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 = "2460038"
data_path = "/mnt/sn1/2460038"
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: 4-3-2023
In [5]:
# Per-season options
def ant_to_report_url(ant):
    return f'https://htmlpreview.github.io/?https://github.com/HERA-Team/H6C_Notebooks/blob/main/antenna_report/antenna_{ant}_report.html'

Load Auto Metrics¶

In [6]:
use_auto_metrics = False

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

# if it exists, load and extract relevant information
if len(auto_metrics_file) > 0:
    auto_metrics_file = auto_metrics_file[0]
    print(f'Found auto_metrics results file at {auto_metrics_file}.')
    
    auto_metrics = load_metric_file(auto_metrics_file)
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
    auto_ex_ants = auto_metrics['ex_ants']['r2_ex_ants']
    
    use_auto_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping auto_metrics.')
Found auto_metrics results file at /mnt/sn1/2460038/zen.2460038.21304.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 1850 ant_metrics files matching glob /mnt/sn1/2460038/zen.2460038.?????.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/2460038/zen.2460038.?????.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 2460038
Date 4-3-2023
LST Range 7.325 -- 17.281 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 184 / 198 (92.9%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 123 / 198 (62.1%)
Redcal Done? ❌
Never Flagged Antennas 10 / 198 (5.1%)
A Priori Good Antennas Flagged 89 / 93 total a priori good antennas:
5, 7, 9, 10, 15, 16, 17, 19, 20, 21, 29, 31,
37, 38, 40, 41, 42, 44, 45, 53, 54, 55, 56,
65, 66, 67, 69, 70, 71, 72, 81, 83, 85, 86,
88, 93, 94, 101, 103, 106, 107, 109, 111, 112,
118, 121, 122, 123, 124, 127, 128, 136, 140,
141, 145, 146, 147, 148, 149, 150, 151, 157,
158, 160, 161, 162, 163, 164, 165, 166, 167,
168, 169, 170, 171, 172, 173, 181, 182, 183,
184, 186, 187, 189, 190, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 6 / 105 total a priori bad antennas:
43, 57, 73, 74, 89, 125
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_2460038.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
4 N01 RF_maintenance 100.00% 8.54% 77.78% 0.00% -1.454227 18.420106 -0.680768 -0.430510 -0.768094 1.773433 -0.906703 23.333448 0.242744 0.173442 0.139139
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 11.561276 14.561149 11.041825 11.441651 4.561602 4.638796 1.970892 2.084959 0.019409 0.018091 0.000658
7 N02 digital_ok 100.00% 100.00% 100.00% 0.00% -1.033725 0.136776 -0.681746 0.208167 0.082191 0.599836 2.511828 4.240451 0.052439 0.056913 0.016722
8 N02 RF_maintenance 0.00% 100.00% 100.00% 0.00% 3.962938 3.840956 2.506548 2.469622 2.397130 2.527567 -2.821426 -2.807920 0.050041 0.055209 0.015239
9 N02 digital_ok 0.00% 100.00% 100.00% 0.00% 1.525769 -0.609316 3.375575 -0.564967 1.741324 0.277523 1.107904 0.333255 0.050223 0.052115 0.018059
10 N02 digital_ok 0.00% 30.27% 10.97% 0.00% -0.747223 -0.852585 0.245673 -0.804003 -0.324270 0.004873 -0.244211 0.452093 0.219582 0.229546 0.129328
15 N01 digital_ok 100.00% 73.46% 24.05% 0.00% 23.704515 -0.065620 0.332135 -0.280698 0.813250 0.517215 1.864850 2.063396 0.183217 0.236080 0.148562
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.425530 15.185383 -0.233422 11.699052 0.883549 4.597920 2.541838 3.674950 0.276528 0.020308 0.147999
17 N01 digital_ok 100.00% 0.00% 82.16% 0.00% 0.108734 4.630822 0.964155 9.701647 1.363644 0.539997 0.708344 2.940269 0.282890 0.165831 0.167450
18 N01 RF_maintenance 100.00% 100.00% 90.38% 0.00% 11.773590 6.399088 11.065147 1.080901 4.544501 1.277774 1.157290 23.466745 0.018694 0.143432 0.091522
19 N02 digital_ok 100.00% 13.51% 0.32% 0.00% -0.396104 -0.096470 -0.404418 1.493211 0.050359 4.305488 0.736278 5.876547 0.241178 0.253649 0.147653
20 N02 digital_ok 100.00% 24.76% 0.38% 0.00% 1.435751 -1.217021 1.924890 -0.482475 4.318008 0.387603 2.378580 0.823725 0.235231 0.259011 0.145897
21 N02 digital_ok 0.00% 28.49% 0.43% 0.00% 0.574652 0.570167 -0.093578 0.401182 0.982306 0.793492 0.571135 0.720355 0.229087 0.254624 0.142546
22 N06 not_connected 0.00% 30.32% 0.43% 0.00% -1.210881 -0.443936 -0.655929 -0.608060 -0.692960 -0.075267 0.128219 -0.117391 0.230776 0.266355 0.154339
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.544762 32.518461 10.576294 6.456014 3.724857 2.668717 8.654823 37.501691 0.039244 0.039442 -0.001339
28 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.963972 18.811238 10.963525 4.356410 4.559071 0.761912 2.145823 18.145330 0.017157 0.104036 0.058979
29 N01 digital_ok 0.00% 0.00% 1.46% 0.00% -1.158618 -0.723643 -0.739736 -0.464286 0.230678 0.287996 0.302716 0.216791 0.293579 0.269798 0.175333
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.504091 -1.023042 0.953529 -0.870368 1.903950 -0.444822 3.184596 -0.002883 0.284674 0.286327 0.180431
31 N02 digital_ok 100.00% 10.97% 0.32% 0.00% 1.249982 -0.166664 1.286243 3.258841 1.818945 1.248562 1.278221 8.903203 0.261625 0.266864 0.157042
32 N02 RF_maintenance 100.00% 36.11% 6.97% 0.00% 21.237406 23.003279 -0.206469 -0.092609 -0.275607 -0.311924 1.494813 3.078230 0.209224 0.230055 0.089402
34 N06 not_connected 100.00% 100.00% 0.43% 0.00% 12.565458 0.463805 5.992829 -0.019414 4.511627 -0.499373 0.991989 -0.342235 0.020132 0.289328 0.131590
35 N06 not_connected 0.00% 30.32% 0.43% 0.00% 0.195500 -0.969654 0.437164 -0.696459 -0.205025 -0.511430 0.199014 0.720778 0.239433 0.270429 0.148576
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.462931 7.664289 1.272438 0.991338 1.425163 1.439233 -0.443319 -0.339881 0.043897 0.047859 0.010319
37 N03 digital_ok 100.00% 53.89% 100.00% 0.00% -0.234650 24.004504 -0.192546 13.576113 -0.836881 4.585005 -1.322033 3.238837 0.196711 0.018792 0.116104
38 N03 digital_ok 100.00% 42.92% 47.73% 0.00% -0.472332 0.115082 -0.270604 0.185819 0.486811 0.461944 1.636339 4.744633 0.208800 0.206153 0.134515
40 N04 digital_ok 100.00% 97.78% 97.78% 2.22% 1.293745 1.388569 0.016961 -0.468819 0.679923 0.672673 7.849390 1.506446 0.094888 0.097336 -0.108398
41 N04 digital_ok 0.00% 0.00% 8.22% 0.00% 0.956034 1.662218 1.478464 2.153836 2.023517 0.656292 0.955061 1.251066 0.257072 0.250016 0.162261
42 N04 digital_ok 100.00% 86.38% 86.49% 13.51% 0.081080 3.602708 -0.366329 0.748410 0.671072 11.528744 -0.143714 1.599760 0.110464 0.109587 -0.131836
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.541332 -0.071405 -0.476674 0.948366 -0.780068 1.262572 -0.024300 1.340151 0.297843 0.290730 0.180804
44 N05 digital_ok 0.00% 100.00% 100.00% 0.00% -0.752916 0.824465 -1.015148 0.545444 -0.481846 0.779703 -0.557611 -0.059071 0.049854 0.056937 0.018978
45 N05 digital_ok 100.00% 10.86% 0.32% 0.00% 1.124939 4.169027 0.866981 0.931908 1.060361 1.663991 1.455321 7.638525 0.255906 0.270510 0.157208
46 N05 RF_maintenance 0.00% 13.30% 0.32% 0.00% -0.520459 -0.336755 -0.032868 -0.918995 0.412331 -0.596810 0.136406 -0.340767 0.244764 0.275696 0.158239
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.687482 14.969166 5.900306 5.931193 4.511436 4.571461 2.072344 0.948144 0.016929 0.025927 0.005950
48 N06 not_connected 0.00% 30.70% 0.43% 0.00% -0.229850 1.132291 -0.444356 1.007986 -0.878956 0.955701 -0.273154 -1.214565 0.241339 0.283647 0.152139
49 N06 not_connected 100.00% 35.62% 2.49% 0.00% -0.703807 -0.618192 0.532083 -0.853830 -0.287349 -0.688391 0.084094 5.081667 0.222245 0.256493 0.145427
50 N03 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.816445 1.790351 0.442582 1.877128 0.812343 1.863713 -0.512262 -0.232428 0.046083 0.046964 0.012448
51 N03 dish_maintenance 100.00% 62.76% 62.16% 0.00% 3.545527 1.491385 0.198845 -0.429546 0.713700 0.826961 55.547751 0.883730 0.191426 0.189477 0.120810
52 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.790316 5.307957 0.084548 -0.150127 0.863099 0.709322 0.175066 -0.334000 0.044043 0.046790 0.012628
53 N03 digital_ok 100.00% 23.78% 34.65% 0.00% 0.593575 1.455284 -0.053599 -0.282492 1.537140 -0.507400 5.712745 3.508455 0.228569 0.225983 0.145911
54 N04 digital_ok 100.00% 99.95% 97.30% 0.00% 8.962349 3.999845 1.965624 -0.222460 2.797415 1.380719 -1.805224 -0.276658 0.114429 0.140559 0.058553
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 1.007955 52.385132 0.723262 7.834315 0.347956 4.757220 0.505327 2.969318 0.046263 0.016647 0.016208
56 N04 digital_ok 0.00% 0.00% 4.70% 0.00% -0.821374 2.633388 -0.759523 2.266835 -0.854239 2.684336 -1.130389 0.578708 0.274830 0.265040 0.170659
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.552048 0.140462 -0.393687 -0.608811 -0.610439 0.517751 0.553252 1.046621 0.297136 0.293772 0.188433
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.319653 14.032264 11.001704 11.616577 4.515019 4.595898 1.724175 2.083165 0.016931 0.017157 0.000800
59 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.461730 1.072980 11.040935 1.283094 4.475451 2.159428 2.064785 2.030430 0.017867 0.059078 0.027975
60 N05 RF_maintenance 100.00% 10.86% 100.00% 0.00% 2.964365 13.942472 0.114983 11.649387 0.402970 4.566561 1.607611 3.712800 0.262727 0.033092 0.124339
61 N06 not_connected 0.00% 30.49% 0.43% 0.00% 1.627866 -0.400553 0.906967 -0.707971 -0.139215 -0.619578 0.639625 0.846635 0.234437 0.293771 0.167240
62 N06 not_connected 0.00% 31.14% 0.43% 0.00% -0.406329 1.378701 0.012301 0.775616 -0.629999 0.115870 0.191186 -1.356535 0.230151 0.285189 0.155781
63 N06 not_connected 100.00% 33.35% 100.00% 0.00% -0.074471 14.453232 -0.634596 6.332731 -0.727774 4.628728 -0.000932 2.513552 0.234935 0.021012 0.122715
64 N06 not_connected 0.00% 48.38% 23.89% 0.00% -0.331815 -0.475516 -1.008963 -0.167588 -0.448529 -0.451373 0.699872 0.487679 0.218311 0.231105 0.137599
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 24.924557 23.851900 13.957103 13.995774 4.534026 4.626999 3.123408 3.336343 0.016862 0.016654 0.000671
66 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 3.314294 24.657725 2.076031 14.160641 1.883654 4.558534 -2.020030 3.667596 0.034122 0.018905 0.010891
67 N03 digital_ok 0.00% 100.00% 100.00% 0.00% -0.415543 -0.006149 -0.440798 1.594365 -0.089073 1.465146 0.480055 0.353376 0.039436 0.040655 0.008216
68 N03 dish_maintenance 100.00% 100.00% 25.89% 0.00% 26.672205 0.680891 14.045077 0.526023 4.463735 -0.367030 5.295901 -0.668835 0.018129 0.234085 0.135286
69 N04 digital_ok 0.00% 0.49% 9.14% 0.00% 0.925337 -0.413445 1.493462 -0.698771 0.972748 0.307732 2.131210 0.350820 0.259828 0.257852 0.163747
70 N04 digital_ok 0.00% 100.00% 100.00% 0.00% 0.056063 2.368950 1.296366 3.098937 1.571737 1.830826 0.472356 0.056287 0.047249 0.042186 -0.015165
71 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 6.388571 -0.200030 -0.418948 0.419598 0.298412 0.701367 -0.242195 0.395686 0.057502 0.060940 0.020962
72 N04 digital_ok 100.00% 83.68% 85.78% 14.22% 0.596313 1.642043 2.669872 1.180061 0.928363 1.803617 7.943028 0.737330 0.111759 0.109862 -0.135341
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.734397 1.907423 -0.812930 0.956921 0.470207 1.938068 0.089464 0.730562 0.282316 0.285135 0.181695
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.395809 -0.546843 0.171534 -0.690035 -0.410562 0.359031 -0.621696 0.887412 0.293334 0.305341 0.190494
77 N06 not_connected 100.00% 85.57% 5.84% 0.00% 41.696593 15.078626 0.366893 -0.511511 2.680139 0.449980 4.531911 0.347324 0.152598 0.233904 0.102170
78 N06 not_connected 100.00% 79.46% 3.41% 0.00% 25.068485 1.124620 -0.110974 0.945392 0.763344 0.379826 1.732058 -1.551174 0.170092 0.262235 0.141238
79 N11 not_connected 100.00% 65.46% 100.00% 0.00% 0.260273 14.755440 -0.629728 6.312067 -0.487327 4.570773 0.820832 1.359516 0.193177 0.018334 0.115112
80 N11 not_connected 100.00% 100.00% 100.00% 0.00% -0.214696 14.779457 0.064254 6.075388 -0.572046 3.153567 -0.652476 0.906212 0.046353 0.025489 0.016687
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 82.267495 36.146956 28.988435 24.940793 6.821678 7.752661 155.845224 102.244791 0.016540 0.016459 0.000778
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 30.425023 50.653870 25.893583 24.141244 14.693533 6.564316 147.260850 118.823881 0.016456 0.016503 0.000777
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 22.286965 41.263183 20.374432 26.632128 5.091001 10.901532 70.617510 157.502243 0.016432 0.016472 0.000729
84 N08 RF_maintenance 100.00% 2.22% 100.00% 0.00% 5.583300 25.968192 3.329661 14.295097 2.308245 4.549297 0.250046 5.184902 0.263375 0.022046 0.135144
85 N08 digital_ok 0.00% 0.49% 8.16% 0.00% -0.291411 3.083683 -0.778491 -0.462210 0.474470 0.423316 -0.833468 0.081062 0.281424 0.270213 0.164882
86 N08 digital_ok 100.00% 0.49% 7.68% 0.00% 1.177838 1.220733 0.612113 0.219874 0.341880 0.867289 -0.025780 8.912077 0.290941 0.283356 0.176096
87 N08 RF_maintenance 100.00% 10.11% 4.97% 0.00% 11.473869 5.235103 2.651642 -0.426581 5.346711 -0.529057 13.637560 -0.060717 0.250957 0.288035 0.179488
88 N09 digital_ok 0.00% 100.00% 100.00% 0.00% 1.293945 1.634263 0.848771 1.470329 0.773945 0.421639 0.537387 0.442278 0.071542 0.080381 0.033041
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.585990 0.628109 0.787141 1.301701 0.815401 1.045241 -0.398051 -0.168328 0.312096 0.321969 0.202528
90 N09 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.341645 -0.450044 -0.447058 -0.502088 -0.171833 -0.881740 -0.584562 -0.783523 0.070329 0.078796 0.031676
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.216492 0.586153 0.995727 0.803010 1.170967 0.836079 0.376742 0.063594 0.278589 0.302732 0.184501
92 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.916323 0.193444 11.018643 0.508909 4.556996 1.351414 0.535933 -0.060371 0.016542 0.041512 0.014869
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.216622 14.292721 11.117105 11.707291 4.491136 4.576328 0.830516 1.165330 0.016512 0.016537 0.000647
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.967478 14.562890 11.230706 11.528936 4.509661 4.603514 1.345537 1.591718 0.016525 0.016521 0.000779
95 N11 not_connected 0.00% 80.76% 82.11% 0.00% 3.605608 1.452412 -0.775734 0.525569 0.825467 0.925123 0.116911 -0.318286 0.148677 0.140466 0.069410
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 0.971016 22.401840 0.956118 -0.310963 0.278852 0.561223 -0.602046 0.501673 0.046061 0.044977 0.009366
97 N11 not_connected 100.00% 72.59% 78.05% 0.00% -1.420853 2.564093 -0.844644 0.537300 -0.669715 -0.440046 0.189830 5.494908 0.176315 0.171376 0.110586
101 N08 digital_ok 100.00% 14.27% 24.59% 0.00% 7.885621 7.882265 0.202068 1.345611 1.049755 1.718525 -1.042464 -0.232985 0.239755 0.235641 0.151078
102 N08 RF_maintenance 0.00% 0.54% 8.38% 0.00% -0.565910 0.984996 -1.081846 -0.360378 0.199060 0.751220 0.365820 3.613552 0.285154 0.271472 0.165761
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 3.882846 4.607813 2.333948 -0.929308 1.663804 0.024273 -2.542319 -0.330667 0.057046 0.058177 0.023669
104 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.586157 55.394609 0.940198 7.197876 0.591569 1.192385 0.153838 1.709150 0.055595 0.062296 0.021917
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.452116 0.760981 0.580257 1.385086 0.955239 0.706722 -0.212713 -0.054559 0.307798 0.316147 0.199294
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.912011 1.378717 1.139100 0.248298 7.506663 0.102367 2.063704 0.871278 0.307815 0.325671 0.201372
107 N09 digital_ok 0.00% 100.00% 100.00% 0.00% 0.676341 2.696191 0.448283 -0.229689 0.963775 0.128620 0.463362 0.652543 0.068156 0.075141 0.031385
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.046098 3.134295 1.427758 2.676658 0.932989 1.702966 16.502073 1.127088 0.284051 0.306979 0.182405
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.646101 14.053781 11.091457 11.416791 4.504124 4.631304 2.031237 2.957596 0.029422 0.018807 0.007493
110 N10 RF_maintenance 100.00% 81.51% 13.24% 0.00% 26.554601 -0.260523 0.561234 -0.110303 2.864379 0.487430 4.074163 0.946166 0.164354 0.238574 0.125431
111 N10 digital_ok 100.00% 73.19% 100.00% 0.00% 10.233957 13.995689 1.013716 11.502482 1.763851 4.621381 20.037077 4.269517 0.177778 0.029093 0.095220
112 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 0.045038 6.950293 1.800837 10.200611 1.556885 1.797499 2.331837 2.976308 0.083966 0.054050 -0.054533
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.811499 15.354510 5.629296 6.303214 4.469591 4.551869 1.651030 1.302486 0.016860 0.016598 0.000545
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.630500 1.096874 5.784929 -0.194188 4.470166 -0.543125 0.543625 -0.536386 0.017012 0.046345 0.023332
115 N11 not_connected 0.00% 72.54% 74.27% 0.00% -1.448221 -0.633389 -1.101690 -0.041011 -0.723875 -0.715922 1.046140 0.494944 0.180323 0.182843 0.111127
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 32.537051 39.176801 24.838511 29.178066 6.878592 11.797481 213.283588 438.635798 0.016333 0.016174 0.000800
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 25.693256 31.980601 22.696093 23.738773 6.754195 5.038896 256.533798 208.149213 0.016159 0.016140 0.000705
120 N08 RF_maintenance 0.00% 100.00% 100.00% 0.00% 3.786503 1.254075 3.003282 -0.670096 1.751170 0.419847 -0.072502 -0.620531 0.058710 0.062281 0.023545
121 N08 digital_ok 100.00% 0.49% 7.68% 0.00% 1.486552 3.696347 -1.022978 6.291690 0.779352 0.985151 10.088594 9.161090 0.311062 0.278269 0.177635
122 N08 digital_ok 100.00% 0.49% 7.68% 0.00% 6.416160 5.328714 -0.560389 -0.842698 0.368788 -0.084479 -0.384902 -0.495322 0.287631 0.283495 0.175106
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.797924 8.111408 1.127087 1.374152 1.464476 1.489073 0.252756 0.656969 0.319739 0.317844 0.199096
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 11.019353 0.566160 11.277500 0.950841 4.483773 1.346178 1.913709 1.283110 0.021654 0.327169 0.150292
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.553114 -0.572215 2.208235 1.464174 1.285470 0.504949 1.440744 1.300167 0.303960 0.321716 0.197106
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.305645 0.996916 0.490588 1.212605 1.222592 1.516469 3.081114 0.905473 0.268679 0.318023 0.187047
127 N10 digital_ok 100.00% 100.00% 1.30% 0.00% 10.532469 -0.809672 11.011261 -1.067234 4.551575 -0.000417 1.984824 2.099218 0.017981 0.266327 0.118990
128 N10 digital_ok 0.00% 60.59% 12.27% 0.00% 0.225836 -0.710982 -0.653576 -0.172508 -0.094312 -0.637201 0.647101 1.127608 0.202308 0.240689 0.137918
131 N11 not_connected 100.00% 72.49% 100.00% 0.00% -0.887640 13.666091 -0.238332 6.195366 -0.627604 3.761854 -0.113604 1.487275 0.183413 0.074062 0.127535
132 N11 not_connected 0.00% 72.54% 73.95% 0.00% -0.953821 -0.469783 -0.401127 -0.824589 -0.473169 -0.640156 1.224245 1.109021 0.179442 0.181689 0.111445
133 N11 not_connected 0.00% 72.54% 73.62% 0.00% -0.377092 -0.985490 -0.901061 -0.549605 -0.452175 -0.838254 0.270256 0.612113 0.179742 0.183339 0.113611
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.009874 15.381188 5.767731 6.288153 4.469907 4.561696 1.177169 1.620974 0.018028 0.017158 0.000874
135 N12 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.768828 7.120704 4.140357 3.948124 4.532022 4.620283 -4.851223 -4.717726 0.017990 0.017078 0.000758
136 N12 digital_ok 100.00% 100.00% 100.00% 0.00% 7.779110 7.130843 4.091641 3.948378 4.524547 4.613226 -5.074555 -4.983526 0.017616 0.017081 0.001653
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 34.610834 63.605455 28.220034 28.635404 16.197504 9.156801 547.210123 434.872626 0.016168 0.016141 0.000744
139 N13 RF_maintenance 0.00% 21.19% 34.22% 0.00% 1.696877 0.006149 0.949163 -0.995957 0.382510 -0.924976 -1.379604 0.308484 0.232800 0.231685 0.142090
140 N13 digital_ok 100.00% 4.49% 22.65% 0.00% 3.406339 -1.044169 -0.336296 -0.437585 3.129201 -0.573362 30.321154 4.970715 0.255361 0.255793 0.154176
141 N13 digital_ok 0.00% 0.54% 16.16% 0.00% -0.507236 -0.266908 0.104075 0.285502 0.600226 -0.333331 -0.273420 -1.574259 0.275420 0.265955 0.162216
142 N13 RF_maintenance 100.00% 0.49% 100.00% 0.00% 0.522247 14.168072 -0.349602 11.658691 1.156012 4.591769 11.604768 1.953611 0.279085 0.024595 0.147494
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.698080 13.986865 10.898108 11.630193 4.166490 4.606223 0.669510 1.501966 0.042081 0.017703 0.019942
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.314244 -0.563709 -0.517575 -0.486685 0.259690 0.613533 -0.267044 -0.595983 0.309311 0.323236 0.200154
145 N14 digital_ok 0.00% 0.11% 0.11% 0.00% 0.562054 0.387933 0.417196 0.281838 0.370709 1.813717 -0.174685 0.189315 0.277177 0.294376 0.173339
146 N14 digital_ok 0.00% 3.73% 0.38% 0.00% -0.441998 -0.672640 -1.081873 -0.684634 -0.830681 -1.030505 -0.805060 -1.118138 0.251984 0.289782 0.174614
147 N15 digital_ok 100.00% 99.89% 99.95% 0.00% 103.428539 102.836471 inf inf 882.373600 892.405362 4896.832981 4899.524577 0.191992 0.183585 0.089595
148 N15 digital_ok 100.00% 99.95% 99.89% 0.00% 116.519069 119.962192 inf inf 855.912221 851.535229 4991.630122 4953.993250 0.099430 0.097058 0.088609
149 N15 digital_ok 100.00% 99.95% 100.00% 0.00% 110.579943 111.014710 inf inf 791.810922 795.622554 4644.828478 4678.817707 0.107534 0.080889 0.080154
150 N15 digital_ok 100.00% 100.00% 99.95% 0.00% 105.379704 106.728697 inf inf 920.001188 923.951907 4783.438760 4801.280569 0.050880 0.086108 0.066866
151 N16 digital_ok 100.00% 83.30% 73.57% 0.00% 17.677607 -0.604143 -0.441639 1.255560 0.555155 0.110339 -0.175421 6.287613 0.161950 0.182969 0.104114
155 N12 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.768287 7.122216 4.089341 3.947855 4.536242 4.623888 -4.692594 -4.598263 0.017617 0.017057 0.001699
156 N12 RF_maintenance 100.00% 86.65% 100.00% 0.00% 0.855011 13.887161 8.043376 11.461707 -0.073874 4.621651 0.682435 1.652478 0.137596 0.019578 0.074659
157 N12 digital_ok 0.00% 49.30% 42.05% 0.00% 1.016584 0.186792 0.572408 1.018223 0.804055 1.450423 0.721518 0.858057 0.203231 0.220140 0.139669
158 N12 digital_ok 100.00% 21.84% 34.43% 0.00% -0.293047 -1.070263 -1.063908 -1.048934 0.152258 0.175765 1.703975 8.230659 0.227622 0.235294 0.146831
159 N13 RF_maintenance 100.00% 21.84% 35.89% 0.00% 0.365427 10.645409 -0.362477 -0.705545 -0.641634 1.141470 -0.668259 3.448642 0.219476 0.212333 0.123846
160 N13 digital_ok 100.00% 100.00% 34.16% 0.00% 11.496035 -0.877206 10.991999 -0.355293 4.516786 0.875337 1.348113 0.140726 0.022438 0.230211 0.129592
161 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 0.231957 29.706243 0.519079 0.318241 1.055205 -0.210485 -0.814314 -0.404634 0.047493 0.044173 0.011478
162 N13 digital_ok 0.00% 100.00% 100.00% 0.00% -0.014615 -0.945743 -0.015350 -0.877121 -0.548943 -0.070764 -0.725839 -1.038134 0.049890 0.045116 0.013012
163 N14 digital_ok 0.00% 0.16% 0.54% 0.00% 0.900888 1.647933 0.375081 0.766500 1.001781 1.586749 0.105096 0.767117 0.263549 0.269117 0.166327
164 N14 digital_ok 0.00% 0.27% 0.38% 0.00% 0.417940 1.455230 1.050272 1.474890 0.297780 1.812260 -0.349663 0.185330 0.262253 0.272991 0.165293
165 N14 digital_ok 100.00% 43.62% 0.43% 0.00% 17.998869 0.025148 0.073743 -0.319188 1.333950 0.301194 9.107091 0.040714 0.206650 0.267971 0.156236
166 N14 digital_ok 0.00% 6.59% 0.54% 0.00% -0.300386 -0.227942 1.187690 0.433670 0.956957 -0.286881 -0.338513 -1.829591 0.242982 0.264714 0.156226
167 N15 digital_ok 100.00% 99.95% 99.95% 0.00% 122.072368 122.980838 inf inf 922.896993 930.630925 4827.570796 4877.467067 0.093054 0.146338 0.036968
168 N15 digital_ok 100.00% 99.95% 100.00% 0.00% 116.886409 121.136409 inf inf 969.157175 988.839323 4981.680961 4984.578352 0.103274 0.076267 -0.004439
169 N15 digital_ok 100.00% 99.95% 100.00% 0.00% 97.677537 103.499278 inf inf 982.886001 964.212835 4824.203083 4788.640824 0.120510 0.044957 0.101978
170 N15 digital_ok 100.00% 99.95% 99.95% 0.00% 113.912977 116.202981 inf inf 1160.247785 1176.136266 4924.116416 4875.961228 0.063478 0.052110 0.018279
171 N16 digital_ok 0.00% 77.46% 72.22% 0.00% -0.521180 -0.976250 0.493393 -0.579258 -0.481341 -0.681829 0.603580 0.281450 0.178449 0.182243 0.119887
172 N16 digital_ok 100.00% 72.49% 72.22% 0.00% 4.179586 1.406731 2.512782 0.884023 2.462497 0.108253 -2.417750 -0.410954 0.181992 0.185956 0.114014
173 N16 digital_ok 100.00% 72.49% 72.65% 0.00% 5.834706 5.608706 3.293517 3.248678 3.567159 3.718045 -3.909801 -3.303304 0.180917 0.185253 0.114303
179 N12 RF_maintenance 0.00% 21.84% 35.35% 0.00% -0.450537 -1.150444 -0.083553 -0.614809 -0.053194 1.989133 -0.238078 0.254039 0.221006 0.225842 0.139949
180 N13 RF_maintenance 100.00% 28.92% 100.00% 0.00% -0.244819 14.807634 -0.917764 11.770544 0.309520 4.569422 8.821232 2.465855 0.216964 0.030135 0.117092
181 N13 digital_ok 0.00% 34.32% 40.05% 0.00% 1.881898 0.951820 1.508090 1.277154 1.136988 0.854216 0.243556 2.949108 0.215501 0.218823 0.136598
182 N13 digital_ok 100.00% 100.00% 100.00% 0.00% -0.518130 13.848098 -0.070477 11.400757 -0.711083 4.618292 -1.335336 0.241941 0.048879 0.020879 0.026851
183 N13 digital_ok 0.00% 23.73% 28.43% 0.00% -0.169739 0.474742 0.659588 1.137892 1.565525 1.256362 0.474475 0.450697 0.233471 0.237224 0.145351
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 15.173654 -0.493025 8.394888 -0.370126 2.641947 0.135139 1.174774 -0.732455 0.046445 0.068328 0.031105
185 N14 RF_maintenance 0.00% 7.08% 9.57% 0.00% 0.034643 -0.332548 -0.994326 -0.004880 -0.205532 0.296739 -0.698834 0.103979 0.243147 0.248496 0.153249
186 N14 digital_ok 0.00% 100.00% 100.00% 0.00% -0.740561 -1.092108 0.202123 -0.416115 -0.472529 -0.760690 -1.213814 -0.901083 0.058491 0.068021 0.026451
187 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 0.499088 -0.371357 0.004880 -0.045440 1.725372 -0.522582 0.199300 -1.504546 0.060112 0.068514 0.023687
189 N15 digital_ok 100.00% 99.95% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.088398 0.060718 0.044080
190 N15 digital_ok 100.00% 99.95% 99.89% 0.00% 124.832317 126.836259 inf inf 880.270882 885.651521 4713.349314 4730.999041 0.094727 0.074390 0.054462
191 N15 digital_ok 100.00% 100.00% 99.84% 0.00% 122.011873 158.934348 inf inf 1038.269559 1347.215060 4279.403012 3446.081667 0.070229 0.081796 0.049785
192 N16 digital_ok 100.00% 72.49% 72.22% 0.00% 4.840373 6.027132 2.947967 3.426070 3.372146 3.874310 -3.210523 -3.538680 0.178765 0.180538 0.114633
193 N16 digital_ok 100.00% 72.49% 72.43% 0.00% 6.356483 5.255786 3.526603 3.156813 3.757303 3.622353 -4.379558 -4.080757 0.180748 0.181444 0.112682
200 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.556268 36.581699 5.811389 0.320119 4.531056 1.813428 0.725102 1.719300 0.018063 0.069342 0.032455
201 N18 RF_maintenance 100.00% 53.03% 63.57% 0.00% 3.191218 4.547460 2.191416 2.917667 2.049360 3.215386 -2.734573 -3.668071 0.194919 0.192689 0.118692
202 N18 digital_ok 100.00% 52.65% 61.41% 0.00% 0.935166 0.339998 0.983521 -0.535139 0.451697 0.275712 -1.988386 26.442153 0.197659 0.198072 0.120054
204 N19 RF_maintenance 100.00% 52.65% 51.57% 0.00% 11.489122 12.493977 1.779849 -0.685114 1.112102 0.053117 10.057662 -0.164106 0.205984 0.213534 0.132652
205 N19 RF_ok 100.00% 96.00% 58.92% 0.00% 7.107209 -1.130608 3.837794 -1.080793 1.288003 -0.262005 0.845953 1.375691 0.133347 0.203696 0.145875
206 N19 RF_ok 100.00% 81.78% 84.11% 0.00% 0.204734 4.292544 0.828274 3.347956 -0.199893 -0.187182 -0.468489 -0.058516 0.167627 0.167644 0.102201
207 N19 RF_ok 0.00% 79.30% 72.92% 0.00% 2.874404 -0.913803 -0.895219 -0.704549 -0.846101 -1.041388 1.919818 -1.752729 0.173483 0.188392 0.121799
208 N20 dish_maintenance 100.00% 99.95% 100.00% 0.00% 134.839665 135.867770 inf inf 1132.196858 1126.888720 4823.534108 4809.729469 0.061067 0.049540 0.014229
209 N20 dish_maintenance 100.00% 99.95% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.075589 0.098767 0.028721
210 N20 dish_maintenance 100.00% 99.95% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.135874 0.079227 0.084427
211 N20 RF_ok 100.00% 84.32% 100.00% 0.00% -0.286124 14.588857 -0.852336 6.336637 -0.750500 4.548137 -1.333463 -0.186911 0.161357 0.017573 0.095841
220 N18 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.684147 -0.643662 0.138272 -0.607058 -0.745559 -0.844474 -2.254765 -2.105086 0.049380 0.056863 0.016734
221 N18 RF_ok 0.00% 100.00% 100.00% 0.00% -0.883389 -0.550361 -1.045462 -0.831284 -0.490398 -1.040508 -0.851866 -1.510042 0.050510 0.054706 0.018651
222 N18 RF_ok 0.00% 100.00% 100.00% 0.00% -0.359324 0.062807 -0.277339 -0.067903 -0.753270 -0.547380 -1.794695 -2.570193 0.051145 0.053012 0.020855
223 N19 RF_ok 100.00% 78.05% 80.22% 0.00% -1.219738 1.672516 -0.572908 2.630378 -0.690025 1.656077 -0.499838 5.648092 0.179562 0.177641 0.117463
224 N19 RF_ok 100.00% 81.51% 78.76% 0.00% 6.696611 5.504068 3.714234 3.320047 3.955494 3.722470 -4.647457 -4.244471 0.171292 0.183423 0.110013
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 0.052150 13.850967 0.470512 6.088343 -0.484725 4.318574 -2.545097 -0.722323 0.043429 0.029125 0.018435
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% -0.906260 16.794140 -0.651623 0.152768 -1.049707 1.271091 -2.189065 -2.185125 0.045367 0.044060 0.011332
227 N20 RF_ok 100.00% 86.65% 80.59% 0.00% 2.358076 -0.140018 2.622900 -0.782211 -0.478183 -0.898456 5.019909 -0.917411 0.146285 0.174306 0.120652
228 N20 RF_maintenance 0.00% 83.03% 80.65% 0.00% 0.711852 -0.241842 0.508645 -0.919666 -0.262336 -0.519370 -1.489108 -0.914910 0.165167 0.174953 0.104041
229 N20 RF_maintenance 0.00% 83.24% 80.76% 0.00% 0.647826 0.982483 0.462848 0.920287 -0.089758 0.434599 -2.073988 -2.598220 0.163632 0.171900 0.103339
237 N18 RF_ok 0.00% 83.57% 76.76% 0.00% 2.230308 -0.832696 0.585091 -1.002020 -0.117667 -0.542288 0.031265 -0.814036 0.157578 0.180129 0.111311
238 N18 RF_ok 0.00% 80.05% 76.81% 0.00% 0.463802 -0.226531 0.550344 0.347706 -0.162485 -0.513628 -1.901662 -1.813824 0.171725 0.179600 0.111090
239 N18 RF_ok 0.00% 80.05% 77.24% 0.00% -0.505469 0.050548 0.035968 0.147997 -0.375130 -0.667153 -1.993965 -1.264139 0.173300 0.180704 0.110146
240 N19 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.924020 -0.103156 0.604792 -0.942240 -0.825102 -1.172950 -2.008671 -2.353833 0.044419 0.047018 0.015171
241 N19 RF_ok 0.00% 85.03% 83.19% 0.00% -1.155831 -0.869322 -0.443326 -0.062672 -1.096224 -0.743524 -1.107064 -1.886550 0.157716 0.170211 0.101996
242 N19 RF_ok 100.00% 98.27% 83.19% 0.00% 17.232071 0.683162 -0.374811 0.711991 0.566175 0.266899 -0.857220 -2.225048 0.119296 0.169934 0.098672
243 N19 RF_ok 100.00% 98.43% 83.35% 0.00% 16.138363 -1.155541 0.580455 -0.924385 1.252911 -0.658176 -1.866862 -1.309195 0.119504 0.168574 0.094461
244 N20 RF_maintenance 0.00% 86.43% 83.14% 0.00% -0.467169 -0.818336 -0.190559 -0.659902 -0.526209 -0.810917 -0.445546 1.001213 0.151521 0.170034 0.100719
245 N20 RF_ok 0.00% 85.51% 83.14% 0.00% 0.772104 0.028690 0.678886 -0.612122 0.026639 -1.062377 -2.374088 -1.068231 0.157290 0.168998 0.094971
246 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 0.071340 15.124594 -0.829072 5.875174 -0.854729 4.599614 -2.156416 -1.110359 0.042359 0.016581 0.020217
261 N20 RF_ok 0.00% 100.00% 100.00% 0.00% 0.069724 -0.029529 0.045921 -0.387038 -0.487246 -0.872013 -1.524183 -2.342256 0.044083 0.040571 0.009523
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 11.482135 14.436240 0.335774 0.508106 1.042139 0.734853 -1.701686 -1.467981 0.044164 0.042581 0.009535
320 N03 dish_maintenance 0.00% 100.00% 98.43% 0.00% 3.543240 1.263103 1.868496 0.938501 1.434037 0.728982 -2.383701 -1.240591 0.119542 0.114978 0.069423
324 N04 not_connected 0.00% 100.00% 98.70% 0.00% 2.468805 3.050289 0.821410 1.075690 0.164943 0.780479 0.000754 -0.696438 0.119175 0.117686 0.069609
325 N09 dish_ok 0.00% 94.16% 90.92% 0.00% 1.443547 -0.943138 0.690405 -0.862149 -0.004873 -0.633345 -1.239995 -0.000754 0.142051 0.137552 0.088233
329 N12 dish_maintenance 0.00% 99.95% 98.05% 0.00% 2.027189 0.254376 0.644005 -0.560528 -0.356011 -0.933894 0.828012 -0.218229 0.119495 0.118649 0.070392
333 N12 dish_maintenance 0.00% 100.00% 97.89% 0.00% 2.275287 0.941881 -0.268794 -0.790408 -0.573486 -0.742994 1.059033 0.893310 0.113680 0.117070 0.067423
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: [4, 5, 7, 8, 9, 10, 15, 16, 17, 18, 19, 20, 21, 22, 27, 28, 29, 31, 32, 34, 35, 36, 37, 38, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 92, 93, 94, 95, 96, 97, 101, 102, 103, 104, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 117, 118, 120, 121, 122, 123, 124, 126, 127, 128, 131, 132, 133, 134, 135, 136, 137, 139, 140, 141, 142, 143, 145, 146, 147, 148, 149, 150, 151, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 324, 325, 329, 333]

unflagged_ants: [30, 43, 57, 73, 74, 89, 91, 105, 125, 144]

golden_ants: [30, 91, 105, 144]
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_2460038.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

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