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 = "2460014"
data_path = "/mnt/sn1/2460014"
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: 3-10-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/2460014/zen.2460014.21298.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 856 ant_metrics files matching glob /mnt/sn1/2460014/zen.2460014.?????.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/2460014/zen.2460014.?????.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 2460014
Date 3-10-2023
LST Range 5.746 -- 10.352 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 856
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas 42, 70
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 62 / 198 (31.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 138 / 198 (69.7%)
Redcal Done? ❌
Never Flagged Antennas 59 / 198 (29.8%)
A Priori Good Antennas Flagged 65 / 93 total a priori good antennas:
3, 5, 7, 15, 16, 17, 29, 30, 31, 37, 38, 40,
42, 45, 53, 54, 55, 56, 65, 66, 67, 70, 71,
72, 81, 86, 93, 94, 101, 103, 107, 109, 111,
112, 121, 122, 123, 124, 127, 128, 136, 140,
147, 148, 149, 150, 151, 158, 161, 165, 167,
168, 169, 170, 173, 181, 182, 184, 187, 189,
190, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 31 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 50, 57, 61, 62, 73,
89, 90, 115, 125, 132, 133, 137, 139, 179,
228, 229, 237, 238, 239, 241, 245, 320, 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_2460014.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% 0.00% 100.00% 0.00% 1.313226 13.100516 0.027382 8.816016 0.228533 10.423485 -0.689128 0.908329 0.548774 0.038653 0.486065
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.401779 13.410170 1.915147 1.969599 2.257493 8.143840 -2.472349 26.350260 0.544579 0.427394 0.348617
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 11.362754 12.907188 8.334992 8.570315 8.868830 10.481698 0.014580 -0.119578 0.039317 0.034216 0.002849
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.889188 0.023325 -0.847037 -0.173042 1.008344 1.299071 4.964301 13.175605 0.561005 0.571145 0.352157
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.358287 -1.567979 -0.253225 0.181658 0.348183 0.650895 2.050547 1.808133 0.555221 0.563250 0.342999
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.211316 -0.605100 2.569130 -0.880691 2.562100 0.133599 2.589556 -0.595162 0.531121 0.561543 0.352189
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.686668 -0.944693 -0.177124 -1.002849 -0.953946 1.504304 1.737031 -0.158697 0.548462 0.556276 0.350168
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 33.406114 -0.741280 2.275149 2.489391 3.766907 0.320418 -0.050188 5.417464 0.392105 0.550723 0.355065
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 2.921863 13.032576 2.650718 8.795769 0.115837 10.397250 5.792317 0.565796 0.521748 0.032696 0.426465
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.954329 7.707900 0.625512 8.040545 0.671371 6.818174 -0.430707 2.634057 0.563311 0.297110 0.437580
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.557893 9.623234 8.361478 0.167950 8.852703 9.161068 0.125844 39.831747 0.033913 0.363216 0.288041
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.220210 -0.308613 -0.721448 0.175386 0.443520 0.350317 -0.121246 0.405009 0.569311 0.586463 0.353536
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.139161 -1.156392 1.847308 -0.804273 0.282505 0.774778 1.700531 0.054372 0.551162 0.576393 0.350526
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.566560 0.096510 -0.263865 0.165124 0.351647 2.298343 0.355047 0.364032 0.550056 0.554813 0.344609
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.011285 -0.212712 -0.081147 -0.131201 -0.386307 0.451650 -1.032430 -1.443609 0.520876 0.531351 0.341632
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.310278 12.334316 8.415637 8.653680 8.840370 10.479280 1.868329 1.334444 0.029115 0.029386 0.000604
28 N01 RF_maintenance 100.00% 100.00% 14.72% 0.00% 10.807272 20.360278 8.212260 3.032990 8.838263 6.035646 -0.132314 34.570465 0.028194 0.220561 0.162950
29 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -1.860591 0.056099 2.221483 0.578669 -0.667036 -0.692594 6.634328 2.066531 0.555822 0.576046 0.355721
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.164786 -0.412617 0.499552 -1.094811 0.323011 0.167206 10.099298 0.291573 0.560560 0.591601 0.358170
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.435463 -1.284383 1.092524 0.724023 1.907688 0.023803 0.632764 9.712016 0.576804 0.583342 0.350619
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.287638 28.673221 0.482712 2.690136 8.905911 1.393757 4.517798 8.505374 0.500898 0.440811 0.281270
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 12.466071 13.830501 3.869174 4.010891 8.821073 10.453010 0.921150 0.562332 0.033511 0.041836 0.005363
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.220095 0.185542 -0.354769 -0.955206 -0.953632 -0.565198 3.021290 0.070946 0.528821 0.517997 0.338293
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.966865 8.638715 0.937088 0.785998 2.617398 3.578688 -0.300271 0.217323 0.534710 0.546819 0.373564
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.724716 21.922595 -0.541716 10.450082 1.358262 10.442157 -0.843444 2.467058 0.555257 0.030365 0.441071
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.655016 0.970335 -1.289309 2.190851 0.861303 0.211504 2.891693 10.952415 0.562655 0.547639 0.367419
40 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.418282 0.563278 2.220613 -0.235153 -0.761274 2.576180 2.011680 27.884645 0.553243 0.571443 0.355962
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.030778 0.948374 1.427265 0.765119 2.764011 0.007641 -0.485218 -0.421045 0.569316 0.583767 0.359015
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.158749 2.387566 2.609068 -0.880958 1.465109 1.148046 -0.167497 0.236424 0.217709 0.216814 -0.278635
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.303192 0.507186 -0.523322 0.676761 -1.188578 0.135014 -1.387453 -0.270558 0.587396 0.588940 0.353143
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.129742 0.384910 -1.273584 0.202683 -0.271400 0.947069 -1.257604 -0.695832 0.582180 0.594908 0.352958
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.560022 3.272493 0.386974 0.797903 -0.357906 1.310185 0.000039 14.589559 0.569754 0.577580 0.348254
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.016928 -0.226833 -0.479559 -1.175784 0.008683 -0.073539 -0.874741 -1.176818 0.570869 0.590938 0.363791
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.550807 13.563176 3.791087 3.700026 8.793310 10.390013 2.264648 0.034255 0.031242 0.047488 0.010645
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.012071 1.334470 -0.819253 1.206543 -1.023796 1.446508 2.123736 -2.551255 0.520326 0.550433 0.351701
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.444181 0.055364 -0.556704 -0.227390 1.029196 -0.409513 1.111817 6.051599 0.487808 0.526464 0.347445
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.996218 0.726906 -0.091005 1.527980 0.089729 0.451759 -0.510341 -0.288383 0.540494 0.546204 0.371439
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 6.836372 1.611482 -0.128394 0.219633 2.852425 3.031884 41.543891 1.840676 0.548426 0.561956 0.367013
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.247294 6.477328 0.344974 0.144637 3.642677 2.287996 3.618338 1.371944 0.563545 0.575075 0.366251
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.357105 2.165674 -0.065064 -0.696556 3.262914 2.452998 10.652903 1.167428 0.574556 0.588136 0.369971
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 10.535607 6.898599 2.082822 -0.308959 9.064754 6.774685 1.229788 4.347072 0.275291 0.298363 0.148656
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.831405 56.613365 0.412476 5.241059 0.428042 10.409157 1.663469 -0.463283 0.238778 0.037038 0.084334
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -1.359549 -0.122033 -0.914080 2.094534 -0.680388 7.060499 -0.917951 5.864383 0.590177 0.587109 0.349210
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.929146 -0.342855 1.771522 -0.209500 1.653706 0.991840 -2.281199 0.694734 0.587012 0.596161 0.346942
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.423416 12.601568 8.338615 8.757248 8.853436 10.496596 2.054613 1.681070 0.034328 0.034111 0.002062
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.368348 0.754987 8.398418 1.257292 8.640562 1.066985 0.320167 1.755132 0.042565 0.581232 0.445312
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.011973 12.406899 -0.218761 8.779668 0.087114 10.444884 1.327943 2.633047 0.565505 0.053162 0.457900
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.107622 0.052341 -0.228674 -1.063144 0.287905 -1.467062 -0.733711 -0.006483 0.505240 0.540719 0.340936
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.391377 0.960073 -0.672221 0.633026 -0.906796 -0.515582 1.413020 -1.079799 0.501965 0.548605 0.350985
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 1.972650 12.973541 -0.633676 4.032608 0.185355 10.511613 -0.789111 2.089590 0.516563 0.043423 0.410402
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.203733 -0.139249 -1.201540 -0.660767 -0.457624 -0.806111 4.745121 0.188214 0.513236 0.500523 0.330187
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 24.593088 21.670589 10.887531 10.805839 9.014692 10.569293 4.372422 5.625308 0.022586 0.024258 0.001944
66 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.488469 0.669688 5.832324 2.712308 1.964993 -0.301367 3.373787 2.157787 0.495457 0.557992 0.383506
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.594245 1.115814 -1.184029 0.851346 0.347509 2.367683 10.753360 1.922923 0.573523 0.569413 0.362697
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 26.782431 0.695556 11.009034 0.549635 8.855393 -0.236868 5.270506 -0.911207 0.031883 0.589254 0.455076
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.593585 0.339893 0.213107 2.483175 0.712984 2.956954 1.594116 0.317381 0.583790 0.576139 0.348661
70 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.663794 -0.064940 1.181678 2.675332 3.485338 0.402028 5.423740 0.742975 0.227741 0.211730 -0.276780
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.356500 -0.796391 0.056581 3.674011 1.859195 -0.894488 -0.740614 -0.131238 0.582880 0.573428 0.342067
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 1.456786 1.009629 1.262795 6.058943 0.703045 2.116265 0.300588 10.050911 0.587353 0.518616 0.360633
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.344791 0.461261 -0.868404 -0.720405 1.381362 1.670733 -0.684313 -0.649336 0.592501 0.602040 0.350605
74 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.740797 0.425567 -0.466528 -0.392031 1.135618 2.543367 -0.703426 5.155593 0.590461 0.601023 0.354543
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 61.330561 9.642761 0.388618 -0.442270 5.060467 5.440378 15.441628 45.068155 0.260872 0.499807 0.351506
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 34.092679 0.842050 -0.487396 0.922733 2.394283 0.422106 1.083363 -0.873027 0.357897 0.557542 0.353238
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.236838 13.332017 -0.999071 4.049561 -0.986117 10.354910 1.639986 -0.506663 0.514129 0.038426 0.418736
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.848093 14.198691 -0.120783 3.968165 -0.955875 10.372263 -0.338320 0.726086 0.529025 0.045520 0.429812
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.851770 13.275026 0.384302 7.658734 -0.199903 10.224524 0.786331 1.923991 0.504496 0.035572 0.391543
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.455024 -0.190984 -0.602263 0.573619 0.579846 -0.571317 -0.617084 9.273237 0.542989 0.547444 0.359609
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.344011 0.042957 0.419728 0.554943 -0.048864 -1.112811 -0.538829 0.820919 0.552354 0.559522 0.354264
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.709408 24.436166 8.236013 11.093976 1.830603 10.396726 6.257538 4.570156 0.429980 0.041078 0.338426
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.281786 0.159895 -1.193312 -1.173832 -0.493493 -0.282144 -0.377091 0.006483 0.589413 0.595962 0.356875
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.934583 0.732483 -1.071145 -0.593449 3.010274 -0.424799 0.654610 22.416276 0.585164 0.594528 0.347264
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.402694 7.177363 -0.308277 -0.055207 0.077770 2.130341 2.700651 5.218940 0.594346 0.608573 0.348667
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.563777 0.171008 0.534606 0.736805 0.108608 -0.690190 0.758631 0.154646 0.584356 0.595856 0.339253
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.915204 0.093869 0.229693 0.842298 -0.304770 -0.766180 -0.658608 -0.308188 0.585921 0.597097 0.344973
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.008687 -0.399897 -0.800173 -0.661556 -0.351987 -1.420268 -0.175796 1.946601 0.584822 0.603175 0.350734
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.779570 -0.684546 0.572709 0.334601 -0.494016 -0.623237 1.364417 0.670112 0.560876 0.585190 0.351081
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.858078 -0.162907 8.317158 0.481651 8.851156 2.686416 -0.181853 0.139275 0.034151 0.582602 0.398313
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.050000 12.702442 8.446741 8.842903 8.727777 10.366264 2.069809 1.323932 0.029217 0.025030 0.002353
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.770306 12.960454 8.528597 8.672625 8.784114 10.418794 0.808181 0.560354 0.025450 0.025335 0.001003
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 7.787227 2.203407 -1.105145 0.357091 6.480200 4.909802 0.197802 0.336840 0.332511 0.353533 0.174485
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 4.718397 22.136817 2.666943 1.088775 3.053238 2.892730 -3.089514 -2.006073 0.525376 0.424035 0.334956
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.646161 4.361294 -1.134604 0.424907 -0.984121 1.795649 1.086686 17.489216 0.515725 0.480053 0.344151
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.135371 8.118799 -0.113327 1.117887 0.535302 1.535359 0.645821 1.539992 0.572674 0.577803 0.353758
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.513900 1.096066 -1.128011 -1.077687 -0.172406 -0.614588 -1.074696 9.820874 0.578127 0.595068 0.354344
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.855652 2.569953 1.794543 -1.033353 3.626628 -0.171151 3.818598 9.081383 0.577659 0.591495 0.343190
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.235346 62.288660 -0.733252 5.845300 2.535053 0.445892 1.267351 1.232047 0.585051 0.568063 0.342077
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.315268 -0.326817 0.406054 0.869661 0.938551 -0.457556 -0.569979 -0.438491 0.587057 0.594990 0.340642
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.211477 1.145339 -0.787438 -0.369496 0.422275 -0.505677 -0.027702 -0.307997 0.590706 0.600992 0.343819
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 1.155839 0.330950 -0.385525 -0.869448 1.329976 0.031787 4.787935 3.969286 0.583123 0.599001 0.344429
108 N09 RF_maintenance 100.00% 100.00% 1.87% 0.00% 10.824127 44.688393 8.364981 0.969812 8.810215 6.825590 1.487209 3.241671 0.033102 0.223509 0.108872
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.670479 12.560480 8.394547 8.557600 8.819173 10.466044 -0.065017 1.442000 0.049675 0.033215 0.011177
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.724657 13.981809 4.688751 -0.145787 3.497838 1.178699 -0.042793 -0.346190 0.535938 0.532950 0.338467
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 28.956002 12.609388 0.709294 8.632220 10.957125 10.450348 26.461404 1.505749 0.443547 0.046649 0.325578
112 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 3.530804 12.169390 6.207177 8.703392 1.571616 10.175309 -0.560970 0.173962 0.156083 0.054961 -0.085087
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.662715 13.907465 3.572980 4.046128 8.690483 10.327477 1.284987 0.169379 0.033211 0.031321 0.001182
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 13.499607 0.962905 3.716938 -0.424512 8.656131 -0.739361 -0.352590 1.097320 0.042520 0.531683 0.417914
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.357593 -1.386789 -1.268266 -0.230481 -0.198505 -1.109923 -0.656899 1.408181 0.494986 0.521447 0.353555
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.562714 13.887542 8.466960 9.040414 8.699984 10.438397 0.791949 3.280111 0.027867 0.030453 0.001733
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.481404 1.468572 0.065553 0.599591 0.437752 0.081812 0.500137 1.280530 0.544194 0.562315 0.363448
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.210978 2.289393 2.420380 -0.719227 0.323482 0.624564 1.966194 0.746512 0.563000 0.594211 0.357556
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.598751 3.122855 2.074005 5.086399 2.056243 -0.697416 20.592537 25.436574 0.581154 0.566037 0.336669
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.406351 6.741979 -0.866354 -1.047632 0.212417 1.029631 -0.385785 -0.761394 0.589736 0.605129 0.347942
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.978186 8.084303 3.042639 1.336186 4.855561 1.342388 -3.366862 -1.820948 0.581076 0.608377 0.353265
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 10.924734 1.465385 8.598970 0.658363 8.668967 -0.610524 0.260680 0.455536 0.038885 0.598410 0.412065
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.014962 0.611549 0.335831 0.709378 -0.079652 0.982817 0.232745 0.617852 0.588265 0.595179 0.344821
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.450167 7.785503 -0.822850 1.563853 1.324753 0.787273 1.220354 0.494502 0.585460 0.585481 0.350101
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 10.543277 -0.302721 8.318198 1.502450 8.848155 0.420430 -0.049748 3.418037 0.031573 0.583073 0.388536
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.050450 -0.150477 -1.039273 -0.644707 -0.077091 0.789671 0.572954 6.548469 0.574341 0.583238 0.370095
131 N11 not_connected 100.00% 0.00% 80.14% 0.00% -0.845978 12.684198 -0.483316 3.984538 0.632255 9.158648 -0.898444 -0.161400 0.522638 0.178285 0.386704
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.923065 0.655349 -0.922511 -1.159732 0.334038 -0.733697 2.578954 0.333649 0.514217 0.520318 0.346380
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.619552 -1.067832 -1.180665 -0.612685 -0.662762 -1.370204 -0.645831 1.503261 0.487644 0.525257 0.360301
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.238022 13.807194 3.694549 4.014871 8.664120 10.350229 -0.117071 0.309025 0.038313 0.033999 0.002736
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.605986 -0.976151 -0.803130 -1.251774 4.646235 0.440248 15.970026 0.245056 0.499723 0.536011 0.376058
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 10.076939 -0.417948 8.065013 -0.474203 8.847531 0.208870 1.085805 -0.354413 0.036437 0.540274 0.401494
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.425052 -0.703705 0.468154 -1.188632 1.051093 -0.187335 0.252418 0.457202 0.522883 0.555258 0.362830
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.984681 2.233705 0.859170 -1.066453 -0.331784 -0.266779 -0.105456 0.367360 0.555100 0.546684 0.339072
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.462947 -0.839213 -0.579731 -0.440970 -0.076153 -0.394603 6.768717 5.709883 0.577690 0.594673 0.350325
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.254802 -0.845808 -0.013544 0.238730 1.368561 -1.079452 1.733844 -0.929922 0.580404 0.601639 0.349780
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.390582 12.458051 -0.278439 8.784821 3.070032 10.440488 31.212750 1.125745 0.586162 0.041869 0.488756
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.569407 12.505218 8.298981 8.755121 8.479495 10.545376 -0.167226 0.967202 0.068238 0.029036 0.030986
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.146680 0.276523 -0.818057 2.516209 0.351064 -0.716874 -0.837404 -0.354521 0.595892 0.588207 0.351700
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.458598 -0.418690 1.483222 0.678187 0.287357 2.316977 -0.082766 -1.192724 0.583117 0.604099 0.355257
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.330646 -0.775052 -1.107609 -0.872060 -0.874706 -1.442178 -0.048607 -0.300042 0.548481 0.569711 0.347295
147 N15 digital_ok 100.00% 99.42% 99.07% 0.00% nan nan inf inf nan nan nan nan 0.322863 0.326585 0.398611
148 N15 digital_ok 100.00% 98.60% 98.71% 0.00% 261.557327 261.284942 inf inf 4561.564605 4559.882108 9928.964284 9917.376035 0.481618 0.464844 0.278306
149 N15 digital_ok 100.00% 98.36% 98.60% 0.00% 207.857886 208.117642 inf inf 3401.190177 3399.670632 6369.035874 6343.453252 0.455675 0.351727 0.375763
150 N15 digital_ok 100.00% 98.01% 98.60% 0.00% 253.010346 252.808268 inf inf 3972.800198 3958.607140 8057.503166 8011.680789 0.473713 0.408001 0.385167
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 22.031478 1.395885 -0.425599 0.552954 5.106988 -0.881959 14.343370 -0.178608 0.412404 0.483670 0.312883
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.418657 -1.105957 8.194874 -1.028753 8.874658 0.260860 1.636356 1.436836 0.037954 0.540044 0.414514
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.925835 12.492311 6.930625 8.597764 4.389978 10.499429 2.816682 1.553749 0.344388 0.036731 0.268589
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.475319 -0.390077 0.207019 0.763717 0.543074 0.134073 -0.427794 0.024147 0.532934 0.548920 0.359731
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.060035 0.076510 0.153111 -0.011665 1.727927 1.385173 4.157866 25.449619 0.550129 0.565120 0.358899
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.661622 25.724282 -1.106168 -0.714804 -0.413200 6.030225 -0.544320 50.649458 0.519569 0.431887 0.316320
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.283947 -0.841015 -0.231694 -0.355216 -0.306728 1.117518 -0.863014 0.677574 0.570082 0.583965 0.351514
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.720247 30.131949 0.232218 -0.284694 0.036919 1.731496 0.135582 1.779202 0.577706 0.453899 0.324550
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.981386 -0.875712 -0.483898 -1.286439 0.620264 1.281759 2.502406 0.484375 0.588451 0.600175 0.353096
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.528623 1.208194 0.062836 0.494441 -0.007641 1.410274 -0.324886 1.505157 0.593026 0.598568 0.353377
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.664436 0.189756 -0.318690 1.311103 0.996241 2.215595 -0.075915 1.810368 0.585357 0.586959 0.345940
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 31.372555 0.240194 -0.477745 -0.623243 5.031084 0.185866 14.016487 0.336553 0.454567 0.596359 0.353089
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.173737 0.002217 0.731755 0.373314 0.607262 -0.701961 0.410416 -1.178905 0.572958 0.592172 0.350219
167 N15 digital_ok 100.00% 98.95% 99.18% 0.00% 262.394283 262.254457 inf inf 3464.097463 3449.737907 6626.634243 6405.160058 0.349461 0.293489 0.314484
168 N15 digital_ok 100.00% 98.71% 99.18% 0.00% nan nan inf inf nan nan nan nan 0.268167 0.259776 0.288493
169 N15 digital_ok 100.00% 99.18% 99.18% 0.00% nan nan inf inf nan nan nan nan 0.227873 0.240487 0.230525
170 N15 digital_ok 100.00% 99.18% 99.18% 0.12% nan nan inf inf nan nan nan nan 0.251657 0.258059 0.170771
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.814762 1.750141 -0.726485 0.135645 -0.688478 0.647097 -0.412277 2.791272 0.492130 0.483790 0.330952
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 12.792157 13.031057 3.332044 3.718295 8.996295 10.499504 2.981106 5.292079 0.034481 0.038939 0.002978
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.949036 -0.047938 -0.337728 0.407209 -0.626407 2.117525 -0.671408 0.461234 0.536823 0.561895 0.355337
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.123539 13.111367 -1.011241 8.898353 1.365532 10.364228 24.834092 1.869734 0.565183 0.048391 0.481246
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.004936 0.031506 0.585335 0.555266 0.285304 0.517374 -0.558365 5.654617 0.572154 0.579153 0.353708
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.123552 12.338161 -0.595288 8.536244 -0.825179 10.480895 11.599716 1.463141 0.588151 0.043774 0.460134
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.205064 0.837169 0.430384 0.705047 1.968534 0.608458 0.754168 0.542944 0.571827 0.583932 0.343920
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 17.776951 -0.464294 5.010741 -0.865487 7.075637 1.212992 20.171261 0.502643 0.436936 0.594222 0.368198
185 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.102310 -0.295013 2.776638 0.504895 3.778618 -1.228538 -2.726690 -0.035499 0.558266 0.595689 0.360290
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.448222 -1.008281 -0.006469 -0.408744 0.685259 -0.933351 0.058886 -1.212070 0.583714 0.593774 0.360130
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.788192 -1.294722 -1.055294 -0.640776 1.620894 2.842198 12.157646 0.853649 0.567920 0.585011 0.360738
189 N15 digital_ok 100.00% 98.48% 98.83% 0.00% nan nan inf inf nan nan nan nan 0.354744 0.322060 0.318870
190 N15 digital_ok 100.00% 98.83% 99.18% 0.00% 259.782269 259.846829 inf inf 3621.962736 3601.280484 6651.319011 6653.379396 0.411502 0.310322 0.299220
191 N15 digital_ok 100.00% 98.60% 99.07% 0.00% nan nan inf inf nan nan nan nan 0.406673 0.235797 0.330991
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 1.276371 8.802021 1.467136 3.665744 2.858668 8.251650 1.095111 -3.893318 0.519898 0.493827 0.356862
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 8.121289 1.262233 3.707626 1.076965 6.782077 1.331756 -3.998587 0.501830 0.478838 0.520093 0.373618
200 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.494042 41.019668 3.684618 -0.235754 8.880493 7.151114 0.882677 13.230294 0.040178 0.158773 0.097065
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.995980 6.563744 2.157658 3.134882 2.331705 6.404944 -0.339194 -2.801287 0.551473 0.549172 0.345247
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.383107 1.416985 0.966202 -1.207021 -0.029326 0.325884 -0.831401 49.659528 0.563538 0.552591 0.344780
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.493350 16.209914 1.002552 -0.953606 0.667515 1.933933 13.568719 2.908702 0.567237 0.590418 0.357857
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 9.161121 0.351591 2.622088 -0.957208 6.090697 -0.276923 38.826350 7.256922 0.301913 0.562411 0.416844
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.514373 6.321173 -0.775272 2.058908 8.935018 4.068979 -0.315820 0.218039 0.525875 0.429818 0.359143
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.693863 2.983244 -0.960683 -0.577835 -0.618096 -1.192273 9.029608 -0.467266 0.536644 0.527248 0.347771
208 N20 dish_maintenance 100.00% 98.83% 98.71% 0.00% nan nan inf inf nan nan nan nan 0.394532 0.271892 0.320632
209 N20 dish_maintenance 100.00% 99.07% 98.71% 0.00% nan nan inf inf nan nan nan nan 0.268847 0.400730 0.322000
210 N20 dish_maintenance 100.00% 99.18% 99.07% 0.00% nan nan inf inf nan nan nan nan 0.407741 0.423605 0.266800
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.450162 13.082699 -1.219485 4.068797 -0.008411 10.354981 1.235866 0.700895 0.493946 0.037980 0.420044
220 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.506495 -0.679159 -0.003382 -0.591271 -0.925133 -0.520822 4.681985 -1.208291 0.550482 0.552706 0.345248
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 1.181198 -0.202422 -1.295728 -0.828880 0.250001 -0.876651 18.405453 -0.351522 0.533225 0.560233 0.348569
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.105325 -0.689198 -0.634088 -0.714201 0.045081 20.587182 4.645147 -0.573687 0.544379 0.560058 0.349712
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.836430 -0.739740 -1.081660 -0.527645 -0.795557 -0.409593 1.394540 10.721526 0.532809 0.564504 0.353097
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.321059 8.006680 3.861406 3.558002 6.956656 7.587070 -4.082458 -2.855514 0.513811 0.539780 0.349284
225 N19 RF_ok 100.00% 0.00% 100.00% 0.00% -1.245402 12.576900 0.153534 3.865595 -0.680423 10.134255 -1.316188 1.070861 0.549196 0.100767 0.461184
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.860808 18.276764 -0.826544 0.585998 -0.904865 4.511726 -0.914530 3.100143 0.532728 0.471612 0.338137
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 4.461079 1.456219 1.776559 -0.675425 1.302614 -0.479513 8.107635 8.803953 0.403121 0.513305 0.368168
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.002217 0.350242 0.421656 -1.235224 -0.276799 -0.221088 1.858306 2.104851 0.516699 0.507410 0.345500
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.062497 0.794536 0.362879 0.922053 -0.184547 0.773559 -0.596261 -2.274099 0.518170 0.533387 0.367870
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.879618 -0.055265 0.185602 -1.256358 -0.672243 -0.497508 0.516690 -0.765477 0.473443 0.529751 0.357487
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.773786 -0.425007 0.353142 0.006469 -1.110626 -0.692184 -1.583610 -1.804616 0.542558 0.554511 0.356458
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.742759 -0.922000 0.025676 -0.144759 -0.836194 -0.381082 1.958459 2.878903 0.541135 0.551464 0.353447
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.641332 0.342478 0.055182 -1.055100 -0.286002 -1.186807 10.967352 8.908870 0.483362 0.554044 0.373440
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.607635 -0.961011 -0.695218 -0.119745 -0.761339 -1.273393 0.921343 -0.615145 0.530862 0.559796 0.368716
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 27.176440 0.573913 -0.420849 0.807837 2.099195 -0.083137 -0.470959 0.986585 0.386356 0.551763 0.363673
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 22.460942 -1.079725 0.656474 -1.164916 4.695121 -0.467175 3.310046 0.310414 0.422662 0.532232 0.359092
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.653083 -0.654658 -0.613646 -1.143287 -0.951254 -0.611924 4.190931 8.254367 0.483423 0.536554 0.365075
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.085995 0.623567 0.542511 -0.712338 -0.676739 -0.933963 -2.035093 0.299643 0.523906 0.528750 0.355924
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.323828 13.759625 -1.090520 3.632187 -0.517532 10.465111 -1.159160 -0.278079 0.502108 0.036796 0.425201
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% -1.072600 -0.263657 -0.340961 -0.524067 -0.119421 -0.883162 24.188157 7.353815 0.514132 0.525572 0.354269
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 11.382729 14.747956 4.441899 4.369345 -0.951762 -0.350733 -0.416012 3.299277 0.485225 0.503035 0.351947
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.822800 2.420441 1.664158 0.812240 0.436072 -0.582139 -1.706598 2.120480 0.452259 0.470494 0.351269
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.736776 3.673923 0.677873 1.074414 0.813650 1.394543 0.016450 -1.635084 0.437820 0.456193 0.336945
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.102083 -0.830208 0.595430 -1.338330 0.414598 -1.205188 -1.602284 1.188680 0.460106 0.460528 0.344026
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.452212 -0.064597 -0.559464 -0.653481 0.731612 -0.337024 5.132709 1.116259 0.429326 0.452295 0.336408
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.336566 1.772013 -0.641184 -1.152165 -0.985843 -0.116594 1.196382 1.886465 0.401479 0.437095 0.327634
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, 15, 16, 17, 18, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 49, 51, 52, 53, 54, 55, 56, 58, 59, 60, 63, 64, 65, 66, 67, 68, 70, 71, 72, 74, 77, 78, 79, 80, 81, 82, 84, 86, 87, 92, 93, 94, 95, 96, 97, 101, 102, 103, 104, 107, 108, 109, 110, 111, 112, 113, 114, 117, 120, 121, 122, 123, 124, 126, 127, 128, 131, 134, 135, 136, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 161, 165, 167, 168, 169, 170, 173, 180, 181, 182, 184, 185, 187, 189, 190, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 220, 221, 222, 223, 224, 225, 226, 227, 240, 242, 243, 244, 246, 261, 262, 329]

unflagged_ants: [8, 9, 10, 19, 20, 21, 22, 35, 41, 43, 44, 46, 48, 50, 57, 61, 62, 69, 73, 83, 85, 88, 89, 90, 91, 105, 106, 115, 118, 125, 132, 133, 137, 139, 141, 144, 145, 146, 157, 160, 162, 163, 164, 166, 171, 179, 183, 186, 228, 229, 237, 238, 239, 241, 245, 320, 324, 325, 333]

golden_ants: [9, 10, 19, 20, 21, 41, 44, 69, 83, 85, 88, 91, 105, 106, 118, 141, 144, 145, 146, 157, 160, 162, 163, 164, 166, 171, 183, 186]
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_2460014.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.2.3.dev121+gc95c57f
In [ ]: