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 = "2459968"
data_path = "/mnt/sn1/2459968"
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: 1-23-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/2459968/zen.2459968.21321.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1849 ant_metrics files matching glob /mnt/sn1/2459968/zen.2459968.?????.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/2459968/zen.2459968.?????.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 2459968
Date 1-23-2023
LST Range 2.729 -- 12.681 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1849
Total Number of Antennas 196
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 196 (0.0%)
Antennas in Commanded State (observed) 0 / 196 (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 57 / 196 (29.1%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 102 / 196 (52.0%)
Redcal Done? ❌
Never Flagged Antennas 94 / 196 (48.0%)
A Priori Good Antennas Flagged 38 / 93 total a priori good antennas:
3, 9, 15, 16, 29, 40, 41, 42, 54, 55, 56, 66,
72, 81, 86, 94, 109, 111, 121, 128, 136, 143,
144, 146, 147, 148, 149, 151, 161, 164, 165,
170, 173, 182, 185, 189, 192, 193
A Priori Bad Antennas Not Flagged 39 / 103 total a priori bad antennas:
8, 35, 43, 46, 48, 49, 52, 62, 64, 73, 74,
82, 87, 89, 95, 102, 115, 120, 125, 132, 137,
139, 179, 210, 211, 220, 221, 222, 223, 227,
229, 237, 238, 239, 245, 261, 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_2459968.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% 5.724977 11.851418 10.764953 0.908096 14.643460 6.358166 6.080600 2.823310 0.033381 0.480918 0.394703
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.394182 -0.478196 1.419233 0.823245 7.598916 3.145865 1.312669 0.788776 0.741114 0.732641 0.279178
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.214117 -0.198558 0.151057 0.026760 -0.882824 2.028185 0.534327 0.202548 0.745041 0.742648 0.261286
7 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.239221 -0.472471 -1.343341 -0.354465 -0.746656 -0.688754 -0.576855 0.377191 0.735863 0.736950 0.268280
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.230292 -0.180434 -0.768820 -0.056454 -1.095377 -0.095680 -0.146245 0.584435 0.730590 0.729490 0.267871
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 2.389264 -0.741862 8.690678 -0.518725 10.717043 -0.653940 2.755581 0.378727 0.604195 0.724119 0.335422
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.335811 -0.636584 0.399667 -1.296090 0.861193 0.477813 1.528760 -0.081147 0.711934 0.717998 0.280670
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 5.624818 13.177327 10.711385 1.836302 14.696146 5.721497 6.085300 2.667405 0.032475 0.497706 0.398016
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 5.668453 0.398638 10.726385 0.680066 14.672075 2.067799 6.118466 0.732072 0.034260 0.750666 0.623748
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 2.144401 3.084883 0.241646 0.298952 0.070416 0.435948 0.327861 -0.046972 0.746955 0.747208 0.260472
18 N01 RF_maintenance 100.00% 100.00% 5.68% 0.00% 5.988051 45.151226 10.750282 -0.087402 14.877319 16.463607 6.088402 6.354901 0.029776 0.348902 0.280138
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.597048 -0.681562 -1.373218 -1.092909 -0.868359 0.496583 -1.076654 -0.809660 0.739867 0.744444 0.263103
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.335781 -1.010789 2.244055 -1.199637 0.535510 0.587052 3.456954 -0.930663 0.735832 0.738374 0.267113
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.367752 0.077433 -0.886558 0.005572 -0.079901 1.557898 0.115415 1.273785 0.724509 0.723337 0.269333
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.414909 0.392387 0.816879 0.402185 2.699645 4.862529 0.405969 -0.128230 0.689016 0.694855 0.283035
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.893846 6.041437 10.732411 11.377831 14.845056 17.340341 6.183927 6.068960 0.035335 0.039043 0.004863
28 N01 RF_maintenance 100.00% 0.00% 48.84% 0.00% 13.834073 62.045545 0.650776 2.733857 10.560469 23.389841 2.770501 7.995013 0.503024 0.261390 0.335359
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 5.743612 6.280329 10.348089 10.977893 14.807503 17.266957 6.115166 6.039577 0.030434 0.037931 0.007601
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.505129 1.128551 -0.993902 0.367274 1.624593 -0.125435 -1.000377 0.138054 0.749591 0.757210 0.254609
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.050820 -0.425038 0.845329 1.021968 0.324944 1.215719 1.188077 1.199742 0.756944 0.755495 0.252704
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.272452 11.090028 -0.313420 3.922903 -0.965313 7.752417 0.166932 2.458062 0.744896 0.686506 0.239976
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 5.963087 6.737163 5.068210 5.574035 14.749303 17.230757 6.185616 6.115616 0.035874 0.049296 0.009453
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.193282 -0.695469 1.408140 -1.403048 0.094137 -0.826471 0.636478 0.597297 0.696552 0.701358 0.279180
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.455116 7.271565 14.405314 14.346066 15.678585 17.878631 6.257324 6.262979 0.033828 0.032066 0.001133
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.225629 1.626251 -1.405334 1.518490 0.479641 0.344774 -1.204640 1.664150 0.757572 0.762267 0.248650
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.204361 0.743663 0.076570 0.549315 -0.393301 0.039619 0.273155 0.502608 0.765599 0.767514 0.243799
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 5.382651 -0.506931 10.343299 0.574024 14.754193 -1.383071 6.086275 -0.023558 0.039862 0.751335 0.564722
41 N04 digital_ok 100.00% 99.95% 99.95% 0.00% 153.497659 156.202561 inf inf 5081.252551 5374.587418 527.100871 570.204724 0.059644 0.416738 0.285306
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.019578 -0.264326 4.845885 6.130020 1.483567 3.366882 3.785716 5.028242 0.746980 0.747989 0.239830
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.412078 -0.872393 0.502333 0.703884 -0.378980 0.512888 -0.012110 0.572195 0.756536 0.760017 0.250030
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.118451 -0.738274 -0.071341 -0.620855 -0.076275 -0.167785 -0.703739 -0.713223 0.750043 0.763128 0.255695
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.820912 0.777518 0.003281 0.430117 -0.339561 1.279242 0.005552 0.951890 0.745348 0.748467 0.246238
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.785146 -0.973984 -1.045191 -0.506392 -0.337333 -0.911167 -0.676825 -1.211794 0.743783 0.750058 0.264465
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 6.620129 6.421264 4.856142 5.159120 14.537171 17.114001 6.145523 6.013172 0.030540 0.054392 0.016777
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.043875 -0.199343 1.003454 2.248465 -0.665511 3.883188 0.187524 1.676008 0.703545 0.708780 0.283256
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.006039 -0.742758 -1.008766 0.679313 1.906376 -0.177793 -0.315526 -0.171258 0.676962 0.703344 0.281162
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.811500 0.926219 0.383877 1.134948 1.529738 6.543186 0.945721 2.070019 0.736483 0.737837 0.242242
51 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 8.961745 8.628278 13.174733 -1.045554 15.358951 8.338138 6.618752 0.964429 0.048530 0.665504 0.524850
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.088742 0.602540 -0.957645 0.083164 1.145002 0.134965 -0.767715 -0.109017 0.765105 0.767033 0.242853
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.864782 2.437913 0.009990 0.176880 0.394626 1.907264 0.356531 0.385368 0.772512 0.773693 0.239570
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 9.802003 -0.143139 5.533005 3.267347 4.406432 0.631845 6.737684 3.427603 0.650057 0.767885 0.235587
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 5.751919 6.526397 10.205599 10.938802 14.730764 17.277463 6.093896 6.110258 0.028970 0.033730 0.004209
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 1.363022 1.549998 5.775743 8.133587 5.580378 9.360140 4.275810 4.680485 0.742620 0.723276 0.233117
57 N04 RF_maintenance 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.509805 0.762778 0.396564
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.072787 6.256644 10.636997 11.523899 14.669038 17.115279 6.162204 6.086938 0.037599 0.037216 0.001384
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.744090 -0.025843 10.221248 0.930758 14.356051 2.425603 6.091743 1.337903 0.057881 0.762272 0.583870
60 N05 RF_maintenance 100.00% 0.00% 75.12% 0.00% 0.121977 6.390964 -0.378532 11.533248 -0.969350 17.106762 -0.214094 6.039103 0.747642 0.147472 0.543181
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.582730 -0.420422 -0.424388 -1.428607 4.294380 -1.606054 -1.154718 -1.392301 0.702687 0.726430 0.263893
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.462979 -0.726624 -0.799791 1.565440 -0.710526 -0.084609 -1.174165 0.839022 0.693361 0.717620 0.272978
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.225984 6.582750 0.129691 5.555290 1.010606 17.339685 -0.407460 6.131685 0.705727 0.048106 0.496435
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.827993 0.156643 -0.364604 -0.792940 -0.457730 -0.310740 -0.445371 0.775899 0.693111 0.698868 0.270468
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.527076 1.373843 0.376654 1.004990 0.220838 0.488582 0.693460 0.943620 0.742944 0.754133 0.256652
66 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.183186 0.402632 -1.410314 -1.343104 4.175741 -0.586603 -1.288120 -1.549779 0.749923 0.761574 0.256943
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.200082 -0.373655 -1.022751 0.690678 -0.995942 0.124422 -0.814011 0.481517 0.764542 0.763079 0.242270
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 14.219713 9.322316 2.542792 15.496967 5.929499 18.033315 2.991484 6.548898 0.531062 0.032525 0.397475
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.786904 -0.766734 0.182649 0.726854 0.087393 1.676184 0.158072 0.593572 0.767896 0.776263 0.230571
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.885398 -1.021944 -0.359442 -0.024860 1.041028 1.545978 -0.647382 -0.197489 0.774162 0.780890 0.233197
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.962782 0.043438 0.145643 0.878007 0.550640 0.326137 0.368400 0.884051 0.779862 0.782294 0.227938
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 6.098547 7.126362 11.159303 11.994982 14.500126 16.948945 6.117912 6.069944 0.031959 0.035809 0.003994
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.961880 -0.298726 -1.342191 -1.314904 0.867498 -0.647504 -1.348943 -1.388447 0.767491 0.775211 0.240445
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.021335 0.241924 0.479037 -0.649490 0.137746 0.469764 -0.144115 -0.536882 0.760576 0.773756 0.247248
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 31.418564 0.279706 1.588700 -0.011930 9.422496 -0.828087 3.110921 -0.416625 0.485896 0.725835 0.357824
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 7.123272 0.337760 -1.156280 1.553442 0.650873 0.805028 -0.493271 0.976155 0.582969 0.725778 0.278158
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.327368 6.608770 -1.404004 5.596387 -0.957721 17.043551 -0.911407 6.009177 0.705272 0.042204 0.490900
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.890113 6.679690 0.374795 5.513894 0.334870 17.104992 0.209119 6.068323 0.698182 0.051606 0.503299
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.000139 7.333267 0.091270 10.119772 0.222046 16.692627 -0.234182 6.191970 0.722742 0.041857 0.520477
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.554373 0.048738 0.243778 2.116975 -1.099256 -0.411999 0.179401 1.664118 0.741436 0.745860 0.246140
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.000310 0.059968 0.156242 0.414770 -0.113111 -0.608307 -0.093618 0.347824 0.751627 0.761825 0.244023
84 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.370097 10.012652 44.274384 35.300701 92.269796 55.573645 130.062564 62.838523 0.016784 0.016099 0.001402
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.036533 0.886586 0.613409 0.668690 -0.760149 -0.829173 0.355821 0.505755 0.766630 0.773177 0.231937
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% -0.083245 -0.749758 0.747327 0.925295 6.823201 -0.686294 0.276418 1.081439 0.762522 0.772768 0.224318
87 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.926475 3.114081 -0.968259 -0.802607 0.029197 0.340459 -0.865338 -0.940642 0.777596 0.785922 0.225269
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.403137 0.726049 0.321117 0.739432 -1.155460 1.261581 -0.279882 0.318118 0.775062 0.782008 0.224209
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.511608 0.438872 -0.047029 0.849410 0.190308 -0.751711 -0.270228 0.434584 0.776490 0.780751 0.227982
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.193736 -0.204315 0.862814 3.914673 -0.998423 13.511587 0.656849 3.206163 0.769897 0.762882 0.227352
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.708783 -0.514465 0.323298 0.275728 -0.986346 -0.964561 0.364568 0.067386 0.763295 0.775705 0.241113
92 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.559085 14.705809 1.976535 2.940752 9.965050 9.435589 2.645141 3.392309 0.444687 0.386824 0.090111
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.325164 -0.404887 2.129492 -1.166845 3.513125 0.244542 3.006443 -1.267815 0.748209 0.759398 0.254000
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 5.925795 6.935488 10.963336 11.436864 14.778842 17.219638 6.155471 6.056569 0.033888 0.026795 0.003383
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.831959 0.734061 -0.602999 1.225728 -0.198129 0.680715 -0.907027 0.649762 0.711712 0.731068 0.279191
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 5.980155 6.472489 4.913923 5.707373 14.442871 16.974209 6.082724 6.056660 0.034267 0.039619 0.003126
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.166665 2.133386 -0.426151 1.850633 -1.452166 5.039728 -0.509089 3.162760 0.702911 0.683452 0.265666
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.869231 1.431076 -0.866934 0.734801 -0.529342 0.906724 -0.757320 0.903508 0.759476 0.768006 0.243610
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.923808 -0.483684 -0.431101 -1.278875 1.580364 1.063015 -1.112318 -1.145790 0.764076 0.769010 0.238722
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.096999 2.765878 3.840520 -1.176291 2.135967 1.549958 3.762250 -0.810783 0.762564 0.777242 0.229951
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.977255 6.968444 -1.374099 8.618153 2.544834 5.994582 -1.437995 7.528712 0.778989 0.772809 0.224776
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.422684 0.096334 0.125443 0.843132 -0.103114 -0.953640 0.063249 0.504595 0.779169 0.782758 0.221540
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.085836 -0.467255 -1.181252 -0.665158 1.712858 -0.245273 -1.437916 -1.133807 0.776654 0.782398 0.226018
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.162610 -0.964871 -0.803708 -1.120840 -0.373193 -0.817831 -0.771143 -1.271111 0.774882 0.781257 0.227777
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.762731 14.120016 10.703477 2.430474 14.776542 10.687179 6.152597 2.995121 0.036590 0.443117 0.226947
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 5.587356 6.421033 10.176063 10.700873 14.805926 17.201048 6.099698 6.111868 0.027184 0.025917 0.001502
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.829681 8.139618 14.751660 15.243835 15.096546 17.635294 6.191069 6.166145 0.021145 0.020998 0.000614
111 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 5.577013 6.817406 10.682360 11.364475 14.856753 17.373474 6.100194 6.185216 0.025318 0.025029 0.001069
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.660698 -0.881627 0.218938 0.195260 0.200304 2.173019 0.491947 0.617337 0.741423 0.756871 0.260206
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 6.429621 6.506541 4.705854 5.608352 14.512364 16.993311 6.198684 6.036614 0.036996 0.030917 0.003207
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.461538 3.909220 38.762024 13.663686 180.871372 11.420653 196.293232 13.858623 0.016973 0.024836 0.004977
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.604479 -0.835639 -0.669669 -0.139269 -0.013693 -1.272368 -0.655745 -0.891117 0.698110 0.723086 0.275938
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.048066 7.474787 10.890068 11.966397 14.490684 17.235838 6.132279 6.221106 0.027827 0.034130 0.004162
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.966154 0.431835 -0.209218 0.609909 0.151781 -0.075176 -0.187524 0.538603 0.731410 0.746851 0.260031
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.326731 0.901842 2.548886 -1.065624 3.656665 2.020532 3.063860 -0.748292 0.751692 0.765840 0.240450
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.770375 0.882321 -1.035455 5.830079 0.408466 2.758108 -0.109687 6.315984 0.766714 0.763392 0.229210
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.599095 2.850283 -0.101527 0.603024 1.394802 1.178432 0.097225 0.853340 0.768912 0.780963 0.224140
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.312845 2.691301 0.376739 0.629643 -0.425632 -0.835141 0.806891 0.886422 0.784723 0.788048 0.222775
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.000310 0.358263 -0.046840 0.682640 -0.599269 -0.288503 0.103471 0.708369 0.783828 0.788092 0.225410
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.509311 -0.565772 0.069604 0.795629 0.694801 -0.128535 -0.005552 0.536289 0.778270 0.783774 0.223161
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.317163 -0.661433 -0.574844 0.915392 16.554828 -0.739092 0.148202 0.809722 0.728359 0.777498 0.232918
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.860459 0.667420 0.280575 0.257790 1.786515 0.794244 0.205716 0.170877 0.768848 0.780651 0.240970
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 5.627275 6.408371 10.807685 11.500060 14.509535 17.040801 6.075957 6.041210 0.032034 0.028987 0.001672
131 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.132453 4.993866 0.356725 5.347711 -1.158876 15.702618 -0.558182 2.378063 0.728714 0.500539 0.330769
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.354278 0.204443 0.210479 -1.395474 0.547957 -0.626645 -0.687066 -1.379565 0.715816 0.727900 0.263773
133 N11 not_connected 100.00% 99.89% 0.00% 0.00% 6.392593 -0.197044 4.675173 -1.433612 14.643765 -0.600036 6.086145 -1.139620 0.069969 0.725569 0.510241
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.632876 -0.877206 -1.205310 -1.132369 4.865509 0.955810 -0.011395 -1.045212 0.695807 0.718156 0.293458
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 5.639789 -0.335900 10.263346 -0.914194 14.859241 0.203246 6.196814 -0.665603 0.045828 0.722605 0.465527
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.186567 0.035389 0.130918 -1.032626 2.547188 -0.098912 0.396580 -1.351569 0.715924 0.733871 0.271106
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.175580 1.434534 2.079232 -0.617440 1.405133 -0.897381 1.636139 -0.958770 0.729288 0.740223 0.261828
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.438177 -1.004772 -1.090821 0.258678 -0.818528 0.493422 -0.903911 -0.315409 0.757609 0.761185 0.243795
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.591886 -0.947760 -0.417011 1.134409 1.534184 -0.411388 -0.095436 0.585346 0.767029 0.764221 0.239717
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.076815 6.439520 -0.842205 11.552790 4.523256 17.343249 1.240357 6.051197 0.766103 0.054838 0.534328
143 N14 digital_ok 100.00% 0.00% 100.00% 0.00% -0.307864 6.790832 0.821742 11.639691 1.390931 16.891072 1.048888 6.155949 0.778957 0.044709 0.579934
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.314006 0.488742 -1.348204 1.339077 -0.866358 10.078513 -1.050487 1.841977 0.781215 0.784627 0.225966
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.979154 -0.235191 -1.219997 4.128449 -0.245962 10.144697 -0.866194 4.422832 0.781339 0.774156 0.223926
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 5.863467 -0.869824 4.658026 0.187549 14.667791 -0.952057 6.075402 -0.755666 0.041618 0.770669 0.573343
147 N15 digital_ok 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.268601 0.155604 0.226494
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.068931 0.087166 0.038174
149 N15 digital_ok 100.00% 99.95% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.811686 0.041128 0.713811
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.725324 -1.130176 -0.593082 -0.904985 -0.872911 0.190060 -1.316605 -1.530092 0.747825 0.759214 0.259014
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 8.304697 2.713488 -0.378230 0.555743 0.587569 0.203340 0.834607 0.003661 0.617159 0.722049 0.251142
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.989976 -0.695997 10.426450 -1.371319 14.876689 0.454733 6.190896 -0.692952 0.047625 0.710525 0.478733
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.888733 6.344270 8.477419 11.234475 10.333928 17.315302 3.079274 6.168038 0.578308 0.041684 0.378317
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.015660 0.193874 -0.196035 0.608463 -0.928212 -0.040918 0.103186 0.976531 0.713720 0.730479 0.276443
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.727386 -0.418104 -0.294958 -0.622336 2.727335 2.866801 0.071250 0.181271 0.730011 0.741306 0.270246
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.143965 3.958877 -1.182028 -0.964083 0.049589 4.457346 -0.945017 1.799500 0.710158 0.654972 0.255285
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.042599 -0.591547 -0.452740 -0.762191 -0.968836 1.946950 -0.229613 -0.562603 0.750145 0.755688 0.247811
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.678260 6.498123 -0.069253 0.329961 -0.659695 7.641600 0.024232 1.065855 0.759583 0.672221 0.217205
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.183596 -0.568510 -0.543299 -0.808526 2.085802 1.606428 -0.962475 -1.486606 0.758144 0.769435 0.243976
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.773252 -0.267993 -0.461176 0.249844 -1.133188 0.816996 -0.397891 0.276536 0.776947 0.778409 0.235032
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.595715 0.220509 0.630569 -0.171822 7.458173 3.061381 0.598857 -0.231708 0.776695 0.780306 0.228323
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 9.794207 -0.829564 -0.336629 -1.154502 1.308970 -0.758780 -0.208421 -0.785808 0.670122 0.780975 0.228717
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.437181 0.190547 -1.211782 -1.107978 -0.381278 22.119911 -1.031976 0.162645 0.776561 0.777089 0.237028
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.348185 -0.401303 -1.295696 -0.180093 1.246693 0.203375 -1.237768 0.105518 0.770116 0.777190 0.236568
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.724958 -0.442231 0.126633 -0.382484 0.955554 -0.593338 0.596237 -0.093877 0.767373 0.775359 0.241474
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.878083 -0.657206 -1.122032 -1.028504 -0.080907 0.345544 -0.967017 -1.619012 0.762936 0.770383 0.247729
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 7.022876 -0.064338 11.074108 -0.761620 14.594341 0.195594 6.274845 -0.009081 0.046176 0.769906 0.589501
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.811168 2.740540 -1.046219 0.268599 -0.921809 3.277082 -1.075893 -0.787873 0.715843 0.714741 0.248443
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 7.585674 6.987491 4.384012 5.145512 14.901801 17.262678 6.337576 6.417932 0.041175 0.046940 0.004640
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.249856 -0.170781 0.261323 -1.365877 -0.287087 2.680763 0.665548 -0.966983 0.704125 0.735146 0.272604
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.608038 7.198869 -1.112719 11.708873 1.578204 17.097435 -0.788098 6.158168 0.735522 0.059334 0.532439
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.202403 0.196105 0.351285 0.545580 0.898862 -0.598689 0.487923 0.733884 0.751904 0.755655 0.252960
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.249248 6.378452 -1.377804 11.228227 -0.911964 17.333378 -0.838244 6.099097 0.762969 0.052748 0.506325
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.790236 -0.389112 -1.004809 -0.092410 1.214785 -1.015485 -0.845877 -0.111211 0.755716 0.762216 0.235467
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.518982 0.057213 -1.069124 -0.483874 -0.472073 -0.320301 -1.017583 0.126094 0.774661 0.783772 0.227416
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 15.138368 0.070182 0.028701 -1.372665 10.525485 0.481279 1.211991 -1.287118 0.684038 0.771400 0.232936
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.770942 -0.955356 -1.066832 -0.003281 1.266633 -0.838597 -1.351240 -0.883333 0.778412 0.776006 0.240274
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.365433 0.253615 -1.410953 2.523038 -0.258266 1.655258 -1.076203 2.258971 0.775363 0.762653 0.246106
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 5.259588 7.010669 10.239698 11.338102 14.833890 17.432307 6.236655 6.275779 0.028723 0.033159 0.002356
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.846780 -0.952548 -0.792261 0.811637 -1.180167 0.974079 -0.357963 0.097851 0.760855 0.764417 0.257525
191 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.598587 -0.147654 1.202944 -0.422765 0.095400 -0.131968 2.334234 0.172582 0.755407 0.764489 0.247931
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 1.925468 2.089885 5.516370 5.420349 11.003690 13.480524 5.104543 5.265480 0.689948 0.700312 0.288640
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 2.225014 0.788674 5.736723 2.168134 11.617349 4.172138 5.314965 1.640603 0.673806 0.728481 0.306688
200 N18 RF_maintenance 100.00% 100.00% 2.33% 0.00% 6.710021 13.463099 4.809316 -0.883926 14.828599 10.504133 6.226938 3.466008 0.043625 0.341488 0.236023
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.270409 1.258151 3.641558 4.745980 4.274163 10.982484 3.172964 4.620687 0.722472 0.706490 0.282646
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% -0.140392 0.190028 2.088218 -1.056441 1.480287 -0.149185 1.553595 1.291108 0.740014 0.731411 0.259818
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.921233 4.665474 0.544989 -0.324965 -0.522323 -0.043151 0.152490 -0.343775 0.748528 0.740168 0.239974
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.222444 2.662651 2.518764 -0.642764 16.356819 -0.010392 2.949618 -0.715149 0.749430 0.740234 0.245980
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.379162 4.247218 1.856019 -0.995406 1.377780 0.787374 1.327885 -0.854417 0.737336 0.737169 0.234129
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 3.961800 7.691685 9.467723 10.569120 14.329567 15.523446 6.353825 8.470364 0.035568 0.038396 0.001032
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 3.578255 5.201223 9.500798 9.800504 14.179931 16.021482 6.462667 6.308459 0.044129 0.042647 0.001652
210 N20 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.688405 0.972032 -1.276249 -0.895957 -0.668267 -0.781915 -1.145074 -0.672157 0.759878 0.735609 0.250997
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.510597 1.046928 -0.940450 0.270257 -0.716411 -0.118336 -1.358435 -0.684546 0.729278 0.734113 0.248638
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.541790 -0.962185 0.867055 -0.007738 -1.067230 0.566606 0.401387 -0.702424 0.727495 0.725877 0.267582
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.602347 -0.764395 -1.033227 -0.410323 -0.148750 -0.695716 -1.118376 -1.060721 0.728032 0.734257 0.259735
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.556788 -0.748489 0.089411 0.486965 -0.576714 -0.966055 -0.744674 -0.211268 0.739960 0.741978 0.255804
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.296766 2.283685 -1.038397 1.475736 0.116659 0.618346 -0.922827 1.018919 0.734501 0.739395 0.256372
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.234552 2.027194 5.829579 5.401216 11.554351 13.355290 5.398461 5.254540 0.707732 0.707837 0.279024
225 N19 RF_ok 100.00% 0.00% 37.05% 0.00% 2.586813 6.598194 1.407785 5.307106 -0.770350 16.822051 0.710166 5.325686 0.750586 0.313291 0.512540
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.167349 4.397584 0.626092 1.311454 -1.190305 5.131065 -0.105003 1.878580 0.750207 0.725621 0.244539
227 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 3.735910 1.770959 -1.176405 0.449013 0.865773 -0.068149 -0.099591 -0.111446 0.733108 0.745497 0.242295
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.612062 5.123789 -0.758176 -0.397022 1.445988 2.068412 -0.632021 0.248868 0.708771 0.675223 0.215639
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.023868 0.109476 2.038240 1.818337 0.433282 2.516854 1.129687 1.078932 0.738934 0.745439 0.258858
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.324778 -0.835114 -0.010826 -1.248558 0.013693 -1.282815 -0.770269 -1.342505 0.686224 0.705873 0.276793
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.600168 -0.432202 1.370213 0.665597 -0.495476 -0.525954 0.622510 -0.265858 0.723328 0.720364 0.276994
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.561850 -0.257370 0.362523 0.511378 -0.624607 -1.031781 -0.242721 -0.246250 0.730635 0.726016 0.267169
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.070148 33.324730 0.243470 0.097144 1.337247 12.323433 1.801324 1.805806 0.629855 0.563975 0.200702
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.098098 5.353162 -0.344765 0.789334 -0.577431 1.562072 -0.313080 0.948788 0.731359 0.707537 0.255452
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 24.974639 2.043043 -0.669238 2.235843 35.280045 3.251063 4.405869 1.791063 0.556425 0.734723 0.323095
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 33.432880 4.246768 0.544713 -1.155652 9.302067 -0.366453 3.512025 -0.981421 0.472891 0.731041 0.403753
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.728892 2.927143 1.547390 -0.572354 5.018033 2.484785 0.164868 -0.647034 0.684079 0.729277 0.249158
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.996037 2.079522 0.597759 -0.717207 -0.565613 -0.958299 0.041003 -1.129052 0.735291 0.734129 0.248432
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.651804 9.003010 -1.099370 -0.288071 5.714293 5.913683 2.847959 2.746843 0.493717 0.488699 0.144088
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 2.900136 3.017325 1.249898 -0.157027 -0.313387 -1.069704 0.513472 -0.542369 0.734052 0.727754 0.253429
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 3.797051 4.363536 9.647394 10.412472 14.580173 16.601378 6.431858 6.294558 0.033681 0.028377 0.004828
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 4.672258 4.560078 2.930402 7.770914 4.584529 17.488158 2.267884 6.117987 0.609592 0.049051 0.493655
324 N04 not_connected 100.00% 100.00% 100.00% 0.00% 174.769517 146.425196 inf inf 4181.452171 3930.159686 416.973080 473.219046 nan nan nan
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.187760 -0.198429 1.838117 -0.941516 1.960027 -0.197649 0.393211 0.503475 0.681995 0.668864 0.273756
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.006831 1.368731 0.597021 -0.503517 3.929760 -0.722011 3.439643 0.190733 0.599113 0.656773 0.287632
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.142616 2.125745 -0.729354 -1.263703 0.390811 -0.523973 1.871362 0.739394 0.556369 0.603851 0.317376
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 9, 15, 16, 18, 22, 27, 28, 29, 32, 34, 36, 40, 41, 42, 47, 50, 51, 54, 55, 56, 57, 58, 59, 60, 61, 63, 66, 68, 72, 77, 78, 79, 80, 81, 84, 86, 90, 92, 94, 96, 97, 104, 108, 109, 110, 111, 113, 114, 117, 121, 126, 128, 131, 133, 135, 136, 142, 143, 144, 145, 146, 147, 148, 149, 151, 155, 156, 159, 161, 164, 165, 166, 170, 173, 180, 182, 185, 189, 192, 193, 200, 201, 205, 206, 207, 208, 209, 224, 225, 226, 228, 240, 241, 242, 243, 244, 246, 262, 320, 324]

unflagged_ants: [5, 7, 8, 10, 17, 19, 20, 21, 30, 31, 35, 37, 38, 43, 44, 45, 46, 48, 49, 52, 53, 62, 64, 65, 67, 69, 70, 71, 73, 74, 82, 83, 85, 87, 88, 89, 91, 93, 95, 101, 102, 103, 105, 106, 107, 112, 115, 118, 120, 122, 123, 124, 125, 127, 132, 137, 139, 140, 141, 150, 157, 158, 160, 162, 163, 167, 168, 169, 171, 179, 181, 183, 184, 186, 187, 190, 191, 202, 210, 211, 220, 221, 222, 223, 227, 229, 237, 238, 239, 245, 261, 325, 329, 333]

golden_ants: [5, 7, 10, 17, 19, 20, 21, 30, 31, 37, 38, 44, 45, 53, 65, 67, 69, 70, 71, 83, 85, 88, 91, 93, 101, 103, 105, 106, 107, 112, 118, 122, 123, 124, 127, 140, 141, 150, 157, 158, 160, 162, 163, 167, 168, 169, 171, 181, 183, 184, 186, 187, 190, 191, 202]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459968.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.dev13+gd6c757c
3.2.1
In [ ]: