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 = "2459901"
data_path = "/mnt/sn1/2459901"
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-17-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/2459901/zen.2459901.25284.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/2459901/zen.2459901.?????.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/2459901/zen.2459901.?????.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 2459901
Date 11-17-2022
LST Range 23.280 -- 9.232 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: 52
RF_ok: 19
digital_ok: 98
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 N09
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 89 / 201 (44.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 137 / 201 (68.2%)
Redcal Done? ❌
Never Flagged Antennas 53 / 201 (26.4%)
A Priori Good Antennas Flagged 71 / 98 total a priori good antennas:
3, 7, 9, 10, 15, 19, 20, 21, 29, 30, 31, 37,
38, 42, 45, 51, 53, 54, 55, 56, 59, 66, 68,
71, 72, 81, 84, 86, 88, 91, 93, 94, 98, 101,
103, 105, 106, 107, 108, 109, 111, 116, 117,
118, 121, 122, 123, 124, 127, 136, 140, 142,
143, 147, 155, 158, 161, 164, 165, 167, 170,
181, 182, 183, 184, 185, 186, 187, 189, 190,
191
A Priori Bad Antennas Not Flagged 26 / 103 total a priori bad antennas:
22, 35, 43, 46, 48, 62, 79, 82, 95, 115, 120,
132, 137, 138, 139, 148, 149, 168, 207, 220,
221, 223, 238, 239, 324, 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_2459901.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% 11.998494 -0.117474 9.183701 0.343876 7.090309 0.540484 0.834451 2.517413 0.038361 0.664076 0.490645
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.918799 0.905011 1.649537 0.356428 1.185186 2.100690 37.840403 75.980865 0.665108 0.662512 0.407274
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.634307 0.214519 -0.331884 -0.378134 0.257416 2.276303 2.224773 -0.200870 0.662391 0.664671 0.406229
7 N02 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
8 N02 RF_maintenance 100.00% 100.00% 100.00% 0.00% 296.251442 296.458372 inf inf 3405.101392 3379.736874 6669.603891 6576.143537 nan nan nan
9 N02 digital_ok 100.00% 100.00% 100.00% 0.00% 292.854338 292.900172 inf inf 4470.162559 4469.180072 10956.548263 10952.897706 nan nan nan
10 N02 digital_ok 0.00% 69.33% 69.33% 0.00% -0.084914 -0.388053 -1.148516 -0.706349 0.074831 1.016195 1.476319 0.457360 0.213201 0.213607 0.122964
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.264691 0.189378 2.113046 1.950833 -0.734747 -0.115655 0.878400 13.561407 0.653904 0.663068 0.407108
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.402045 -1.369038 -0.591489 0.190091 2.177794 2.560428 1.428959 2.800831 0.670796 0.670311 0.408364
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.294964 1.073378 -0.182828 -0.141483 0.678804 1.149501 2.735587 1.478633 0.662356 0.670608 0.410432
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.359443 21.229544 -0.614821 0.132954 1.414433 4.379097 17.979903 31.913975 0.647801 0.439324 0.486830
19 N02 digital_ok 100.00% 69.33% 69.33% 0.00% 0.213802 -1.322292 0.693054 1.032180 -0.006893 1.052510 6.836610 5.885547 0.216895 0.224651 0.120336
20 N02 digital_ok 0.00% 69.33% 69.33% 0.00% -1.097376 -1.040735 3.242977 -1.626246 0.270736 0.153305 0.760468 -0.664225 0.214018 0.224677 0.125622
21 N02 digital_ok 100.00% 69.33% 69.33% 0.00% 0.080377 -0.114531 -0.403831 3.966493 1.910125 -0.524257 0.557719 0.042859 0.214690 0.207695 0.124752
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.161859 -0.646120 -0.108474 -0.476936 3.409072 3.386761 -0.446783 -0.921325 0.617447 0.636551 0.409971
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.825633 13.027312 9.208897 9.717517 7.278014 7.289047 2.569880 1.954608 0.036582 0.041126 0.004841
28 N01 RF_maintenance 100.00% 0.00% 86.86% 0.00% 14.463430 28.611027 1.091487 0.787373 2.390866 6.189787 3.914021 19.716742 0.347046 0.150146 0.245926
29 N01 digital_ok 100.00% 0.00% 100.00% 0.00% -1.322764 13.634123 -0.288754 9.333948 0.684448 7.275300 -0.357600 0.317217 0.668618 0.040821 0.509275
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.852666 -0.108541 -0.858237 0.216940 1.913790 0.144729 7.368159 0.019241 0.664559 0.675024 0.404086
31 N02 digital_ok 0.00% 69.33% 69.33% 0.00% 0.245986 -1.317904 0.860352 1.070768 2.692178 1.298571 1.888303 0.905474 0.226627 0.226472 0.117488
32 N02 RF_maintenance 100.00% 69.33% 69.33% 0.00% 11.019160 25.330665 -0.060666 2.041718 8.183457 4.157506 4.202444 7.291084 0.218239 0.193982 0.110865
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 14.042930 -0.958942 3.963305 -0.811095 7.152266 1.722734 1.044895 1.548250 0.048677 0.650426 0.461125
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.102700 -0.027504 0.546495 -1.698188 -0.484356 -0.406058 -1.110172 -0.488669 0.628723 0.632243 0.406893
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.133105 9.815918 -0.163101 0.113096 0.555071 1.865098 1.216229 1.851043 0.662633 0.669766 0.403873
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.763423 0.471026 -1.472396 0.414114 0.445462 1.122443 -0.818316 6.618785 0.675232 0.680868 0.411143
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.331226 0.141074 -0.130210 0.239791 -0.075558 -0.043664 6.640919 1.284350 0.676328 0.685640 0.411926
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.592496 0.955400 -0.169821 0.228931 -0.711956 0.429727 -0.219986 1.407003 0.671061 0.676945 0.401193
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.721107 0.819760 -0.879182 -0.249702 3.103038 0.056240 -0.282583 0.561293 0.674768 0.674323 0.393227
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 12.956012 14.185937 9.416443 10.153838 6.968928 7.070546 0.769100 1.640917 0.039329 0.035954 0.001403
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.659806 0.488090 -0.278606 0.230094 -0.822276 0.633354 -1.036637 0.533696 0.682067 0.682017 0.407693
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.930848 0.349277 -0.914303 -0.388798 -0.269925 0.433225 -0.755727 -0.106439 0.674933 0.686515 0.414501
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -0.372305 2.119694 -0.043894 0.052604 -0.418667 3.391879 0.731214 4.378383 0.661034 0.663911 0.406279
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.017927 2.068537 1.138385 1.498348 -0.604580 0.011285 0.016579 -2.160101 0.651774 0.685282 0.427894
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 13.054400 1.100931 3.791377 -1.539653 7.141122 -0.967622 1.660812 7.651282 0.042153 0.642746 0.436824
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.044666 0.658450 -0.207755 1.106100 -0.717579 1.010756 -0.963056 -2.017262 0.625646 0.659902 0.411941
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.203501 0.104287 -1.246161 -1.723137 -0.924680 -1.002074 -0.001714 6.908676 0.581239 0.620047 0.393959
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.870867 23.144868 -0.065594 0.868007 0.626986 4.545239 8.764448 59.019452 0.657033 0.607421 0.376297
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 28.303179 0.996880 11.813110 -0.134528 7.460078 4.175367 10.321807 6.671569 0.046053 0.685522 0.499439
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.373552 8.006997 -0.527847 0.189721 0.468147 0.812231 0.510280 0.436465 0.681893 0.692276 0.396360
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.678010 3.046585 -0.436356 -0.196754 2.396619 1.958897 2.528314 5.091694 0.686456 0.694903 0.402653
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 12.000466 13.852342 9.214811 9.934314 7.181648 7.228744 2.337015 1.358737 0.036820 0.035777 0.001445
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.954994 14.655116 0.479984 9.845438 3.028754 7.258387 4.008163 3.094797 0.673169 0.038358 0.464678
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.600572 14.712199 0.060272 10.036560 -0.357783 7.139233 1.680307 1.190750 0.673344 0.042924 0.479015
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 33.206772 -0.123081 5.212598 0.263035 1.781051 0.655499 6.610872 2.510958 0.478254 0.684520 0.416538
58 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.076953 13.441657 -0.618968 9.818836 0.312089 7.194012 1.230846 1.233454 0.668347 0.040028 0.443301
59 N05 digital_ok 100.00% 100.00% 62.63% 0.00% 12.576501 12.484849 8.643549 9.249078 6.934284 6.605996 1.096646 1.589205 0.050781 0.218395 0.132596
60 N05 RF_maintenance 100.00% 0.00% 98.16% 0.00% -1.434241 13.300640 -0.325228 9.852294 -1.334119 7.229693 -1.371450 2.649297 0.671649 0.079772 0.491832
61 N06 not_connected 100.00% 73.50% 0.00% 0.00% 13.250740 -0.148365 3.465043 -1.325494 6.843296 -1.903033 0.075678 0.575662 0.192235 0.648673 0.494175
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.257423 1.228510 -1.740758 0.819817 -0.762725 -0.998888 0.565572 -1.780776 0.614261 0.663559 0.408319
63 N06 not_connected 100.00% 100.00% 100.00% 0.00% 255.396766 254.803609 inf inf 7.604584 7.450686 -5.018927 -5.058984 nan nan nan
64 N06 not_connected 100.00% 100.00% 100.00% 0.00% 255.389815 254.794230 inf inf 7.630211 7.598302 -5.000329 -5.004907 nan nan nan
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.429416 0.852373 0.138716 0.635205 0.429538 1.094729 1.754697 1.511004 0.657837 0.682068 0.406060
66 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.537128 1.550954 1.668928 1.592071 4.459550 0.221736 -0.364315 1.029434 0.668140 0.685722 0.399037
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.687077 -0.502187 1.712527 1.624957 -0.665669 0.027696 0.293651 2.102578 0.671619 0.685235 0.389498
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.995974 31.566650 0.296745 13.018880 0.001003 7.295182 0.699859 9.761280 0.683850 0.036991 0.495613
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.117166 -0.468947 0.060182 0.314969 -0.456467 1.339719 -0.295707 0.689012 0.681050 0.694434 0.389596
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.898107 -0.185154 -0.726462 -0.361557 2.080744 1.878731 0.025157 -0.189151 0.685516 0.695993 0.395527
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 8.479946 0.166244 0.267949 0.801025 -0.196644 -0.244565 0.798888 0.813152 0.689827 0.693031 0.399720
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 2.719742 0.195487 0.339840 0.772327 0.074564 -0.287629 11.479492 2.959436 0.672820 0.682914 0.400214
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.328465 0.857611 -1.107810 1.854260 0.457648 10.410195 -0.151243 0.279770 0.682563 0.678811 0.412869
74 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.029440 9.839985 -0.152259 -1.104083 -0.389977 5.272015 -0.234870 7.803469 0.678845 0.668651 0.396226
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 25.895308 29.559709 0.023264 -0.826054 1.536933 1.626588 12.745397 5.389671 0.519202 0.481548 0.218942
78 N06 not_connected 100.00% 100.00% 100.00% 0.00% 255.416481 254.796428 inf inf 7.251245 7.592338 -5.100854 -5.006895 nan nan nan
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.116650 -0.424723 -0.904547 -1.244049 -0.565095 -0.554622 1.024547 -0.301023 0.618638 0.646784 0.403466
80 N11 not_connected 100.00% 4.65% 100.00% 0.00% 10.282229 15.309524 2.065858 4.289053 4.274888 7.146180 10.891100 0.944155 0.286755 0.043186 0.162310
81 N07 digital_ok 100.00% 0.00% 0.00% 0.00% -0.752098 0.014623 -0.558699 1.405601 0.181407 31.291840 -0.216809 1.760974 0.639769 0.648043 0.393870
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.473453 -0.462970 -0.129935 1.558076 0.445630 -0.130984 0.003866 0.381656 0.660551 0.668252 0.390602
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.552566 -0.067426 -0.375307 0.057064 0.038466 -1.044938 -0.672369 0.428190 0.670912 0.685457 0.385340
84 N08 digital_ok 100.00% 23.47% 100.00% 0.00% 23.505588 27.837836 11.891127 12.590049 5.650900 7.152220 4.602892 5.204187 0.241472 0.039556 0.141772
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.401417 0.379858 0.211315 0.953518 -0.570659 -0.397012 -0.615295 -0.262378 0.682229 0.688344 0.386118
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.179999 -0.171775 1.658425 1.210658 5.776495 -0.793734 0.380999 17.484102 0.667241 0.686032 0.381730
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.483739 8.765122 0.566379 -0.429316 12.976996 1.354645 3.697692 2.752163 0.639847 0.700612 0.382752
88 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 0.741225 0.399394 0.040268 0.681240 -0.911950 1.183396 5.378807 1.468058 0.075086 0.080462 0.012654
89 N09 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.534644 0.633095 -0.208188 0.513153 -0.665005 -0.600318 -0.514468 -0.279832 0.069099 0.074145 0.008438
90 N09 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.087942 -0.514417 1.067873 0.906965 -0.037025 -0.950108 0.716206 3.513062 0.078799 0.082662 0.013950
91 N09 digital_ok 0.00% 100.00% 100.00% 0.00% -0.639210 -0.134500 -0.030546 0.004061 -0.809229 -0.521736 0.573368 -0.007189 0.090335 0.089359 0.024529
92 N10 RF_maintenance 100.00% 5.08% 21.15% 0.00% 43.460860 51.275446 0.329433 0.824825 4.210816 5.352395 1.474668 9.505252 0.275990 0.233373 0.088399
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 2.097380 0.443080 1.835307 0.019963 0.248359 1.060168 5.539095 -0.347587 0.655042 0.682726 0.408204
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 13.247169 -0.800521 9.353313 -0.513577 7.072326 0.643048 0.880422 5.003078 0.037229 0.677905 0.411620
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.286684 -0.149090 -0.843834 0.568624 0.326642 -0.824593 0.097072 2.104209 0.624271 0.664619 0.413830
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.471894 14.804430 3.786298 4.455034 6.966945 7.050396 0.952165 0.660702 0.034617 0.040100 0.003071
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.199485 4.144218 0.142265 0.019415 -0.758073 -0.224156 -1.191166 10.154232 0.616922 0.599715 0.404391
98 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 1.371967 5.152846 -0.211232 0.000361 -0.108019 0.442408 0.194666 2.762463 0.637682 0.654194 0.394548
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.313284 -0.804770 0.556305 0.552840 -0.283095 2.698194 2.390456 -0.289514 0.644100 0.671437 0.395799
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -1.553345 -0.979869 -0.903688 0.085119 2.293776 -0.650813 -0.063822 0.424746 0.662977 0.679827 0.386447
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.377800 8.896052 -0.794245 0.670362 -0.225096 1.240391 0.051255 0.034406 0.688131 0.697398 0.381203
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.362142 0.588670 -1.390349 2.450165 1.260962 -0.117519 -0.594892 5.598228 0.691287 0.687319 0.378967
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.215817 6.170267 3.954298 0.450073 3.088849 1.529419 5.680995 3.584767 0.660130 0.696018 0.383322
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.469225 69.158462 6.195676 6.985063 2.632192 10.495215 0.159123 2.415452 0.625823 0.666095 0.389641
105 N09 digital_ok 0.00% 100.00% 100.00% 0.00% -0.035242 -0.233716 -0.306823 0.563930 1.461591 -0.661392 -0.399003 -0.262522 0.076193 0.085384 0.013087
106 N09 digital_ok 0.00% 100.00% 100.00% 0.00% -0.425626 0.526236 0.885667 0.797103 1.395011 0.080462 0.128203 -0.090423 0.068161 0.071651 0.007957
107 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 1.264325 0.630458 -0.710620 -0.273590 0.076521 -0.343743 7.700845 7.181094 0.062375 0.067489 0.006383
108 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 12.088775 4.394858 9.142925 -0.507217 7.168401 0.147250 1.916168 -0.045781 0.028890 0.078234 0.048362
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.786172 13.454961 0.240364 9.604667 -0.343463 7.328971 2.090500 1.924518 0.668166 0.040549 0.415539
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 10.527654 29.883997 0.272804 12.749756 7.657283 7.130231 3.940783 5.107201 0.641919 0.035692 0.380165
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.282640 13.421720 0.164010 9.722982 -0.095758 7.332985 0.000285 2.459341 0.662226 0.040430 0.416786
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.464295 1.000095 -0.221270 -0.304564 0.567693 2.167720 0.401581 -0.159168 0.650389 0.669177 0.410162
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 14.409626 14.858381 3.580998 4.355187 6.985863 7.086949 1.431314 0.612256 0.038418 0.031029 0.004382
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 6.436223 0.567657 0.903164 -0.575239 6.101688 -0.841822 2.411278 -0.731497 0.521455 0.640309 0.427697
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.725971 1.379587 2.104196 1.345256 1.690160 -0.428316 -2.594886 -1.420799 0.611354 0.639671 0.422108
116 N07 digital_ok 100.00% 0.00% 0.00% 0.00% -0.267764 0.199924 -0.393694 0.274528 1.525244 0.357067 3.825776 5.756130 0.632684 0.650196 0.398647
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 13.128672 15.137758 9.244158 10.162196 7.016832 7.196012 1.421164 3.999173 0.027994 0.034492 0.003882
118 N07 digital_ok 100.00% 0.00% 0.00% 0.00% -0.311893 1.102954 -0.440611 0.470951 -0.248766 0.143276 3.000089 4.317881 0.661271 0.682522 0.389787
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.285980 1.249492 -1.688798 1.678259 0.434875 10.638356 0.227701 2.893863 0.676399 0.674796 0.383948
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.424529 2.835780 2.166487 1.752920 0.412845 0.265524 1.558313 -2.670036 0.670533 0.697301 0.372729
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.272767 5.438149 -0.613340 1.104848 0.161696 1.407290 19.033736 16.725894 0.690528 0.700781 0.381439
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.654174 8.004717 -0.667545 0.380115 1.527839 1.423309 0.042801 -0.457707 0.695665 0.703180 0.389888
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.444775 10.367021 0.130376 0.685077 1.484738 0.077222 -0.346004 0.299308 0.691343 0.701846 0.397421
124 N09 digital_ok 0.00% 100.00% 100.00% 0.00% -0.967634 -0.183207 -0.398496 0.267923 -0.645068 0.285293 0.382305 1.036655 0.074100 0.080596 0.010632
125 N09 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.351775 -1.103728 -0.687701 0.551679 0.224533 -0.162933 -0.036540 -0.304474 0.070692 0.079000 0.009110
126 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% 0.504488 4.143201 -0.894833 1.036456 4.701284 0.531773 2.308037 0.444624 0.081401 0.082532 0.017129
127 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.467333 0.513122 -0.260501 0.030514 3.456765 2.407259 0.837463 4.394666 0.673321 0.691854 0.412799
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.604111 0.198693 1.159233 0.723539 -0.483753 2.829887 -0.413455 1.104296 0.665771 0.685493 0.407850
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.744508 -1.999738 -0.166319 0.068197 -0.565177 -0.223818 -0.264224 2.036598 0.662613 0.683700 0.411950
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.519541 0.664999 -0.282217 0.058027 -0.856533 0.935058 1.909865 3.107655 0.644428 0.674208 0.405261
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.293250 14.996704 3.821770 4.577822 7.134623 7.203505 2.982747 -0.283022 0.035905 0.042562 0.002536
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.195114 0.363782 0.026991 -1.253414 -0.745769 -1.256270 0.625072 0.048475 0.615581 0.629540 0.408919
133 N11 not_connected 100.00% 100.00% 84.37% 0.00% 13.856615 19.954358 3.586121 3.140075 7.103407 5.644246 1.501007 0.877983 0.045286 0.172908 0.081081
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.999453 13.446691 -0.125227 9.920150 0.438974 7.152413 -0.180230 1.344499 0.629287 0.044049 0.430798
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 6.674550 0.169298 7.342972 4.615676 13.776411 25.095467 0.454080 0.771939 0.450983 0.612571 0.413441
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.027504 -0.501326 -0.600587 -0.385098 3.197749 3.259417 0.154591 0.847318 0.644241 0.670624 0.400235
138 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.247339 -0.151744 -0.060740 0.680038 0.264005 -0.039571 1.346824 -0.003866 0.666673 0.685425 0.398801
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.820260 -0.653885 1.179851 -1.239413 0.128667 -1.840902 -1.374137 0.702573 0.670785 0.677452 0.383358
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.728633 4.159408 -0.179458 2.582398 -1.111940 3.035258 2.384059 -1.743614 0.684483 0.692939 0.379527
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.331510 -0.774901 -0.862646 0.323789 -0.049330 -1.644904 0.491058 -1.402637 0.682422 0.702701 0.384013
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 1.107633 13.228322 -1.350751 9.857438 2.822127 7.260416 19.931754 1.825810 0.684127 0.052242 0.504230
143 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 12.279450 -0.109410 9.302102 0.069460 6.912785 2.498732 0.138963 0.184181 0.042706 0.698675 0.501735
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.353716 -0.474025 -0.490591 3.170726 0.404235 -0.011285 -0.468289 -0.304812 0.677491 0.678167 0.408150
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.283577 2.894671 -0.563471 6.376707 0.018380 18.119662 -0.119713 1.062322 0.669502 0.605733 0.427245
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.699534 1.664788 -1.522950 0.662176 0.845884 -1.169747 1.446195 -1.899978 0.632847 0.683821 0.419251
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.759107 -1.417597 1.272931 1.836536 5.067840 -0.504956 -0.029340 -0.014934 0.661074 0.678791 0.402933
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.813991 -0.122120 2.794205 1.385111 -1.122007 1.199691 0.455923 -0.270420 0.646760 0.681625 0.412096
149 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.949130 1.339871 -1.384598 1.392244 -1.123562 -0.671317 -0.547204 -2.149411 0.661385 0.682241 0.412602
150 N15 RF_maintenance 100.00% 100.00% 6.33% 0.00% 12.796319 -0.088586 9.206844 -1.103301 7.209861 3.358350 2.194013 0.024488 0.047545 0.263153 0.114271
155 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.382609 1.429828 -0.318424 6.640201 0.818760 22.830166 2.125996 1.296334 0.634180 0.541923 0.430032
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.133350 12.999074 -0.657145 9.591483 3.881209 7.291926 4.316684 0.601947 0.641359 0.045475 0.445224
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.453644 0.069886 -0.004061 0.390725 -0.125514 0.159262 -0.377143 0.049927 0.648689 0.669039 0.406334
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.310271 -0.236160 -0.927482 -1.020983 3.277509 1.981865 3.574912 14.634394 0.666358 0.682996 0.408307
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.129639 27.865032 -1.685507 -1.076585 -1.353676 4.818527 -0.428075 46.028952 0.640656 0.551912 0.372525
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.480126 -1.165013 -0.668943 -1.059098 -0.244065 1.845712 0.189408 0.676612 0.677604 0.691438 0.391437
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.655861 33.677115 -0.521959 -0.775477 -0.105541 -0.070238 -0.367118 0.477416 0.678094 0.562123 0.356710
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.879654 -0.097100 1.979620 0.922194 -0.023492 -1.350066 -1.038290 -1.749500 0.681818 0.700009 0.392159
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.683983 1.568150 -0.597089 0.088492 0.154284 0.934296 1.896516 1.424682 0.683017 0.696813 0.402892
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.072185 0.641391 2.422861 -0.550413 28.231759 2.312137 1.768447 0.646820 0.652170 0.696618 0.413806
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 34.664781 0.339759 2.078332 0.236913 3.091414 0.133125 0.905665 -0.191302 0.498621 0.687178 0.403910
166 N14 RF_maintenance 100.00% 0.00% 100.00% 0.00% 34.777161 12.616776 -0.071869 9.455388 3.086357 7.278586 43.004402 1.192937 0.536390 0.039378 0.329322
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.372018 -0.876834 -1.066436 0.872682 1.680919 -0.029903 -0.955246 4.319037 0.676462 0.687132 0.413696
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.639162 -0.894965 -0.352961 -0.687535 2.248073 0.863669 -0.424777 1.187568 0.666961 0.688444 0.415666
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.913561 1.958325 -1.289091 -1.646505 0.466347 -0.600456 -0.784241 -0.986243 0.664622 0.671978 0.412356
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 12.878425 -0.409275 9.364078 -1.098947 6.989249 0.032184 0.831832 5.327569 0.043144 0.679163 0.505991
179 N12 RF_maintenance 100.00% 100.00% 79.39% 0.00% 13.009941 13.565514 9.358563 10.177120 6.846461 5.796227 0.578062 1.157625 0.071177 0.172700 0.091553
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.284411 14.287717 0.298649 9.982399 -0.432231 7.154950 18.788342 2.305543 0.668257 0.058551 0.512023
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.007716 -0.040905 -0.577267 0.240626 0.429396 -0.045032 -0.444373 4.720943 0.681256 0.688422 0.397198
182 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.077434 4.866934 -1.443405 2.742830 -0.531806 2.716619 9.120117 -2.083419 0.684168 0.682575 0.400223
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.968946 1.277407 0.551324 4.510146 2.272321 -1.026449 0.723054 0.098651 0.671255 0.641178 0.392465
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 12.286100 13.837721 9.287322 9.869821 7.164851 7.251197 0.716719 1.028494 0.027032 0.025426 0.001534
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 9.745628 1.132915 8.612919 6.770455 7.354615 2.037817 0.150137 0.213406 0.302017 0.595350 0.433698
186 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.628197 2.190446 9.295755 1.746949 7.152988 0.697722 2.259609 -2.502957 0.052718 0.688686 0.484785
187 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 12.339984 2.185585 9.055217 1.379771 7.306176 -0.647741 2.363585 -0.957031 0.052031 0.687236 0.488608
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 10.143020 10.288959 1.494628 0.048663 1.223538 4.093992 0.431714 2.443783 0.333189 0.358321 0.164250
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 50.585252 13.542884 -0.394200 9.949357 3.709183 7.159190 41.136568 3.266078 0.465669 0.039403 0.324416
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.148747 0.328388 3.252535 -0.100989 -0.182423 -0.339224 11.114204 0.499636 0.616902 0.660481 0.438653
200 N18 RF_maintenance 100.00% 100.00% 38.45% 0.00% 14.072538 39.950303 3.767517 0.296010 7.298205 4.899448 1.621044 -0.973766 0.051068 0.214111 0.133343
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.266226 7.169549 4.389819 3.650966 5.666583 4.732302 -4.131628 -3.417169 0.627582 0.644912 0.391192
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% 1.077689 2.179956 0.513706 -0.365699 -1.007091 0.343188 -0.566591 3.171490 0.657319 0.630943 0.398712
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 255.394892 254.804576 inf inf 7.546021 7.433312 -5.095461 -5.062084 nan nan nan
205 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
206 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.107179 2.711972 1.070626 -0.936439 0.078211 -0.118757 -1.462327 -0.990292 0.624001 0.635766 0.389538
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% 100.00% 100.00% 0.00% 255.392049 254.796335 inf inf 7.668100 7.600822 -5.027947 -5.009280 nan nan nan
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.171778 -0.956022 -0.246492 -0.569179 -1.555411 -1.008982 2.779143 -0.362984 0.650839 0.653617 0.403855
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.900733 0.198137 -0.910097 -0.717535 0.770208 -1.341412 1.292318 -0.622258 0.618142 0.659027 0.411703
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 1.136269 0.887870 0.427258 -0.695075 -0.679112 -2.019878 4.369651 -0.094621 0.647153 0.656860 0.406337
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.030302 2.094555 -1.713132 0.273116 -0.741238 -1.125318 -0.112711 3.473068 0.626013 0.658868 0.413862
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.346343 7.720296 4.556222 4.113159 5.839953 5.627879 -4.320702 -4.209685 0.617539 0.630711 0.406763
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% 6.751579 2.017955 1.274680 -1.431124 0.652699 -0.980323 1.158906 -0.477250 0.523654 0.631895 0.444275
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.427727 -0.906432 0.899344 0.427274 -0.870756 -0.677664 -1.934004 -1.818063 0.648160 0.650803 0.418799
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.405892 2.663361 -0.613580 0.952185 -1.171807 -1.290872 -0.047848 3.515815 0.638508 0.585806 0.425373
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.251339 14.878598 -0.609690 6.412702 -0.210253 7.285739 6.656884 3.091625 0.649832 0.054189 0.499647
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.194150 2.725950 0.885323 1.122230 0.548583 0.192832 0.031204 -1.500093 0.540842 0.549887 0.404379
325 N09 dish_ok 0.00% 100.00% 100.00% 0.00% 0.231914 -1.361829 0.970327 -1.539045 0.102706 -0.721795 -1.691006 -0.238864 0.087894 0.092318 0.035380
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.190901 -0.835163 -1.562565 -1.159230 -0.876832 -1.282353 5.453561 0.838562 0.512818 0.556409 0.406372
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.667372 0.685188 -1.068135 -1.657688 -1.125160 -1.032807 1.646248 0.391180 0.507169 0.546714 0.402878
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, 8, 9, 10, 15, 18, 19, 20, 21, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 42, 45, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 63, 64, 66, 68, 71, 72, 73, 74, 77, 78, 80, 81, 84, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96, 97, 98, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 113, 114, 116, 117, 118, 119, 121, 122, 123, 124, 125, 126, 127, 131, 133, 135, 136, 140, 142, 143, 145, 147, 150, 155, 156, 158, 159, 161, 164, 165, 166, 167, 170, 179, 180, 181, 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, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 325, 329]

unflagged_ants: [5, 16, 17, 22, 35, 40, 41, 43, 44, 46, 48, 62, 65, 67, 69, 70, 79, 82, 83, 85, 95, 99, 100, 112, 115, 120, 128, 129, 130, 132, 137, 138, 139, 141, 144, 146, 148, 149, 157, 160, 162, 163, 168, 169, 202, 207, 220, 221, 223, 238, 239, 324, 333]

golden_ants: [5, 16, 17, 40, 41, 44, 65, 67, 69, 70, 83, 85, 99, 100, 112, 128, 129, 130, 141, 144, 146, 157, 160, 162, 163, 169, 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_2459901.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 [ ]: