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 = "2459961"
data_path = "/mnt/sn1/2459961"
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: 1-16-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/2459961/zen.2459961.21314.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/2459961/zen.2459961.?????.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/2459961/zen.2459961.?????.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 2459961
Date 1-16-2023
LST Range 2.268 -- 12.224 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
Total Number of Antennas 196
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 196 (0.0%)
Antennas in Commanded State (observed) 0 / 196 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 66 / 196 (33.7%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 111 / 196 (56.6%)
Redcal Done? ❌
Never Flagged Antennas 85 / 196 (43.4%)
A Priori Good Antennas Flagged 43 / 93 total a priori good antennas:
3, 9, 15, 16, 20, 29, 37, 38, 40, 42, 54, 55,
56, 65, 71, 72, 81, 94, 101, 103, 106, 109,
111, 121, 122, 123, 128, 136, 143, 146, 147,
148, 149, 151, 161, 165, 170, 173, 182, 185,
189, 192, 193
A Priori Bad Antennas Not Flagged 35 / 103 total a priori bad antennas:
8, 22, 35, 46, 48, 49, 61, 62, 64, 73, 89,
90, 95, 102, 115, 120, 125, 137, 139, 166,
206, 211, 220, 221, 222, 223, 227, 229, 237,
238, 239, 245, 261, 324, 325
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_2459961.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.885552 16.731352 10.375357 -0.709680 12.362287 9.001090 5.504272 3.157947 0.033134 0.494414 0.402675
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.098078 0.209764 2.040824 1.938773 25.507504 4.844945 8.359340 1.498183 0.750917 0.731368 0.269208
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.515398 0.404011 0.310580 0.231857 2.545559 2.712183 3.022258 2.373476 0.753839 0.743148 0.237925
7 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.722799 -0.904018 -1.089756 -0.353121 0.450785 3.112542 1.524481 2.077771 0.747798 0.738613 0.242642
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.016885 -0.816779 -0.624812 0.024286 1.489480 2.047882 1.954442 2.349947 0.744448 0.731188 0.240933
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.832490 -1.229566 8.426657 -0.470338 12.449387 1.377919 5.712533 1.465229 0.627613 0.725475 0.294649
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.175431 -0.207697 -1.454818 -1.368379 0.135365 0.740013 0.565163 1.051960 0.727652 0.720460 0.250517
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.598783 19.484300 9.766117 0.631828 12.346984 9.363897 5.479151 3.293374 0.032245 0.503209 0.398682
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.673325 -0.481449 10.340638 0.905619 12.344677 0.896851 5.499568 1.506807 0.032567 0.751232 0.611689
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.909008 2.358636 0.451306 0.400810 0.691904 0.206630 1.155314 0.598528 0.756835 0.744120 0.240939
18 N01 RF_maintenance 100.00% 100.00% 8.32% 0.00% 10.440276 25.019146 10.330961 -0.535622 12.420107 11.944951 5.474098 5.443864 0.029093 0.368187 0.294047
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.375936 -0.330588 -1.204951 -0.529102 0.879686 1.124079 -0.420167 0.057484 0.743930 0.745286 0.237802
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.247157 -0.740376 2.379968 -1.040826 2.217954 -1.262358 4.330825 -0.525451 0.749676 0.737643 0.241786
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.383644 0.006627 -0.646320 0.128128 -0.321184 2.485949 1.082117 1.711710 0.731098 0.720923 0.237613
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.883043 -0.037561 0.741988 0.510905 0.422225 -1.027234 -0.490895 -0.473291 0.707349 0.698166 0.250573
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.311404 11.057378 10.365708 10.894979 12.468966 13.788927 5.570832 6.201174 0.032972 0.036034 0.004185
28 N01 RF_maintenance 100.00% 0.00% 46.16% 0.00% 15.422847 32.875216 0.302031 2.233413 10.099464 12.002081 2.099320 5.937202 0.508309 0.275957 0.317915
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 9.583394 11.106749 9.956947 10.503492 12.407219 13.726502 5.502671 6.097368 0.029589 0.034980 0.005591
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.628350 0.248875 0.252465 0.585658 0.165781 0.229718 0.402875 0.371236 0.761615 0.753478 0.234886
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.743896 -0.260737 1.252092 0.971337 1.480195 1.598670 2.096402 1.092008 0.768654 0.746970 0.234918
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.915009 18.556916 -0.128646 3.119414 0.025701 6.877341 0.616933 5.266975 0.758329 0.694806 0.224966
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.960059 12.508450 4.634039 5.053832 12.376991 13.704166 5.500185 6.092530 0.034172 0.045630 0.008452
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.395262 0.387352 1.676007 -1.151946 -0.110026 -1.483092 0.237584 -0.019111 0.712177 0.699715 0.248121
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 14.920515 14.032759 13.834405 13.808146 12.526796 13.775999 5.528847 6.249648 0.031786 0.030062 0.001181
37 N03 digital_ok 100.00% 99.68% 99.95% 0.00% 229.273296 229.393958 inf inf 8553.885730 8556.175105 875.581246 876.399434 0.535242 0.146646 0.431287
38 N03 digital_ok 100.00% 99.62% 99.68% 0.00% 232.836667 232.733085 inf inf 6268.243090 6142.665448 547.141895 504.939340 0.643582 0.488458 0.393913
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 9.261377 -0.740429 9.960103 0.478090 12.414319 -0.288638 5.522821 0.344369 0.039097 0.757685 0.579799
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.234326 -0.364882 -0.036873 0.134568 0.309963 0.258544 0.276581 2.470755 0.773432 0.763282 0.222505
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.611010 12.363903 10.689888 11.462973 12.287360 13.601977 5.469463 6.110649 0.026726 0.026248 0.001300
43 N05 RF_maintenance 100.00% 98.97% 99.19% 0.00% 219.224939 219.640349 inf inf 6247.588350 6213.759823 694.551336 708.477829 0.553103 0.453453 0.355475
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.318390 -0.991579 -0.324944 -0.504806 -1.315358 -0.677432 -1.291561 -0.723147 0.765210 0.762936 0.232568
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.676312 0.944051 0.148170 0.641342 0.076511 -0.113622 0.217664 0.718104 0.763488 0.749159 0.226905
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.585571 0.268185 -0.881818 -0.865749 -0.040762 -0.669634 -0.406774 -1.735299 0.759293 0.753358 0.238578
47 N06 not_connected 100.00% 100.00% 98.38% 0.00% 10.662498 11.824045 4.443458 4.667877 12.399321 13.690322 5.547471 6.102815 0.030950 0.055902 0.018290
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.316373 0.154823 0.642008 2.142178 -1.351007 1.385625 -0.653188 1.195839 0.720642 0.713183 0.250602
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.519195 -0.209578 -1.019358 -0.223326 1.923432 -1.474184 0.002694 -0.374611 0.696701 0.703019 0.242931
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.531279 9.918598 0.320952 1.472426 5.044743 10.737924 5.107322 13.225388 0.754005 0.709917 0.216695
51 N03 dish_maintenance 100.00% 96.43% 0.00% 0.00% 18.292816 7.455254 13.326443 -0.239230 12.657256 7.452342 5.835200 0.467343 0.050316 0.657159 0.506289
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.377498 4.909025 -0.492756 0.330398 0.843423 1.885487 0.163977 1.013032 0.774679 0.763450 0.221868
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.399767 1.973490 0.320759 0.412413 0.360783 1.217603 0.851943 1.009962 0.781362 0.771223 0.219354
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.592881 11.606319 10.371194 11.152454 12.438238 13.711873 5.565760 6.124162 0.026640 0.025964 0.001247
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.551780 11.570396 9.809768 10.443476 12.400577 13.717184 5.506923 6.188456 0.028563 0.031624 0.002946
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.520424 12.598201 0.626954 11.302481 0.185850 13.657910 0.740935 6.114031 0.779278 0.038158 0.614084
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 14.443677 0.940633 6.990607 0.616228 7.636626 1.345647 3.513417 0.632461 0.619968 0.768840 0.240881
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.482293 11.514302 10.266648 11.041254 12.371574 13.698314 5.580470 6.167942 0.034312 0.034540 0.001479
59 N05 RF_maintenance 100.00% 98.05% 0.00% 0.00% 10.068700 -0.519237 9.839717 2.030199 12.257433 0.911972 5.520937 2.293612 0.059406 0.758083 0.575380
60 N05 RF_maintenance 100.00% 98.92% 98.92% 0.00% 217.533766 218.067256 inf inf 4061.655368 4719.995403 506.306021 534.955887 0.507385 0.524953 0.289050
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.511940 -0.672669 -0.650628 -1.349863 0.002404 -2.496978 -1.093713 -1.555310 0.722223 0.725319 0.233593
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.307486 -1.068013 -0.589553 1.265797 -0.828816 0.463006 -1.006457 0.441420 0.709035 0.720292 0.243323
63 N06 not_connected 100.00% 0.00% 99.84% 0.00% -0.401388 11.604614 -0.090390 5.059828 -0.836567 13.755640 -0.766798 6.146534 0.723613 0.049729 0.511586
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.721633 -0.202561 -0.832213 -0.945605 -0.633428 0.139822 0.083501 0.987564 0.712828 0.696657 0.234437
65 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.490654 1.184976 0.412343 1.058501 4.501164 8.266474 3.052735 4.518790 0.756463 0.751141 0.229967
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.253397 -0.270004 -1.259563 -1.176592 0.805414 -0.182207 -0.668003 -1.060015 0.764111 0.759463 0.232949
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.303002 0.496811 -0.865017 0.690543 0.064503 3.103263 -0.222998 2.062626 0.775209 0.767363 0.220028
68 N03 dish_maintenance 100.00% 99.84% 99.84% 0.00% 230.735614 231.157324 inf inf 6472.231997 6612.056725 576.727171 594.230159 0.307469 0.361858 0.194219
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.493271 -0.949382 0.187349 0.859306 0.285907 2.433890 0.368469 1.007426 0.780087 0.771439 0.210038
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.006627 -1.443981 -0.050953 0.192671 -0.455240 -0.373876 -0.282593 0.222300 0.781723 0.775338 0.212250
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 5.276158 -0.888392 0.574531 0.945489 0.748628 0.626146 0.690430 0.675200 0.790433 0.771223 0.212676
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.112162 12.513784 10.778935 11.484671 12.278391 13.618961 5.473995 6.096434 0.026716 0.025254 0.001626
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.290318 1.635268 -1.323475 -1.428071 0.283158 -0.875625 -1.436020 -1.914005 0.782586 0.774720 0.220063
74 N05 RF_maintenance 100.00% 98.81% 98.76% 0.00% 232.813182 232.742300 inf inf 8553.171146 8553.979318 875.186583 875.515371 0.617813 0.664275 0.305506
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 50.340155 -0.987029 0.035441 -0.126608 26.084777 -1.306164 4.013465 -0.837892 0.559012 0.728127 0.280104
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 17.209164 -0.470473 -0.926471 1.349703 2.081432 0.276350 1.081364 0.533257 0.607826 0.727122 0.241475
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.262935 12.056870 -1.417469 5.099273 -1.715415 13.658717 -0.456380 6.067644 0.720463 0.040068 0.491927
80 N11 not_connected 100.00% 0.00% 96.86% 0.00% -0.330839 12.259597 0.089001 5.004148 0.654780 13.670141 -0.000084 6.115425 0.714119 0.065646 0.495130
81 N07 digital_ok 100.00% 0.00% 97.57% 0.00% 0.482257 11.851160 0.262043 9.660156 3.381429 13.582589 2.255663 6.137160 0.737454 0.043916 0.528235
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.503552 7.838612 0.431996 8.755225 1.399591 10.925161 0.706293 2.529859 0.748158 0.536349 0.317955
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.473965 0.281392 0.345756 0.490234 -0.507349 0.385764 0.496309 0.906070 0.763596 0.759397 0.216520
84 N08 RF_maintenance 100.00% 17.14% 100.00% 0.00% 11.509903 13.120954 13.392447 14.069682 10.369269 13.750922 3.464150 6.173691 0.427301 0.035264 0.254972
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.489884 0.738597 2.562246 1.499632 0.993757 1.293195 1.896295 1.549120 0.774345 0.770490 0.206640
86 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.708798 -0.956588 1.301118 1.772526 2.622369 1.458776 0.831046 2.478860 0.773654 0.761745 0.198141
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.819403 6.915526 -0.704210 -0.610584 -0.520013 -0.566336 -0.734933 -0.715611 0.789612 0.782570 0.203487
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.474989 0.109854 0.522284 0.698113 -1.341740 0.913545 0.304750 0.572913 0.783862 0.775704 0.200928
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.337768 0.575039 0.065976 0.911113 -0.841422 0.628327 -0.269690 0.575838 0.787434 0.775578 0.206936
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.238602 -0.912912 0.942273 1.377150 -0.832707 -0.002404 0.463250 0.918018 0.780452 0.770795 0.207311
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.814587 -0.140325 -0.105329 -0.325435 -1.392483 -1.611268 -0.394192 -0.782134 0.771639 0.768742 0.217404
92 N10 RF_maintenance 100.00% 0.00% 0.11% 0.00% 33.336789 34.907566 1.307303 2.129115 10.419558 13.274074 2.208261 3.291520 0.462724 0.402912 0.079554
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.397875 -0.123660 2.089593 -1.010884 1.615515 -0.967258 2.528406 -1.199066 0.762481 0.757820 0.226709
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.304926 11.793773 10.561602 10.942367 12.221553 13.704461 5.508434 6.096376 0.030840 0.026050 0.002315
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.003707 -0.316088 -1.028855 1.031844 -1.876527 -0.326741 -1.364950 0.166486 0.727687 0.728778 0.243448
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.739066 11.954573 4.493230 5.216082 12.318271 13.625474 5.512809 6.089628 0.033166 0.038005 0.002760
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.113959 3.477528 -0.031484 1.490334 2.357499 6.924067 1.550543 2.762711 0.702371 0.677181 0.226272
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.686077 6.390308 -0.560405 1.070295 0.404195 1.650940 -0.166421 1.789021 0.773103 0.763217 0.216381
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.919692 -0.147743 -1.500090 -0.792692 0.522247 -0.537646 -1.381778 -0.390069 0.778527 0.768670 0.209504
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.324210 3.652730 4.974571 -1.307864 2.012260 -0.889866 3.864952 -1.036045 0.769833 0.774742 0.205959
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.358190 35.814167 -1.260337 7.721295 -0.424660 8.716021 -1.544883 6.016489 0.788304 0.769637 0.204071
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.543854 -0.396314 -0.262800 0.212753 -0.596298 -0.691000 -0.710948 -0.290044 0.790677 0.778387 0.200363
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 2.602507 0.456185 0.095132 -0.592915 20.267911 -1.606919 -0.127174 -1.084248 0.786849 0.777030 0.201039
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.758651 1.367147 -0.018408 -0.373802 -0.394368 -0.710023 0.227566 -0.468309 0.787652 0.780314 0.202146
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.834824 36.594548 10.317650 1.545487 12.387042 12.298683 5.511802 3.481501 0.034391 0.457552 0.229150
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.605652 11.323744 10.341103 10.778586 12.461192 13.727489 5.496392 6.161804 0.026988 0.026905 0.001366
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 20.349320 20.836565 14.034105 14.487383 12.337859 13.593265 5.374960 6.054140 0.023985 0.026343 0.001328
111 N10 digital_ok 100.00% 0.00% 98.97% 0.00% -0.021890 10.712699 0.479807 10.874870 -0.003336 13.760080 1.207765 6.208533 0.767929 0.041618 0.459343
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.771954 -1.268822 0.345469 0.328033 0.631424 -0.374145 0.606281 0.312555 0.759001 0.753870 0.231416
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.038951 12.107889 4.283929 5.103253 12.288873 13.656831 5.491829 6.087905 0.034628 0.030810 0.002124
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 5.248659 5.813151 14.818150 11.286184 23.027161 16.289815 34.978425 10.044020 0.021824 0.027803 0.003480
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.634781 -0.830900 -0.845088 -0.367583 -0.453129 -1.914989 -0.302114 -0.499878 0.713826 0.716853 0.240351
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.446544 12.382915 10.482995 11.449168 12.307128 13.666377 5.483345 6.196039 0.027699 0.031592 0.002787
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.652448 0.694521 -0.113866 0.676647 -0.211905 0.466311 -0.027930 1.075230 0.740625 0.744648 0.230187
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.305697 2.003328 2.834855 -0.764356 2.016936 -0.285991 2.836526 -0.823214 0.765697 0.765279 0.212249
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.995414 4.798790 -0.222296 5.594830 0.294071 8.263501 1.189951 6.435508 0.782062 0.760665 0.203609
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.787284 5.474231 -0.025352 0.973257 0.223196 0.287750 -0.051304 1.021274 0.790951 0.778106 0.198078
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.949764 6.712800 0.791452 0.891653 -0.181118 0.814831 0.715175 0.991004 0.797332 0.785298 0.198433
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.120587 1.201342 0.059908 0.812897 -0.065480 0.202236 -0.096089 0.656121 0.796453 0.782454 0.200322
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.102234 -0.259558 -0.434183 0.783895 -0.954209 0.206265 -0.818015 0.248010 0.789646 0.778060 0.199588
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.002454 4.605561 -1.058284 1.354141 9.982565 0.415966 10.456486 0.949987 0.752306 0.776379 0.205136
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.628821 0.060893 0.648215 0.428656 -0.019709 -0.193703 0.475009 0.213332 0.781442 0.778214 0.215518
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.551783 11.041017 10.457160 11.034557 12.310455 13.674162 5.480136 6.118467 0.029697 0.027945 0.001074
131 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.509966 9.770207 0.059182 4.789258 -1.537130 10.985940 -0.951366 2.686885 0.743804 0.515372 0.308924
132 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.084794 1.347456 -0.756795 -1.435022 4.275181 -2.088195 -1.278355 -1.498552 0.729395 0.725468 0.233047
133 N11 not_connected 100.00% 86.38% 0.00% 0.00% 11.154626 -0.350981 4.235342 -1.500886 12.372398 -1.317553 5.431546 -1.103448 0.114110 0.720710 0.471969
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.224815 -1.491560 -0.446179 -1.412926 4.442861 0.105002 3.001293 0.607940 0.712800 0.714363 0.258701
136 N12 digital_ok 100.00% 96.92% 0.00% 0.00% 9.023757 -0.520789 9.900205 -0.416937 12.426976 3.417184 5.566258 0.813136 0.049256 0.720519 0.431785
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.987538 0.334228 0.528073 -1.427133 -0.376623 -1.690180 0.889598 -1.383214 0.728148 0.731148 0.240313
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.449785 0.672259 1.792800 -0.822875 0.044497 -2.650218 1.209434 -1.278290 0.741806 0.737093 0.229759
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.269271 -0.381746 -0.976878 0.055921 -0.835225 -1.866885 -0.556320 -0.854997 0.770915 0.763367 0.215709
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.776598 -1.165031 -0.069091 0.901228 0.576716 -0.894213 -0.002874 0.052732 0.780721 0.764888 0.212030
142 N13 RF_maintenance 100.00% 0.00% 96.86% 0.00% 0.066197 11.602811 -0.433241 11.056314 2.971668 13.716630 3.221933 6.148107 0.782846 0.056068 0.531358
143 N14 digital_ok 100.00% 0.00% 98.76% 0.00% -0.966884 11.764202 1.176010 11.165517 1.201362 13.613040 0.956286 6.211330 0.790775 0.045825 0.575128
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.485717 0.071173 -1.006846 0.576866 -0.334851 -0.086196 -0.889794 0.629523 0.793553 0.781622 0.201545
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.215009 -0.001862 -0.980427 3.232089 -0.339121 11.513245 -0.875816 3.196451 0.793794 0.774939 0.200684
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 10.686636 -0.475280 4.245896 -0.147162 12.334860 -1.458262 5.455583 -1.262134 0.041133 0.768825 0.561576
147 N15 digital_ok 100.00% 99.19% 99.08% 0.00% nan nan inf inf nan nan nan nan 0.581760 0.629562 0.411128
148 N15 digital_ok 100.00% 99.08% 98.86% 0.00% nan nan inf inf nan nan nan nan 0.432223 0.504770 0.393230
149 N15 digital_ok 100.00% 99.08% 99.08% 0.00% nan nan inf inf nan nan nan nan 0.362286 0.457727 0.356314
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.618919 -0.861311 -0.908563 -1.232995 -0.111046 -0.746893 -1.587647 -1.928425 0.766838 0.762621 0.230361
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 17.031656 2.821617 -0.271868 0.606357 4.285118 -0.258089 1.719959 -0.858925 0.665304 0.714856 0.216653
155 N12 RF_maintenance 100.00% 96.54% 0.00% 0.00% 9.157794 -0.600947 10.060293 -1.497248 12.478801 2.559400 5.568765 0.783525 0.053467 0.707099 0.444536
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 4.728853 10.478260 9.196585 10.773171 9.600536 13.796258 1.949247 6.232819 0.528622 0.039073 0.333611
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.128452 -0.182545 0.001864 0.731068 0.658730 1.999487 0.873760 1.850458 0.727331 0.726022 0.244754
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.303304 -0.932162 0.072755 -0.454784 0.300800 0.561697 0.624705 1.264059 0.743196 0.739558 0.241746
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.038279 17.278167 -1.380667 -0.819301 -1.937767 8.165249 -1.122207 4.809289 0.723195 0.641146 0.225525
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.042125 -0.798749 -0.299987 -0.549285 -0.364845 0.320690 0.071549 -0.279289 0.764316 0.756096 0.222039
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.122401 24.252416 0.085384 -0.276481 0.016471 5.010706 0.263314 0.806404 0.773227 0.678079 0.200473
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.361192 -1.072186 -0.885190 -1.205319 0.711959 0.468315 -0.862130 -1.768910 0.778716 0.770141 0.216390
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.763144 0.934974 -0.202718 0.432096 -0.291037 0.264938 -0.173090 0.621141 0.790006 0.776987 0.208984
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.302249 0.158301 0.683397 0.073946 0.896890 0.955211 0.803423 0.213365 0.791135 0.778384 0.204917
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 18.512120 0.575846 -0.521036 -1.022759 2.450390 -1.421181 0.501821 -1.037979 0.690599 0.780732 0.201395
166 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.199392 2.236066 -0.932504 -0.175889 0.446831 0.329463 -0.842505 -0.251438 0.789432 0.777433 0.212619
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.618091 -0.679312 -1.299173 -0.105234 0.648778 0.891551 -1.248759 -0.279189 0.788149 0.779027 0.211937
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.756659 -0.527495 0.432690 -0.282704 0.344221 -0.446419 0.501531 -0.515619 0.783072 0.776153 0.215744
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.507594 -0.689370 -0.803937 -1.375490 -0.015548 -0.333339 -0.867288 -1.903264 0.779736 0.771193 0.222765
170 N15 digital_ok 100.00% 97.41% 0.00% 0.00% 10.854648 -0.171310 10.673764 -1.176350 12.370641 -1.526749 5.607417 -1.145415 0.049551 0.770032 0.566015
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.322151 3.968397 -1.332048 0.112911 -1.808135 0.790642 -1.077247 -0.992050 0.729601 0.708943 0.224231
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 11.527272 11.989442 3.940041 4.659535 12.528184 13.753348 5.671554 6.334996 0.039503 0.044963 0.004788
179 N12 RF_maintenance 100.00% 99.46% 99.41% 0.00% nan nan inf inf nan nan nan nan 0.467375 0.409052 0.425074
180 N13 RF_maintenance 100.00% 0.00% 96.38% 0.00% -0.922402 11.858172 -1.500733 11.208590 -0.710518 13.698841 -0.355140 6.231865 0.748952 0.064782 0.525838
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.706614 -0.810395 0.091225 0.311700 0.056708 0.911499 0.178071 0.618699 0.765976 0.754332 0.226697
182 N13 digital_ok 100.00% 0.00% 97.03% 0.00% 0.222406 11.003090 -0.673663 10.759648 -0.982226 13.756661 -0.980424 6.165737 0.774193 0.056952 0.496971
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.535228 2.971537 -0.167805 0.690005 -0.245141 0.204829 -0.002694 0.660713 0.769331 0.761564 0.209529
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.023147 -0.327028 -0.689125 -0.449005 -0.005669 -1.061851 0.053715 0.037430 0.791966 0.783000 0.201824
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 23.710379 0.639011 -0.616943 -1.419143 3.605822 -0.797945 0.919108 -1.679238 0.699594 0.772013 0.206846
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.333451 -1.163760 -1.462437 -0.395504 0.354797 0.054030 -1.305736 -1.199328 0.790254 0.776817 0.216069
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.570770 0.857291 -1.111350 1.981848 -0.692501 1.504257 -0.950167 1.832460 0.788801 0.767619 0.220346
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 8.796085 10.601414 9.862013 10.873056 12.518096 13.840458 5.687515 6.313235 0.028054 0.031393 0.001441
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.490479 -1.555658 -0.604715 0.672335 -0.959837 -0.732501 -0.550850 -0.222105 0.776310 0.766948 0.230960
191 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.077377 0.175860 1.381349 -0.251079 0.615989 -1.104346 2.104856 -0.084061 0.771177 0.765087 0.222332
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.084292 4.026090 5.511052 5.325997 9.402207 10.955502 4.784557 5.382122 0.701079 0.701821 0.256952
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.510091 0.410584 5.596325 2.016624 9.584831 1.969602 4.864021 1.491182 0.688786 0.727774 0.266437
200 N18 RF_maintenance 100.00% 100.00% 8.59% 0.00% 10.993418 35.357975 4.388678 -0.239573 12.485043 12.520608 5.524469 4.250247 0.041039 0.358292 0.244815
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.497784 2.691324 3.487192 4.630850 4.991237 8.750433 2.734848 4.629897 0.734201 0.710033 0.254786
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% -0.296486 1.157171 1.879173 -1.030215 0.817025 -1.238978 1.147573 0.208682 0.752675 0.732846 0.233978
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.494552 5.246494 0.282260 -0.375132 -0.277762 -1.046743 -0.047658 -0.709496 0.760809 0.737746 0.216090
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.115244 1.980427 2.967966 -0.641052 1.992915 -1.391054 2.316903 -0.624160 0.760088 0.748835 0.224945
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.593750 5.482025 1.649767 -1.103188 1.018081 2.499512 1.232436 -0.782411 0.749656 0.733614 0.208341
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.152289 7.421342 9.470757 11.157910 12.459648 13.075044 5.987401 8.368307 0.034132 0.035493 0.000140
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 4.830230 6.725077 9.212884 9.603845 12.173071 12.965637 5.734202 6.583319 0.041873 0.041446 0.003067
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 8.296702 8.617392 -1.209448 -1.118201 -1.101286 -1.190363 -1.132219 -1.442808 0.773318 0.760041 0.223852
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.375742 -0.166090 -1.230416 0.187646 -1.392006 -0.884998 -1.214100 -0.659841 0.742949 0.744746 0.225435
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.051156 -0.651098 0.592445 -0.098647 -1.117713 -0.400861 -0.042745 -0.865150 0.739980 0.727858 0.241779
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.351979 0.177532 -1.437470 -0.557335 -1.627572 -2.278956 -0.889334 -1.424663 0.740185 0.735683 0.234691
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.447467 -0.855588 -0.244642 0.311916 -1.046085 -1.482180 -0.891220 -0.629493 0.752623 0.744624 0.231296
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.414020 2.281749 -1.165588 -0.808882 -1.476148 0.776911 -0.916532 -1.198265 0.746604 0.730550 0.223043
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.520628 3.740300 5.729231 5.309684 10.031264 10.745713 4.994224 5.351420 0.716965 0.713914 0.255236
225 N19 RF_ok 100.00% 0.00% 38.38% 0.00% 2.005514 11.698483 1.046333 4.817115 -0.200070 13.239214 0.450446 5.605667 0.762458 0.312694 0.508590
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.348451 9.432887 0.315158 1.306567 -1.538469 5.758710 -0.393516 1.756073 0.764290 0.703762 0.232679
227 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 3.111332 1.542668 -1.392567 0.293730 0.149848 -0.444178 -0.182830 -0.306557 0.744786 0.745626 0.218498
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.980298 10.227110 -0.473380 -0.254644 7.081885 7.712038 4.774058 7.514499 0.699961 0.686033 0.187745
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.477956 -0.011481 1.757602 1.620961 0.630942 1.223155 0.722682 0.817615 0.751341 0.745986 0.232394
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.793191 0.897489 0.069118 -1.441395 0.786983 -2.282205 -0.680979 -1.561171 0.698258 0.707260 0.253635
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.550821 0.901431 1.111775 0.400426 -0.438153 -0.630962 0.223624 -0.543164 0.736405 0.723799 0.251628
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.328135 -1.171521 -0.001864 0.260125 -1.363631 -0.671549 -0.610951 -0.524590 0.744426 0.730800 0.243522
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 21.380917 59.018535 -0.668982 0.384682 7.260969 10.858054 6.738173 8.806658 0.620156 0.553487 0.151381
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.495473 6.920074 -0.675228 0.573443 -0.422920 0.363789 -0.458964 1.001741 0.744792 0.708333 0.235292
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 45.784071 1.453419 -0.226829 1.980959 27.545004 1.669316 5.836880 1.568973 0.553993 0.739821 0.327577
243 N19 RF_ok 100.00% 5.08% 0.00% 0.00% 67.268836 4.662106 0.561833 -1.298008 9.311932 -0.305787 3.317615 -1.129286 0.477487 0.732766 0.391997
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.978404 2.734474 1.538864 -0.797980 4.742301 -1.260478 -0.020009 -0.821492 0.694236 0.731979 0.232049
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.655007 3.280415 0.334327 -0.941860 -0.662671 -1.193771 -0.178523 -1.094907 0.749877 0.736108 0.226802
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.624726 11.969377 -0.976514 -0.042633 9.289615 10.267319 2.668853 3.820294 0.495973 0.493660 0.131103
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.866850 2.607564 0.910116 -0.295234 0.245898 -0.418546 0.280624 -0.166626 0.745190 0.730514 0.231600
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.067611 6.375663 9.450105 10.127268 13.381919 13.785974 6.088149 6.727073 0.031657 0.027410 0.003838
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 6.395597 10.505364 2.966313 7.301001 2.799053 13.749823 2.782089 6.144237 0.613806 0.047784 0.504795
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 2.890312 2.835414 1.464226 1.896520 0.535719 0.865141 0.361517 0.381015 0.662822 0.661022 0.251011
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% -0.213507 -0.251542 1.549053 -1.050831 0.469794 3.338441 -0.044590 1.149220 0.694145 0.675259 0.259573
329 N12 dish_maintenance 100.00% 99.14% 99.30% 0.00% nan nan inf inf nan nan nan nan 0.621184 0.391308 0.420027
333 N12 dish_maintenance 100.00% 99.30% 99.19% 0.00% nan nan inf inf nan nan nan nan 0.417792 0.406867 0.398099
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, 9, 15, 16, 18, 20, 27, 28, 29, 32, 34, 36, 37, 38, 40, 42, 43, 47, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 63, 65, 68, 71, 72, 74, 77, 78, 79, 80, 81, 82, 84, 87, 92, 94, 96, 97, 101, 103, 104, 106, 108, 109, 110, 111, 113, 114, 117, 121, 122, 123, 126, 128, 131, 132, 133, 135, 136, 142, 143, 145, 146, 147, 148, 149, 151, 155, 156, 159, 161, 165, 170, 173, 179, 180, 182, 185, 189, 192, 193, 200, 201, 205, 207, 208, 209, 210, 224, 225, 226, 228, 240, 241, 242, 243, 244, 246, 262, 320, 329, 333]

unflagged_ants: [5, 7, 8, 10, 17, 19, 21, 22, 30, 31, 35, 41, 44, 45, 46, 48, 49, 53, 61, 62, 64, 66, 67, 69, 70, 73, 83, 85, 86, 88, 89, 90, 91, 93, 95, 102, 105, 107, 112, 115, 118, 120, 124, 125, 127, 137, 139, 140, 141, 144, 150, 157, 158, 160, 162, 163, 164, 166, 167, 168, 169, 171, 181, 183, 184, 186, 187, 190, 191, 202, 206, 211, 220, 221, 222, 223, 227, 229, 237, 238, 239, 245, 261, 324, 325]

golden_ants: [5, 7, 10, 17, 19, 21, 30, 31, 41, 44, 45, 53, 66, 67, 69, 70, 83, 85, 86, 88, 91, 93, 105, 107, 112, 118, 124, 127, 140, 141, 144, 150, 157, 158, 160, 162, 163, 164, 167, 168, 169, 171, 181, 183, 184, 186, 187, 190, 191, 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_2459961.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.dev13+gd6c757c
3.3.dev3+gb08b74d
In [ ]: