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 = "2459895"
data_path = "/mnt/sn1/2459895"
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-11-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/2459895/zen.2459895.25271.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/2459895/zen.2459895.?????.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/2459895/zen.2459895.?????.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 2459895
Date 11-11-2022
LST Range 22.883 -- 8.840 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: 52
RF_ok: 19
digital_ok: 98
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 92 / 201 (45.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 115 / 201 (57.2%)
Redcal Done? ❌
Never Flagged Antennas 71 / 201 (35.3%)
A Priori Good Antennas Flagged 57 / 98 total a priori good antennas:
3, 9, 20, 21, 29, 44, 45, 51, 54, 55, 56, 59,
66, 68, 71, 81, 83, 84, 94, 98, 99, 100, 101,
103, 108, 109, 111, 116, 117, 118, 121, 122,
123, 136, 140, 142, 143, 144, 146, 147, 155,
161, 162, 163, 164, 165, 169, 170, 182, 183,
184, 185, 186, 187, 189, 190, 191
A Priori Bad Antennas Not Flagged 30 / 103 total a priori bad antennas:
8, 35, 48, 49, 61, 62, 64, 79, 89, 90, 95,
97, 102, 115, 120, 125, 132, 139, 168, 205,
207, 220, 221, 223, 238, 239, 324, 325, 329,
333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459895.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% 12.233112 -0.554801 12.291583 0.165650 10.191826 0.737505 6.014169 0.458954 0.034746 0.764167 0.546660
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.768491 1.684842 2.344153 1.188219 6.269350 18.619187 7.560013 14.107531 0.768321 0.748523 0.279755
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.388018 0.108227 -0.332325 -0.669765 -0.153977 1.039545 -0.345770 -0.697433 0.776368 0.758638 0.264062
7 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.762707 -0.820273 0.490254 0.140289 0.292203 -0.212559 1.341134 1.466102 0.762015 0.749682 0.267964
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.309380 -1.437454 -0.691841 -0.646000 -1.064190 0.005127 -0.331627 -0.168464 0.751458 0.742160 0.273213
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 2.942990 -0.538439 9.633918 -0.300286 2.220563 0.551262 2.228561 1.275964 0.649453 0.739542 0.320746
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.440206 -0.671878 -1.604391 -1.679389 -0.342108 1.441343 -0.504936 0.241342 0.736876 0.730805 0.293065
15 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.947654 -0.020647 0.269889 -0.099032 -0.186906 0.106365 -0.020439 -0.567401 0.778853 0.768342 0.255918
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.319935 -1.465374 -0.524156 0.081392 0.790178 1.198979 -0.640091 -0.032425 0.778711 0.767988 0.252864
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.271044 0.685395 0.007175 -0.354102 2.022874 -0.112789 0.158437 -0.749806 0.777284 0.766727 0.260824
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.432829 10.739037 -0.665968 -0.093932 0.530925 2.958976 0.215046 1.409287 0.766133 0.594999 0.385334
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 3.227018 -1.154212 0.078432 -0.272310 1.612684 2.130904 0.270807 0.406998 0.759934 0.761023 0.264008
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.914452 -1.020205 4.296041 -1.369191 3.027405 0.310458 5.725918 -2.766987 0.755768 0.757352 0.276639
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.138622 0.205521 -0.375325 4.992594 1.452649 5.753757 0.805651 8.899873 0.747994 0.722023 0.283326
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% 31.853578 9.902090 -0.844845 -0.005526 5.144755 2.416464 2.764147 -0.180538 0.599833 0.688428 0.231699
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.893292 13.256310 12.315953 12.592950 10.313147 11.099606 6.125321 5.594657 0.033043 0.036749 0.004378
28 N01 RF_maintenance 100.00% 0.00% 37.30% 0.00% 14.431957 29.791816 1.867850 1.052325 5.093759 9.289382 4.481220 5.559764 0.503793 0.265904 0.316525
29 N01 digital_ok 100.00% 0.00% 100.00% 0.00% -1.055061 13.764391 -0.247487 12.087879 0.317879 11.068787 -0.414675 5.493306 0.784775 0.036233 0.586528
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.512708 -0.684748 -0.901326 -0.009665 0.278323 0.120675 -0.130320 -0.151764 0.776077 0.773370 0.249389
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.798035 -1.531343 1.392743 0.855811 1.924845 1.291166 2.348737 1.463259 0.783440 0.773665 0.256393
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.357328 26.057454 -0.585143 2.546353 4.446570 2.598425 -0.059215 4.341352 0.765044 0.712413 0.241167
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 14.110200 1.446104 5.342115 0.467150 10.231547 -1.221284 5.989262 -0.242090 0.043637 0.728513 0.422750
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.251560 0.042691 1.666127 -1.385207 0.430998 -1.434861 0.476030 -1.038299 0.720250 0.715468 0.296501
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.820094 9.098639 -0.065313 -0.080142 0.926997 1.821656 0.004331 -0.373103 0.767597 0.765413 0.260515
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.512482 0.226921 -1.926603 1.063206 0.199962 2.332453 -1.906762 1.658296 0.776700 0.773515 0.260877
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.055901 0.338712 -0.164870 -0.047278 0.312001 0.631353 0.661309 -0.097560 0.782900 0.779139 0.256150
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.268529 0.531409 -0.222908 0.038958 -0.380275 -0.319314 -0.361880 -0.462337 0.782625 0.776128 0.249476
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.310818 -0.396979 -0.810060 -0.551787 1.162631 -0.619588 -1.127134 -1.070919 0.786449 0.778083 0.247281
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.095269 0.603886 -0.041890 0.578600 1.193069 -0.115278 -0.213482 0.398359 0.790720 0.780375 0.251191
43 N05 RF_maintenance 0.00% 7.73% 5.19% 0.00% -0.521569 -0.371653 0.237430 0.050300 -0.747636 0.469464 -0.855493 -0.239900 0.670148 0.673921 0.242134
44 N05 digital_ok 0.00% 7.62% 5.24% 0.00% -1.744435 -0.386497 -0.581403 -0.788699 -0.851698 0.133784 -1.838827 -1.077468 0.668474 0.676383 0.243683
45 N05 digital_ok 0.00% 7.62% 5.30% 0.00% -0.164662 2.147958 -0.073318 -0.182924 -0.376783 2.513234 0.034840 -0.127966 0.666395 0.662991 0.240938
46 N05 RF_maintenance 0.00% 7.62% 7.03% 0.00% -1.134336 1.337545 1.462423 2.947364 0.138666 1.594163 2.303339 1.794593 0.661301 0.655104 0.258477
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 13.262705 2.215990 5.113786 -1.209941 10.195454 -2.365574 5.992977 -1.741069 0.038499 0.732924 0.407870
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.168542 1.064643 1.406688 2.308969 -0.267190 1.429695 0.716946 0.764687 0.727637 0.736956 0.298108
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.273318 0.781429 -1.247715 2.045827 -1.595161 0.289243 -0.960186 0.020885 0.710278 0.723259 0.295721
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 23.764822 1.013369 0.330096 0.437936 6.721391 1.672050 7.807973 1.758726 0.704187 0.755285 0.248177
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 27.104003 0.813401 15.758257 -0.230370 10.369836 2.726413 6.131501 0.073276 0.048433 0.770928 0.509925
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.071600 7.591976 -0.730701 0.006635 0.413152 0.785186 -0.780745 -0.620392 0.779403 0.777251 0.254504
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.589262 3.115737 -0.373113 -0.445589 2.163161 1.582136 0.008156 -0.518718 0.786757 0.783578 0.248916
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 12.205340 14.061015 12.330571 12.887876 10.280661 11.063884 6.120106 5.566829 0.045355 0.045138 0.000931
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.053404 14.174389 -0.542112 12.067754 5.302465 11.112649 0.334475 5.715539 0.786046 0.037161 0.486415
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.475832 14.945801 0.157664 13.031277 -0.113341 11.007144 0.532969 5.531040 0.789273 0.038330 0.495659
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 30.153711 -0.674989 6.810155 0.077812 4.409207 0.492788 3.608939 0.177931 0.653199 0.787269 0.256987
58 N05 RF_maintenance 100.00% 7.62% 100.00% 0.00% 0.136274 13.697836 -0.941827 12.735456 -0.298723 11.028019 -0.583774 5.547025 0.675822 0.033224 0.383788
59 N05 digital_ok 100.00% 100.00% 29.30% 0.00% 12.745451 12.503371 11.585061 11.979873 10.074397 9.717152 6.035814 3.855911 0.047906 0.319712 0.180608
60 N05 RF_maintenance 100.00% 7.68% 77.24% 0.00% -1.115743 13.578133 0.140555 12.774391 -1.206495 10.923680 -1.108738 5.417940 0.665498 0.132858 0.401389
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.244101 2.258189 -1.797086 -0.285768 -0.005127 -1.740467 -1.968732 -1.084498 0.738691 0.732485 0.266379
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.682899 1.089588 0.408660 1.909809 -1.323271 -0.114205 -0.053182 0.784634 0.737206 0.747863 0.282751
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.139794 14.077636 0.460957 5.523851 -0.139902 11.105419 -0.445627 5.672826 0.723641 0.044858 0.402482
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.184034 0.061436 -1.126160 0.930193 -1.444932 -1.665608 -0.934041 -1.244398 0.705251 0.720753 0.295931
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.234869 1.503353 0.201850 0.565310 0.898715 1.062573 0.643488 0.644763 0.750926 0.759108 0.281209
66 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.588796 1.560557 2.560324 1.774346 4.285412 1.307906 2.987683 2.348764 0.760320 0.765346 0.266238
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.724626 -0.688655 1.430941 0.978625 0.309607 1.129378 2.182952 1.662892 0.772712 0.772592 0.255218
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.554008 30.017622 0.423779 16.948290 0.236871 10.835519 0.790939 5.641961 0.781725 0.036789 0.527211
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.005398 -0.798187 0.061573 0.181271 -0.227166 1.140050 0.241745 -0.155939 0.783137 0.780550 0.243572
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.542113 -0.644894 -0.695140 -0.701816 0.992891 0.509378 -0.948441 -1.146375 0.787501 0.785263 0.242199
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 8.354895 -0.590360 0.423339 0.525253 1.019425 0.734032 0.803785 0.540436 0.795557 0.785532 0.239896
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.857979 -0.109758 0.536141 0.593138 0.200345 -0.096085 1.354185 1.147461 0.789952 0.787751 0.237158
73 N05 RF_maintenance 0.00% 7.62% 5.03% 0.00% -1.124750 0.989171 -1.049871 1.424187 -1.274173 3.805956 -2.099002 1.888886 0.677411 0.684089 0.240114
74 N05 RF_maintenance 0.00% 7.68% 5.14% 0.00% -1.248009 0.809652 0.249776 -1.566382 -0.769699 1.224628 -0.760757 -1.936597 0.671597 0.675790 0.240986
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 25.347588 27.006485 0.527371 -1.008635 3.046370 3.016590 2.658706 0.766565 0.653666 0.622422 0.166752
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 34.454950 -0.693855 -0.223424 0.334965 2.889985 -1.840357 1.740239 -1.031909 0.603209 0.741565 0.272345
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.483357 -0.380451 -0.723367 -0.719989 -1.461453 -2.473993 -1.479063 -2.557650 0.730651 0.743142 0.283961
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 11.165588 15.349558 3.262942 5.379268 7.385806 10.984688 5.710328 5.499954 0.433101 0.038914 0.268311
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% -0.426806 -0.157767 -0.505171 0.370806 -0.741550 35.104831 -0.608376 0.470383 0.060386 0.079094 0.004414
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.201055 10.315276 -0.055540 10.111478 0.577766 7.443122 0.049233 1.739353 0.072270 0.116768 0.030470
83 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.604341 -0.459313 -0.312730 -0.318271 -0.064829 -1.127343 -0.526186 -0.399471 0.086007 0.091081 0.010206
84 N08 digital_ok 100.00% 18.05% 100.00% 0.00% 22.134080 26.606322 15.854238 16.395579 7.188144 10.816966 3.167146 5.520056 0.438647 0.035667 0.226927
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.750103 0.283686 0.467489 0.872537 -0.169740 0.182521 0.536788 0.804921 0.779391 0.773179 0.244083
86 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.699010 -0.022131 1.811424 1.323966 2.598179 -0.138535 1.294558 2.369170 0.775923 0.773023 0.237109
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.227444 8.364651 0.456490 -0.684003 15.112938 0.103034 0.615121 -1.155608 0.776555 0.787221 0.233652
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.397336 0.520435 0.113369 0.339868 -0.487053 -0.295435 0.492258 0.269083 0.784481 0.781431 0.233385
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.388311 0.495443 -0.263518 0.355121 -1.217728 -0.503461 -0.335805 0.021137 0.788075 0.783229 0.238734
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.269843 -0.527864 1.077734 0.715389 0.598604 -0.680561 1.291921 0.931331 0.784856 0.781334 0.237722
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.345962 -0.170348 0.067002 -0.323384 -0.894543 -0.269253 0.386712 -0.284233 0.782748 0.785565 0.246347
92 N10 RF_maintenance 100.00% 0.00% 13.03% 0.00% 41.602539 49.191280 0.583938 0.998404 7.761637 8.434553 4.231452 4.140530 0.450525 0.397257 0.090217
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.554667 0.030151 2.236233 -0.217321 1.826238 0.584709 3.354812 -0.137661 0.773154 0.779179 0.259309
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 13.386607 -0.831052 12.485430 -0.256600 10.212463 0.589570 5.990935 0.235760 0.033288 0.772889 0.416245
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.691551 -0.180411 -0.732994 1.734579 -1.670251 -0.132043 -1.364474 0.388515 0.736845 0.753934 0.286137
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.545036 14.879020 5.117509 5.608208 10.089610 10.954293 6.003742 5.504951 0.033190 0.037176 0.002422
97 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.003575 3.380280 0.738104 -0.262184 -0.824811 -0.809982 -0.835825 3.443037 0.726124 0.714000 0.289350
98 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 1.421113 6.152297 -0.291654 -0.284266 -0.590498 -0.147253 0.404782 -0.740048 0.064699 0.072007 0.006132
99 N07 digital_ok 0.00% 100.00% 100.00% 0.00% 0.005398 -0.646707 0.915915 0.039225 -0.061061 2.013098 0.849416 -0.062817 0.067113 0.066392 0.004735
100 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -1.429917 -1.082378 -0.084009 0.642629 0.704601 -0.350262 -0.206774 0.331081 0.060074 0.071057 0.004338
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.558008 8.131575 -0.940020 0.644625 -0.186029 1.089810 -0.847987 0.463078 0.765899 0.759871 0.264530
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.317423 -0.499222 -1.459072 2.901107 -0.466825 0.641358 -2.162601 3.719898 0.772986 0.761253 0.251373
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.132263 5.537684 5.623542 0.693336 5.423928 1.184585 5.174363 2.004407 0.761835 0.772507 0.240550
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.158071 62.789931 7.982963 8.062872 1.810579 1.376142 5.381564 6.157968 0.751278 0.767968 0.239037
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.642208 -0.216824 -0.140876 0.420140 0.672690 -0.566624 -0.008156 0.270279 0.785387 0.776453 0.233801
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.101369 0.741620 0.761852 0.589952 -0.676291 -0.577096 0.713180 0.379087 0.782366 0.777201 0.235122
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.416732 0.045182 -0.664333 -0.579593 -0.332866 -0.969099 -0.159604 -0.637634 0.786704 0.781036 0.236787
108 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 12.361922 3.662802 12.242575 -0.871807 10.235613 0.310602 6.036162 -0.800380 0.043136 0.783727 0.417251
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -1.514691 13.699048 0.422654 12.443715 -0.110903 11.089031 0.632287 5.552110 0.783070 0.038665 0.453003
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.315323 28.537676 -0.371255 16.609579 1.072529 10.755132 -0.076600 5.349102 0.785357 0.033385 0.449285
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.250463 13.562530 0.199016 12.571612 -0.046484 11.081930 1.736875 5.569632 0.774522 0.038301 0.446589
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -1.332798 0.856968 -0.148719 -0.524955 -0.089679 0.224203 0.284753 -0.522345 0.764293 0.766288 0.267654
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 14.400247 14.938661 4.842829 5.472301 10.102827 10.971479 6.016907 5.491749 0.035112 0.030682 0.003001
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.269009 0.522183 0.932302 0.080984 0.770401 -1.875776 0.098489 -2.195424 0.681569 0.740534 0.289412
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.543469 0.597886 3.359984 2.755714 3.142105 1.184660 2.047000 0.687672 0.716436 0.733801 0.308388
116 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.145449 0.485753 -0.683469 0.109406 0.063970 0.389913 0.375382 0.874409 0.085451 0.084056 0.010629
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 13.254545 15.286427 12.383589 13.199927 10.132184 11.027967 6.021123 5.657132 0.026705 0.025801 0.000748
118 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.438683 0.795900 -0.557072 0.171960 -0.338569 -0.604427 -0.231030 0.081647 0.067325 0.067650 0.004126
119 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.109730 1.318480 -1.241175 2.311511 -0.374356 9.499733 -1.388846 2.055297 0.071625 0.074490 0.005865
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.439139 2.109511 2.911340 3.248053 1.432816 2.216509 3.462984 2.307360 0.757016 0.745051 0.262632
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.398870 5.651633 -0.571902 0.725232 0.744686 0.932395 1.552289 2.144026 0.775656 0.768573 0.249546
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.281817 7.991479 -1.023853 0.308619 2.352548 1.063280 -0.675044 0.395041 0.783701 0.772982 0.243800
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.430113 9.836749 0.353332 0.623353 1.052659 1.022616 1.119899 0.980138 0.787813 0.779408 0.238766
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.995698 -0.705997 -0.437379 0.101244 -0.488135 0.071199 0.094519 0.324934 0.785948 0.778966 0.239265
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.250637 1.706767 -0.947309 0.285729 -1.196197 0.583497 -0.745235 0.087483 0.784671 0.774113 0.240335
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.610057 3.577723 -1.418124 0.920537 6.777786 2.026724 -0.712510 0.871038 0.782495 0.772253 0.243425
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.105777 -0.288518 -0.050500 -0.150198 2.254185 2.055562 0.079790 0.077018 0.785374 0.784025 0.251258
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.772243 -0.881817 1.643827 0.771659 0.256033 2.026798 2.121616 1.370949 0.781839 0.781721 0.250048
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.604618 -1.158008 0.632444 0.551290 -0.052807 0.145595 1.218656 1.159301 0.778884 0.780040 0.258505
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.058560 -0.085041 -0.310827 -0.224377 -0.426105 0.558358 0.330560 0.412503 0.764659 0.772511 0.261943
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.378876 15.081433 5.155754 5.761340 10.227232 11.010898 6.117297 5.426754 0.033797 0.038553 0.001521
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.908277 0.439344 0.570213 -1.970057 -0.478527 -1.863822 -0.702679 -2.158773 0.734276 0.739277 0.282468
133 N11 not_connected 100.00% 100.00% 35.24% 0.00% 13.878479 18.845327 4.843674 3.899285 10.189169 9.052750 6.005412 3.991530 0.040230 0.333784 0.187363
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.912037 13.693250 0.014676 12.872625 0.808561 11.015884 1.628119 5.530856 0.711913 0.038891 0.434288
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 2.693108 -0.221556 7.451027 3.725601 14.762803 19.209046 3.694076 4.301343 0.658509 0.707424 0.295453
137 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.092253 -0.541065 -0.445978 -1.069953 2.060562 0.135892 -0.095905 -1.315257 0.075116 0.078715 0.007174
138 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.930202 -0.377257 0.854264 1.396035 0.393837 0.293794 1.926951 2.111953 0.072777 0.074308 0.006046
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.077937 -0.682103 2.099340 -0.678765 1.146267 -2.594475 1.344470 -1.950469 0.736958 0.731839 0.283460
140 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.513600 14.310756 0.456112 12.691557 -0.601732 11.073574 -0.140037 5.559930 0.755577 0.050010 0.502535
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.349884 -0.974567 -0.890219 1.333420 1.077812 -0.886836 -0.320096 0.016005 0.767257 0.752351 0.256701
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.490958 13.558778 1.506062 12.789982 3.123443 11.058918 2.202181 5.563406 0.767890 0.046131 0.515952
143 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 12.460115 -0.874288 12.467566 -0.089420 10.069966 1.552814 5.989581 0.241717 0.028427 0.092965 0.084965
144 N14 digital_ok 100.00% 100.00% 100.00% 0.00% -0.709229 -0.678026 -0.583077 4.109040 0.650372 2.591040 -0.097579 5.344320 0.100101 0.110242 0.025079
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% -1.367757 1.010433 -0.794820 6.911587 -0.936273 5.319509 0.114957 5.750647 0.106701 0.128135 0.027789
146 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 0.318098 0.958281 -1.726955 1.833703 -0.421830 -0.171725 -1.884193 0.484220 0.111431 0.128244 0.034592
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 224.925303 225.068408 inf inf 5576.974809 5526.196934 791.965350 772.526005 nan nan nan
148 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 245.956460 247.214720 inf inf 6079.969636 5535.996723 1042.922523 983.437738 nan nan nan
149 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 266.596023 266.526299 inf inf 6486.936253 6429.425069 566.945398 517.261613 nan nan nan
150 N15 RF_maintenance 100.00% 100.00% 0.00% 0.00% 12.965123 -0.229213 12.316255 0.023556 10.232181 0.305068 6.032438 2.232119 0.052539 0.516104 0.304613
155 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.527975 -0.627159 -0.287696 3.158758 1.376784 22.727848 2.354532 3.896634 0.707183 0.703682 0.311773
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.036303 13.219494 0.385460 12.424337 7.653622 11.081385 2.441877 5.537330 0.712114 0.038912 0.443042
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.125999 -0.357298 0.056920 0.177606 -0.140469 0.886378 0.922290 0.622471 0.720847 0.724906 0.296221
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.963069 -0.746841 -0.871206 -1.533517 1.843911 0.523243 -0.125157 -0.484893 0.736446 0.735447 0.292119
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.120871 32.096685 -1.688926 -0.852633 -1.510431 2.446577 -1.890847 0.600901 0.718898 0.600836 0.269063
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.267811 -1.319866 -0.780958 -1.337388 -0.718975 0.387727 -0.130791 -1.562152 0.756727 0.748423 0.264450
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.886713 30.329330 -0.528306 -0.894821 -0.589332 0.541291 -0.198562 -0.101584 0.762693 0.654862 0.245017
162 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 12.494064 14.503678 12.248874 12.903994 10.177278 11.002119 6.024348 5.525355 0.046401 0.054189 0.005144
163 N14 digital_ok 0.00% 100.00% 100.00% 0.00% -0.072995 1.240408 -0.659617 -0.086789 -0.333897 0.479964 -0.414369 0.109739 0.093282 0.091406 0.020982
164 N14 digital_ok 100.00% 100.00% 100.00% 0.00% -0.672410 0.008975 1.576434 -0.870567 4.957706 0.498119 2.358519 -0.993200 0.101350 0.095241 0.023876
165 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 30.404615 0.106547 2.677708 0.009606 4.275743 0.116729 2.142166 0.859746 0.112955 0.101729 0.027906
166 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 30.649911 12.829357 0.237213 12.236892 3.827346 11.048214 2.948394 5.567914 0.109762 0.027695 0.046899
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.620914 -1.094278 -1.014893 0.737905 -0.941520 0.921373 -2.114831 1.910292 0.784028 0.773889 0.258131
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.870491 -1.096282 -0.237212 -1.199906 2.194440 0.623176 0.443618 -1.230230 0.782707 0.775480 0.255024
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.813274 17.555812 -1.565663 -1.351989 0.238517 11.342836 -1.211078 -0.312329 0.780348 0.730618 0.268182
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 13.050955 -0.796223 12.538997 -1.555683 10.109164 1.501876 5.995258 -1.032934 0.038565 0.772618 0.533191
179 N12 RF_maintenance 100.00% 87.41% 42.86% 0.00% 13.212820 14.126301 12.541870 13.289665 10.013020 10.315342 5.923435 4.438885 0.114113 0.265884 0.146882
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.594007 14.404404 12.433103 12.952443 10.135460 11.014091 6.014382 5.599992 0.049226 0.052055 0.002574
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.323263 -0.669055 -0.670217 -0.152350 0.750165 0.034414 -0.226890 0.316432 0.759534 0.746601 0.269760
182 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.032248 3.382435 -1.393256 4.607748 -1.666882 5.188241 -1.231508 3.701066 0.765705 0.725627 0.294248
183 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 12.710855 -1.356973 12.136679 -0.399673 10.316352 -0.253558 5.951299 -0.534446 0.040189 0.749959 0.468548
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 12.510110 13.994474 12.422251 12.793133 10.195128 11.017411 6.001256 5.518494 0.025656 0.025090 0.001065
185 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 9.026265 0.271646 11.408774 8.421256 7.954326 1.788655 2.891430 5.775382 0.099979 0.127500 0.040362
186 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 11.953638 1.279321 12.436779 3.252624 10.174676 1.763974 6.041156 2.147776 0.034604 0.117905 0.060612
187 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 12.507055 1.174429 12.101229 2.739876 10.263488 0.626984 6.062440 1.780636 0.031439 0.123093 0.069550
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 9.666132 9.904223 2.208552 0.483178 4.439087 5.814401 4.025206 3.537792 0.493141 0.501542 0.137061
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 43.906696 13.818710 -0.341576 12.913508 3.833673 11.058819 4.457257 5.606631 0.654475 0.038254 0.446180
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.300143 -0.449298 4.332585 -0.504116 2.237831 -0.176469 6.551817 0.273261 0.754885 0.762284 0.267492
200 N18 RF_maintenance 100.00% 100.00% 32.43% 0.00% 14.116576 40.499060 5.071241 1.059311 10.334782 9.616761 6.030970 4.330134 0.045950 0.323835 0.199213
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.493739 5.531031 6.430571 5.839188 8.558008 7.988881 5.547058 4.691948 0.694976 0.694066 0.306782
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% 0.805137 2.083544 1.158314 -0.651777 -0.035440 -0.801625 0.488788 -1.625033 0.742800 0.708947 0.284112
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 14.702066 15.905049 4.779273 5.194339 10.254265 11.040665 6.026973 5.575982 0.033752 0.041977 0.001966
205 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.954671 2.312184 0.983638 -1.913641 -0.127450 -1.523124 0.482657 -1.682827 0.744873 0.723429 0.273393
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.575620 1.161133 0.870424 -0.620371 18.673711 -1.759537 -0.778516 -1.470861 0.749811 0.728330 0.267115
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.343243 2.396863 1.950381 -0.007175 1.563766 -1.166782 1.306811 -0.886095 0.739687 0.727736 0.260432
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% 227.959930 228.326369 inf inf 5937.897547 6248.610586 829.658680 898.391281 nan nan nan
211 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 266.695898 266.595288 inf inf 5878.016023 5863.336356 896.078736 890.980008 nan nan nan
219 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.306917 3.669175 6.432567 4.827312 8.525395 5.844405 5.454517 3.628824 0.690863 0.700239 0.322658
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.599693 -0.677104 0.215835 0.235267 -1.142933 -2.163515 -0.659092 -1.275184 0.736013 0.717749 0.285309
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.003821 0.112881 -0.923237 -0.014239 -0.331647 -1.152672 -1.584752 -1.361020 0.720844 0.723455 0.275452
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 1.269406 1.056872 1.013220 -0.147406 -0.760833 9.397937 0.639854 -1.430787 0.739578 0.726264 0.279006
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.613310 1.901656 -1.696715 1.840960 -0.715127 0.178697 -1.796913 0.774888 0.735176 0.728041 0.275126
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.561803 6.045855 6.652280 6.460643 8.779053 9.162643 5.646305 5.094908 0.709164 0.695815 0.304669
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 265.531879 265.728773 inf inf 7349.365209 7349.003785 593.971275 593.526137 nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 228.578312 228.320949 inf inf 5690.153685 5670.839219 757.188977 741.378197 nan nan nan
227 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 248.369959 247.643994 inf inf 5599.594727 6026.774480 756.173646 845.715534 nan nan nan
228 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 245.069293 245.096042 inf inf 5541.691608 5545.800104 751.355341 762.257665 nan nan nan
229 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 248.945175 248.409864 inf inf 5940.774119 6296.852973 850.441672 925.667954 nan nan nan
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 6.390213 1.775203 1.873826 -0.994848 1.435549 -1.944398 -0.075685 -1.582985 0.637604 0.693891 0.311155
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.067078 -0.413106 1.683965 1.367285 -0.074202 -1.084910 0.535549 -0.107155 0.733142 0.713520 0.296930
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.552295 2.689784 -0.276689 1.266572 -1.611190 -0.879149 -1.202302 -0.141776 0.736016 0.674054 0.297846
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% 228.247312 227.479410 inf inf 6058.983786 6460.641973 830.131946 784.600735 nan nan nan
241 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 227.711489 228.181289 inf inf 6304.068054 6660.689224 667.716662 651.938887 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% 189.530444 189.527622 inf inf 4708.814867 4788.750703 762.230173 784.379026 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% 269.126835 269.263901 inf inf 7344.935787 7343.276403 936.334479 948.368674 nan nan nan
246 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 251.642955 251.653114 inf inf 5910.445360 6073.238897 680.158624 698.302600 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.550966 14.459533 -0.667524 8.193316 -0.596609 11.075890 -0.028285 5.622648 0.753590 0.050214 0.520074
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.484334 1.731954 1.771585 2.483753 0.253021 1.042196 -0.517228 -0.179932 0.660269 0.642515 0.296056
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% -0.422024 -1.194324 1.867658 -0.997282 0.669290 -1.250599 -0.806856 0.595127 0.704133 0.673203 0.285606
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.726234 -1.234325 -1.614154 0.220591 -0.191313 -1.692167 2.353589 -0.944414 0.636146 0.653076 0.308674
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.258349 0.850583 -1.405610 -1.205640 0.391572 -0.782689 3.328863 0.652875 0.587037 0.610996 0.330630
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, 9, 18, 20, 21, 22, 27, 28, 29, 32, 34, 36, 43, 44, 45, 46, 47, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 63, 66, 68, 71, 73, 74, 77, 78, 80, 81, 82, 83, 84, 87, 92, 94, 96, 98, 99, 100, 101, 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, 147, 148, 149, 150, 155, 156, 159, 161, 162, 163, 164, 165, 166, 169, 170, 179, 180, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 203, 206, 208, 209, 210, 211, 219, 222, 224, 225, 226, 227, 228, 229, 237, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320]

unflagged_ants: [5, 7, 8, 10, 15, 16, 17, 19, 30, 31, 35, 37, 38, 40, 41, 42, 48, 49, 53, 61, 62, 64, 65, 67, 69, 70, 72, 79, 85, 86, 88, 89, 90, 91, 93, 95, 97, 102, 105, 106, 107, 112, 115, 120, 124, 125, 127, 128, 129, 130, 132, 139, 141, 157, 158, 160, 167, 168, 181, 202, 205, 207, 220, 221, 223, 238, 239, 324, 325, 329, 333]

golden_ants: [5, 7, 10, 15, 16, 17, 19, 30, 31, 37, 38, 40, 41, 42, 53, 65, 67, 69, 70, 72, 85, 86, 88, 91, 93, 105, 106, 107, 112, 124, 127, 128, 129, 130, 141, 157, 158, 160, 167, 181, 202]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459895.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 [ ]: