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 = "2459953"
data_path = "/mnt/sn1/2459953"
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-8-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/2459953/zen.2459953.21289.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 1851 ant_metrics files matching glob /mnt/sn1/2459953/zen.2459953.?????.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/2459953/zen.2459953.?????.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 2459953
Date 1-8-2023
LST Range 1.736 -- 11.698 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
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 65 / 196 (33.2%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 121 / 196 (61.7%)
Redcal Done? ❌
Never Flagged Antennas 75 / 196 (38.3%)
A Priori Good Antennas Flagged 49 / 93 total a priori good antennas:
3, 5, 7, 9, 10, 15, 16, 29, 38, 40, 42, 54,
55, 56, 71, 72, 81, 85, 86, 93, 94, 101, 103,
106, 109, 111, 121, 122, 123, 128, 136, 140,
143, 146, 151, 158, 161, 165, 167, 170, 173,
182, 185, 187, 189, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 31 / 103 total a priori bad antennas:
8, 22, 35, 46, 48, 61, 62, 64, 73, 82, 89,
90, 95, 114, 115, 125, 132, 137, 139, 207,
211, 220, 221, 226, 237, 238, 239, 245, 324,
325, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459953.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.877803 12.485938 9.948688 -1.012518 11.268264 6.395470 0.111260 8.598352 0.031838 0.349573 0.276158
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.108887 2.781145 5.774351 -0.359668 9.896106 7.583552 16.625922 33.867409 0.553878 0.635183 0.434656
5 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.925877 -0.819537 3.050482 2.135608 17.502357 8.236498 3.391564 6.889171 0.600184 0.629732 0.402579
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.082484 0.018078 -1.274890 -0.349092 -0.516102 0.218371 9.303411 11.446789 0.627828 0.646331 0.397232
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.427332 -1.415836 -0.673541 -0.003176 -0.454455 0.200994 3.724194 1.493378 0.627829 0.642438 0.392283
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.390198 -1.225523 8.285962 -0.490283 6.796605 0.029426 0.186885 -0.343617 0.452997 0.643060 0.469395
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.462237 -0.545997 -0.995491 -1.382346 -0.504033 1.230774 -0.004602 6.065917 0.620651 0.642999 0.399984
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.248840 16.629550 9.882108 -0.910331 11.304016 6.582484 -0.024767 1.912115 0.030799 0.351093 0.267741
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.105590 -0.815601 9.914281 0.823512 11.265798 1.438481 0.079814 1.953161 0.030417 0.644399 0.517068
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.723142 1.421067 0.487573 0.352528 -0.403552 -0.084381 1.345085 0.905135 0.627952 0.646313 0.402297
18 N01 RF_maintenance 100.00% 100.00% 53.00% 0.00% 10.714449 17.132463 9.887595 -0.691896 11.386509 8.759970 0.059034 14.023362 0.028810 0.226330 0.171737
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 2.930176 -0.730955 -1.231931 -0.829502 2.318549 1.755839 2.061463 1.598549 0.628125 0.655134 0.392457
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.210830 -1.424089 2.495050 -1.098200 0.468040 1.405692 0.746219 -0.360993 0.627515 0.653308 0.398784
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.027405 0.163125 -0.652840 0.006525 0.379421 1.906041 0.150470 0.177798 0.624440 0.635379 0.389360
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.665316 -0.270263 0.817626 0.617301 1.035450 0.936440 -0.693232 -1.208938 0.597504 0.617166 0.392584
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.414684 11.081754 9.949888 10.361463 11.395723 12.767638 1.379656 0.900194 0.034460 0.037450 0.005114
28 N01 RF_maintenance 100.00% 0.00% 84.82% 0.00% 11.265296 25.723460 -0.697245 0.985773 8.051500 8.619729 5.236658 14.574727 0.358688 0.157986 0.271963
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.140514 11.513710 9.528158 9.943437 11.353422 12.714386 0.035051 -0.226147 0.029554 0.033588 0.004420
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.315346 -0.112318 -0.217383 0.598869 1.060889 -0.067553 1.086508 0.128822 0.634934 0.652483 0.395094
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.528374 -0.273357 1.208361 1.062456 1.476872 0.699896 1.159957 3.039976 0.645236 0.647055 0.387258
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.016029 14.570048 -0.159444 2.299722 2.260801 11.608090 11.412654 36.097561 0.623011 0.580022 0.369217
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.557580 12.602069 4.207497 4.496597 11.356554 12.729600 0.453263 0.171762 0.033078 0.042409 0.006609
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.537443 0.026694 0.820973 -1.452135 -0.333608 -1.133401 1.687366 0.057477 0.607620 0.603466 0.384991
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.496761 25.101672 13.293787 13.199853 11.429266 12.615435 4.055447 4.048004 0.029496 0.027625 0.001909
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.114876 0.439783 -1.225295 0.810541 0.142834 0.838808 -0.405733 3.091907 0.629382 0.639633 0.409060
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.103816 0.111336 0.124078 0.603111 -0.054786 0.942897 4.746530 0.878839 0.631221 0.647419 0.409088
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 9.500679 0.172939 9.566923 0.471927 11.378546 -0.382918 0.952193 0.441921 0.034864 0.641347 0.503924
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.734925 -0.129008 -0.035237 0.003176 1.642801 -0.208133 -0.469964 0.933224 0.632053 0.650572 0.392456
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.634145 11.969287 10.230650 10.884318 11.215279 12.597577 1.284130 1.902073 0.027001 0.026216 0.001369
43 N05 RF_maintenance 100.00% 97.51% 97.57% 0.00% 197.763123 197.894407 inf inf 4191.355273 4229.794757 4928.527319 4681.530059 0.595435 0.607614 0.373763
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.912391 -0.078215 -0.825667 0.064702 -0.129463 0.462631 -0.843785 -0.657307 0.648808 0.664833 0.389130
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.057610 2.983896 0.174193 0.620082 -0.658854 1.289547 -0.156028 2.597054 0.639783 0.648305 0.379820
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.188220 0.287854 -0.942008 -0.775873 -0.053209 -0.311109 -0.527062 -0.737485 0.642402 0.668145 0.402198
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.784851 12.326985 4.025445 4.114035 11.306633 12.655455 0.192639 -0.487809 0.031076 0.045866 0.010574
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.010580 1.104005 0.905355 2.347947 -0.931056 2.521346 -0.567178 -1.707484 0.612790 0.636942 0.395668
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.044980 -0.095164 -0.473473 -0.566406 1.176716 -0.606846 0.213669 4.786437 0.560259 0.607149 0.393423
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.330713 10.760976 0.156624 1.172717 2.585755 7.087946 13.281608 57.718035 0.602644 0.583874 0.383992
51 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 22.440390 4.323491 12.745368 -0.532562 11.541870 6.990448 7.165921 2.191105 0.035330 0.529005 0.401813
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.921503 6.216136 -0.393843 0.512904 1.076453 0.297018 0.614905 1.099857 0.634057 0.646979 0.399504
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.945944 2.878059 0.106840 0.351547 0.979340 1.670555 2.639896 3.882002 0.638900 0.653863 0.405503
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.870826 11.678755 9.970601 10.605024 11.335453 12.699823 1.433146 0.736503 0.026933 0.026092 0.001173
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.325533 12.312372 9.982679 10.499253 11.391145 12.742685 1.054012 2.384351 0.027643 0.029524 0.002007
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.212149 12.432128 0.438481 10.737468 -0.149836 12.643004 1.913342 1.346867 0.639782 0.034868 0.520876
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 23.486063 -0.171773 6.974749 0.554606 6.961671 0.819184 23.961204 1.875178 0.417133 0.659287 0.418903
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.514236 11.393092 9.850765 10.491352 11.347567 12.741188 1.992349 1.736738 0.032864 0.033119 0.001978
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.865997 0.653806 8.342848 2.492197 16.824453 0.843519 71.481413 6.856927 0.046731 0.647507 0.530582
60 N05 RF_maintenance 100.00% 97.89% 97.73% 0.00% nan nan inf inf nan nan nan nan 0.436374 0.482886 0.302252
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.660208 0.149591 -0.736578 -1.454591 1.174001 -1.482106 -0.687262 -0.000356 0.586050 0.623870 0.385565
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.787309 0.648850 -0.812769 1.553646 -0.544228 0.030202 1.609373 -0.900872 0.577710 0.635045 0.399712
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.072568 11.706358 0.097377 4.525298 0.578602 12.821576 -0.334962 1.713787 0.608867 0.042144 0.487081
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.200389 0.377173 -0.506819 -1.060893 -0.506537 -0.638713 3.081170 3.360266 0.592859 0.589704 0.376897
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.609402 1.048971 0.405537 1.131935 0.262512 0.520562 1.315299 0.478699 0.612395 0.633258 0.414064
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.430237 1.575894 -1.326048 -1.320745 3.309146 -0.005037 -0.589297 -0.048056 0.629221 0.648227 0.408893
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.417467 -0.617244 -0.952331 0.647388 -0.523164 0.688139 0.053699 1.374595 0.636276 0.648673 0.402952
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 20.585575 25.368287 1.242720 13.923653 6.957350 12.705151 1.319586 8.359113 0.352408 0.027080 0.249550
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.603085 -0.608834 0.230049 0.779808 -0.131795 1.716963 -0.166983 0.231909 0.631976 0.650201 0.393695
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.150479 -0.469276 -0.175620 0.060637 0.435805 0.961831 0.568903 -0.033184 0.638786 0.656690 0.392657
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.694338 0.022095 0.648579 0.915347 0.913372 -0.648466 3.253766 0.096472 0.652682 0.654796 0.383766
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.908670 12.505139 10.341654 10.908073 11.228599 12.594367 1.446865 1.701333 0.026897 0.025489 0.001450
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.669955 0.744857 -1.395304 -1.003533 0.609364 -0.492274 -0.367595 -0.450478 0.657810 0.669812 0.384727
74 N05 RF_maintenance 100.00% 97.62% 97.41% 0.00% nan nan inf inf nan nan nan nan 0.663945 0.677551 0.392087
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 48.272494 0.892677 0.403880 0.183008 9.883051 -0.915863 35.949491 -1.009557 0.374838 0.629481 0.416282
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 33.522782 -0.005850 -0.341088 1.530379 2.825509 0.440825 0.547216 0.740285 0.434048 0.640553 0.387611
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.389600 12.067837 -1.359051 4.546886 -0.607986 12.632640 1.180411 -0.435541 0.593747 0.038219 0.458278
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -1.047272 12.887494 0.261584 4.444406 0.944013 12.646507 6.239036 0.522945 0.592951 0.043102 0.460544
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.268161 12.190853 0.063341 9.077794 -0.820880 12.409232 -0.353879 0.806549 0.588061 0.035309 0.454661
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.560579 -0.243200 0.379676 2.135084 -0.793180 -1.080217 -0.639963 -0.325022 0.607506 0.614669 0.391727
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.671016 -0.189339 0.172960 0.405434 0.440440 -0.994978 -0.598129 -0.169067 0.617743 0.637411 0.396866
84 N08 RF_maintenance 100.00% 76.18% 100.00% 0.00% 19.620819 22.599906 12.928965 13.458468 9.615056 12.535650 2.671531 2.963159 0.185404 0.032038 0.113102
85 N08 digital_ok 100.00% 97.68% 97.78% 0.00% nan nan inf inf nan nan nan nan 0.537878 0.489901 0.415252
86 N08 digital_ok 100.00% 97.89% 98.11% 0.00% nan nan inf inf nan nan nan nan 0.452980 0.446472 0.385873
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.772003 7.035024 -0.646779 -0.276758 -0.356341 1.775534 0.421814 2.212544 0.651461 0.667551 0.383198
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.881682 0.568862 0.405634 0.677605 -0.349679 -0.322536 0.860460 -0.094357 0.643794 0.659780 0.373989
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.074038 0.324698 -0.026075 0.779766 -0.547224 -1.174258 -0.716373 -0.596623 0.650375 0.663009 0.374726
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.144585 -0.759770 0.995283 1.300163 -0.826254 -0.913287 -0.118464 2.047232 0.642773 0.655688 0.375959
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.330196 -0.396848 0.403815 0.199509 -1.055805 -0.779071 0.599664 -0.005419 0.640537 0.665045 0.388046
92 N10 RF_maintenance 100.00% 0.00% 23.72% 0.00% 34.580553 40.632881 0.554959 1.227941 7.737370 8.020300 -0.153370 5.386207 0.282086 0.240832 0.087772
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 1.986309 -0.056426 2.242911 -1.091791 2.271460 6.224563 3.230496 0.377011 0.631997 0.659583 0.392110
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.854483 11.775755 10.109819 10.379656 11.487320 12.697875 0.540168 0.262259 0.029712 0.026409 0.001690
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.703408 0.012757 -0.648743 1.267957 -0.877900 0.708610 -0.641470 0.936140 0.603942 0.639000 0.396282
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.117738 12.487992 4.058809 4.649455 11.217443 12.629281 0.243826 0.241181 0.032945 0.037327 0.002207
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.948908 5.369129 -1.101974 1.262559 -0.918954 10.042213 5.119533 5.552762 0.587550 0.538831 0.382759
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.701386 8.494845 -0.487429 1.202926 0.168615 1.087479 0.393119 0.709372 0.638216 0.648881 0.393420
102 N08 RF_maintenance 100.00% 97.89% 97.78% 0.00% nan nan inf inf nan nan nan nan 0.439339 0.447296 0.349518
103 N08 digital_ok 100.00% 97.46% 97.95% 0.00% nan nan inf inf nan nan nan nan 0.593815 0.468582 0.420239
104 N08 RF_maintenance 100.00% 97.78% 97.84% 0.00% nan nan inf inf nan nan nan nan 0.422965 0.427730 0.305671
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.458817 -0.365684 0.199615 0.784650 0.283904 -1.045436 -0.591176 -0.348715 0.651176 0.659705 0.370852
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.587191 1.497859 2.119065 -0.464322 11.787185 9.918008 0.347129 0.875320 0.627577 0.665632 0.374938
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.696718 0.730784 -0.857174 -1.046652 0.577146 0.370534 2.855227 2.533785 0.653414 0.669807 0.373346
108 N09 RF_maintenance 100.00% 100.00% 0.32% 0.00% 9.999910 37.992513 9.894057 0.721928 11.347758 8.062638 0.919520 1.758122 0.032895 0.278810 0.159847
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.795606 11.369826 9.926913 10.235200 11.404003 12.756549 -0.042980 0.979341 0.026679 0.026821 0.001262
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 24.633807 23.982462 13.350018 13.657865 11.250363 12.491220 2.642344 2.762824 0.023706 0.025180 0.000983
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.082880 11.299381 0.465597 10.361342 -0.366320 12.771102 7.621411 1.755335 0.645494 0.033441 0.459432
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.814755 -0.677966 0.270840 0.298196 0.882700 3.351268 0.265662 -0.675833 0.637282 0.653279 0.397231
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.786099 12.629670 3.829514 4.536748 11.261434 12.697542 0.851004 0.100357 0.033560 0.030884 0.001542
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.868351 0.724313 -0.759787 0.178751 0.080731 -0.678231 0.673148 0.380154 0.586588 0.625204 0.393312
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.131148 -0.776047 -0.642908 -0.178908 -0.075733 -1.007672 -0.588053 -0.043137 0.579488 0.609439 0.399642
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.788161 12.762651 10.027184 10.864174 11.208354 12.695922 0.472029 2.296476 0.027592 0.029870 0.001847
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 1.091772 1.238586 -0.289201 0.546073 -0.345808 -0.439895 -0.232218 0.352900 0.607381 0.637085 0.402504
120 N08 RF_maintenance 100.00% 97.73% 97.89% 0.00% nan nan inf inf nan nan nan nan 0.515255 0.483787 0.446224
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.650398 3.407594 -1.347215 5.897057 0.367023 -0.098587 6.038190 11.224665 0.644114 0.632091 0.379213
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.138386 6.629622 0.109250 0.905542 1.674994 0.978466 0.160802 -0.652227 0.651748 0.663974 0.384846
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.892128 8.863279 0.730275 0.959582 0.112511 0.080161 -0.580814 -0.260756 0.659606 0.672666 0.385381
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.342042 0.217794 -0.096830 0.623531 -0.766460 -0.482953 0.356815 0.216506 0.662156 0.670608 0.377695
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.130471 -0.712463 -0.355161 0.693696 0.186231 -0.733135 -0.060751 -0.505331 0.655384 0.666791 0.372435
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.576867 6.376170 -1.323866 1.514232 2.925934 0.419789 2.558767 0.235169 0.659621 0.663721 0.377165
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.044911 -0.088786 0.560332 0.500177 1.363941 0.425426 -0.283507 0.409633 0.653058 0.673529 0.389310
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 8.936762 10.508541 9.452919 9.914202 11.234283 12.621863 -0.286976 -0.043780 0.029735 0.028273 0.001052
131 N11 not_connected 100.00% 0.00% 3.40% 0.00% -0.784739 11.265532 0.291087 4.372463 -0.176717 10.662159 -0.654386 -0.093122 0.623325 0.300187 0.439651
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.074838 1.802433 -0.675441 -1.276105 -0.904982 -0.596361 2.042859 -0.055954 0.595921 0.611824 0.380880
133 N11 not_connected 100.00% 100.00% 0.00% 0.00% 11.416112 -0.197053 3.806794 -1.429074 11.340396 -0.432030 1.010369 -0.565705 0.061428 0.607329 0.479155
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.753779 -0.696843 -0.132866 -1.313502 3.435724 0.387110 5.459028 0.823081 0.587311 0.621122 0.419444
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.126470 0.798249 9.503399 0.426780 11.431028 7.306723 0.766822 -0.008276 0.035955 0.612568 0.453860
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.589873 -0.635603 0.195944 -1.327994 1.626096 -0.993483 0.172898 -0.226719 0.591076 0.632294 0.409946
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.724442 -0.392803 1.962735 -0.596174 0.949025 -0.390165 -0.776955 -0.209141 0.622591 0.630757 0.390084
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.155038 -0.204539 -1.090622 0.160172 -0.564326 -0.346060 4.919275 3.159295 0.636797 0.663489 0.392311
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.399436 -0.617193 -0.287416 1.074764 1.951971 -0.670751 0.319279 -1.026667 0.641114 0.667675 0.387180
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.784333 11.264186 -0.642426 10.524493 3.277217 12.723039 24.129038 0.824159 0.647825 0.042569 0.517144
143 N14 digital_ok 100.00% 0.00% 100.00% 0.00% -1.202935 11.736748 0.913028 10.597724 1.837262 12.556692 0.493831 1.591384 0.651518 0.036942 0.529031
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.470278 0.010580 -1.133947 0.336287 -0.140268 0.273535 -0.669903 -0.742335 0.662780 0.673271 0.375676
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.019486 0.891974 -1.042860 4.299160 -0.128677 4.711879 -0.337107 0.132300 0.661448 0.645704 0.380786
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.212249 -1.143579 3.813850 0.153923 11.342702 -1.053343 -0.277135 -0.926426 0.037214 0.660768 0.515210
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.747152 -1.599021 1.165761 2.319358 -1.199140 -1.172040 -0.469611 0.387956 0.646284 0.659841 0.382287
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.286649 0.080414 -0.568678 -0.559241 1.940059 0.995926 -0.071289 -0.758223 0.652739 0.672074 0.394726
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.403349 -1.314451 -1.209350 -1.148599 -0.547423 0.841943 1.069571 0.681307 0.644961 0.666380 0.398460
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.013136 -0.714729 -0.893034 -1.037545 -0.896487 0.186276 -0.672379 -0.180732 0.645415 0.662039 0.401432
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 27.132763 1.080449 0.083016 0.405609 4.129749 0.274982 0.750789 -0.546027 0.477779 0.589784 0.347665
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.471598 -0.851085 9.654698 -1.434660 11.844423 0.765810 1.128530 2.721553 0.036820 0.622552 0.477824
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 6.055918 11.149465 8.977624 10.250589 8.178134 12.794483 0.744036 1.011547 0.333583 0.036040 0.247056
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.276207 -0.408349 -0.065353 0.753172 -0.921124 0.005037 -0.378986 0.000356 0.606052 0.631100 0.406998
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.794941 0.004422 -0.140022 -0.353991 1.705421 0.971540 2.811475 16.540772 0.619162 0.646809 0.411699
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.194131 20.853821 -1.237882 -0.796321 0.229234 8.197068 -0.266722 66.348146 0.590541 0.536873 0.361970
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.880744 -1.203648 -0.313750 -0.672184 -0.903983 1.239985 1.139933 0.694331 0.632447 0.655366 0.393309
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.104089 27.229016 -0.046133 -0.553734 -0.310840 2.382449 -0.292654 0.500990 0.639482 0.528360 0.342953
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.108373 -0.973026 -0.608783 -1.025049 1.331183 1.036679 2.268279 0.305150 0.656233 0.673419 0.384555
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.533454 1.146024 -0.220427 0.438820 -0.533918 1.110025 -0.326632 0.965055 0.659995 0.672132 0.386437
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.108714 0.456916 0.583545 -0.043846 2.612422 2.608980 1.203650 0.862100 0.654234 0.673425 0.378183
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 31.663414 0.022884 -0.386217 -0.882975 21.251554 12.228203 4.479370 0.254566 0.517487 0.671958 0.378017
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.459635 1.836475 -0.819085 0.784075 12.306448 17.454304 6.304127 7.993605 0.658537 0.668100 0.383157
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.985085 -1.140454 -1.427228 -0.112492 1.241827 0.725246 0.563339 5.803225 0.659404 0.672526 0.387558
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.956100 -1.446596 0.283762 -0.364680 1.211834 0.044628 -0.668270 1.720284 0.650016 0.667966 0.393742
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.468495 -0.776825 -0.926113 -1.244774 0.060008 0.091058 -0.823565 -0.911753 0.652062 0.670201 0.395659
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.694994 -0.807902 10.225068 -1.347683 11.616862 -0.530343 1.292345 0.713954 0.036985 0.665758 0.523028
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.643047 2.646171 -1.118745 -0.061294 -1.030476 2.472449 -0.556522 0.774406 0.589861 0.574436 0.369510
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 12.011694 12.393673 3.544740 4.143071 11.472277 12.758075 2.029731 3.821724 0.038411 0.040847 0.002694
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.062847 -0.668866 -0.303752 1.040884 -1.040798 1.926794 -0.013844 25.912247 0.614320 0.635845 0.400960
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.489695 11.977410 -1.464523 10.667848 13.462805 12.638232 17.928235 1.254613 0.635322 0.048656 0.521756
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.459672 -0.444400 0.023505 0.330821 0.182321 -0.211889 -0.481110 3.134281 0.642973 0.657713 0.393432
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.340655 11.072123 -1.326016 10.217217 -0.503419 12.758220 11.970614 1.007637 0.653034 0.043358 0.493449
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.643900 0.482652 -0.945043 0.023971 0.527367 -0.632053 1.027849 0.731245 0.646982 0.661298 0.379004
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.051635 -0.761650 -0.770578 -0.442970 -0.290856 0.203496 0.935362 0.164745 0.654716 0.673133 0.374197
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 36.127762 -0.236073 -0.200094 -1.290029 22.483529 12.182095 9.102764 0.315204 0.519392 0.669923 0.381569
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.651911 -1.254254 -1.445871 -0.201489 0.924336 -0.173900 0.162175 3.345206 0.662388 0.681384 0.392321
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.173998 0.792676 -1.217535 1.382994 -0.244101 -0.701260 1.289703 15.382702 0.657989 0.676587 0.385063
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 9.025380 10.950020 9.466895 10.341027 11.877302 13.114373 3.673405 1.503537 0.028038 0.030169 0.000934
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.399887 -1.169616 -0.731243 0.787935 -0.782758 0.152739 -0.613749 -1.281988 0.644515 0.669570 0.404188
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.599178 0.494271 1.290870 -0.405683 0.569138 0.245963 8.495351 1.274982 0.630367 0.654268 0.401783
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.444230 7.238281 5.592890 5.525739 8.666943 10.073954 -3.119624 -3.139420 0.587246 0.608628 0.390513
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 7.066357 0.215694 5.686262 1.692641 8.874684 1.674063 -3.082633 0.870714 0.575633 0.619366 0.419416
200 N18 RF_maintenance 100.00% 100.00% 52.73% 0.00% 11.594347 34.256005 3.968657 1.117260 11.426656 9.858544 0.801293 0.049906 0.040002 0.217741 0.148386
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.567766 5.402816 3.559104 4.888015 3.702321 8.069455 -0.341746 -2.275278 0.629751 0.631958 0.387171
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.613560 1.922981 2.131374 -1.285538 0.917288 0.793456 -0.215977 20.224490 0.639746 0.627467 0.381431
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.482834 2.703415 0.402265 -0.337746 -0.918629 -0.145673 -0.442329 4.894342 0.632840 0.621713 0.375136
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.381530 1.320264 2.482683 -0.506293 11.882989 -0.517436 -0.640406 3.557799 0.637128 0.636296 0.376206
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.794505 3.699646 1.819033 -0.289239 1.053743 -0.126769 -0.574188 -0.904758 0.619237 0.619706 0.355293
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 7.356081 12.215306 9.114258 11.573297 11.182090 11.313278 7.662659 66.640650 0.033671 0.032166 0.001142
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.835801 8.154792 9.205550 9.242894 11.282192 12.526609 15.193817 12.690302 0.039513 0.038245 0.001461
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 12.860992 11.695652 -0.935116 -0.943877 -0.897728 -0.447155 -0.755859 1.563717 0.633987 0.647572 0.391495
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.834043 -0.794611 -0.838089 0.410515 -0.533838 -0.261262 2.600149 -0.111943 0.586309 0.622137 0.394495
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.390284 -0.686679 0.835902 -0.073912 -0.346343 -0.938669 3.031972 -1.051653 0.623407 0.634253 0.385686
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.520615 -0.142271 -0.871412 -0.336897 0.710807 -1.041039 2.888336 -0.760461 0.609347 0.639755 0.390669
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.313909 -0.323235 0.058198 -1.438183 0.385764 31.239683 1.833804 -0.069217 0.619383 0.621595 0.388499
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.905981 1.156622 -1.094175 -1.128476 -0.036933 -1.114080 -0.489726 9.886893 0.611016 0.637140 0.383851
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.292973 6.956864 5.898464 5.586975 9.257301 10.244687 -3.162055 -3.083032 0.606393 0.629056 0.383258
225 N19 RF_ok 100.00% 0.00% 88.76% 0.00% 1.468936 11.576893 1.235235 4.313184 -0.824210 12.571893 -0.965904 0.539014 0.632786 0.131903 0.529818
226 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.120429 1.251020 0.496153 1.866661 -0.723006 2.214780 -0.544023 -0.985271 0.624929 0.650960 0.395987
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.846394 0.554999 -1.270280 0.477475 0.156319 -0.510656 8.854383 -0.199101 0.591717 0.634202 0.386557
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.821752 18.677938 -0.829772 0.134079 5.868293 6.156412 61.317590 66.272523 0.518009 0.531220 0.310130
229 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.501103 0.236470 1.743011 1.833916 0.046010 1.293400 4.782424 -1.508940 0.609625 0.631582 0.399830
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.310702 0.013449 -0.178739 -1.214984 0.281488 -0.202105 -0.364977 -0.896288 0.555409 0.614706 0.408638
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.432190 -0.279378 1.349809 0.740320 -0.327123 0.409930 -1.311240 -1.458343 0.620357 0.635982 0.397589
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.990356 -1.397044 0.228667 0.527904 -0.868117 -0.043129 0.714276 2.002931 0.618179 0.639207 0.394971
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 33.055190 52.807679 -0.046362 1.234134 14.627870 20.975332 21.513611 14.189952 0.469113 0.402517 0.229664
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.962801 3.815375 -0.480739 0.429561 -0.743829 0.994686 5.159211 18.016170 0.608139 0.590135 0.387123
242 N19 RF_ok 100.00% 0.05% 0.00% 0.00% 53.881536 1.960936 0.694366 2.219152 11.156146 2.257574 15.824389 -0.552168 0.314765 0.641066 0.487603
243 N19 RF_ok 100.00% 22.69% 0.00% 0.00% 59.306585 2.480215 1.207912 -1.185203 9.453950 -0.923845 -1.225606 -0.003238 0.273127 0.617502 0.485282
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.815916 2.043426 1.298473 -0.943099 4.675009 0.948775 1.994267 5.761584 0.491848 0.595960 0.392609
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.538283 2.370051 0.561116 -0.592115 -0.182844 -0.307520 -1.028191 -0.060089 0.601411 0.609397 0.388290
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.898137 7.478987 -0.394953 0.496472 6.314776 7.550649 2.928616 -0.370401 0.320018 0.330443 0.162057
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.431051 1.419247 1.069900 -0.109357 -0.247641 -0.756559 -0.363315 9.804007 0.600224 0.609760 0.391158
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.532293 8.078969 8.962496 9.692516 11.585830 12.514688 8.291029 15.703798 0.030624 0.027058 0.003167
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 6.252365 12.026301 2.743286 6.728331 17.966497 12.804580 19.244695 2.544094 0.421197 0.042290 0.332505
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.117233 2.418160 1.586588 2.017833 0.653492 1.661926 0.859298 -0.343524 0.502821 0.525727 0.383475
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.418238 -0.701516 1.688645 -0.963763 1.280042 -0.018206 0.281333 2.018375 0.527715 0.534067 0.389887
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 4.815947 -0.714631 1.185690 -0.673341 3.053824 -0.254865 2.411498 0.405873 0.415872 0.531078 0.393394
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.167752 2.822445 -0.711860 -1.247734 0.404865 -0.786470 0.971090 1.072702 0.462322 0.508193 0.375938
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 5, 7, 9, 10, 15, 16, 18, 27, 28, 29, 32, 34, 36, 38, 40, 42, 43, 47, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 74, 77, 78, 79, 80, 81, 84, 85, 86, 87, 92, 93, 94, 96, 97, 101, 102, 103, 104, 106, 108, 109, 110, 111, 113, 117, 120, 121, 122, 123, 126, 128, 131, 133, 135, 136, 140, 142, 143, 145, 146, 151, 155, 156, 158, 159, 161, 165, 166, 167, 170, 173, 179, 180, 182, 185, 187, 189, 191, 192, 193, 200, 201, 202, 205, 206, 208, 209, 210, 222, 223, 224, 225, 227, 228, 229, 240, 241, 242, 243, 244, 246, 261, 262, 320, 329]

unflagged_ants: [8, 17, 19, 20, 21, 22, 30, 31, 35, 37, 41, 44, 45, 46, 48, 53, 61, 62, 64, 65, 66, 67, 69, 70, 73, 82, 83, 88, 89, 90, 91, 95, 105, 107, 112, 114, 115, 118, 124, 125, 127, 132, 137, 139, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 164, 168, 169, 171, 181, 183, 184, 186, 190, 207, 211, 220, 221, 226, 237, 238, 239, 245, 324, 325, 333]

golden_ants: [17, 19, 20, 21, 30, 31, 37, 41, 44, 45, 53, 65, 66, 67, 69, 70, 83, 88, 91, 105, 107, 112, 118, 124, 127, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 164, 168, 169, 171, 181, 183, 184, 186, 190]
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_2459953.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.1.5.dev215+gd2b157e
In [ ]: