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 = "2459930"
data_path = "/mnt/sn1/2459930"
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-16-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/2459930/zen.2459930.21301.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 1849 ant_metrics files matching glob /mnt/sn1/2459930/zen.2459930.?????.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/2459930/zen.2459930.?????.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 2459930
Date 12-16-2022
LST Range 0.228 -- 10.184 hours
X-Engine Status ✅ ✅ ✅ ✅ ❌ ❌ ✅ ✅
Number of Files 1849
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 N11, N18, N19, N20
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 92 / 201 (45.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 138 / 201 (68.7%)
Redcal Done? ❌
Never Flagged Antennas 63 / 201 (31.3%)
A Priori Good Antennas Flagged 53 / 94 total a priori good antennas:
3, 7, 9, 15, 16, 19, 21, 29, 30, 38, 40, 42,
53, 54, 55, 56, 67, 71, 72, 81, 85, 86, 94,
100, 101, 103, 106, 107, 109, 111, 121, 122,
123, 128, 129, 130, 136, 143, 146, 147, 148,
158, 161, 164, 165, 170, 182, 183, 185, 187,
189, 191, 202
A Priori Bad Antennas Not Flagged 22 / 107 total a priori bad antennas:
8, 22, 35, 46, 48, 49, 61, 62, 64, 74, 77,
82, 89, 90, 102, 120, 125, 137, 179, 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_2459930.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.063295 14.759947 8.587181 0.713655 6.456404 4.232021 1.069648 2.114483 0.033772 0.375671 0.303896
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.214870 1.114341 0.413699 1.010575 0.999893 0.247179 12.785612 2.609025 0.673098 0.678238 0.404377
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.449321 2.892994 -0.371298 -0.067429 -0.178981 1.855663 1.607642 0.104792 0.674662 0.677036 0.401681
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.565206 -1.169097 0.550468 3.058245 0.313038 2.256563 7.912323 9.803268 0.664602 0.666642 0.389435
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.190458 -1.296315 -0.924038 -0.114707 -0.285702 0.922465 2.205674 2.326581 0.672242 0.679017 0.388858
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.006894 -0.745062 7.009433 0.252141 2.861410 0.527898 0.769190 0.024815 0.516512 0.674221 0.456418
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.113582 -0.913945 1.716645 -0.749194 1.684541 1.810760 1.130207 2.012858 0.643512 0.665915 0.400241
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.245389 16.818091 8.059046 1.725480 6.459713 4.373756 0.538616 1.287291 0.032600 0.370024 0.288881
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.318557 -0.466978 8.558612 0.397379 6.463588 1.278698 1.121389 0.554184 0.033024 0.688066 0.568087
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.647581 1.875964 -0.096854 0.140983 0.164294 0.498792 3.878243 2.036434 0.677168 0.686563 0.398878
18 N01 RF_maintenance 100.00% 100.00% 42.51% 0.00% 10.948787 20.468726 8.563252 0.476194 6.549795 5.017764 0.978935 18.114445 0.029442 0.239540 0.186531
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.082938 0.020725 -0.634528 2.073250 -0.540249 52.663987 2.087781 3.171395 0.679498 0.664656 0.396905
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.378363 -0.940943 3.186521 -0.670342 -0.711029 -0.212513 1.311100 0.132332 0.661215 0.688193 0.400371
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.057098 0.189057 -0.318762 3.971320 -0.008385 -0.229457 0.966780 0.493937 0.659044 0.640771 0.395096
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.738709 -0.474179 0.392458 0.121973 2.745096 0.772796 -0.221292 -1.057707 0.619214 0.635733 0.391284
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.750883 10.786060 8.603606 9.254171 6.581848 7.073087 2.402359 1.455395 0.036534 0.040844 0.006460
28 N01 RF_maintenance 100.00% 0.00% 81.18% 0.00% 12.356998 25.706548 -0.897996 0.992755 3.367983 5.088711 2.997217 16.322263 0.383785 0.181488 0.275262
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.275069 11.241774 8.247780 8.904813 6.527829 7.054875 0.989674 0.120483 0.029713 0.037182 0.007507
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.268920 0.123290 -1.245794 0.354997 6.290361 -0.173011 2.940599 0.385130 0.685963 0.690759 0.389941
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.206448 -1.214852 0.500477 1.118042 1.614208 0.432558 1.782212 2.479294 0.689327 0.689948 0.386913
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.792679 16.715043 0.300112 2.050292 7.977554 3.660796 35.194045 37.803816 0.588991 0.604294 0.274892
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.705205 12.327606 3.644134 4.194123 6.505550 7.041762 1.248958 0.502849 0.034052 0.044916 0.006752
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.244362 0.006902 1.319735 -1.300685 1.357915 -0.988275 -1.174134 -0.668639 0.627622 0.628416 0.388035
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.127193 6.449223 -0.115302 0.209965 0.558916 1.764063 1.218351 1.006460 0.666700 0.674476 0.400236
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.553865 0.379579 -0.497135 0.567716 1.802952 0.929263 -0.389137 2.861754 0.681062 0.686077 0.404011
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.162417 0.064806 -0.105836 0.563555 0.371365 0.109243 4.773640 1.383025 0.683168 0.692460 0.403316
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 9.654834 0.364276 8.269183 0.385558 6.569972 -0.333528 2.128636 0.763167 0.039232 0.686776 0.545369
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.487787 -0.087892 -0.743010 -0.021286 0.980851 0.511095 -0.137397 0.494034 0.686382 0.694533 0.385105
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.844967 11.721829 8.814604 9.679278 6.424101 7.045684 1.732585 1.871957 0.031410 0.029511 0.002306
43 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.500553 0.693536 -0.084601 0.388123 7.284771 0.328736 0.163216 1.201674 0.686630 0.684471 0.387796
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.880128 -0.036597 -0.137722 -0.576345 -0.726767 0.097082 -0.863959 -0.784337 0.684034 0.696219 0.383714
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.653017 0.311174 -0.160829 0.348651 -0.746204 0.436996 0.210124 1.681474 0.675299 0.684106 0.380964
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.059010 1.676765 1.007847 1.989273 -0.736909 0.654939 0.308707 -1.532946 0.664946 0.687878 0.400318
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.945425 12.040400 3.480793 3.858170 6.479790 7.001349 1.334163 0.036447 0.030064 0.050514 0.012881
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.041931 0.829820 1.059801 1.736894 -0.989273 0.934981 -0.988078 -2.103357 0.630401 0.652420 0.394801
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.009182 -0.539948 -0.659668 -0.136395 -0.293393 -0.901317 0.157920 2.202170 0.581080 0.630941 0.397942
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.518746 19.021682 -0.091216 1.085999 1.400171 3.368099 32.535035 76.460362 0.655037 0.614133 0.368211
51 N03 dish_maintenance 100.00% 98.97% 0.00% 0.00% 22.617681 3.006539 11.042008 -0.689640 6.685439 4.728296 7.744762 -0.163371 0.043837 0.576930 0.446971
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.980991 6.052554 -0.809812 0.383313 0.538042 0.916443 2.279331 1.227072 0.684727 0.694655 0.392929
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.154707 2.415374 -0.424776 0.050286 0.499478 1.037170 2.384043 5.055839 0.692958 0.699935 0.398762
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.128442 11.476243 8.612785 9.462414 6.568654 7.099274 3.516948 2.138158 0.031372 0.029859 0.001469
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.581464 12.119606 8.630454 9.375469 6.561244 7.082232 1.829533 2.751020 0.027882 0.031528 0.003152
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.118260 12.228594 0.083263 9.568618 -0.332179 7.031935 0.928159 1.374937 0.687732 0.039564 0.568548
57 N04 RF_maintenance 100.00% 3.41% 0.00% 0.00% 14.350672 0.284108 7.652709 0.422368 8.231760 0.443802 8.914985 1.826258 0.319017 0.701945 0.464258
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.634953 11.161619 8.500851 9.356895 6.484734 7.039687 2.233192 1.371067 0.036688 0.036179 0.001649
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.539563 0.707805 8.085687 0.469923 6.376353 2.010123 1.031671 7.603527 0.051234 0.685350 0.541995
60 N05 RF_maintenance 100.00% 0.00% 97.03% 0.00% 0.726142 11.088734 -0.671890 9.385379 -0.176528 7.011735 0.381112 1.901452 0.668264 0.091800 0.517909
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.980935 0.878888 -0.681747 -1.276351 0.958767 -0.193388 -0.390189 -0.030428 0.607024 0.640619 0.382067
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.101185 0.991484 -0.765447 1.266768 2.861482 -0.114162 0.803477 -1.258979 0.597634 0.652892 0.396864
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.160528 11.492384 0.094140 4.224261 -0.517570 7.080162 -0.487525 1.893686 0.612481 0.044933 0.471955
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.446218 0.311269 -0.153349 -0.968489 -0.894149 -1.354513 0.154727 -0.191016 0.592695 0.597873 0.381767
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.212957 0.702200 0.141160 0.205703 0.476926 1.336561 3.156396 1.185263 0.661522 0.681952 0.409653
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.006902 1.344829 1.682661 1.781325 1.676931 0.437800 0.759195 1.423904 0.671544 0.686763 0.397602
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.949863 9.371048 1.678083 1.855393 -0.412201 0.101767 1.340843 1.632453 0.678716 0.674888 0.384284
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 21.441618 25.002384 0.737317 12.340743 3.463800 7.038156 0.762666 7.664684 0.389203 0.031487 0.285928
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.291820 -0.468345 0.038293 0.521526 -0.540469 1.211033 0.393111 0.002044 0.686806 0.699797 0.381016
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.970216 -0.165913 -0.678640 -0.172399 0.143378 0.424749 0.462190 0.153691 0.681394 0.704715 0.385343
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.208063 -0.145573 0.131136 0.936152 0.352447 0.270782 1.583302 1.151131 0.702121 0.704803 0.376928
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 2.345863 12.236744 0.382953 9.704590 -0.181914 6.970573 4.165591 0.858910 0.692478 0.036407 0.562503
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.096278 0.615038 -0.375318 1.669696 -0.271438 4.259437 0.188015 0.089557 0.697190 0.692649 0.379894
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.659195 0.827663 0.527652 -0.709195 -0.631209 1.392449 -0.762814 0.771933 0.683900 0.692361 0.376602
77 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.298662 0.621953 0.948671 0.118165 -0.846846 -0.904221 -0.529952 -1.420443 0.641234 0.645671 0.386455
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 29.328226 0.396726 -0.292072 1.356054 2.098432 0.020480 1.307093 -0.234111 0.419121 0.646120 0.392919
79 N11 not_connected 100.00% 100.00% 100.00% 0.00% 14.707724 15.155016 -0.172654 0.324912 -0.933815 -1.066003 -0.466566 -1.414949 nan nan nan
80 N11 not_connected 100.00% 100.00% 100.00% 0.00% 15.947697 21.660941 2.818058 4.445892 2.401553 6.956627 0.688236 0.882065 nan nan nan
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.576195 11.858895 -0.457491 8.116803 -0.540497 6.907807 0.170109 1.390055 0.639732 0.039222 0.484074
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.891367 -0.588013 -0.075068 1.838806 -0.446963 -0.681630 -0.480776 -0.518876 0.658827 0.666820 0.390922
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.897038 -0.351376 -0.205475 0.265658 -0.407019 -0.705313 -0.540482 0.121052 0.670989 0.685395 0.389914
84 N08 RF_maintenance 100.00% 5.35% 100.00% 0.00% 17.672046 22.298912 11.002778 11.961849 4.875283 6.969298 3.195046 3.602277 0.290062 0.037087 0.200748
85 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.060176 -0.256454 -0.090885 0.525553 8.566465 -0.513964 0.333306 -0.754319 0.687886 0.696548 0.385200
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.127069 3.192476 0.784310 0.814439 1.947786 -0.633651 1.170791 13.908974 0.676753 0.675514 0.364828
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.100000 6.726927 -0.289328 0.098557 11.250409 1.846402 4.023803 0.359100 0.662883 0.715689 0.368213
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.371407 0.354484 -0.088317 0.755891 -1.170405 -0.369187 1.850566 0.415536 0.688643 0.701864 0.367907
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.488353 -0.091581 -0.181313 0.734217 -0.851891 -0.839756 -0.586648 -0.767741 0.694751 0.702547 0.371750
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.681293 -0.395505 1.198477 1.143124 2.377358 -0.699501 0.068837 3.209385 0.680243 0.686892 0.373025
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.755397 -0.314831 -0.006765 0.278971 -0.717421 -0.649365 0.117158 -0.431131 0.678667 0.698624 0.388992
92 N10 RF_maintenance 100.00% 0.00% 17.90% 0.00% 36.416663 41.834773 0.308851 0.239973 4.137092 4.962003 1.588019 2.286333 0.300187 0.259448 0.094383
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 2.264069 0.375750 1.765818 0.228653 0.356161 0.649530 2.450560 -0.474448 0.658482 0.680210 0.397688
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.073831 11.551110 8.734439 9.266059 6.507497 7.052759 1.719399 0.998035 0.031366 0.026319 0.003091
95 N11 not_connected 100.00% 100.00% 100.00% 0.00% 14.933274 15.189470 -0.196453 0.607592 -0.556656 -0.399668 1.200248 1.368556 nan nan nan
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 20.499309 21.346486 3.808793 4.611743 6.328132 6.909938 1.495665 0.682227 nan nan nan
97 N11 not_connected 100.00% 100.00% 100.00% 0.00% 14.668560 17.382552 -0.876106 2.957030 23.147708 7.585113 0.648622 1.864099 nan nan nan
98 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.673442 3.264380 -0.249562 -0.727428 -0.310049 0.188502 1.740194 1.847368 0.635640 0.660312 0.398601
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 2.920996 -0.856466 0.520477 0.559364 -1.286245 1.550344 0.592740 -0.577006 0.633618 0.670411 0.402042
100 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 217.253108 217.039490 inf inf 3377.614835 3196.713054 5389.228125 4392.642221 nan nan nan
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.337897 7.787702 -0.667328 0.874988 0.002757 0.909133 0.206030 0.173105 0.687028 0.695990 0.384256
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.921559 1.053020 0.579284 1.943311 -0.467380 0.364338 -0.962841 2.562782 0.695054 0.690666 0.377848
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.732222 4.048086 0.478574 -0.430595 74.280475 -0.281924 2.551000 1.333449 0.677132 0.704577 0.375694
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.713568 56.020575 5.940954 6.614863 1.236490 1.828228 -0.084589 0.032219 0.639986 0.677073 0.375357
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.881401 -0.528574 -0.302931 0.713517 0.619042 -0.458596 -0.006416 -0.451471 0.697334 0.702752 0.364903
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% -0.414564 0.327274 1.114396 0.973140 2.515813 -0.463257 0.370346 6.071562 0.683813 0.701179 0.366863
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 1.899071 2.506430 -1.107879 -0.831302 -0.218279 -0.436189 14.553496 8.437039 0.691360 0.706672 0.369030
108 N09 RF_maintenance 100.00% 100.00% 0.54% 0.00% 10.223394 36.039942 8.559129 0.493851 6.506973 5.704943 1.721926 1.818450 0.037964 0.298651 0.151024
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.002878 11.188379 8.589546 9.152452 6.591535 7.104878 1.752338 2.245228 0.026660 0.026725 0.001410
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 24.545880 23.646288 11.533098 12.101042 6.483786 6.929719 3.519759 3.191402 0.024290 0.027056 0.001035
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.136390 11.091851 0.129252 9.243683 -0.144663 7.095312 5.939786 2.173547 0.661067 0.038162 0.501150
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.261246 -0.331400 -0.178839 0.006765 0.431648 1.556867 0.032810 -0.629515 0.646687 0.663778 0.414016
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 21.073298 21.397887 3.616627 4.517190 6.375735 6.965892 2.541949 1.181409 nan nan nan
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 14.658215 15.073231 -0.399794 0.030532 1.327819 -0.774710 0.413222 0.211518 nan nan nan
115 N11 not_connected 100.00% 100.00% 100.00% 0.00% 15.467205 15.776484 1.421860 1.857714 0.426919 1.092914 -0.714539 -1.328160 nan nan nan
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -1.336182 0.213626 -1.154413 -0.076826 0.231634 -0.139086 -0.087497 0.135976 0.629620 0.647297 0.396803
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.977498 12.546636 8.657532 9.692577 6.425629 7.048358 1.444765 2.666150 0.027352 0.032360 0.002983
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.064161 0.752198 -0.208223 0.555440 -0.109400 0.015746 1.815604 2.377865 0.658187 0.677953 0.395388
119 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.389749 2.295589 2.092778 2.234799 -0.197841 1.141691 1.001882 -2.090149 0.672020 0.689596 0.374117
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.026617 3.577152 -1.069039 3.230582 0.577048 -0.112792 3.827722 13.952090 0.698052 0.696459 0.373197
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.573290 5.863231 0.284594 0.681861 0.884628 0.806671 -0.071526 -0.706412 0.700314 0.709046 0.372387
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.821162 7.700518 0.208878 0.833693 0.533926 0.185732 0.312959 0.999410 0.704749 0.711901 0.373195
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -1.122560 0.244416 -0.313718 0.519432 -0.338224 -0.185330 0.568384 -0.144993 0.701726 0.710379 0.372207
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.950889 -0.474063 -0.723087 0.815485 -0.918234 -0.416546 -0.007662 -0.280920 0.695882 0.702412 0.374798
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 29.274964 1.809172 -0.240736 0.974411 4.098533 -0.028212 3.336738 0.067728 0.561803 0.695447 0.363714
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.266222 0.194206 -0.149656 0.282054 1.739633 1.279687 0.053010 3.436383 0.681475 0.699973 0.395345
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.313991 10.701657 8.645278 9.353593 6.458839 7.008048 1.114053 0.851010 0.031044 0.028415 0.001707
129 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 222.488507 222.972681 inf inf 3798.617499 3797.590346 6083.827305 6080.982465 nan nan nan
130 N10 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 14.953411 20.671294 0.316685 4.516188 -0.911100 6.308434 -0.268188 0.199705 nan nan nan
132 N11 not_connected 100.00% 100.00% 100.00% 0.00% 14.790999 14.472063 0.083353 -0.961609 -0.342589 -0.327547 -0.538192 -0.510287 nan nan nan
133 N11 not_connected 100.00% 100.00% 100.00% 0.00% 20.601268 14.717042 3.614646 -0.988647 6.402746 -0.840231 1.714871 -0.622246 nan nan nan
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.765382 -1.027540 -0.278484 -0.801498 1.310055 0.208674 7.546248 -0.432599 0.626402 0.661346 0.422063
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.245722 1.721295 8.222023 2.435265 6.560140 18.451763 1.630507 0.228384 0.042722 0.632908 0.499432
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.028529 -1.107384 -0.481945 -1.195657 0.776692 -0.582319 0.735727 1.338153 0.643938 0.672179 0.404267
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 100.00% 0.00% 0.00% 0.00% 0.918038 -0.132932 1.827053 -0.760683 0.067272 12.675868 -0.808087 6.957672 0.669033 0.668984 0.383893
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.252755 -0.571373 -1.259591 -0.082058 -0.740583 -0.783079 2.778765 1.292041 0.684397 0.704260 0.382152
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.515818 -0.556980 -0.870306 0.745325 1.236177 -1.048558 -0.368349 -1.657156 0.688823 0.707073 0.376489
142 N13 RF_maintenance 100.00% 0.00% 99.73% 0.00% 1.107272 11.091175 -1.206722 9.392269 1.238009 7.044699 14.236841 1.198058 0.691700 0.052409 0.587253
143 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 1.136717 -0.821876 5.293305 -0.114609 -0.670229 1.013032 -0.006067 -0.480456 0.636060 0.710700 0.408279
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.383838 0.149778 -0.664534 0.695450 0.770709 1.319333 -0.270206 0.362701 0.695973 0.707326 0.378747
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.436900 1.805347 -0.437071 5.142783 -0.554536 8.367529 0.012371 -0.049528 0.689553 0.655884 0.403018
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.273077 -0.967555 3.297017 0.172183 6.463526 -1.036799 0.581201 -1.037118 0.038762 0.689593 0.587255
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.776132 2.821148 0.770304 0.100960 -1.071033 1.973579 0.006698 58.282798 0.662645 0.579564 0.430823
148 N15 digital_ok 100.00% 63.93% 0.00% 0.00% 1.824164 -0.244319 5.214305 1.403475 64.191276 0.945461 21.678185 -0.685134 0.258619 0.677599 0.483010
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.675539 1.174065 -1.199736 1.883635 0.945603 0.267199 -0.501113 -1.815872 0.652901 0.672216 0.417331
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.930803 0.147895 1.753659 0.905439 0.447390 -0.866322 -1.221040 -1.328727 0.644988 0.666231 0.428210
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.785108 -0.898428 8.303298 -1.209015 6.554942 1.264701 0.890553 0.367683 0.038349 0.654421 0.517736
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.605107 10.896935 6.181588 9.165805 4.882540 7.083635 0.775855 1.422051 0.524101 0.041471 0.432830
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.031775 -0.399254 -0.448263 0.427914 -0.481191 0.145440 -0.172331 -0.275694 0.645510 0.665813 0.402918
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.236509 -0.396519 -0.930773 -0.949892 1.450706 3.494758 2.222437 10.476126 0.662918 0.681448 0.403727
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.522954 28.700434 -0.915720 -0.484092 -1.032033 1.778555 -0.396005 0.691297 0.639447 0.520831 0.356352
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.738145 -0.982500 -0.585010 -0.879328 -0.517190 1.265473 0.033816 0.263384 0.675827 0.690311 0.387322
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.869101 27.042599 -0.420854 -0.505110 0.148346 0.939846 -0.066825 0.142150 0.678548 0.568985 0.343962
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.777509 0.277571 2.591504 1.463990 0.885844 -0.444308 -0.365508 -1.566573 0.683941 0.700064 0.377711
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.144731 0.838582 -0.548509 0.359429 -0.301907 0.458403 -0.215091 0.549102 0.691521 0.699376 0.387923
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.863191 0.151650 0.940819 -0.240656 4.943540 1.069573 0.858202 0.850611 0.681114 0.697515 0.382991
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 27.345813 0.225968 1.917124 0.467702 2.328492 -0.054672 0.115899 -0.742511 0.524364 0.692837 0.386286
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.229405 7.483399 -0.701595 0.629982 0.451176 -0.797148 0.063995 -0.345560 0.678208 0.683682 0.394239
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.495142 -0.998565 -0.311151 3.388278 0.366231 -0.667352 -0.846521 1.579426 0.678080 0.670374 0.407720
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.722386 -1.042142 -0.269286 -0.435702 0.976155 0.667077 -0.008712 1.399924 0.661556 0.682799 0.414218
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.821328 -1.047079 -1.273616 -1.087872 0.055747 -0.037231 -0.680342 -1.160768 0.657157 0.678785 0.415886
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.786289 -0.446154 8.763205 -0.963684 6.409426 2.073010 1.140737 0.401565 0.040179 0.668194 0.578573
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.326322 -0.098718 0.714446 2.053550 -1.208577 1.829064 -0.294443 -0.114031 0.650498 0.661520 0.391080
180 N13 RF_maintenance 100.00% 0.00% 99.41% 0.00% 0.007406 11.868670 -0.523574 9.513586 0.157528 7.010718 16.649237 1.765418 0.670488 0.059273 0.588349
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.020576 -0.220688 -0.432393 0.295680 -0.519346 -0.033982 -0.464307 3.558551 0.676820 0.684151 0.391336
182 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.007779 3.995779 0.464811 3.152131 12.275924 2.896870 4.530187 -1.058378 0.684786 0.680414 0.396457
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.627178 0.751155 0.759305 4.526000 0.724028 -0.835111 0.440200 -0.501513 0.665591 0.640593 0.380215
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.300007 -0.233912 -0.944345 3.152631 -0.015746 -0.812695 -0.002044 -0.009763 0.676675 0.677413 0.385641
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 17.539915 -1.305497 6.967584 3.954163 5.832941 -1.208696 0.115013 -0.644736 0.380592 0.657342 0.423734
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.871524 -1.422347 -0.755247 -0.113683 0.141842 -0.742151 -0.458490 -1.448981 0.680403 0.691980 0.408447
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.197510 -0.941341 -0.647820 1.428789 -0.677025 21.603572 0.917029 14.253949 0.674706 0.678594 0.400126
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 8.782607 10.675384 8.107525 9.192873 7.053904 7.081755 16.246097 0.781490 0.028202 0.031587 0.001514
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.750897 -1.199567 -0.999165 0.387690 -0.311577 -0.983456 -0.254038 -1.352649 0.643109 0.671673 0.428110
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.370717 0.594610 0.736340 -0.531306 0.582374 0.151154 4.933374 -0.096380 0.630627 0.656100 0.430401
200 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 20.866743 41.732868 3.772089 0.469682 6.503437 6.166294 1.826779 -0.410841 nan nan nan
201 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 15.871627 16.958326 2.807530 3.585117 2.663305 4.557856 -0.123739 -2.506810 nan nan nan
202 N18 digital_ok 100.00% 100.00% 100.00% 0.00% 15.378510 14.716085 1.623541 -0.673688 0.312367 0.423735 -0.008943 28.595465 nan nan nan
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% 100.00% 100.00% 0.00% 15.435779 15.198409 0.367153 -0.074503 -0.864699 -0.479991 -0.381535 7.426261 nan nan nan
206 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 15.595333 15.436637 1.050951 0.038935 2.879977 7.327461 -0.216998 1.681630 nan nan nan
207 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 16.122759 15.445745 1.394812 0.175587 0.490223 -0.311257 -0.461077 -1.238517 nan nan nan
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 17.160354 21.043628 8.104161 9.374136 6.389452 7.472199 10.242548 40.138638 nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 17.214515 18.489231 8.137772 8.671124 6.462673 7.472639 11.765914 17.566156 nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 21.042143 21.266387 2.056689 3.608981 -0.900787 -1.077875 0.035505 -0.338213 nan nan nan
211 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 14.795322 15.087861 -0.357120 0.136075 -0.397838 -0.822082 -0.118340 -1.141371 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 100.00% 100.00% 100.00% 0.00% 15.587610 14.959169 1.121754 -0.215384 2.903100 -1.001891 31.124281 -1.013591 nan nan nan
221 N18 RF_ok 100.00% 100.00% 100.00% 0.00% 14.924490 14.829065 -0.097754 -0.456039 9.527013 -1.140165 2.711961 -0.710049 nan nan nan
222 N18 RF_ok 100.00% 100.00% 100.00% 0.00% 14.850689 15.164703 0.259947 0.152515 -0.566763 -0.841662 2.762407 -1.164052 nan nan nan
223 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 15.361369 15.633782 -0.739568 0.514350 -0.554568 15.236849 1.380854 6.273925 nan nan nan
224 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 18.003320 17.951498 4.826196 4.166805 5.508519 5.643620 -2.268298 -2.826174 nan nan nan
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 15.598649 20.748884 1.085500 4.332586 -0.675484 6.917030 -0.676681 0.578020 nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 15.213811 20.281516 0.419804 0.950359 -1.138795 2.213326 -0.410516 -0.175004 nan nan nan
227 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 15.146715 15.222097 -0.605038 0.117198 -0.368594 -0.807673 11.238330 -0.064544 nan nan nan
228 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 17.745719 23.381618 -0.731302 -0.159580 1.872755 4.380469 63.199194 88.994442 nan nan nan
229 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 15.531684 15.411248 1.621391 1.052945 0.244393 0.163789 -0.121557 -1.430959 nan nan nan
237 N18 RF_ok 100.00% 100.00% 100.00% 0.00% 14.442798 14.451945 -0.276222 -0.876627 -0.568141 -0.845163 0.007247 -0.840512 nan nan nan
238 N18 RF_ok 100.00% 100.00% 100.00% 0.00% 15.272507 15.007111 1.483552 0.782507 0.046645 -0.262189 -1.031766 -1.687810 nan nan nan
239 N18 RF_ok 100.00% 100.00% 100.00% 0.00% 15.010561 15.179559 0.591877 0.649610 -0.362589 0.091126 -0.038817 0.386833 nan nan nan
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% 24.676623 49.726382 2.325767 1.018997 7.511724 4.768885 7.487706 1.334805 nan nan nan
241 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 15.433759 15.308184 -0.096938 0.786880 -0.240948 -0.552050 6.297163 17.664225 nan nan nan
242 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 39.770045 15.696386 -0.042068 1.023976 8.772707 -0.024600 22.225434 -0.992509 nan nan nan
243 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 58.795113 15.349478 0.725455 -0.815013 5.195988 -0.464551 -0.625534 -0.337945 nan nan nan
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 15.644080 14.852654 1.165730 -0.348858 1.398960 -0.051019 1.498325 4.655957 nan nan nan
245 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 15.927163 15.407133 2.655132 0.346643 1.859030 -0.341201 -1.351340 -0.378378 nan nan nan
246 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 20.661416 19.898576 -0.244837 -0.287478 3.194452 4.719026 2.284322 -0.705894 nan nan nan
261 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 15.709683 15.419629 0.882681 -0.155489 -0.369410 -0.627314 -0.059470 -0.323089 nan nan nan
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 17.156275 18.600415 8.112902 8.955828 6.434569 6.788242 10.377912 22.897972 nan nan nan
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 10.365666 11.916377 4.321937 6.124221 2.629128 7.128487 11.786770 3.635133 0.403239 0.048754 0.311294
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.425691 2.474487 1.539430 1.601478 0.485636 0.649787 1.943345 -0.092853 0.537473 0.559637 0.392703
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.006295 -0.884108 1.616980 -0.992280 0.338605 -0.420411 -0.870301 -0.092877 0.568503 0.575132 0.402992
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.712347 -0.490239 -1.243158 -0.561606 29.172475 -0.739680 3.973790 0.465915 0.497888 0.567341 0.406717
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.688882 1.177385 -1.071514 -1.011617 -0.692005 -0.714575 1.242463 2.236536 0.504735 0.552803 0.395723
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 7, 9, 15, 16, 18, 19, 21, 27, 28, 29, 30, 32, 34, 36, 38, 40, 42, 43, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 67, 68, 71, 72, 73, 78, 79, 80, 81, 84, 85, 86, 87, 92, 94, 95, 96, 97, 100, 101, 103, 104, 106, 107, 108, 109, 110, 111, 113, 114, 115, 117, 119, 121, 122, 123, 126, 128, 129, 130, 131, 132, 133, 135, 136, 138, 139, 142, 143, 145, 146, 147, 148, 155, 156, 158, 159, 161, 164, 165, 166, 170, 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: [5, 8, 10, 17, 20, 22, 31, 35, 37, 41, 44, 45, 46, 48, 49, 61, 62, 64, 65, 66, 69, 70, 74, 77, 82, 83, 88, 89, 90, 91, 93, 98, 99, 102, 105, 112, 116, 118, 120, 124, 125, 127, 137, 140, 141, 144, 149, 150, 157, 160, 162, 163, 167, 168, 169, 179, 181, 184, 186, 190, 324, 325, 333]

golden_ants: [5, 10, 17, 20, 31, 37, 41, 44, 45, 65, 66, 69, 70, 83, 88, 91, 93, 98, 99, 105, 112, 116, 118, 124, 127, 140, 141, 144, 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_2459930.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 [ ]: