Nightly Per-Antenna Quality Summary Notebook¶

Josh Dillon, Last Revised February 2021

This notebooks brings together as much information as possible from ant_metrics, auto_metrics and redcal to help figure out which antennas are working properly and summarizes it in a single giant table. It is meant to be lightweight and re-run as often as necessary over the night, so it can be run when any of those is done and then be updated when another one completes.

Contents:¶

  • Table 1: Overall Array Health
  • Table 2: RTP Per-Antenna Metrics Summary Table
  • Figure 1: Array Plot of Flags and A Priori Statuses
In [1]:
import os
os.environ['HDF5_USE_FILE_LOCKING'] = 'FALSE'
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import pandas as pd
pd.set_option('display.max_rows', 1000)
from hera_qm.metrics_io import load_metric_file
from hera_cal import utils, io, redcal
import glob
import h5py
from copy import deepcopy
from IPython.display import display, HTML
from hera_notebook_templates.utils import status_colors
from hera_mc import mc
from pyuvdata import UVData

%matplotlib inline
%config InlineBackend.figure_format = 'retina'
display(HTML("<style>.container { width:100% !important; }</style>"))
In [2]:
# If you want to run this notebook locally, copy the output of the next cell into the first few lines of this cell.

# JD = "2459122"
# data_path = '/lustre/aoc/projects/hera/H4C/2459122'
# ant_metrics_ext = ".ant_metrics.hdf5"
# redcal_ext = ".maybe_good.omni.calfits"
# nb_outdir = '/lustre/aoc/projects/hera/H4C/h4c_software/H4C_Notebooks/_rtp_summary_'
# good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
# os.environ["JULIANDATE"] = JD
# os.environ["DATA_PATH"] = data_path
# os.environ["ANT_METRICS_EXT"] = ant_metrics_ext
# os.environ["REDCAL_EXT"] = redcal_ext
# os.environ["NB_OUTDIR"] = nb_outdir
# os.environ["GOOD_STATUSES"] = good_statuses
In [3]:
# Use environment variables to figure out path to data
JD = os.environ['JULIANDATE']
data_path = os.environ['DATA_PATH']
ant_metrics_ext = os.environ['ANT_METRICS_EXT']
redcal_ext = os.environ['REDCAL_EXT']
nb_outdir = os.environ['NB_OUTDIR']
good_statuses = os.environ['GOOD_STATUSES']
print(f'JD = "{JD}"')
print(f'data_path = "{data_path}"')
print(f'ant_metrics_ext = "{ant_metrics_ext}"')
print(f'redcal_ext = "{redcal_ext}"')
print(f'nb_outdir = "{nb_outdir}"')
print(f'good_statuses = "{good_statuses}"')
JD = "2460029"
data_path = "/mnt/sn1/2460029"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 3-25-2023
In [5]:
# Per-season options
def ant_to_report_url(ant):
    return f'https://htmlpreview.github.io/?https://github.com/HERA-Team/H6C_Notebooks/blob/main/antenna_report/antenna_{ant}_report.html'

Load Auto Metrics¶

In [6]:
use_auto_metrics = False

# find the auto_metrics file
glob_str = os.path.join(data_path, f'zen.{JD}*.auto_metrics.h5')
auto_metrics_file = sorted(glob.glob(glob_str))

# if it exists, load and extract relevant information
if len(auto_metrics_file) > 0:
    auto_metrics_file = auto_metrics_file[0]
    print(f'Found auto_metrics results file at {auto_metrics_file}.')
    
    auto_metrics = load_metric_file(auto_metrics_file)
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
    auto_ex_ants = auto_metrics['ex_ants']['r2_ex_ants']
    
    use_auto_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping auto_metrics.')
Found auto_metrics results file at /mnt/sn1/2460029/zen.2460029.21307.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

# get a list of all ant_metrics files
glob_str = os.path.join(data_path, f'zen.{JD}.?????.sum{ant_metrics_ext}')
ant_metrics_files = sorted(glob.glob(glob_str))

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1648 ant_metrics files matching glob /mnt/sn1/2460029/zen.2460029.?????.sum.ant_metrics.hdf5

Load chi^2 info from redcal¶

In [8]:
use_redcal = False
glob_str = os.path.join(data_path, f'zen.{JD}.?????.sum{redcal_ext}')

redcal_files = sorted(glob.glob(glob_str))
if len(redcal_files) > 0:
    print(f'Found {len(redcal_files)} ant_metrics files matching glob {glob_str}')
    post_redcal_ant_flags_dict = {}
    flagged_by_redcal_dict = {}
    cspa_med_dict = {}
    for cal in redcal_files:
        hc = io.HERACal(cal)
        _, flags, cspa, chisq = hc.read()
        cspa_med_dict[cal] = {ant: np.nanmedian(cspa[ant], axis=1) for ant in cspa}

        post_redcal_ant_flags_dict[cal] = {ant: np.all(flags[ant]) for ant in flags}
        # check history to distinguish antennas flagged going into redcal from ones flagged during redcal
        tossed_antenna_lines =  hc.history.replace('\n','').split('Throwing out antenna ')[1:]
        flagged_by_redcal_dict[cal] = sorted([int(line.split(' ')[0]) for line in tossed_antenna_lines])
        
    use_redcal = True
else:
    print(f'No files found matching glob {glob_str}. Skipping redcal chisq.')
No files found matching glob /mnt/sn1/2460029/zen.2460029.?????.sum.known_good.omni.calfits. Skipping redcal chisq.

Figure out some general properties¶

In [9]:
# Parse some general array properties, taking into account the fact that we might be missing some of the metrics
ants = []
pols = []
antpol_pairs = []

if use_auto_metrics:
    ants = sorted(set(bl[0] for bl in auto_metrics['modzs']['r2_shape_modzs']))
    pols = sorted(set(bl[2] for bl in auto_metrics['modzs']['r2_shape_modzs']))
if use_ant_metrics:
    antpol_pairs = sorted(set([antpol for dms in ant_metrics_dead_metrics.values() for antpol in dms.keys()]))
    antpols = sorted(set(antpol[1] for antpol in antpol_pairs))
    ants = sorted(set(antpol[0] for antpol in antpol_pairs) | set(ants))
    pols = sorted(set(utils.join_pol(ap, ap) for ap in antpols) | set(pols))
if use_redcal:
    antpol_pairs = sorted(set([ant for cspa in cspa_med_dict.values() for ant in cspa.keys()]) | set(antpol_pairs))
    antpols = sorted(set(antpol[1] for antpol in antpol_pairs))
    ants = sorted(set(antpol[0] for antpol in antpol_pairs) | set(ants))
    pols = sorted(set(utils.join_pol(ap, ap) for ap in antpols) | set(pols))

# Figure out remaining antennas not in data and also LST range
data_files = sorted(glob.glob(os.path.join(data_path, 'zen.*.sum.uvh5')))
hd = io.HERAData(data_files[0])
unused_ants = [ant for ant in hd.antpos if ant not in ants]    
hd_last = io.HERAData(data_files[-1])

Load a priori antenna statuses and node numbers¶

In [10]:
# try to load a priori antenna statusesm but fail gracefully if this doesn't work.
a_priori_statuses = {ant: 'Not Found' for ant in ants}
nodes = {ant: np.nan for ant in ants + unused_ants}
try:
    from hera_mc import cm_hookup

    # get node numbers
    hookup = cm_hookup.get_hookup('default')
    for ant_name in hookup:
        ant = int("".join(filter(str.isdigit, ant_name)))
        if ant in nodes:
            if hookup[ant_name].get_part_from_type('node')['E<ground'] is not None:
                nodes[ant] = int(hookup[ant_name].get_part_from_type('node')['E<ground'][1:])
    
    # get apriori antenna status
    for ant_name, data in hookup.items():
        ant = int("".join(filter(str.isdigit, ant_name)))
        if ant in a_priori_statuses:
            a_priori_statuses[ant] = data.apriori

except Exception as err:
    print(f'Could not load node numbers and a priori antenna statuses.\nEncountered {type(err)} with message: {err}')

Summarize auto metrics¶

In [11]:
if use_auto_metrics:
    # Parse modzs
    modzs_to_check = {'Shape': 'r2_shape_modzs', 'Power': 'r2_power_modzs', 
                      'Temporal Variability': 'r2_temp_var_modzs', 'Temporal Discontinuties': 'r2_temp_diff_modzs'}
    worst_metrics = []
    worst_zs = []
    all_modzs = {}
    binary_flags = {rationale: [] for rationale in modzs_to_check}

    for ant in ants:
        # parse modzs and figure out flag counts
        modzs = {f'{pol} {rationale}': auto_metrics['modzs'][dict_name][(ant, ant, pol)] 
                 for rationale, dict_name in modzs_to_check.items() for pol in pols}
        for pol in pols:
            for rationale, dict_name in modzs_to_check.items():
                binary_flags[rationale].append(auto_metrics['modzs'][dict_name][(ant, ant, pol)] > mean_round_modz_cut)

        # parse out all metrics for dataframe
        for k in modzs:
            col_label = k + ' Modified Z-Score'
            if col_label in all_modzs:
                all_modzs[col_label].append(modzs[k])
            else:
                all_modzs[col_label] = [modzs[k]]
                
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
else:
    mean_round_modz_cut = 0

Summarize ant metrics¶

In [12]:
if use_ant_metrics:
    a_priori_flag_frac = {ant: np.mean([ant in apxa for apxa in ant_metrics_apriori_exants.values()]) for ant in ants}
    dead_ant_frac = {ap: {ant: np.mean([(ant, ap) in das for das in ant_metrics_dead_ants_dict.values()])
                                 for ant in ants} for ap in antpols}
    crossed_ant_frac = {ant: np.mean([np.any([(ant, ap) in cas for ap in antpols])
                                      for cas in ant_metrics_crossed_ants_dict.values()]) for ant in ants}
    ant_metrics_xants_frac_by_antpol = {antpol: np.mean([antpol in amx for amx in ant_metrics_xants_dict.values()]) for antpol in antpol_pairs}
    ant_metrics_xants_frac_by_ant = {ant: np.mean([np.any([(ant, ap) in amx for ap in antpols])
                                     for amx in ant_metrics_xants_dict.values()]) for ant in ants}
    average_dead_metrics = {ap: {ant: np.nanmean([dm.get((ant, ap), np.nan) for dm in ant_metrics_dead_metrics.values()]) 
                                 for ant in ants} for ap in antpols}
    average_crossed_metrics = {ant: np.nanmean([cm.get((ant, ap), np.nan) for ap in antpols 
                                                for cm in ant_metrics_crossed_metrics.values()]) for ant in ants}
else:
    dead_cut = 0.4
    crossed_cut = 0.0

Summarize redcal chi^2 metrics¶

In [13]:
if use_redcal:
    cspa = {ant: np.nanmedian(np.hstack([cspa_med_dict[cal][ant] for cal in redcal_files])) for ant in antpol_pairs}
    redcal_prior_flag_frac = {ant: np.mean([np.any([afd[ant, ap] and not ant in flagged_by_redcal_dict[cal] for ap in antpols])
                                            for cal, afd in post_redcal_ant_flags_dict.items()]) for ant in ants}
    redcal_flagged_frac = {ant: np.mean([ant in fbr for fbr in flagged_by_redcal_dict.values()]) for ant in ants}

Get FEM switch states¶

In [14]:
HHautos = sorted(glob.glob(f"{data_path}/zen.{JD}.*.sum.autos.uvh5"))
diffautos = sorted(glob.glob(f"{data_path}/zen.{JD}.*.diff.autos.uvh5"))

try:
    db = mc.connect_to_mc_db(None)
    session = db.sessionmaker()
    startJD = float(HHautos[0].split('zen.')[1].split('.sum')[0])
    stopJD = float(HHautos[-1].split('zen.')[1].split('.sum')[0])
    start_time = Time(startJD,format='jd')
    stop_time = Time(stopJD,format='jd')

    # get initial state by looking for commands up to 3 hours before the starttime
    # this logic can be improved after an upcoming hera_mc PR
    # which will return the most recent command before a particular time.
    search_start_time = start_time - TimeDelta(3*3600, format="sec")
    initial_command_res = session.get_array_signal_source(starttime=search_start_time, stoptime=start_time)
    if len(initial_command_res) == 0:
        initial_source = "Unknown"
    elif len(command_res) == 1:
        initial_source = initial_command_res[0].source
    else:
        # multiple commands
        times = []
        sources = []
        for obj in command_res:
            times.append(obj.time)
            sources.append(obj.source)
        initial_source = sources[np.argmax(times)]
    
    # check for any changes during observing
    command_res = session.get_array_signal_source(starttime=start_time, stoptime=stop_time)
    if len(command_res) == 0:
        # still nothing, set it to None
        obs_source = None
    else:
        obs_source_times = []
        obs_source = []
        for obj in command_res:
            obs_source_times.append(obj.time)
            obs_source.append(obj.source)

    if obs_source is not None:
        command_source = [initial_source] + obs_source
    else:
        command_source = initial_source
    
    res = session.get_antenna_status(starttime=startTime, stoptime=stopTime)
    fem_switches = {}
    right_rep_ant = []
    if len(res) > 0:
        for obj in res:
            if obj.antenna_number not in fem_switches.keys():
                fem_switches[obj.antenna_number] = {}
            fem_switches[obj.antenna_number][obj.antenna_feed_pol] = obj.fem_switch
        for ant, pol_dict in fem_switches.items():
            if pol_dict['e'] == initial_source and pol_dict['n'] == initial_source:
                right_rep_ant.append(ant)
except Exception as e:
    print(e)
    initial_source = None
    command_source = None
    right_rep_ant = []
name 'command_res' is not defined

Find X-engine Failures¶

In [15]:
read_inds = [1, len(HHautos)//2, -2]
x_status = [1,1,1,1,1,1,1,1]
s = UVData()
s.read(HHautos[1])

nants = len(s.get_ants())
freqs = s.freq_array[0]*1e-6
nfreqs = len(freqs)

antCon = {a: None for a in ants}
rightAnts = []
for i in read_inds:
    s = UVData()
    d = UVData()
    s.read(HHautos[i])
    d.read(diffautos[i])
    for pol in [0,1]:
        sm = np.abs(s.data_array[:,0,:,pol])
        df = np.abs(d.data_array[:,0,:,pol])
        sm = np.r_[sm, np.nan + np.zeros((-len(sm) % nants,len(freqs)))]
        sm = np.nanmean(sm.reshape(-1,nants,nfreqs),axis=1)
        df = np.r_[df, np.nan + np.zeros((-len(df) % nants,len(freqs)))]
        df = np.nanmean(df.reshape(-1,nants,nfreqs),axis=1)

        evens = (sm + df)/2
        odds = (sm - df)/2
        rat = np.divide(evens,odds)
        rat = np.nan_to_num(rat)
        for xbox in range(0,8):
            xavg = np.nanmean(rat[:,xbox*192:(xbox+1)*192],axis=1)
            if np.nanmax(xavg)>1.5 or np.nanmin(xavg)<0.5:
                x_status[xbox] = 0
    for ant in ants:
        for pol in ["xx", "yy"]:
            if antCon[ant] is False:
                continue
            spectrum = s.get_data(ant, ant, pol)
            stdev = np.std(spectrum)
            med = np.median(np.abs(spectrum))
            if (initial_source == 'digital_noise_same' or initial_source == 'digital_noise_different') and med < 10:
                antCon[ant] = True
            elif (initial_source == "load" or initial_source == 'noise') and 80000 < stdev <= 4000000 and antCon[ant] is not False:
                antCon[ant] = True
            elif initial_source == "antenna" and stdev > 500000 and med > 950000 and antCon[ant] is not False:
                antCon[ant] = True
            else:
                antCon[ant] = False
            if np.min(np.abs(spectrum)) < 100000:
                antCon[ant] = False
for ant in ants:
    if antCon[ant] is True:
        rightAnts.append(ant)
            
x_status_str = ''
for i,x in enumerate(x_status):
    if x==0:
        x_status_str += '\u274C '
    else:
        x_status_str += '\u2705 '

Build Overall Health DataFrame¶

In [16]:
def comma_sep_paragraph(vals, chars_per_line=40):
    outstrs = []
    for val in vals:
        if (len(outstrs) == 0) or (len(outstrs[-1]) > chars_per_line):
            outstrs.append(str(val))
        else:
            outstrs[-1] += ', ' + str(val)
    return ',<br>'.join(outstrs)
In [17]:
# Time data
to_show = {'JD': [JD]}
to_show['Date'] = f'{utc.month}-{utc.day}-{utc.year}'
to_show['LST Range'] = f'{hd.lsts[0] * 12 / np.pi:.3f} -- {hd_last.lsts[-1] * 12 / np.pi:.3f} hours'

# X-engine status
to_show['X-Engine Status'] = x_status_str

# Files
to_show['Number of Files'] = len(data_files)

# Antenna Calculations
to_show['Total Number of Antennas'] = len(ants)

to_show[' '] = ''
to_show['OPERATIONAL STATUS SUMMARY'] = ''

status_count = {status: 0 for status in status_colors}
for ant, status in a_priori_statuses.items():
    if status in status_count:
        status_count[status] = status_count[status] + 1
    else:
        status_count[status] = 1
to_show['Antenna A Priori Status Count'] = '<br>'.join([f'{status}: {status_count[status]}' for status in status_colors if status in status_count and status_count[status] > 0])

to_show['Commanded Signal Source'] = ', '.join(command_source if hasattr(command_source, '__iter__') else [str(command_source)])
to_show['Antennas in Commanded State (reported)'] = f'{len(right_rep_ant)} / {len(ants)} ({len(right_rep_ant) / len(ants):.1%})'
to_show['Antennas in Commanded State (observed)'] = f'{len(rightAnts)} / {len(ants)} ({len(rightAnts) / len(ants):.1%})'

if use_ant_metrics:
    to_show['Cross-Polarized Antennas'] = ', '.join([str(ant) for ant in ants if (np.max([dead_ant_frac[ap][ant] for ap in antpols]) + crossed_ant_frac[ant] == 1) 
                                                                                 and (crossed_ant_frac[ant] > .5)])

# Node calculations
nodes_used = set([nodes[ant] for ant in ants if np.isfinite(nodes[ant])])
to_show['Total Number of Nodes'] = len(nodes_used)
if use_ant_metrics:
    node_off = {node: True for node in nodes_used}
    not_correlating = {node: True for node in nodes_used}
    for ant in ants:
        for ap in antpols:
            if np.isfinite(nodes[ant]):
                if np.isfinite(average_dead_metrics[ap][ant]):
                    node_off[nodes[ant]] = False
                if dead_ant_frac[ap][ant] < 1:
                    not_correlating[nodes[ant]] = False
    to_show['Nodes Registering 0s'] = ', '.join([f'N{n:02}' for n in sorted([node for node in node_off if node_off[node]])])
    to_show['Nodes Not Correlating'] = ', '.join([f'N{n:02}' for n in sorted([node for node in not_correlating if not_correlating[node] and not node_off[node]])])

# Pipeline calculations    
to_show['  '] = ''
to_show['NIGHTLY ANALYSIS SUMMARY'] = ''
    
all_flagged_ants = []
if use_ant_metrics:
    to_show['Ant Metrics Done?'] = '\u2705'
    ant_metrics_flagged_ants = [ant for ant in ants if ant_metrics_xants_frac_by_ant[ant] > 0]
    all_flagged_ants.extend(ant_metrics_flagged_ants)
    to_show['Ant Metrics Flagged Antennas'] = f'{len(ant_metrics_flagged_ants)} / {len(ants)} ({len(ant_metrics_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Ant Metrics Done?'] = '\u274C'
if use_auto_metrics:
    to_show['Auto Metrics Done?'] = '\u2705'
    auto_metrics_flagged_ants = [ant for ant in ants if ant in auto_ex_ants]
    all_flagged_ants.extend(auto_metrics_flagged_ants)    
    to_show['Auto Metrics Flagged Antennas'] = f'{len(auto_metrics_flagged_ants)} / {len(ants)} ({len(auto_metrics_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Auto Metrics Done?'] = '\u274C'
if use_redcal:
    to_show['Redcal Done?'] = '\u2705'    
    redcal_flagged_ants = [ant for ant in ants if redcal_flagged_frac[ant] > 0]
    all_flagged_ants.extend(redcal_flagged_ants)    
    to_show['Redcal Flagged Antennas'] = f'{len(redcal_flagged_ants)} / {len(ants)} ({len(redcal_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Redcal Done?'] = '\u274C' 
to_show['Never Flagged Antennas'] = f'{len(ants) - len(set(all_flagged_ants))} / {len(ants)} ({(len(ants) - len(set(all_flagged_ants))) / len(ants):.1%})'

# Count bad antennas with good statuses and vice versa
n_apriori_good = len([ant for ant in ants if a_priori_statuses[ant] in good_statuses.split(',')])
apriori_good_flagged = []
aprior_bad_unflagged = []
for ant in ants:
    if ant in set(all_flagged_ants) and a_priori_statuses[ant] in good_statuses.split(','):
        apriori_good_flagged.append(ant)
    elif ant not in set(all_flagged_ants) and a_priori_statuses[ant] not in good_statuses.split(','):
        aprior_bad_unflagged.append(ant)
to_show['A Priori Good Antennas Flagged'] = f'{len(apriori_good_flagged)} / {n_apriori_good} total a priori good antennas:<br>' + \
                                            comma_sep_paragraph(apriori_good_flagged)
to_show['A Priori Bad Antennas Not Flagged'] = f'{len(aprior_bad_unflagged)} / {len(ants) - n_apriori_good} total a priori bad antennas:<br>' + \
                                            comma_sep_paragraph(aprior_bad_unflagged)

# Apply Styling
df = pd.DataFrame(to_show)
divider_cols = [df.columns.get_loc(col) for col in ['NIGHTLY ANALYSIS SUMMARY', 'OPERATIONAL STATUS SUMMARY']]
try:
    to_red_columns = [df.columns.get_loc(col) for col in ['Cross-Polarized Antennas', 'Nodes Registering 0s', 
                                                          'Nodes Not Correlating', 'A Priori Good Antennas Flagged']]
except:
    to_red_columns = []
def red_specific_cells(x):
    df1 = pd.DataFrame('', index=x.index, columns=x.columns)
    for col in to_red_columns:
        df1.iloc[col] = 'color: red'
    return df1

df = df.T
table = df.style.hide_columns().apply(red_specific_cells, axis=None)
for col in divider_cols:
    table = table.set_table_styles([{"selector":f"tr:nth-child({col+1})", "props": [("background-color", "black"), ("color", "white")]}], overwrite=False)

Table 1: Overall Array Health¶

In [18]:
HTML(table.render())
Out[18]:
JD 2460029
Date 3-25-2023
LST Range 6.734 -- 16.691 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1648
Total Number of Antennas 199
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 94
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 199 (0.0%)
Antennas in Commanded State (observed) 0 / 199 (0.0%)
Cross-Polarized Antennas 40, 42, 70, 72, 112
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 68 / 199 (34.2%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 131 / 199 (65.8%)
Redcal Done? ❌
Never Flagged Antennas 66 / 199 (33.2%)
A Priori Good Antennas Flagged 68 / 94 total a priori good antennas:
3, 5, 7, 15, 16, 17, 19, 20, 30, 31, 37, 38,
40, 42, 45, 53, 54, 55, 56, 65, 66, 67, 70,
71, 72, 81, 83, 86, 93, 94, 101, 103, 106,
107, 109, 111, 112, 118, 121, 122, 123, 124,
127, 136, 140, 147, 148, 149, 150, 151, 158,
161, 165, 167, 168, 169, 170, 173, 181, 182,
184, 187, 189, 190, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 40 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 50, 57, 61, 62,
64, 73, 74, 89, 95, 115, 120, 125, 132, 133,
139, 185, 206, 220, 221, 222, 228, 229, 237,
238, 239, 240, 241, 245, 261, 320, 324, 325,
333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2460029.csv

Build DataFrame¶

In [20]:
# build dataframe
to_show = {'Ant': [f'<a href="{ant_to_report_url(ant)}" target="_blank">{ant}</a>' for ant in ants],
           'Node': [f'N{nodes[ant]:02}' for ant in ants], 
           'A Priori Status': [a_priori_statuses[ant] for ant in ants]}
           #'Worst Metric': worst_metrics, 'Worst Modified Z-Score': worst_zs}
df = pd.DataFrame(to_show)

# create bar chart columns for flagging percentages:
bar_cols = {}
if use_auto_metrics:
    bar_cols['Auto Metrics Flags'] = [float(ant in auto_ex_ants) for ant in ants]
if use_ant_metrics:
    if np.sum(list(a_priori_flag_frac.values())) > 0:  # only include this col if there are any a priori flags
        bar_cols['A Priori Flag Fraction in Ant Metrics'] = [a_priori_flag_frac[ant] for ant in ants]
    for ap in antpols:
        bar_cols[f'Dead Fraction in Ant Metrics ({ap})'] = [dead_ant_frac[ap][ant] for ant in ants]
    bar_cols['Crossed Fraction in Ant Metrics'] = [crossed_ant_frac[ant] for ant in ants]
if use_redcal:
    bar_cols['Flag Fraction Before Redcal'] = [redcal_prior_flag_frac[ant] for ant in ants]
    bar_cols['Flagged By Redcal chi^2 Fraction'] = [redcal_flagged_frac[ant] for ant in ants]  
for col in bar_cols:
    df[col] = bar_cols[col]

# add auto_metrics
if use_auto_metrics:
    for label, modz in all_modzs.items():
        df[label] = modz
z_score_cols = [col for col in df.columns if 'Modified Z-Score' in col]        
        
# add ant_metrics
ant_metrics_cols = {}
if use_ant_metrics:
    for ap in antpols:
        ant_metrics_cols[f'Average Dead Ant Metric ({ap})'] = [average_dead_metrics[ap][ant] for ant in ants]
    ant_metrics_cols['Average Crossed Ant Metric'] = [average_crossed_metrics[ant] for ant in ants]
    for col in ant_metrics_cols:
        df[col] = ant_metrics_cols[col]   

# add redcal chisq
redcal_cols = []
if use_redcal:
    for ap in antpols:
        col_title = f'Median chi^2 Per Antenna ({ap})'
        df[col_title] = [cspa[ant, ap] for ant in ants]
        redcal_cols.append(col_title)

# sort by node number and then by antenna number within nodes
df.sort_values(['Node', 'Ant'], ascending=True)

# style dataframe
table = df.style.hide_index()\
          .applymap(lambda val: f'background-color: {status_colors[val]}' if val in status_colors else '', subset=['A Priori Status']) \
          .background_gradient(cmap='viridis', vmax=mean_round_modz_cut * 3, vmin=0, axis=None, subset=z_score_cols) \
          .background_gradient(cmap='bwr_r', vmin=dead_cut-.25, vmax=dead_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .background_gradient(cmap='bwr_r', vmin=crossed_cut-.25, vmax=crossed_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .background_gradient(cmap='plasma', vmax=4, vmin=1, axis=None, subset=redcal_cols) \
          .applymap(lambda val: 'font-weight: bold' if val < dead_cut else '', subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val < crossed_cut else '', subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .applymap(lambda val: 'color: red' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .bar(subset=list(bar_cols.keys()), vmin=0, vmax=1) \
          .format({col: '{:,.4f}'.format for col in z_score_cols}) \
          .format({col: '{:,.4f}'.format for col in ant_metrics_cols}) \
          .format({col: '{:,.2%}'.format for col in bar_cols}) \
          .applymap(lambda val: 'font-weight: bold', subset=['Ant']) \
          .set_table_styles([dict(selector="th",props=[('max-width', f'70pt')])])

Table 2: RTP Per-Antenna Metrics Summary Table¶

This admittedly very busy table incorporates summary information about all antennas in the array. Its columns depend on what information is available when the notebook is run (i.e. whether auto_metrics, ant_metrics, and/or redcal is done). These can be divided into 5 sections:

Basic Antenna Info: antenna number, node, and its a priori status.

Flag Fractions: Fraction of the night that an antenna was flagged for various reasons. Note that auto_metrics flags antennas for the whole night, so it'll be 0% or 100%.

auto_metrics Details: If auto_metrics is included, this section shows the modified Z-score signifying how much of an outlier each antenna and polarization is in each of four categories: bandpass shape, overall power, temporal variability, and temporal discontinuities. Bold red text indicates that this is a reason for flagging the antenna. It is reproduced from the auto_metrics_inspect.ipynb nightly notebook, so check that out for more details on the precise metrics.

ant_metrics Details: If ant_metrics is included, this section shows the average correlation-based metrics for antennas over the whole night. Low "dead ant" metrics (nominally below 0.4) indicate antennas not correlating with the rest of the array. Negative "crossed ant" metrics indicate antennas that show stronger correlations in their cross-pols than their same-pols, indicating that the two polarizations are probably swapped. Bold text indicates that the average is below the threshold for flagging.

redcal chi^2 Details: If redcal is included, this shows the median chi^2 per antenna. This would be 1 in an ideal array. Antennas are thrown out when they they are outliers in their median chi^2, usually greater than 4-sigma outliers in modified Z-score.

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.428027 12.684005 0.267049 10.087767 0.633215 3.809426 -0.395381 1.893626 0.534817 0.042816 0.460437
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.364823 21.379214 -0.899173 -0.407465 -0.780125 0.823722 -1.033127 4.916767 0.548499 0.422823 0.342943
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.216576 12.505702 9.637164 9.860492 3.414649 3.851845 0.647596 0.738734 0.038443 0.032291 0.002284
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.048184 -0.065483 -0.644253 0.086850 -0.171512 0.979684 14.729400 11.676540 0.558712 0.570052 0.339014
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.135655 3.319898 1.998610 2.105446 1.521182 1.962904 -2.723624 -1.924465 0.534360 0.547282 0.323436
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.640184 -0.394224 3.124453 -0.538876 0.691424 0.106905 3.401396 -0.310282 0.539668 0.566221 0.340278
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.907414 -1.439880 -0.070195 -0.803216 -1.156690 -0.121489 1.844748 -0.153565 0.550991 0.557063 0.334939
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 23.521829 0.375500 0.904980 0.225440 0.810538 0.509624 0.698830 2.191802 0.423589 0.562354 0.348363
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.253338 13.094482 -0.283861 10.086681 0.492594 3.799019 1.006961 2.944065 0.563826 0.041438 0.475676
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.158388 4.016311 0.942275 8.430982 1.078555 0.357172 -0.043453 3.671977 0.566790 0.413556 0.393162
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.422866 6.636874 9.659589 0.904908 3.404162 1.013301 0.876781 46.176728 0.036320 0.365795 0.288698
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.178701 -0.201582 -0.300491 0.025773 -0.019416 5.907346 -0.365342 2.510935 0.574867 0.586373 0.339684
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.548398 -0.953546 1.433779 -0.403848 5.302224 0.173596 1.120777 -0.248106 0.564502 0.583455 0.336697
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.616761 0.088264 -0.011429 0.249587 0.396719 0.669970 0.100982 0.491010 0.555461 0.561725 0.328256
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.130016 -0.688841 -0.442433 -0.608858 -1.137994 0.222827 -0.829335 -0.899880 0.530104 0.540396 0.330339
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.424733 28.542609 9.186694 5.487345 2.614100 2.413586 14.077356 70.341374 0.084076 0.080394 -0.027338
28 N01 RF_maintenance 100.00% 100.00% 1.33% 0.00% 9.720480 16.518776 9.569013 3.585324 3.411759 0.609779 1.794526 35.012988 0.031290 0.257286 0.192491
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.247986 -0.556977 -0.624565 -0.438674 -0.059139 0.282000 0.801141 1.054588 0.581325 0.588950 0.342974
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.047625 -0.795382 0.238298 -0.866416 0.708389 -0.229175 6.243454 0.122649 0.577692 0.595783 0.342044
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.756182 -0.667487 1.224989 1.882845 1.162388 1.693440 0.448869 17.402394 0.584522 0.588095 0.332699
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 18.405928 19.842946 -0.247891 -0.028554 0.290320 0.295411 23.566222 6.615474 0.474909 0.506700 0.214505
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.206099 13.275285 5.179161 5.306499 3.369506 3.812236 1.000384 2.790729 0.034656 0.053633 0.011778
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.283536 -1.075139 0.515181 -1.115205 -0.308936 -0.921200 -2.214265 -0.707835 0.538945 0.539779 0.328228
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.456667 6.812740 1.186814 0.818788 0.994609 1.386872 0.210795 0.926279 0.535735 0.538492 0.354276
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.661735 20.813836 -0.500951 11.737401 -1.222387 3.822920 -1.420100 3.512815 0.533295 0.034198 0.425211
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.437532 1.494487 -0.170831 0.010870 0.409918 -0.552027 3.822581 11.657860 0.561307 0.542544 0.352155
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.528263 1.041900 0.112004 -0.517698 0.587957 0.555820 15.667364 4.173509 0.238963 0.230769 -0.270698
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.677293 1.343037 1.338695 1.854774 1.468066 -0.047021 -0.124031 0.209948 0.575241 0.584530 0.343307
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.030060 1.890241 -0.242413 -0.802033 0.789953 0.385491 -0.372490 0.094657 0.260815 0.247268 -0.270035
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.020508 -0.003122 -0.663929 0.781615 1.978441 0.898599 0.239639 0.791653 0.588697 0.597407 0.334747
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.752263 0.566649 -0.835653 0.454737 -0.582256 0.538540 -0.884275 -0.102255 0.588934 0.604674 0.337012
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -0.051636 2.743584 0.892448 0.763509 0.387787 1.502881 0.256443 11.111717 0.576189 0.588469 0.329581
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.620839 -0.335465 0.042802 -0.982007 0.087465 -0.425779 -0.383486 -0.660268 0.579533 0.599676 0.345607
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.313400 12.954232 5.094529 4.996352 3.369702 3.791146 2.754707 0.653467 0.031637 0.056965 0.016231
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.406089 0.680947 -0.690201 0.807932 -1.228207 0.542310 -1.252021 -2.193264 0.539642 0.557184 0.333772
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.861454 0.191486 0.018444 -0.194368 -1.031564 0.132258 -0.232254 0.688713 0.509765 0.536047 0.332329
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.483301 1.028043 0.493385 1.640592 0.453049 1.578313 -0.145510 0.415422 0.535645 0.537507 0.351861
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.310876 1.416810 0.281309 -0.500719 0.814487 0.371760 85.653585 0.870807 0.546775 0.555047 0.351905
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.021981 5.236914 0.624662 0.294232 0.919183 0.974607 3.065298 0.559249 0.562749 0.568408 0.350605
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.135339 1.433238 -0.034083 -0.380372 1.200344 -0.878952 11.888868 3.711316 0.568121 0.582227 0.353125
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 6.072110 3.536041 1.693330 -0.357458 1.613460 1.742980 -1.932562 -0.114830 0.306767 0.349825 0.144684
55 N04 digital_ok 100.00% 10.62% 100.00% 0.00% 0.194150 46.327228 0.379882 6.720709 -0.316393 3.913016 2.238978 0.374877 0.254634 0.043224 0.103580
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.694351 1.193706 -0.999013 2.151732 -0.886544 3.467584 -1.142361 5.510759 0.590425 0.595148 0.331557
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.114410 2.108034 -1.035352 -0.094781 -0.303398 0.593658 -0.297260 1.424089 0.596582 0.600529 0.328935
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.081083 12.121264 9.601161 10.014455 3.361919 3.803152 1.441734 1.335785 0.038203 0.037578 0.001720
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.175926 0.586614 9.636691 1.013555 3.308276 2.005220 0.577328 2.901143 0.050338 0.595292 0.441830
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.805125 12.099141 0.135393 10.044070 0.384366 3.787527 0.379717 2.950379 0.576998 0.077377 0.451349
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.551748 -0.976655 0.841334 -0.690866 -0.325874 -0.665997 -0.348832 1.322053 0.522376 0.563906 0.336991
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.503885 0.913211 0.354350 0.564990 0.468024 -0.327597 0.763042 -1.742474 0.513855 0.558572 0.337113
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.400742 12.561834 -0.913335 5.348229 -1.111859 3.845900 -0.878798 3.073228 0.541519 0.047736 0.412535
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.671689 -0.628969 -1.099435 -0.254903 -0.673866 -0.810616 0.277744 0.215568 0.530525 0.524901 0.326420
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 22.063081 20.552884 12.204003 12.111479 3.412155 3.862281 4.982948 6.687309 0.023322 0.033506 0.009962
66 N03 digital_ok 100.00% 29.61% 100.00% 0.00% 2.372452 21.262670 1.600681 12.256189 0.953712 3.806119 -2.415930 7.422625 0.211144 0.052799 0.100410
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.697719 -0.358752 -0.334722 1.309634 -0.260047 1.277491 4.995839 1.643121 0.565704 0.570102 0.349858
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 23.593080 1.079470 12.281152 0.796440 3.326996 -0.056494 5.769266 -1.605150 0.036912 0.578499 0.443929
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.688042 2.094210 1.424411 -0.727220 0.505653 0.502397 3.870024 0.153766 0.581745 0.594332 0.340564
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% 0.003122 1.662746 1.222383 2.624498 1.388835 1.392679 3.434915 0.863086 0.262281 0.246273 -0.267660
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.232400 -0.241964 -0.351200 0.294049 0.071945 -0.003037 -0.644784 1.500327 0.593323 0.610167 0.335303
72 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.158119 0.984226 2.417896 1.065103 1.840317 1.150211 16.108852 1.067029 0.269971 0.260474 -0.268419
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.643598 1.425251 -0.645347 1.025560 0.285435 0.243256 -0.466869 0.317421 0.600241 0.610254 0.333780
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.929888 0.008816 -0.463811 -0.189227 -1.040134 0.555640 -1.651004 0.737772 0.595397 0.611665 0.338537
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 42.524009 12.637053 0.394504 -0.566648 1.345856 0.017404 1.676455 0.127986 0.333768 0.480777 0.260778
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 23.353716 0.610367 -0.144883 0.712663 0.304646 0.062550 3.656269 -0.970547 0.392131 0.565115 0.330501
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.386920 12.767422 -0.552112 5.331684 -0.746532 3.778004 0.012726 0.127132 0.534614 0.041107 0.415149
80 N11 not_connected 100.00% 0.00% 98.97% 0.00% 0.085233 13.134078 -0.229875 5.186261 -0.966673 2.772777 -1.444542 1.569926 0.534072 0.083407 0.411257
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 43.890570 37.290236 24.902153 19.274794 7.773547 4.430226 585.161882 297.490304 0.016865 0.016813 0.000817
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 32.160420 40.229716 23.869562 20.447171 8.524191 6.071115 561.431748 431.684623 0.016294 0.016570 0.000758
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 27.561210 43.406458 20.743399 19.143069 5.423792 6.917631 420.298578 374.619228 0.016488 0.016719 0.000702
84 N08 RF_maintenance 100.00% 70.87% 100.00% 0.00% 16.436354 22.686578 11.843537 12.398593 2.085340 3.774370 4.248008 5.358930 0.198451 0.037934 0.126793
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.745592 0.310568 -0.210498 -0.879110 0.131610 -0.012122 -1.683626 -0.429087 0.589991 0.595380 0.338346
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.677988 0.931993 0.702640 0.206322 -0.130734 0.942276 0.315244 20.285038 0.588607 0.602975 0.331049
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.046800 5.907260 1.206067 0.224326 5.418301 1.347364 20.838768 3.072163 0.532867 0.617879 0.324633
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.806632 0.699072 0.834191 1.289143 0.335189 0.080349 3.912410 1.151365 0.593564 0.605621 0.325243
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.269309 0.469187 0.843028 1.127204 0.315618 0.673380 -0.454270 0.033824 0.590561 0.610141 0.331453
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.196618 -0.644566 0.124690 -1.056190 1.899864 9.168386 0.317198 3.361271 0.578408 0.611502 0.336136
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.052485 0.184045 0.974736 0.705290 0.732244 0.731762 0.397507 0.139818 0.580497 0.603207 0.341207
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.635403 0.104099 9.618532 0.412306 3.415873 0.968516 0.394807 1.125071 0.037126 0.596097 0.393165
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.947509 12.290649 9.702285 10.094172 3.343755 3.787106 2.705384 2.345111 0.031001 0.025009 0.003097
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.641529 12.565846 9.799208 9.935768 3.374322 3.812264 1.220823 1.025804 0.025380 0.025327 0.001031
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.496272 1.407361 -0.912363 0.293979 1.166256 0.768156 -1.117022 -1.034789 0.388232 0.386617 0.164427
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.351962 21.152961 0.607166 -0.409931 -0.442793 0.342286 -1.303955 7.812885 0.545349 0.446739 0.325303
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.509653 2.485457 -1.026760 0.704235 -0.584923 -0.855572 -0.560515 8.905065 0.529615 0.511678 0.330439
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.433509 7.005877 0.305624 1.149037 0.707754 1.392627 0.226786 1.443902 0.570476 0.579294 0.341317
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.915969 0.430672 -0.927101 -0.835660 -0.175195 0.258099 -1.267968 5.632706 0.587569 0.595634 0.337240
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.547594 4.075579 2.098007 -0.961288 1.623733 0.086398 -3.024885 3.444467 0.572837 0.605487 0.336677
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.730703 50.212877 0.817948 6.419198 0.861088 0.253662 1.395052 3.244773 0.595800 0.583438 0.325883
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.178833 0.500432 0.512746 1.198854 0.878088 0.664428 -0.060549 0.408771 0.598130 0.607409 0.325449
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.621928 0.991278 1.835340 0.202996 5.984544 0.021089 0.583944 0.844617 0.584164 0.613252 0.332594
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 6.724630 2.834900 0.495624 -0.088157 0.080212 0.142226 11.219713 9.440951 0.586299 0.610327 0.323652
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.722927 35.743418 9.645926 1.219405 3.378237 1.687506 1.943609 1.566911 0.035674 0.298650 0.151004
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.420991 12.149563 9.681579 9.837857 3.391644 3.848801 0.530558 2.176303 0.070684 0.037343 0.022688
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 19.541398 -0.241589 0.363015 -0.086531 3.707258 0.519963 65.116043 -0.185671 0.495677 0.591142 0.332097
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 25.177292 12.101455 1.457506 9.913305 0.216953 3.829063 6.627566 2.637930 0.451425 0.064658 0.301079
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% 0.551582 6.110005 1.713125 8.852867 1.742686 1.566676 0.698724 1.067710 0.236942 0.145025 -0.215597
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.382631 13.317870 4.860127 5.325017 3.329692 3.771967 1.982092 1.142453 0.033907 0.031099 0.001742
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 12.169556 0.657945 4.996109 -0.306025 3.317074 -0.954275 0.267113 0.745449 0.047595 0.542792 0.408822
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.425045 -0.913046 -0.914782 -0.173113 -0.900316 -0.940215 -0.292527 -0.765078 0.512884 0.532093 0.338464
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 29.157363 44.648821 21.482581 24.934885 7.520641 19.453559 395.466358 800.367558 0.017059 0.016226 0.001056
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 26.318907 50.413096 20.530338 26.772510 4.751248 13.526901 403.018390 953.611039 0.022694 0.019632 0.002576
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.281170 1.057378 2.845358 -0.618757 0.975694 0.566390 1.266393 -0.310545 0.568855 0.593550 0.339214
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.280349 2.786275 -1.021952 5.660411 -0.430072 -0.223597 2.716551 20.700451 0.596195 0.579141 0.327991
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.415276 4.793565 -0.347327 -0.851103 0.508150 0.137326 -0.581477 -0.784185 0.603798 0.612717 0.330594
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.545384 7.296512 1.105119 1.196338 0.987696 0.947842 -0.053996 0.793245 0.605378 0.615402 0.331987
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 9.768847 0.215618 9.849370 0.845789 3.328784 0.944071 0.639103 1.773287 0.043375 0.617678 0.410587
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.530058 -0.910191 2.008577 1.327670 1.193954 0.064704 0.126862 0.182556 0.590975 0.606368 0.332562
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.013835 1.570190 0.359208 1.081618 0.993711 1.371279 5.834999 0.338514 0.574080 0.606970 0.337874
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 9.305477 0.714302 9.607172 2.522093 3.408297 0.349053 0.342849 4.225421 0.033753 0.592745 0.383764
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.089360 -1.010177 -0.541708 -0.288780 0.016343 -0.947671 1.122161 2.883363 0.581237 0.593380 0.351859
131 N11 not_connected 100.00% 0.00% 52.00% 0.00% -1.348489 12.007744 -0.494007 5.264156 -0.977102 3.093200 -1.105680 0.447985 0.541554 0.214511 0.382052
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.295651 -0.168750 -0.734098 -0.832548 -0.986742 -0.545149 0.001959 -0.236991 0.534165 0.534323 0.331727
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.428073 -1.387774 -0.764899 -0.678139 -0.675116 -1.114372 -0.715210 0.371424 0.520381 0.537597 0.340605
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.869198 13.579933 4.977135 5.307190 3.336921 3.821482 0.477296 1.132127 0.041651 0.034741 0.003791
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.591736 -1.338242 -0.654907 -1.082545 0.004732 0.086678 12.613374 0.279118 0.511824 0.534505 0.355513
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 8.809183 1.477957 9.359852 -0.225235 3.411362 0.475020 1.568329 9.023977 0.042751 0.527933 0.384027
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 36.384041 50.632256 26.725801 23.291095 13.804764 5.682546 1087.710308 520.222117 0.016186 0.016262 0.000716
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.034893 -0.352707 0.569358 -1.077474 -0.254451 -1.019182 0.092612 2.867477 0.558785 0.566699 0.329104
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 4.723606 -1.085405 -0.235257 -0.550831 1.285262 -0.818180 65.853191 10.636911 0.564005 0.597486 0.333256
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.503430 -0.622815 0.141055 0.085346 0.590377 -0.664239 0.065543 -1.538818 0.590652 0.604413 0.329509
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.136950 12.143934 -0.258017 10.050358 1.152574 3.818804 20.600062 2.194035 0.596856 0.050200 0.481696
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.383102 11.950015 9.518507 10.026937 3.048918 3.802308 0.403228 1.884489 0.104957 0.030850 0.059101
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.074258 1.388357 -0.444995 1.396741 0.424900 0.216142 -0.778438 0.240605 0.604268 0.613743 0.334840
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.088839 0.348954 0.130191 0.404323 0.012122 2.584394 0.034015 1.013869 0.600429 0.608686 0.336117
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.561744 -0.953246 -0.991550 -0.806194 -0.892164 -1.209170 -0.302092 -0.590083 0.565534 0.587540 0.334606
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
149 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
150 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 17.263186 -0.666007 -0.541245 1.041237 0.244639 -0.150287 -0.177710 11.649100 0.419844 0.516424 0.301978
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.284659 -1.021195 9.492233 -0.540554 3.420675 0.047103 2.216929 0.468131 0.044580 0.538313 0.405333
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.260728 11.991520 7.368000 9.880383 0.857674 3.855035 1.916620 2.495299 0.402518 0.041070 0.306241
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.661875 0.019692 0.599620 0.830734 0.504576 1.010499 -0.064998 0.001197 0.533955 0.555412 0.344848
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.429027 -0.329947 -1.030373 -1.083140 0.191595 0.086014 3.727483 14.574233 0.554416 0.566556 0.339332
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.255776 20.791143 -0.295142 -0.291029 -0.959470 0.454334 -0.218720 6.830048 0.531475 0.435231 0.299590
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.197666 -1.113609 0.207895 -0.411035 0.614340 0.924087 -0.572129 -0.001197 0.575379 0.590255 0.336624
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.143709 25.939440 0.541787 0.158931 0.835559 -0.315980 -0.356821 0.534513 0.585671 0.482463 0.308171
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.716880 -1.229822 -0.272277 -0.962318 -0.259595 0.083303 2.797154 -0.541685 0.594233 0.608489 0.337772
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.500954 1.560795 0.434015 0.648697 0.664037 1.573307 -0.186580 1.122979 0.599780 0.611320 0.339619
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.286147 1.047509 1.196173 1.273899 0.800977 1.713988 0.185970 1.784171 0.592282 0.604402 0.331164
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 23.041928 0.281270 0.447078 -0.318272 0.198364 0.345908 0.571896 -0.246876 0.463202 0.606566 0.325993
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.591491 -0.316213 1.153166 0.229520 0.656985 -0.813504 0.177773 -1.648168 0.582625 0.597673 0.330066
167 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
168 N15 digital_ok 100.00% 99.94% 99.94% 0.00% nan nan inf inf nan nan nan nan 0.594433 0.502373 0.468084
169 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
170 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.351967 -1.596358 0.996350 -1.126656 -0.911794 -1.048988 -0.095399 1.231980 0.500141 0.540129 0.343691
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.298014 0.522003 2.014918 0.691983 1.519270 -0.221576 -3.118516 -0.074869 0.528563 0.541404 0.345089
173 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.805771 4.951109 2.697966 2.803769 2.619530 3.092578 -3.757884 -2.365259 0.496558 0.498770 0.328274
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.242626 -1.044036 0.146634 -0.326324 -0.269377 7.853174 -0.466546 3.876062 0.539384 0.571254 0.344247
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.186938 12.747010 -0.753196 10.151412 0.643000 3.785217 16.334367 2.651979 0.570662 0.056368 0.466773
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.365304 0.466398 1.367796 0.947276 0.380113 0.502101 0.096008 4.458037 0.577497 0.590329 0.342482
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.469405 11.949995 -0.435448 9.829358 2.673873 3.854555 0.957414 2.550706 0.591974 0.052272 0.440180
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.191703 0.835149 0.116278 0.528489 0.893101 0.930779 0.108883 0.340384 0.581893 0.594664 0.328050
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 15.140153 -0.456517 6.824369 -0.547404 1.994737 -0.198382 2.767863 -0.178755 0.421956 0.604049 0.358569
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.293945 -0.138785 -1.097038 -0.038475 -0.603239 0.061485 -0.408533 0.625946 0.594301 0.602291 0.336817
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.128624 -1.130450 -0.080034 -0.561586 -0.968877 -0.884173 -1.234323 -0.972433 0.588648 0.598688 0.337146
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 1.170455 -0.626456 1.915648 -0.189828 16.211618 -0.728083 9.391667 -0.535175 0.560400 0.589749 0.343245
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
190 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
191 N15 digital_ok 100.00% 99.94% 99.94% 0.00% nan nan inf inf nan nan nan nan 0.499114 0.320809 0.416270
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 2.231807 5.366821 1.634034 2.972492 1.407424 3.193645 -1.488759 -3.628539 0.524911 0.503961 0.332137
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.316927 4.721043 2.928062 2.719388 2.690611 3.005050 -3.975996 -3.529466 0.492559 0.487002 0.321320
200 N18 RF_maintenance 100.00% 100.00% 42.60% 0.00% 11.206650 31.503964 5.018285 0.017337 3.413963 1.166469 1.778129 4.146730 0.041587 0.220830 0.140740
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.213482 3.948252 1.699957 2.503979 1.286179 2.599196 -1.929729 -3.341999 0.554747 0.553373 0.330328
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.250053 0.637962 0.608761 -0.577891 -0.028940 0.096780 -1.883152 50.663289 0.573122 0.567517 0.329952
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.512607 11.757174 1.763565 -0.695496 0.625354 0.194734 22.980096 1.497699 0.580085 0.594591 0.339127
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.876711 -1.356306 3.144073 -1.114939 0.517619 -0.552191 2.514331 4.067492 0.417145 0.579549 0.383465
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.355959 3.697564 0.745511 2.831409 -0.602037 -0.175189 0.433920 1.251742 0.524536 0.475799 0.319949
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.166693 0.053182 -1.031153 -0.237880 -0.997363 1.590126 6.965453 -0.279888 0.553771 0.552287 0.330689
208 N20 dish_maintenance 100.00% 99.94% 99.94% 0.00% nan nan inf inf nan nan nan nan 0.340754 0.101645 0.307891
209 N20 dish_maintenance 100.00% 99.94% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.413067 0.030100 0.310048
210 N20 dish_maintenance 100.00% 99.88% 99.94% 0.00% nan nan inf inf nan nan nan nan 0.517776 0.410551 0.460708
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.033554 12.549568 -0.733856 5.354307 -0.839294 3.785409 0.248083 1.468890 0.517813 0.040084 0.426783
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.120299 -1.260821 -0.151380 -0.729321 -1.196130 -0.459144 1.690775 -1.102872 0.560392 0.563932 0.333811
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.086810 -0.914519 -0.760958 -0.959999 3.752194 -1.019413 2.871803 -0.859297 0.557329 0.570260 0.334977
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.638502 -0.443475 -0.495834 -0.239757 -1.204212 -0.882296 2.846896 -1.114021 0.560355 0.575357 0.335657
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.280181 -0.197474 -0.466822 1.207577 -0.833341 5.264151 -0.029428 4.976295 0.550744 0.535096 0.329098
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.641070 4.881758 3.099746 2.875679 2.906151 3.055722 -4.105021 -3.396825 0.514560 0.539918 0.328107
225 N19 RF_ok 100.00% 0.00% 90.59% 0.00% -0.441400 12.145247 0.190582 5.140051 -1.070859 3.627371 -1.776132 2.006119 0.559843 0.142253 0.446541
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.057149 15.766228 -0.866578 -0.028203 -1.184635 0.970754 -1.068874 0.806394 0.547921 0.473290 0.322471
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 2.708474 -0.279240 2.332701 -0.773926 -0.906023 4.454137 10.538298 8.228998 0.456298 0.541143 0.360287
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.249472 -0.566228 0.197319 -0.942645 -0.709455 -0.542086 0.366811 0.545835 0.528930 0.527593 0.328688
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.200955 0.582708 0.188090 0.686964 -0.685442 0.041953 -1.989777 -2.140903 0.529563 0.533728 0.345568
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.941595 -0.977776 0.524759 -0.997428 -0.365806 -0.498094 1.228600 -0.703804 0.505512 0.543761 0.343431
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.149788 -0.655904 0.215041 0.171215 -0.881926 -0.897689 -1.791188 -1.762673 0.551987 0.559419 0.342339
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.912776 -0.039030 -0.251535 0.183132 -0.684304 -0.544740 -0.600463 1.567338 0.550197 0.559453 0.339864
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.668328 -0.443098 -0.272280 -1.031881 -0.926617 -1.043515 -0.229132 1.824889 0.549017 0.559740 0.339856
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.369938 -1.130985 -0.670843 -0.213299 -1.320493 -0.824582 0.430701 -1.353255 0.552068 0.562626 0.349151
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 16.864538 0.179299 -0.508900 0.477747 0.090408 -0.006673 0.970663 -1.080389 0.417853 0.554653 0.340519
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 13.444212 -1.575984 0.391682 -0.907993 1.157217 -0.604099 23.658129 -0.138986 0.446560 0.543474 0.340978
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.196775 -1.134312 -0.113982 -0.772720 -0.871683 -0.674671 1.286308 4.671622 0.510811 0.541372 0.339803
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.528608 2.162946 0.011429 -1.029294 -0.920949 -1.045969 -1.922348 0.832134 0.538663 0.526286 0.337118
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.699753 13.080334 -1.038123 4.948475 -0.943835 3.833912 -0.650100 0.514298 0.518921 0.039823 0.427259
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.477248 -0.322317 -0.183189 -0.460487 -1.042562 -1.059863 0.062512 -0.350013 0.526336 0.527755 0.337407
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 9.952437 13.055853 0.388451 0.402624 0.964824 0.568105 -0.097538 1.040916 0.535342 0.535923 0.356470
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.726811 0.944256 1.394970 0.652270 0.595424 0.147032 -1.979507 -0.473924 0.442867 0.449482 0.327801
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.642126 2.461022 0.493091 0.836737 -0.316224 0.407426 0.470812 -0.650289 0.429654 0.434484 0.314104
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.465009 -1.036399 0.338440 -0.839940 -0.549505 -0.944383 -1.872001 -0.114868 0.461576 0.456353 0.333271
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.753741 0.076169 0.376144 -0.632898 4.390845 -1.002775 2.383263 1.186821 0.435215 0.441357 0.319522
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.050964 2.926313 -0.230509 -0.762990 -0.777376 -0.850134 0.926552 1.220908 0.411223 0.416346 0.297415
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 5, 7, 15, 16, 17, 18, 19, 20, 27, 28, 30, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 51, 52, 53, 54, 55, 56, 58, 59, 60, 63, 65, 66, 67, 68, 70, 71, 72, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 90, 92, 93, 94, 96, 97, 101, 102, 103, 104, 106, 107, 108, 109, 110, 111, 112, 113, 114, 117, 118, 121, 122, 123, 124, 126, 127, 131, 134, 135, 136, 137, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 161, 165, 167, 168, 169, 170, 173, 179, 180, 181, 182, 184, 187, 189, 190, 191, 192, 193, 200, 201, 202, 204, 205, 207, 208, 209, 210, 211, 223, 224, 225, 226, 227, 242, 243, 244, 246, 262, 329]

unflagged_ants: [8, 9, 10, 21, 22, 29, 35, 41, 43, 44, 46, 48, 49, 50, 57, 61, 62, 64, 69, 73, 74, 85, 88, 89, 91, 95, 105, 115, 120, 125, 128, 132, 133, 139, 141, 144, 145, 146, 157, 160, 162, 163, 164, 166, 171, 172, 183, 185, 186, 206, 220, 221, 222, 228, 229, 237, 238, 239, 240, 241, 245, 261, 320, 324, 325, 333]

golden_ants: [9, 10, 21, 29, 41, 44, 69, 85, 88, 91, 105, 128, 141, 144, 145, 146, 157, 160, 162, 163, 164, 166, 171, 172, 183, 186]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2460029.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

# Figure out where to draw the nodes
node_centers = {}
for node in sorted(set(list(nodes.values()))):
    if np.isfinite(node):
        this_node_ants = [ant for ant in ants + unused_ants if nodes[ant] == node]
        if len(this_node_ants) == 1:
            # put the node label just to the west of the lone antenna 
            node_centers[node] = hd.antpos[ant][node] + np.array([-14.6 / 2, 0, 0])
        else:
            # put the node label between the two antennas closest to the node center
            node_centers[node] = np.mean([hd.antpos[ant] for ant in this_node_ants], axis=0)
            closest_two_pos = sorted([hd.antpos[ant] for ant in this_node_ants], 
                                     key=lambda pos: np.linalg.norm(pos - node_centers[node]))[0:2]
            node_centers[node] = np.mean(closest_two_pos, axis=0)
In [25]:
def Plot_Array(ants, unused_ants, outriggers):
    plt.figure(figsize=(16,16))
    
    plt.scatter(np.array([hd.antpos[ant][0] for ant in hd.data_ants if ant in ants]), 
                np.array([hd.antpos[ant][1] for ant in hd.data_ants if ant in ants]), c='w', s=0)

    # connect every antenna to their node
    for ant in ants:
        if nodes[ant] in node_centers:
            plt.plot([hd.antpos[ant][0], node_centers[nodes[ant]][0]], 
                     [hd.antpos[ant][1], node_centers[nodes[ant]][1]], 'k', zorder=0)

    rc_color = '#0000ff'
    antm_color = '#ffa500'
    autom_color = '#ff1493'

    # Plot 
    unflagged_ants = []
    for i, ant in enumerate(ants):
        ant_has_flag = False
        # plot large blue annuli for redcal flags
        if use_redcal:
            if redcal_flagged_frac[ant] > 0:
                ant_has_flag = True
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=7 * (2 - 1 * float(not outriggers)), fill=True, lw=0,
                                                color=rc_color, alpha=redcal_flagged_frac[ant]))
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=6 * (2 - 1 * float(not outriggers)), fill=True, color='w'))
        
        # plot medium green annuli for ant_metrics flags
        if use_ant_metrics: 
            if ant_metrics_xants_frac_by_ant[ant] > 0:
                ant_has_flag = True
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=6 * (2 - 1 * float(not outriggers)), fill=True, lw=0,
                                                color=antm_color, alpha=ant_metrics_xants_frac_by_ant[ant]))
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=5 * (2 - 1 * float(not outriggers)), fill=True, color='w'))
        
        # plot small red annuli for auto_metrics
        if use_auto_metrics:
            if ant in auto_ex_ants:
                ant_has_flag = True                
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=5 * (2 - 1 * float(not outriggers)), fill=True, lw=0, color=autom_color)) 
        
        # plot black/white circles with black outlines for antennas
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4 * (2 - 1 * float(not outriggers)), fill=True, color=['w', 'k'][ant_has_flag], ec='k'))
        if not ant_has_flag:
            unflagged_ants.append(ant)

        # label antennas, using apriori statuses if available
        try:
            bgc = matplotlib.colors.to_rgb(status_colors[a_priori_statuses[ant]])
            c = 'black' if (bgc[0]*0.299 + bgc[1]*0.587 + bgc[2]*0.114) > 186 / 256 else 'white'
        except:
            c = 'k'
            bgc='white'
        plt.text(hd.antpos[ant][0], hd.antpos[ant][1], str(ant), va='center', ha='center', color=c, backgroundcolor=bgc)

    # label nodes
    for node in sorted(set(list(nodes.values()))):
        if not np.isnan(node) and not np.all(np.isnan(node_centers[node])):
            plt.text(node_centers[node][0], node_centers[node][1], str(node), va='center', ha='center', bbox={'color': 'w', 'ec': 'k'})
    
    # build legend 
    legend_objs = []
    legend_labels = []
    
    # use circles for annuli 
    legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgecolor='k', markerfacecolor='w', markersize=13))
    legend_labels.append(f'{len(unflagged_ants)} / {len(ants)} Total {["Core", "Outrigger"][outriggers]} Antennas Never Flagged')
    legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markerfacecolor='k', markersize=15))
    legend_labels.append(f'{len(ants) - len(unflagged_ants)} Antennas {["Core", "Outrigger"][outriggers]} Flagged for Any Reason')

    if use_auto_metrics:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=autom_color, markersize=15))
        legend_labels.append(f'{len([ant for ant in auto_ex_ants if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas Flagged by Auto Metrics')
    if use_ant_metrics: 
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=antm_color, markersize=15))
        legend_labels.append(f'{np.round(np.sum([frac for ant, frac in ant_metrics_xants_frac_by_ant.items() if ant in ants]), 2)} Antenna-Nights on' 
                             f'\n{np.sum([frac > 0 for ant, frac in ant_metrics_xants_frac_by_ant.items() if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas '
                             'Flagged by Ant Metrics\n(alpha indicates fraction of time)')        
    if use_redcal:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=rc_color, markersize=15))
        legend_labels.append(f'{np.round(np.sum(list(redcal_flagged_frac.values())), 2)} Antenna-Nights on' 
                             f'\n{np.sum([frac > 0 for ant, frac in redcal_flagged_frac.items() if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas '
                             'Flagged by Redcal\n(alpha indicates fraction of time)')

    # use rectangular patches for a priori statuses that appear in the array
    for aps in sorted(list(set(list(a_priori_statuses.values())))):
        if aps != 'Not Found':
            legend_objs.append(plt.Circle((0, 0), radius=7, fill=True, color=status_colors[aps]))
            legend_labels.append(f'A Priori Status:\n{aps} ({[status for ant, status in a_priori_statuses.items() if ant in ants].count(aps)} {["Core", "Outrigger"][outriggers]} Antennas)')

    # label nodes as a white box with black outline
    if len(node_centers) > 0:
        legend_objs.append(matplotlib.patches.Patch(facecolor='w', edgecolor='k'))
        legend_labels.append('Node Number')

    if len(unused_ants) > 0:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markerfacecolor='grey', markersize=15, alpha=.2))
        legend_labels.append(f'Anntenna Not In Data')
        
    
    plt.legend(legend_objs, legend_labels, ncol=2, fontsize='large', framealpha=1)
    
    if outriggers:
        pass
    else:
        plt.xlim([-200, 150])
        plt.ylim([-150, 150])        
       
    # set axis equal and label everything
    plt.axis('equal')
    plt.tight_layout()
    plt.title(f'Summary of {["Core", "Outrigger"][outriggers]} Antenna Statuses and Metrics on {JD}', size=20)    
    plt.xlabel("Antenna East-West Position (meters)", size=12)
    plt.ylabel("Antenna North-South Position (meters)", size=12)
    plt.xticks(fontsize=12)
    plt.yticks(fontsize=12)
    xlim = plt.gca().get_xlim()
    ylim = plt.gca().get_ylim()    
        
    # plot unused antennas
    plt.autoscale(False)    
    for ant in unused_ants:
        if nodes[ant] in node_centers:
            plt.plot([hd.antpos[ant][0], node_centers[nodes[ant]][0]], 
                     [hd.antpos[ant][1], node_centers[nodes[ant]][1]], 'k', alpha=.2, zorder=0)
        
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4, fill=True, color='w', ec=None, alpha=1, zorder=0))
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4, fill=True, color='grey', ec=None, alpha=.2, zorder=0))
        if hd.antpos[ant][0] < xlim[1] and hd.antpos[ant][0] > xlim[0]:
            if hd.antpos[ant][1] < ylim[1] and hd.antpos[ant][1] > ylim[0]:
                plt.text(hd.antpos[ant][0], hd.antpos[ant][1], str(ant), va='center', ha='center', color='k', alpha=.2) 

Figure 1: Array Plot of Flags and A Priori Statuses¶

This plot shows all antennas, which nodes they are connected to, and their a priori statuses (as the highlight text of their antenna numbers). It may also show (depending on what is finished running):

  • Whether they were flagged by auto_metrics (red circle) for bandpass shape, overall power, temporal variability, or temporal discontinuities. This is done in a binary fashion for the whole night.
  • Whether they were flagged by ant_metrics (green circle) as either dead (on either polarization) or crossed, with the transparency indicating the fraction of the night (i.e. number of files) that were flagged.
  • Whether they were flagged by redcal (blue circle) for high chi^2, with the transparency indicating the fraction of the night (i.e. number of files) that were flagged.

Note that the last fraction does not include antennas that were flagged before going into redcal due to their a priori status, for example.

In [26]:
core_ants = [ant for ant in ants if ant < 320]
outrigger_ants = [ant for ant in ants if ant >= 320]
Plot_Array(ants=core_ants, unused_ants=unused_ants, outriggers=False)
if len(outrigger_ants) > 0:
    Plot_Array(ants=outrigger_ants, unused_ants=sorted(set(unused_ants + core_ants)), outriggers=True)

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.1.1.dev3+gb291d34
3.2.3.dev149+g96d0dd5
In [ ]: