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 = "2459933"
data_path = "/mnt/sn1/2459933"
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-19-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/2459933/zen.2459933.21329.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 1684 ant_metrics files matching glob /mnt/sn1/2459933/zen.2459933.?????.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/2459933/zen.2459933.?????.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 2459933
Date 12-19-2022
LST Range 0.431 -- 9.511 hours
X-Engine Status ✅ ✅ ✅ ✅ ❌ ❌ ✅ ✅
Number of Files 1684
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 N18, N19, N20
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 89 / 201 (44.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 130 / 201 (64.7%)
Redcal Done? ❌
Never Flagged Antennas 71 / 201 (35.3%)
A Priori Good Antennas Flagged 46 / 94 total a priori good antennas:
3, 7, 9, 15, 16, 17, 21, 29, 30, 38, 40, 42,
54, 55, 56, 71, 72, 81, 86, 94, 98, 100, 101,
103, 107, 109, 111, 121, 122, 123, 128, 136,
143, 146, 158, 161, 164, 165, 170, 182, 183,
185, 187, 189, 191, 202
A Priori Bad Antennas Not Flagged 23 / 107 total a priori bad antennas:
4, 8, 22, 43, 46, 48, 49, 61, 62, 64, 73, 74,
77, 82, 89, 90, 102, 125, 137, 139, 324, 325,
333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459933.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% 10.594078 14.933692 9.554797 0.440683 8.461570 4.625877 0.338610 3.114407 0.033501 0.371289 0.298185
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.517741 1.329244 1.784600 2.451624 0.523025 0.505787 2.562793 0.527087 0.669272 0.685302 0.415984
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.456472 -0.048113 -0.498212 -0.413242 -0.196732 1.041661 1.951674 -0.151050 0.668107 0.680577 0.411208
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.615295 -1.279727 0.609212 3.197580 -0.551295 -0.627576 9.713331 10.471666 0.657977 0.664752 0.398880
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.302331 -1.332601 -1.143262 -0.441292 -0.306170 0.329399 3.031930 1.601046 0.667495 0.679380 0.398215
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.435394 -0.535512 7.818739 -0.047307 3.954465 0.216897 -0.270525 -0.834722 0.501814 0.674174 0.472905
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 2.163861 -0.887809 -0.308121 -1.082084 -0.134916 0.985465 0.499821 3.117806 0.645740 0.665563 0.405918
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.961421 17.395684 9.496044 2.296863 8.494122 5.120711 0.030170 1.687648 0.031162 0.363499 0.282076
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.850540 -0.308116 9.521927 0.206366 8.464831 1.516550 0.241744 0.728844 0.032490 0.686834 0.564145
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.743322 1.901801 -0.132328 -0.133548 0.450625 0.396039 4.178680 1.396560 0.670729 0.686298 0.406838
18 N01 RF_maintenance 100.00% 100.00% 35.04% 0.00% 11.477528 19.601998 9.514594 0.088546 8.603759 7.019841 0.266487 17.812038 0.029227 0.240206 0.186210
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.035159 -0.790747 -0.877152 3.243596 0.024331 0.216861 0.086472 2.324728 0.674171 0.668723 0.398883
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.040063 -0.857824 3.459879 -0.483824 0.173575 -1.321815 0.457175 -1.187624 0.654165 0.690243 0.409552
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.169300 0.373902 -0.422108 4.118519 0.328065 -0.640453 0.126214 -0.301552 0.654708 0.639523 0.402507
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.412825 -0.137932 0.671687 0.513633 1.299982 0.796659 -0.374618 -1.178479 0.600874 0.621800 0.390481
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.127245 11.170664 9.565104 10.025772 8.577762 8.410069 1.650654 0.855411 0.035718 0.040902 0.007138
28 N01 RF_maintenance 100.00% 0.00% 82.30% 0.00% 13.432480 26.817963 -1.074107 0.812080 4.085265 7.005822 3.465219 15.502962 0.378354 0.177197 0.273028
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.819568 11.627381 9.158948 9.622962 8.563410 8.386146 0.281890 -0.412828 0.029637 0.036517 0.007287
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.306763 0.067984 -0.494635 0.093454 7.485853 0.916455 18.612761 0.241535 0.674372 0.689952 0.396198
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.254406 -1.221580 0.567223 0.858542 0.670004 -0.252321 0.686740 2.417629 0.683804 0.689823 0.395222
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 20.535702 9.755111 0.248597 1.531350 0.754773 7.380724 11.466795 118.540217 0.573365 0.624925 0.314164
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 12.261867 12.701214 3.939062 4.282396 8.572669 8.407544 1.941805 1.263464 0.032801 0.043591 0.006633
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.270799 -0.021383 1.510206 -0.698459 0.939163 -1.303721 5.016756 -0.803098 0.606833 0.612706 0.384033
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.330032 6.718773 -0.199679 -0.057837 0.627479 1.452950 1.564220 1.674216 0.663436 0.676682 0.407131
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.526757 0.366386 -0.814293 0.319988 0.591644 0.755750 -0.886064 3.100891 0.677903 0.688569 0.411021
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.079476 0.050144 -0.234268 0.238017 -0.023663 -0.059580 4.189329 0.451837 0.678078 0.694196 0.412194
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 10.207365 0.356003 9.186844 0.110819 8.588536 -0.462781 0.957818 0.170171 0.038898 0.686877 0.540691
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.209547 -0.016681 -0.795111 -0.408030 1.416554 -0.066376 -0.238868 0.303785 0.679700 0.694645 0.392708
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.381623 12.092445 9.819894 10.519950 8.407180 8.293838 1.673302 1.854218 0.031042 0.029283 0.002311
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.483163 0.690248 -0.781993 0.140580 -0.307181 0.320651 -0.263240 0.662241 0.678355 0.685845 0.394891
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.986445 0.084791 -0.749968 -0.348681 0.174504 0.853742 0.771553 0.656041 0.672369 0.689560 0.389389
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.384792 0.532760 -0.266246 0.075864 -0.620591 1.442213 0.766865 2.537690 0.668524 0.682286 0.388844
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.135129 1.912357 1.055717 2.506404 -0.418754 0.718878 -0.121971 -1.931166 0.656192 0.687791 0.407196
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.482119 12.409121 3.755176 3.902454 8.507092 8.326420 1.133134 0.060901 0.029806 0.053707 0.014699
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.206248 1.184588 0.994426 2.266413 1.577625 1.230848 -0.411769 -2.133293 0.621153 0.649142 0.397501
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.137087 -0.363181 -0.887499 0.166818 0.204943 -1.298189 -0.080454 0.856827 0.569140 0.626243 0.400495
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.330019 23.948939 -0.237445 1.144861 0.616525 0.863134 14.619670 21.716524 0.655712 0.605867 0.367822
51 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 23.361435 3.387921 12.329655 -1.019272 8.740972 5.478884 7.136560 -0.250593 0.044073 0.584245 0.457683
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.634159 6.326880 -0.974111 0.110746 0.711663 0.738507 1.713732 0.375263 0.680352 0.696189 0.401123
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.347025 2.590125 -0.501843 -0.239870 0.631229 1.830507 2.510670 3.731052 0.687423 0.701283 0.407233
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.628692 11.803676 9.578723 10.260529 8.524940 8.356694 1.211376 0.073841 0.031104 0.029542 0.001461
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.097418 12.456310 9.596596 10.162339 8.568290 8.394894 0.584834 1.624545 0.027506 0.030803 0.002899
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.189272 12.580341 -0.012464 10.385956 -0.685911 8.300052 1.399334 0.050545 0.681785 0.041166 0.568620
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.389135 0.231566 8.273460 0.128428 7.399449 1.128542 3.892402 1.237264 0.340330 0.700045 0.464640
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.187989 11.515953 9.455874 10.145520 8.459267 8.325594 0.925304 0.257470 0.036008 0.035601 0.001380
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.289780 0.828671 9.520057 0.981946 8.399575 2.420764 1.439912 6.503926 0.052516 0.677121 0.538960
60 N05 RF_maintenance 100.00% 0.00% 97.86% 0.00% 0.787947 11.427323 -0.846871 10.181314 -0.136618 8.371588 1.066373 1.998420 0.665664 0.080914 0.523950
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.988793 0.487362 -1.071221 -1.377576 1.624466 -1.361631 -0.643937 -0.312864 0.605196 0.643367 0.390028
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.813164 1.162217 -1.326897 1.670411 -0.360845 -0.237280 0.963773 -1.288981 0.594606 0.650388 0.399847
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.220490 11.812191 0.155559 4.313331 -0.002394 8.438128 -0.336094 1.636653 0.610731 0.044915 0.473798
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.603648 0.524991 -0.195300 -1.435494 -0.565396 -1.348246 1.445826 -0.094051 0.589741 0.598764 0.383387
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.375799 0.849699 0.019669 0.652129 0.523313 1.436561 1.164089 -0.002690 0.658181 0.683039 0.415065
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.197512 1.398688 1.933084 1.637288 2.439460 0.011916 0.433579 1.026587 0.666244 0.688890 0.405314
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.877880 -0.705200 1.743028 1.592969 -0.601933 0.255355 0.224118 1.221590 0.677107 0.693585 0.401732
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 22.396187 25.689339 0.810503 13.528492 4.117916 8.407489 -0.338628 6.452662 0.384527 0.030647 0.287211
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.485959 -0.222787 -0.090287 0.289663 -0.095569 0.929798 0.786769 0.380034 0.680872 0.699508 0.389170
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.262527 -0.109666 -0.783135 -0.476254 0.258725 1.303358 0.416420 -0.008311 0.674453 0.705251 0.395304
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.513860 -0.095480 0.119974 0.685867 0.608058 0.204286 2.302729 1.914360 0.696086 0.705521 0.385592
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 2.564892 12.624720 0.287649 10.546342 -0.126869 8.251549 8.814094 0.239605 0.686343 0.037500 0.564183
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.068751 0.613351 -0.517340 1.515352 0.213886 2.764581 -0.281687 -0.349559 0.689426 0.689270 0.386181
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.397682 0.909778 0.525853 -1.123677 -0.389564 1.123916 -0.952326 1.702772 0.682649 0.692949 0.383391
77 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.106255 1.016333 0.995441 0.357017 -0.324666 -0.927619 1.518820 -1.299927 0.640118 0.647707 0.389746
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 30.954113 0.184452 -0.372863 1.594165 3.115020 -0.393874 0.911108 0.670322 0.412584 0.649328 0.398420
79 N11 not_connected 100.00% 100.00% 100.00% 0.00% 15.163452 15.626557 -0.889091 0.276092 -0.822987 -1.394493 0.455738 -1.508828 nan nan nan
80 N11 not_connected 100.00% 100.00% 100.00% 0.00% 16.511188 22.544589 3.223458 4.567277 3.398949 8.249783 0.823210 0.294759 nan nan nan
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.320828 12.229528 -0.547286 8.742719 -0.443500 8.184265 -0.026620 1.195197 0.635077 0.039225 0.483394
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.072783 -0.473222 -0.144465 1.682119 -0.599628 -0.905476 0.039273 0.002690 0.654151 0.667805 0.396749
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.622881 -0.278230 -0.354074 -0.085135 -0.087782 -1.089097 -0.635060 -0.127449 0.666014 0.686158 0.396930
84 N08 RF_maintenance 100.00% 27.14% 100.00% 0.00% 20.272108 22.932984 12.453167 13.080000 7.120217 8.333469 3.345662 3.495221 0.244164 0.039489 0.166261
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.375638 -0.209214 -0.551171 0.251465 -0.423661 -0.466159 -0.268634 -0.411145 0.683591 0.696049 0.391948
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.272259 2.466115 1.300251 1.225854 3.579985 -0.682523 0.397904 14.842425 0.671671 0.676151 0.373010
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.231091 7.134757 -0.835137 -0.397638 7.418732 0.144095 0.329969 1.395029 0.687600 0.715553 0.383709
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.713258 0.316487 -0.160597 0.434047 -1.248023 -0.343485 3.131284 0.545754 0.679442 0.700660 0.377796
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.821894 -0.040914 -0.346082 0.458883 -0.672870 -1.018742 -0.779257 -0.929431 0.689184 0.701321 0.380980
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.486020 -0.344438 0.771692 0.923612 -0.816122 -1.491178 -0.178518 3.043145 0.677859 0.687346 0.381560
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.522195 -0.378410 -0.085186 -0.085296 -1.109022 -0.742937 -0.373895 -0.752628 0.674393 0.699626 0.396413
92 N10 RF_maintenance 100.00% 0.00% 17.04% 0.00% 37.380126 42.962533 0.288685 0.879397 6.616954 7.354530 1.708395 13.196472 0.294935 0.249125 0.096212
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 2.385919 0.444375 1.925163 -0.044741 1.074152 0.543425 2.003879 -0.878702 0.656152 0.682387 0.400398
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.606957 11.902938 9.726185 10.040914 8.531939 8.345362 0.549553 -0.008147 0.030767 0.025759 0.002961
95 N11 not_connected 100.00% 100.00% 100.00% 0.00% 15.441308 15.683657 -0.352047 0.910559 -0.099144 -0.385516 0.223654 1.095917 nan nan nan
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 21.443401 22.220680 4.129654 4.760091 8.287567 8.170860 0.692681 0.045426 nan nan nan
97 N11 not_connected 100.00% 99.94% 99.94% 0.00% 15.154833 18.045073 0.087981 2.885736 -0.430045 3.666056 3.908843 1.785963 0.430890 0.386043 0.303064
98 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 1.172394 5.324582 -0.360963 -0.523605 -0.337305 1.069668 0.348297 3.524240 0.632320 0.652951 0.395216
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 3.317261 -0.841544 0.527611 0.121644 -1.365334 1.508071 0.972474 -0.737148 0.625802 0.671589 0.409163
100 N07 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.873694 8.273420 -0.873211 0.684863 -0.224213 0.997360 0.322368 0.192407 0.682446 0.697154 0.393399
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.134623 1.217984 -0.308212 1.939643 0.404991 -0.425883 -0.331921 3.712614 0.689880 0.689625 0.384537
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.101462 4.449918 -0.776452 -0.740211 20.759574 2.470321 7.624395 1.922975 0.686488 0.704669 0.380365
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.120363 58.723704 6.612314 6.872487 3.068114 0.913063 -0.194921 -0.349123 0.630186 0.677308 0.387947
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.367984 -0.766942 -0.341730 0.458445 0.411077 -0.714729 -0.421188 -0.537924 0.690645 0.701218 0.372999
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.127868 0.420926 0.607435 0.677295 1.359812 -0.666591 -0.421242 0.018981 0.681464 0.700073 0.377307
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 2.450991 3.431147 -0.658290 -0.683609 -0.224589 -0.375056 11.660554 10.156754 0.686277 0.705880 0.376590
108 N09 RF_maintenance 100.00% 100.00% 0.24% 0.00% 10.719323 36.748716 9.514299 0.234746 8.530557 5.871012 0.977066 1.170147 0.038915 0.294368 0.146125
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.518139 11.505286 9.547326 9.907053 8.598577 8.406801 0.153929 0.800696 0.025797 0.026405 0.001314
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.428436 24.281485 12.897807 13.263219 8.495536 8.251388 2.876937 2.614966 0.023856 0.026566 0.000929
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.068311 11.420159 0.052635 10.008792 0.097579 8.409729 5.840978 0.971849 0.662662 0.037709 0.494517
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.017863 -0.287171 -0.293809 -0.278371 0.705849 2.650154 0.196738 -0.812495 0.647301 0.669781 0.414441
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 22.062930 22.272005 3.908784 4.649856 8.309482 8.202363 1.093753 -0.106366 nan nan nan
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 15.256630 15.657350 -0.492297 0.183103 1.161481 -1.181849 0.605546 0.249289 nan nan nan
115 N11 not_connected 100.00% 100.00% 100.00% 0.00% 16.016824 16.364103 1.626233 2.376200 0.721236 0.911515 -1.414068 -1.706279 nan nan nan
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -1.168957 0.448759 -0.792561 0.275390 0.799907 -0.340691 0.107912 0.327312 0.625468 0.647605 0.400035
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.518778 12.904135 9.633179 10.521657 8.424464 8.389119 0.933343 2.518168 0.027382 0.031915 0.002727
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.537223 1.175247 -0.578217 0.240132 -0.385097 -0.394204 0.547490 1.054280 0.654732 0.680099 0.402158
119 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 240.002799 239.844414 inf inf 3627.135211 3621.524308 2523.367143 2485.644661 nan nan nan
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.683206 3.457608 2.029447 2.878378 2.796647 2.077422 19.492345 2.581427 0.656993 0.684786 0.375931
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.949442 4.125555 -1.423413 2.203868 1.903454 0.375906 7.825822 13.992187 0.693366 0.700906 0.383073
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.103261 6.262516 -0.065972 0.430966 0.889320 0.857207 0.266672 -1.020615 0.695722 0.707637 0.381778
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.396918 8.186555 0.185018 0.646243 0.239312 0.035201 -0.592647 -0.398713 0.698973 0.711878 0.384515
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.930947 0.065069 -0.480939 0.238288 -0.626187 0.033589 0.627351 -0.168514 0.697115 0.709400 0.383903
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.280861 3.178092 -1.059280 0.408600 -1.352109 2.398414 -0.201103 1.168307 0.689680 0.697623 0.380555
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 20.510173 -1.106212 -0.831684 0.505093 11.347673 0.714556 69.229837 1.926888 0.604976 0.696293 0.387690
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.231519 0.161788 -0.135870 0.086147 1.889751 1.275809 2.352769 0.975753 0.677336 0.700888 0.401994
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.626946 10.629163 9.072014 9.588794 8.418799 8.269502 -0.133746 -0.262878 0.031406 0.026901 0.002784
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.017627 -1.272260 0.263530 0.660209 -0.987339 -0.398705 1.171457 -0.261443 0.657612 0.682160 0.410989
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.459571 0.683436 -0.359454 -0.068382 -0.589789 0.526632 0.728715 1.746066 0.643371 0.669990 0.405671
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 15.521825 21.457441 0.319084 4.630075 -0.347688 7.680819 -0.996377 -0.658054 nan nan nan
132 N11 not_connected 100.00% 99.94% 99.94% 0.00% 15.333447 15.023279 0.037921 -0.973104 3.387503 -0.797144 0.333601 -0.664869 0.515629 0.595232 0.443244
133 N11 not_connected 100.00% 100.00% 100.00% 0.00% 21.536299 15.299036 3.904591 -1.077109 8.413698 -1.464644 0.998752 -0.768458 nan nan nan
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.653781 -0.896887 -0.540516 -1.084283 3.957826 0.496127 10.239068 -0.471303 0.623221 0.663552 0.424583
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.787606 0.822409 9.132456 1.730639 8.590394 15.858505 0.969264 -0.255294 0.042146 0.646642 0.514427
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.090782 -1.006027 -0.500320 -1.535452 0.973784 -1.434773 0.540911 0.748965 0.638268 0.672672 0.410535
138 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.108727 -0.105683 2.070028 -0.535861 1.000602 -0.858846 -0.573814 0.111794 0.665380 0.674273 0.388974
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.419672 -0.566749 -1.523505 0.185052 -0.958810 -0.914617 3.873714 1.810244 0.679174 0.704765 0.389670
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.495077 -0.527412 -0.966977 1.117343 1.398243 -1.194028 -0.269209 -1.677193 0.683248 0.707421 0.384704
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.752834 11.420845 -1.350079 10.185616 1.364192 8.372857 13.776251 0.642390 0.686041 0.053601 0.585344
143 N14 digital_ok 100.00% 0.00% 100.00% 0.00% 1.440716 11.872030 5.890737 10.170799 0.001763 8.207021 -0.415921 0.135886 0.625538 0.039036 0.548395
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.704861 0.253819 -0.816896 0.428045 -0.661413 1.468664 -0.810123 -0.139497 0.690669 0.705373 0.388229
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.400807 2.049296 -0.724326 5.123322 -0.529880 12.559047 0.410733 0.718919 0.683407 0.655078 0.403484
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.836930 -0.818120 3.550222 0.388952 8.473767 -1.064153 0.019854 -1.304560 0.038067 0.690395 0.579333
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.744518 -1.154527 0.759526 1.899133 -0.190774 -0.579151 -0.415506 -0.420151 0.661784 0.681619 0.397959
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.433085 -0.256183 2.666679 1.369038 0.198452 1.135977 -0.330632 -0.595955 0.643936 0.682405 0.410971
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.727722 1.268509 -1.036533 2.353931 -1.001312 0.130111 -0.758767 -2.002706 0.657200 0.680527 0.416608
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 1.105845 0.165326 2.006456 1.258404 0.464416 -1.264284 -1.528164 -1.334552 0.646811 0.671236 0.428629
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.340917 -0.783984 9.226580 -1.546767 8.594010 0.817610 0.357720 0.423266 0.038548 0.657424 0.519291
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 4.543637 11.271222 7.777404 9.924159 4.933352 8.408282 0.261676 0.819254 0.464671 0.041756 0.380092
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.148394 -0.258302 -0.583094 0.240183 -0.644122 0.597943 -0.241948 -0.354445 0.642109 0.666300 0.409706
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.217134 -0.203616 -0.870785 -1.500779 1.637968 1.321238 3.696887 11.395381 0.657668 0.682273 0.411233
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.639450 23.730492 -1.047068 -0.779037 -0.594761 4.841328 -0.407348 50.332418 0.633310 0.561657 0.368650
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.581589 -0.962980 -0.725302 -1.208120 -0.676111 1.421161 0.445319 0.342584 0.671188 0.690185 0.395083
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.862369 27.683549 -0.552370 -0.660994 -0.100690 1.178015 -0.581426 -0.088640 0.673330 0.566316 0.349258
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 2.192813 0.401283 2.890952 1.894020 0.971326 -0.453706 -0.063040 -1.449942 0.682324 0.701221 0.388298
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.017632 0.861155 -0.691083 0.038357 -0.438857 1.350591 -0.172386 0.946444 0.686110 0.698523 0.397345
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.818355 0.100822 1.018899 -0.533469 4.248106 0.889096 0.389213 0.465059 0.675591 0.697291 0.394621
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 30.836530 -0.028240 1.778782 0.174944 4.600791 0.121425 18.397453 0.056361 0.525084 0.692682 0.402833
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.524259 1.043177 0.076516 0.569341 -0.495489 6.899730 4.096172 0.137596 0.672517 0.694021 0.408001
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.399618 -0.970308 -0.467140 3.433965 0.815153 -0.736119 -1.010178 1.516114 0.676767 0.670557 0.411284
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.696580 -1.068080 -0.342945 -0.844189 1.139480 0.258501 -0.302273 0.073580 0.661806 0.685942 0.414322
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.836406 -1.024013 -1.476554 -1.053701 0.388900 -0.011916 -0.647033 -1.194239 0.659202 0.683370 0.417079
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 11.329745 -0.436080 9.758592 -1.395444 8.383113 1.098149 0.429396 1.703274 0.040318 0.672700 0.582125
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.497656 0.103228 1.169155 2.788944 1.942829 25.660660 -0.494040 1.661878 0.641529 0.651293 0.398073
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.116082 12.207332 -0.610486 10.324388 0.987673 8.326284 18.587060 1.144686 0.665787 0.060395 0.584289
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.016681 -0.197196 -0.577453 -0.005835 -0.435085 0.109507 -0.617955 3.355861 0.671799 0.684067 0.400166
182 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.213679 4.446277 -1.125746 3.870607 -0.002273 3.506664 9.914267 -1.337345 0.677442 0.682099 0.402018
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.689842 0.838042 1.507648 5.385664 0.137792 -0.274319 0.499639 -0.564203 0.658508 0.635105 0.387665
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.161562 -0.225747 0.392090 3.218244 -0.450645 -1.011654 0.863822 -0.141900 0.667184 0.676708 0.389537
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 18.108185 -1.183319 7.756165 4.170109 7.736493 -1.471167 -0.305336 -0.692644 0.366977 0.655273 0.436874
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.760762 -1.442159 -0.974352 0.005835 0.761621 -0.237213 -0.321567 -0.407511 0.677687 0.694180 0.415634
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.041409 -0.422464 -0.793099 0.023825 -0.719434 1.737891 0.670606 13.157217 0.673048 0.686569 0.406044
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 9.371769 11.047758 9.004509 9.953817 8.963323 8.425658 16.602133 0.584007 0.028072 0.030813 0.001345
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.004649 -1.211009 -1.195062 0.739739 -0.429429 -1.016412 -0.419621 -1.563958 0.643991 0.673854 0.431442
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.466989 0.871344 0.804387 -0.902311 -0.305906 0.518224 5.941311 -0.068093 0.626037 0.657053 0.431901
200 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 21.823882 43.791031 4.074035 0.730466 8.542535 6.950808 1.235719 -0.265915 nan nan nan
201 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 16.510544 17.661846 3.271116 4.394221 3.646997 5.518885 -0.671883 -2.754364 nan nan nan
202 N18 digital_ok 100.00% 100.00% 100.00% 0.00% 15.896628 15.256944 1.846056 -0.665526 1.208208 0.481068 -1.013296 27.350501 nan nan nan
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 22.213045 22.571331 3.840976 4.408717 8.472208 8.349290 1.828128 1.742390 nan nan nan
205 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 16.132284 15.764862 0.789337 -1.067942 -0.596568 0.083938 -0.862511 5.763859 nan nan nan
206 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 16.167700 15.898925 1.281729 -0.382910 1.071110 -1.262098 0.280883 3.325287 nan nan nan
207 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 16.802684 15.983627 1.568968 -0.214300 1.487387 4.475600 -0.695193 -1.000152 nan nan nan
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 17.998628 21.767490 8.945269 11.522876 8.005931 9.280396 9.150107 73.663343 nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 18.049852 19.239704 8.924624 9.340504 8.599849 8.221460 8.952809 10.400309 nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 21.937568 22.044674 2.178812 3.779863 -0.575529 -0.177335 -0.323412 -0.392132 nan nan nan
211 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 15.322180 15.653404 -0.483337 0.318815 -0.878335 -1.008424 0.808599 -1.091896 nan nan nan
219 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 18.534191 17.205936 5.232774 3.747732 6.672171 4.100934 -2.926856 -2.570539 nan nan nan
220 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 15.561251 15.518967 0.664884 -0.054708 -0.529695 -1.021894 3.465414 -1.400619 nan nan nan
221 N18 RF_ok 100.00% 100.00% 100.00% 0.00% 15.409155 15.413868 -0.524459 -0.301195 -0.366331 -1.012493 2.753749 -0.994289 nan nan nan
222 N18 RF_ok 100.00% 100.00% 100.00% 0.00% 15.388046 15.746540 0.232184 0.405075 0.148432 -1.300121 3.160258 -1.507483 nan nan nan
223 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 15.973530 16.329210 -0.828873 2.017870 -0.055191 4.115830 0.835319 0.736662 nan nan nan
224 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 18.746329 18.628943 5.449143 5.069747 6.504444 6.564555 -3.037983 -3.314154 nan nan nan
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 16.155640 21.576359 1.170585 4.440895 -0.528257 8.202652 -0.912234 0.056974 nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 15.742350 16.160182 0.438198 1.417448 -0.977584 3.898065 -0.773565 -0.412784 nan nan nan
227 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 15.738755 15.870265 -0.734560 0.325389 -0.133484 -0.956501 12.596125 -0.572136 nan nan nan
228 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 20.992443 27.131465 -0.793058 -0.140583 5.175856 2.943480 50.270992 58.352825 nan nan nan
229 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 16.023308 16.011556 1.503818 1.484110 -0.100369 0.034871 8.618801 -1.899507 nan nan nan
237 N18 RF_ok 100.00% 100.00% 100.00% 0.00% 15.041887 15.008816 -0.277789 -0.853539 -0.072854 -0.398096 1.465231 -1.116377 nan nan nan
238 N18 RF_ok 100.00% 100.00% 100.00% 0.00% 15.671310 15.370218 1.190027 0.633866 -0.178917 -0.216706 -1.184398 -1.730306 nan nan nan
239 N18 RF_ok 100.00% 100.00% 100.00% 0.00% 15.566583 15.734888 0.670131 1.001220 0.151643 -0.237781 -0.065356 0.321493 nan nan nan
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% 26.137375 53.314422 2.719274 1.297801 4.544855 6.305159 3.222417 15.507326 nan nan nan
241 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 16.017201 16.169975 -0.210616 0.480503 -0.798054 -0.386048 5.545692 15.699798 nan nan nan
242 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 35.930764 16.279192 0.159021 1.459522 5.302618 0.342918 18.089712 -0.940453 nan nan nan
243 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 63.590844 15.966472 0.783519 -0.795378 8.662171 -0.660425 0.488189 -0.400254 nan nan nan
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 16.270454 15.432693 1.224997 -0.835293 2.270652 0.571513 1.805853 5.794044 nan nan nan
245 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 16.694213 16.086951 3.338248 1.011281 3.197200 0.039075 -2.072609 -0.897727 nan nan nan
246 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 21.180029 20.331672 0.129537 0.245580 4.059425 5.513309 1.675636 -1.105070 nan nan nan
261 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 16.254223 16.019097 0.939169 0.001830 -0.152762 -0.941958 -0.476760 0.452477 nan nan nan
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 18.076360 19.019210 9.087736 9.755463 8.233655 7.530553 9.997872 10.044913 nan nan nan
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 10.810894 12.251886 4.634500 6.468613 3.590909 8.423863 10.392111 1.946109 0.406507 0.048494 0.316258
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.532645 2.714341 1.751034 2.076982 0.949610 0.939038 3.391851 2.198627 0.536377 0.561976 0.396907
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.112540 -0.665546 1.835264 -0.885089 1.012503 -0.606919 -1.247248 -0.340708 0.566712 0.574904 0.406494
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.963883 -0.694731 -1.386599 0.167721 -0.473906 -1.175012 6.171238 0.076966 0.500145 0.570598 0.408828
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.144878 2.647844 -1.234356 -1.032904 -0.387952 -0.863397 0.701284 1.690822 0.500388 0.547564 0.392323
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, 7, 9, 15, 16, 17, 18, 21, 27, 28, 29, 30, 32, 34, 35, 36, 38, 40, 42, 47, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 78, 79, 80, 81, 84, 86, 87, 92, 94, 95, 96, 97, 98, 100, 101, 103, 104, 107, 108, 109, 110, 111, 113, 114, 115, 117, 119, 120, 121, 122, 123, 126, 128, 131, 132, 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, 206, 207, 208, 209, 210, 211, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 329]

unflagged_ants: [4, 5, 8, 10, 19, 20, 22, 31, 37, 41, 43, 44, 45, 46, 48, 49, 53, 61, 62, 64, 65, 66, 67, 69, 70, 73, 74, 77, 82, 83, 85, 88, 89, 90, 91, 93, 99, 102, 105, 106, 112, 116, 118, 124, 125, 127, 129, 130, 137, 139, 140, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 167, 168, 169, 181, 184, 186, 190, 324, 325, 333]

golden_ants: [5, 10, 19, 20, 31, 37, 41, 44, 45, 53, 65, 66, 67, 69, 70, 83, 85, 88, 91, 93, 99, 105, 106, 112, 116, 118, 124, 127, 129, 130, 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_2459933.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.dev11+g87299d5
3.1.5.dev197+g9b7c3f4
In [ ]: