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 = "2460109"
data_path = "/mnt/sn1/2460109"
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: 6-13-2023
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/2460109/zen.2460109.42116.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 361 ant_metrics files matching glob /mnt/sn1/2460109/zen.2460109.?????.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/2460109/zen.2460109.?????.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 'startTime' 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 2460109
Date 6-13-2023
LST Range 16.999 -- 18.940 hours
X-Engine Status ❌ ✅ ❌ ❌ ✅ ❌ ❌ ❌
Number of Files 361
Total Number of Antennas 202
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
RF_maintenance: 67
RF_ok: 18
digital_ok: 84
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 202 (0.0%)
Antennas in Commanded State (observed) 0 / 202 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 54 / 202 (26.7%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 93 / 202 (46.0%)
Redcal Done? ❌
Never Flagged Antennas 109 / 202 (54.0%)
A Priori Good Antennas Flagged 32 / 84 total a priori good antennas:
9, 15, 17, 37, 40, 41, 42, 51, 86, 112, 118,
121, 123, 140, 141, 144, 145, 146, 153, 161,
162, 163, 164, 165, 173, 181, 183, 186, 187,
192, 193, 202
A Priori Bad Antennas Not Flagged 57 / 118 total a priori bad antennas:
8, 22, 35, 36, 43, 46, 48, 49, 50, 52, 57,
58, 60, 64, 68, 73, 74, 77, 79, 80, 84, 89,
95, 97, 102, 108, 114, 115, 132, 133, 134,
135, 136, 155, 179, 204, 206, 210, 220, 221,
222, 223, 226, 228, 229, 237, 238, 239, 240,
241, 242, 243, 244, 245, 261, 324, 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_2460109.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 0.00% 0.00% 0.00% 0.00% -0.108546 -0.902492 -0.058199 -1.266148 0.180106 -1.081887 0.169221 -0.583714 0.743433 0.672460 0.443656
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.633527 5.433387 -0.325266 -0.338460 -1.096920 0.432592 -0.817644 0.085720 0.747365 0.618815 0.437240
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.315353 2.242718 -0.074106 3.936080 0.214276 2.859321 0.220705 1.865286 0.763908 0.699098 0.448659
7 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.305395 -0.870500 -1.131408 -0.939165 -0.875832 -0.476873 2.189589 1.908176 0.757097 0.697060 0.448472
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.649727 2.889285 2.537242 2.768638 1.791066 2.201795 -0.418508 -0.625658 0.734839 0.668419 0.446743
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 2.554785 -0.039862 4.499046 0.209906 3.480947 0.748891 3.020367 0.390403 0.760854 0.696126 0.450095
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.838182 -1.128614 1.063170 -1.011514 0.142573 -1.575529 -0.890225 -0.514774 0.755637 0.689627 0.462087
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 5.126267 -1.015065 0.638144 -1.130814 -0.264679 -0.614207 0.573663 -0.240089 0.702986 0.700325 0.386616
16 N01 RF_maintenance 100.00% 100.00% 52.08% 0.00% 4.597421 5.131287 23.444456 23.968356 3.561025 3.748535 3.371420 3.373785 0.049740 0.220503 0.151307
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.967330 2.947671 1.714273 5.529564 1.731227 3.184933 1.113224 4.298927 0.785983 0.724272 0.445238
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.329264 5.094925 0.554024 2.390071 0.528634 1.176913 10.053442 26.132542 0.730601 0.535068 0.517659
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.051252 1.249488 -1.104737 1.375611 -0.601778 0.638392 -0.235900 -1.087245 0.781470 0.708421 0.452571
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.307739 0.078986 0.317120 0.631025 0.873727 1.133474 1.023719 0.800099 0.782826 0.718934 0.449882
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.676582 -0.538567 -0.959156 -0.477952 -0.678849 -0.699271 -0.083565 -0.028656 0.781205 0.711936 0.462025
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.228290 -1.283231 1.735510 -0.721044 0.841069 0.360805 1.418987 0.146716 0.719484 0.647241 0.454994
27 N01 RF_ok 100.00% 100.00% 0.00% 0.00% 9.851693 10.275586 21.655463 9.250834 4.199523 4.537719 14.214432 34.274420 0.071986 0.264343 0.193215
28 N01 RF_ok 100.00% 0.00% 0.00% 0.00% -0.210328 9.846650 0.352006 9.204434 1.061307 1.977899 0.274181 22.310598 0.782945 0.445041 0.607287
29 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.480578 5.413680 23.103956 23.404120 3.539982 3.987071 4.184975 4.743318 0.040641 0.064727 0.023711
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.881835 -0.744882 1.102227 -0.944530 0.355809 -1.345011 -0.955726 -0.668363 0.788303 0.741244 0.436697
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.578868 1.098126 -0.422546 1.396689 -0.112563 1.555094 0.112879 1.056058 0.796030 0.739018 0.443648
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.058703 -0.893240 0.910160 -1.127544 0.470734 -0.961048 0.657042 -0.056439 0.753291 0.733119 0.395810
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 4.996465 0.601646 14.743361 0.429711 3.572140 -0.365382 3.563885 -0.629960 0.062370 0.665355 0.507955
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.775278 -0.348178 0.725983 -0.463842 -0.083787 -1.139921 -0.844650 -0.568750 0.726739 0.652700 0.451174
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.376806 0.968036 0.832427 0.203975 0.790977 0.196197 0.715120 0.647869 0.728002 0.640524 0.420010
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 4.514109 3.578621 7.250344 9.650906 3.869566 4.066816 2.940583 7.555132 0.745090 0.660972 0.422505
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.833967 0.154977 -0.927974 0.792962 -0.445725 0.881566 0.624140 3.463940 0.751312 0.683676 0.421829
40 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.268501 0.671837 0.824296 0.754646 1.135641 0.761805 0.732727 21.733868 0.777651 0.720039 0.432252
41 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.674526 2.575944 -0.194275 4.933553 -0.221552 3.158443 0.029693 1.931699 0.789812 0.733276 0.429777
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.240821 4.007511 -0.069748 8.607858 0.078226 3.706103 0.213323 3.051181 0.801238 0.739132 0.442039
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.047644 -0.055816 -1.292050 0.288488 -0.933110 0.436250 0.043266 1.196950 0.750795 0.691385 0.435703
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.307453 -0.138377 -1.184878 -0.187302 -1.310696 -0.212860 -0.008691 0.710335 0.733075 0.673479 0.441711
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.143186 -0.080029 0.599035 -0.233516 0.678165 -0.263988 1.066794 0.668021 0.755017 0.690691 0.448625
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.751972 -0.746404 -0.516130 -0.428962 -0.304059 -1.433760 0.629543 -0.340070 0.751936 0.681010 0.465041
47 N06 not_connected 100.00% 0.00% 100.00% 0.00% 3.991074 5.500519 14.045436 14.197858 2.710125 3.964436 4.051610 3.293694 0.369931 0.125959 0.268674
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.186035 0.953309 -0.176031 1.005606 -0.816900 0.239855 -0.491642 -0.746407 0.725126 0.643574 0.442704
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.512406 0.059585 0.374686 0.040781 0.266924 -0.731431 0.935808 -0.632372 0.709354 0.625774 0.439121
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.463258 -0.240614 -0.147570 0.254482 0.105819 0.414709 0.106976 0.246957 0.729664 0.638171 0.422854
51 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.001354 -0.218427 -0.752457 0.960592 -0.472435 1.300701 25.120435 0.813811 0.739849 0.664019 0.413114
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.834928 0.449392 1.231096 -0.536810 1.089625 -0.484766 1.542277 0.123241 0.758441 0.681049 0.417343
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.594165 -0.581080 -0.385522 -0.707888 0.293715 0.137989 2.467629 1.506386 0.769221 0.705183 0.414314
54 N04 dish_maintenance 100.00% 0.00% 0.00% 0.00% 11.103282 2.079205 6.571069 6.894293 3.968144 2.795656 3.464106 2.859027 0.449637 0.506091 0.204574
55 N04 RF_maintenance 100.00% 100.00% 0.00% 0.00% 22.453350 -0.400435 17.363794 -0.243436 4.268216 -0.793186 2.854240 0.859410 0.065337 0.724099 0.548753
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.480143 1.444925 -0.877858 0.888756 -0.750031 0.557031 -0.327569 0.606911 0.803689 0.746053 0.424213
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.533118 -0.734920 -0.824843 -0.983874 0.008333 -0.743208 -0.011433 0.008966 0.813185 0.755685 0.429837
58 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.916591 2.641257 2.745603 2.587974 1.975089 2.050813 -0.335912 -0.617506 0.712179 0.653935 0.437575
59 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.165753 6.479614 0.147106 24.110655 0.389653 4.005564 0.794097 3.921822 0.739788 0.072446 0.573603
60 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.407770 -0.408308 -0.010284 -0.075701 0.581439 0.214182 0.787383 2.097533 0.750476 0.688324 0.455536
61 N06 not_connected 100.00% 100.00% 0.00% 0.00% 5.057132 -1.182596 14.085784 -1.321869 3.582769 -1.507351 3.331913 0.210904 0.039081 0.674404 0.510925
62 N06 digital_ok 0.00% 0.00% 0.00% 0.00% 0.450724 1.591644 2.651119 1.227937 1.441246 0.463852 1.903714 -0.805399 0.716104 0.650462 0.430885
63 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.075909 3.784935 -0.297001 3.585191 -0.976598 3.095826 -0.411346 -0.389189 0.716636 0.603409 0.443489
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.471688 -1.128358 -0.784385 -0.663979 -1.350904 -0.847027 -0.261068 0.370458 0.701972 0.620054 0.428312
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.046389 -0.801747 0.187641 -1.209366 0.768212 -0.851005 0.242200 -0.307103 0.733939 0.635568 0.429265
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.156157 -0.452058 0.086890 0.191993 0.048830 0.397965 0.117845 0.678733 0.735955 0.660664 0.413437
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.984003 0.355198 -0.937051 0.862994 -0.465606 0.631476 0.828433 1.086993 0.759145 0.687396 0.416749
68 N03 RF_ok 0.00% 0.00% 0.00% 0.00% 1.184807 1.297573 1.489813 2.040424 1.169695 1.777346 1.214236 3.925682 0.774539 0.704984 0.419895
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.576662 -0.255363 0.466565 -0.429630 0.361581 -0.364183 1.348255 -0.063823 0.785789 0.723135 0.421967
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.750984 0.298281 2.573248 0.472980 1.627768 0.301798 1.258857 0.775567 0.797130 0.740958 0.424192
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.754587 -0.326606 -1.115771 -0.098291 -0.919375 0.344452 -0.479702 0.206945 0.805424 0.749729 0.429023
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.006750 -0.607922 -0.411010 -0.485742 -0.176693 -0.106981 0.044140 -0.118128 0.811612 0.758780 0.432729
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.489157 2.474731 -0.473698 3.710487 -0.420457 3.828370 0.946744 2.957672 0.759374 0.700125 0.443693
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.966257 -1.059527 -0.474041 -1.267242 -0.654143 -0.496362 -0.310934 0.322753 0.753849 0.694737 0.442735
77 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.847450 0.949788 -0.753479 -0.476295 0.449048 -0.204398 -0.040794 -0.046403 0.696651 0.643957 0.348129
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 5.866448 1.351223 0.669768 1.345111 0.443357 0.599186 1.070427 -0.660695 0.634480 0.644373 0.365679
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.219871 -0.651972 0.461975 -0.667850 -0.268540 -1.225870 0.426261 -0.822126 0.773418 0.701372 0.431917
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.137869 2.549468 0.174230 2.509762 -0.670648 1.882040 -1.005029 -0.861233 0.758938 0.662663 0.444004
81 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
83 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
84 N08 RF_ok 0.00% 0.00% 0.00% 0.00% 2.093729 2.853378 1.946914 2.685973 1.242291 2.213720 -0.878583 -0.731283 0.752220 0.673691 0.416353
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.173027 -0.832345 -0.029001 -1.277922 -1.073129 -1.061933 -1.051563 -0.536857 0.781559 0.718160 0.428162
86 N08 digital_ok 100.00% 100.00% 0.00% 0.00% 4.639525 -0.546214 21.008262 -0.573759 3.566309 -0.191824 2.328882 4.315125 0.079009 0.731545 0.505620
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 18.045105 0.897088 5.025526 -1.136355 1.804357 -0.994609 2.438062 -0.511097 0.757696 0.746815 0.354762
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.272587 0.579879 0.365316 1.633818 0.435215 1.296530 0.582594 0.800344 0.807512 0.753971 0.429318
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.226906 -0.022207 0.469646 0.663473 0.747091 0.867190 0.277967 0.385118 0.814166 0.757593 0.441340
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.647337 2.065628 0.507785 6.953793 -0.432841 20.869577 -1.087871 7.938863 0.808526 0.738913 0.444219
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.000656 -0.218077 0.524576 0.243094 0.680134 0.594830 0.333337 0.131105 0.811243 0.749999 0.456024
92 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.380223 5.038653 23.619161 23.997081 3.532928 3.985427 5.227355 5.113548 0.027101 0.026886 0.001456
93 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.564610 5.415389 23.513777 24.287103 3.575741 4.012938 4.784124 5.876683 0.028172 0.040313 0.005345
94 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.177412 3.317717 0.461831 5.211049 0.742826 3.655917 1.210470 3.018977 0.769951 0.694206 0.442811
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.983345 0.431248 -1.010133 0.572789 -1.446277 -0.184966 -0.323846 -1.016318 0.774822 0.704851 0.430105
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.351943 4.592548 1.227922 -0.468729 0.375023 -0.297436 -1.056423 0.721040 0.765540 0.644281 0.393425
97 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.708541 1.443061 -0.654230 1.871420 -1.521208 0.959516 -0.790460 2.137683 0.758276 0.671210 0.436042
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.134369 1.461972 -0.521805 0.551328 0.080535 0.670817 0.038531 0.556527 0.767541 0.691399 0.429279
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.688905 -0.680003 -0.633861 -1.246114 -1.220914 -1.412807 -0.868566 0.462340 0.776515 0.707703 0.428042
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.089825 0.440220 -0.280182 -0.251259 -1.100553 -0.173322 -0.901580 0.556767 0.780072 0.723746 0.415498
104 N08 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.130803 24.321958 5.651595 10.888770 3.586160 4.680968 2.647372 2.828838 0.793999 0.719156 0.441469
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -1.126238 -0.392789 -1.193349 0.042892 -0.495797 0.043046 -0.154034 0.056992 0.799029 0.743696 0.431530
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.128304 -0.834374 -0.163536 -0.130122 0.074633 -0.211300 0.154740 -0.063106 0.804050 0.747156 0.443396
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.102800 0.656964 -0.028956 -1.069437 -0.161558 -0.967068 1.611491 0.261346 0.806466 0.745741 0.427866
108 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.177658 0.269358 -1.065187 0.198664 -0.921347 0.275977 -0.257813 0.168031 0.805326 0.749035 0.453932
109 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.205246 5.254746 3.870223 23.763967 23.547785 4.000012 8.467351 4.833328 0.463072 0.054316 0.318559
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.174201 -0.485823 3.848177 0.195681 1.463262 0.603796 1.944782 0.567635 0.716550 0.696591 0.365370
111 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.676583 0.985189 2.091149 1.129522 1.636674 0.581706 8.283593 1.049484 0.729130 0.691659 0.396772
112 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 1.786113 0.756913 19.445214 0.779350 -0.463059 0.168958 3.578581 -0.838049 0.632413 0.673545 0.403939
113 N11 not_connected 100.00% 0.00% 0.00% 0.00% 3.462680 3.638382 3.211610 3.457275 2.447047 2.968011 -0.621599 -0.492553 0.748981 0.673400 0.422282
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 3.051940 -0.052023 2.812129 -0.568324 2.114096 -1.279268 -0.769873 -0.868811 0.743304 0.688034 0.414621
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.241876 0.334006 -1.279609 0.404011 -0.749119 -0.320081 -0.514933 -1.053999 0.746422 0.662678 0.425819
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
118 N07 digital_ok 100.00% 96.68% 96.68% 0.00% 65.957104 65.962409 inf inf 224.715480 224.591205 1213.445236 1213.121112 0.998952 0.997695 0.086668
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.485432 -0.814719 3.192803 -0.454843 3.230433 0.546122 8.245604 4.099213 0.763956 0.690912 0.429981
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.192790 4.007232 2.188343 9.267275 1.316472 4.089335 -0.801707 6.408776 0.756285 0.702067 0.414849
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.968712 1.015075 -0.936860 -0.683444 -0.789446 -1.480987 -0.356872 -0.895339 0.785255 0.716745 0.441842
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.231746 1.917514 2.943230 1.660667 2.235875 0.836166 -0.085858 -1.073767 0.761978 0.715316 0.440008
124 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.447358 5.460307 23.921929 24.446932 3.567237 4.033647 3.835750 7.235305 0.064558 0.068237 0.002061
125 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.634210 -0.196808 3.628829 0.495540 5.053598 0.560866 2.444857 0.336945 0.797752 0.743075 0.455998
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.339595 -0.161622 2.905747 0.090902 0.386264 0.079051 3.440730 0.121083 0.769593 0.741948 0.412892
127 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 4.528449 2.956456 23.605922 3.286099 3.540166 3.576837 3.498718 4.536659 0.055044 0.452853 0.300815
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.298798 -0.674504 0.132414 -1.029005 0.053436 -0.914177 0.713915 1.111340 0.770228 0.706180 0.450807
131 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.104407 4.253760 -0.141066 14.137441 -0.449846 2.062439 -0.944413 1.910136 0.776166 0.468958 0.497363
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.098973 -1.106448 -0.236656 -0.973641 -0.981043 -1.461051 -0.929175 -0.752674 0.769886 0.698173 0.419414
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.261889 -0.412534 -1.112157 -0.396945 -1.639962 -1.274641 -0.641493 -0.910323 0.755864 0.675884 0.422322
134 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.040086 2.758706 3.861934 2.688825 1.545391 2.082503 3.942180 -0.818261 0.713127 0.628578 0.424331
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.000656 0.416971 -0.375031 0.823052 -0.588522 3.340382 -0.775082 1.357489 0.703222 0.612694 0.426484
136 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.857578 3.436155 -0.748508 0.742371 -1.168399 0.257920 -0.747787 2.025977 0.724868 0.624138 0.434045
137 N07 RF_maintenance 100.00% 96.68% 96.68% 0.00% 65.956627 65.961281 inf inf 125.537688 125.855214 417.262658 419.488739 0.998952 0.997695 0.086668
139 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
140 N13 digital_ok 100.00% 99.72% 99.72% 0.00% 52.258582 50.058272 inf inf 800.225096 806.081945 3992.039726 4175.715404 0.466543 0.489730 0.369337
141 N13 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.284562 0.413312 0.202922
142 N13 RF_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.901175 0.893820 0.813524
143 N14 RF_maintenance 100.00% 99.72% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.567104 0.046836 0.550249
144 N14 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.714498 0.701543 0.589322
145 N14 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.695099 0.565972 0.531242
146 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.028694 0.054844 0.043945
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 2.182219 0.221397 2.836619 0.782358 2.739253 0.772998 1.466321 0.592254 0.802341 0.741885 0.454972
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.006937 0.082480 0.265742 0.360386 0.470593 0.105947 0.175194 0.155380 0.800275 0.739377 0.447174
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.937689 -0.450208 1.240572 -0.344265 1.232036 -0.099789 1.149275 -0.077292 0.795952 0.733112 0.435434
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.433308 -0.377343 0.483869 -0.205775 0.661218 0.031024 0.471648 0.008691 0.785193 0.716329 0.424944
151 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.387692 -0.212646 -0.746062 0.775530 0.093940 0.075631 -0.306248 1.217584 0.720545 0.699498 0.361016
152 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.938634 -1.073274 -1.259188 -1.179989 -1.150792 -1.667557 -0.312181 -0.666012 0.756366 0.674431 0.416251
153 N16 digital_ok 100.00% 100.00% 0.00% 0.00% 4.553520 -0.878725 14.312400 -0.829193 3.562932 0.450778 3.508640 -0.200829 0.067904 0.652294 0.458683
154 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.107789 -0.440724 0.047325 -0.635309 -0.776438 -1.403910 -0.963712 -0.824472 0.717480 0.621966 0.420428
155 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.246259 -0.734730 1.392049 -0.829792 0.569481 -0.963704 -0.993791 -0.694366 0.697424 0.607980 0.425773
156 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.966496 -0.127424 6.303456 0.307264 3.534742 0.505097 3.643923 0.243331 0.725189 0.624719 0.430946
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.040361 -0.065321 -0.032094 0.186232 -0.003334 0.265735 0.147356 0.145039 0.735768 0.644462 0.431650
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.780515 -0.777230 -0.538586 -0.562700 -0.283678 -0.377496 0.368480 1.019877 0.746762 0.659364 0.445458
159 N13 RF_maintenance 100.00% 99.72% 99.72% 0.00% 91.671830 91.662472 inf inf 833.324341 832.675731 4655.564132 4588.496069 0.753057 0.731479 0.650041
160 N13 RF_maintenance 100.00% 99.72% 99.72% 0.00% 79.778826 79.802494 inf inf 839.767938 829.216804 4721.212461 4598.218278 0.771513 0.807168 0.747965
161 N13 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
162 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 89.973023 89.877282 inf inf 815.192991 810.026520 4376.436493 4241.917180 nan nan nan
163 N14 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.469976 0.652130 0.506834
164 N14 digital_ok 100.00% 99.72% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.614619 0.094692 0.529753
165 N14 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.518957 0.958001 0.873513
166 N14 RF_maintenance 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.655079 0.741756 0.567531
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.018514 0.179851 0.158634 0.595001 0.557764 0.558063 0.275543 0.705478 0.790126 0.733001 0.452306
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.115973 -0.699617 0.488065 -0.109362 0.582618 0.025462 0.366573 0.101085 0.793897 0.734656 0.443535
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.157508 -1.112522 0.302209 -0.786906 0.455103 -0.529519 0.245576 -0.243825 0.793080 0.728431 0.435660
170 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 2.463688 0.641268 3.317478 0.670046 2.117984 0.642645 2.075770 0.400421 0.785637 0.720561 0.428845
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.005288 -0.562339 1.372503 0.368657 0.351457 -0.355181 0.647908 0.118400 0.762974 0.695452 0.415770
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.397699 -0.448202 0.434528 -0.735211 -0.346384 -0.987334 -0.992138 -0.245592 0.749676 0.674436 0.419545
173 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.367996 3.581968 3.123048 3.362323 2.273902 2.835305 -0.664212 -0.524380 0.709193 0.618911 0.417519
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.100066 0.551503 1.737302 1.072297 1.597379 1.034928 0.901037 0.674518 0.744440 0.658448 0.452536
180 N13 RF_maintenance 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.704436 0.633197 0.528836
181 N13 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.856566 0.843903 0.464381
182 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
183 N13 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
184 N14 dish_maintenance 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.884204 0.486281 0.570874
185 N14 RF_maintenance 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.608888 0.729605 0.631162
186 N14 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.811873 0.907324 0.707361
187 N14 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.860870 0.892597 0.611098
189 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 2.095575 2.598560 2.112948 2.519314 1.244776 1.869739 -0.882693 -0.819443 0.757181 0.688297 0.436175
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.059628 -0.674478 0.010284 -0.363422 0.475276 -0.172455 0.402995 -0.056617 0.783656 0.711547 0.426689
191 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.055289 0.557325 0.403916 0.847079 0.418276 0.860267 1.773848 0.529416 0.775709 0.702394 0.422177
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.608164 3.908048 3.373421 3.671889 2.641059 3.211525 -0.515976 -0.367604 0.722063 0.641136 0.417081
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.660911 3.376517 3.417359 3.222749 2.666742 2.717652 -0.519492 -0.603335 0.705556 0.622609 0.415311
200 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.025310 0.041690 -0.009979
201 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.117727 0.182106 0.070020
202 N18 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.198702 0.012970 0.086902
204 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.926469 2.211342 0.292329 -0.628313 0.304392 -0.604717 0.844913 -0.268270 0.772015 0.707890 0.440103
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.290018 0.680446 8.846869 1.371091 0.108839 0.575476 3.340063 1.350816 0.714604 0.711378 0.446456
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.947245 0.547745 2.569176 2.462087 1.114243 1.040938 1.156957 1.084863 0.769761 0.711446 0.432480
207 N19 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.009561 7.254068 14.078450 6.149830 3.565652 4.133856 3.486698 3.404164 0.062365 0.444538 0.339718
208 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% 1.841280 6.391783 11.876229 24.026440 2.509699 3.553566 3.694202 45.497131 0.770109 0.052633 0.656906
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 4.511412 5.385690 21.947000 23.202090 3.465196 3.521975 15.255881 27.260759 0.038807 0.047354 0.005104
210 N20 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.972883 1.534716 -0.190000 0.162263 0.185429 0.340680 0.149253 0.143216 0.775886 0.698356 0.425632
211 N20 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.788232 5.345046 -0.516079 15.010286 -0.769255 4.000430 -0.027902 4.335026 0.751500 0.057959 0.625889
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.357379 -0.808433 -0.316559 -1.132381 -0.693056 -0.452338 -0.435746 -0.674464 0.745994 0.671199 0.454853
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.614832 -0.561951 0.441859 -0.589510 -0.389854 -1.370575 -0.728727 -0.892592 0.752376 0.686709 0.454582
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.338352 0.275620 -0.262117 0.204303 -0.810285 -0.612493 -0.686183 -1.064827 0.763148 0.697108 0.452325
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.096516 0.960758 -0.678935 2.629518 -0.822223 1.018025 -0.265649 1.480342 0.767541 0.696449 0.450686
224 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.920891 3.720777 3.657166 3.546098 2.912976 3.054898 -0.331720 -0.449442 0.738835 0.678828 0.440536
225 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.973716 4.178137 0.928029 13.921767 0.101522 2.537871 -1.083604 3.507162 0.768120 0.421611 0.567364
226 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.344918 1.955556 -0.492418 -0.156311 -1.245294 0.297606 -0.856522 -0.594901 0.770018 0.667368 0.425932
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 0.160931 0.037511 0.886433 -0.209955 -0.130238 -1.004781 8.604564 -0.584225 0.761566 0.694021 0.427744
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.535170 -0.892295 0.114458 -1.323885 -0.600777 -1.243495 -0.299632 0.021867 0.757067 0.683870 0.420667
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.800068 1.253779 0.680879 1.293332 0.042683 0.657493 -1.084229 -1.167176 0.744610 0.662120 0.436023
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.270646 -0.886196 0.283779 -0.860246 -0.156126 -1.418466 0.237726 -0.802394 0.732857 0.661529 0.453042
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.939587 0.907979 0.882956 1.057075 0.003334 0.319661 -1.094280 -1.141748 0.744377 0.670056 0.455311
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.813223 0.540608 -0.772806 0.516349 -1.204732 -0.409918 -0.760772 -1.086145 0.755612 0.680769 0.453639
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.777057 -0.518130 -0.459840 -0.553891 -1.304110 -1.461345 -0.793232 -0.785893 0.760966 0.692658 0.450086
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.211137 0.038232 -0.191586 0.182629 -1.064985 -0.763285 -0.840038 -1.065764 0.763288 0.693908 0.449894
242 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.596262 0.839950 -0.820096 0.785108 0.098480 -0.044850 -0.218274 -1.120969 0.709682 0.687553 0.388114
243 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.137344 -0.949346 0.605657 -0.958803 0.924241 -1.637967 0.346062 -0.721669 0.716306 0.686972 0.400767
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.600085 0.403339 -0.447296 1.109225 -0.734044 1.170885 0.050006 1.084035 0.758375 0.683043 0.439822
245 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.668304 -0.627535 0.518969 -0.808943 -0.361689 -1.627543 -1.059335 -0.240374 0.752705 0.675795 0.438039
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% 1.778700 5.435846 6.988644 14.248996 0.340856 3.982842 3.135995 3.456423 0.695328 0.055563 0.580905
261 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.675020 0.090265 0.499432 -0.026611 -0.152356 -0.669912 -1.060060 -1.040238 0.736525 0.660792 0.439458
262 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.687727 2.399608 2.025222 -0.048825 13.269043 0.145638 4.653955 0.115851 0.736496 0.656283 0.439940
320 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.262416 -0.098158 -0.758933 -0.618829 -1.146494 -1.117770 -0.448907 -0.606775 0.611598 0.427034 0.366739
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.431477 1.782617 1.129436 1.471683 0.398531 0.853768 -0.855663 -1.002264 0.599288 0.417749 0.363267
325 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.892332 -0.943524 0.951271 -1.200157 0.083812 -0.976886 -0.961032 -0.508231 0.643003 0.492374 0.384186
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 4.885411 5.317161 14.348962 15.095264 3.589294 4.026845 3.264537 4.069590 0.060059 0.055371 0.005148
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.444848 -0.082822 0.738847 -1.003840 -0.075664 -1.323336 1.110406 -0.534487 0.568674 0.378567 0.323021
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: [4, 9, 15, 16, 17, 18, 27, 28, 29, 32, 34, 37, 40, 41, 42, 47, 51, 54, 55, 59, 61, 63, 78, 81, 82, 83, 86, 87, 90, 92, 93, 94, 96, 104, 109, 110, 111, 112, 113, 117, 118, 120, 121, 123, 124, 125, 126, 127, 131, 137, 139, 140, 141, 142, 143, 144, 145, 146, 153, 156, 159, 160, 161, 162, 163, 164, 165, 166, 173, 180, 181, 182, 183, 184, 185, 186, 187, 192, 193, 200, 201, 202, 205, 207, 208, 209, 211, 224, 225, 227, 246, 262, 329]

unflagged_ants: [3, 5, 7, 8, 10, 19, 20, 21, 22, 30, 31, 35, 36, 38, 43, 44, 45, 46, 48, 49, 50, 52, 53, 56, 57, 58, 60, 62, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 77, 79, 80, 84, 85, 88, 89, 91, 95, 97, 101, 102, 103, 105, 106, 107, 108, 114, 115, 122, 128, 132, 133, 134, 135, 136, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 167, 168, 169, 170, 171, 172, 179, 189, 190, 191, 204, 206, 210, 220, 221, 222, 223, 226, 228, 229, 237, 238, 239, 240, 241, 242, 243, 244, 245, 261, 320, 324, 325, 333]

golden_ants: [3, 5, 7, 10, 19, 20, 21, 30, 31, 38, 44, 45, 53, 56, 62, 65, 66, 67, 69, 70, 71, 72, 85, 88, 91, 101, 103, 105, 106, 107, 122, 128, 147, 148, 149, 150, 151, 152, 154, 157, 158, 167, 168, 169, 170, 171, 172, 189, 190, 191, 320, 325]
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_2460109.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.1.1.dev3+gb291d34
3.2.3.dev158+gd5cadd5
In [ ]: