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 = "2459943"
data_path = "/mnt/sn1/2459943"
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: 12-29-2022
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/2459943/zen.2459943.21276.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/2459943/zen.2459943.?????.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/2459943/zen.2459943.?????.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 2459943
Date 12-29-2022
LST Range 1.076 -- 11.038 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 94
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 201 (0.0%)
Antennas in Commanded State (observed) 0 / 201 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 18
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 66 / 201 (32.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 118 / 201 (58.7%)
Redcal Done? ❌
Never Flagged Antennas 83 / 201 (41.3%)
A Priori Good Antennas Flagged 50 / 94 total a priori good antennas:
3, 7, 9, 15, 16, 29, 30, 37, 40, 42, 54, 55,
56, 71, 72, 81, 86, 91, 94, 98, 99, 100, 101,
103, 105, 107, 109, 111, 116, 121, 122, 123,
128, 129, 130, 136, 143, 146, 158, 161, 164,
165, 170, 182, 183, 185, 187, 189, 191, 202
A Priori Bad Antennas Not Flagged 39 / 107 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 61, 62, 64, 74,
77, 79, 82, 89, 90, 95, 114, 115, 125, 132,
137, 139, 206, 211, 220, 221, 222, 223, 226,
237, 238, 239, 245, 261, 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_2459943.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 8.440935 11.462060 9.060017 -1.196244 6.780469 3.043218 -0.117998 3.453464 0.033484 0.362367 0.287932
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.750601 0.199587 -1.497003 0.429065 8.842352 2.230889 72.194398 18.896613 0.649385 0.664010 0.408977
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.021196 0.053476 -0.117931 -0.181704 0.039635 2.238044 0.122144 0.061761 0.648674 0.665770 0.408814
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.676095 -0.909843 0.809850 3.190597 -0.584538 -0.231374 9.427667 5.693486 0.636126 0.650745 0.393863
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.170000 -1.124943 -0.744086 -0.110544 -0.208998 1.007574 0.818581 1.541148 0.653075 0.666436 0.395770
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.066811 -0.044027 7.482203 0.296244 3.470124 0.530792 -0.523182 -0.275012 0.489434 0.662589 0.466594
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.264359 -0.447972 -0.314443 -0.660913 0.698092 1.823695 0.294558 1.595228 0.638133 0.660223 0.402043
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 8.801398 15.100052 9.007320 -0.601910 6.834623 2.433430 -0.341381 0.930523 0.032795 0.363935 0.279742
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 8.673441 -0.740725 9.031096 0.420899 6.794668 2.714766 -0.045896 0.853693 0.032667 0.671435 0.544622
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.780973 1.559272 0.121834 0.228557 1.232193 1.103034 1.885544 0.264851 0.654181 0.669668 0.406278
18 N01 RF_maintenance 100.00% 100.00% 54.29% 0.00% 9.255394 15.941347 9.027058 -0.340398 6.989152 3.594474 -0.153235 10.828989 0.029166 0.232062 0.176239
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.809054 -1.454541 -0.496473 3.175906 1.449632 0.467265 0.270911 0.976446 0.657493 0.656277 0.393939
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.808282 -0.917139 3.381218 -1.072951 -0.151190 -0.461717 0.950121 -0.814253 0.641708 0.677153 0.408595
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.088140 0.029267 -0.163275 3.941394 0.483324 0.909857 -0.027666 0.279223 0.643641 0.629029 0.394448
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.775720 -0.769354 -0.115635 -0.381292 3.227325 1.842538 -0.784411 -0.886379 0.618865 0.637921 0.396862
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.066471 9.229794 9.076848 9.545287 6.938483 7.127468 0.759297 0.530359 0.036324 0.040500 0.006152
28 N01 RF_maintenance 100.00% 0.00% 83.74% 0.00% 9.525805 22.687555 -0.954821 0.983104 3.266354 3.349720 2.058491 9.978026 0.375303 0.174359 0.270284
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 8.675595 9.599509 8.706761 9.177980 6.944241 7.122687 -0.162181 -0.280760 0.029479 0.036109 0.006681
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.262570 0.137399 -0.588911 0.415401 5.940568 0.900326 4.857470 -0.010477 0.663586 0.675933 0.398527
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.501796 -1.002705 0.737832 1.175501 1.414673 -0.001804 0.070098 0.345003 0.668433 0.675036 0.393336
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.313683 1.766061 0.391523 1.269038 7.368237 2.022543 11.818130 44.859801 0.592792 0.650991 0.378811
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 9.990580 10.586676 4.028842 4.392473 6.881654 7.085921 0.101796 0.044030 0.034674 0.042724 0.005349
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.464957 -1.166781 0.790817 -1.268582 1.056875 -0.441061 0.724367 -0.730121 0.628046 0.632325 0.392456
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.449045 6.854626 0.023312 0.187494 0.660847 1.814272 1.410310 1.542854 0.642075 0.657388 0.411391
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.151512 0.227948 -1.360262 1.148326 1.009761 1.901386 -0.358071 4.988167 0.649597 0.666037 0.412596
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.106997 -0.383799 0.094865 0.584310 -0.015197 -0.164399 1.415103 0.541727 0.657691 0.669856 0.409557
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 8.087972 0.497919 8.733391 0.385143 6.930365 -0.290778 -0.046537 -0.169248 0.038111 0.665135 0.525588
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.770938 0.181474 -0.603790 -0.081163 2.281552 0.762346 -0.616970 0.559420 0.662807 0.676967 0.392227
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.195143 10.090185 9.290606 9.973664 6.622882 6.835167 -0.192685 0.331052 0.030994 0.029111 0.002174
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.023537 -0.052977 -0.475375 0.426025 -0.448576 0.994619 -0.030331 1.965753 0.671600 0.679796 0.399411
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.458227 0.413820 -1.371158 0.000664 -0.056712 0.738094 -0.728418 -0.578135 0.673380 0.686654 0.394266
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.010677 1.426489 0.124966 0.222155 -0.446301 2.197545 -0.241457 0.869275 0.663609 0.674427 0.391158
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.055461 1.348787 1.314321 1.487034 -0.461623 0.620642 -0.445219 -1.528431 0.655275 0.681919 0.408215
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 9.255449 10.343170 3.863135 4.048238 6.831104 7.000883 -0.026207 -0.444333 0.030742 0.051717 0.013986
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.451065 0.590625 0.323754 1.273028 0.668924 1.440837 0.212280 -1.611434 0.632770 0.655720 0.396641
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.562562 -0.454114 -1.102818 -0.000664 -0.146810 -0.850026 -0.178424 0.239497 0.588341 0.635631 0.400242
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.193688 14.599450 0.307888 1.155888 4.197896 3.240919 42.455702 45.489498 0.604190 0.596209 0.363949
51 N03 dish_maintenance 100.00% 99.89% 0.00% 0.00% 20.471003 3.445259 11.553757 -0.715914 7.142516 4.864724 4.996815 2.601163 0.044001 0.553229 0.427631
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.834628 5.870314 -0.611196 0.377117 0.555328 1.311253 0.990222 0.099580 0.661678 0.674843 0.402632
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.019808 2.611717 -0.233351 0.006760 1.344938 2.407099 1.355005 2.783121 0.663019 0.680672 0.408601
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 8.515361 9.799585 9.083117 9.748862 6.862760 7.057973 0.558918 0.185036 0.030682 0.029311 0.001333
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 8.929015 10.399174 9.098947 9.659935 6.935169 7.106942 0.057627 1.128491 0.027788 0.030793 0.002755
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.228457 10.493839 0.286824 9.854120 -0.258391 6.970237 1.551577 0.494935 0.667727 0.038895 0.554377
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.702412 0.330063 8.068710 0.467981 5.460326 1.101548 2.547343 1.476393 0.300424 0.680528 0.466194
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.078166 9.507988 8.972166 9.644426 6.790257 7.010738 0.322977 0.225020 0.036531 0.036040 0.001697
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.087184 2.941842 9.022406 1.057790 6.615210 2.954047 -0.167652 6.821744 0.050005 0.665824 0.536098
60 N05 RF_maintenance 100.00% 0.00% 96.76% 0.00% 0.156577 9.431892 -0.481575 9.676832 -0.162641 7.056851 -0.115159 1.009691 0.662640 0.082952 0.533669
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.650067 -0.697880 -0.495665 -1.438809 1.879466 -0.830163 -0.823438 -0.171275 0.608352 0.647889 0.395208
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.455193 0.898661 -0.955310 0.838587 -0.841477 -0.620956 0.126548 -0.890460 0.608470 0.655820 0.399348
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.116279 9.788583 -0.537318 4.423774 0.032582 7.184234 -0.117851 1.196677 0.626695 0.045487 0.500443
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.146767 -0.204194 -0.785042 -0.942287 -1.111835 -0.886045 0.227797 -0.103257 0.613325 0.615354 0.382015
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.535329 1.063357 0.400817 0.877896 0.302466 1.298825 -0.106766 0.342712 0.637792 0.660903 0.418259
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.386589 1.647286 1.775468 1.784459 3.085032 0.278472 -0.134730 0.916619 0.646206 0.666579 0.408985
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.769939 -0.890012 1.924738 1.796565 -0.148519 0.834869 0.433047 2.548541 0.655425 0.671800 0.403740
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 19.727692 22.857710 1.068066 12.690459 2.748085 7.157591 -0.174982 4.509752 0.373268 0.030707 0.275511
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.065888 -0.376315 0.262487 0.523382 -0.252790 1.627064 -0.370766 -0.444339 0.663652 0.681344 0.392688
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.435082 -0.172690 -0.522578 -0.176519 0.843975 1.911945 0.378870 0.333720 0.658364 0.686672 0.397073
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 6.966493 -0.048782 0.359922 0.976453 0.601651 0.204189 1.384209 1.015044 0.681635 0.686874 0.387405
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 1.939330 10.534135 0.543672 9.996847 -0.014978 6.875028 5.411766 0.611951 0.671223 0.036362 0.553680
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.799531 0.577289 -1.005208 2.326556 0.637069 7.945125 -0.672265 -0.437143 0.683227 0.676571 0.389824
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.533969 1.184187 -0.137385 -0.736887 -0.487981 2.312053 -1.170067 0.441100 0.677221 0.683323 0.388340
77 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.293699 0.549164 0.284790 -0.336504 -0.843751 -0.776149 0.773143 -0.915097 0.645663 0.652044 0.388627
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 27.660321 0.178672 -0.629200 0.734858 1.088568 -0.613753 1.104015 0.602985 0.448652 0.659398 0.391413
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.421533 -0.740032 -1.523331 -0.271794 -1.170092 -1.149634 -0.251156 -1.247228 0.615295 0.649942 0.400996
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.894113 10.876823 -0.178910 4.338970 -0.088604 6.964607 1.359036 0.143184 0.612767 0.054406 0.474500
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.142093 10.225865 -0.294824 8.375288 0.096371 6.705517 -0.614101 0.499195 0.614565 0.039374 0.476376
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.290545 -0.259407 0.104722 1.765179 0.269153 0.406174 -0.267475 -0.231395 0.633428 0.646980 0.400492
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.451934 0.150450 -0.088745 0.281579 -0.119398 1.029475 -0.707152 0.747416 0.645744 0.665509 0.400545
84 N08 RF_maintenance 100.00% 43.17% 100.00% 0.00% 16.743361 20.087108 11.628722 12.284268 5.486699 7.110106 1.613165 2.092683 0.232032 0.035722 0.149791
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.330524 -0.299586 0.073591 0.539014 2.377064 0.400583 -0.673928 -0.485741 0.663090 0.675639 0.392985
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.396072 -0.356491 1.202361 0.772829 4.914526 -0.439744 0.290601 10.082140 0.644735 0.661864 0.371871
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.007494 6.698611 0.180280 -0.240628 12.403339 0.463181 13.073015 3.623937 0.602502 0.692333 0.375563
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.611418 0.336993 0.139292 0.906363 -0.573820 0.580146 2.968302 1.622424 0.669912 0.680976 0.379841
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.978400 0.460138 0.044747 0.765449 -0.470345 -0.325959 -0.508279 -0.359069 0.655031 0.683446 0.383324
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.381416 -0.213627 0.829838 1.227641 -0.868419 -0.725002 0.215763 2.029037 0.665366 0.666942 0.381414
91 N09 digital_ok 100.00% 99.57% 99.51% 0.00% nan nan inf inf nan nan nan nan 0.452232 0.515314 0.416769
92 N10 RF_maintenance 100.00% 0.00% 16.15% 0.00% 31.456029 36.948564 0.405747 0.991453 3.185480 3.389611 0.126491 5.136227 0.298244 0.253644 0.090085
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 3.770156 0.330888 2.068184 0.235455 0.990863 1.309436 2.053245 1.014358 0.641800 0.674187 0.396827
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.384907 9.890996 9.206571 9.551894 6.849617 7.035730 -0.064082 -0.073459 0.031328 0.026328 0.002298
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.567871 -0.985375 -0.827171 0.429667 -0.157367 -0.485222 -0.712457 -0.026174 0.630471 0.660982 0.401772
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 9.527831 10.484951 3.868437 4.487834 6.648673 6.846131 0.023999 -0.021163 0.033308 0.039210 0.002891
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.174177 6.013654 -0.043091 2.604546 0.173490 3.601177 1.095638 1.373989 0.575325 0.503652 0.377445
98 N07 digital_ok 100.00% 99.46% 99.68% 0.00% 217.150023 217.076889 inf inf 3341.353507 3310.989893 4601.512445 4488.862515 0.514746 0.410273 0.362031
99 N07 digital_ok 100.00% 99.30% 99.51% 0.00% nan nan inf inf nan nan nan nan 0.571618 0.470803 0.391813
100 N07 digital_ok 100.00% 99.35% 99.41% 0.00% nan nan inf inf nan nan nan nan 0.555536 0.497238 0.478851
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.537718 7.629257 -0.502441 0.892974 -0.095884 1.875876 0.173958 1.432787 0.664678 0.677215 0.392380
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.767668 0.449688 -0.813302 2.001140 0.568477 0.742781 -0.835514 4.191588 0.672272 0.671153 0.385423
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.244630 3.631273 -1.319022 -0.470035 6.949098 1.013464 4.368267 1.227704 0.671538 0.683118 0.379715
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.765152 52.223290 6.398806 6.843908 2.865249 4.392515 -0.212520 0.061014 0.612141 0.654351 0.386389
105 N09 digital_ok 100.00% 99.62% 99.68% 0.00% nan nan inf inf nan nan nan nan 0.488623 0.428861 0.514360
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.141374 -0.963785 1.006181 1.043602 2.154322 0.037767 0.106339 2.130985 0.663001 0.666289 0.368704
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 2.317075 2.043888 -0.449875 -0.320923 0.823836 0.167868 5.550090 4.030934 0.674061 0.684318 0.380415
108 N09 RF_maintenance 100.00% 99.62% 99.62% 0.00% nan nan inf inf nan nan nan nan 0.598312 0.675897 0.408446
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 8.383746 9.492091 9.060085 9.434717 6.981782 7.137669 -0.301619 0.522387 0.026043 0.026901 0.001182
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 22.348041 21.512045 12.059619 12.443673 6.831368 6.964260 1.740776 1.898786 0.024126 0.026680 0.001343
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.100173 9.431340 0.325025 9.527829 -0.371202 7.155778 7.006409 0.669752 0.661409 0.037952 0.479279
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.528407 2.082472 -0.062176 -0.135120 0.578893 2.400708 0.009321 -0.749371 0.652901 0.659189 0.397730
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.220001 10.541168 3.670692 4.391779 6.690576 6.897217 0.296128 -0.168753 0.035421 0.030859 0.002279
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.276549 0.361854 -1.189407 -0.292966 1.276273 -0.446605 -0.218298 -0.950808 0.594339 0.643494 0.404856
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.599114 1.502342 1.071147 1.706037 0.545645 1.115489 -0.882136 -0.659272 0.614453 0.638309 0.413028
116 N07 digital_ok 100.00% 99.35% 99.68% 0.00% nan nan inf inf nan nan nan nan 0.620889 0.296523 0.445340
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.294284 10.875019 9.120894 9.974947 6.697863 6.999921 0.130754 1.527777 0.027793 0.031384 0.002486
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.728082 1.047375 -0.164386 0.557948 -0.171402 -0.333016 -0.367713 0.180196 0.632522 0.662312 0.404403
119 N07 RF_maintenance 100.00% 99.41% 99.51% 0.00% nan nan inf inf nan nan nan nan 0.514055 0.493921 0.408726
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.080615 2.275577 2.214077 1.776179 3.011208 1.686869 8.432426 0.964842 0.647508 0.676213 0.383832
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.991519 2.723278 -1.332472 5.453151 3.038593 0.779994 11.068464 7.963671 0.673945 0.660508 0.379457
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.756144 5.958207 0.216398 0.626441 -0.014099 1.520629 0.357119 -0.669238 0.680440 0.691064 0.385472
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.892587 7.593159 0.395010 0.911014 0.750993 0.511355 -0.432972 -0.184748 0.683800 0.692629 0.387173
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.597997 3.706180 -0.159465 0.511358 -0.573865 0.132828 0.191047 0.040514 0.684543 0.678750 0.380613
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.040486 -0.948783 -0.349568 0.834561 0.187666 -0.144649 0.213380 -0.323712 0.673239 0.685587 0.383162
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 19.521772 5.050440 -0.143786 1.144507 11.445808 1.192499 38.371242 -0.278779 0.573969 0.684212 0.378246
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.562476 0.380652 0.003289 0.249048 2.766817 1.928275 -0.038439 1.985013 0.674850 0.689777 0.396897
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 7.833245 9.096142 9.118207 9.637950 6.749604 6.941672 -0.402809 -0.089876 0.030935 0.028361 0.001309
129 N10 digital_ok 100.00% 99.57% 99.46% 0.00% nan nan inf inf nan nan nan nan 0.415917 0.548640 0.314944
130 N10 digital_ok 100.00% 99.46% 99.51% 0.00% nan nan inf inf nan nan nan nan 0.499565 0.483246 0.272028
131 N11 not_connected 100.00% 0.00% 15.02% 0.00% -0.772493 9.796367 -0.067116 4.336449 -0.855831 6.378785 -1.056508 -0.377233 0.637380 0.279300 0.451440
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.963269 0.059292 -0.528655 -1.536758 2.539197 -0.722806 0.058541 -0.723693 0.615681 0.633604 0.397270
133 N11 not_connected 100.00% 100.00% 0.00% 0.00% 9.801783 -0.909403 3.670677 -1.405947 6.813443 -0.788789 0.284778 -0.692421 0.051191 0.626349 0.482296
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.552878 -0.906222 -0.174510 -1.548581 2.513929 0.896760 21.255872 -0.116668 0.611767 0.644867 0.423553
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 7.715002 2.832057 8.687501 2.591259 6.986025 23.413084 0.266112 2.754614 0.041391 0.612815 0.453538
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.479054 -0.583022 -0.367365 -1.273991 1.865215 -0.252421 -0.144607 0.304917 0.615448 0.656754 0.413815
138 N07 RF_maintenance 100.00% 99.41% 99.51% 0.00% 203.011404 202.676871 inf inf 3785.556631 3785.746069 5448.923923 5455.973071 0.633668 0.510042 0.454946
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.717413 -0.687526 1.178660 -1.184548 0.623471 -0.877999 -0.994239 0.058573 0.639446 0.659349 0.389063
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.237681 -0.572772 -1.034935 -0.624145 -0.616647 -0.126822 2.664960 1.153575 0.663429 0.688131 0.388901
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.188870 -0.686273 -0.671515 0.309834 0.972120 -0.791386 -0.004830 -1.230757 0.669281 0.689006 0.384109
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.719640 9.413494 -1.080320 9.685077 2.068506 7.082958 11.150821 0.499242 0.674120 0.049243 0.539229
143 N14 digital_ok 100.00% 0.00% 100.00% 0.00% 0.280415 9.851661 5.523672 9.655986 -0.757078 6.792367 0.147908 0.109230 0.618618 0.037587 0.501365
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.056669 0.341686 -0.487926 0.705554 0.565675 0.261363 -0.629240 0.004830 0.681466 0.692897 0.384152
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.977758 3.618678 -0.337683 5.439577 -0.505665 13.665911 -0.375466 0.039288 0.678378 0.629359 0.402272
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 9.549898 1.331837 3.683604 -0.289347 6.817509 -0.527084 -0.441231 -1.225059 0.037965 0.667821 0.514986
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.807385 -1.286699 1.233681 2.010894 0.662645 0.001804 -0.531709 -0.693718 0.662379 0.676344 0.389272
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.747810 0.026140 2.670746 1.466705 -0.231424 1.918499 -0.645534 -0.795413 0.650100 0.679754 0.402452
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.754045 0.999294 -1.541152 1.393840 -0.147378 -0.195089 -0.590202 -1.505890 0.662853 0.678082 0.404231
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.979542 -0.268601 1.093577 0.444078 0.414168 -0.818876 -1.278509 -1.078341 0.656270 0.665846 0.407488
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 8.203949 -0.821907 8.771237 -1.145439 6.992746 0.747683 -0.194288 0.428959 0.037245 0.646048 0.478585
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.793305 9.264725 7.363525 9.450623 2.923363 7.167523 0.197449 0.608222 0.457544 0.039637 0.355316
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.311779 -0.108572 -0.205219 0.557903 -0.506356 0.983605 -0.438502 -0.349295 0.630615 0.655455 0.407056
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.260320 -0.539934 -0.659908 -1.143822 2.354699 2.449007 1.902501 5.069945 0.646649 0.672160 0.410174
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.113339 22.585041 -1.550906 -0.852798 -0.951944 4.287245 -0.561946 32.905000 0.623455 0.531788 0.362514
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.599678 -0.058558 -0.426427 -0.873719 -0.530791 1.984709 -0.207646 -0.095899 0.659035 0.672093 0.389378
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.740064 24.844738 -0.276432 -0.584774 0.333241 0.450645 -0.705403 0.685269 0.664723 0.552269 0.346704
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.592769 0.194327 1.967868 1.026894 0.100744 -0.736656 0.137479 -1.227227 0.669510 0.691362 0.389030
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.208559 0.051268 -0.369003 0.274375 -0.199927 1.050205 -0.675054 0.055993 0.681543 0.687274 0.389261
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.915638 0.594114 1.635728 -0.259320 7.067656 2.490247 0.060267 0.384247 0.669528 0.693502 0.387048
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 25.463917 0.424497 2.206012 0.445698 3.872123 0.522429 1.394437 -0.497818 0.516315 0.689013 0.380604
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.054075 1.331353 0.255133 0.474654 0.146490 39.760313 1.992107 3.668880 0.674537 0.683260 0.389821
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.033200 -1.253435 -0.978918 3.479270 1.340603 -0.310215 -1.115474 1.356319 0.681206 0.669915 0.397401
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.742334 -0.782877 -0.126827 -0.447201 1.682759 0.934143 -0.640795 0.682706 0.669145 0.680803 0.399521
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.890494 -0.497456 -1.049791 -1.531146 2.440015 0.728006 2.350322 -1.089853 0.657993 0.684806 0.403523
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 9.111042 -0.428125 9.236106 -0.982467 6.668687 0.209296 -0.085995 0.388646 0.040123 0.677912 0.531237
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.734534 -0.514633 1.520931 3.074964 0.357565 20.234471 -0.208475 1.340263 0.605147 0.642224 0.393629
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.022390 10.063533 -0.353928 9.800926 1.153257 6.979445 9.876912 0.899678 0.655815 0.056666 0.539858
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.378107 -0.010677 -0.104353 0.360958 -0.042622 -0.192199 -0.606483 2.025977 0.665496 0.679518 0.396571
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.205048 9.227901 -0.679373 9.425357 0.246886 7.180876 4.824808 0.668207 0.672519 0.050861 0.512426
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.269771 1.272241 0.949775 4.616969 1.012881 -0.536425 0.449729 0.360075 0.657324 0.633162 0.371795
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.122738 -0.633703 0.610031 3.196539 -0.263568 -0.487190 0.049134 0.673527 0.660761 0.671035 0.376467
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 15.019016 -1.202999 7.514901 4.034679 8.299336 -0.800648 0.291901 -0.041802 0.364828 0.657773 0.416339
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.908120 -1.102607 -1.419384 -0.677466 0.762001 0.071640 -0.649161 -0.864542 0.680926 0.697958 0.397807
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.179248 -0.376043 -1.329924 1.998244 -0.224611 9.344886 0.515181 5.858881 0.676921 0.678894 0.388500
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 7.761355 9.066951 8.623441 9.480191 6.986713 7.172071 -0.318931 0.193834 0.028288 0.031314 0.001277
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.157645 -1.199821 -0.738444 -0.062825 -0.423287 -0.122215 -0.580751 -1.173875 0.659302 0.676535 0.408150
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 2.498040 0.042016 0.960963 -0.454455 0.172365 1.239365 7.011572 0.252360 0.627322 0.667709 0.418039
200 N18 RF_maintenance 100.00% 100.00% 37.55% 0.00% 9.984276 30.289960 3.835393 0.383711 7.022498 4.526954 0.320887 -0.257673 0.042183 0.232652 0.157322
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.703684 4.698956 2.566688 3.441348 2.958185 4.461036 -1.312900 -2.195910 0.650188 0.650485 0.394273
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.241130 -0.130673 1.302433 -1.274405 0.784557 1.113672 -1.334117 13.566245 0.660828 0.660998 0.388345
203 N18 RF_maintenance 100.00% 99.46% 99.51% 0.00% nan nan inf inf nan nan nan nan 0.325960 0.388423 0.273404
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.021897 2.004260 0.392485 -0.863717 -0.719516 2.274396 -0.758670 4.555015 0.652234 0.645946 0.383432
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.046112 2.620040 0.760487 -1.105275 1.649219 -0.377584 1.403787 1.709892 0.653297 0.640438 0.385554
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.247991 1.776567 1.071903 -0.853729 0.443138 4.880478 -0.389203 -0.299169 0.636497 0.644101 0.367684
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.130351 10.270037 8.460309 10.666389 6.384635 6.519774 12.098285 46.653532 0.033976 0.034455 0.001217
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.600730 6.969610 8.348451 8.989752 5.459895 7.138164 10.502874 16.138085 0.041454 0.040758 0.001802
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 11.491865 6.866527 -0.911687 -0.918843 -0.383934 -0.409867 -0.130860 -0.655017 0.646637 0.649556 0.402068
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.217632 -0.885477 -1.028393 -0.218903 -0.398082 -1.099605 1.629468 -0.636207 0.604180 0.636863 0.405644
219 N18 RF_maintenance 100.00% 99.73% 99.68% 0.00% nan nan inf inf nan nan nan nan 0.304514 0.363621 0.227045
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.246921 -0.938719 0.249559 -0.748689 -0.608658 0.457325 0.656279 -0.962707 0.646659 0.656071 0.392089
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.173163 -0.975358 -1.050707 -0.945225 0.733274 -0.861892 2.026759 -1.032354 0.635458 0.661813 0.395847
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.639907 -0.628135 -0.188124 -0.142986 -0.063735 -0.967514 2.405416 -1.304030 0.645336 0.670183 0.399336
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.536923 2.533627 -1.533587 1.942167 -0.647203 3.557780 0.281836 1.167576 0.634121 0.567679 0.402572
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.288720 5.911872 4.414896 4.006972 5.107534 5.465013 -2.523861 -2.404446 0.613247 0.645365 0.389299
225 N19 RF_ok 100.00% 0.00% 88.98% 0.00% 1.185984 9.886174 0.761140 4.212035 -0.904107 6.981427 -0.967245 -0.011900 0.652189 0.130196 0.537364
226 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.118618 0.673506 -0.027128 0.819712 -1.030921 2.312198 -0.779320 2.057890 0.645135 0.658186 0.397775
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 4.600315 0.078193 -1.278981 -0.233293 0.255149 -0.927035 5.625805 -0.474737 0.599203 0.651785 0.393706
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 18.696288 13.716914 -0.556784 -0.427362 2.430333 3.365217 47.203272 67.951289 0.499732 0.542362 0.299242
229 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.695188 0.218110 1.144476 0.907506 -0.356629 0.140373 3.808476 -1.360568 0.625366 0.648478 0.411294
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.766701 -0.699962 -0.323448 -1.519700 -0.709546 -0.031929 0.605930 -1.002166 0.587714 0.640909 0.415108
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.675476 -0.995905 1.170244 0.715410 -0.171547 -0.119549 -1.496377 -1.561854 0.643122 0.657381 0.405076
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.875680 -0.646684 0.231711 0.493373 -0.045462 -0.546379 0.689731 1.047818 0.642551 0.661486 0.402356
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.699329 34.100419 2.202159 1.123694 5.790212 7.369023 55.331084 71.948512 0.478195 0.418164 0.202738
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.508310 2.569988 -0.782418 0.494895 -0.864605 -0.363123 2.585487 10.355276 0.633715 0.616003 0.396220
242 N19 RF_ok 100.00% 1.30% 0.00% 0.00% 40.457516 1.344863 -0.101870 0.864596 12.429162 0.483302 47.926413 -1.107657 0.400933 0.661462 0.467821
243 N19 RF_ok 100.00% 5.46% 0.00% 0.00% 52.592987 1.672595 0.594444 -1.478930 4.725181 0.151746 -0.877506 -0.592393 0.279571 0.641691 0.501109
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.514019 1.082255 1.165037 -0.710061 1.559221 0.574075 2.093973 3.967309 0.525641 0.618360 0.398690
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.302389 0.919089 0.055317 -1.095045 -0.773095 -1.114792 -1.052329 0.318253 0.621469 0.632392 0.400435
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.668075 6.458260 -0.811579 -0.744675 2.651634 3.338261 1.213320 -0.197021 0.336534 0.339659 0.163452
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.401788 0.912607 0.585956 -0.605162 -0.634828 -1.040565 -0.847446 -0.079840 0.622209 0.633783 0.401724
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.293651 6.623202 8.147386 9.069679 6.557748 6.714424 4.952661 14.382770 0.033139 0.027460 0.004969
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 8.277304 10.373985 4.583744 6.359731 2.161017 7.164977 6.774537 1.143910 0.382809 0.046754 0.297341
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.986817 1.946281 0.853560 1.094763 0.687704 1.050460 2.314301 1.819870 0.526139 0.552500 0.389844
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.656324 -1.167065 0.956166 -1.501765 0.680057 -0.276127 -0.313778 0.886959 0.555786 0.567657 0.397612
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.417309 -0.933142 -0.322591 -1.113643 -0.418053 -0.487818 2.343590 0.132318 0.495478 0.561305 0.401164
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.980501 1.500349 -0.785693 -1.496030 -1.070176 -0.655115 0.555176 0.782075 0.497914 0.541058 0.385417
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, 7, 9, 15, 16, 18, 27, 28, 29, 30, 32, 34, 36, 37, 40, 42, 47, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 73, 78, 80, 81, 84, 86, 87, 91, 92, 94, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, 113, 116, 117, 119, 120, 121, 122, 123, 126, 128, 129, 130, 131, 133, 135, 136, 138, 142, 143, 145, 146, 155, 156, 158, 159, 161, 164, 165, 166, 170, 179, 180, 182, 183, 185, 187, 189, 191, 200, 201, 202, 203, 205, 207, 208, 209, 210, 219, 224, 225, 227, 228, 229, 240, 241, 242, 243, 244, 246, 262, 320]

unflagged_ants: [5, 8, 10, 17, 19, 20, 21, 22, 31, 35, 38, 41, 43, 44, 45, 46, 48, 49, 53, 61, 62, 64, 65, 66, 67, 69, 70, 74, 77, 79, 82, 83, 85, 88, 89, 90, 93, 95, 106, 112, 114, 115, 118, 124, 125, 127, 132, 137, 139, 140, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 167, 168, 169, 181, 184, 186, 190, 206, 211, 220, 221, 222, 223, 226, 237, 238, 239, 245, 261, 324, 325, 329, 333]

golden_ants: [5, 10, 17, 19, 20, 21, 31, 38, 41, 44, 45, 53, 65, 66, 67, 69, 70, 83, 85, 88, 93, 106, 112, 118, 124, 127, 140, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 167, 168, 169, 181, 184, 186, 190]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459943.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.0.5.dev13+gd6c757c
3.1.5.dev197+g9b7c3f4
In [ ]: