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 = "2459890"
data_path = "/mnt/sn1/2459890"
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-6-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/2459890/zen.2459890.25276.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

# get a list of all ant_metrics files
glob_str = os.path.join(data_path, f'zen.{JD}.?????.sum{ant_metrics_ext}')
ant_metrics_files = sorted(glob.glob(glob_str))

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1849 ant_metrics files matching glob /mnt/sn1/2459890/zen.2459890.?????.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/2459890/zen.2459890.?????.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 2459890
Date 11-6-2022
LST Range 22.556 -- 8.507 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1849
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
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 65 / 201 (32.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 126 / 201 (62.7%)
Redcal Done? ❌
Never Flagged Antennas 75 / 201 (37.3%)
A Priori Good Antennas Flagged 55 / 96 total a priori good antennas:
3, 7, 10, 15, 16, 17, 19, 20, 29, 30, 37, 44,
51, 54, 55, 56, 59, 68, 71, 72, 81, 84, 86,
88, 94, 99, 101, 103, 108, 109, 111, 117, 121,
122, 123, 136, 140, 142, 143, 144, 158, 161,
162, 164, 165, 169, 170, 183, 184, 185, 186,
187, 189, 190, 191
A Priori Bad Antennas Not Flagged 34 / 105 total a priori bad antennas:
8, 35, 43, 46, 48, 49, 61, 62, 64, 73, 74,
79, 82, 89, 90, 95, 102, 115, 120, 125, 132,
137, 139, 148, 149, 168, 205, 207, 220, 221,
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_2459890.csv

Build DataFrame¶

In [20]:
# build dataframe
to_show = {'Ant': [f'<a href="{ant_to_report_url(ant)}" target="_blank">{ant}</a>' for ant in ants],
           'Node': [f'N{nodes[ant]:02}' for ant in ants], 
           'A Priori Status': [a_priori_statuses[ant] for ant in ants]}
           #'Worst Metric': worst_metrics, 'Worst Modified Z-Score': worst_zs}
df = pd.DataFrame(to_show)

# create bar chart columns for flagging percentages:
bar_cols = {}
if use_auto_metrics:
    bar_cols['Auto Metrics Flags'] = [float(ant in auto_ex_ants) for ant in ants]
if use_ant_metrics:
    if np.sum(list(a_priori_flag_frac.values())) > 0:  # only include this col if there are any a priori flags
        bar_cols['A Priori Flag Fraction in Ant Metrics'] = [a_priori_flag_frac[ant] for ant in ants]
    for ap in antpols:
        bar_cols[f'Dead Fraction in Ant Metrics ({ap})'] = [dead_ant_frac[ap][ant] for ant in ants]
    bar_cols['Crossed Fraction in Ant Metrics'] = [crossed_ant_frac[ant] for ant in ants]
if use_redcal:
    bar_cols['Flag Fraction Before Redcal'] = [redcal_prior_flag_frac[ant] for ant in ants]
    bar_cols['Flagged By Redcal chi^2 Fraction'] = [redcal_flagged_frac[ant] for ant in ants]  
for col in bar_cols:
    df[col] = bar_cols[col]

# add auto_metrics
if use_auto_metrics:
    for label, modz in all_modzs.items():
        df[label] = modz
z_score_cols = [col for col in df.columns if 'Modified Z-Score' in col]        
        
# add ant_metrics
ant_metrics_cols = {}
if use_ant_metrics:
    for ap in antpols:
        ant_metrics_cols[f'Average Dead Ant Metric ({ap})'] = [average_dead_metrics[ap][ant] for ant in ants]
    ant_metrics_cols['Average Crossed Ant Metric'] = [average_crossed_metrics[ant] for ant in ants]
    for col in ant_metrics_cols:
        df[col] = ant_metrics_cols[col]   

# add redcal chisq
redcal_cols = []
if use_redcal:
    for ap in antpols:
        col_title = f'Median chi^2 Per Antenna ({ap})'
        df[col_title] = [cspa[ant, ap] for ant in ants]
        redcal_cols.append(col_title)

# sort by node number and then by antenna number within nodes
df.sort_values(['Node', 'Ant'], ascending=True)

# style dataframe
table = df.style.hide_index()\
          .applymap(lambda val: f'background-color: {status_colors[val]}' if val in status_colors else '', subset=['A Priori Status']) \
          .background_gradient(cmap='viridis', vmax=mean_round_modz_cut * 3, vmin=0, axis=None, subset=z_score_cols) \
          .background_gradient(cmap='bwr_r', vmin=dead_cut-.25, vmax=dead_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .background_gradient(cmap='bwr_r', vmin=crossed_cut-.25, vmax=crossed_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .background_gradient(cmap='plasma', vmax=4, vmin=1, axis=None, subset=redcal_cols) \
          .applymap(lambda val: 'font-weight: bold' if val < dead_cut else '', subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val < crossed_cut else '', subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .applymap(lambda val: 'color: red' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .bar(subset=list(bar_cols.keys()), vmin=0, vmax=1) \
          .format({col: '{:,.4f}'.format for col in z_score_cols}) \
          .format({col: '{:,.4f}'.format for col in ant_metrics_cols}) \
          .format({col: '{:,.2%}'.format for col in bar_cols}) \
          .applymap(lambda val: 'font-weight: bold', subset=['Ant']) \
          .set_table_styles([dict(selector="th",props=[('max-width', f'70pt')])])

Table 2: RTP Per-Antenna Metrics Summary Table¶

This admittedly very busy table incorporates summary information about all antennas in the array. Its columns depend on what information is available when the notebook is run (i.e. whether auto_metrics, ant_metrics, and/or redcal is done). These can be divided into 5 sections:

Basic Antenna Info: antenna number, node, and its a priori status.

Flag Fractions: Fraction of the night that an antenna was flagged for various reasons. Note that auto_metrics flags antennas for the whole night, so it'll be 0% or 100%.

auto_metrics Details: If auto_metrics is included, this section shows the modified Z-score signifying how much of an outlier each antenna and polarization is in each of four categories: bandpass shape, overall power, temporal variability, and temporal discontinuities. Bold red text indicates that this is a reason for flagging the antenna. It is reproduced from the auto_metrics_inspect.ipynb nightly notebook, so check that out for more details on the precise metrics.

ant_metrics Details: If ant_metrics is included, this section shows the average correlation-based metrics for antennas over the whole night. Low "dead ant" metrics (nominally below 0.4) indicate antennas not correlating with the rest of the array. Negative "crossed ant" metrics indicate antennas that show stronger correlations in their cross-pols than their same-pols, indicating that the two polarizations are probably swapped. Bold text indicates that the average is below the threshold for flagging.

redcal chi^2 Details: If redcal is included, this shows the median chi^2 per antenna. This would be 1 in an ideal array. Antennas are thrown out when they they are outliers in their median chi^2, usually greater than 4-sigma outliers in modified Z-score.

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.830876 -0.641247 12.736558 0.231417 8.140230 0.673601 0.315935 2.973970 0.032220 0.666985 0.541259
4 N01 RF_maintenance 100.00% 6.38% 0.00% 0.00% 0.576258 3.208501 4.077255 2.846014 55.378472 54.549068 62.274427 52.397771 0.561826 0.573630 0.347432
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.186976 -0.578619 -0.403249 -0.594829 0.064921 1.441965 2.203731 0.414456 0.677443 0.668704 0.395133
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.003651 -1.119837 0.196225 -0.297833 -0.294582 0.133466 7.360499 12.931282 0.669281 0.667676 0.390532
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.202983 -1.543071 -0.686274 -0.278495 -0.462940 0.302827 2.635365 0.201247 0.661814 0.662390 0.383909
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.134591 -0.477258 0.023271 0.369729 0.858134 0.307311 -0.482882 -0.596112 0.664202 0.661552 0.395353
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.169329 -0.660426 -1.901258 -1.493929 -0.239403 5.809022 1.131263 0.291828 0.656412 0.658834 0.399994
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.465172 -0.386718 0.266690 -0.142285 -0.058847 0.309790 1.245978 9.402234 0.676348 0.675941 0.397165
16 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.930661 -1.099219 -0.637902 0.173123 0.669252 0.869748 9.275893 4.165584 0.676521 0.672248 0.390303
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.488514 0.598571 -0.057744 -0.311397 -0.611815 0.610243 9.188361 4.378894 0.678971 0.678379 0.392121
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.762576 9.484415 -0.780295 -0.216546 0.060536 3.212256 11.545749 29.695793 0.666923 0.462158 0.473755
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.504973 -1.135670 0.643410 -0.595840 0.957884 17.596404 4.896773 9.696951 0.665695 0.680802 0.387877
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.446392 -0.871156 -0.494436 -0.778377 -0.367198 -0.620332 4.908099 1.028554 0.674808 0.685229 0.392593
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.443381 0.145585 -0.258873 0.151602 1.094393 0.588917 1.544540 0.747540 0.657944 0.659004 0.389480
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% 31.734606 6.659571 -1.025267 -0.198763 4.910300 5.618113 17.799081 43.877613 0.454532 0.602439 0.328594
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.789078 11.980169 12.764647 13.195513 8.238791 9.149557 1.528622 0.761464 0.031796 0.036017 0.004350
28 N01 RF_maintenance 100.00% 0.00% 85.07% 0.00% 13.621372 28.005840 1.808616 0.924630 5.004467 7.496382 4.322686 14.936207 0.358366 0.154863 0.258187
29 N01 digital_ok 100.00% 0.00% 100.00% 0.00% -1.209033 12.458951 -0.342254 12.662358 -0.062740 9.127630 -0.384606 -0.340270 0.684112 0.034733 0.576384
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.686748 -0.612610 -1.100990 0.070868 2.730899 -0.277720 12.817375 1.026407 0.681482 0.683733 0.380594
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.117512 -1.383095 -0.516957 0.111332 0.573539 2.547257 2.749094 3.615669 0.693369 0.686193 0.387472
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.704435 24.435290 0.452036 -0.348332 4.506699 3.222504 20.709866 38.249341 0.651125 0.592979 0.338603
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 12.630210 1.381383 5.327340 -1.396412 8.193274 11.231844 0.597741 8.124787 0.040479 0.643492 0.483494
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.187210 0.340327 1.652521 -1.824032 -0.210652 -1.036757 -0.351098 0.563494 0.640815 0.630647 0.393304
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.558825 8.733295 -0.035434 0.069570 0.560603 1.145902 0.444743 1.015904 0.669277 0.673511 0.397015
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.546502 0.547294 -2.203769 1.282640 0.556385 1.475442 -0.212352 5.229749 0.681800 0.682505 0.401144
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.143963 0.229840 -0.156855 0.020900 0.884747 0.722631 2.979719 0.625410 0.683743 0.689135 0.401325
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.013161 0.339618 -0.305824 0.129576 0.328781 -0.344631 -0.601460 -0.302282 0.680451 0.680928 0.388641
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.017718 -0.074381 -0.860396 -0.471612 1.294907 -0.008024 -0.218345 1.350924 0.685268 0.683253 0.378950
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.124013 0.830955 -0.040083 0.722956 1.115957 0.241971 0.529778 -0.437705 0.694958 0.686785 0.390928
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.465660 -0.146876 0.107605 0.184700 -1.066441 -0.006521 -1.112235 -0.382280 0.700164 0.690796 0.386030
44 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 4.185626 3.198399 -0.801535 -0.980264 3.848706 1.709196 44.193650 15.553838 0.669946 0.680190 0.371572
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.575405 0.084931 -0.115163 0.237421 0.432542 2.893308 -0.069923 3.900935 0.683588 0.679272 0.380676
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.154661 1.750204 1.518060 2.956947 0.196756 0.213139 -0.560548 -2.199565 0.670620 0.694098 0.394719
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 11.761419 1.877688 5.086246 -1.526302 8.172407 -1.948728 0.506994 2.693931 0.037212 0.648378 0.479005
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.952911 1.119846 1.368056 2.260746 -0.538782 0.257843 -0.723561 -2.067193 0.644618 0.664540 0.399226
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.226428 0.799432 -1.488716 1.966990 -0.997809 -0.151581 0.279387 -0.897539 0.611483 0.647342 0.395263
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.516043 19.781309 -0.235982 1.325614 2.064538 7.640090 17.536957 21.287440 0.659512 0.609794 0.362864
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 24.915622 0.541371 16.416953 -0.098990 8.392187 2.935054 6.277730 5.970456 0.038278 0.687051 0.541431
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.582687 7.348489 -0.853861 0.115369 0.442944 0.829842 0.425862 -0.152443 0.685826 0.693725 0.388682
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.459476 3.017642 -0.396553 -0.365773 1.300118 1.112505 2.577819 3.458622 0.690481 0.696951 0.389645
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.863322 12.722310 12.777938 13.512305 8.210387 9.127453 1.397877 0.407476 0.042965 0.042638 0.001100
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.431313 13.449560 0.150140 13.385162 10.318723 9.119375 -0.025930 1.337327 0.684136 0.034151 0.514214
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.289598 13.572124 0.188096 13.666896 -0.654117 9.079991 0.881916 0.058116 0.690477 0.036404 0.531809
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 31.262947 -0.580288 6.995296 0.110051 5.131518 0.381767 5.066802 1.435287 0.499351 0.696926 0.385040
58 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.053474 12.370723 -1.058078 13.349710 0.626362 9.110842 0.558991 0.296217 0.694939 0.036116 0.502214
59 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 12.172174 3.513186 -1.633992 0.131879 4.577784 1.215567 49.312259 30.453864 0.651179 0.680013 0.368844
60 N05 RF_maintenance 100.00% 0.00% 97.62% 0.00% -1.277617 12.328224 0.019568 13.396241 -1.291239 9.074497 -1.138297 1.277803 0.693097 0.076782 0.537708
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.490600 2.450078 -1.961490 -0.209798 1.356152 -1.248672 -0.413661 2.428006 0.632208 0.627299 0.375337
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.261725 1.193324 0.273054 1.767590 -0.771743 -0.025837 0.904718 -1.284290 0.642117 0.668933 0.387858
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.211945 12.762776 0.309286 5.660751 -0.647547 9.170486 0.086739 1.754931 0.628165 0.043496 0.471952
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.135821 0.109914 -1.410239 0.727714 -1.538411 -1.793239 0.122381 -1.120636 0.600946 0.632967 0.393412
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.247856 1.337895 0.161214 0.751351 1.132720 1.417707 2.713641 0.287143 0.661912 0.681938 0.401815
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.124779 1.613007 2.848859 2.075845 3.193242 0.422779 -0.408622 0.008670 0.667561 0.685430 0.393086
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.286723 -0.883642 1.543614 1.118533 0.158078 1.001580 0.247811 0.730010 0.676709 0.690470 0.385840
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.403037 28.009755 0.356726 17.826534 0.328498 8.914933 2.366895 6.672804 0.686303 0.031548 0.538041
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.182703 -0.824101 0.041153 0.395220 0.930802 0.248430 -0.350688 -0.349742 0.685471 0.696327 0.379567
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.489636 -0.710906 -0.777573 -0.656955 0.992827 0.654552 -0.008670 -0.515465 0.693918 0.702663 0.379394
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.252792 -0.619992 0.419352 0.781695 0.423413 1.811518 2.078017 0.057681 0.701497 0.701783 0.376738
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 2.801621 -0.018451 0.519532 0.680883 -0.080400 0.895276 4.917061 -0.063468 0.683367 0.694721 0.367835
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.130933 0.816059 -1.307875 1.269635 -0.301232 -0.822683 -0.681165 -0.729295 0.704134 0.697979 0.380108
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.637276 0.643458 0.135594 -1.508979 -0.669360 2.542962 -0.659143 1.823926 0.702226 0.701162 0.378336
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 8.299440 26.819085 1.035210 -1.214266 7.674113 4.085249 49.010013 18.254737 0.614036 0.519587 0.334488
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 34.425632 -0.758502 -0.366467 0.087381 2.658356 -2.066323 5.219010 -0.337673 0.460368 0.649383 0.370818
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.583442 -0.287627 -0.963258 -1.037418 -0.530615 -1.578544 1.016450 -0.208876 0.628628 0.650407 0.390596
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 9.427540 13.966013 3.482859 5.511448 6.722455 9.077722 11.727839 0.215937 0.300688 0.038118 0.202749
81 N07 digital_ok 100.00% 0.00% 0.00% 0.00% -0.626721 -0.138980 -0.518962 0.041126 -0.740525 31.538501 -0.309937 -0.106031 0.640376 0.663290 0.390271
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.243077 -0.193597 -0.007704 2.126894 -0.594893 -1.562504 -0.585626 -0.680295 0.656849 0.667565 0.385117
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.743170 -0.508706 -0.291221 -0.230218 -0.438930 -0.332096 -0.359590 2.181844 0.669111 0.685502 0.381309
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 1.917075 24.915377 5.776920 17.257576 2.223248 8.884257 -0.120428 3.008204 0.656232 0.035414 0.444332
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.309988 -0.184808 -0.633493 0.182848 -0.473684 -0.538453 -0.770733 -0.916940 0.685657 0.693842 0.379598
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.703358 -0.380017 1.788611 1.554012 6.897746 -1.600099 1.044993 12.587521 0.674427 0.688096 0.369486
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.526949 7.650367 0.026241 -0.177071 2.673717 1.532722 2.607967 3.083097 0.699274 0.710326 0.371746
88 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 1.240462 0.376262 0.131881 0.419488 -1.280418 1.945715 5.657274 1.647416 0.685980 0.696551 0.363971
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.310928 0.334174 -0.327578 0.443222 0.296712 0.266147 -0.713748 -0.769082 0.690029 0.696234 0.372547
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.199223 -0.825507 -1.742227 0.850550 -1.124239 -0.572819 -0.622538 3.179302 0.697935 0.690508 0.373782
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.474806 -0.059146 0.034474 -0.190676 -0.972887 -0.030498 -0.035159 -0.643031 0.682896 0.697685 0.384647
92 N10 RF_maintenance 100.00% 0.00% 32.02% 0.00% 40.197020 47.112817 0.390748 0.914331 5.973958 8.766293 2.414631 7.299257 0.291438 0.238778 0.097839
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 2.307719 0.009374 2.280708 -0.113594 1.200635 -0.050741 3.139861 -0.506792 0.667526 0.687821 0.392194
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 11.942462 -1.297011 12.944304 -0.419109 8.168157 2.172507 0.379457 3.928434 0.031841 0.681873 0.457108
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.020407 -0.354809 -0.919529 1.616054 -0.397970 -0.889917 1.842396 1.461810 0.633852 0.669208 0.400571
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.116427 13.534661 5.093932 5.757802 8.070383 9.070402 0.564484 0.050829 0.032813 0.036460 0.002118
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.180724 3.996643 0.629747 -0.198457 -1.091940 0.152632 -0.797423 6.603408 0.626310 0.600837 0.398039
98 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 1.271825 3.858251 -0.350648 -0.166461 -0.462483 1.282876 0.724809 1.739294 0.637972 0.652053 0.385578
99 N07 digital_ok 100.00% 0.00% 0.00% 0.00% -0.040834 -0.630418 1.014347 0.045311 -1.408750 4.059023 1.293115 -0.961600 0.641881 0.671775 0.390719
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -1.281658 -0.987866 -0.014694 0.869685 1.408735 -1.050282 0.717453 1.408218 0.659876 0.675601 0.381176
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.163581 7.243943 -1.003886 0.809965 -0.065461 0.291779 0.188907 -0.124283 0.686066 0.692764 0.378847
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.218111 0.369846 -0.964938 2.396417 -0.293036 -0.321516 -0.804766 3.679502 0.693262 0.688945 0.376836
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.150970 5.518046 9.040407 -0.820849 1.846754 4.710600 5.855183 4.219945 0.619164 0.701656 0.391818
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.795452 62.856120 8.508013 8.682322 0.464488 0.879212 -0.305918 -0.608055 0.637613 0.676935 0.377157
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.637332 -0.289880 -0.291916 0.556959 -0.447384 0.340681 -0.452830 -0.407446 0.693193 0.698193 0.366350
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.451567 0.526288 0.707932 0.708494 2.360666 1.191736 -0.410247 -0.179939 0.682840 0.695054 0.368535
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.881630 -0.230299 -0.619331 -0.348649 1.027456 -0.411332 2.831240 2.255198 0.685468 0.697183 0.371320
108 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 10.961935 3.517583 12.688458 -0.873700 8.199319 -0.270585 0.999026 1.754656 0.039143 0.699049 0.481027
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -1.262535 12.403159 0.431363 13.037478 -0.309498 9.132389 0.114336 0.791383 0.686191 0.035112 0.470541
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.492119 26.385287 -0.403211 17.461880 0.825322 8.830674 0.869779 2.642355 0.690882 0.031196 0.468713
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.089651 12.303213 0.246856 13.201764 0.028901 9.126323 5.692734 0.986620 0.673077 0.035400 0.460927
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.677034 1.055526 -0.166427 -0.428255 -0.247240 0.678067 0.307591 -0.614128 0.660628 0.671669 0.396792
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.921914 13.611979 4.799823 5.612753 8.080866 9.069373 0.906066 -0.175549 0.034087 0.030774 0.002013
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.783251 0.443875 0.868106 -0.235852 2.248424 -1.945527 2.693898 -0.501898 0.535634 0.642311 0.417630
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.019793 0.734077 3.512033 2.711384 1.668679 -0.040996 -1.693529 -0.907442 0.622419 0.644123 0.412322
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.131883 0.217610 -0.320908 0.275880 0.187074 -0.578830 0.727969 0.321909 0.634719 0.651760 0.385971
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 11.869957 13.950015 12.839896 13.849988 8.100150 9.134803 0.677631 2.123006 0.027673 0.030495 0.001712
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.848927 0.664937 -0.602527 0.260414 1.534152 0.746675 2.353736 2.544706 0.660973 0.683088 0.386589
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.743697 1.010928 -1.329634 2.160674 -0.340836 12.944393 1.028612 3.009095 0.674336 0.672047 0.378871
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.681000 2.426683 3.199885 3.273255 0.228054 0.767285 0.478023 -2.228954 0.669749 0.696995 0.371820
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.238896 5.261348 -0.737456 0.844750 2.419562 0.489596 28.930889 12.792570 0.694045 0.702999 0.378204
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.104307 7.415090 -1.087828 0.480979 1.377146 0.447768 2.197086 -0.984013 0.702770 0.706912 0.377838
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.597590 9.256010 0.372076 0.774367 0.157728 0.801859 -0.557104 -0.469694 0.700449 0.709246 0.375809
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.862248 -0.281839 -0.469927 0.254748 -0.012130 -0.336650 0.759517 0.280803 0.699455 0.709156 0.376874
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.381288 0.066937 -1.375899 0.418801 -0.340542 0.865950 -0.411445 -0.097099 0.693691 0.696267 0.376206
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.445248 3.162403 -1.296083 1.097694 16.675773 -0.336826 54.938328 -0.367304 0.615824 0.689047 0.365638
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.168077 -0.284920 -0.049417 -0.033042 1.761490 0.594610 1.660918 3.235061 0.687176 0.700701 0.390852
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.983389 -0.647300 1.918251 0.970589 -0.779453 0.910176 0.084491 1.181029 0.676568 0.693426 0.390731
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.329218 -1.748919 -0.233648 -0.202955 0.048764 0.551677 0.254872 -0.416457 0.675469 0.690762 0.398091
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.159503 0.079669 -0.300147 -0.146341 -0.757587 0.254260 1.897037 1.640417 0.656988 0.679005 0.393376
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.922213 13.697487 5.129210 5.915404 8.186525 9.084391 2.087038 -0.746631 0.033211 0.037930 0.001648
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.142759 0.552726 0.450548 -2.056260 -0.675808 -1.179659 1.032697 -0.120950 0.624039 0.631517 0.397316
133 N11 not_connected 100.00% 100.00% 84.10% 0.00% 12.510319 17.231709 4.799544 4.003517 8.162439 7.966247 0.770223 0.250506 0.038752 0.173001 0.098583
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -1.397958 12.370979 0.018201 13.495641 0.106216 9.107712 -0.064705 0.397162 0.634019 0.037724 0.472405
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 1.932355 0.345017 5.029969 3.050881 15.701300 17.336315 -0.196256 4.202472 0.597761 0.637076 0.382419
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.066905 -0.680045 -0.419168 -0.961516 2.804799 2.411790 0.356192 -0.160586 0.640578 0.667293 0.392555
138 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.121193 -0.362256 0.951243 1.610968 -0.636311 -0.097120 4.466241 -0.045549 0.662808 0.679613 0.391573
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.456446 -0.930828 2.142213 -0.993604 -0.216066 -1.825561 -0.340291 0.357154 0.668707 0.672573 0.379358
140 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.193006 12.999822 0.315568 13.297976 -1.359666 9.129060 1.359420 1.334925 0.685198 0.044108 0.551138
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.529281 -0.786235 -0.990193 1.155999 1.150074 -1.903783 0.271022 -1.496230 0.685144 0.701738 0.376110
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.470412 12.301003 -0.712458 13.406109 1.952478 9.112717 0.277032 0.715197 0.686675 0.043184 0.546297
143 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.062525 -0.786228 12.930548 0.053272 8.021420 1.190568 -0.136848 -1.045073 0.036679 0.704757 0.560643
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.599700 -1.371752 -0.606091 6.378707 -0.483573 -0.680043 -0.268365 -0.837577 0.693997 0.664418 0.393980
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.424644 1.019190 -0.827164 7.062189 -0.919159 11.314030 -0.255252 -0.243309 0.689368 0.650363 0.399148
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.248244 1.046265 -1.926435 1.730112 0.077643 -1.064364 0.708997 -1.087683 0.648896 0.693664 0.396345
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.997894 -1.740942 1.093607 2.412556 -0.986653 -0.786348 -0.290315 -0.435867 0.676654 0.686168 0.384268
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -2.051549 -0.569425 3.993314 1.883892 -0.269706 -0.139351 -0.630416 -0.842977 0.659595 0.689091 0.399246
149 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.156027 0.907046 -1.588323 2.752795 -1.237761 -0.172943 -0.389576 -1.871560 0.674036 0.688977 0.400054
150 N15 RF_maintenance 100.00% 100.00% 12.76% 0.00% 11.611193 0.267637 12.758935 0.967723 8.210457 0.233001 1.337659 -0.728318 0.042807 0.283680 0.148306
155 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.868841 -0.670845 -0.343782 1.605163 0.767133 18.077444 1.227970 0.783497 0.634778 0.648626 0.404011
156 N12 RF_maintenance 100.00% 99.84% 0.00% 0.00% 10.293686 -0.413271 12.720790 2.193939 8.254493 -0.175865 0.670914 -0.198938 0.059812 0.648508 0.534657
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.124855 -0.484467 0.025967 0.250252 -1.122330 0.355124 -0.378818 -0.493528 0.647054 0.665455 0.395960
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.504774 -0.680963 -0.868174 -1.962750 2.156720 0.178051 3.926032 11.046146 0.663613 0.679448 0.400249
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.030615 26.895369 -2.007642 -1.229685 -1.169369 8.410837 -0.351021 16.003204 0.635302 0.532760 0.363440
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.746612 -1.250793 -0.850762 -1.323326 -0.385983 0.776791 0.105571 0.632859 0.676094 0.688164 0.380892
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.019653 29.328666 -0.572496 -1.095312 -0.478081 0.668110 -0.372913 0.401573 0.680311 0.564182 0.349932
162 N13 digital_ok 100.00% 7.95% 16.28% 0.00% 6.724757 7.196274 10.798716 11.696453 29.551329 20.963383 0.435749 0.437021 0.438239 0.435104 0.304772
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.427745 1.060290 -0.710669 0.007704 -0.564797 0.881656 -0.286717 0.668686 0.693950 0.698089 0.386062
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.851034 0.120922 1.120593 -0.828995 7.702562 0.778684 0.304904 0.559688 0.684676 0.699412 0.382523
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 31.136258 -0.143695 2.781367 0.174909 4.607150 -0.301563 1.490105 -0.585751 0.525253 0.691954 0.381597
166 N14 RF_maintenance 100.00% 0.00% 100.00% 0.00% 27.072330 11.416714 0.029313 12.816962 9.815013 9.144421 18.216358 0.244596 0.564456 0.033986 0.386860
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.547845 -1.271133 -1.277097 0.882126 0.024427 1.533669 -0.926510 2.928931 0.692312 0.693003 0.394974
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.047913 -1.039387 -0.232003 -1.161212 1.131879 0.110311 -0.294329 0.348766 0.679901 0.694740 0.397134
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 4.536529 9.753092 -1.574597 -1.911480 -0.068999 5.404325 -0.145836 13.906834 0.670282 0.651194 0.394305
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 11.621684 -0.751568 13.000932 -1.842137 8.078301 13.173057 0.394645 2.258830 0.036403 0.682900 0.557505
179 N12 RF_maintenance 100.00% 99.84% 97.57% 0.00% 11.791194 13.381452 13.010406 14.038895 7.992119 8.732340 0.220164 0.323817 0.055971 0.094299 0.038629
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.185052 13.028317 12.887834 13.581115 8.093899 9.094343 0.077154 1.188785 0.045992 0.048564 0.004135
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.366050 -0.671948 -0.662708 -0.055952 0.006521 0.848821 -0.550238 3.196463 0.684342 0.685467 0.386518
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.103009 3.875383 -0.798251 4.754154 -0.453221 3.538067 6.526851 -1.319471 0.686980 0.683553 0.385421
183 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 11.125214 -1.187655 11.849499 -1.229126 8.214775 0.550218 -0.373082 -0.672150 0.039652 0.686982 0.514631
184 N14 digital_ok 100.00% 98.86% 100.00% 0.00% 11.026660 12.678822 12.858922 13.412528 8.200323 9.109298 0.202097 0.150631 0.072571 0.043668 0.025763
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 8.314433 1.041399 11.803947 9.047983 7.656128 0.562756 -0.183482 -0.159617 0.334963 0.595918 0.419361
186 N14 digital_ok 100.00% 99.51% 0.00% 0.00% 10.578801 1.585153 12.895608 3.296869 8.214517 0.818900 1.271335 -2.161499 0.045439 0.694654 0.534096
187 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.119162 1.588397 12.534768 2.717655 8.333261 -0.097328 1.261656 -0.330942 0.044602 0.693276 0.540939
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 9.249838 9.825413 2.121781 -0.091253 4.344839 7.660150 0.796848 1.794993 0.347886 0.370700 0.173455
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 44.472894 12.530302 -0.409489 13.541285 9.440600 9.140083 121.658182 1.478867 0.469094 0.034050 0.358853
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.056799 0.029390 4.763527 -0.456030 -0.981653 0.084671 6.572147 0.331132 0.627384 0.665280 0.423384
200 N18 RF_maintenance 100.00% 100.00% 64.63% 0.00% 12.646195 37.429779 5.036053 1.107743 8.281730 8.883806 0.922280 0.896375 0.045605 0.209313 0.144715
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.064190 5.874858 6.904740 6.113040 6.479803 6.173964 -2.885781 -2.844247 0.636974 0.646997 0.383594
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% 0.529023 2.188660 1.082163 -0.633437 -0.999789 -0.008594 0.632565 2.110517 0.665109 0.627151 0.394389
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 13.203979 14.468596 4.727055 5.307089 8.223101 9.124534 1.471508 1.832665 0.033375 0.040991 0.001725
205 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.705134 2.833529 0.194673 0.479174 -1.549652 -0.305043 -0.630229 3.130507 0.660242 0.617507 0.407995
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.642744 0.673457 1.363589 -0.925490 9.526168 -1.572623 0.901400 4.010809 0.656786 0.647585 0.391499
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.225978 1.950872 1.963448 0.045146 0.673173 1.181127 -0.488236 -1.074122 0.640309 0.643853 0.376418
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.264337 4.173502 7.094649 5.013559 6.805088 4.226735 -3.009949 -2.465289 0.631176 0.653245 0.403157
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.046212 -0.980020 0.104556 -0.030137 -1.544462 -1.885532 3.150126 -1.079110 0.659136 0.653580 0.394804
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.289101 -0.127788 -0.997524 -0.307102 -0.013245 -1.008740 1.285743 -0.454918 0.620275 0.657196 0.399557
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.912332 1.065710 0.898691 -0.679694 -0.427211 33.402014 4.056064 2.102019 0.657788 0.648324 0.405236
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.582370 1.140638 -1.959704 -0.511011 -0.147351 3.475162 0.850854 5.641069 0.638043 0.617772 0.391763
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.236436 6.479274 7.134519 6.796437 6.490917 7.426654 -2.737471 -3.269650 0.637036 0.637497 0.396527
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 271.386013 271.287976 inf inf 7077.128396 7074.383628 7549.682284 7542.271495 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.674527 1.463790 1.996539 -1.400491 2.035073 -1.476564 0.777785 -0.317886 0.515744 0.630715 0.435596
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.009374 -0.856198 1.662931 1.163785 -0.969976 -0.304062 -1.050260 -1.133132 0.658112 0.652516 0.404823
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.541906 -0.490896 0.590241 -1.496643 0.523168 28.748990 1.147778 12.332295 0.650342 0.629869 0.400562
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% 241.208745 241.166695 inf inf 6014.356198 5936.547844 5953.334779 5858.192144 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% 264.485800 264.776792 inf inf 5042.964986 5160.817565 4082.801252 4531.196121 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% 241.112954 241.073881 inf inf 5265.116361 5321.360706 4758.874735 4890.100823 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.030951 13.084919 -0.744908 8.508796 -0.771039 9.143105 12.829775 1.966578 0.650954 0.046657 0.545202
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.726776 1.867529 1.739680 2.424439 0.018021 0.302293 3.909188 0.038294 0.552970 0.555131 0.388962
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.050461 -1.256111 1.841442 -1.428763 0.091566 -0.314414 -0.777944 0.439068 0.588982 0.568642 0.401121
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.176230 -1.309261 -1.749897 -0.881099 -1.333468 -1.087064 6.873321 1.404968 0.524017 0.564931 0.397306
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.732142 0.713750 -1.488887 -1.622137 -0.798871 -1.294296 0.623887 0.417105 0.514571 0.547909 0.389068
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, 10, 15, 16, 17, 18, 19, 20, 22, 27, 28, 29, 30, 32, 34, 36, 37, 44, 47, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 77, 78, 80, 81, 84, 86, 87, 88, 92, 94, 96, 97, 99, 101, 103, 104, 108, 109, 110, 111, 113, 114, 117, 119, 121, 122, 123, 126, 131, 133, 135, 136, 138, 140, 142, 143, 144, 145, 150, 155, 156, 158, 159, 161, 162, 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, 223, 224, 225, 226, 227, 228, 229, 237, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 329]

unflagged_ants: [5, 8, 9, 21, 31, 35, 38, 40, 41, 42, 43, 45, 46, 48, 49, 53, 61, 62, 64, 65, 66, 67, 69, 70, 73, 74, 79, 82, 83, 85, 89, 90, 91, 93, 95, 98, 100, 102, 105, 106, 107, 112, 115, 116, 118, 120, 124, 125, 127, 128, 129, 130, 132, 137, 139, 141, 146, 147, 148, 149, 157, 160, 163, 167, 168, 181, 202, 205, 207, 220, 221, 238, 324, 325, 333]

golden_ants: [5, 9, 21, 31, 38, 40, 41, 42, 45, 53, 65, 66, 67, 69, 70, 83, 85, 91, 93, 98, 100, 105, 106, 107, 112, 116, 118, 124, 127, 128, 129, 130, 141, 146, 147, 157, 160, 163, 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_2459890.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

# Figure out where to draw the nodes
node_centers = {}
for node in sorted(set(list(nodes.values()))):
    if np.isfinite(node):
        this_node_ants = [ant for ant in ants + unused_ants if nodes[ant] == node]
        if len(this_node_ants) == 1:
            # put the node label just to the west of the lone antenna 
            node_centers[node] = hd.antpos[ant][node] + np.array([-14.6 / 2, 0, 0])
        else:
            # put the node label between the two antennas closest to the node center
            node_centers[node] = np.mean([hd.antpos[ant] for ant in this_node_ants], axis=0)
            closest_two_pos = sorted([hd.antpos[ant] for ant in this_node_ants], 
                                     key=lambda pos: np.linalg.norm(pos - node_centers[node]))[0:2]
            node_centers[node] = np.mean(closest_two_pos, axis=0)
In [25]:
def Plot_Array(ants, unused_ants, outriggers):
    plt.figure(figsize=(16,16))
    
    plt.scatter(np.array([hd.antpos[ant][0] for ant in hd.data_ants if ant in ants]), 
                np.array([hd.antpos[ant][1] for ant in hd.data_ants if ant in ants]), c='w', s=0)

    # connect every antenna to their node
    for ant in ants:
        if nodes[ant] in node_centers:
            plt.plot([hd.antpos[ant][0], node_centers[nodes[ant]][0]], 
                     [hd.antpos[ant][1], node_centers[nodes[ant]][1]], 'k', zorder=0)

    rc_color = '#0000ff'
    antm_color = '#ffa500'
    autom_color = '#ff1493'

    # Plot 
    unflagged_ants = []
    for i, ant in enumerate(ants):
        ant_has_flag = False
        # plot large blue annuli for redcal flags
        if use_redcal:
            if redcal_flagged_frac[ant] > 0:
                ant_has_flag = True
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=7 * (2 - 1 * float(not outriggers)), fill=True, lw=0,
                                                color=rc_color, alpha=redcal_flagged_frac[ant]))
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=6 * (2 - 1 * float(not outriggers)), fill=True, color='w'))
        
        # plot medium green annuli for ant_metrics flags
        if use_ant_metrics: 
            if ant_metrics_xants_frac_by_ant[ant] > 0:
                ant_has_flag = True
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=6 * (2 - 1 * float(not outriggers)), fill=True, lw=0,
                                                color=antm_color, alpha=ant_metrics_xants_frac_by_ant[ant]))
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=5 * (2 - 1 * float(not outriggers)), fill=True, color='w'))
        
        # plot small red annuli for auto_metrics
        if use_auto_metrics:
            if ant in auto_ex_ants:
                ant_has_flag = True                
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=5 * (2 - 1 * float(not outriggers)), fill=True, lw=0, color=autom_color)) 
        
        # plot black/white circles with black outlines for antennas
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4 * (2 - 1 * float(not outriggers)), fill=True, color=['w', 'k'][ant_has_flag], ec='k'))
        if not ant_has_flag:
            unflagged_ants.append(ant)

        # label antennas, using apriori statuses if available
        try:
            bgc = matplotlib.colors.to_rgb(status_colors[a_priori_statuses[ant]])
            c = 'black' if (bgc[0]*0.299 + bgc[1]*0.587 + bgc[2]*0.114) > 186 / 256 else 'white'
        except:
            c = 'k'
            bgc='white'
        plt.text(hd.antpos[ant][0], hd.antpos[ant][1], str(ant), va='center', ha='center', color=c, backgroundcolor=bgc)

    # label nodes
    for node in sorted(set(list(nodes.values()))):
        if not np.isnan(node) and not np.all(np.isnan(node_centers[node])):
            plt.text(node_centers[node][0], node_centers[node][1], str(node), va='center', ha='center', bbox={'color': 'w', 'ec': 'k'})
    
    # build legend 
    legend_objs = []
    legend_labels = []
    
    # use circles for annuli 
    legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgecolor='k', markerfacecolor='w', markersize=13))
    legend_labels.append(f'{len(unflagged_ants)} / {len(ants)} Total {["Core", "Outrigger"][outriggers]} Antennas Never Flagged')
    legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markerfacecolor='k', markersize=15))
    legend_labels.append(f'{len(ants) - len(unflagged_ants)} Antennas {["Core", "Outrigger"][outriggers]} Flagged for Any Reason')

    if use_auto_metrics:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=autom_color, markersize=15))
        legend_labels.append(f'{len([ant for ant in auto_ex_ants if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas Flagged by Auto Metrics')
    if use_ant_metrics: 
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=antm_color, markersize=15))
        legend_labels.append(f'{np.round(np.sum([frac for ant, frac in ant_metrics_xants_frac_by_ant.items() if ant in ants]), 2)} Antenna-Nights on' 
                             f'\n{np.sum([frac > 0 for ant, frac in ant_metrics_xants_frac_by_ant.items() if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas '
                             'Flagged by Ant Metrics\n(alpha indicates fraction of time)')        
    if use_redcal:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=rc_color, markersize=15))
        legend_labels.append(f'{np.round(np.sum(list(redcal_flagged_frac.values())), 2)} Antenna-Nights on' 
                             f'\n{np.sum([frac > 0 for ant, frac in redcal_flagged_frac.items() if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas '
                             'Flagged by Redcal\n(alpha indicates fraction of time)')

    # use rectangular patches for a priori statuses that appear in the array
    for aps in sorted(list(set(list(a_priori_statuses.values())))):
        if aps != 'Not Found':
            legend_objs.append(plt.Circle((0, 0), radius=7, fill=True, color=status_colors[aps]))
            legend_labels.append(f'A Priori Status:\n{aps} ({[status for ant, status in a_priori_statuses.items() if ant in ants].count(aps)} {["Core", "Outrigger"][outriggers]} Antennas)')

    # label nodes as a white box with black outline
    if len(node_centers) > 0:
        legend_objs.append(matplotlib.patches.Patch(facecolor='w', edgecolor='k'))
        legend_labels.append('Node Number')

    if len(unused_ants) > 0:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markerfacecolor='grey', markersize=15, alpha=.2))
        legend_labels.append(f'Anntenna Not In Data')
        
    
    plt.legend(legend_objs, legend_labels, ncol=2, fontsize='large', framealpha=1)
    
    if outriggers:
        pass
    else:
        plt.xlim([-200, 150])
        plt.ylim([-150, 150])        
       
    # set axis equal and label everything
    plt.axis('equal')
    plt.tight_layout()
    plt.title(f'Summary of {["Core", "Outrigger"][outriggers]} Antenna Statuses and Metrics on {JD}', size=20)    
    plt.xlabel("Antenna East-West Position (meters)", size=12)
    plt.ylabel("Antenna North-South Position (meters)", size=12)
    plt.xticks(fontsize=12)
    plt.yticks(fontsize=12)
    xlim = plt.gca().get_xlim()
    ylim = plt.gca().get_ylim()    
        
    # plot unused antennas
    plt.autoscale(False)    
    for ant in unused_ants:
        if nodes[ant] in node_centers:
            plt.plot([hd.antpos[ant][0], node_centers[nodes[ant]][0]], 
                     [hd.antpos[ant][1], node_centers[nodes[ant]][1]], 'k', alpha=.2, zorder=0)
        
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4, fill=True, color='w', ec=None, alpha=1, zorder=0))
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4, fill=True, color='grey', ec=None, alpha=.2, zorder=0))
        if hd.antpos[ant][0] < xlim[1] and hd.antpos[ant][0] > xlim[0]:
            if hd.antpos[ant][1] < ylim[1] and hd.antpos[ant][1] > ylim[0]:
                plt.text(hd.antpos[ant][0], hd.antpos[ant][1], str(ant), va='center', ha='center', color='k', alpha=.2) 

Figure 1: Array Plot of Flags and A Priori Statuses¶

This plot shows all antennas, which nodes they are connected to, and their a priori statuses (as the highlight text of their antenna numbers). It may also show (depending on what is finished running):

  • Whether they were flagged by auto_metrics (red circle) for bandpass shape, overall power, temporal variability, or temporal discontinuities. This is done in a binary fashion for the whole night.
  • Whether they were flagged by ant_metrics (green circle) as either dead (on either polarization) or crossed, with the transparency indicating the fraction of the night (i.e. number of files) that were flagged.
  • Whether they were flagged by redcal (blue circle) for high chi^2, with the transparency indicating the fraction of the night (i.e. number of files) that were flagged.

Note that the last fraction does not include antennas that were flagged before going into redcal due to their a priori status, for example.

In [26]:
core_ants = [ant for ant in ants if ant < 320]
outrigger_ants = [ant for ant in ants if ant >= 320]
Plot_Array(ants=core_ants, unused_ants=unused_ants, outriggers=False)
if len(outrigger_ants) > 0:
    Plot_Array(ants=outrigger_ants, unused_ants=sorted(set(unused_ants + core_ants)), outriggers=True)

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.0.4.dev44+g3962204
3.1.5.dev171+gc8e6162
In [ ]: