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 = "2460027"
data_path = "/mnt/sn1/2460027"
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-23-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/2460027/zen.2460027.21272.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/2460027/zen.2460027.?????.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/2460027/zen.2460027.?????.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 2460027
Date 3-23-2023
LST Range 6.594 -- 16.556 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
Total Number of Antennas 199
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 94
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 199 (0.0%)
Antennas in Commanded State (observed) 0 / 199 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 69 / 199 (34.7%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 114 / 199 (57.3%)
Redcal Done? ❌
Never Flagged Antennas 83 / 199 (41.7%)
A Priori Good Antennas Flagged 57 / 94 total a priori good antennas:
3, 5, 7, 9, 15, 16, 17, 19, 21, 37, 40, 42,
54, 55, 65, 66, 70, 71, 72, 81, 83, 93, 94,
101, 109, 111, 112, 118, 121, 122, 123, 124,
127, 136, 144, 147, 148, 149, 150, 151, 161,
162, 165, 167, 168, 169, 170, 173, 181, 182,
184, 187, 189, 190, 191, 192, 193
A Priori Bad Antennas Not Flagged 46 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 50, 51, 57, 61,
62, 64, 73, 74, 89, 95, 97, 102, 115, 125,
132, 133, 139, 179, 185, 201, 206, 207, 220,
221, 222, 227, 228, 229, 237, 238, 239, 240,
241, 244, 245, 261, 320, 324, 329
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_2460027.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.140979 13.484792 0.395134 10.876831 0.330106 3.307556 0.915370 1.870862 0.653002 0.043946 0.575657
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.003368 20.981073 -0.970045 -0.429552 -0.554540 1.113108 -0.843327 0.095150 0.658022 0.562440 0.283910
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.750542 13.313739 10.365680 10.627757 2.840273 3.318454 1.630593 1.866322 0.038095 0.032528 0.001912
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.853703 -0.163439 -0.594928 -0.308646 -0.175276 4.661933 0.124580 0.254284 0.673325 0.680235 0.277586
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.430730 2.838983 2.056272 2.251941 2.224274 1.646458 0.672126 1.278890 0.639108 0.640926 0.281898
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.063772 -0.404440 3.437799 -0.543286 1.822937 0.019091 5.779431 -0.138251 0.672004 0.680420 0.271641
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.623787 -1.192541 -0.920091 -0.801017 0.190237 -0.185194 -0.647912 -0.401845 0.673630 0.674543 0.275024
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 22.149947 0.073659 0.243349 -0.278122 0.092691 0.315323 0.446938 0.096659 0.576606 0.677834 0.275956
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.428633 13.921568 -0.115935 10.874516 0.158358 3.305502 0.213006 1.872991 0.680111 0.044884 0.587518
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.358808 1.728303 1.010559 8.791707 0.586535 7.737710 1.562847 14.090212 0.683836 0.581832 0.318698
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.964425 6.898851 10.395648 0.966988 2.835022 1.134414 1.628077 1.664631 0.037258 0.519634 0.434809
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.123231 -0.361694 0.250218 0.429548 7.829213 -0.448914 2.194319 0.039821 0.688869 0.684469 0.281801
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.190315 -0.634559 1.057446 -0.501071 2.347696 0.075012 1.635111 -0.220059 0.689624 0.695021 0.267268
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.233932 0.390128 -0.002254 0.579088 4.738019 4.881623 0.150406 1.053988 0.674814 0.678436 0.270239
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.039341 -0.526045 -0.452935 -0.446475 -1.135283 -0.686187 -0.685866 -0.612531 0.655549 0.663869 0.272303
27 N01 RF_maintenance 100.00% 59.70% 71.15% 0.54% 7.204969 28.456950 9.778738 5.827280 4.322897 3.738548 5.480899 4.610321 0.183011 0.143656 -0.022456
28 N01 RF_maintenance 100.00% 100.00% 8.37% 0.00% 10.234164 16.199572 10.294232 3.963602 2.845271 2.350142 1.656319 4.138475 0.031275 0.417694 0.335506
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.801846 -0.420298 -0.003837 -0.442405 1.817342 -0.095167 0.082755 -0.205253 0.694601 0.698096 0.273862
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.240628 -0.523368 0.381159 -0.883022 0.665665 -0.481341 0.620811 -0.723182 0.695560 0.702992 0.271388
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.693436 -0.666150 0.987843 1.472756 1.979394 1.835495 1.469911 2.178933 0.703744 0.707174 0.265109
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.119190 22.032554 -0.974568 0.573661 3.265084 2.792019 2.161188 1.066206 0.668026 0.650706 0.239209
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.757740 14.098650 5.597582 5.753198 2.835847 3.310592 1.644965 1.874853 0.035224 0.060277 0.016218
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.481054 -0.817059 0.187476 -0.685299 -0.741849 -0.668760 -0.320939 -0.285141 0.661613 0.669944 0.273131
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.529645 7.206411 1.354919 0.911995 1.204056 0.697407 2.348866 1.994082 0.668381 0.677205 0.279032
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.871924 21.530302 -0.574353 12.637723 -1.083795 3.276263 -0.713516 1.709394 0.651326 0.035711 0.515746
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.485573 1.808193 -0.183192 0.029922 0.192282 -0.187987 0.121283 0.442460 0.679152 0.669798 0.283335
40 N04 digital_ok 0.00% 0.00% 0.00% 96.43% 0.648682 1.124895 0.101036 -0.560495 0.476083 0.362785 1.003781 0.124651 0.433901 0.425233 -0.214516
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.817106 1.551817 1.557224 1.555005 0.937581 0.898477 2.148886 2.309316 0.698540 0.707293 0.270841
42 N04 digital_ok 0.00% 0.00% 0.00% 94.54% -0.069593 2.497328 -0.303512 -0.683348 0.506703 0.324982 0.512229 0.016942 0.452046 0.437710 -0.212562
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.698661 -0.186963 -0.719366 0.905285 -0.380303 0.490406 -0.846248 1.333564 0.696512 0.712783 0.270647
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.707181 0.381604 -0.926409 0.503406 -0.334715 0.649986 -0.780380 0.843568 0.703069 0.718730 0.268910
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.040252 2.649006 0.943730 0.859907 0.348987 0.916365 1.205585 1.142717 0.699247 0.707497 0.258041
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.583738 -0.257450 0.049807 -1.025032 0.093068 -0.599608 0.260961 -0.978481 0.698512 0.709945 0.268211
47 N06 not_connected 100.00% 100.00% 99.57% 0.00% 10.848387 13.732690 5.507602 5.419677 2.841161 3.293526 1.694228 1.800799 0.031346 0.072240 0.027124
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.123162 0.554867 -0.802537 0.921252 -1.052928 0.230455 -0.888513 0.356913 0.666975 0.674274 0.271331
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.405568 -0.012520 0.653233 -0.617263 -0.361135 -0.881510 1.086201 -0.707279 0.647918 0.665580 0.268633
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.444370 1.388363 0.502477 1.762265 0.538427 1.259717 1.295496 3.369719 0.667820 0.681452 0.277556
51 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.673226 1.432990 0.445303 -0.508578 0.725092 0.106626 2.489130 -0.072625 0.673644 0.684668 0.277881
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.216825 5.424902 0.794186 0.362198 0.590901 0.570920 1.216118 0.799750 0.685383 0.694613 0.277501
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.058347 1.131807 0.146953 -0.479552 0.134879 -0.547757 0.597203 -0.642772 0.687616 0.695172 0.281845
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 6.685896 3.505455 1.784090 -0.105492 1.754126 2.417713 1.048722 0.315169 0.428229 0.486345 0.166446
55 N04 digital_ok 100.00% 14.32% 100.00% 0.00% 0.292538 47.392555 0.428381 7.220038 -0.154719 3.237571 0.157107 1.594970 0.424289 0.048941 0.246282
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.553061 0.788294 -1.038863 2.400899 -0.765987 3.397666 -1.003476 3.753711 0.700153 0.718123 0.269503
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.700270 0.497547 -0.683653 -0.429238 -0.732232 0.257002 -0.865132 -0.188657 0.703968 0.717809 0.268716
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.564681 12.930920 10.335377 10.798184 2.838970 3.311940 1.666225 1.887416 0.038091 0.037925 0.001340
59 N05 RF_maintenance 100.00% 99.73% 0.00% 0.00% 10.717989 0.542439 10.380541 1.246262 2.823897 0.798038 1.620253 1.719456 0.065591 0.717360 0.510810
60 N05 RF_maintenance 100.00% 0.32% 64.29% 0.00% 0.483069 12.728340 -0.084358 10.817404 3.969237 3.283190 1.006133 1.526123 0.697343 0.178559 0.479974
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.340662 -0.822938 0.745305 -0.669136 -0.326736 -0.593788 0.825687 -0.382576 0.665334 0.693298 0.264458
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.878884 0.498765 0.739542 0.564947 0.441236 -0.208055 0.775713 0.163264 0.649862 0.681643 0.270095
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.158255 13.424417 -0.934653 5.796623 -1.136432 3.326962 -0.906596 1.906438 0.667303 0.048243 0.470717
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.319405 -0.359596 -1.149754 -0.203647 -0.982596 -0.637417 -0.727233 0.197124 0.658013 0.665071 0.271775
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 22.436390 21.317802 13.113241 13.035117 2.800957 3.299553 1.632372 1.918502 0.023439 0.033359 0.009892
66 N03 digital_ok 100.00% 20.37% 88.65% 0.00% 2.248586 21.841781 1.734654 13.178349 0.735490 3.257761 0.773785 1.466588 0.379896 0.098125 0.222442
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.716402 -0.406039 -0.338443 1.492908 -0.176464 0.616872 0.001269 2.404641 0.685432 0.699346 0.275458
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 23.928236 0.626859 13.201218 0.731317 2.757423 -0.252985 1.465248 0.247099 0.045305 0.689534 0.530256
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.246905 0.012520 1.476285 -0.663990 0.654184 -0.165935 2.072197 -0.495077 0.701828 0.711050 0.267607
70 N04 digital_ok 100.00% 0.00% 0.00% 91.30% -0.088227 1.533409 1.356642 2.967280 0.995044 1.887271 2.446254 4.414034 0.466481 0.454057 -0.205199
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.366703 -0.326156 -0.278214 0.244653 -0.182073 0.222227 -0.253157 0.564384 0.707565 0.724597 0.263460
72 N04 digital_ok 100.00% 0.00% 0.00% 86.44% 0.668081 0.972612 2.687468 1.199198 1.309255 1.195704 4.787306 1.896652 0.477805 0.467885 -0.203028
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.403107 1.410238 -0.570133 0.408961 -0.092412 1.111380 -0.484241 0.622897 0.715554 0.728747 0.264190
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.883700 -0.317728 -0.143726 -0.576693 -0.900313 0.069979 -0.410128 -0.443661 0.705232 0.724901 0.269563
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 21.318382 13.164236 -0.359254 -0.637634 2.702935 0.301120 0.297409 -0.143707 0.561521 0.617017 0.182613
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 23.567579 0.335580 -0.087060 0.754422 0.352832 -0.040880 0.285128 0.282565 0.543595 0.683926 0.269220
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.719853 13.607144 -0.518328 5.783771 -0.666276 3.300439 -0.256626 1.851634 0.663115 0.040781 0.472885
80 N11 not_connected 100.00% 0.00% 87.74% 0.00% 0.341275 14.344090 -0.256389 5.699778 -1.080754 3.283059 -0.622089 1.750398 0.657105 0.107908 0.455420
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 45.767849 42.056055 23.912971 24.574046 5.709250 7.507885 13.936188 16.666429 0.018045 0.016386 0.001382
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 32.612153 45.841844 28.346244 22.681899 21.374311 10.531264 29.537478 16.060800 0.016233 0.016471 0.000723
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 28.249875 37.581090 23.506563 24.963915 4.721465 14.375186 14.487421 21.485621 0.016437 0.016272 0.000730
84 N08 RF_maintenance 100.00% 27.55% 100.00% 0.00% 14.343843 22.964637 12.605929 13.334791 5.405540 3.254801 7.275651 1.896459 0.368247 0.038693 0.222176
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.666039 2.002041 -0.171722 -0.945576 -1.051195 0.169604 -0.492913 -0.699060 0.698190 0.710163 0.268519
86 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.795022 1.010880 0.564070 0.215042 0.226967 0.120252 0.813237 0.856881 0.708696 0.720975 0.255700
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.199191 6.981489 0.437230 0.274238 0.872226 0.269846 0.666837 0.500680 0.713493 0.727821 0.252827
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.379435 0.871370 0.905020 1.283705 0.222527 0.332594 1.398589 1.883402 0.715041 0.727449 0.248390
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.216885 0.682831 0.894059 1.230772 0.244110 0.560438 1.129524 1.777543 0.713389 0.730266 0.252465
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.283789 -0.523748 -0.882296 -0.977787 11.794480 3.578952 0.009123 -0.651552 0.697904 0.724661 0.261501
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.091534 0.187347 1.079100 0.788408 0.488347 0.453296 1.333530 1.104316 0.706729 0.726366 0.259249
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.142957 0.246377 10.349419 0.505087 2.841333 0.628492 1.628390 0.858264 0.036979 0.721862 0.425181
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.495956 13.136222 10.445423 10.886975 2.833612 3.305681 1.672321 1.890787 0.031139 0.024958 0.003130
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.181500 13.389412 10.547029 10.713409 2.831432 3.311112 1.634467 1.870812 0.025401 0.025323 0.001055
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.523358 1.416003 -1.039547 0.286908 1.164088 0.772976 -0.356079 0.404363 0.562306 0.571579 0.180475
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.213668 21.484799 0.603082 -0.417297 -0.533140 0.366272 -0.030653 -0.228822 0.661008 0.602900 0.259832
97 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.297197 2.327366 -1.061057 0.946288 -1.214173 1.827384 -0.816032 1.816521 0.651382 0.653729 0.276814
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.943043 7.638499 0.358758 1.271799 0.518273 0.864309 0.619420 1.941785 0.697899 0.711827 0.263450
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.994019 0.455966 -1.066715 -0.872685 -0.745799 -0.177156 -0.983465 -0.564458 0.700702 0.712978 0.263685
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.200884 3.942699 2.231133 -0.990967 1.160870 -0.328137 1.034091 -0.790883 0.671926 0.720944 0.279527
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.358918 47.178379 0.463172 6.632870 0.549604 3.918426 0.666660 9.484176 0.716409 0.722887 0.255128
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.054609 0.655832 0.579244 1.299232 0.485320 0.578651 0.800222 1.801685 0.717550 0.731680 0.250198
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.098266 1.326761 0.317043 0.171111 1.623606 0.086333 0.545034 0.429636 0.716438 0.731605 0.250382
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.694695 0.308161 -0.345066 -0.510282 1.775779 0.074911 -0.128615 -0.292544 0.712061 0.728271 0.254492
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.240099 36.127269 10.383421 1.464568 2.838478 1.998342 1.653559 0.670101 0.035672 0.442437 0.210545
109 N10 digital_ok 100.00% 71.31% 100.00% 0.00% 9.817051 12.977644 10.411894 10.604520 2.806236 3.322706 1.285096 1.892038 0.147109 0.038744 0.073497
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.073776 -0.222786 0.254505 -0.098106 3.081890 0.166131 1.576271 0.082321 0.650500 0.719289 0.265021
111 N10 digital_ok 100.00% 0.00% 73.04% 0.00% 25.156077 12.749616 1.640500 10.678324 0.504786 3.295071 1.616204 1.652936 0.613798 0.142762 0.346110
112 N10 digital_ok 100.00% 2.38% 2.38% 63.32% -0.095983 4.191031 1.869813 9.317632 1.330403 6.635267 3.044597 11.541935 0.446703 0.339542 -0.157773
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.959453 14.162441 5.260067 5.777357 2.821503 3.298280 1.646796 1.867147 0.034187 0.030978 0.002003
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 12.753576 0.480317 5.408274 -0.386039 2.814290 -0.824759 1.600462 -0.544540 0.047387 0.670543 0.455871
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.028689 -1.017984 -0.964694 -0.195505 -1.005485 -0.835256 -0.560841 -0.471333 0.641027 0.659451 0.282011
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 29.684062 43.824111 24.540545 25.242318 7.153349 8.791129 13.314236 17.991749 0.017016 0.016265 0.000990
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 19.668578 35.849211 20.004742 26.389358 5.463941 11.502273 11.854491 23.206310 0.026081 0.023633 0.003862
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.320795 1.204348 2.999088 -0.568642 1.503241 0.047873 4.365412 -0.322060 0.702265 0.715963 0.257153
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.413252 3.253291 -1.085531 6.241175 -0.341605 40.721762 -0.780541 9.788833 0.712049 0.668738 0.267775
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.679604 4.944498 -0.320333 -0.851632 0.224703 -0.185223 -0.201763 -0.695930 0.720469 0.729493 0.254110
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.024601 7.677061 1.264428 1.292535 0.848238 0.784516 1.646692 1.852060 0.726004 0.738792 0.251722
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 10.328681 0.289955 10.606769 0.945944 2.825084 0.676876 1.625096 1.471401 0.043827 0.738296 0.431038
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.163518 -0.658602 1.439949 1.373969 0.580623 0.427788 1.781077 1.832154 0.719017 0.729835 0.253677
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.384913 0.731989 0.607339 1.161685 1.203324 0.813092 1.719508 1.658693 0.661296 0.732366 0.250069
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 9.773653 0.620743 10.337695 2.986796 2.841634 1.539940 1.632523 4.432119 0.033726 0.722207 0.419287
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.246215 -0.845557 -0.518441 -0.402459 -0.020195 -0.794432 -0.379960 -0.556896 0.703499 0.711152 0.272088
131 N11 not_connected 100.00% 0.00% 17.13% 0.00% -1.236305 11.616948 -0.540498 5.611804 -1.002705 3.261019 -0.795731 2.421406 0.666540 0.423033 0.337769
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.032855 0.124462 -0.930018 -0.853044 -0.908781 -0.681170 -1.031517 -0.632249 0.655177 0.669086 0.276166
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.221906 -1.118647 -0.768277 -0.682572 -0.883819 -1.053144 -0.509356 -0.834473 0.647299 0.665561 0.281558
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.316226 14.214877 5.384370 5.751964 2.821018 3.300312 1.618711 1.863587 0.040873 0.035144 0.003089
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.305329 -0.862351 -0.662877 -0.811001 0.058864 6.640596 0.337235 0.392285 0.656583 0.676434 0.273579
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.270451 -0.262306 10.065977 -0.319504 2.844132 -0.048152 1.648412 0.250032 0.045511 0.680255 0.446345
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 30.225947 50.240691 26.685177 24.861192 12.180105 9.895388 28.774990 18.084386 0.016255 0.016278 0.000749
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.902944 -0.363608 0.602176 -1.056573 -0.446997 1.979353 0.030430 -0.662284 0.679362 0.698441 0.266049
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.159024 -0.904070 0.075166 -0.552098 0.887976 -0.789388 0.343541 -0.679875 0.707153 0.715920 0.254810
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.507161 -0.730776 0.226297 0.133999 0.215300 -0.713814 0.428227 -0.191824 0.711352 0.715018 0.255043
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.971171 13.015935 -0.127953 10.832311 0.211885 3.305987 0.387237 1.841027 0.716482 0.059597 0.530667
143 N14 RF_maintenance 100.00% 46.03% 100.00% 0.00% 11.329494 12.819903 9.704623 10.807967 8.323002 3.307009 2.079529 1.892396 0.202813 0.031341 0.135862
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.101164 1.380575 -0.412406 1.270230 -0.047720 11.481336 -0.252931 1.964147 0.721338 0.734532 0.255853
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.111454 0.274711 0.046837 -0.160168 0.269918 -0.245287 0.180165 -0.001269 0.718080 0.724417 0.255864
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.311583 -0.692001 -1.059288 -0.783109 -1.053111 -0.684999 -0.867501 -0.887521 0.695540 0.712426 0.262138
147 N15 digital_ok 100.00% 99.84% 99.84% 0.00% 198.012680 198.176624 inf inf 1560.370942 1523.058331 241.349066 225.176017 0.612675 0.685938 0.177503
148 N15 digital_ok 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.336040 0.341373 0.234122
149 N15 digital_ok 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.812081 0.908262 0.431209
150 N15 digital_ok 100.00% 100.00% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.101844 0.146685 0.155958
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 16.888497 -0.438438 -0.557486 1.170506 -0.110436 0.088623 -0.341816 1.598135 0.573033 0.660470 0.246962
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.733472 -0.955233 10.206573 -0.614180 2.844391 3.187870 1.647461 0.300849 0.047786 0.677818 0.453610
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.780583 12.717191 7.983334 10.644335 5.522074 3.325435 12.053633 1.907503 0.580437 0.040246 0.405499
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.729009 0.345283 0.679845 0.963891 0.442516 0.980564 1.168416 1.731025 0.673168 0.694934 0.267002
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.193465 -0.116259 -0.941633 -1.130032 -0.257480 -0.494518 -0.605413 -0.494687 0.681766 0.695530 0.266976
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.554094 20.990359 -0.341197 -0.199729 -0.675130 0.636638 -0.277071 0.142177 0.668442 0.601340 0.238775
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.112595 -1.036383 0.292057 -0.314142 1.074768 0.140532 0.592476 0.023805 0.702416 0.714619 0.256956
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.023408 25.666621 0.626131 0.222396 0.602763 0.089780 0.990280 0.384059 0.709788 0.639492 0.233291
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.715397 -1.144949 -0.320221 -1.105405 -0.725917 8.929815 -0.498258 -0.856229 0.710023 0.720566 0.260043
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.736935 1.899947 0.490695 0.755395 0.468455 1.077076 0.752523 1.232813 0.718820 0.731637 0.257981
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.021243 0.918764 0.786741 1.454788 0.728290 0.832271 1.131112 2.157798 0.718027 0.729847 0.253980
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 19.651797 0.504826 0.546329 -0.299559 0.233842 0.121586 0.594422 -0.117081 0.623127 0.723757 0.245121
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.713185 -0.349777 1.254603 0.254611 1.025625 -0.664842 1.775205 -0.131512 0.711551 0.710644 0.258091
167 N15 digital_ok 100.00% 99.95% 100.00% 0.00% 209.987600 209.809472 inf inf 2074.983585 2075.163767 370.101771 370.117706 0.265553 0.112615 0.190744
168 N15 digital_ok 100.00% 99.95% 99.95% 0.00% 199.722272 200.077447 inf inf 1551.867301 1558.877777 236.121601 243.463467 0.320509 0.355915 0.127948
169 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 157.998313 156.986752 inf inf 1663.550370 1621.027447 265.094767 251.415499 0.115188 0.104900 0.032423
170 N15 digital_ok 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.853881 0.200146 0.784847
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.225179 -1.122051 0.571932 -0.548681 -0.677699 -0.851074 0.524059 -0.726855 0.637277 0.668135 0.279336
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.036701 0.131295 2.169639 0.662347 1.077209 -0.254725 0.957708 0.206686 0.631747 0.658937 0.295818
173 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.534427 4.489146 2.934007 3.025942 2.005717 2.632082 1.336789 1.653225 0.597281 0.602660 0.292599
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.553541 -0.933683 0.220650 -0.785034 0.374644 -0.201363 0.445263 -0.458713 0.674056 0.700867 0.269596
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.020563 13.584211 -0.475910 10.945448 7.297140 3.297018 -0.096150 1.853705 0.694977 0.065935 0.515953
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.067230 0.216549 1.387780 1.117353 0.601312 5.657577 1.914701 1.889770 0.707140 0.718045 0.260985
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.456271 12.741460 -0.156628 10.592985 3.223861 3.306617 -0.525007 1.858798 0.702786 0.059395 0.483328
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.524982 1.024139 0.741727 1.138678 0.511691 0.671283 1.070267 1.540062 0.705862 0.717852 0.250374
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 16.472551 -0.262475 7.084433 -0.598379 4.495609 -0.029272 8.693618 -0.426451 0.560818 0.720772 0.273664
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.157234 -0.123526 -1.131319 -0.047535 -0.738368 0.053668 -0.983281 0.185021 0.707583 0.718492 0.264368
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.172595 -1.105571 -0.102727 -0.574385 -0.996625 -0.935511 -0.371059 -0.682630 0.699259 0.709500 0.266846
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.434405 -0.937823 0.830902 -0.299697 21.369260 -0.709853 0.203464 -0.483660 0.689800 0.701860 0.266963
189 N15 digital_ok 100.00% 100.00% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.051489 0.518650 0.462712
190 N15 digital_ok 100.00% 99.95% 99.89% 0.00% 204.389756 204.665959 inf inf 2076.860383 2077.207648 370.483119 370.573714 0.313813 0.263237 0.191049
191 N15 digital_ok 100.00% 99.89% 99.84% 0.00% 151.793853 152.240005 inf inf 1596.876889 1611.452473 247.549722 252.372117 0.611253 0.664401 0.325116
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.700889 4.685159 2.386397 3.122714 11.138808 2.689989 -0.465878 1.692771 0.617572 0.610979 0.290658
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.860326 4.063135 3.095418 2.837204 2.171743 2.459697 1.399062 1.535340 0.591696 0.602170 0.292302
200 N18 RF_maintenance 100.00% 100.00% 0.27% 0.00% 11.763994 31.597024 5.418381 0.072159 2.840296 1.672415 1.648974 0.681262 0.041928 0.353640 0.242333
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.004264 3.436178 1.835213 2.675383 0.969722 2.188291 0.697263 1.426586 0.668883 0.664631 0.275703
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% 0.284598 0.979694 0.659617 -0.453439 -0.485256 -0.341918 0.005058 0.890445 0.686604 0.695248 0.266427
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.687495 11.556093 1.727442 -0.756647 0.948976 -0.391640 2.766565 -0.649515 0.700394 0.706402 0.260741
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.390668 -0.839306 3.927855 -0.657368 1.754651 -0.484651 3.197592 -0.270080 0.577486 0.699010 0.314234
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.060662 3.068224 0.580580 2.935986 -0.255680 1.316608 0.676855 3.198745 0.659852 0.633573 0.255984
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.940539 0.329082 -1.145648 -0.752535 -1.125406 0.010498 -0.836243 -0.545111 0.676032 0.683721 0.265130
208 N20 dish_maintenance 100.00% 99.68% 99.68% 0.00% nan nan inf inf nan nan nan nan 0.836641 0.853077 0.360128
209 N20 dish_maintenance 100.00% 99.84% 99.84% 0.00% nan nan inf inf nan nan nan nan 0.605164 0.567682 0.151689
210 N20 dish_maintenance 100.00% 99.78% 99.78% 0.00% nan nan inf inf nan nan nan nan 0.661946 0.560899 0.246486
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.190829 13.388984 -0.701806 5.807898 -0.895785 3.299894 -0.562637 1.880280 0.640444 0.040179 0.541438
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.121489 -1.100759 -0.171662 -0.643505 -1.048317 -0.883820 -0.514136 -0.850892 0.680175 0.685958 0.269952
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.860985 -0.621612 -0.483105 -0.997284 0.743653 -0.924344 -0.719784 -1.026149 0.680191 0.689661 0.269327
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.363061 -0.511660 -0.608998 -0.233949 -1.026669 -0.860995 -0.789633 -0.553503 0.677053 0.687725 0.269234
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.278873 -1.365193 -0.442529 -0.081360 -0.722877 11.521820 -0.333388 0.075085 0.673739 0.674866 0.266047
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.343342 4.344411 3.337086 3.076224 2.439757 2.607839 1.501308 1.644326 0.609639 0.638487 0.285832
225 N19 RF_ok 100.00% 0.00% 42.63% 0.00% -0.540620 12.441933 0.132018 5.535451 -0.905146 3.249893 -0.333751 1.222919 0.671028 0.295064 0.453655
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.686972 15.102407 -0.939287 0.026194 -1.048100 0.692170 -1.015787 -0.065134 0.668484 0.615840 0.262482
227 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 2.746053 -1.020326 2.586904 -0.567416 0.573106 1.790078 2.563029 -0.681881 0.605921 0.668944 0.296152
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.150952 -0.315006 0.218272 -0.927311 -0.712178 -0.795699 -0.237344 -0.700448 0.644585 0.656467 0.277756
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.224306 0.326485 0.187455 0.739788 -0.750018 0.047144 -0.286268 0.174307 0.637675 0.646336 0.289055
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.996461 -0.621689 0.689333 -1.007197 -0.350852 -0.874247 0.801601 -0.665595 0.649255 0.673037 0.274925
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.303090 -0.375404 0.195806 0.101895 -0.859308 -0.744714 -0.311054 -0.342147 0.669100 0.674298 0.280064
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.820911 -0.384272 -0.249440 0.169478 -0.906915 -0.605172 -0.538687 -0.194871 0.669142 0.673680 0.278129
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.736959 -0.197094 -0.285246 -1.081568 0.282850 -1.033277 -0.420296 -0.862751 0.665757 0.674575 0.278724
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.424232 -0.994751 -0.762440 -0.211661 -1.187089 -0.815315 -0.900972 -0.537835 0.666898 0.671491 0.280990
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 16.625225 0.100466 -0.529278 0.601789 0.065634 -0.253607 -0.346349 0.092162 0.566446 0.663513 0.271936
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 15.978947 -1.178023 0.206979 -0.853442 0.411153 -0.732793 -0.019806 -0.584903 0.568433 0.660626 0.272458
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.541223 -1.040908 -0.021752 -1.092648 -0.757275 -0.921650 0.035385 -0.764273 0.635660 0.661470 0.278348
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.587893 2.383473 0.003837 -1.068101 -0.976556 -1.019063 -0.433717 -0.892538 0.648091 0.646675 0.284336
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.444910 13.905413 -1.140059 5.366001 -0.915038 3.311341 -1.024634 1.860982 0.635206 0.039021 0.538116
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.607264 -0.473166 -0.256566 -0.533559 -1.049217 -0.911587 -0.601182 -0.756505 0.634643 0.640008 0.284201
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 10.030128 12.831246 0.651949 0.400931 0.545993 0.488413 0.867391 0.676839 0.645795 0.648363 0.290946
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.442371 0.501209 1.479159 0.728144 0.311243 -0.010498 0.475581 0.131293 0.482006 0.485968 0.312100
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.859298 2.214546 0.519227 0.889531 -0.458059 0.374956 -0.089508 0.227634 0.489962 0.499217 0.289219
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 0.544311 -0.664204 0.356260 -0.867682 -0.581641 9.849603 -0.229022 0.124541 0.522909 0.521337 0.310068
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.429155 -0.054424 0.562580 -0.627534 1.749104 -0.710429 -0.254941 -0.393388 0.525172 0.552431 0.291505
333 N12 dish_maintenance 100.00% 0.00% 3.30% 0.00% 2.452206 3.372556 -0.165260 -0.871597 -0.185057 7.911289 0.734006 0.579302 0.507107 0.521302 0.293796
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 5, 7, 9, 15, 16, 17, 18, 19, 21, 27, 28, 32, 34, 36, 37, 40, 42, 47, 52, 54, 55, 58, 59, 60, 63, 65, 66, 68, 70, 71, 72, 77, 78, 79, 80, 81, 82, 83, 84, 87, 90, 92, 93, 94, 96, 101, 104, 108, 109, 110, 111, 112, 113, 114, 117, 118, 120, 121, 122, 123, 124, 126, 127, 131, 134, 135, 136, 137, 142, 143, 144, 147, 148, 149, 150, 151, 155, 156, 159, 161, 162, 165, 167, 168, 169, 170, 173, 180, 181, 182, 184, 187, 189, 190, 191, 192, 193, 200, 204, 205, 208, 209, 210, 211, 223, 224, 225, 226, 242, 243, 246, 262, 325, 333]

unflagged_ants: [8, 10, 20, 22, 29, 30, 31, 35, 38, 41, 43, 44, 45, 46, 48, 49, 50, 51, 53, 56, 57, 61, 62, 64, 67, 69, 73, 74, 85, 86, 88, 89, 91, 95, 97, 102, 103, 105, 106, 107, 115, 125, 128, 132, 133, 139, 140, 141, 145, 146, 157, 158, 160, 163, 164, 166, 171, 172, 179, 183, 185, 186, 201, 202, 206, 207, 220, 221, 222, 227, 228, 229, 237, 238, 239, 240, 241, 244, 245, 261, 320, 324, 329]

golden_ants: [10, 20, 29, 30, 31, 38, 41, 44, 45, 53, 56, 67, 69, 85, 86, 88, 91, 103, 105, 106, 107, 128, 140, 141, 145, 146, 157, 158, 160, 163, 164, 166, 171, 172, 183, 186, 202]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2460027.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 [ ]: