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 = "2459879"
data_path = "/mnt/sn1/2459879"
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: 10-26-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/2459879/zen.2459879.28881.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 1688 ant_metrics files matching glob /mnt/sn1/2459879/zen.2459879.?????.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/2459879/zen.2459879.?????.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 2459879
Date 10-26-2022
LST Range 22.701 -- 7.785 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1688
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 7
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 96
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 95
Total Number of Nodes 18
Nodes Registering 0s N09, N20
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 98 / 201 (48.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 147 / 201 (73.1%)
Redcal Done? ❌
Never Flagged Antennas 47 / 201 (23.4%)
A Priori Good Antennas Flagged 67 / 96 total a priori good antennas:
7, 10, 15, 19, 21, 30, 31, 37, 38, 42, 44,
45, 51, 53, 54, 55, 59, 68, 71, 72, 81, 83,
84, 86, 88, 91, 93, 94, 98, 99, 100, 101, 103,
105, 106, 107, 108, 109, 111, 116, 117, 118,
121, 122, 123, 124, 130, 136, 140, 142, 143,
147, 158, 161, 164, 165, 167, 169, 170, 181,
183, 184, 185, 186, 187, 190, 191
A Priori Bad Antennas Not Flagged 18 / 105 total a priori bad antennas:
4, 8, 35, 64, 79, 132, 139, 168, 207, 220,
221, 222, 223, 237, 238, 324, 329, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459879.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 0.00% 0.00% 0.00% 0.00% -0.663266 -0.457264 -0.151813 0.440014 0.021650 0.518013 -0.529094 2.957853 0.669102 0.670535 0.421059
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.065932 2.292183 0.648314 0.238150 -0.345964 1.277462 0.872560 -0.427999 0.667062 0.667566 0.406346
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.009648 -0.196091 -0.149590 -0.377415 -0.069197 0.207726 0.200117 -0.552126 0.671886 0.675052 0.404836
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.628015 -0.584010 0.189955 -0.070188 -0.130119 0.588627 5.112540 10.789887 0.664624 0.673647 0.408182
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.248846 2.340762 1.453347 1.544713 -1.038313 -0.886862 -1.614039 -3.703245 0.647457 0.653777 0.397094
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.158553 -0.430653 0.247622 0.535564 0.401160 0.886199 -0.145520 1.108518 0.657322 0.665807 0.412948
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.927825 -0.820743 -1.353770 -1.179517 1.526187 -0.123506 1.321381 0.540599 0.647354 0.662906 0.422818
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.844895 -0.222563 0.424265 0.075505 -0.118893 0.074828 4.837856 1.613234 0.669921 0.680566 0.408634
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.667296 -0.969383 -0.362077 0.209744 0.356544 -0.002107 1.498757 1.877562 0.671246 0.679719 0.398941
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.438179 0.468265 0.055509 -0.054962 0.524979 0.220450 0.602973 0.889577 0.672082 0.683834 0.400119
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.579433 9.170958 0.296592 0.163252 0.625645 -0.305931 17.151117 19.246025 0.645906 0.457575 0.476582
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.065260 -1.315634 0.086396 3.830903 -0.289933 0.026275 8.115501 11.558876 0.664337 0.661034 0.405764
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.689185 1.637562 -0.367367 -2.707022 -0.424440 -1.607601 1.788953 -1.258078 0.667372 0.670212 0.406744
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.675979 0.517137 -0.246242 1.797073 0.733781 -0.038066 1.398794 46.911417 0.653361 0.656363 0.413246
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% 25.307553 9.599604 -0.127696 -2.474029 5.519833 3.715605 5.649590 7.087668 0.421377 0.591788 0.337836
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.610332 9.558395 10.407392 10.796323 1.399273 1.943859 3.281331 2.121880 0.032022 0.036959 0.005229
28 N01 RF_maintenance 100.00% 0.00% 85.01% 0.00% 11.908163 23.794068 1.325416 0.739695 2.416036 5.718167 6.043214 16.628575 0.350820 0.157236 0.264596
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.209555 0.405533 -0.147686 0.534389 0.211600 0.533385 -0.130928 3.278655 0.675064 0.681137 0.394470
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.409140 -0.787983 -0.869201 0.271200 -0.151225 0.192768 5.273880 0.228865 0.675422 0.687150 0.396899
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.202567 0.509372 0.366874 0.708735 0.640808 4.195757 4.460737 4.293056 0.684051 0.681540 0.405140
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.317379 15.538562 1.299403 -0.496077 7.230880 6.806403 1.589393 3.653775 0.570248 0.606104 0.302150
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 10.129053 0.400861 4.531839 -2.788805 1.370664 4.463531 1.291464 -0.861539 0.039754 0.650222 0.442003
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 3.259053 -0.319431 1.914691 -2.161054 -0.662139 -1.462063 -3.910436 -0.636642 0.631130 0.634082 0.417932
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.512826 6.931949 0.098840 0.208081 0.029332 0.700731 1.240935 1.727930 0.661189 0.676391 0.417918
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.520781 0.377104 0.030499 0.516255 0.687146 0.288300 0.479720 13.842525 0.670701 0.684279 0.421711
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.314482 0.254814 0.117669 0.419394 0.847087 1.642906 8.124413 3.622435 0.676308 0.689471 0.419358
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.050226 0.354338 0.013214 0.292329 0.214407 0.728314 -0.406380 -0.479346 0.674165 0.683030 0.403109
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.226768 0.052336 -0.717991 -0.224058 0.961344 0.462917 -0.433843 -0.014813 0.678881 0.682731 0.389897
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 154.126591 155.133073 inf inf 3442.837792 3554.067114 9698.604740 10219.243021 nan nan nan
43 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.970588 2.741961 10.296595 0.094324 1.480532 0.144380 3.737013 4.019967 0.037142 0.686625 0.435969
44 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 19.403194 1.802848 0.431393 -0.004138 3.446393 0.337585 42.659170 6.526288 0.605457 0.685139 0.388052
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -0.506047 1.628133 0.103843 0.315182 0.845786 0.022446 0.553077 11.704041 0.674725 0.671992 0.396961
46 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.525524 10.026995 0.001743 10.843062 0.072614 2.060769 2.662547 6.095230 0.666948 0.034667 0.436245
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 183.426572 183.497601 inf inf 3116.429311 3106.960764 8461.470174 8398.200235 nan nan nan
48 N06 not_connected 100.00% 100.00% 100.00% 0.00% 185.843986 186.348445 inf inf 3075.638085 3192.645973 9616.557716 9740.606230 nan nan nan
49 N06 not_connected 100.00% 100.00% 100.00% 0.00% 183.561782 183.638240 inf inf 4172.150578 3787.187556 11361.360311 9276.701222 nan nan nan
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.636075 21.804880 0.099610 1.173076 1.397291 0.677570 5.726620 14.904522 0.650122 0.588216 0.378500
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 21.412468 0.532595 13.321277 -0.163218 1.558717 0.712387 13.063099 5.817198 0.035203 0.685413 0.473311
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.358494 5.682392 -0.035721 0.281494 1.849955 0.680316 2.088325 1.097819 0.677668 0.690664 0.408554
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.467853 2.382461 -0.288495 -0.146459 0.979106 0.402844 3.360459 8.813330 0.684383 0.696585 0.408628
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 1.501974 10.887985 0.576214 10.945887 3.588552 1.935342 3.703908 3.584472 0.674005 0.033392 0.446112
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.023594 0.502890 0.255332 0.510373 -0.014405 1.640506 0.557480 2.288275 0.678852 0.690373 0.382840
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 29.240763 1.229199 4.242570 0.349090 -0.267649 1.184155 4.297827 3.819621 0.505058 0.694052 0.395951
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.201139 10.033116 10.355047 10.989715 1.454722 2.043180 4.744588 4.050641 0.035577 0.032624 0.002223
59 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 1.864308 2.741699 -0.528269 1.037192 0.774668 0.868232 15.767572 4.780868 0.667127 0.679129 0.395778
60 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.026850 9.786104 10.388134 10.970555 1.474549 2.049510 4.144529 5.106255 0.027282 0.026807 0.001402
61 N06 not_connected 100.00% 100.00% 100.00% 0.00% 183.377062 183.153117 inf inf 3360.198718 3223.207291 9050.685456 8656.904399 nan nan nan
62 N06 not_connected 100.00% 100.00% 100.00% 0.00% 218.886948 219.116301 inf inf 4674.113652 4672.245979 13485.235096 13473.766626 nan nan nan
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 7.556836 10.142754 -2.036319 4.853467 -1.790737 1.939779 -0.196715 3.482046 0.586316 0.040824 0.407161
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.147760 -0.704950 -2.494341 -1.730653 -1.211824 -2.402414 -0.366146 -1.765688 0.600190 0.633759 0.415026
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.664220 0.728839 0.380874 0.784112 1.137322 0.839994 -0.346030 0.524062 0.649481 0.675503 0.433273
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.190193 1.057785 2.136587 1.842302 1.778184 0.525419 -0.195201 1.642290 0.655427 0.678079 0.419985
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.884852 -0.630904 1.408571 1.044612 0.456705 0.721043 0.952151 2.648593 0.664254 0.683556 0.410028
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 1.565382 23.813059 0.433062 14.480273 -0.022602 1.830221 0.493971 11.969575 0.671418 0.029202 0.473248
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.000717 -0.439376 0.249226 0.393098 0.507639 0.432949 0.419387 1.722472 0.680052 0.694094 0.393495
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.359714 -0.023651 -0.551448 -0.377044 0.737740 -0.014299 -0.196326 0.010177 0.686819 0.698292 0.393682
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 5.618258 -0.399827 0.698804 0.929628 0.371902 1.209908 0.622150 0.750780 0.691872 0.696216 0.392243
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 180.032536 177.581581 inf inf 3434.923303 3472.401855 7842.788471 8041.939138 nan nan nan
73 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.831773 9.104121 10.238370 10.673326 1.539012 1.999154 5.608237 3.272863 0.027012 0.026828 0.001272
74 N05 RF_maintenance 100.00% 100.00% 0.12% 0.00% 8.533335 7.913266 10.101563 10.009372 1.516034 1.374590 5.605734 33.774741 0.030936 0.326624 0.195002
77 N06 not_connected 100.00% 100.00% 100.00% 0.00% 218.693260 218.711173 inf inf 3761.400938 3667.560432 9781.647811 9273.856572 nan nan nan
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 28.395052 -1.130021 -1.695650 -2.226702 -0.196212 -1.629810 0.583775 0.871244 0.458093 0.647247 0.386191
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.948934 1.555236 0.931596 0.824407 -1.323913 -1.548838 -2.605009 -3.454105 0.636177 0.659162 0.416355
80 N11 not_connected 100.00% 0.53% 100.00% 0.00% 8.164821 11.237266 0.526703 4.718519 1.348253 1.955473 16.404800 1.103393 0.287240 0.037987 0.173233
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% -0.475418 -0.503602 -0.306267 5.488621 -0.427006 27.948241 -0.114138 1.162362 0.064544 0.089619 0.020637
82 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.642821 -0.376062 0.065023 1.782901 0.064463 -0.462181 0.198141 0.016046 0.071830 0.073292 0.012406
83 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.501615 -0.069559 -0.214998 0.000661 0.153758 0.976467 0.190375 0.731936 0.078966 0.073297 0.014320
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 1.559851 20.852858 5.688838 14.014365 0.680770 1.789526 24.808723 6.361583 0.638426 0.033647 0.390445
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.116993 0.915035 0.784311 0.988838 -0.194467 0.400614 -0.009328 0.481210 0.674262 0.679435 0.386983
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.889196 4.141898 1.978556 0.345806 4.285091 -1.198863 0.343269 19.435163 0.663292 0.658227 0.369764
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.927764 6.027098 1.203749 0.049713 12.831574 3.159213 7.862683 3.150780 0.602095 0.699473 0.359971
88 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
89 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% 177.632807 177.632979 inf inf 3680.750631 3635.608737 9298.239812 9050.933625 nan nan nan
90 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% 161.354700 161.382343 inf inf 2642.731995 2647.330286 8980.968156 9038.975900 nan nan nan
91 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
92 N10 RF_maintenance 100.00% 0.36% 35.13% 0.00% 33.986734 38.856980 0.387931 0.673727 1.029662 3.813740 0.365857 6.801725 0.277004 0.226770 0.096860
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 1.579145 0.368088 1.987949 0.019374 2.525705 -0.069465 5.890621 -0.415501 0.661295 0.683005 0.410369
94 N10 digital_ok 100.00% 0.00% 0.00% 0.00% -0.748100 -0.689067 0.384069 0.487545 1.252897 1.543407 2.657564 4.391608 0.661556 0.673657 0.410231
95 N11 not_connected 0.00% 0.00% 0.00% 100.00% 2.730598 2.260675 1.902224 1.570610 -0.261961 0.706599 -3.656034 -3.695475 0.228098 0.224238 -0.292725
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 9.647505 10.884125 4.322650 4.896789 1.367276 2.034150 1.907303 1.322151 0.032885 0.039287 0.004353
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% 2.131605 2.642341 1.592376 -0.425093 -0.764735 -0.621569 -2.851758 12.852976 0.619094 0.612309 0.408933
98 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 1.013887 4.946956 -0.188229 -0.019012 0.000917 0.195456 1.365566 4.785939 0.071782 0.070653 0.013399
99 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 0.755664 -0.547756 0.280336 0.663277 0.237360 3.446362 1.883875 -0.189987 0.067450 0.062618 0.008835
100 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.930817 -0.540430 -0.000661 0.867656 0.994915 -0.259103 0.612527 0.761414 0.063217 0.063019 0.008073
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.395442 7.585717 -0.663501 0.773404 0.249565 0.398128 0.174894 0.034217 0.675905 0.684093 0.399711
102 N08 RF_maintenance 100.00% 99.59% 100.00% 0.00% 9.807969 10.782092 10.120687 11.012600 1.476980 1.973510 0.961812 5.652452 0.116112 0.037597 0.048985
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 20.442545 21.283294 11.888780 12.419305 1.451331 2.153008 11.673752 10.937001 0.025864 0.028481 0.002861
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.761747 52.057251 6.754957 7.556416 -0.058742 6.531196 0.371919 0.325906 0.637827 0.662012 0.379484
105 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 208.043379 207.843661 inf inf 3832.272745 3867.474995 9982.537068 10109.929303 nan nan nan
106 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 211.857913 212.441713 inf inf 3684.881937 3687.238409 9570.105084 9479.723765 nan nan nan
107 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 178.699657 179.087641 inf inf 3473.252096 3343.718234 10388.373447 10517.408576 nan nan nan
108 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.607882 9.923461 0.514876 10.675206 0.087924 1.926393 -0.091359 2.358138 0.677880 0.033001 0.421028
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.765516 22.513933 -0.112030 14.176015 3.708084 1.760100 1.610865 5.623896 0.675121 0.029873 0.406993
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.144610 9.817821 0.443533 10.785091 0.108895 1.912739 0.350987 3.074116 0.668680 0.033350 0.417685
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.595849 -0.509096 -0.027377 -0.258868 0.325389 0.256803 0.432937 -0.136248 0.656131 0.680621 0.418467
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.372082 10.896478 4.094860 4.787060 1.370322 2.015333 2.816725 1.551530 0.037425 0.031276 0.003526
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 6.781476 2.721450 2.517459 1.209308 1.579212 -0.756720 0.882033 -3.367808 0.451216 0.645536 0.456338
115 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.027987 5.683802 0.472051 -0.152231 -1.913572 -1.641671 -3.014621 -1.315847 0.619076 0.595064 0.410920
116 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.910006 -0.090002 -0.496654 0.310889 0.934946 -0.723018 0.259215 0.212140 0.089535 0.079570 0.018898
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 9.494803 11.321427 10.438409 11.296779 1.350782 2.017032 1.842173 4.623612 0.026240 0.025236 0.000778
118 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.576286 0.546894 -0.171902 0.793583 0.839711 3.074277 0.242969 0.470133 0.064667 0.061262 0.006930
119 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 0.559176 1.611963 -1.703671 3.830066 -0.416648 5.332433 0.059569 1.579828 0.071975 0.080546 0.015525
120 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 14.010960 21.067484 -0.535292 13.933752 1.604026 1.923708 2.225179 11.265469 0.328121 0.034897 0.198907
121 N08 digital_ok 100.00% 0.83% 0.00% 0.00% 2.130735 4.079055 -0.190021 -0.029128 0.088456 1.069247 46.139957 18.026435 0.676180 0.695489 0.392557
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.685054 5.903651 1.122208 0.466044 2.224056 0.025589 2.362433 -0.426782 0.692969 0.698979 0.387680
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.103528 7.545607 0.363833 0.753539 0.336219 0.545188 -0.320295 0.292783 0.692407 0.698810 0.388907
124 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
125 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% 194.074001 194.023814 inf inf 3339.863053 3594.541521 10447.172581 10926.986516 nan nan nan
126 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.156402 -0.264370 -0.109531 0.043226 1.372860 0.361334 -0.192643 1.219524 0.681107 0.692977 0.411190
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.713182 -0.224756 1.317714 0.799726 -0.004027 0.152870 -0.073432 -0.323672 0.672617 0.688531 0.408161
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.373951 -1.460492 -0.039752 0.118121 0.107492 0.819245 -0.418432 -0.240137 0.669957 0.687546 0.414566
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 1.660962 0.516288 -0.128549 0.048966 -0.405339 0.262969 0.890238 4.444530 0.647402 0.678651 0.413427
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 9.535171 10.988951 4.371375 5.044346 1.388795 1.931155 3.387463 -0.013406 0.033563 0.037747 0.002073
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.099490 -1.121593 1.492679 -0.514555 -1.039802 -2.295204 -3.924218 -2.316574 0.625393 0.658219 0.429878
133 N11 not_connected 100.00% 100.00% 84.89% 0.00% 9.993876 15.288147 4.107552 3.453110 1.389061 2.049614 1.778190 0.974926 0.038631 0.163724 0.083330
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.990425 9.923156 0.055783 11.016137 0.446969 1.985584 0.481444 1.766426 0.619106 0.036025 0.411101
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 2.218057 0.306687 0.295130 1.076804 -0.180510 5.705074 0.471954 0.690457 0.607809 0.644604 0.421020
137 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.000717 -0.743223 -0.388468 0.469260 1.572120 2.854320 0.782283 0.928371 0.072356 0.074146 0.012108
138 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.052055 -0.200677 0.075658 0.801524 -0.097836 0.432165 4.734027 -0.358145 0.072842 0.073865 0.013394
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.172394 0.795421 2.108286 0.759708 -0.431426 -1.563879 -4.344997 -3.254741 0.650443 0.676629 0.410629
140 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 2.442196 10.642586 1.570309 10.881370 -0.965145 1.863063 -2.398858 3.228215 0.662817 0.047623 0.484286
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.852890 3.123335 -0.673676 2.001629 -0.196401 -0.226467 -0.011861 -4.438191 0.680307 0.678117 0.386434
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.663147 9.842749 0.285276 10.956237 1.322994 1.960558 2.103662 2.718718 0.678713 0.044297 0.490201
143 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 8.799472 -0.200025 10.500446 0.083537 1.322195 0.229819 0.209406 -0.536760 0.035505 0.700811 0.489978
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.483380 -0.172065 -0.307111 2.473468 -0.588409 -0.648267 -0.316280 1.489028 0.682809 0.687676 0.397974
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.992607 1.762277 -0.045727 7.632874 0.975304 13.949751 0.951879 2.298661 0.678012 0.591093 0.432210
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.288895 3.426176 -2.337281 1.868955 -0.296760 -0.330627 -0.733047 -4.539379 0.667485 0.680119 0.400890
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 218.306969 218.365346 inf inf 4657.844253 4657.058829 13342.750544 13335.686745 nan nan nan
148 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
149 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 230.600661 230.668766 inf inf 4677.092621 4675.670527 13521.347425 13513.785359 nan nan nan
150 N15 RF_maintenance 100.00% 100.00% 7.41% 0.00% 9.277913 1.426536 10.396539 0.733194 1.384787 0.379391 2.901774 -2.894257 0.042094 0.265302 0.091840
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 8.299546 -0.458733 10.051194 1.352614 1.440244 11.885199 2.460416 5.476281 0.051356 0.647240 0.475750
156 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.960978 -0.158073 9.426900 -0.352339 -0.278797 0.256365 3.020697 1.318893 0.358482 0.659854 0.501099
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.193052 -0.096646 0.169505 0.384192 -0.499202 0.223907 0.200938 0.580450 0.634586 0.664886 0.427428
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.129964 -0.367052 -0.636918 -0.828794 1.594449 0.019883 8.811678 28.013608 0.652335 0.679355 0.429752
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.210771 19.948113 -0.090668 -1.073717 -2.029038 -0.095054 -1.357993 1.414326 0.652673 0.532577 0.385208
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.675283 -0.737869 -0.506108 -0.988623 0.002107 0.282765 1.468798 0.759723 0.669336 0.688206 0.400837
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.563624 24.940365 -0.110118 -1.210764 0.629145 -1.727625 0.416821 1.474437 0.674462 0.567203 0.359350
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.735684 0.333199 -1.973054 -1.764427 0.863873 1.215541 0.371976 0.010722 0.687678 0.701793 0.398062
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.564416 -0.257618 -0.424667 0.186049 0.046960 0.027886 0.158936 1.666434 0.686984 0.696303 0.400119
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.404913 0.150466 1.789062 -0.553076 8.529386 0.346936 1.719505 3.153883 0.674544 0.701482 0.399244
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 15.794983 -0.103883 7.762826 -0.578625 0.234165 0.128922 -0.256995 -0.436448 0.398942 0.698575 0.440225
166 N14 RF_maintenance 100.00% 0.00% 94.61% 0.00% 26.313527 9.002415 1.944045 10.470056 -0.328061 1.922067 4.545995 1.283341 0.533768 0.093254 0.348962
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.623867 -0.931101 -2.688847 0.912892 0.418715 1.425208 -0.821648 5.509848 0.687773 0.691863 0.407380
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.939370 -0.770416 -0.092778 -0.352119 0.765209 0.171882 0.055251 0.338792 0.674146 0.692263 0.410963
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 12.350029 14.494207 -0.520936 0.385120 4.563268 0.170377 -1.072705 -3.042603 0.584193 0.550375 0.295552
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 9.275344 -0.268610 10.566528 -1.540448 1.385057 5.393044 1.646032 1.125350 0.038681 0.685573 0.508359
179 N12 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.419762 10.980746 10.563811 11.464753 1.352398 2.038792 1.230321 1.871261 0.046642 0.043209 0.005553
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.868310 10.494683 10.479301 11.084880 1.360335 1.989257 1.052505 2.996872 0.046428 0.049544 0.005130
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.455044 -0.189669 -0.429879 0.365128 0.421474 2.031698 -0.207083 5.216194 0.679116 0.690007 0.400569
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.829249 2.572480 5.946340 1.412282 -1.644706 -1.107675 7.952137 -2.003756 0.625162 0.686526 0.412287
183 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 9.003195 -0.730151 10.257962 -0.056872 1.366967 0.431697 0.372083 0.619617 0.042893 0.690816 0.452629
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 8.678524 10.211885 10.452614 10.961219 1.369471 1.898372 0.863415 1.132252 0.083456 0.042365 0.034707
185 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 8.140123 -1.522302 10.425183 3.507369 1.352022 -0.419835 0.601696 -0.312599 0.034781 0.682421 0.447006
186 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.360593 1.041835 3.983414 -2.001753 8.210030 0.850037 1.178518 0.781931 0.657657 0.701409 0.404954
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 2.440678 0.223508 -0.890594 -0.654631 25.531362 -2.467273 1.364226 3.848756 0.669664 0.695406 0.404861
189 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.040679 0.853707 1.364112 -0.480418 0.411177 0.151609 0.361576 -0.070515 0.652192 0.680107 0.415316
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 44.226374 10.021886 -0.643961 11.046086 1.636252 2.051855 17.513069 4.164203 0.431704 0.032910 0.284926
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.051385 -0.052146 3.910196 -0.029628 -0.817282 1.545727 14.130981 1.112072 0.623918 0.668166 0.444767
200 N18 RF_maintenance 100.00% 100.00% 56.75% 0.00% 10.110029 31.728294 4.314173 -0.911626 1.425602 3.029542 2.227046 -1.656919 0.045992 0.212215 0.131107
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.868315 3.985509 3.090925 2.448022 0.501423 0.445905 -4.889641 -4.631385 0.630219 0.651925 0.398373
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% -0.296490 1.328064 -1.420521 -0.439292 -1.884859 -1.229173 -0.332487 3.742495 0.662960 0.641620 0.399274
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.908877 3.018626 -1.506495 0.936965 -1.893704 -1.963573 -1.148748 6.671439 0.662192 0.607004 0.416437
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.086447 -0.084611 -2.529542 -2.724051 18.178323 -1.186594 -0.061121 4.867199 0.641873 0.657271 0.390424
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.103651 0.953847 -0.675306 -1.887350 -2.026685 -1.509662 -2.031896 -1.811877 0.640660 0.652609 0.381716
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 218.846853 219.165480 inf inf 3465.495006 3460.586451 8428.374118 8420.080705 nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 218.902314 219.205609 inf inf 2936.971707 2927.071462 10460.458747 10011.877816 nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 200.904312 201.157239 inf inf 3594.040290 3647.151392 8917.387062 9100.194408 nan nan nan
211 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
219 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.034806 2.826397 1.668055 1.533906 -0.994014 -0.740824 -2.487836 -4.261910 0.655541 0.664160 0.408978
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.242272 -0.673699 -0.755112 -2.548931 -0.084797 -0.713591 2.840074 -0.712339 0.623823 0.665977 0.408747
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.746391 3.110637 1.981394 1.627502 -0.488754 -0.686842 -1.711105 -4.163540 0.653121 0.667239 0.403197
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.394976 0.230575 -2.029826 -2.459393 -1.657796 -0.990101 -0.049487 2.652211 0.632774 0.661800 0.393524
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.053012 4.448541 3.292181 2.968534 0.720542 1.198338 -4.829063 -5.201270 0.640371 0.649285 0.396641
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 218.857991 219.168801 inf inf 3463.668488 3392.917703 8458.278372 7952.439502 nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 211.481844 211.768400 inf inf 3494.343031 3469.207140 8594.403718 8510.727032 nan nan nan
227 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 195.095372 194.240681 inf inf 3885.117279 4023.095118 9918.062977 10743.817572 nan nan nan
228 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 201.909926 202.352668 inf inf 3666.310534 3623.028646 10685.909997 10523.206633 nan nan nan
229 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 185.485433 185.325639 inf inf 3403.583564 3433.791592 10194.494794 10427.674145 nan nan nan
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.600785 0.896089 -0.522748 -2.483738 -0.791363 -1.674949 0.009328 -0.999408 0.597910 0.637528 0.423242
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.656984 -1.253362 -0.875650 -1.227974 -2.093194 -1.568432 -2.100465 -2.357726 0.653455 0.659297 0.417372
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.717519 0.391405 -2.472924 0.147064 -0.769888 -1.819960 0.152314 9.648477 0.647989 0.660947 0.409662
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% 211.916966 212.129041 inf inf 3479.895032 3491.943880 8545.517531 8610.240860 nan nan nan
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.471931 3.072554 -2.791874 0.309214 -1.045123 -1.598572 6.988166 30.227383 0.643426 0.609106 0.414734
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 22.932629 0.164783 -1.836832 -0.717479 -0.904810 -2.075854 0.396479 -1.798214 0.507622 0.662378 0.409398
243 N19 RF_ok 100.00% 16.00% 0.00% 0.00% 52.302463 1.169392 -0.422166 -2.302923 1.144437 -1.374656 -1.577414 -0.152431 0.288094 0.641797 0.527708
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 194.074528 194.059532 inf inf 2825.477712 2836.312887 9405.291157 9373.398944 nan nan nan
245 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 189.404404 188.835954 inf inf 3188.686605 3214.414206 9607.288493 10000.158661 nan nan nan
246 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
261 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.125068 10.743670 -0.482978 7.100507 -0.203796 1.920500 11.091198 3.771584 0.642711 0.045606 0.478952
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% -0.231809 0.817124 -0.915264 -0.408498 -1.482346 -2.086325 0.500230 -1.325839 0.546865 0.556108 0.411559
325 N09 dish_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.256333 -1.671706 -0.979830 -2.335570 -1.316825 -1.243220 2.533478 -0.612070 0.503196 0.566253 0.423986
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.756200 0.398620 -1.045776 -2.260171 -1.208088 -0.661567 3.007819 0.389747 0.511419 0.550757 0.415205
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: [7, 10, 15, 18, 19, 21, 22, 27, 28, 30, 31, 32, 34, 36, 37, 38, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 68, 71, 72, 73, 74, 77, 78, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 130, 131, 133, 135, 136, 137, 138, 140, 142, 143, 145, 147, 148, 149, 150, 155, 156, 158, 159, 161, 164, 165, 166, 167, 169, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 190, 191, 200, 201, 203, 205, 206, 208, 209, 210, 211, 219, 224, 225, 226, 227, 228, 229, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 325]

unflagged_ants: [3, 4, 5, 8, 9, 16, 17, 20, 29, 35, 40, 41, 56, 64, 65, 66, 67, 69, 70, 79, 85, 112, 127, 128, 129, 132, 139, 141, 144, 146, 157, 160, 162, 163, 168, 189, 202, 207, 220, 221, 222, 223, 237, 238, 324, 329, 333]

golden_ants: [3, 5, 9, 16, 17, 20, 29, 40, 41, 56, 65, 66, 67, 69, 70, 85, 112, 127, 128, 129, 141, 144, 146, 157, 160, 162, 163, 189, 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_2459879.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.4.dev44+g3962204
3.1.5.dev171+gc8e6162
In [ ]: