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 = "2459903"
data_path = "/mnt/sn1/2459903"
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-19-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/2459903/zen.2459903.25274.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/2459903/zen.2459903.?????.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/2459903/zen.2459903.?????.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 2459903
Date 11-19-2022
LST Range 23.409 -- 9.366 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
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 79 / 201 (39.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 136 / 201 (67.7%)
Redcal Done? ❌
Never Flagged Antennas 58 / 201 (28.9%)
A Priori Good Antennas Flagged 66 / 98 total a priori good antennas:
3, 7, 9, 15, 19, 21, 29, 30, 31, 37, 38, 42,
45, 51, 53, 54, 55, 56, 59, 68, 71, 81, 83,
84, 86, 93, 94, 98, 99, 100, 101, 103, 107,
108, 109, 111, 116, 117, 118, 121, 122, 123,
130, 136, 140, 142, 143, 146, 155, 158, 161,
164, 165, 167, 170, 181, 182, 183, 184, 185,
186, 187, 189, 190, 191, 202
A Priori Bad Antennas Not Flagged 26 / 103 total a priori bad antennas:
4, 22, 35, 43, 46, 48, 62, 64, 74, 79, 89,
115, 120, 125, 132, 139, 148, 149, 168, 207,
223, 238, 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_2459903.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.392115 -0.554319 9.773936 0.333610 7.178276 0.192927 2.009919 3.137100 0.032146 0.662193 0.502380
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.275220 1.856186 1.438098 0.122634 -0.502672 1.650597 -1.803734 1.952046 0.659572 0.662922 0.415148
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.528149 -0.154463 -0.336417 -0.444991 -0.206695 1.078393 -0.317595 -0.542924 0.659327 0.666401 0.411175
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.042302 -1.059731 0.765973 2.685001 -0.396782 -0.675121 20.406861 27.991010 0.655779 0.659343 0.404494
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.503653 -1.504138 -0.993577 -0.343326 -0.135963 0.490652 7.849653 7.489045 0.658369 0.667685 0.403506
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.315241 -0.091995 8.131652 0.097596 3.037798 0.315756 1.013538 -0.348765 0.482456 0.661305 0.476765
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.773855 -0.690159 -1.236136 -0.787036 -0.370006 0.588768 -0.527125 0.346398 0.642041 0.657324 0.412905
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.619392 0.210163 9.184280 1.006156 7.183373 1.473367 0.855603 2.432525 0.031587 0.666719 0.491679
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.127598 -1.201618 -0.655583 0.161620 1.666096 1.321933 1.459423 2.793183 0.667140 0.672271 0.410551
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.418930 0.783842 -0.184251 -0.186239 0.655771 0.819573 2.581587 1.392033 0.663595 0.675919 0.408357
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.418602 11.451674 -0.632524 0.243613 0.705745 1.989048 25.034596 34.615933 0.645912 0.453246 0.473888
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.402452 -1.413790 0.679073 1.010015 0.539783 1.731156 4.981041 11.708698 0.655819 0.675493 0.399786
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.297766 -1.231303 3.389253 -1.383311 0.161203 0.851256 1.503556 -0.993241 0.647275 0.682161 0.413944
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.175007 -0.196156 -0.441487 4.192403 0.466617 0.208133 1.114640 0.442489 0.646369 0.637202 0.408015
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.056204 -0.516666 -0.044847 -0.375252 3.581388 2.736216 0.062216 -1.085580 0.617245 0.639760 0.405960
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.259875 11.527159 9.811121 10.310401 7.271477 7.946013 4.785770 3.722354 0.031574 0.036028 0.004714
28 N01 RF_maintenance 100.00% 0.00% 84.70% 0.00% 12.757684 27.226578 1.068579 0.798736 3.476895 7.923664 9.635762 26.055818 0.357710 0.159172 0.262324
29 N01 digital_ok 100.00% 0.00% 100.00% 0.00% -1.509541 12.021384 -0.280446 9.906479 0.129641 7.926926 0.048059 1.029882 0.668055 0.034583 0.530176
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.672015 -0.375353 -1.066100 0.207932 0.352906 0.695891 24.524583 0.263878 0.670795 0.683095 0.396039
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.161228 -1.261049 0.922737 1.294797 1.581682 1.661933 5.664319 2.100080 0.676766 0.681464 0.396595
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.773604 19.024363 0.351499 1.939625 10.095948 8.710222 3.742851 24.781835 0.573228 0.586028 0.286086
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 12.128683 -0.718069 4.280584 -0.196842 7.228412 2.488926 2.232201 -0.920830 0.041780 0.658951 0.466963
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.651023 -0.012519 -1.127833 -1.682453 -1.291644 -1.318297 -0.384207 0.041856 0.614899 0.636694 0.401496
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.654315 7.736813 -0.147400 0.079362 0.596854 1.818383 0.511185 2.536202 0.639273 0.663329 0.417356
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.230773 0.137236 -1.250971 0.428073 0.249682 0.971207 -0.488953 18.533792 0.653734 0.672841 0.423737
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.097608 -0.196346 -0.071569 0.416564 0.184680 0.916215 11.881995 3.867745 0.657640 0.679599 0.424597
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.217607 0.489096 -0.129386 0.235949 -0.757566 0.215470 -0.329265 -0.187417 0.660765 0.676002 0.406007
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.177213 0.551412 -0.976798 -0.336120 1.570516 -0.283077 -0.351744 -0.192410 0.668073 0.678348 0.391473
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.245578 12.562064 10.009295 10.751192 7.096732 7.800278 1.706774 2.898289 0.033022 0.031174 0.000862
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.612621 0.499397 -0.067809 0.244606 -0.832593 0.111304 -1.754735 1.713873 0.684497 0.688457 0.397302
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.760918 0.181663 -1.299150 0.229823 -0.303031 0.568640 -0.535606 -0.253630 0.681246 0.695280 0.395899
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -0.700303 1.977671 0.003691 -0.050849 -0.276401 1.652810 1.035456 6.240415 0.669032 0.675129 0.390015
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.052834 1.669955 1.229958 1.865682 -0.625242 0.485510 0.672067 -2.749951 0.660316 0.692952 0.411170
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 11.306871 1.329254 4.097167 -1.291500 7.213419 -0.901234 2.870479 4.042683 0.037247 0.650190 0.451912
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.081490 0.770174 -0.054255 1.456724 1.306662 1.133207 0.778415 -3.201384 0.628982 0.664525 0.409949
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.137349 0.797536 -1.301399 -1.630624 -0.482933 -1.076835 0.720200 31.054894 0.583605 0.619505 0.391447
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.275592 14.545912 -0.013365 0.688095 0.803710 4.773697 4.420512 29.889261 0.627206 0.615580 0.390710
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 25.270410 0.811545 12.565455 -0.229577 7.494863 2.412233 17.175522 5.838800 0.038323 0.675008 0.501040
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.861546 6.205417 -0.507704 0.176865 0.025767 1.029907 2.420019 2.387880 0.659203 0.682460 0.414587
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.328132 2.169391 -0.493781 -0.255716 2.054930 1.294786 5.090373 10.309337 0.668880 0.687534 0.412596
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.404811 12.279829 9.813548 10.536889 7.263086 7.898269 4.230841 2.413071 0.031636 0.031393 0.001242
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 1.460659 13.020196 0.624112 10.446509 2.731854 7.927962 5.728451 5.500889 0.666913 0.033265 0.473052
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.233115 13.061930 0.092190 10.636121 -0.003851 7.838047 0.894796 1.992553 0.673135 0.036128 0.493978
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 21.739568 0.541916 6.017634 0.914403 7.017693 0.784720 13.539806 4.788618 0.538721 0.692621 0.413361
58 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.825545 11.882772 -0.634935 10.409807 -0.264134 7.870712 3.137204 2.482608 0.677134 0.035660 0.460082
59 N05 digital_ok 100.00% 100.00% 60.49% 0.00% 11.097676 11.473113 9.715805 10.326853 7.094988 7.297873 3.035960 3.831609 0.043318 0.218284 0.138670
60 N05 RF_maintenance 100.00% 0.00% 98.11% 0.00% -1.317099 11.745269 -0.062045 10.449177 -1.581674 7.897454 -0.892744 5.559984 0.678344 0.076643 0.495243
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 10.695422 0.061353 3.518162 -1.387449 6.246036 -1.713365 0.009095 1.435298 0.296204 0.656869 0.480588
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.338732 1.263259 -1.576233 1.187827 -0.913781 -0.239862 2.600433 -2.424241 0.620040 0.669700 0.408191
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.417722 12.120292 0.138253 4.715341 -0.423784 7.966091 -0.313401 5.298803 0.613758 0.042471 0.431089
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.998999 0.469145 -1.033371 0.272733 -1.114449 -1.240300 -0.304187 -1.746196 0.594299 0.635176 0.408793
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.257645 0.998951 0.205461 0.676799 0.761043 1.044757 -0.016573 1.315566 0.628585 0.665322 0.436516
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.130095 1.232654 1.681406 1.681564 2.482509 0.410122 0.052992 3.829040 0.638026 0.669227 0.425219
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.637892 -0.634113 1.882133 1.673727 -0.712239 0.088348 1.873410 3.074722 0.645032 0.673014 0.414518
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.745948 28.144291 0.329490 13.791208 0.118873 7.830586 0.281947 16.372016 0.661812 0.029972 0.478563
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.116224 -0.365891 0.113159 0.286580 -0.554565 0.795531 0.458975 1.721961 0.666111 0.690513 0.398045
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.406215 -0.449033 -0.771002 -0.453808 1.000400 1.076861 0.095949 0.026405 0.677749 0.697849 0.394587
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.303038 -0.259164 0.298443 0.859297 -0.231998 0.422556 -0.065836 1.250027 0.687829 0.699046 0.389748
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.414424 -0.204777 0.377422 0.818394 0.335745 -0.005468 2.858498 0.444237 0.676790 0.692977 0.382422
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.201667 0.298406 -0.831017 2.554985 0.148687 9.416997 -0.161561 0.481701 0.689467 0.687426 0.389608
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.128190 1.100931 0.141089 -1.123563 -0.796617 1.152173 -1.412174 3.073788 0.684389 0.694291 0.385952
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 22.008241 25.331837 0.367597 -0.842014 1.865727 2.458425 6.173171 1.310405 0.526952 0.497743 0.203394
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 32.100079 -0.305562 -0.279097 -0.184193 1.596405 -1.561759 -0.908435 0.860478 0.460394 0.653467 0.383157
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.214152 -0.326003 -0.654841 -0.978618 -0.717758 -1.052520 -0.012499 -1.022293 0.619433 0.651978 0.406500
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 9.336896 13.461691 2.462170 4.584663 5.037359 7.832064 24.816072 2.066238 0.299218 0.037861 0.191108
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% -0.629513 0.172822 -0.622173 3.887172 -0.139855 29.796170 0.275433 2.268748 0.065654 0.077423 0.015232
82 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 2.305882 -0.404387 -0.154736 1.613329 0.278023 -0.511417 -0.280673 -0.095327 0.063448 0.066410 0.011070
83 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.643441 -0.199143 -0.425700 0.011471 0.168653 -0.985259 -0.583119 0.760252 0.067915 0.065536 0.012170
84 N08 digital_ok 100.00% 42.81% 100.00% 0.00% 21.091197 24.922956 12.603639 13.328194 5.700774 7.777512 7.938011 9.056715 0.227416 0.035851 0.139159
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.089225 0.618935 -0.115911 0.291914 -0.934271 0.301837 0.539555 0.693376 0.663841 0.681625 0.394338
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% -0.012610 -0.362449 1.230690 0.537088 3.260919 -0.537104 0.736976 29.460833 0.655565 0.684599 0.384220
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 20.363479 7.054412 1.338151 -0.379472 11.808062 1.726980 4.229557 1.445702 0.578629 0.704905 0.358363
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.340834 0.173887 0.027280 0.737417 -0.675960 0.774076 0.676915 -0.236453 0.674447 0.693618 0.374156
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.186626 0.103308 -0.180036 0.505747 -0.888658 -0.380950 -0.430392 -0.299480 0.676271 0.694368 0.379845
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.363087 -0.549439 1.127454 0.956797 -0.098781 -0.718530 0.468011 6.431650 0.668338 0.688089 0.383821
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.650140 -0.373351 -0.009432 -0.006865 -0.412407 -0.134033 -0.096359 -0.382803 0.667257 0.694560 0.396712
92 N10 RF_maintenance 100.00% 0.00% 15.84% 0.00% 39.762130 46.567557 0.381508 0.698900 5.385419 6.367361 2.050882 18.259827 0.290825 0.246266 0.100448
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 1.905366 0.268366 1.995399 -0.053196 0.070443 0.867321 7.688084 -0.398714 0.655451 0.686794 0.406748
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 11.496611 -0.587100 9.944761 -0.402474 7.185917 0.685003 2.206540 2.808905 0.031281 0.680342 0.422646
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.230467 0.072940 -0.537799 0.890963 -0.156108 -0.523421 -0.712783 5.846118 0.627889 0.668321 0.414451
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.628135 13.038132 4.081601 4.752003 7.082884 7.773032 2.495063 1.593796 0.032562 0.036154 0.002255
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.841369 3.777384 0.438977 0.045299 -0.658898 -0.269052 -1.863051 21.314505 0.610952 0.600715 0.403008
98 N07 digital_ok 0.00% 100.00% 100.00% 0.00% 0.802916 1.187065 -0.180965 -0.062746 -0.223854 0.222482 0.042845 2.766558 0.066802 0.064168 0.013274
99 N07 digital_ok 100.00% 100.00% 100.00% 0.00% -0.434607 -0.810651 0.530239 0.667720 -0.829548 1.849867 4.573910 -0.277472 0.062008 0.056896 0.008699
100 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -1.341379 -0.847595 -0.325133 0.711900 1.768574 -0.346320 1.201623 2.917206 0.050766 0.055789 0.006041
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.600023 7.564584 -0.805980 0.669686 0.000977 0.746130 -0.123073 -0.111191 0.658283 0.678286 0.405990
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.248667 0.696251 -0.554391 1.886741 -0.078061 0.558597 -0.636112 16.377635 0.670553 0.677792 0.392534
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.509055 5.181591 3.870471 0.099471 2.305623 0.696657 15.483857 8.637206 0.649369 0.691799 0.390888
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.109934 60.733712 6.663001 7.392610 2.886000 7.448691 0.694592 3.092923 0.618557 0.663861 0.387573
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.174083 -0.446121 -0.397940 0.567828 1.042382 -0.297664 0.313790 -0.134896 0.679782 0.692731 0.372674
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.427440 0.104834 0.984588 0.886929 0.016459 -0.138062 0.436358 -0.198761 0.668711 0.693445 0.376254
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.688848 -0.273612 -1.368906 -0.932728 -0.461968 -0.321420 2.495222 6.441669 0.678005 0.697318 0.381893
108 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 10.498382 3.268175 9.738409 -0.597676 7.253610 0.070356 3.799967 0.114587 0.039453 0.699292 0.455570
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.335827 11.896596 9.798616 10.196347 7.333369 7.957592 1.404649 3.570539 0.028568 0.031088 0.001445
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 11.608108 26.590575 0.337394 13.491449 10.247348 7.726728 6.872849 8.236051 0.623519 0.029891 0.368089
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.062973 11.842592 0.214797 10.301217 0.207786 7.959229 -0.301682 4.587114 0.661782 0.034110 0.429434
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.161389 0.975361 -0.218443 -0.399171 0.856680 1.006048 0.823041 -0.379366 0.649810 0.671929 0.411555
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.440830 13.053035 3.867157 4.649888 7.098366 7.796026 3.412137 1.514582 0.033944 0.030683 0.001929
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 6.036610 0.764950 1.277303 -0.277901 6.926359 -1.252088 1.873222 -0.826727 0.508106 0.641154 0.439272
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.517855 1.452474 2.458992 1.737236 1.654592 0.452544 -4.006036 -1.440923 0.604939 0.639192 0.428999
116 N07 digital_ok 100.00% 100.00% 100.00% 0.00% -0.343636 0.282299 -0.022399 0.240287 0.269178 0.111549 4.026149 -0.116802 0.079859 0.072249 0.018307
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 11.391780 13.446950 9.832584 10.769847 7.127987 7.876416 2.991655 7.097612 0.026267 0.025076 0.000703
118 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.300354 0.696049 -0.407424 0.422817 -0.559252 -0.051056 0.062703 1.081606 0.057093 0.054781 0.006347
119 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 0.978297 1.247806 -1.170043 2.933528 0.471380 8.181727 -0.124306 4.286488 0.062225 0.066258 0.011371
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.686110 2.615278 2.274660 2.142254 0.418543 0.930351 1.886037 -3.935143 0.645283 0.680218 0.389850
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.240197 4.390286 -0.538474 0.959876 0.032905 1.546109 51.973572 26.932205 0.670007 0.690883 0.387694
122 N08 digital_ok 100.00% 100.00% 0.00% 0.00% 26.004366 6.792496 11.498298 0.344692 6.910193 1.076170 9.464060 -0.377602 0.081278 0.699934 0.490349
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.409191 8.630621 0.123899 0.695325 0.961680 0.455478 -0.164507 0.848496 0.686795 0.704560 0.383639
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.920205 -0.269608 -0.363605 0.260217 -0.304008 0.416832 0.870365 1.413815 0.685361 0.707147 0.381889
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.467747 -1.314196 -0.592704 0.608089 -0.048060 -0.260191 -0.209884 -0.308818 0.678633 0.696694 0.384052
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.334369 5.261255 -0.827692 1.067378 2.461810 1.160758 7.285028 2.466545 0.675657 0.693543 0.391477
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.157759 -0.121753 -0.309795 -0.048458 2.434278 1.454314 0.395036 1.309742 0.673607 0.699431 0.405015
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.657904 0.237199 1.254082 0.663342 -0.290780 1.608217 -0.063758 0.300492 0.666042 0.690909 0.404680
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.679170 -1.961014 -0.155403 0.087383 -0.408866 0.189112 -0.492932 -0.046813 0.663299 0.685725 0.411996
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.221813 0.618971 -0.254074 0.032223 -0.675279 0.488111 1.363635 7.106286 0.644121 0.673102 0.407271
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.471168 13.175075 4.132109 4.893603 7.202179 7.859361 4.832671 0.035851 0.032997 0.037962 0.001941
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.936328 0.341308 0.278632 -1.319176 -0.863636 -1.193311 -1.395130 -0.269957 0.613529 0.630133 0.414796
133 N11 not_connected 100.00% 100.00% 81.73% 0.00% 11.929668 17.890461 3.881171 3.332033 7.182013 6.882915 3.672357 2.298373 0.039840 0.176581 0.093261
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -1.130725 11.908901 -0.106193 10.512448 0.210302 7.853448 0.170822 2.581694 0.597247 0.036997 0.433102
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 6.884157 0.642177 8.463977 6.066612 9.291472 21.085223 0.967097 1.000143 0.344666 0.567680 0.426367
137 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.011683 -0.754176 -0.672183 -0.201724 1.753923 2.572530 2.447146 3.059757 0.064480 0.064086 0.010189
138 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.805224 -0.477725 0.591596 1.394970 0.148313 0.057367 2.548571 -0.252189 0.064886 0.064737 0.011838
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.899942 -0.507525 1.481040 -1.012120 0.005468 -1.571111 -2.479072 -0.491568 0.643433 0.659344 0.398501
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.693745 3.600778 0.079193 2.966510 -0.981296 3.077512 6.889514 -1.250432 0.662900 0.677878 0.387742
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.271410 -0.554656 -0.966481 0.641022 -0.764001 -1.302059 -0.087833 -2.503437 0.667479 0.692940 0.386404
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.302884 11.770347 -1.467674 10.453809 1.746409 7.910534 38.200178 3.619877 0.675833 0.045155 0.517248
143 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 10.653966 32.695727 9.889052 2.748778 7.056335 6.053910 0.916597 19.881731 0.035968 0.316719 0.209328
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.542286 -0.712284 -0.587684 3.358259 0.830026 -0.699330 -0.311945 0.400498 0.682480 0.685959 0.389288
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.128749 2.858909 -0.448728 7.377188 0.644292 16.602506 0.887379 2.880010 0.676163 0.597097 0.425243
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.700894 2.170030 3.892998 1.011987 7.174490 -0.505260 0.887067 -2.686552 0.037074 0.689363 0.512009
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.589788 -1.329501 1.270964 1.920601 3.124719 -0.344765 0.406982 0.025435 0.661271 0.685592 0.396995
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.789705 -0.350562 2.820360 1.403248 -0.874900 0.659964 0.012499 0.130539 0.649583 0.686939 0.412859
149 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.178752 1.309520 -1.197823 1.785930 -0.619467 -0.093419 -0.918314 -3.269002 0.661216 0.681331 0.412736
150 N15 RF_maintenance 100.00% 0.00% 100.00% 0.00% 4.791464 11.962627 3.661727 10.361886 6.127242 7.889793 -4.785507 1.982349 0.331278 0.037951 0.231386
155 N12 digital_ok 100.00% 100.00% 75.51% 0.00% 10.166848 0.213981 9.485225 -0.672931 7.339356 1.120092 1.737570 4.297150 0.034144 0.203082 -0.016335
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.204045 11.508267 -0.983161 10.172940 3.286562 7.939200 6.229552 1.515679 0.608139 0.051796 0.457035
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.011683 -0.162362 0.006865 0.358158 -0.058262 -0.085257 -0.168870 0.035590 0.614931 0.649227 0.427398
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.062727 -0.574104 -1.006781 -1.146782 1.888072 1.567900 11.760065 34.221805 0.636088 0.665021 0.425142
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.051009 16.356403 -1.514935 -1.156706 -1.419908 5.782532 0.104296 7.855364 0.616082 0.592807 0.388143
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.678168 -1.251158 -0.693031 -1.204668 -0.204356 1.003516 0.793822 0.653299 0.656223 0.679078 0.400855
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.796560 29.948117 -0.539461 -0.763485 -0.102772 0.326444 -0.096170 1.128554 0.662436 0.559591 0.354280
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.392181 0.079425 2.379114 1.310985 0.508920 -0.927234 -3.124895 -2.759475 0.671968 0.694687 0.385739
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.341886 0.963888 -0.603617 0.101576 -0.186184 1.026889 0.602939 2.269545 0.680210 0.694850 0.393884
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.325709 0.073637 3.260411 -0.598015 28.027081 1.649265 3.331753 2.717394 0.649687 0.696481 0.404987
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 29.283053 -0.191448 2.963309 0.233128 3.440550 0.001216 2.273058 0.031979 0.501535 0.688004 0.396801
166 N14 RF_maintenance 100.00% 12.32% 100.00% 0.00% 52.895926 11.158514 0.085519 10.030037 4.632489 7.930686 2.238944 2.391356 0.250958 0.030867 0.139590
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.777078 -1.266581 -0.804288 3.495198 0.866198 -0.915615 -1.190911 4.027322 0.676598 0.676768 0.409001
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.732723 -1.059519 -0.397014 -0.790716 1.419318 0.491848 0.493655 0.961699 0.665806 0.690772 0.412324
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.067715 1.717970 -1.339941 -1.424319 1.170981 -0.855740 0.973886 -1.176061 0.657760 0.671849 0.411224
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 11.164948 -0.514139 9.956360 -1.157375 7.111006 0.156478 2.032962 7.863699 0.036512 0.675833 0.517513
179 N12 RF_maintenance 100.00% 100.00% 82.86% 0.00% 11.293068 11.965924 9.943822 10.757487 6.974157 6.586078 1.669419 2.260926 0.064495 0.171330 0.099222
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.273197 12.663787 0.339868 10.577701 0.150234 7.852142 43.482153 4.466856 0.646877 0.050970 0.502314
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.447598 -0.218910 -0.610154 0.169307 -0.168565 0.437041 -0.281350 8.800914 0.664189 0.677853 0.399611
182 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.036646 4.224580 -1.206123 3.146935 -0.847976 3.195779 24.087691 -2.700164 0.672429 0.674558 0.393546
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.241939 1.719891 0.540212 4.782126 0.904470 -1.200182 1.836126 0.363974 0.665074 0.634178 0.388100
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 10.689888 12.252070 9.884859 10.463954 7.235073 7.901014 1.791021 2.173612 0.025956 0.025196 0.001133
185 N14 digital_ok 100.00% 3.73% 0.00% 0.00% 14.141440 -1.421164 8.744408 4.163702 7.992274 -1.194875 0.481640 0.132257 0.285303 0.656360 0.454866
186 N14 digital_ok 100.00% 100.00% 48.65% 0.00% 10.006698 12.440739 9.897401 8.803500 7.241600 6.551877 4.397665 2.811038 0.030105 0.227371 0.133335
187 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 10.736436 7.598689 9.644013 2.552085 7.372660 5.915044 4.590196 -0.970750 0.042899 0.350816 0.224323
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 8.996916 9.180099 1.588143 -0.105217 1.864726 5.966769 1.715754 0.491046 0.347852 0.374965 0.184164
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 44.566705 12.015126 -0.304069 10.540624 3.472584 7.870828 28.006780 5.559744 0.480369 0.033324 0.346732
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.002636 0.344712 3.473696 -0.098135 -0.212051 -0.035621 15.756955 0.573907 0.614505 0.659670 0.442493
200 N18 RF_maintenance 100.00% 100.00% 49.35% 0.00% 12.121744 36.444896 4.084351 0.606738 7.338270 6.839981 3.547772 -1.466636 0.045676 0.215829 0.138332
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.253120 6.313211 4.825508 4.091474 5.806073 5.444013 -6.152419 -5.612021 0.616526 0.639415 0.390488
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.989458 2.051186 0.810725 -0.425486 -0.573265 -0.616669 -0.249290 8.205097 0.650480 0.629630 0.394322
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.642651 13.911907 3.842141 4.452376 7.275063 7.944473 5.279890 5.762935 0.033004 0.041264 0.001998
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.902711 3.092023 0.652540 -1.438991 -1.035120 -0.184589 -1.619666 19.295932 0.640536 0.639067 0.397006
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.364171 1.758464 -1.381112 -1.017445 6.527562 -1.185716 0.114826 5.306552 0.620026 0.641458 0.394839
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.186709 2.667968 1.402345 -0.362749 0.326246 -0.488404 -2.402169 -0.342901 0.623955 0.640473 0.383643
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.359024 4.381033 4.943036 3.263219 6.041784 4.100979 -6.256397 -4.757020 0.608182 0.644621 0.416559
220 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.761036 -0.471390 0.028948 -0.265236 -1.286651 -1.064450 4.838472 -1.158119 0.638447 0.646833 0.401870
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 1.729187 0.326693 -0.957473 -0.490087 0.175942 -1.588444 4.829797 -0.110411 0.612728 0.653186 0.410799
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.833488 0.663053 0.731135 -0.440253 -0.683703 -1.763063 8.440344 0.560226 0.642390 0.654925 0.408864
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.670814 1.004766 -1.547906 -1.102499 -0.992935 -1.363877 -0.077932 0.364197 0.624245 0.647926 0.404592
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.368362 6.868239 5.013000 4.577947 5.991031 6.362285 -6.394068 -6.299136 0.612960 0.628327 0.406195
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
227 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
228 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
229 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 5.496108 1.638446 1.234357 -1.182818 0.437843 -1.364363 9.180737 -0.994645 0.524808 0.628040 0.442571
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.613710 -0.547104 1.224355 0.798761 -0.606697 -0.608466 -2.593425 -2.759459 0.638053 0.646298 0.416728
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.427518 2.336295 -0.273456 0.781798 -1.566165 -0.737846 2.607839 8.310528 0.631781 0.590746 0.421665
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
241 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
242 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
243 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
245 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
246 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
261 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.171131 13.145058 -0.668385 6.836866 -0.326718 7.936455 9.812496 5.327933 0.625062 0.046647 0.488547
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.108093 2.590985 1.173466 1.470667 0.139218 0.673022 -1.680976 -2.750308 0.523571 0.541779 0.407066
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.833067 -1.114812 1.292981 -1.340059 0.231064 -0.563451 -2.745786 0.082900 0.557062 0.558265 0.418410
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.536533 -0.867778 -1.307483 -0.368233 -0.611818 -1.281661 0.730761 -1.262163 0.493591 0.544607 0.410692
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.313630 0.649246 -1.123741 -1.475676 -1.652246 -1.408807 2.083320 0.183387 0.488295 0.535263 0.407097
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, 7, 8, 9, 15, 18, 19, 21, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 42, 45, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 63, 68, 71, 73, 77, 78, 80, 81, 82, 83, 84, 86, 87, 90, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 107, 108, 109, 110, 111, 113, 114, 116, 117, 118, 119, 121, 122, 123, 126, 130, 131, 133, 135, 136, 137, 138, 140, 142, 143, 145, 146, 150, 155, 156, 158, 159, 161, 164, 165, 166, 167, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 202, 203, 205, 206, 208, 209, 210, 211, 219, 220, 221, 222, 224, 225, 226, 227, 228, 229, 237, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320]

unflagged_ants: [4, 5, 10, 16, 17, 20, 22, 35, 40, 41, 43, 44, 46, 48, 62, 64, 65, 66, 67, 69, 70, 72, 74, 79, 85, 88, 89, 91, 105, 106, 112, 115, 120, 124, 125, 127, 128, 129, 132, 139, 141, 144, 147, 148, 149, 157, 160, 162, 163, 168, 169, 207, 223, 238, 324, 325, 329, 333]

golden_ants: [5, 10, 16, 17, 20, 40, 41, 44, 65, 66, 67, 69, 70, 72, 85, 88, 91, 105, 106, 112, 124, 127, 128, 129, 141, 144, 147, 157, 160, 162, 163, 169]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459903.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.dev6+gfb03830
3.1.5.dev171+gc8e6162
In [ ]: