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 = "2460035"
data_path = "/mnt/sn1/2460035"
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-31-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/2460035/zen.2460035.21275.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/2460035/zen.2460035.?????.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/2460035/zen.2460035.?????.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 2460035
Date 3-31-2023
LST Range 7.121 -- 17.083 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
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 40, 42, 70, 72, 112
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 63 / 198 (31.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 114 / 198 (57.6%)
Redcal Done? ❌
Never Flagged Antennas 82 / 198 (41.4%)
A Priori Good Antennas Flagged 58 / 93 total a priori good antennas:
5, 7, 15, 16, 17, 31, 37, 38, 40, 42, 45, 53,
54, 55, 65, 66, 69, 70, 71, 72, 81, 86, 93,
94, 101, 103, 109, 111, 112, 121, 122, 123,
124, 127, 136, 140, 147, 148, 149, 150, 151,
158, 160, 161, 165, 167, 168, 169, 170, 173,
182, 184, 189, 190, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 47 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 50, 57, 61, 62,
64, 73, 74, 82, 89, 90, 95, 115, 125, 132,
133, 135, 137, 139, 185, 201, 206, 220, 221,
222, 223, 228, 229, 237, 238, 239, 240, 241,
244, 245, 261, 320, 324, 325, 329, 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_2460035.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.142250 17.643773 -0.677004 -0.346416 -0.405668 0.953209 -0.945271 2.870031 0.551088 0.437756 0.351372
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 9.415738 11.716074 10.088298 10.439874 4.032673 4.116393 0.460667 0.431274 0.035960 0.030969 0.001649
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.995527 0.227464 -0.562793 0.209019 0.089717 0.900672 12.778272 11.639575 0.562520 0.571374 0.348099
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.166018 3.216743 2.343308 2.324662 2.062808 2.145690 -2.034503 -1.568538 0.538899 0.548686 0.331734
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.672397 -0.363271 3.222838 -0.433807 1.664918 0.319360 1.656455 -0.534579 0.543121 0.567175 0.345451
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.041343 -1.115214 0.074050 -0.655810 -0.833291 0.139617 -0.794501 0.642737 0.555405 0.559109 0.341793
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 20.528621 0.028647 0.286298 -0.190954 0.529256 0.580048 0.325359 1.522772 0.429023 0.566559 0.352550
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.237456 12.235767 -0.236495 10.681313 0.871755 4.079456 0.911349 2.262992 0.565940 0.036844 0.473836
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.242089 4.249947 0.997050 9.072535 1.260558 0.937626 -0.108700 2.911932 0.569563 0.402739 0.406253
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.587340 5.595189 10.106118 1.158202 4.021745 1.776505 0.590793 27.524022 0.035461 0.366622 0.292725
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.079178 -1.094176 -0.273062 -0.732985 0.409822 0.726047 -0.479991 1.820734 0.577508 0.587419 0.345046
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.287369 -1.012725 2.224091 -0.463896 1.770504 0.212533 1.117260 -0.385150 0.563661 0.585416 0.343691
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.284203 0.048648 0.045539 0.512868 0.597069 0.778368 0.020266 0.025504 0.560042 0.565251 0.335531
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.091764 -0.571302 -0.442340 -0.433939 -0.377199 -0.056813 -0.657520 -0.928561 0.531842 0.543381 0.336807
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.724673 26.568166 9.712498 5.965920 3.580895 3.036955 9.384829 37.271018 0.073866 0.071987 -0.029590
28 N01 RF_maintenance 100.00% 100.00% 13.83% 0.00% 8.940354 16.056268 10.015805 4.267371 4.032424 0.624794 1.391445 20.689751 0.030105 0.246968 0.185838
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.102021 -0.551057 -0.573374 -0.386220 0.498549 0.375457 0.849733 0.564878 0.584764 0.590519 0.349852
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.098976 -0.801479 0.877865 -0.768833 1.345647 0.012485 3.165127 -0.391887 0.577690 0.597665 0.349541
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.746779 -0.580248 1.385963 2.790371 1.703947 0.060401 0.558775 15.750330 0.587714 0.586202 0.341036
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.456914 18.505212 -0.140035 -0.039756 -0.085126 -0.096142 6.347929 6.823292 0.478014 0.507195 0.207003
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 10.290368 -0.151667 5.437223 -0.475102 4.001672 -0.957144 0.812033 2.153410 0.041153 0.557718 0.407998
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.135532 -0.939621 0.531374 -1.005275 -0.092893 -0.723023 0.896985 0.095615 0.542962 0.541510 0.335182
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.946316 6.283836 1.284114 1.046399 1.520641 1.433903 0.514417 0.969145 0.547315 0.545548 0.359613
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.469596 19.344513 -0.338703 12.410223 -0.830707 4.078873 -0.656693 2.698772 0.544511 0.031515 0.433573
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.504882 1.491006 -0.132827 0.296352 0.501800 -0.074420 1.760177 6.900764 0.570385 0.548943 0.356858
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.331245 1.153593 0.103714 -0.383676 0.677965 0.473712 5.827663 0.451656 0.235197 0.229968 -0.277006
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.729964 1.309171 1.614275 1.760310 1.516286 0.040898 -0.063529 0.092420 0.579429 0.590580 0.351044
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.001930 3.742683 -0.263715 1.912001 0.786554 1.879915 -0.222638 1.671052 0.256871 0.243032 -0.276233
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.567983 0.006036 -0.520965 1.008152 -0.547966 0.963917 -0.690060 0.683702 0.592955 0.600360 0.344262
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.066399 0.236563 -0.748591 0.075939 -0.636313 0.615089 -0.731510 -0.195879 0.593576 0.607919 0.345648
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.195372 3.634242 0.907494 1.018806 0.735962 1.314770 0.639401 6.565125 0.580500 0.591631 0.337711
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.493293 -0.423399 0.050564 -0.888173 0.593317 -0.408972 -0.343859 -0.667741 0.582893 0.602317 0.352004
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 9.451414 12.109964 5.352088 5.367127 4.012977 4.083712 2.748400 1.148492 0.031593 0.052810 0.014443
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.258045 0.812948 -0.491697 0.982950 -1.016838 0.672546 -0.856159 -1.754225 0.545485 0.559941 0.338465
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.610833 -0.211036 0.576859 -0.555405 -0.252204 -0.746149 -0.077881 2.531995 0.511602 0.538211 0.336257
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.560470 0.877287 0.453867 1.833227 0.824170 1.746037 0.773488 0.920292 0.549388 0.544570 0.355514
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.021684 1.289077 0.146236 -0.221117 1.643151 0.876965 66.523890 1.232138 0.559392 0.563405 0.353340
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.480579 4.419075 0.745174 0.472206 1.263010 1.188564 3.131795 1.268199 0.574521 0.576106 0.352079
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.207553 1.064381 0.159319 -0.346392 1.238186 -0.267434 8.713715 4.728845 0.579545 0.589427 0.354995
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 5.719783 3.323417 2.012258 -0.190587 2.162688 1.284936 -1.276856 -0.071512 0.315557 0.355646 0.149420
55 N04 digital_ok 100.00% 14.42% 100.00% 0.00% 0.600608 43.317166 0.623873 7.075784 0.166808 4.121519 2.395793 1.394891 0.252555 0.038954 0.106556
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.904398 1.176975 -0.738251 2.230557 -0.575521 3.693678 -0.777657 0.831575 0.594162 0.594486 0.337491
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.715388 1.124004 -0.394984 -0.443026 -0.479943 0.772821 0.058954 1.276738 0.601016 0.598296 0.336150
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.450029 11.354706 10.058623 10.609287 4.001356 4.091115 1.275281 1.130920 0.035315 0.035147 0.001974
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.370251 0.770314 10.098377 1.409205 3.958979 1.458178 0.695974 3.491840 0.044888 0.598655 0.450734
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.211440 11.286578 0.167417 10.638836 0.680159 4.079547 1.086075 2.846809 0.584377 0.071053 0.465044
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.338585 -0.848408 0.816152 -0.596165 -0.368189 -0.310841 0.004386 0.511908 0.526173 0.566181 0.340812
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.294392 0.826247 0.132731 0.686672 -0.508082 -0.076724 0.170180 -1.174989 0.525776 0.562727 0.341030
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.175375 11.726193 -0.586408 5.732515 -0.904627 4.119104 -0.582990 2.106636 0.544755 0.043672 0.420108
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.466921 -0.415024 -0.999940 -0.078212 -0.750384 -0.582628 0.913408 0.013104 0.532504 0.526172 0.333112
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 20.185122 19.209227 12.770974 12.792045 4.004219 4.107151 3.692381 4.904237 0.023335 0.030047 0.007246
66 N03 digital_ok 100.00% 17.34% 100.00% 0.00% 2.674751 19.740014 1.940546 12.949516 1.529986 4.046953 -1.585278 5.613172 0.223863 0.045824 0.118822
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.757476 -0.375373 -0.828096 1.089323 -0.366148 0.920473 3.753856 1.113639 0.577171 0.577962 0.346922
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 21.580815 0.685183 12.857846 0.700793 3.947791 -0.268107 4.532046 -0.900518 0.032493 0.589877 0.454952
69 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 1.037548 4.538666 1.432548 -0.507425 0.714562 0.452636 2.737912 0.680743 0.589283 0.598492 0.342390
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.031283 2.051145 1.378788 3.012158 1.483423 1.818550 2.232978 0.709788 0.260606 0.244563 -0.273678
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.012902 -0.049955 -0.227480 0.464397 0.299186 0.585114 -0.572496 0.543455 0.598483 0.613274 0.341972
72 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.495258 1.321295 2.519026 1.178647 2.109423 1.627640 12.950567 0.987453 0.264421 0.258985 -0.275317
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.586418 1.287402 -0.578809 0.710342 0.534219 1.187109 -0.272620 0.360150 0.605648 0.615044 0.343783
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.947729 0.007354 -0.288547 -0.026120 -0.691441 0.950178 -0.826466 1.249664 0.601173 0.613257 0.345907
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 42.105521 14.079291 0.656299 -0.430646 2.667159 0.383412 8.598604 -0.226780 0.310491 0.468074 0.254055
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 21.836955 0.616033 -0.028625 0.873350 0.709486 0.181938 1.890141 -0.863486 0.397926 0.566784 0.333855
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.191003 11.940356 -0.519560 5.720025 -0.455964 4.066547 0.117499 0.023304 0.536282 0.038969 0.422129
80 N11 not_connected 100.00% 0.00% 95.79% 0.00% -0.203725 12.232680 -0.007774 5.560919 -0.773003 3.226419 -0.941773 0.993918 0.540126 0.084398 0.424362
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.190861 12.012725 0.726489 9.438482 0.849774 4.021526 0.280156 1.450590 0.527149 0.037707 0.397828
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.641478 0.794705 -0.242911 -0.289197 0.319264 -0.775048 -0.592056 -0.703814 0.559129 0.562843 0.351400
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.184715 0.287671 0.759997 0.986012 1.040338 0.875513 -0.458794 0.659428 0.569876 0.573771 0.347362
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.215785 21.690097 1.401142 13.050568 0.622254 3.936307 -1.955191 3.826158 0.580030 0.049066 0.445548
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.412866 2.210461 -0.910849 -0.830539 -0.455416 1.004427 -0.823620 1.314513 0.598347 0.599248 0.339612
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.092772 0.715120 -0.096920 -0.278024 -0.004989 0.336671 -0.229151 11.516475 0.597052 0.607868 0.337700
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.172768 4.145277 2.568580 -0.352257 4.831282 -0.667963 23.121764 -0.337663 0.538306 0.622092 0.328535
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.648172 0.856580 0.890669 1.337062 0.728165 0.328370 1.699606 0.410296 0.597415 0.609494 0.333019
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.555714 0.377849 0.796913 1.266787 0.638601 0.718881 -0.437059 -0.135629 0.595624 0.611634 0.337887
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.569940 -0.474921 -0.364916 -0.450896 -0.215743 -0.846942 -0.388683 1.347233 0.588780 0.614980 0.342763
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.092323 0.227004 0.997351 0.779139 0.876963 0.856182 0.299930 -0.130873 0.585933 0.604596 0.345325
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 8.917657 0.189268 10.065534 0.634939 4.038211 1.384468 0.235044 0.732998 0.034267 0.597776 0.403180
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.154687 11.523681 10.163514 10.692618 3.985568 4.074943 1.838828 1.566361 0.029920 0.025041 0.002678
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.770256 11.761899 10.263806 10.526273 4.000526 4.092468 0.755201 0.654646 0.025363 0.025369 0.001059
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.549973 1.417144 -0.805619 0.481077 0.905279 0.720971 -0.708530 -0.490968 0.410175 0.404899 0.176972
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.522866 19.568808 0.837410 -0.296260 -0.082150 0.476630 -1.348552 0.519467 0.549600 0.449076 0.332578
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.223249 2.046325 -1.016057 0.537692 -0.868209 -0.672062 1.635479 9.125384 0.530761 0.517195 0.336899
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.287374 6.428052 0.262100 1.375690 1.012847 1.554660 -0.209675 0.307192 0.586065 0.590683 0.341627
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.808345 0.539931 -0.757283 -0.736952 -0.203989 0.602862 -0.483206 4.117274 0.597106 0.602440 0.340108
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.703918 3.788354 2.430679 -0.447896 2.116102 0.680343 -1.809572 13.327518 0.577300 0.609307 0.339026
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.737688 45.811877 0.645613 6.706646 0.258346 0.573772 0.436934 0.489874 0.602098 0.588012 0.335367
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.249513 0.460228 0.717836 1.322785 0.899882 0.654534 -0.261845 -0.186181 0.601576 0.611162 0.333448
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.628910 1.087981 -0.064115 0.199462 -0.111172 0.267522 -0.230571 -0.165281 0.602481 0.615982 0.336683
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.404278 0.497007 -0.026109 -0.610161 0.386699 -0.081126 0.718387 1.248416 0.596335 0.611161 0.334235
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.090743 2.253708 2.228411 2.492074 1.184440 1.226502 8.784222 0.006785 0.590824 0.604405 0.340820
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 8.719713 11.385546 10.138495 10.420834 4.004018 4.121468 0.365051 1.449031 0.063773 0.035412 0.020512
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.876426 -0.113717 0.569679 -0.064458 3.807198 0.702524 20.104211 -0.494832 0.506020 0.596153 0.334640
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 5.732303 11.324820 0.953364 10.499128 1.465051 4.100875 17.631306 1.839234 0.542508 0.057843 0.410348
112 N10 digital_ok 100.00% 5.89% 5.89% 94.11% 0.421859 6.042085 1.846881 9.405044 1.618300 1.875141 0.683146 0.569566 0.232666 0.139292 -0.216983
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.465566 12.441851 5.107436 5.712376 3.966549 4.058912 1.311694 0.628932 0.033297 0.031009 0.001534
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 11.152259 0.568248 5.251508 -0.232725 3.956957 -0.804611 0.192999 -0.246657 0.042756 0.543584 0.413448
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.298595 -0.855826 -0.963150 -0.074593 -0.739306 -0.984345 -0.676930 -1.203245 0.518446 0.533106 0.343338
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.629904 12.684784 10.176729 10.899963 3.969549 4.078768 1.001814 3.100632 0.027831 0.031146 0.002122
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.343185 1.172486 0.626735 0.965197 0.585621 1.122580 -0.142797 0.358182 0.560516 0.571015 0.349426
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.941499 0.816195 2.874554 -0.509681 1.450016 0.609858 4.388461 2.755077 0.579028 0.600215 0.340695
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.474527 2.350350 2.043856 5.760839 1.574613 0.899412 -1.010191 13.423937 0.584261 0.586318 0.326706
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.863144 4.441108 -0.452206 -0.747837 0.879332 0.184863 -0.590405 -0.722854 0.609376 0.616973 0.338567
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.380683 3.615611 2.771679 1.210318 2.598897 0.633260 -2.454981 -1.609964 0.586002 0.617448 0.343502
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 8.995570 0.410766 10.310288 0.962387 3.968974 1.195814 0.450364 0.526584 0.039767 0.620832 0.414647
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.530947 1.001289 1.693238 1.313407 0.200573 0.384218 0.290224 0.135408 0.598650 0.607431 0.337345
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.804390 4.829543 0.067276 1.622167 0.105617 1.322620 1.769565 1.977453 0.599560 0.604743 0.340651
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 8.673549 -0.323408 10.062129 -0.566245 4.036127 0.578614 0.209471 2.432885 0.033580 0.605621 0.403552
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.154617 -0.768857 -0.543298 -0.278686 -0.012485 -0.510381 0.455758 2.237786 0.585314 0.594930 0.357331
131 N11 not_connected 100.00% 0.00% 52.35% 0.00% -0.937331 11.140921 -0.286540 5.629985 -0.739206 3.446211 -1.062298 0.141073 0.546929 0.218377 0.392469
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.823349 0.032028 -0.347020 -0.697108 -0.816559 -0.542159 -0.433788 -0.421755 0.539011 0.535264 0.338496
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.480205 -1.066862 -0.713037 -0.531565 -0.629855 -1.086600 -0.559191 0.557009 0.523490 0.538588 0.344807
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 9.948307 12.389109 5.235449 5.696474 3.968308 4.064230 0.278433 0.705813 0.039011 0.034183 0.002827
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.519765 -1.203611 -0.556604 -0.959985 0.655248 0.204698 2.428334 -0.358823 0.523772 0.541481 0.355003
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 8.226760 -0.420090 9.798818 -0.165952 4.027126 0.558411 1.112991 -0.059524 0.037512 0.550386 0.398073
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.162805 -0.348164 0.638187 -0.759457 1.089193 0.076039 0.606280 0.897652 0.545783 0.564843 0.348432
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.105185 -0.179284 0.854472 -0.939736 0.122998 -0.809900 -0.820302 1.024889 0.567937 0.572484 0.333306
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 14.221316 0.080991 -0.499104 -0.356001 6.828253 -0.272368 107.597599 11.044096 0.539481 0.600255 0.329677
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.411883 -0.437258 0.276080 0.276957 0.792145 -0.565689 -0.075189 -1.263029 0.594938 0.606824 0.337149
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.874882 11.351629 -0.128332 10.644743 1.070409 4.090246 14.194236 1.508360 0.599423 0.043388 0.487444
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.470841 11.316026 9.970537 10.615742 3.687926 4.098530 0.495616 1.487517 0.103334 0.030851 0.059431
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.550903 -0.425177 -0.384162 -0.678611 0.535510 -0.558112 -0.683736 -0.760143 0.608624 0.620491 0.343556
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.001930 -0.179152 0.048539 -0.313983 0.676436 0.814473 -0.243880 0.237932 0.604499 0.611066 0.341418
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.587933 -0.788411 -0.992031 -0.753776 -0.843642 -1.100488 -0.287548 -0.633379 0.570753 0.589541 0.340921
147 N15 digital_ok 100.00% 99.51% 99.51% 0.00% 184.081541 184.223488 inf inf 1429.278815 1422.868084 4700.729852 4635.015017 0.565794 0.556173 0.502777
148 N15 digital_ok 100.00% 99.46% 99.51% 0.00% 169.694079 170.060570 inf inf 1321.117595 1318.459080 5169.539913 4999.691626 0.436079 0.427544 0.399867
149 N15 digital_ok 100.00% 99.62% 99.51% 0.00% 170.458916 170.788104 inf inf 1505.181036 1492.554004 7539.670809 7484.104268 0.282061 0.385343 0.348786
150 N15 digital_ok 100.00% 99.51% 99.57% 0.00% nan nan inf inf nan nan nan nan 0.338788 0.322757 0.291730
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 15.433343 -0.423365 -0.414171 1.273544 0.380900 -0.059428 -0.256357 9.784388 0.426559 0.516679 0.302912
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 8.553663 -0.987725 9.937665 -0.475656 4.032168 0.626315 1.621717 0.109815 0.038709 0.545953 0.405320
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.353802 11.223611 8.784556 10.461611 1.607293 4.118260 1.505553 1.779827 0.349703 0.037778 0.262100
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.745888 0.100207 0.649039 1.083110 0.936857 1.359662 -0.060005 0.079080 0.547499 0.562797 0.346546
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.251976 -0.077368 -0.952803 -0.962307 0.369512 0.128812 2.631420 11.115940 0.565250 0.572766 0.343577
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.292670 12.488929 -0.336755 -0.500606 -0.726187 1.475288 -0.212669 8.044279 0.538427 0.485523 0.315580
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 9.393088 -0.813329 10.048291 -0.158804 4.006320 0.825851 0.713593 0.557102 0.044115 0.593770 0.468367
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.158517 23.904697 0.594098 0.355542 1.091281 -0.253353 -0.030387 0.705837 0.588005 0.484508 0.313958
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.119879 -1.250556 -0.178378 -0.905805 -0.459723 0.107485 2.797790 -0.466353 0.600045 0.611287 0.342976
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.618238 1.402263 0.461565 0.811495 0.921682 1.529053 0.062212 0.807459 0.603094 0.613377 0.345777
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.046940 1.174542 0.764198 1.539946 0.202264 1.603111 0.223437 0.863844 0.598390 0.606744 0.337055
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 19.328170 0.105085 0.443243 -0.222838 0.455208 0.535940 3.294236 0.269712 0.476386 0.608649 0.331874
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.510423 -0.198453 1.170739 0.400750 1.156412 -0.540836 -0.004386 -1.432780 0.589134 0.600553 0.337697
167 N15 digital_ok 100.00% 99.68% 99.68% 0.00% 188.596997 188.327490 inf inf 1490.978346 1488.235700 5077.752136 4980.910227 0.282919 0.280870 0.255847
168 N15 digital_ok 100.00% 99.62% 99.73% 0.00% nan nan inf inf nan nan nan nan 0.447113 0.381302 0.391941
169 N15 digital_ok 100.00% 99.46% 99.46% 0.00% 155.298835 155.549140 inf inf 1295.123842 1288.479043 5223.539073 5260.807594 0.435269 0.436538 0.384559
170 N15 digital_ok 100.00% 99.41% 99.46% 0.00% 156.065358 156.668110 inf inf 1558.957151 1573.946280 5544.834635 5650.357911 0.430000 0.440324 0.388574
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.422127 -1.404069 1.117450 -0.978074 -0.632646 -1.095027 -0.227399 1.726254 0.502402 0.542233 0.348509
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.403199 0.371678 2.352283 0.747441 2.027857 -0.240821 -2.226536 0.302288 0.532363 0.543089 0.349421
173 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.944953 4.758742 3.104902 3.074546 3.140717 3.294507 -2.857906 -1.925187 0.500298 0.499509 0.333359
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.702728 -0.104567 0.456294 0.999966 -0.273775 1.082789 -0.177172 8.073097 0.546191 0.573073 0.347644
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.217566 11.926074 -0.694153 10.749940 0.651948 4.069453 12.663270 1.749624 0.575456 0.050368 0.478202
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.385128 0.474144 1.491015 1.002812 0.634594 0.783964 -0.181857 3.234545 0.581557 0.593354 0.348702
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.404753 11.162576 -0.492838 10.400424 -0.811694 4.111844 3.778631 1.945124 0.594397 0.045776 0.450920
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.571677 0.366311 0.782344 1.123069 1.246942 0.922269 0.785592 0.035500 0.587557 0.597762 0.335522
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 10.739100 -0.247213 7.528180 -0.226069 1.606596 -0.014007 4.972387 -0.268160 0.422666 0.605550 0.367186
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.021904 -0.121384 -0.984279 0.062007 -0.158205 0.355770 1.356011 0.630684 0.597925 0.603794 0.343238
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.843290 -1.015282 0.124733 -0.390194 -0.752978 -0.949560 -0.971904 -0.756234 0.593864 0.601584 0.344403
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.290022 -0.707476 0.219422 -0.187598 0.741337 -0.450879 3.932702 -0.357120 0.581924 0.591895 0.346835
189 N15 digital_ok 100.00% 99.57% 99.57% 0.00% nan nan inf inf nan nan nan nan 0.432252 0.397802 0.425433
190 N15 digital_ok 100.00% 99.46% 99.46% 0.00% 167.168489 168.015274 inf inf 1674.925896 1668.920872 6304.542106 6225.140846 0.475257 0.488050 0.402141
191 N15 digital_ok 100.00% 99.14% 99.24% 0.00% 180.663956 181.070253 inf inf 1527.800750 1575.237290 5381.793832 5670.488793 0.556695 0.480842 0.421907
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 2.880118 5.109584 2.235662 3.233363 1.977719 3.425775 -1.988062 -2.743905 0.524557 0.504391 0.337341
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.380155 4.567076 3.315637 2.987133 3.302610 3.228710 -2.936566 -2.724603 0.496302 0.487176 0.327929
200 N18 RF_maintenance 100.00% 100.00% 35.87% 0.00% 10.275174 29.252294 5.266369 0.264725 4.023189 1.454973 1.357728 7.285307 0.040904 0.222024 0.145610
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.540898 3.795973 2.011608 2.753195 1.622911 2.818041 -1.553448 -2.587279 0.557786 0.554246 0.337986
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.661676 0.822012 0.909456 -0.317191 0.158630 0.152386 -1.422650 32.956535 0.574753 0.566112 0.336061
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.134798 10.676861 1.666290 -0.599605 0.792640 0.099447 12.779022 0.667131 0.583791 0.595702 0.342896
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.965546 -1.038373 3.530249 -0.887407 1.274662 -0.230546 2.293186 2.302592 0.399414 0.579649 0.393671
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.294593 3.544463 0.810826 3.094578 -0.094133 -0.127602 0.306306 0.422387 0.526759 0.474961 0.326726
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.890662 0.894222 -0.830406 0.405881 -0.935036 -0.096880 4.625625 -0.230512 0.556447 0.546626 0.336955
208 N20 dish_maintenance 100.00% 99.35% 99.30% 0.00% 186.343402 186.682097 inf inf 1549.286411 1564.214687 5523.829780 5681.713916 0.405244 0.404990 0.372562
209 N20 dish_maintenance 100.00% 99.51% 99.46% 0.00% nan nan inf inf nan nan nan nan 0.358059 0.398480 0.376003
210 N20 dish_maintenance 100.00% 99.24% 99.24% 0.00% nan nan inf inf nan nan nan nan 0.539526 0.463545 0.306028
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.215648 11.737930 -0.679249 5.742330 -0.724595 4.070431 -0.263754 0.935938 0.520087 0.038363 0.431064
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.843187 -0.801171 0.092214 -0.518862 -0.853237 -0.972471 1.226449 -0.828122 0.563570 0.564691 0.340419
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.785928 -0.676584 -0.967119 -0.750173 -0.345998 -0.899121 1.311466 -0.672051 0.556082 0.570804 0.339521
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.576341 -0.288824 -0.359280 -0.075706 -0.681533 -0.833813 2.116190 -0.976366 0.563376 0.576893 0.341831
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.198399 -1.131167 -0.466396 0.026109 -0.577384 -0.455816 0.121027 2.302370 0.552577 0.556447 0.332113
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.675644 4.658958 3.482901 3.127224 3.505247 3.270141 -3.026310 -2.511683 0.519257 0.541461 0.332579
225 N19 RF_ok 100.00% 0.00% 92.00% 0.00% -0.256806 11.361670 0.333176 5.521662 -0.700121 3.894621 -1.250122 1.261098 0.563391 0.137706 0.455616
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.936823 14.814673 -0.669909 0.138317 -0.921501 1.130613 -0.935926 -0.423901 0.552440 0.465970 0.330019
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 2.091554 -1.186532 2.552717 -0.751485 -0.415661 -0.957882 6.904290 -0.004139 0.456745 0.547614 0.368780
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.175013 -0.179536 0.428157 -0.765175 -0.273080 -0.402903 -0.215436 0.424824 0.529972 0.527719 0.331374
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.362920 0.656473 0.374052 0.855678 -0.189201 0.166681 0.529596 -1.653846 0.532495 0.534350 0.349598
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.786740 -0.691999 0.670371 -0.830763 -0.109590 -0.272407 -0.055723 -0.751721 0.507026 0.543729 0.348137
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.087387 -0.473482 0.460063 0.248262 -0.467896 -0.689134 -1.431882 -1.431362 0.555369 0.559160 0.347887
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.961828 -0.794515 -0.455803 -0.211258 -0.839402 -0.914640 0.257885 0.543000 0.555413 0.561412 0.346581
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.578841 -0.205643 -0.109805 -0.895255 -0.786584 -0.907016 -0.281677 2.251822 0.552530 0.560436 0.345270
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.135232 -0.901113 -0.479986 -0.078160 -1.024404 -0.810780 0.280066 -0.959612 0.555072 0.562880 0.353607
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 13.930229 0.910755 -0.078490 1.006351 0.807991 0.466701 -1.181765 -1.129272 0.423973 0.554390 0.343003
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 13.451478 -1.135590 0.554750 -0.766477 1.829205 -0.464026 3.317060 -0.302247 0.451158 0.544024 0.341994
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.071714 -0.844780 -0.045665 -0.617800 -0.569053 -0.710421 0.973579 3.077226 0.513543 0.542155 0.343029
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.299448 1.827840 0.597635 -0.644339 -0.107391 -0.938349 -1.665765 -0.245534 0.539717 0.526936 0.342176
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.608279 12.234621 -0.860306 5.312999 -0.765201 4.107743 -0.787076 0.263618 0.521273 0.037484 0.430506
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.313556 -0.176690 -0.062410 -0.379122 -0.622563 -0.881032 1.001011 -0.215183 0.528012 0.527310 0.341799
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 9.161968 11.783731 0.434958 0.507951 1.299112 0.803364 -0.162149 1.389296 0.537757 0.537243 0.360022
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.126623 1.888159 1.705888 0.887143 1.192921 0.517464 -1.637510 0.142891 0.433370 0.437395 0.317394
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.999152 2.309934 0.723995 0.999331 0.089487 0.589973 -0.779073 -1.302755 0.429597 0.429142 0.311965
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.937238 -0.974701 0.601805 -0.741184 -0.163358 -0.644709 -1.420379 -0.154690 0.464842 0.454696 0.336011
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.902150 -0.156194 -0.737554 -0.975851 -0.719067 -0.690033 2.809611 -0.227489 0.436478 0.440245 0.319996
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.949863 2.189734 -0.088341 -0.605909 -0.629020 -0.622911 0.715454 0.236342 0.416603 0.419037 0.302157
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [4, 5, 7, 15, 16, 17, 18, 27, 28, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 51, 52, 53, 54, 55, 58, 59, 60, 63, 65, 66, 68, 69, 70, 71, 72, 77, 78, 79, 80, 81, 84, 86, 87, 92, 93, 94, 96, 97, 101, 102, 103, 104, 108, 109, 110, 111, 112, 113, 114, 117, 120, 121, 122, 123, 124, 126, 127, 131, 134, 136, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 165, 167, 168, 169, 170, 173, 179, 180, 182, 184, 189, 190, 191, 192, 193, 200, 202, 204, 205, 207, 208, 209, 210, 211, 224, 225, 226, 227, 242, 243, 246, 262]

unflagged_ants: [8, 9, 10, 19, 20, 21, 22, 29, 30, 35, 41, 43, 44, 46, 48, 49, 50, 56, 57, 61, 62, 64, 67, 73, 74, 82, 83, 85, 88, 89, 90, 91, 95, 105, 106, 107, 115, 118, 125, 128, 132, 133, 135, 137, 139, 141, 144, 145, 146, 157, 162, 163, 164, 166, 171, 172, 181, 183, 185, 186, 187, 201, 206, 220, 221, 222, 223, 228, 229, 237, 238, 239, 240, 241, 244, 245, 261, 320, 324, 325, 329, 333]

golden_ants: [9, 10, 19, 20, 21, 29, 30, 41, 44, 56, 67, 83, 85, 88, 91, 105, 106, 107, 118, 128, 141, 144, 145, 146, 157, 162, 163, 164, 166, 171, 172, 181, 183, 186, 187]
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_2460035.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

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