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 = "2459894"
data_path = "/mnt/sn1/2459894"
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: 11-10-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/2459894/zen.2459894.25254.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 1850 ant_metrics files matching glob /mnt/sn1/2459894/zen.2459894.?????.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/2459894/zen.2459894.?????.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 2459894
Date 11-10-2022
LST Range 22.813 -- 8.770 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
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
Total Number of Nodes 18
Nodes Registering 0s N20
Nodes Not Correlating N07, N14
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 84 / 201 (41.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 135 / 201 (67.2%)
Redcal Done? ❌
Never Flagged Antennas 57 / 201 (28.4%)
A Priori Good Antennas Flagged 65 / 96 total a priori good antennas:
3, 7, 9, 17, 19, 21, 29, 30, 31, 37, 38, 45,
51, 53, 54, 55, 56, 59, 68, 71, 72, 81, 83,
84, 86, 88, 93, 94, 98, 99, 100, 101, 103,
108, 109, 111, 116, 117, 118, 121, 122, 123,
136, 140, 142, 143, 144, 146, 158, 161, 162,
163, 164, 165, 170, 181, 183, 184, 185, 186,
187, 189, 190, 191, 202
A Priori Bad Antennas Not Flagged 26 / 105 total a priori bad antennas:
35, 43, 46, 48, 49, 61, 62, 64, 74, 79, 89,
95, 115, 120, 125, 132, 139, 148, 149, 168,
221, 223, 238, 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_2459894.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% 11.140671 -0.555307 8.382186 0.303760 9.755889 1.171336 1.387462 2.936334 0.035000 0.673711 0.485497
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.243162 1.811080 1.158873 0.059638 4.264545 17.776259 17.326623 34.335235 0.690332 0.674118 0.391877
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.476841 -0.117223 -0.505927 -0.263892 -0.149483 1.208741 1.602018 -0.014841 0.686609 0.676904 0.386182
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.157509 -0.796634 0.135793 0.306810 -0.312793 0.440199 13.221590 9.972816 0.678727 0.676204 0.379641
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.725549 -1.551079 -0.788875 -0.271394 -0.652151 0.528239 5.530972 0.409813 0.672793 0.673087 0.375608
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.824421 -0.055604 6.667699 -0.029815 4.407643 0.777224 0.622361 1.928501 0.528211 0.671652 0.446115
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.055236 -0.731274 -1.389073 -1.007495 -0.053768 2.346619 0.882310 0.661686 0.664401 0.667603 0.392443
15 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.063492 -0.245952 -0.056510 0.050220 -0.165441 0.677589 0.287448 0.943671 0.683459 0.682538 0.388991
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.104644 -1.213148 -0.605877 0.269836 0.548553 1.095560 1.762876 3.721197 0.686691 0.680754 0.381216
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.411716 0.855408 -0.295945 -0.067721 1.074584 0.209290 4.443910 4.196274 0.689312 0.687330 0.381487
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.956275 14.427934 -0.735222 0.089418 1.504674 4.697081 22.534348 33.632209 0.676740 0.473489 0.469825
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.417089 -1.377504 -0.250567 -0.395834 0.432413 5.707879 7.130425 8.766658 0.680506 0.691792 0.378491
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.821260 -1.073847 2.903996 -1.553679 -0.155044 0.263861 0.687296 -1.061798 0.671198 0.693500 0.391593
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.011769 0.499047 -0.482870 3.870353 1.436607 1.511402 0.405163 0.035475 0.671346 0.640082 0.397327
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% 34.343915 10.410542 -0.756212 -0.479291 9.135671 2.555284 12.207186 11.073037 0.467598 0.608023 0.318543
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.927041 12.572900 8.400131 9.054927 9.886269 10.569973 3.312180 2.339093 0.033539 0.037304 0.004110
28 N01 RF_maintenance 100.00% 0.00% 84.32% 0.00% 13.944478 29.754038 0.957773 0.724348 5.874180 11.299357 5.435509 23.593880 0.377221 0.165553 0.266529
29 N01 digital_ok 100.00% 0.00% 100.00% 0.00% -1.292698 13.031180 -0.445747 8.691974 0.093514 10.565006 -0.361978 0.442945 0.694336 0.035938 0.518806
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.058976 -0.616656 -0.920385 0.201025 0.110700 0.437138 11.443224 -0.088183 0.691025 0.693124 0.369643
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.153279 -1.547696 0.842742 0.784187 0.522503 2.599990 7.130291 0.872817 0.700130 0.695014 0.376037
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.522818 26.902212 -0.751106 2.044255 -0.079237 5.435887 1.082944 5.348652 0.677281 0.593677 0.355762
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 13.062590 1.488158 3.378633 -0.097435 9.830386 1.034275 1.740205 4.159673 0.044500 0.664190 0.429330
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.316737 0.490491 1.172386 -1.532640 0.005142 -1.276929 -0.611920 0.256495 0.651300 0.639404 0.386883
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.801469 8.827166 -0.283007 0.147044 0.946895 2.062397 1.727279 2.282473 0.665876 0.673442 0.395178
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.687406 0.299530 -1.593128 0.983207 1.074093 1.011680 -0.303507 6.377021 0.680477 0.684055 0.402578
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.147168 0.080055 -0.359067 0.212451 1.031195 0.418425 6.031174 1.559980 0.683936 0.691034 0.401609
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.325573 0.482374 -0.433858 0.211492 0.069005 -0.352456 -0.185642 -0.208261 0.686101 0.687822 0.381970
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.247672 -0.158515 -0.802771 -0.247603 1.434670 0.129414 0.944376 1.730698 0.693997 0.692357 0.372710
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.005969 0.933016 -0.272834 0.601558 1.146797 0.278493 0.045271 -0.199558 0.703861 0.695754 0.381283
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.396343 0.175589 0.130749 0.247864 -1.315481 0.422579 -0.990985 0.496017 0.708387 0.699767 0.375384
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.792930 -0.111387 -1.003506 0.186484 0.131675 0.920813 -0.135568 0.107238 0.705012 0.706075 0.375252
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -0.518464 1.556921 -0.317624 0.111947 -0.016167 1.482083 0.606417 4.911377 0.692796 0.687484 0.372213
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.286507 1.840509 0.820183 1.685617 -0.225075 0.162194 -0.172129 -2.657893 0.682321 0.706032 0.390582
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 12.283944 2.086619 3.214374 -1.357532 9.795254 -1.872313 1.978876 4.333441 0.039544 0.658504 0.416190
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.996892 1.257919 0.978119 1.217271 -0.289194 0.320129 -1.336435 -2.596854 0.656266 0.674517 0.391488
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.264710 0.285671 -1.563835 0.561930 -1.468783 -0.975144 0.332467 -0.737563 0.622648 0.657901 0.388125
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.101405 18.789896 -0.402850 0.861010 1.835049 9.399862 11.740545 36.297727 0.653499 0.613303 0.371999
51 N03 digital_ok 100.00% 99.84% 0.00% 0.00% 26.289555 1.007209 10.884169 0.073698 10.078133 3.069374 12.464680 8.934693 0.041664 0.684139 0.464148
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.973798 7.259291 -0.782301 0.185250 0.678930 1.320543 1.878943 2.209194 0.683550 0.693008 0.391266
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.565320 2.679661 -0.501231 -0.113677 1.267557 1.734712 4.883975 6.754572 0.692819 0.698543 0.389453
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.194772 13.325075 8.412790 9.269761 9.868258 10.593411 3.890653 2.396488 0.044373 0.043765 0.001209
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.839433 14.128054 -0.084289 9.184851 6.504554 10.606466 9.522205 4.324351 0.692889 0.035512 0.455143
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.143570 14.218133 -0.136140 9.371821 -0.367212 10.547931 0.999522 2.146712 0.699117 0.037824 0.467456
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 31.380478 -0.400567 4.570914 0.220076 3.191335 0.969156 12.258278 3.498942 0.519890 0.704228 0.381918
58 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.334833 12.962981 -0.934799 9.158009 0.697118 10.624618 3.577449 3.443407 0.699977 0.035937 0.433027
59 N05 digital_ok 100.00% 100.00% 64.00% 0.00% 11.901011 12.620430 8.345332 9.116233 9.780014 9.870649 3.613833 3.951203 0.043343 0.220341 0.124794
60 N05 RF_maintenance 100.00% 0.00% 97.03% 0.00% -1.308226 12.886497 0.065735 9.189432 -1.175938 10.547589 -0.543284 3.812928 0.701418 0.084628 0.466413
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.637106 2.548812 -1.529280 -0.031256 1.371078 -1.697362 -0.265212 3.176493 0.645047 0.639622 0.370648
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.569985 1.391801 0.245332 0.896577 -1.064904 -0.009492 -0.000337 -1.708246 0.659379 0.679779 0.378876
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.135483 13.309993 0.291221 3.963910 -0.702264 10.597666 0.220027 3.769599 0.642459 0.045994 0.416400
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.109213 0.103409 -0.892866 0.177642 -1.377819 -1.818187 0.050998 -1.322202 0.616376 0.646663 0.385680
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.121180 1.167734 -0.128714 0.628335 1.613765 1.717619 0.917337 0.319685 0.653649 0.673548 0.410973
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.084709 1.475476 1.690045 1.513851 2.553000 0.941928 0.074861 1.003122 0.660454 0.677858 0.400780
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.262066 -0.835028 0.797930 0.918408 -0.151135 0.482155 0.798810 1.959041 0.673379 0.685210 0.391982
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.035883 29.521859 0.012983 12.197220 0.085246 10.481084 2.199263 11.380354 0.686964 0.033497 0.476532
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.184295 -0.781197 -0.226757 0.371857 0.490895 1.125120 -0.119226 -0.279109 0.689627 0.698754 0.375344
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.620880 -0.320183 -0.767922 -0.308037 1.166692 1.177242 0.692434 1.078640 0.699325 0.705596 0.370871
71 N04 digital_ok 100.00% 0.00% 0.16% 0.00% 7.963108 -0.813617 0.042880 0.570023 0.795614 1.811378 2.015199 3.372609 0.709635 0.701041 0.368934
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 2.462875 -0.411898 0.096627 0.583799 0.489468 0.648679 6.040162 1.678152 0.698595 0.703421 0.361298
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.061991 0.845278 -0.822876 1.218518 0.447580 4.089514 0.777941 0.838275 0.710470 0.702596 0.370619
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.199152 1.090460 0.135565 -0.971217 -0.673588 1.613897 -1.143580 2.863042 0.707151 0.700021 0.370424
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 26.074363 28.684380 0.349456 -0.796923 3.091841 4.495903 8.124988 2.714354 0.550798 0.498392 0.201557
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 36.805569 -0.730570 -0.271987 -0.240047 3.745728 -2.569089 0.697374 -0.210422 0.479745 0.663404 0.363839
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.130204 -0.376590 -0.593255 -1.032021 -0.573885 -1.491735 0.084798 -0.747141 0.642562 0.661933 0.383713
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 9.955230 14.642844 2.426602 3.861354 7.277209 10.500224 15.028655 1.257095 0.321818 0.040125 0.192975
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% -0.533759 -0.665568 -0.588794 1.050909 -1.003415 31.501600 -0.098465 0.573583 0.066496 0.083104 0.010661
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 2.417162 1.190583 -0.271033 4.671541 -0.827992 2.120284 -0.473656 2.707550 0.070317 0.115101 0.012607
83 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.623913 -0.480132 -0.482903 -0.072991 -0.375408 -0.334014 -0.502301 0.610676 0.076924 0.082851 0.013811
84 N08 digital_ok 100.00% 49.46% 100.00% 0.00% 22.243606 26.074403 11.019856 11.808457 8.081710 10.340392 5.318409 5.863142 0.232683 0.034470 0.128108
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.498867 0.287109 -0.060179 0.873663 -0.232164 -0.106316 -0.503150 1.098015 0.685797 0.688120 0.374786
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.225628 -0.537312 0.975780 1.146649 5.073509 -0.845506 0.437380 19.949413 0.678649 0.688448 0.359916
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.004378 8.025970 0.031480 -0.334169 16.722920 1.047786 2.261285 0.763110 0.677271 0.711763 0.357576
88 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.568499 0.142656 -0.176761 0.387358 -1.059984 1.358588 5.787000 1.307239 0.691616 0.699615 0.354860
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.436858 0.240511 -0.471733 0.413268 -0.010457 0.023208 -0.565706 -0.488100 0.695051 0.700408 0.363548
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.349955 -0.491717 0.579620 0.690828 -1.338870 -0.520739 0.011818 4.204531 0.687847 0.696190 0.366739
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.535310 -0.097649 -0.231465 -0.061612 -0.626356 0.234254 -0.159049 -0.514913 0.687474 0.702216 0.377648
92 N10 RF_maintenance 100.00% 0.00% 14.43% 0.00% 42.370094 49.808403 0.088292 0.752172 8.047657 9.189978 0.627230 10.244517 0.312959 0.260521 0.100458
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 2.162650 0.381046 1.323885 0.021577 2.034780 0.585420 5.682836 -0.736781 0.679357 0.697508 0.384205
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 12.322124 -1.083660 8.525800 -0.009816 9.827772 1.939095 1.790201 2.814697 0.033947 0.691588 0.403197
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.437684 -0.382683 -0.576665 0.791063 -0.675394 -1.186231 0.064845 1.743457 0.646641 0.679431 0.391402
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.484432 14.201007 3.215940 4.025216 9.689490 10.480626 1.752637 1.046720 0.033637 0.037707 0.002453
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.210580 4.431711 0.485049 -0.012445 -0.830644 0.200056 -0.625903 10.630395 0.635973 0.610214 0.392037
98 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 1.313973 5.882873 -0.480733 -0.031863 -0.105388 1.509043 0.277538 2.270690 0.070928 0.075786 0.011654
99 N07 digital_ok 0.00% 100.00% 100.00% 0.00% 0.142506 -0.786181 0.423398 0.173039 -1.458388 3.567089 3.442752 -0.788270 0.069112 0.068062 0.009610
100 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -1.184584 -0.689402 -0.899492 0.031256 0.547728 -1.034946 1.112901 2.436221 0.060773 0.066304 0.006929
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.516370 7.429827 -0.952849 0.657556 0.323155 0.847512 -0.030108 -0.402284 0.681066 0.680813 0.386299
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.259975 0.369897 -1.138582 2.330930 0.433944 -0.247894 -0.573408 5.519495 0.690798 0.677905 0.373896
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.057391 4.939902 3.528243 0.654687 9.212383 6.133853 5.215655 14.773879 0.663864 0.692444 0.368996
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.017708 66.575043 5.520025 6.028510 1.714591 1.502782 -0.162613 0.223320 0.641440 0.673660 0.366172
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.823869 -0.563603 -0.358184 0.482938 0.222682 -0.205660 -0.387185 -0.484517 0.695347 0.696257 0.357416
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.421124 0.314133 0.253681 0.581663 0.817987 0.581687 -0.164028 -0.573965 0.682560 0.695080 0.358346
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.434659 -0.170296 -1.333424 -0.822804 0.004631 -0.422262 0.764626 2.865308 0.692159 0.700986 0.367382
108 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 11.317883 3.705861 8.346816 -0.443874 9.832937 0.545919 2.590588 1.087429 0.041461 0.701956 0.418664
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -1.058640 12.996127 0.032548 8.947435 -0.445364 10.599398 0.671754 2.458120 0.692021 0.037290 0.430138
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.312740 27.956055 -0.510216 11.949274 0.912856 10.274861 -0.232258 5.272376 0.700121 0.032825 0.427816
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.089194 12.916615 -0.087840 9.059740 -0.411011 10.593736 5.648245 2.782682 0.685162 0.037795 0.418209
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.635829 1.432537 -0.355295 -0.175763 -0.090464 0.961928 0.181024 -0.602551 0.672552 0.680939 0.388373
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.420839 14.254803 3.019603 3.928055 9.702352 10.479753 1.945676 0.743114 0.036036 0.030839 0.003404
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 6.148914 0.467064 0.435638 -0.453693 4.093328 -1.571997 1.295108 -0.689073 0.544224 0.651742 0.412146
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.370941 0.838093 2.433020 1.519535 2.415397 0.264775 -2.855087 -1.607749 0.631473 0.652561 0.406135
116 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.420541 -0.005969 -0.796493 0.297141 1.492157 -0.574264 -0.143254 -0.281201 0.086457 0.086324 0.018136
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 12.224570 14.678052 8.448160 9.491679 9.726014 10.559623 2.049259 4.237395 0.026763 0.025795 0.000957
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% -0.428993 1.001925 -0.681858 0.302605 0.756733 0.165952 2.881049 4.112334 0.065866 0.064012 0.007528
119 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.003397 2.005532 -1.546331 1.340398 -0.622586 11.310881 -0.641076 0.427964 0.071514 0.073277 0.011738
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.941156 2.523977 1.871529 1.902446 0.270788 0.873786 0.958919 -2.751868 0.665844 0.684685 0.370167
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.301212 4.857074 -0.762449 1.295569 1.052559 18.932713 19.181232 20.784561 0.693777 0.690706 0.373946
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.560497 7.603104 -1.123077 0.421333 2.597018 0.675694 0.088876 -0.769995 0.703288 0.698528 0.373022
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.979148 9.570524 -0.002307 0.627949 0.253725 1.475687 -0.468605 -0.378524 0.701522 0.701863 0.370024
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.972819 -0.560413 -0.570907 0.276919 -0.031522 0.316134 0.647134 0.364281 0.696487 0.701693 0.371933
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.019277 0.813282 -1.003284 0.381825 -0.306803 0.803335 -0.191348 -0.328980 0.691303 0.690735 0.372172
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.804592 2.739089 -1.443019 0.815918 4.902244 -0.652633 1.808793 -0.597399 0.692624 0.686146 0.380778
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.021152 -0.255451 -0.251959 0.095431 1.883137 0.918120 1.706979 3.324447 0.693688 0.703382 0.386281
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.975402 -0.419010 0.966201 0.783374 -0.539609 1.171331 -0.560882 -0.465838 0.686856 0.697868 0.383283
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.632896 -1.827060 0.205791 0.600107 -0.029299 0.503542 0.016997 3.679346 0.684622 0.695169 0.387705
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.079812 0.374765 -0.462016 0.040278 -0.234825 0.341254 1.721991 3.376787 0.666942 0.686386 0.382270
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.305516 14.358702 3.243849 4.135536 9.818387 10.520555 4.006404 -0.187046 0.034603 0.038800 0.001706
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.228744 0.810363 0.371669 -1.264084 -0.345692 -1.364736 -0.027432 0.013300 0.635761 0.639740 0.391839
133 N11 not_connected 100.00% 100.00% 82.22% 0.00% 12.839735 18.068116 3.019695 2.831615 9.825009 9.041607 2.757081 1.396194 0.040846 0.187262 0.093820
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -1.394833 12.980534 -0.212354 9.256030 0.108826 10.518082 0.106213 1.626509 0.626852 0.038947 0.415112
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 3.280598 0.045094 4.946302 2.771815 16.107421 20.599741 0.364056 -0.006755 0.547102 0.622607 0.398366
137 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.032745 -0.660821 -0.533294 -0.602916 1.848117 1.288684 0.992158 0.315997 0.073520 0.075342 0.011765
138 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.761196 -0.592976 -0.241245 0.595655 -0.588356 -0.004631 2.316612 -0.280618 0.073993 0.072942 0.013195
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.498590 -0.896900 1.510893 -0.963211 0.327504 -2.261655 -1.342787 -0.535471 0.664318 0.659861 0.380294
140 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.664831 13.619388 0.287809 9.126125 -0.654546 10.573882 2.974029 3.075605 0.680422 0.045930 0.484576
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.550536 -0.933049 -0.890442 0.491911 1.419448 -2.208702 -0.050509 -1.854115 0.683675 0.690964 0.368521
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.803768 12.836736 1.109032 9.193926 1.073311 10.581108 3.259886 2.750306 0.674982 0.042849 0.477457
143 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 11.404421 -0.685683 8.508687 0.156392 9.642597 1.506422 0.637822 -0.836057 0.028179 0.091848 0.080216
144 N14 digital_ok 0.00% 100.00% 100.00% 0.00% -0.803033 -1.065607 -0.669724 3.113829 -1.348268 -1.422068 -0.562182 -0.573314 0.095759 0.107716 0.040495
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% -1.507610 1.550197 -0.783084 5.150968 -1.089096 6.695868 -0.115915 0.099012 0.099281 0.122846 0.044257
146 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 0.333531 1.217780 -1.529503 0.856678 -0.448507 -1.194829 0.256120 -2.199507 0.101711 0.115107 0.049775
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.944127 -1.668812 0.565113 1.727211 -1.244249 -0.578466 1.777771 0.119199 0.685453 0.686909 0.375057
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.990081 -0.676173 2.460985 1.338499 -0.395625 0.919210 -0.457180 -0.691670 0.669907 0.691763 0.385950
149 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.064561 0.912667 -1.031466 1.548333 -0.980048 -0.205148 0.138298 -2.019135 0.684230 0.693698 0.387582
150 N15 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.952243 -0.364261 8.399864 -0.564568 9.823742 0.397620 2.975532 -0.074274 0.044853 0.301072 0.130595
155 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.837880 -1.222233 -0.412938 2.491863 1.282365 26.813934 2.001957 1.503302 0.628700 0.628964 0.404326
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.438017 12.482989 0.399677 8.934592 27.148895 10.562616 6.153291 0.754177 0.628963 0.038747 0.422215
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.036136 -0.313020 -0.213862 0.301274 -0.758782 1.091729 -0.266240 0.000337 0.640560 0.656230 0.399869
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.931274 -0.479998 -0.845728 -0.880880 1.784032 1.022165 3.547643 19.602276 0.658588 0.670515 0.400383
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.072346 32.999204 -1.262112 -0.793764 -1.412783 3.710095 -0.332471 6.688827 0.632919 0.510075 0.366326
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.605968 -1.227739 -0.818152 -0.762076 -0.227199 1.147230 0.449077 1.203407 0.675318 0.678643 0.377200
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.813052 31.304725 -0.626809 -0.816584 -0.383548 0.742227 0.025221 1.413108 0.678868 0.554769 0.352524
162 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 11.427659 13.769879 8.350370 9.277624 9.754059 10.505361 1.567802 1.533875 0.045118 0.050898 0.004562
163 N14 digital_ok 0.00% 100.00% 100.00% 0.00% -0.159974 1.048642 -0.726370 0.150050 -0.374617 0.618045 -0.104849 1.536125 0.093786 0.092256 0.037463
164 N14 digital_ok 100.00% 100.00% 100.00% 0.00% -0.779322 0.111722 0.653089 -0.436003 5.572451 1.253064 0.719573 0.789427 0.098720 0.093150 0.041028
165 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 34.834186 -0.179322 1.583315 0.219292 4.963423 -0.257543 1.197081 -0.621413 0.100445 0.100025 0.046325
166 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 33.674919 12.066344 -0.195760 8.796138 5.003336 10.557472 19.773540 1.536866 0.099911 0.027384 0.042725
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.516917 -1.259441 -0.815681 0.713371 1.038719 1.078146 -0.962208 3.078303 0.698249 0.690055 0.388746
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.977345 -1.114582 -0.400647 -0.679258 1.350142 0.787885 -0.450732 0.709946 0.688613 0.695170 0.387683
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.830146 1.514384 -1.386958 -1.486359 0.768184 -1.176862 -0.721890 -1.446254 0.686973 0.680324 0.389716
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 11.986568 -0.728774 8.560454 -1.259110 9.691043 11.912415 1.431862 4.125504 0.039314 0.687321 0.486277
179 N12 RF_maintenance 100.00% 97.62% 87.84% 0.00% 12.169069 13.737664 8.562843 9.580179 9.637235 10.421858 1.581925 1.854547 0.063683 0.134338 0.064639
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.518709 13.649248 8.483340 9.313088 9.712936 10.513852 1.094564 2.849599 0.047221 0.049415 0.004037
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.409366 -0.413148 -0.724865 0.076598 0.783622 1.048166 -0.289730 6.155035 0.683455 0.678796 0.385435
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.083949 4.234719 -1.062937 2.916145 -0.935449 4.066177 11.490421 -1.787771 0.689845 0.674454 0.390704
183 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 11.452121 -0.989396 7.786277 -0.731459 9.862798 0.429323 0.530888 -0.177863 0.041309 0.676938 0.448177
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 11.433359 13.314965 8.474811 9.197982 9.822379 10.547119 1.395948 1.354912 0.025688 0.025162 0.001056
185 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 9.014250 1.147600 7.825216 6.272480 9.303349 0.962029 1.266162 0.484982 0.074857 0.123058 0.052778
186 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 10.880854 1.707941 8.485025 1.901162 9.820383 0.581358 3.155404 -2.637630 0.031324 0.106839 0.061030
187 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 11.487535 1.705437 8.244984 1.522635 9.921000 -0.265135 3.013787 -0.643344 0.029909 0.110736 0.070392
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 9.582236 10.440393 1.171495 0.228438 4.387491 8.005606 1.762742 1.357795 0.363358 0.380634 0.171537
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 48.825447 13.119354 -0.347743 9.284232 5.070788 10.557780 45.871484 3.529407 0.499372 0.036510 0.338772
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.116082 0.113207 2.936944 -0.178562 -0.631533 0.416600 14.694707 0.982376 0.637504 0.668472 0.412743
200 N18 RF_maintenance 100.00% 100.00% 52.92% 0.00% 13.053716 40.484433 3.183211 0.417714 9.918494 9.673402 2.325402 2.025916 0.046931 0.223073 0.132900
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.733474 6.395410 4.712117 3.819026 7.825260 7.080190 -4.024316 -3.698632 0.636966 0.643284 0.379897
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.634401 2.372299 0.797599 -0.299490 -0.886019 -0.369438 0.348729 4.564998 0.663491 0.622289 0.393604
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 13.606948 15.187323 2.973552 3.725619 9.870537 10.564860 3.239564 4.001786 0.034087 0.041117 0.001522
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.111576 2.341177 0.681392 -1.291828 -0.979665 -0.732406 -0.943179 5.427455 0.657026 0.635966 0.392540
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.400633 0.599790 0.235307 -0.943220 20.208760 -2.317279 0.156834 4.162722 0.651671 0.642825 0.387618
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.534233 2.326991 1.393433 -0.521379 0.928598 6.701592 -1.048236 -0.935199 0.644901 0.637094 0.371706
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 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% 0.00% 0.00% 0.00% 7.637810 4.452924 4.712414 3.078411 7.895001 5.115935 -4.121766 -3.099394 0.634463 0.649985 0.395258
220 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.924058 -0.809419 0.119360 -0.330438 -1.063679 -1.718509 4.500050 -0.244088 0.657095 0.650199 0.390964
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.166193 -0.015300 -0.933596 -0.487559 0.113939 -1.642211 2.292379 -0.398042 0.619823 0.655241 0.397105
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.899438 0.924455 0.680093 -1.117602 -0.468122 26.392450 5.096313 0.799302 0.654844 0.649287 0.392072
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.660759 2.099589 -1.294143 0.829249 -1.064768 -1.502303 0.837559 -0.280704 0.637809 0.661511 0.396847
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.942637 7.022834 4.884256 4.276654 8.051088 8.457179 -4.232641 -4.384593 0.636671 0.635049 0.391856
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
227 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
228 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
229 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 6.823988 1.732541 1.028654 -1.241144 3.094850 -0.845418 2.266263 0.164384 0.521661 0.629513 0.426542
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.071876 -0.806408 1.191387 0.492239 -0.757171 -1.068175 -1.548746 -1.810507 0.656655 0.650131 0.401710
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.710112 3.440854 -0.131799 1.066243 2.058999 1.695609 0.234992 5.481626 0.648150 0.577179 0.415248
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
241 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
242 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
243 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
245 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 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.040730 13.821684 -0.740833 5.886878 -0.083875 10.649699 16.338201 5.400974 0.646430 0.048909 0.467261
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.672809 2.094191 1.199780 1.320942 0.668351 0.527703 1.593950 -0.613301 0.556688 0.557829 0.381368
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.098222 -1.271752 1.294144 -1.272422 0.638075 -0.117284 -1.434433 0.164361 0.593010 0.571903 0.394512
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.071256 -1.201870 -1.518448 -0.903084 -0.477657 -1.176133 5.691509 0.580196 0.530149 0.564818 0.389074
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.007664 0.961078 -1.230161 -1.483734 -0.434963 -1.555240 1.817664 1.498368 0.514449 0.545923 0.379196
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, 8, 9, 17, 18, 19, 21, 22, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 45, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 73, 77, 78, 80, 81, 82, 83, 84, 86, 87, 88, 90, 92, 93, 94, 96, 97, 98, 99, 100, 101, 102, 103, 104, 108, 109, 110, 111, 113, 114, 116, 117, 118, 119, 121, 122, 123, 126, 131, 133, 135, 136, 137, 138, 140, 142, 143, 144, 145, 146, 150, 155, 156, 158, 159, 161, 162, 163, 164, 165, 166, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 202, 203, 205, 206, 207, 208, 209, 210, 211, 219, 220, 222, 224, 225, 226, 227, 228, 229, 237, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 329]

unflagged_ants: [5, 10, 15, 16, 20, 35, 40, 41, 42, 43, 44, 46, 48, 49, 61, 62, 64, 65, 66, 67, 69, 70, 74, 79, 85, 89, 91, 95, 105, 106, 107, 112, 115, 120, 124, 125, 127, 128, 129, 130, 132, 139, 141, 147, 148, 149, 157, 160, 167, 168, 169, 221, 223, 238, 324, 325, 333]

golden_ants: [5, 10, 15, 16, 20, 40, 41, 42, 44, 65, 66, 67, 69, 70, 85, 91, 105, 106, 107, 112, 124, 127, 128, 129, 130, 141, 147, 157, 160, 167, 169]
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_2459894.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.dev4+g1a49ae0
3.1.5.dev171+gc8e6162
In [ ]: