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 = "2459896"
data_path = "/mnt/sn1/2459896"
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: 11-12-2022
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/2459896/zen.2459896.25289.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 1849 ant_metrics files matching glob /mnt/sn1/2459896/zen.2459896.?????.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/2459896/zen.2459896.?????.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 2459896
Date 11-12-2022
LST Range 22.953 -- 8.904 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1849
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 7
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 96
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 201 (0.0%)
Antennas in Commanded State (observed) 0 / 201 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 18
Nodes Registering 0s N20
Nodes Not Correlating N05, N07, N14
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 89 / 201 (44.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 127 / 201 (63.2%)
Redcal Done? ❌
Never Flagged Antennas 59 / 201 (29.4%)
A Priori Good Antennas Flagged 63 / 96 total a priori good antennas:
3, 7, 9, 15, 19, 21, 29, 30, 37, 38, 44, 45,
51, 53, 54, 55, 56, 59, 68, 71, 81, 83, 84,
86, 88, 94, 98, 99, 100, 101, 103, 107, 108,
109, 111, 116, 117, 118, 121, 122, 123, 136,
140, 142, 143, 144, 146, 147, 158, 161, 162,
163, 164, 165, 170, 183, 184, 185, 186, 187,
189, 190, 191
A Priori Bad Antennas Not Flagged 26 / 105 total a priori bad antennas:
8, 35, 48, 49, 61, 62, 64, 79, 89, 95, 115,
120, 125, 132, 139, 148, 149, 168, 207, 220,
221, 223, 238, 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_2459896.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% 100.00% 0.00% 0.00% 9.671023 -0.507088 9.447020 0.237771 9.887777 0.648915 0.866373 1.857919 0.033548 0.670993 0.464641
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.335664 1.040235 2.240082 1.117486 1.854458 6.083019 15.826176 70.967332 0.670386 0.667699 0.404423
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.032684 -0.261029 -0.509459 -0.593302 -0.603805 0.170973 0.940280 -0.241099 0.673503 0.674993 0.400685
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.945641 -0.858708 0.140963 0.246503 -0.764094 1.886153 11.133843 6.899325 0.664519 0.674649 0.397531
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.677402 -1.350852 -0.742658 -0.404484 -1.305335 0.031335 2.310531 0.957428 0.657474 0.670798 0.391949
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.061739 -0.240267 7.503284 0.000024 1.648607 0.817282 0.079893 -0.066742 0.518696 0.670997 0.464577
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.618416 -0.813672 -1.407309 -1.169937 -0.283061 1.115336 0.797326 -0.021702 0.653971 0.665719 0.408935
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.827744 0.026807 0.748891 0.629927 -0.135211 0.510851 0.295231 4.719560 0.671060 0.678247 0.403799
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.827880 -1.114366 -0.827408 -0.003625 -0.191266 0.230557 2.348891 2.990739 0.673994 0.677771 0.399218
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.348414 0.604416 -0.256482 -0.208270 0.830862 0.037621 3.354243 1.651088 0.674182 0.683536 0.398374
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.910895 10.990928 -0.724516 0.127094 1.627128 3.341344 17.899079 29.163633 0.652659 0.459370 0.474265
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.375824 -1.193983 -0.391251 -1.190649 8.187387 20.936385 5.114322 2.165707 0.663811 0.689818 0.402428
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.065354 -0.951867 3.159496 -1.661721 -0.679448 1.553856 0.494445 -0.573502 0.655626 0.689429 0.411648
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.176289 -0.203269 -0.564506 3.950279 -0.862434 0.150326 0.010142 -0.151643 0.656565 0.643474 0.405892
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% 27.167005 6.263779 -0.630798 -0.864027 10.581324 3.894466 23.509236 36.297065 0.449228 0.609090 0.341095
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.613195 10.762146 9.485279 10.026038 9.965371 10.965621 2.514390 1.816094 0.032453 0.036765 0.004734
28 N01 RF_maintenance 100.00% 0.00% 84.32% 0.00% 11.884646 25.009957 0.963633 0.710156 6.409643 13.744291 2.534618 18.779408 0.362930 0.159100 0.263103
29 N01 digital_ok 100.00% 0.00% 100.00% 0.00% -1.360807 11.203340 -0.456800 9.642345 -0.263298 10.931425 -0.218203 0.324732 0.680143 0.035083 0.486179
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.278436 -0.576021 -1.130323 0.151946 6.752896 0.597063 21.656045 0.710330 0.675049 0.687162 0.391553
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.004576 -1.293954 0.800813 1.176849 0.445340 1.896676 2.084127 0.585209 0.682698 0.687652 0.399274
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.597625 20.406173 0.282099 1.987035 16.761025 6.151064 8.762355 14.945812 0.570909 0.586055 0.249968
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 11.315410 1.198265 4.140248 -0.438496 9.937914 3.876478 0.965763 -0.107806 0.041891 0.663375 0.422481
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.535750 -0.469722 1.055816 -1.401763 2.456001 -2.940369 -0.688334 -0.354095 0.643113 0.646763 0.399025
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.222850 7.596265 -0.252550 -0.007044 0.875594 2.045130 3.372395 1.602612 0.657914 0.674249 0.407428
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.439490 0.302509 -1.072936 0.287656 -0.104750 0.570054 -0.568353 7.996009 0.672719 0.683568 0.413294
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.073748 0.177615 -0.150927 0.206296 1.210797 2.391954 5.183899 1.552026 0.676175 0.689650 0.412185
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.177338 0.487182 -0.203308 0.180092 -0.647050 -0.606135 -0.352740 -0.166018 0.677621 0.684931 0.392601
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.043626 0.126502 -1.144410 -0.319475 0.596569 -0.186400 -0.100938 0.719403 0.684164 0.686957 0.381128
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.088789 0.827162 -0.419216 0.567112 1.201395 0.304855 0.702999 -0.106611 0.692088 0.690607 0.395873
43 N05 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.517895 0.210892 0.003625 0.120466 -1.307733 -0.026910 -1.302741 0.289523 0.057766 0.051455 0.007018
44 N05 digital_ok 0.00% 100.00% 100.00% 0.00% -1.446932 0.088541 -1.279200 0.142648 0.231214 0.961558 -0.651416 -0.458543 0.053278 0.049363 0.005348
45 N05 digital_ok 0.00% 100.00% 100.00% 0.00% -0.671580 1.218970 -0.079599 -0.159538 -0.432182 0.168806 -0.017705 2.205351 0.058558 0.051399 0.006249
46 N05 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.975123 1.561113 1.103800 1.775775 0.442180 0.396075 0.029382 -1.876793 0.067934 0.060171 0.012331
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 10.735503 1.414507 3.961725 -1.457223 9.924054 -1.306597 0.993111 5.052515 0.037542 0.658391 0.411491
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.889507 1.295721 1.051002 1.174693 -0.674309 -0.765343 -1.526937 -1.873575 0.649529 0.672773 0.402604
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.058752 1.138436 -0.994567 1.130621 -1.722915 -0.587578 -0.281718 -1.489577 0.620219 0.655873 0.396423
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 21.804948 0.875481 0.221611 0.405892 7.945028 1.107280 87.428893 3.910524 0.574598 0.666161 0.389915
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 23.419475 0.703242 12.147459 -0.405087 10.211115 1.257316 9.162377 6.356560 0.038476 0.684288 0.446732
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.614066 6.187074 -0.567645 0.115938 3.248108 1.056730 0.553059 0.640219 0.677263 0.692344 0.400794
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.351957 2.542568 -0.646592 -0.370242 0.654982 0.585169 2.940679 4.789688 0.686623 0.698420 0.399074
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.694648 11.455364 9.484708 10.244147 9.973645 10.945878 1.988698 0.914658 0.044401 0.043619 0.001317
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.612876 12.131972 0.650590 10.159298 4.503473 10.949093 1.811214 2.698334 0.683185 0.033374 0.425621
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 3.168463 12.190116 0.037898 10.340756 0.343070 10.940938 1.060168 0.904205 0.685326 0.036830 0.436302
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 26.542243 0.383845 5.507144 0.200345 13.106227 1.587612 2.012803 1.599884 0.484112 0.699043 0.393138
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 0.539140 11.081446 -0.750890 10.119521 -0.072862 10.970143 0.966198 1.181261 0.053061 0.026300 0.024656
59 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 10.336633 10.735214 9.388452 10.044898 9.833744 9.912524 0.661277 1.023853 0.029429 0.048441 0.013577
60 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% -1.148495 11.000764 -0.011418 10.158456 -2.332595 10.906163 -1.020866 2.445963 0.062448 0.033004 0.024514
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.950543 1.752740 -1.278857 -0.034840 0.739321 -2.716400 0.414925 3.781968 0.633881 0.642569 0.385015
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.126807 1.788682 0.302503 1.112652 -1.013238 -0.250268 0.614617 -1.732333 0.648608 0.679086 0.392397
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.079465 11.346938 0.080048 4.620560 -0.771295 10.977139 -0.452249 2.557272 0.634660 0.042250 0.395849
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.721285 0.356298 -0.943276 0.256234 -1.950940 -2.626841 -0.329098 -1.009887 0.610895 0.646175 0.396813
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.452260 1.098686 0.174103 0.564772 2.004127 1.590390 0.806137 1.241511 0.647056 0.674477 0.424359
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.295237 1.307191 1.413711 1.611065 1.435937 0.828651 -0.217125 2.213628 0.656780 0.678216 0.411831
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.699944 -0.612123 1.029340 0.854214 -0.354859 -0.011117 0.415732 0.935271 0.664186 0.683993 0.401257
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.773166 26.094644 0.196330 13.393998 0.388436 10.654247 0.227242 8.467285 0.681538 0.030229 0.449073
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.134926 -0.417333 0.071278 0.204812 0.173362 0.177273 0.040088 0.289329 0.682836 0.699172 0.382782
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.333698 -0.700377 -0.924310 -0.567116 0.119571 0.361978 -0.334304 -0.109916 0.693989 0.706292 0.381352
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.028120 -0.153746 0.190561 0.810849 0.261342 1.425026 1.644891 1.104102 0.701910 0.705225 0.378099
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.807271 -0.011308 0.336077 0.774002 0.683063 0.494756 3.640259 0.283998 0.686166 0.699477 0.378432
73 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% -1.204953 0.493232 -0.751257 2.373189 -1.372642 15.496834 -0.371898 -0.069252 0.055838 0.056811 0.008438
74 N05 RF_maintenance 0.00% 100.00% 100.00% 0.00% -1.197252 0.155307 0.227511 -1.161176 -1.309172 0.431788 -1.165059 0.410515 0.057990 0.053572 0.006441
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 20.798824 23.827706 0.351415 -0.794157 2.993060 3.883025 8.504244 6.364361 0.536091 0.500672 0.205737
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 28.515090 -0.510124 -0.245189 -0.242189 3.383971 -3.164479 2.850001 0.400058 0.475181 0.661708 0.374036
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.840138 -0.498024 -0.613853 -0.915752 -1.874349 -2.650435 1.509475 -0.687700 0.636313 0.663989 0.396998
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 8.452969 12.541067 2.322630 4.491962 8.110873 10.922263 6.192856 0.888236 0.305923 0.038808 0.175223
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% -0.442022 -0.799993 -0.713961 2.964389 -1.169872 27.456854 0.127996 0.930664 0.062980 0.087661 0.011443
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 2.060927 -1.001398 -0.272299 3.314713 0.677043 80.791768 -0.386649 0.691887 0.066074 0.082928 0.024164
83 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.559280 -0.181249 -0.474498 -0.059863 -0.287556 0.262634 -0.162825 1.217204 0.072150 0.076148 0.013416
84 N08 digital_ok 100.00% 29.85% 100.00% 0.00% 19.106210 23.096838 12.191969 12.962915 7.658849 10.628215 3.826959 4.650777 0.241210 0.034730 0.132805
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.187796 0.575794 -0.515857 0.168986 1.782258 -0.582489 -0.494399 0.538342 0.682048 0.690275 0.383213
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% -0.416011 -0.245559 1.982269 1.170314 5.132221 -1.244284 0.149702 19.903976 0.667967 0.691192 0.373032
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 18.970212 6.811887 1.286306 -0.327964 18.141306 0.728119 7.110645 1.955362 0.589556 0.711649 0.348429
88 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.662412 0.018469 -0.095277 0.726156 -1.093436 1.565840 8.577163 2.743673 0.682703 0.697514 0.369417
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.364074 0.342765 -0.212447 0.488125 -0.674673 -0.075196 -0.485231 -0.386555 0.681982 0.698525 0.383572
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.375985 -0.510556 0.817091 0.824718 0.891490 -1.134749 -0.111139 4.198810 0.673653 0.691832 0.387519
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.531503 -0.184800 -0.079746 0.014932 -0.631902 0.324018 0.043303 -0.305644 0.673484 0.700120 0.400684
92 N10 RF_maintenance 100.00% 0.00% 16.55% 0.00% 36.765874 43.310131 0.286973 0.674443 7.779080 10.241057 1.380069 6.606711 0.293076 0.245799 0.101184
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 2.025799 -0.008996 1.882939 -0.134677 2.355929 0.402572 3.596291 -0.293385 0.667770 0.696385 0.400235
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 10.736211 -1.010316 9.603093 0.121826 9.934305 2.592252 0.903217 2.661134 0.031907 0.691557 0.385664
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.164480 0.051773 -0.433838 0.823834 -0.611024 -1.290687 2.575501 3.415780 0.642307 0.678608 0.403475
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.817262 12.160234 3.943635 4.650980 9.842981 10.939186 1.030514 0.562768 0.032814 0.036881 0.002552
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.807001 3.324252 0.457101 0.147276 -1.413593 -2.166734 -0.961813 7.529114 0.626701 0.609407 0.398433
98 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 1.022521 5.529847 -0.247411 -0.226387 0.406666 0.588905 0.462445 2.301101 0.072940 0.071112 0.014297
99 N07 digital_ok 0.00% 100.00% 100.00% 0.00% 0.543355 -0.703622 0.464362 0.684107 -1.623626 3.334405 1.338871 -0.411667 0.064721 0.062831 0.009835
100 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -1.412478 -0.930816 -1.125268 0.027659 0.279434 -0.911733 -0.259881 0.277423 0.052487 0.060723 0.005988
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.942954 6.752012 -0.836744 0.537529 0.580863 1.010631 0.327352 0.298434 0.674963 0.684557 0.397045
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.067919 0.358450 -0.476233 1.786826 -1.629983 0.053422 -0.814052 7.573413 0.686638 0.684211 0.383304
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.938405 4.765002 3.165314 0.076660 37.280656 8.758898 5.037709 6.361448 0.667586 0.697317 0.380064
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.680877 56.086897 6.324658 7.091461 0.168858 10.775588 -0.144127 -0.108176 0.633586 0.670287 0.376771
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.112571 -0.374949 -0.447116 0.570694 0.063485 -0.506492 -0.045212 0.019523 0.689039 0.697732 0.371014
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.324050 0.298431 0.851300 0.886145 2.143597 0.738851 -0.101159 0.248257 0.673136 0.694656 0.377920
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.317532 -0.139241 -1.378308 -0.879063 -0.949735 -0.817885 3.291710 4.215677 0.680281 0.697958 0.383564
108 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 9.814425 3.209524 9.416518 -0.641489 9.950412 -0.092387 1.889270 0.303867 0.039766 0.703545 0.406830
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -1.099971 11.134658 0.179156 9.914187 -0.186051 10.951844 1.341379 1.626056 0.680186 0.034010 0.402334
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 12.506769 24.635997 0.193040 13.096899 18.430266 10.592203 34.175466 4.136905 0.622418 0.029988 0.328019
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.015978 11.051668 0.087184 10.015906 0.058865 10.959879 10.223726 2.217307 0.674981 0.034314 0.392980
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.683765 1.017077 -0.343410 -0.494935 -0.191699 -0.262229 0.384060 -0.281426 0.663784 0.681855 0.401623
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.586418 12.178839 3.737368 4.553044 9.859485 10.937124 1.542521 0.613400 0.034757 0.030648 0.002617
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.194427 0.581654 1.012186 -0.244747 6.845494 -2.198174 1.989281 -0.614063 0.531019 0.654081 0.429073
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.292813 1.172808 2.375446 1.646876 1.973744 0.594613 -2.017148 -1.209510 0.619778 0.651031 0.420428
116 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.355636 0.142714 -0.300516 0.148657 2.076692 -0.473893 0.157096 -0.083511 0.085394 0.082278 0.020267
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 10.643050 12.609316 9.507616 10.474682 9.871843 10.940386 1.400594 3.377377 0.026359 0.025628 0.000764
118 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.653092 0.467763 -0.406904 0.427801 0.552803 1.596910 3.880835 3.885464 0.060800 0.059628 0.007041
119 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 0.770422 0.991349 -1.574578 2.257274 -0.340638 11.441716 0.507002 2.622458 0.066105 0.073135 0.011246
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.585475 2.308900 2.115716 2.044211 0.068748 1.116696 0.345968 -2.336820 0.661594 0.685073 0.379260
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.735886 4.280372 -0.965268 0.604640 5.362124 0.145285 9.903400 15.652925 0.684644 0.695339 0.381496
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.842021 6.565817 -0.890910 0.265186 3.736796 0.554141 0.913675 -0.421182 0.697788 0.702428 0.383288
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.658943 7.805681 -0.013922 0.639074 0.913226 0.659332 -0.157265 0.740775 0.695859 0.702224 0.382013
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.947137 -0.239120 -0.433265 0.221648 -0.822832 0.116007 0.755198 0.876625 0.688961 0.703122 0.386985
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.713305 -1.069848 -0.781831 0.643543 -0.328103 0.714718 -0.245742 -0.191406 0.683469 0.696429 0.392698
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.398412 2.174411 -0.709665 0.737919 9.289107 -0.601636 21.452096 0.040516 0.639726 0.689455 0.390621
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.032497 -0.099380 -0.499804 -0.109609 1.795251 1.652379 1.814196 3.644713 0.683135 0.704109 0.401562
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.719109 -0.279112 1.195540 0.497208 -0.441561 0.558427 0.063447 1.570002 0.677204 0.699454 0.396816
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.441750 -1.633650 0.437908 0.640396 0.041311 0.716753 -0.160539 1.072619 0.675411 0.696533 0.402843
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.173771 0.590126 -0.354371 -0.090177 -0.923222 0.124735 2.021673 3.863682 0.656628 0.686654 0.397034
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.698669 12.275720 3.993406 4.790990 9.920085 10.913806 2.255090 -0.164050 0.033375 0.038337 0.002014
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.978404 0.084307 0.273870 -1.295280 -1.361476 -2.151891 1.239901 -0.051490 0.626465 0.643272 0.406439
133 N11 not_connected 100.00% 100.00% 80.31% 0.00% 11.127743 16.555705 3.751211 3.275941 9.919270 10.335459 1.447679 0.640376 0.041031 0.181943 0.086214
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.969734 11.118376 -0.267931 10.221222 0.162062 10.959122 -0.098076 1.159493 0.619089 0.037078 0.394710
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 4.466653 0.123467 7.328893 5.468482 13.859094 33.551469 0.018068 -0.129383 0.457161 0.587711 0.403673
137 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.180634 -0.559107 -0.837262 -0.214029 1.454101 2.978075 0.005891 0.920922 0.068445 0.072521 0.011277
138 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.130069 -0.273687 -0.208510 0.673974 1.690726 0.554694 0.776993 -0.005891 0.068318 0.070293 0.012752
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.913316 -0.760747 1.466443 -0.983651 -0.479917 -2.414884 -0.842424 0.808513 0.658999 0.665073 0.390701
140 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.507397 11.772597 0.250953 10.112801 -1.023824 10.925008 2.264228 2.321187 0.674816 0.042915 0.459552
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.282777 -0.450640 -1.017910 0.561505 0.469082 -2.763124 0.533701 -1.395668 0.680383 0.693590 0.379908
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.614961 10.967282 1.061240 10.168517 8.441458 10.954913 4.324790 1.689929 0.671283 0.041810 0.458530
143 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 9.884811 -0.441561 9.558234 -0.143813 9.838074 0.941263 0.288951 -0.247554 0.027643 0.091625 0.077472
144 N14 digital_ok 0.00% 100.00% 100.00% 0.00% -0.438700 -0.838923 -0.624338 3.428320 -1.347261 0.268476 -0.371733 -0.042623 0.091938 0.106440 0.042408
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% -1.165292 2.389089 -0.632870 7.062307 1.173860 28.530391 -0.083396 0.662676 0.095880 0.119447 0.048509
146 N14 digital_ok 0.00% 100.00% 100.00% 0.00% -0.004576 1.329176 -1.671049 0.937330 -0.794360 -1.531837 -0.043724 -1.639437 0.099856 0.114024 0.052510
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.773974 -1.469977 1.102664 1.789936 5.591261 -0.490255 -0.069202 -0.235391 0.673454 0.689728 0.387092
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.830006 -0.393797 2.652971 1.297464 -1.657174 0.630139 -0.388313 -0.164738 0.663431 0.694965 0.401595
149 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.230187 1.147344 -1.127547 1.746035 -1.308163 0.477332 -0.785748 -2.025430 0.675078 0.692296 0.401140
150 N15 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.348820 -0.273291 9.476424 -0.909691 9.972409 -0.368150 2.112242 -0.032335 0.041271 0.283301 0.107508
155 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.586740 -0.725742 -0.429130 5.697697 1.372554 34.389353 0.806542 0.505313 0.621794 0.585202 0.420286
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.452065 10.722397 2.422413 9.903056 31.223327 10.932964 2.515442 0.552571 0.608829 0.037672 0.392269
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.004724 -0.268542 -0.105042 0.246043 -0.674817 -0.063784 -0.075254 0.008757 0.634273 0.659644 0.415678
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.304050 -1.048019 -1.151630 -1.289714 0.804372 0.417638 3.267390 14.410409 0.653450 0.673493 0.414324
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.092347 27.763910 -1.427469 -0.802202 -2.049235 2.918533 -0.001124 1.855945 0.631486 0.510096 0.371020
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.776696 -1.139207 -0.764124 -1.140873 -0.357886 -0.576600 0.042637 -0.150130 0.668516 0.681504 0.388341
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.765378 27.886707 -0.628205 -0.793844 -0.130052 -0.080466 -0.267337 0.145126 0.673730 0.558676 0.360151
162 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 9.863403 11.789827 9.408137 10.243818 9.890604 10.931866 1.055235 1.110362 0.045781 0.050647 0.003795
163 N14 digital_ok 0.00% 100.00% 100.00% 0.00% -0.589627 0.840884 -0.675007 0.034656 -0.276720 0.105306 -0.158470 0.588899 0.090188 0.091284 0.039880
164 N14 digital_ok 100.00% 100.00% 100.00% 0.00% -0.377395 -0.141557 2.573257 -0.708452 35.321000 0.394318 0.512708 1.042692 0.097472 0.093168 0.045685
165 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 26.958610 -0.112093 2.176778 0.158787 3.839635 -0.024702 0.158608 -0.130202 0.098218 0.101599 0.049442
166 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 28.529777 10.303277 0.054817 9.766064 2.315897 10.927502 1.226338 1.086757 0.097574 0.027201 0.039603
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.647214 -1.103727 -0.670490 0.904159 -0.474491 0.929368 -0.984602 1.744830 0.688146 0.692059 0.398907
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.908435 -0.936588 -0.525930 -0.839575 1.061943 0.571801 -0.023328 1.071897 0.679268 0.695818 0.399839
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.839458 1.509075 -1.472167 -1.382011 0.011117 -2.558734 -0.423150 0.138441 0.675519 0.679690 0.399841
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.397492 -0.827604 9.623116 -1.546826 9.857549 9.976715 0.867583 0.742435 0.037415 0.688096 0.469395
179 N12 RF_maintenance 100.00% 100.00% 82.04% 0.00% 10.511846 11.398934 9.610715 10.497382 9.789459 10.478088 0.712905 1.060842 0.062309 0.156696 0.080591
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.982692 11.746160 9.546243 10.282569 9.851755 10.947025 0.546983 2.083644 0.047262 0.049882 0.003924
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.349698 -0.285641 -0.706976 0.173534 -0.031832 2.255470 -0.392434 3.791348 0.677535 0.681812 0.396951
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.045334 3.767119 -1.003857 2.981375 7.116414 4.159144 8.198658 -1.828396 0.683344 0.675203 0.401098
183 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 10.130084 -0.794151 9.352468 -0.048552 9.955776 0.678847 0.221464 0.123225 0.038221 0.679333 0.426018
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 9.908777 11.446196 9.563286 10.187965 9.888198 10.884683 0.732634 0.953266 0.025616 0.025099 0.001081
185 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 8.016892 0.785076 8.934019 6.934622 8.852785 1.837355 0.477353 0.216795 0.068765 0.120076 0.055748
186 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 9.430436 1.582612 9.570276 1.998130 9.908363 1.454360 2.120364 -2.202655 0.030648 0.109056 0.059401
187 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 9.946423 1.746659 9.341132 1.707115 9.958421 0.323622 2.186641 -1.156288 0.028939 0.113936 0.068355
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 8.536408 8.921863 1.456753 0.143568 4.108493 11.712024 1.315514 0.917661 0.350030 0.372903 0.177242
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 41.553537 11.223473 -0.282546 10.246364 10.088972 10.996695 157.945327 2.663658 0.461133 0.033745 0.295285
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.061691 0.006150 3.249110 -0.196831 0.341327 0.414879 12.589291 0.820502 0.628790 0.668659 0.428724
200 N18 RF_maintenance 100.00% 100.00% 56.46% 0.00% 11.299026 33.937738 3.952409 0.496589 10.011650 10.369387 1.552080 -0.497741 0.044831 0.216123 0.121585
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.541189 5.542872 4.639439 3.865891 8.067413 7.472510 -3.408316 -3.171859 0.626480 0.643772 0.390616
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% 0.678627 1.415609 0.786252 -0.512224 -0.735624 -1.906291 -0.698471 3.491800 0.655887 0.633536 0.397388
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.824720 12.992403 3.717206 4.366194 9.972259 10.965389 2.540391 3.011821 0.033680 0.040739 0.001543
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.611019 2.071700 0.142823 -0.859839 -2.080720 -1.813899 -0.753826 7.582167 0.647861 0.640706 0.400421
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.408310 0.293342 -1.272591 -1.023440 10.452827 -2.753621 1.688096 2.741176 0.630222 0.648217 0.395948
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.225311 1.461567 1.372131 0.073960 0.144559 2.853439 -1.180496 -1.010469 0.634413 0.644210 0.379549
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
211 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
219 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.433340 3.857352 4.653672 3.080236 6.618143 5.017928 -3.348369 -2.578518 0.623383 0.650844 0.411745
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.338146 -0.782411 0.058302 -0.282669 -2.192627 -2.458643 1.471289 -1.028061 0.651915 0.654240 0.405184
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.063881 -0.145587 -1.044607 -0.547958 0.033028 -2.520552 1.739568 -0.755442 0.620619 0.657546 0.408187
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.804527 0.694305 0.772796 -1.206434 -0.690342 46.417537 4.346944 1.796669 0.646171 0.647921 0.408852
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.358733 1.891608 -1.565781 0.914088 -1.274283 -0.733381 0.440943 -0.659641 0.627623 0.660743 0.409734
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.699822 6.038815 4.841924 4.338596 8.400240 8.994828 -3.578513 -3.546385 0.620922 0.632099 0.401978
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
227 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
228 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
229 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 5.037456 1.071422 1.285477 -1.144321 0.711988 -2.530328 3.550837 -0.572815 0.531985 0.635137 0.440806
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.652351 -0.774209 1.215565 0.782044 -0.673514 -1.010946 -1.406021 -1.469220 0.647388 0.652449 0.414069
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.597302 1.700603 -0.051726 0.856026 -1.392240 21.727669 -0.210623 4.323325 0.640524 0.589788 0.422306
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
241 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
242 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
243 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
245 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
246 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
261 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.456839 12.137052 -0.758665 6.668643 -1.367838 10.943540 8.114290 2.501076 0.643446 0.047645 0.441629
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.888014 2.193436 1.165820 1.402620 0.346142 -0.243637 0.954253 -0.974623 0.542743 0.552195 0.401499
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.582128 -1.164087 1.270602 -1.312483 0.249254 -1.392042 -1.383565 -0.207930 0.577278 0.567825 0.412402
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 0.601124 -1.215538 -1.411185 -0.853795 24.648417 -1.374635 5.793061 0.882296 0.525117 0.561407 0.410071
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.718816 0.123794 -1.229280 -1.346863 -2.009735 -1.417033 0.661282 1.280436 0.510200 0.548867 0.402427
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, 7, 9, 15, 18, 19, 21, 22, 27, 28, 29, 30, 32, 34, 36, 37, 38, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 73, 74, 77, 78, 80, 81, 82, 83, 84, 86, 87, 88, 90, 92, 94, 96, 97, 98, 99, 100, 101, 102, 103, 104, 107, 108, 109, 110, 111, 113, 114, 116, 117, 118, 119, 121, 122, 123, 126, 131, 133, 135, 136, 137, 138, 140, 142, 143, 144, 145, 146, 147, 150, 155, 156, 158, 159, 161, 162, 163, 164, 165, 166, 170, 179, 180, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 203, 205, 206, 208, 209, 210, 211, 219, 222, 224, 225, 226, 227, 228, 229, 237, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 329]

unflagged_ants: [5, 8, 10, 16, 17, 20, 31, 35, 40, 41, 42, 48, 49, 61, 62, 64, 65, 66, 67, 69, 70, 72, 79, 85, 89, 91, 93, 95, 105, 106, 112, 115, 120, 124, 125, 127, 128, 129, 130, 132, 139, 141, 148, 149, 157, 160, 167, 168, 169, 181, 202, 207, 220, 221, 223, 238, 324, 325, 333]

golden_ants: [5, 10, 16, 17, 20, 31, 40, 41, 42, 65, 66, 67, 69, 70, 72, 85, 91, 93, 105, 106, 112, 124, 127, 128, 129, 130, 141, 157, 160, 167, 169, 181, 202]
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_2459896.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.0.5.dev4+g1a49ae0
3.1.5.dev171+gc8e6162
In [ ]: