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 = "2459989"
data_path = "/mnt/sn1/2459989"
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: 2-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/2459989/zen.2459989.21275.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 1851 ant_metrics files matching glob /mnt/sn1/2459989/zen.2459989.?????.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/2459989/zen.2459989.?????.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 2459989
Date 2-13-2023
LST Range 4.098 -- 14.060 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (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 59 / 198 (29.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 118 / 198 (59.6%)
Redcal Done? ❌
Never Flagged Antennas 80 / 198 (40.4%)
A Priori Good Antennas Flagged 46 / 93 total a priori good antennas:
3, 7, 15, 16, 19, 29, 38, 40, 42, 45, 53, 54,
55, 71, 72, 81, 86, 93, 94, 101, 103, 109,
111, 112, 121, 122, 123, 124, 136, 144, 147,
151, 158, 161, 162, 165, 170, 173, 182, 185,
187, 189, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 33 / 105 total a priori bad antennas:
4, 8, 22, 43, 46, 48, 49, 61, 62, 73, 74, 89,
90, 115, 120, 132, 133, 137, 139, 166, 179,
220, 223, 228, 229, 237, 238, 241, 244, 245,
324, 325, 329
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_2459989.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% 100.00% 0.00% 10.021929 13.798539 8.752737 9.610649 7.936443 9.224220 -0.112367 0.158846 0.029347 0.030749 0.002152
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.749989 0.941446 2.047151 0.340115 0.548998 0.918655 3.111754 0.440981 0.576430 0.603454 0.403220
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.399942 -0.422759 0.280113 0.538455 0.134907 1.952523 0.681400 0.445700 0.596579 0.602368 0.389185
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.816549 -0.170425 -0.931764 0.027391 -0.074102 0.475182 7.088004 8.134352 0.606712 0.621766 0.388434
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.126261 -1.500509 -0.415522 0.392426 -0.213410 0.349351 1.148393 1.340145 0.605773 0.618149 0.384627
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.628649 -0.785512 2.613873 -0.719754 0.690671 -0.037074 1.246183 -0.831820 0.582297 0.620428 0.396522
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.715223 -0.427702 1.330135 -0.876303 0.225405 0.739857 -0.316936 1.409048 0.597037 0.614707 0.386375
15 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.287405 13.530400 8.232850 9.075843 7.939283 9.226087 -0.425093 -0.313770 0.027849 0.026418 0.001625
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.227324 -0.940379 8.722434 1.042046 7.937637 2.003082 -0.021454 1.687581 0.030338 0.615677 0.491390
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.162149 1.727488 0.542160 0.674248 0.754243 0.941654 1.104265 1.264552 0.606240 0.623585 0.391075
18 N01 RF_maintenance 100.00% 100.00% 42.68% 0.00% 10.833011 18.008039 8.694610 -0.206776 8.042283 4.780026 -0.166424 11.850900 0.028774 0.223100 0.168415
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.914321 -0.912178 -0.910263 1.483610 -0.391144 1.539440 0.750509 6.282155 0.613432 0.624553 0.380397
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.378899 -1.494769 1.684125 -0.580996 0.362157 0.547117 1.319377 -0.623366 0.606373 0.627441 0.384014
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.640272 0.063293 -0.447542 0.388287 0.261704 1.217382 0.064748 0.038445 0.599733 0.608972 0.376484
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.344197 -0.135343 0.694975 0.237714 0.835288 0.930089 -0.670746 -1.239893 0.577925 0.593680 0.381369
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.594489 12.831621 8.750005 9.434449 8.038596 9.285440 1.053730 0.700951 0.033029 0.036227 0.004187
28 N01 RF_maintenance 100.00% 0.00% 87.63% 0.00% 10.497299 25.313829 -0.140595 2.770894 5.478759 6.313298 4.220883 12.698445 0.354634 0.150253 0.262207
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.349240 13.299594 8.395098 9.083031 8.011723 9.254020 -0.154635 -0.458927 0.028965 0.034152 0.005236
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.116470 -0.138541 1.775457 -0.998846 0.352133 -0.094035 1.300467 -0.234971 0.601366 0.641498 0.394638
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.952159 -1.357673 1.030179 0.931680 1.085731 -0.859295 0.262775 2.180807 0.628616 0.633987 0.381297
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.132062 26.368432 0.458142 3.091282 6.317607 0.566419 9.479748 9.810811 0.564812 0.511738 0.304259
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.745222 14.490022 3.915319 4.497004 8.000911 9.238790 0.638519 0.345898 0.033849 0.043739 0.006829
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.428415 -0.152419 0.796288 -0.999598 -0.106979 -1.114147 5.145883 -0.256880 0.585278 0.580440 0.374784
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.695317 26.625609 11.554330 11.813025 8.150387 9.215716 4.569390 4.540998 0.030700 0.028295 0.001534
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.435903 0.584866 -0.858028 1.578599 0.937639 0.965737 0.019959 1.915175 0.608234 0.613064 0.401572
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.069539 0.073185 0.233085 0.805875 -0.123833 0.524103 4.809305 1.773806 0.611242 0.611135 0.394869
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 9.700626 0.837433 8.427050 0.745940 8.068310 0.323502 2.598632 2.478227 0.035579 0.611945 0.468617
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.178855 0.062973 0.122243 0.344173 1.663143 0.618251 0.246418 0.785272 0.609818 0.632853 0.379952
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.306321 3.189669 -0.399614 7.653340 1.346972 2.890816 1.106707 1.723869 0.628851 0.522615 0.414381
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.223389 0.215068 0.371593 0.911261 -0.701207 0.632409 -0.571468 0.743405 0.630751 0.638328 0.382990
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.291592 -0.198635 -0.140416 -0.129704 -0.623259 0.535266 -0.541977 -0.286451 0.631996 0.648280 0.384429
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.169484 3.354858 0.248062 1.031948 -0.478895 1.691264 0.934086 11.323607 0.621594 0.629917 0.378010
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.920294 -0.060937 -0.667990 -0.824172 -0.410057 -0.207907 -0.168138 -0.392525 0.623363 0.645275 0.394817
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.809785 14.178886 3.832185 4.168453 7.993833 9.175737 1.645247 0.111473 0.031313 0.051796 0.014193
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.198505 1.023737 0.006582 1.670375 -1.001253 1.578307 -0.479915 -2.016665 0.585089 0.612628 0.389800
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.056009 0.010566 -0.767541 0.195251 0.687493 -0.588985 -0.090604 3.914892 0.544717 0.585720 0.383335
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.612049 4.184304 0.306686 1.306166 1.174356 1.706653 15.567844 24.334512 0.582577 0.580829 0.381176
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 9.659005 4.201771 0.177629 2.026232 4.606690 3.297131 33.154457 3.706910 0.498271 0.505992 0.257759
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.255344 6.369514 -0.324448 0.788329 1.078947 0.915894 0.813871 1.207550 0.617296 0.625820 0.392278
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.380691 3.237675 -1.067593 0.368709 0.928625 2.096932 2.796652 12.017183 0.628628 0.637333 0.394934
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 27.455474 -0.644238 4.193560 -0.358186 1.722050 0.423573 3.998618 2.484777 0.447423 0.639636 0.384860
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.502604 14.132604 8.776522 9.550935 8.025727 9.245890 1.192330 2.291990 0.028131 0.030137 0.002139
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.572929 -0.067678 -0.594576 1.457641 -0.271054 0.602574 0.234683 1.759645 0.621574 0.646029 0.379076
57 N04 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.893699 0.299610 9.039056 -0.759057 7.856688 1.103744 1.191794 1.642210 0.040975 0.647717 0.507897
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.673707 13.211866 8.670925 9.547362 7.971005 9.233721 1.419384 1.145299 0.034385 0.034546 0.001728
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.466034 1.044473 8.284979 0.982311 7.830187 1.795057 1.016538 10.337766 0.044045 0.631992 0.498626
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.143310 13.117890 -0.364319 9.569774 -0.173560 9.247824 7.518146 1.789419 0.623334 0.063364 0.505652
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.815751 0.342469 -0.486596 -0.893801 1.057924 -0.886569 -0.558449 -0.188134 0.567293 0.597992 0.374730
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.025319 0.712759 -0.899554 1.041834 -0.734557 -0.485749 1.204516 -0.918025 0.565395 0.607714 0.387250
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 1.436206 13.651511 0.103890 4.518976 0.539657 9.304334 -0.585995 1.163455 0.580032 0.043118 0.463343
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.085554 0.237588 -0.527754 -0.462720 -0.664296 -1.038264 1.319838 4.665341 0.573055 0.566144 0.367371
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.591025 1.422261 0.470569 1.251383 -0.212959 0.510395 1.140067 0.104494 0.591906 0.610679 0.403419
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.662749 1.673397 -0.990700 -0.510851 2.458161 0.370699 -0.571593 0.073824 0.612688 0.626802 0.400322
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.354123 -0.394665 -0.113926 1.476730 -0.376395 0.722607 0.061154 1.115755 0.621022 0.626024 0.388300
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 18.534847 27.245345 0.829856 12.416451 4.145352 9.210535 0.135015 5.898780 0.361939 0.027658 0.262724
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.689819 0.095748 0.334477 1.069520 -0.357548 1.238017 0.941293 1.287397 0.619439 0.638426 0.374625
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.748437 -0.300788 -0.009899 0.401377 0.856556 1.529810 1.102969 0.835078 0.628428 0.645151 0.374520
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.474154 -0.598931 0.671359 1.182863 0.160902 -0.211075 1.245762 0.804186 0.622197 0.651397 0.375359
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.585792 14.387478 9.098958 9.902367 7.863146 9.088826 1.055723 1.172556 0.032987 0.036160 0.004213
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.312876 0.596919 -1.059151 -0.561831 0.932501 -0.635694 -0.228222 -0.461598 0.640418 0.653799 0.380847
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.929429 -0.135067 0.225930 -0.136830 -0.019081 1.122034 -0.603430 2.631396 0.640149 0.647608 0.379762
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 42.659091 6.523829 0.271497 -0.087287 3.399761 1.697578 8.245590 19.086727 0.397067 0.570602 0.355739
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 32.505523 0.594529 -0.162183 1.360455 1.870929 0.521112 1.204717 -0.122559 0.420222 0.616304 0.380046
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.003130 13.945630 -1.084713 4.540740 -0.891657 9.154867 0.399478 -0.702785 0.575111 0.038428 0.449419
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.499466 14.787105 0.601948 4.453706 -0.694053 9.176690 -0.667140 0.214374 0.590229 0.046415 0.465955
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.397310 14.010480 0.250129 8.364817 -0.255221 8.943891 -0.278845 0.457957 0.568844 0.035454 0.433726
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.788139 0.982491 0.485202 4.906157 -0.444034 0.052792 -0.169116 1.115127 0.590970 0.545235 0.383018
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.049333 -0.048639 0.290261 0.669451 0.108456 -0.000012 -0.732629 -0.076168 0.605153 0.614062 0.381085
84 N08 RF_maintenance 100.00% 70.66% 100.00% 0.00% 19.542294 24.342922 11.218516 12.032127 6.665722 9.156247 2.098527 2.237608 0.191703 0.035069 0.120640
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.600668 -0.254640 2.407869 1.507922 -1.068673 0.080928 -0.260378 -0.025770 0.603928 0.634667 0.379385
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.365847 0.024525 1.234668 1.802208 2.320563 -0.292765 -0.170451 13.608563 0.609684 0.630310 0.360496
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.264663 6.560760 -0.523564 0.121661 1.691112 0.117220 7.590824 5.578843 0.625150 0.655688 0.368561
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.884130 -0.128300 0.473783 0.956855 -0.229543 -1.154602 -0.216158 -0.558171 0.627164 0.644257 0.367593
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.947374 0.362866 0.127598 1.061724 -0.862084 -0.671993 -0.819507 -0.780238 0.627783 0.645922 0.371037
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.463916 -0.106779 -1.070111 -0.242570 -0.286118 -1.459534 -0.603410 1.008728 0.635066 0.654850 0.379364
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.160357 -0.009187 0.467687 0.562905 -0.781801 -0.464245 0.405134 0.186629 0.616182 0.641071 0.379528
92 N10 RF_maintenance 100.00% 97.19% 97.30% 0.05% nan nan inf inf nan nan nan nan 0.605712 0.593456 0.265242
93 N10 digital_ok 100.00% 96.87% 97.08% 0.05% 245.535053 245.900237 inf inf 2802.456577 2762.394251 3139.582168 3159.607709 0.543403 0.524317 0.279172
94 N10 digital_ok 100.00% 96.87% 96.97% 0.00% nan nan inf inf nan nan nan nan 0.605844 0.595314 0.268675
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 7.073580 4.079159 -0.490077 0.819768 0.154164 0.047729 -0.540388 -0.350724 0.530502 0.576106 0.350285
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 4.638033 21.733882 3.590674 1.522982 3.215096 1.973578 -2.386404 -1.762020 0.592508 0.493228 0.364554
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.175743 4.608478 -0.440440 0.913240 -0.836115 0.715420 0.352601 8.351664 0.571236 0.537704 0.374653
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.268682 7.712779 -0.250665 1.365125 -0.055744 1.216796 -0.243892 -0.354776 0.624710 0.631740 0.378991
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.922971 1.071894 -0.957500 -0.431232 0.257394 1.157116 -0.475846 6.893317 0.626142 0.643803 0.377516
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.134545 3.283874 2.787438 -0.878152 0.519734 0.195134 -1.838471 9.043045 0.628167 0.642776 0.368869
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.150994 59.638209 -0.906636 6.474581 2.344901 -0.688741 -0.055128 -0.052370 0.635543 0.622561 0.370713
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.552161 -0.015300 0.324300 1.087694 0.393758 -0.608515 -0.684390 -0.638695 0.631641 0.646340 0.368650
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.731274 -0.781381 -0.964555 -0.178279 0.013693 -1.221341 -0.254215 -0.669038 0.632841 0.636804 0.365558
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 2.073018 1.413106 -0.504230 -0.708115 0.182854 0.008730 3.256007 3.410576 0.627702 0.653092 0.371400
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.099146 41.529950 8.701203 1.173350 7.989035 3.732639 0.481841 2.502827 0.032771 0.280879 0.155670
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.973677 13.207453 8.730628 9.331312 8.071392 9.288843 -0.365846 0.495675 0.027611 0.029297 0.001620
110 N10 RF_maintenance 100.00% 4.27% 0.00% 95.68% 14.887953 2.494910 9.404551 4.556039 3.662747 4.010068 0.988458 -0.154005 0.158980 0.260224 -0.212940
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 32.319087 13.078447 0.778966 9.409693 4.832818 9.285545 7.611176 0.607436 0.491672 0.054647 0.338476
112 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.142323 13.353483 8.549640 9.553445 8.010109 9.287762 -0.301239 -0.088003 0.029500 0.030649 0.001096
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.949749 14.521322 3.603735 4.537270 7.875820 9.132537 0.640109 -0.091004 0.034462 0.031227 0.001700
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 18.186265 11.693017 15.596187 9.401453 13.705900 9.789875 344.081920 50.280524 0.018561 0.028040 0.005516
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.090617 -0.791637 -0.602668 0.237523 -0.324292 -1.020981 -0.740949 -1.242964 0.556680 0.586558 0.390562
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.897964 14.682864 8.820072 9.858859 7.873935 9.201353 0.163080 1.735278 0.027892 0.030862 0.002180
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.239900 1.718119 -0.067405 0.819105 -0.585789 0.253005 -0.283598 0.418526 0.601784 0.618823 0.389977
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.366432 1.518830 2.434441 -0.619724 -0.529237 0.676989 3.147874 2.342781 0.611769 0.640005 0.378809
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.557033 3.548130 -0.927209 5.543875 0.375483 -0.860822 8.428173 11.532522 0.638712 0.621913 0.372561
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.687287 6.998282 -0.895969 -0.837723 -0.050118 0.911670 -0.693272 -0.970810 0.635697 0.654951 0.375775
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.609500 9.232037 0.772093 1.182475 0.187365 -0.021263 -0.585009 -0.396239 0.641164 0.655896 0.378218
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 10.225287 0.024409 8.953567 0.865866 7.853169 0.480250 -0.071782 0.472155 0.038977 0.653941 0.463491
125 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.464635 2.074645 -0.088102 0.950814 1.654227 0.249397 1.676043 1.537523 0.632003 0.641815 0.366258
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.674869 3.018557 -0.990092 1.850057 1.226347 4.530080 1.268326 0.876170 0.639081 0.638481 0.375082
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.287675 0.167231 0.658519 0.684959 1.203880 0.905146 0.352653 -0.210965 0.631521 0.652053 0.385333
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.079477 -0.374507 -0.885199 -0.275863 -0.355546 0.530683 -0.371211 2.674348 0.638932 0.649993 0.391053
131 N11 not_connected 100.00% 0.00% 3.30% 0.00% -0.823688 12.871261 0.279451 4.376268 -0.740912 8.044638 -0.850241 -0.347884 0.598920 0.274197 0.429955
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.669825 0.723688 -0.006582 -1.001843 1.463889 -1.109001 0.538090 -0.392708 0.577291 0.585262 0.376523
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.619179 -0.995603 -0.968545 -0.281085 -0.907012 -1.286409 -0.564274 0.582071 0.560234 0.591157 0.394367
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.322507 14.483106 3.729823 4.504361 7.849281 9.152333 -0.411022 -0.194692 0.038990 0.033882 0.002823
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.318614 -1.242276 -0.758898 -1.115396 2.362102 0.657346 4.667117 -0.144394 0.564939 0.597634 0.404180
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.338250 -0.600428 8.371643 -0.314291 8.050698 0.411253 0.475130 -0.724747 0.037490 0.601203 0.457983
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.202894 -0.536612 0.348888 -1.111957 1.427629 -0.387684 0.194476 -0.116816 0.581148 0.613791 0.392744
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.315958 1.855521 1.675523 -0.706278 0.742214 -0.822732 -0.922747 -0.178496 0.609187 0.605433 0.371255
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.224800 -0.879046 -0.729076 -0.077537 -0.651599 -0.857270 2.655217 2.182916 0.626105 0.642818 0.377777
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.362296 -0.756685 -0.071399 0.637865 1.502148 -1.109616 0.740049 -0.847908 0.624024 0.648311 0.377788
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.429893 13.179817 -0.417329 9.573213 2.979499 9.269421 23.041763 0.803117 0.628672 0.042972 0.513225
143 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.595839 -0.928895 -0.971959 -0.645991 -0.270344 1.663620 -0.264073 0.472368 0.640038 0.649245 0.373700
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.369205 2.491606 -0.731290 7.067448 -0.115217 2.188589 -0.655174 0.149109 0.641312 0.541381 0.409350
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.355778 13.300838 8.718229 9.601987 7.817299 9.295872 0.262578 1.992932 0.068369 0.029134 0.028652
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.321159 0.806599 -0.446791 0.469429 -0.456122 -0.000208 -0.699400 -1.551252 0.611816 0.636308 0.373577
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.439784 -1.306527 2.067071 2.426202 -0.708894 -0.469121 4.813607 0.687460 0.619592 0.631860 0.374006
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.365074 0.009514 -0.373816 -0.156357 1.304781 1.528472 -0.412383 -0.481576 0.628271 0.646305 0.390614
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.100037 -1.325794 -0.694158 -1.103650 -0.309839 0.857256 0.160814 0.103662 0.624358 0.639801 0.397496
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.051423 3.166642 -0.674006 -1.016761 -0.695027 -0.262199 0.315904 0.401668 0.623273 0.617554 0.390349
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 21.621148 1.210734 0.224207 0.797481 2.648299 -0.838934 3.992738 -0.396911 0.485140 0.557315 0.343131
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.638929 -1.140035 8.507656 -0.891892 8.104004 -0.225074 1.260177 1.533779 0.038959 0.601908 0.469454
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 4.016073 12.900260 7.345939 9.342427 4.229192 9.308623 2.473989 1.185193 0.400251 0.037432 0.306291
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.444731 -0.363587 0.062769 0.932230 -0.274631 0.580121 -0.385440 -0.007495 0.590152 0.612412 0.390588
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.045561 -0.268218 0.037350 0.210333 1.795348 1.847512 1.541627 14.715351 0.602659 0.623565 0.389720
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.413064 2.929442 -1.005720 -1.034373 -0.218721 0.977811 -0.290945 12.443759 0.573724 0.591585 0.370450
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.101133 -1.021169 -0.384929 -0.197759 -0.515575 1.548172 -0.678236 0.237726 0.616448 0.635030 0.382321
161 N13 digital_ok 100.00% 96.81% 97.46% 0.00% 200.559429 201.027058 inf inf 2884.303574 2846.344299 4522.274551 4370.875285 0.534772 0.472192 0.259963
162 N13 digital_ok 100.00% 97.14% 97.57% 0.00% 190.032283 189.402804 inf inf 2767.581342 2843.616811 4116.737148 4457.690764 0.530056 0.411723 0.353894
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 1.019857 1.313774 -0.065191 0.728043 0.000012 1.055390 -0.308646 0.950544 0.634747 0.649499 0.383399
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.128748 -0.287347 -0.263811 1.629058 1.041814 1.531348 3.849321 0.507145 0.634655 0.639516 0.371854
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 26.023100 -0.185078 -0.417979 -0.467628 4.497410 0.316611 18.597864 0.120220 0.524311 0.649858 0.373589
166 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.437991 3.054818 -1.067034 2.834182 -0.010329 3.753185 2.477073 -1.519822 0.620281 0.637803 0.374118
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.965837 -1.080096 -1.083514 -0.644471 1.223073 -0.403212 0.384013 1.802493 0.633837 0.650166 0.385057
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.847539 -1.393249 0.357093 0.026388 1.166775 0.747751 -0.306480 3.489979 0.628897 0.639315 0.387565
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.354374 -1.097101 -0.674733 -1.128478 0.601630 0.550677 -0.710205 -0.716744 0.628879 0.643459 0.394259
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.862307 -0.570333 8.998274 -0.361674 7.882286 -0.125214 1.182125 4.251760 0.038354 0.634306 0.500508
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.822990 1.715199 -0.910197 -0.268878 -0.739142 0.095583 -0.692276 0.322546 0.563964 0.561976 0.361375
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 12.114205 13.813549 3.350772 4.188045 8.091644 9.278402 1.571706 2.834776 0.034846 0.040608 0.004117
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.699393 -0.659393 -1.006810 -0.568592 -0.973925 1.480990 -0.612885 -0.464070 0.599952 0.622055 0.391048
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.410315 13.810861 -1.104156 9.698285 0.243907 9.160904 12.340955 1.039390 0.618379 0.049769 0.515733
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.583838 -0.325052 0.675311 0.769272 0.457669 -0.137571 -0.558168 2.323907 0.619688 0.633003 0.389086
182 N13 digital_ok 100.00% 97.30% 97.51% 0.00% 245.978957 246.527131 inf inf 2963.635450 2954.900643 4761.498448 4772.964562 0.508003 0.443703 0.307038
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.463158 -0.227788 0.145550 0.935223 1.175194 -0.127527 1.369197 0.596376 0.618703 0.637368 0.376230
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.679157 -0.720175 -0.942261 -0.027718 -0.214569 0.214874 0.064861 -0.187192 0.639279 0.649136 0.369036
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 20.130087 -0.242901 -0.483167 -0.847926 6.706238 0.569126 10.875027 0.002093 0.563873 0.646386 0.371644
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.173034 -0.724088 0.685261 -0.081952 -0.533742 -0.946787 -0.101503 -0.887680 0.619284 0.653995 0.384797
187 N14 digital_ok 100.00% 61.21% 0.00% 0.00% 9.367053 -0.787134 7.875845 0.141451 7.171210 1.380627 0.150502 -0.341647 0.207788 0.645529 0.468616
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 8.544313 12.733163 8.278944 9.426067 8.125550 9.341015 16.659747 1.391564 0.028641 0.030783 0.001018
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.900171 -1.274358 -0.513609 0.465504 -0.420172 -0.745988 -0.749253 -1.442088 0.618839 0.638275 0.399308
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 0.398286 0.369601 1.221073 -0.024848 -0.171023 0.561523 4.040640 0.232745 0.594838 0.615914 0.393912
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.450091 7.060320 3.253855 4.275030 2.656838 7.390054 -0.745818 -3.000200 0.580757 0.563785 0.390262
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 7.809761 1.026932 4.743505 1.520805 6.317101 1.575543 -2.908064 -0.806891 0.547150 0.581245 0.406281
200 N18 RF_maintenance 100.00% 100.00% 65.05% 0.00% 11.773775 37.935389 3.712185 0.024811 8.070623 4.360419 0.466008 12.598235 0.038547 0.198653 0.130623
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.917164 5.053185 3.018565 3.697393 2.519381 5.893914 -0.510474 -2.223969 0.599327 0.603994 0.382398
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.691800 3.892376 1.765088 -1.017243 0.640352 -0.435682 -0.236376 16.121469 0.611001 0.600686 0.375833
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.899121 15.468054 0.992833 -0.705727 -0.552008 0.581681 8.164161 0.582492 0.617870 0.646548 0.385840
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 9.644461 1.820930 3.415661 -0.662962 6.648746 -0.800566 1.584419 2.442858 0.284229 0.609644 0.460016
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.029256 6.392809 -0.578988 2.261048 7.478368 3.002510 -0.096476 0.460755 0.591397 0.496382 0.388665
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.526742 2.258118 -0.280297 -0.170580 -0.735768 -0.890294 5.877222 -0.674191 0.599625 0.591240 0.368513
208 N20 dish_maintenance 100.00% 96.33% 96.27% 0.00% 260.573674 259.964193 inf inf 3694.318103 3686.583124 6573.246290 6535.489432 0.502848 0.524373 0.239492
209 N20 dish_maintenance 100.00% 96.54% 96.54% 0.00% nan nan inf inf nan nan nan nan 0.491659 0.536478 0.265374
210 N20 dish_maintenance 100.00% 96.16% 95.84% 0.05% nan nan inf inf nan nan nan nan 0.537888 0.580668 0.229798
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.026904 13.766245 -0.894244 4.564390 -0.752250 9.162588 0.016807 -0.279066 0.562187 0.038520 0.482488
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.217556 -0.881101 0.746169 -0.221728 -0.645469 -0.286822 2.731015 -1.165872 0.601330 0.607190 0.378897
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 3.363278 -0.188756 -0.928177 -0.499345 -0.386322 -1.234788 12.531486 -0.587717 0.577109 0.614970 0.384249
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.021935 -0.286811 0.087719 -0.621919 -0.480429 18.403297 1.842386 -0.882684 0.595289 0.603562 0.377187
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.720883 -0.189113 -1.070481 0.509192 -0.560049 -0.785400 0.918677 -0.007409 0.584654 0.625351 0.387712
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.889628 6.226424 4.897287 4.158055 6.539559 6.980219 -2.843577 -2.201201 0.577282 0.599530 0.377017
225 N19 RF_ok 100.00% 0.00% 91.95% 0.00% -0.622871 13.318005 0.901973 4.337721 -0.767606 9.017480 -1.196924 0.329169 0.607461 0.129088 0.502141
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.267939 19.791117 -0.131225 0.836683 -0.923488 2.825909 -0.937644 -1.038987 0.596225 0.540519 0.366167
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 4.239114 -0.216540 1.728642 -0.344439 1.745685 -0.869938 2.786007 -0.187853 0.472472 0.598845 0.419323
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.813039 0.009187 1.286518 -1.101750 0.607855 -1.148926 -0.274287 0.707586 0.578472 0.579295 0.376440
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.286773 0.547367 1.040698 1.358115 -0.275851 0.791349 1.463332 -1.869669 0.580183 0.593663 0.398393
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.628368 -0.049528 0.033302 -1.094758 -0.904944 -0.906178 -0.800567 -1.089763 0.530100 0.588140 0.393657
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.257148 -0.170015 1.151194 0.369585 -0.469433 -0.759292 -1.249059 -1.488505 0.593225 0.609206 0.387915
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.907021 -1.156749 0.221356 0.144147 -0.597775 -0.888869 5.146638 0.781561 0.595744 0.611818 0.386291
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.462128 0.360885 -0.109181 -0.730675 -0.746399 -1.378384 8.837468 5.110513 0.585993 0.608327 0.386442
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.281994 -1.056656 -0.013851 0.250757 -0.712530 -1.084088 0.398517 -0.722204 0.585841 0.615486 0.396777
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 17.368475 0.454986 0.694770 1.211627 2.417538 0.474771 -0.915439 -0.265434 0.510456 0.611128 0.396090
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 22.410707 -0.501629 1.341922 -1.017412 2.897340 -0.804981 -0.975323 -0.166219 0.455251 0.589146 0.381966
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.243184 -0.706861 -0.792826 -0.723602 -0.350562 -0.579791 1.570773 3.833148 0.545281 0.597345 0.395405
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.016681 0.483132 1.323675 -0.405358 0.200656 -1.309355 -1.519066 0.109322 0.577495 0.588400 0.387461
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% 0.056263 14.703069 0.096473 3.582439 -0.776886 9.205380 -0.929247 -0.762043 0.562971 0.037409 0.480580
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% -0.210004 2.496539 0.461902 -0.162899 -0.519896 -0.900110 4.922429 1.542831 0.570947 0.564694 0.380652
262 N20 dish_maintenance 100.00% 2.65% 11.08% 0.00% 10.979458 12.624446 4.537044 4.932626 4.051434 4.283595 -0.026379 1.578777 0.269960 0.248957 0.125611
320 N03 dish_maintenance 100.00% 100.00% 100.00% 0.00% 14.022487 13.556567 5.799406 6.371167 8.113397 9.379665 2.004067 2.997569 0.052388 0.044758 0.006590
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 2.402195 2.698978 1.261329 1.354428 0.965687 0.854474 0.758204 -0.872899 0.476031 0.499583 0.372552
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.438985 -0.734207 1.363042 -1.134936 0.580776 -1.370732 -1.370313 -0.147061 0.512829 0.514309 0.387786
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.996255 -0.295637 -0.722420 -0.790581 0.175472 -1.358318 3.411340 0.007409 0.461573 0.506475 0.372231
333 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.670614 4.295308 -0.872789 -0.994343 -0.358811 -0.875093 0.812861 -0.066104 0.457004 0.481955 0.354786
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 7, 15, 16, 18, 19, 27, 28, 29, 32, 34, 35, 36, 38, 40, 42, 45, 47, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 63, 64, 68, 71, 72, 77, 78, 79, 80, 81, 82, 84, 86, 87, 92, 93, 94, 95, 96, 97, 101, 102, 103, 104, 108, 109, 110, 111, 112, 113, 114, 117, 121, 122, 123, 124, 125, 126, 131, 134, 135, 136, 142, 144, 145, 147, 151, 155, 156, 158, 159, 161, 162, 165, 170, 173, 180, 182, 185, 187, 189, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 221, 222, 224, 225, 226, 227, 239, 240, 242, 243, 246, 261, 262, 320, 333]

unflagged_ants: [4, 5, 8, 9, 10, 17, 20, 21, 22, 30, 31, 37, 41, 43, 44, 46, 48, 49, 56, 61, 62, 65, 66, 67, 69, 70, 73, 74, 83, 85, 88, 89, 90, 91, 105, 106, 107, 115, 118, 120, 127, 128, 132, 133, 137, 139, 140, 141, 143, 146, 148, 149, 150, 157, 160, 163, 164, 166, 167, 168, 169, 171, 179, 181, 183, 184, 186, 190, 220, 223, 228, 229, 237, 238, 241, 244, 245, 324, 325, 329]

golden_ants: [5, 9, 10, 17, 20, 21, 30, 31, 37, 41, 44, 56, 65, 66, 67, 69, 70, 83, 85, 88, 91, 105, 106, 107, 118, 127, 128, 140, 141, 143, 146, 148, 149, 150, 157, 160, 163, 164, 167, 168, 169, 171, 181, 183, 184, 186, 190]
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_2459989.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 [ ]: