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 = "2459935"
data_path = "/mnt/sn1/2459935"
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: 12-21-2022
In [5]:
# Per-season options
def ant_to_report_url(ant):
    return f'https://htmlpreview.github.io/?https://github.com/HERA-Team/H6C_Notebooks/blob/main/antenna_report/antenna_{ant}_report.html'

Load Auto Metrics¶

In [6]:
use_auto_metrics = False

# find the auto_metrics file
glob_str = os.path.join(data_path, f'zen.{JD}*.auto_metrics.h5')
auto_metrics_file = sorted(glob.glob(glob_str))

# if it exists, load and extract relevant information
if len(auto_metrics_file) > 0:
    auto_metrics_file = auto_metrics_file[0]
    print(f'Found auto_metrics results file at {auto_metrics_file}.')
    
    auto_metrics = load_metric_file(auto_metrics_file)
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
    auto_ex_ants = auto_metrics['ex_ants']['r2_ex_ants']
    
    use_auto_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping auto_metrics.')
Found auto_metrics results file at /mnt/sn1/2459935/zen.2459935.21341.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 1848 ant_metrics files matching glob /mnt/sn1/2459935/zen.2459935.?????.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/2459935/zen.2459935.?????.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 2459935
Date 12-21-2022
LST Range 0.566 -- 10.511 hours
X-Engine Status ✅ ✅ ✅ ✅ ❌ ❌ ✅ ✅
Number of Files 1848
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 94
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 201 (0.0%)
Antennas in Commanded State (observed) 0 / 201 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 18
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 90 / 201 (44.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 140 / 201 (69.7%)
Redcal Done? ❌
Never Flagged Antennas 61 / 201 (30.3%)
A Priori Good Antennas Flagged 51 / 94 total a priori good antennas:
3, 7, 9, 10, 15, 16, 19, 21, 29, 30, 31, 37,
38, 40, 42, 53, 54, 55, 56, 71, 72, 81, 86,
93, 94, 100, 101, 103, 109, 111, 121, 122,
123, 128, 136, 140, 143, 146, 158, 161, 165,
167, 170, 181, 182, 183, 185, 187, 189, 191,
202
A Priori Bad Antennas Not Flagged 18 / 107 total a priori bad antennas:
4, 22, 43, 46, 48, 49, 61, 62, 64, 73, 89,
125, 137, 139, 324, 325, 329, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459935.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% 9.891626 14.433653 8.319645 0.508112 8.914354 5.656028 1.530435 8.358382 0.032465 0.362189 0.291281
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.148497 -0.347620 0.135267 0.922626 0.350322 -0.617248 -0.735421 -2.142438 0.657305 0.673043 0.410736
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.699708 -0.102333 -0.468396 -0.105967 -0.575918 1.374478 -0.177214 -0.103174 0.656589 0.665321 0.405335
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.525781 -1.159119 0.475672 2.971738 -0.884610 -0.420294 17.473513 15.762486 0.645337 0.646766 0.390455
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.644979 -1.440357 -1.145433 -0.207607 -0.076011 0.577354 5.178021 3.185442 0.656001 0.663179 0.391246
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.087011 -0.893148 6.813220 0.113454 3.728569 0.790674 0.453700 -0.059144 0.488144 0.660794 0.462873
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.918398 -1.097110 -0.601299 -0.795033 -0.437260 1.516478 0.246952 6.991570 0.639200 0.653202 0.398434
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.100300 16.630970 7.780748 1.565248 8.916957 6.212484 0.735503 3.035757 0.030835 0.357018 0.275566
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.127003 -0.236928 8.290166 0.447712 8.920527 1.512711 1.587052 2.524091 0.030992 0.671108 0.546283
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.496647 1.823165 -0.140782 0.058611 0.131173 0.593196 0.432062 0.951550 0.660706 0.671224 0.400761
18 N01 RF_maintenance 100.00% 100.00% 53.84% 0.00% 10.755851 18.904952 8.279195 0.132173 9.039579 7.446646 1.443619 22.579684 0.028346 0.238169 0.183430
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.373143 -1.169658 -0.851669 2.935980 -0.052770 0.007074 0.022873 4.494221 0.664224 0.653952 0.393448
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.431787 -1.112452 2.994175 -0.876167 0.513858 -0.450504 0.776141 -0.911551 0.644412 0.676739 0.403513
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.018016 -0.414996 -0.434243 3.917730 0.346459 -0.650019 0.844501 0.090917 0.646676 0.628766 0.397867
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.749600 -0.525330 0.445252 -0.007400 2.042605 0.535825 -0.052304 -0.818292 0.589634 0.603543 0.380044
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.434974 11.012416 8.327514 9.013401 9.038271 9.585903 3.757581 2.914115 0.034727 0.038377 0.005828
28 N01 RF_maintenance 100.00% 0.00% 83.66% 0.00% 12.659073 26.791975 -1.193217 0.838962 5.542155 8.273717 8.524717 22.111226 0.374700 0.177050 0.264744
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.123537 11.447528 7.960688 8.649863 9.008311 9.553748 1.500889 0.961862 0.029408 0.033988 0.005104
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.396767 -0.056029 -0.424791 0.236722 1.718498 0.835508 37.589615 1.548637 0.663872 0.675454 0.388664
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.341644 -1.108655 0.473226 0.867335 0.838593 -0.374963 1.343042 4.280021 0.674723 0.674109 0.390361
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.273657 10.069629 -0.522133 1.561199 -0.239817 11.149079 1.080288 26.667603 0.620522 0.619112 0.357817
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.552162 12.540033 3.293545 3.873553 8.984362 9.544979 2.184143 1.818111 0.030697 0.036640 0.003889
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.390117 0.235153 0.917189 -1.242797 -0.612477 -1.350499 9.487359 0.238754 0.595069 0.590785 0.371695
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.925731 5.910290 -0.272763 0.116985 0.380888 1.652057 1.246950 1.651169 0.650078 0.657763 0.402693
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.561432 0.246483 -1.130627 0.481479 0.599556 0.829440 -0.532440 5.898991 0.667232 0.671406 0.407968
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.139680 -0.241504 -0.355257 0.470770 0.420529 -0.190898 7.611192 1.605955 0.667428 0.677715 0.407497
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 9.521103 0.158912 7.990504 0.270121 9.005113 -0.483465 1.456686 -0.083374 0.036471 0.670103 0.532000
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.538004 -0.353298 -0.663443 -0.168135 1.678158 -0.012672 -0.562223 -0.017253 0.668806 0.678631 0.388026
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.672757 11.940983 8.556610 9.456122 8.802583 9.416427 1.107400 2.163175 0.030614 0.028964 0.002181
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.047629 0.756077 -0.822323 0.331917 -0.427429 0.402524 0.001178 0.706997 0.650513 0.652243 0.383682
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -2.031201 0.022199 -0.350123 -0.727841 -0.824999 0.809748 -0.852499 -0.369031 0.660134 0.673297 0.383241
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.317777 0.455067 -0.366406 0.272281 -0.529918 1.320812 0.207338 3.474128 0.653716 0.660866 0.379602
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.292696 1.585792 0.817052 1.702824 -0.200734 0.399982 -0.016353 -2.270651 0.642215 0.668635 0.398347
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.769706 12.253595 3.131200 3.535593 8.945638 9.494475 1.912990 0.832633 0.028567 0.045944 0.011092
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.021940 0.796921 0.454879 1.535495 -1.171936 0.975480 2.236520 -2.204367 0.609294 0.630549 0.387332
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.157349 -0.235214 -1.504367 0.081994 0.127780 -1.217890 0.495092 1.565649 0.557379 0.606798 0.387700
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.048510 2.777192 -0.398891 0.590038 1.901107 2.972244 5.481387 6.522887 0.641173 0.652035 0.381724
51 N03 dish_maintenance 100.00% 99.40% 0.00% 0.00% 22.692432 3.323303 10.795877 -0.643898 9.186055 7.831899 11.518388 0.234203 0.040304 0.562129 0.429920
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.738909 5.934532 -0.919804 0.267922 0.783033 1.035105 0.553233 0.429196 0.670434 0.680457 0.397631
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.401939 2.447836 -0.472778 0.029266 0.770307 1.922414 2.767099 6.221154 0.676635 0.685773 0.402942
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.911356 11.638193 8.340975 9.223534 8.977159 9.536607 2.889681 1.676618 0.030822 0.029213 0.001472
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.371166 12.295631 8.355980 9.134121 9.013904 9.562323 1.531142 3.764047 0.027464 0.029623 0.002167
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.146409 12.414504 -0.132975 9.334098 -0.671363 9.473097 0.567740 1.647224 0.673796 0.036195 0.558797
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.004508 -0.161707 7.760173 0.856610 7.273382 0.741694 3.539062 1.444441 0.321125 0.685243 0.465730
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.507992 11.338400 8.232881 9.122983 8.923680 9.515220 2.545229 2.075828 0.032719 0.032522 0.001897
59 N05 RF_maintenance 100.00% 99.95% 0.00% 0.00% 10.342711 0.803938 7.818095 0.587081 8.777864 2.322402 1.173920 7.604324 0.046288 0.661143 0.525573
60 N05 RF_maintenance 100.00% 0.00% 96.75% 0.00% 0.657583 11.258703 -0.862423 9.153422 -0.329775 9.540686 1.803421 4.215001 0.638449 0.076141 0.507478
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.997323 0.392694 -1.029777 -1.536686 1.355354 -1.170902 -0.105361 0.803077 0.586451 0.620860 0.379329
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.250830 0.558230 -1.331547 0.918720 -0.909821 -0.209548 2.530157 -0.889821 0.581312 0.630540 0.388687
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.062145 11.658585 -0.118137 3.901143 -0.477047 9.613327 0.199877 4.310810 0.579258 0.039497 0.453129
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.254804 0.533341 -0.479776 -1.108535 -1.306729 -1.569787 0.535290 1.665645 0.558444 0.556789 0.358439
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.471574 0.573842 -0.120878 0.803704 0.531339 1.160121 -0.023916 0.380246 0.650469 0.667463 0.410434
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.278888 1.211927 1.815582 1.625162 2.497593 0.347447 -0.024343 1.158903 0.656367 0.674314 0.402633
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.028337 -0.732834 1.462207 1.665471 -0.697531 0.372912 0.816058 2.574779 0.667306 0.678203 0.396209
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 21.452729 25.593361 0.532035 12.141295 4.607231 9.604619 -0.000471 12.517794 0.380559 0.028508 0.278641
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.350281 -0.272969 -0.269899 0.510821 -0.681086 1.276669 -0.260892 0.163264 0.670812 0.683315 0.383979
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.027378 -0.116592 -0.713909 -0.180898 -0.128013 1.247419 0.038724 -0.273368 0.664969 0.689907 0.390496
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.520225 -0.474394 0.067186 0.723602 0.604124 -0.016600 -0.442175 0.193529 0.686967 0.690804 0.380491
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 2.207340 12.459939 0.116233 9.479319 -0.339599 9.425428 0.834224 1.769141 0.680113 0.034390 0.560088
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.898711 0.417816 -0.831800 1.488651 0.450102 1.145925 -0.312053 -0.163565 0.675229 0.668886 0.380947
74 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.535968 2.961322 0.134627 -0.775506 0.065585 1.762453 -0.133007 5.433462 0.655699 0.655336 0.371121
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.472108 0.673799 0.546364 -0.265206 -1.091858 -0.983582 6.902703 -1.045391 0.625258 0.625160 0.379725
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 30.594841 -0.260175 -0.480222 0.872532 3.205545 -0.530270 0.424712 2.477094 0.380320 0.609468 0.379523
79 N11 not_connected 100.00% 87.61% 87.61% 0.00% 12.297308 12.736216 -1.122531 -0.303570 0.944654 0.838721 1.517062 -1.036058 0.547972 0.562737 0.346420
80 N11 not_connected 100.00% 87.61% 100.00% 0.00% 13.900300 20.706593 2.647505 4.077233 4.077124 10.409236 4.244904 2.234973 0.543678 0.045166 0.421430
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.472467 12.053291 -0.546947 7.866459 -0.730063 9.336725 0.126627 2.735212 0.627997 0.037144 0.481422
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.224765 9.470897 -0.227057 7.352098 -0.356992 7.399575 -0.086200 0.742535 0.645758 0.324224 0.448121
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.843152 -0.251258 -0.414404 0.084592 0.341320 -1.211691 -0.461693 0.554249 0.655574 0.672100 0.392252
84 N08 RF_maintenance 100.00% 53.08% 100.00% 0.00% 19.530658 22.716070 10.933044 11.743226 7.426182 9.484223 5.640974 6.411077 0.234580 0.033694 0.154635
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.409979 -0.501319 0.096433 0.983881 -0.747257 -0.565232 -0.598018 -0.487022 0.672696 0.679225 0.385769
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.565952 2.413047 0.813154 1.228953 3.352099 -1.303862 0.276333 24.251625 0.663543 0.659953 0.367034
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.284988 6.807728 -1.024452 -0.216507 0.020542 0.871282 -0.312738 0.391124 0.691113 0.701193 0.381369
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.653578 -0.009560 -0.218938 0.441275 -0.595081 -0.632384 0.717409 0.171304 0.670225 0.685929 0.373566
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.969877 -0.166328 -0.486667 0.524439 -0.768193 -0.826196 -0.585787 -0.331810 0.681472 0.686736 0.376593
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.347428 -0.673843 0.441088 0.916269 -0.568907 -1.417048 0.211349 5.777759 0.670170 0.678548 0.378809
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.641717 -0.203294 -0.213962 0.016933 -0.909025 -0.425950 -0.246690 -0.006773 0.666761 0.685774 0.390469
92 N10 RF_maintenance 100.00% 0.00% 29.06% 0.00% 35.560280 42.605212 0.028470 0.761753 6.697360 8.967114 1.900786 18.962989 0.294913 0.250426 0.092421
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 1.852815 0.476233 1.475814 0.158850 1.309764 0.628531 4.759215 -0.522789 0.649631 0.668742 0.393118
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.887572 11.730257 8.471181 9.027043 8.959952 9.540331 1.802899 1.475904 0.029414 0.025841 0.002242
95 N11 not_connected 100.00% 87.61% 87.61% 0.00% 12.560946 12.898681 -0.660662 0.368467 1.524547 1.606176 -0.287670 0.582395 0.558483 0.573387 0.347592
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 19.234495 20.370354 3.414611 4.250889 9.750831 10.347061 2.023098 1.770160 0.033659 0.038926 0.002594
97 N11 not_connected 100.00% 87.61% 87.61% 0.00% 12.368142 15.715657 -0.226622 2.417592 1.715522 5.542942 6.865692 5.224879 0.504673 0.417023 0.333916
98 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.874256 3.231945 -0.457797 -0.182726 -0.739063 -0.053444 1.015534 2.895709 0.625361 0.637351 0.389553
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 2.706683 -0.815008 0.371786 0.147586 -1.336496 2.558265 3.429456 -0.093757 0.618941 0.658708 0.403131
100 N07 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.069849 7.835313 -0.932292 0.816230 0.383640 1.616725 -0.035300 -0.364529 0.673611 0.681752 0.387645
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.899161 1.208844 -1.198908 2.503914 1.236441 -0.624499 -0.546117 7.837223 0.682179 0.674217 0.381577
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.098344 3.940534 -1.527151 -0.400430 2.572549 1.423166 12.993169 5.200932 0.680447 0.689355 0.373703
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.111538 58.178232 5.640384 6.145599 1.961637 0.020829 0.331506 2.715169 0.622623 0.662676 0.380214
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.270372 -0.858478 -0.379143 0.519321 0.584260 -0.829530 -0.279013 -0.304177 0.681393 0.685729 0.368773
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.156839 0.293491 0.315969 0.685539 -0.816853 -0.487697 0.095757 -0.405762 0.673416 0.685526 0.372774
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.930229 1.893243 -0.755031 -0.450304 0.219729 0.547681 1.243190 3.449257 0.676952 0.687534 0.374525
108 N09 RF_maintenance 100.00% 100.00% 3.79% 0.00% 10.035288 36.142617 8.279408 0.534105 8.990871 7.454827 2.833868 7.908973 0.035175 0.293839 0.147137
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.809950 11.337400 8.312336 8.907476 9.078071 9.607547 1.178095 2.765137 0.026591 0.026087 0.001566
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 24.744823 24.200971 11.307420 11.907485 8.963816 9.421855 5.752394 6.004524 0.023588 0.025420 0.000807
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.115038 11.240689 -0.104375 8.998573 -0.423666 9.619142 -0.348972 3.215294 0.656634 0.035316 0.489913
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.727306 -0.398466 -0.330566 0.007400 0.974032 3.155905 0.258439 -0.285786 0.640147 0.655477 0.405014
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 19.863625 20.435834 3.215412 4.152008 9.782569 10.380806 2.890232 1.725467 0.035042 0.030382 0.002518
114 N11 not_connected 100.00% 87.61% 87.61% 0.00% 12.504550 12.754778 -0.830395 -0.389716 3.453543 1.698763 1.326674 0.035527 0.526611 0.552758 0.351778
115 N11 not_connected 100.00% 87.61% 87.61% 0.00% 13.376817 13.662077 1.247195 1.637452 2.131416 3.155036 -1.393175 -1.680161 0.539687 0.548002 0.361849
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -1.119505 0.349592 -1.223341 -0.174458 -0.462040 0.159089 1.896027 0.993218 0.619402 0.636004 0.393864
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.801328 12.728909 8.387667 9.452889 8.866001 9.574188 2.062423 5.054462 0.027324 0.030298 0.001921
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.121612 1.158987 -0.709123 0.364895 0.012672 -0.049209 0.333551 1.140065 0.647037 0.666119 0.394652
119 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.781969 2.797558 1.725059 2.006703 3.162422 2.282522 26.459545 4.970466 0.651109 0.672567 0.370792
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.106217 2.994226 -1.510337 5.647487 0.626632 -0.294211 19.260462 17.143335 0.682567 0.655644 0.377910
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.086393 5.802953 -0.214864 0.571306 1.149924 1.335564 0.344877 -0.531061 0.686862 0.692420 0.375783
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.209511 7.688261 0.083034 0.679773 0.665145 0.814643 -0.107659 0.575359 0.689086 0.695246 0.379614
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.963342 0.108754 -0.566172 0.362102 -1.088777 0.150057 0.791730 0.281963 0.688185 0.694112 0.380441
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.157380 0.784220 -0.973674 0.458311 -0.717946 -0.949532 0.894448 -0.162140 0.679315 0.682910 0.376856
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.302517 3.594022 -1.385249 1.124850 10.582292 0.541853 8.496044 1.799072 0.642833 0.677939 0.379265
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.140385 0.099931 -0.106537 0.283437 1.706893 1.474010 -0.080339 0.213536 0.668032 0.684868 0.395694
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.141489 10.863123 8.380045 9.119369 8.904652 9.483117 0.972787 1.473609 0.028751 0.025508 0.002075
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.822149 0.496068 1.371689 0.785150 0.090791 -0.781874 -2.044624 -1.930818 0.652563 0.670381 0.403552
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.774188 -0.788287 1.276410 0.736464 0.082244 -0.576161 -1.666901 0.262100 0.642039 0.659209 0.398980
131 N11 not_connected 100.00% 87.61% 93.07% 0.00% 12.655967 19.585628 -0.096488 4.127733 2.536620 9.805426 -0.657411 0.596564 0.568315 0.200377 0.406732
132 N11 not_connected 100.00% 87.61% 87.61% 0.00% 12.319447 12.359729 -1.089376 -1.297776 1.970751 1.240932 2.895806 0.610231 0.533537 0.543476 0.344521
133 N11 not_connected 100.00% 100.00% 87.61% 0.00% 19.322094 12.356459 3.209954 -1.276635 9.879828 1.289833 2.664292 -0.188569 0.048617 0.535692 0.415991
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.815368 -0.886271 -0.457058 -1.574308 5.236323 0.922154 6.879946 0.121770 0.621363 0.651278 0.414564
136 N12 digital_ok 100.00% 99.68% 0.00% 0.00% 9.130618 0.188764 7.937795 1.022706 9.048730 15.195949 2.522327 1.601131 0.039772 0.639993 0.498917
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.199457 -1.123659 -0.421694 -1.471585 1.311286 -0.226190 1.909647 1.483813 0.631045 0.658538 0.402153
138 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 243.255371 243.216979 inf inf 4646.494413 4583.039043 7595.615982 7403.193093 nan nan nan
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.725693 0.009560 1.582402 -1.025798 0.170023 -1.272115 -1.791100 -1.129982 0.657833 0.658689 0.382499
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.463530 -0.654560 -1.514175 -0.356747 -0.767263 -0.915251 6.894566 4.648902 0.670392 0.690127 0.384267
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.467978 -0.891990 -0.836907 0.465610 1.914116 -1.638926 -0.297987 -1.469686 0.674456 0.692436 0.379404
142 N13 RF_maintenance 100.00% 0.00% 99.62% 0.00% 2.093022 11.279324 -1.196264 9.155302 3.213173 9.543237 21.087694 2.644196 0.677216 0.047783 0.578916
143 N14 digital_ok 100.00% 0.00% 100.00% 0.00% 1.008235 11.726850 5.161005 9.143770 -0.365710 9.397539 -0.211317 1.836888 0.614738 0.035767 0.538443
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.717160 0.110014 -0.831722 0.583123 -0.220408 1.500356 -0.515874 0.439122 0.682625 0.690053 0.383411
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.120999 1.364579 -0.700653 4.323004 -0.318103 9.718340 0.174343 0.999444 0.677690 0.652051 0.399426
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.146621 -0.925350 2.944908 -0.278294 8.961163 -0.819062 1.015807 -0.736548 0.036838 0.675720 0.570985
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.527204 -1.260299 0.511128 1.858440 -0.663528 -0.689801 1.306294 0.964244 0.648474 0.660564 0.388450
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.647362 -0.361185 2.358290 1.418276 0.421141 1.372025 -0.064114 -0.236785 0.629244 0.661850 0.399842
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.573106 0.854435 -1.241141 1.545370 -0.668457 0.253404 1.563503 -1.141704 0.643577 0.661071 0.404632
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.933146 0.144162 1.540589 0.571048 -0.502497 -1.259383 -1.166910 0.060685 0.636420 0.653321 0.416740
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.635357 -0.853923 8.021274 -1.446291 9.049485 1.008003 1.354529 2.971540 0.035815 0.646050 0.501681
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.980306 11.105129 6.747416 8.917984 4.251952 9.600970 2.165368 2.975077 0.459941 0.037552 0.377003
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.065007 -0.384362 -0.613998 0.393892 -0.510423 0.969502 -0.076431 0.433171 0.637268 0.653453 0.399772
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.035575 0.076863 -0.772327 -1.140895 1.936695 1.933280 5.647048 17.717607 0.651985 0.669381 0.402874
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.353217 5.587796 -1.199130 -1.343578 -1.446454 3.621080 -0.036770 15.788280 0.625104 0.631061 0.380198
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.410496 -0.976431 -0.766554 -0.806487 -0.579477 1.071317 0.981936 2.249874 0.664830 0.676049 0.389001
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.014299 27.427411 -0.573577 -0.750494 -0.333508 1.200956 -0.044187 0.855148 0.666165 0.551864 0.350697
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.163799 -0.042016 2.264091 1.126699 0.549112 -0.718037 -1.151349 -1.139131 0.676042 0.686923 0.385689
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.183414 0.713005 -0.707368 0.230462 -0.189357 0.724658 0.148113 2.356932 0.679061 0.684299 0.393003
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.015259 0.102104 0.556079 -0.238034 3.117756 1.880947 2.233981 1.896859 0.668946 0.682851 0.387866
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 30.792000 -0.422679 1.429400 0.310660 4.333785 0.099468 2.145308 -0.309134 0.516556 0.678614 0.392602
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.278588 0.591697 -0.032785 1.809575 0.403021 0.860331 7.299297 18.353221 0.665399 0.665089 0.396641
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.161969 -1.043036 -0.806768 3.177110 1.439298 -0.466524 -0.486639 5.212568 0.665061 0.651634 0.404971
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.798908 -1.084455 -0.356744 -0.551504 1.379697 0.531673 -0.190094 2.169201 0.651619 0.669645 0.405198
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.759141 -1.007710 -1.387775 -1.526200 0.646587 0.233603 -0.566768 -0.871884 0.650075 0.667099 0.408200
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.613963 -0.275336 8.502332 -1.239085 8.843302 -0.760439 1.781129 4.383584 0.036409 0.657195 0.556985
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.454873 0.869646 1.139098 4.599404 -1.381745 -0.169441 0.118085 13.434717 0.633486 0.619538 0.386063
180 N13 RF_maintenance 100.00% 0.00% 99.89% 0.00% -0.074091 12.076137 -0.591200 9.280736 1.082111 9.493132 26.501212 3.525550 0.658102 0.054075 0.578258
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.136563 -0.087583 -0.554729 0.112273 -0.342540 0.483354 -0.158619 6.236901 0.664389 0.670009 0.394459
182 N13 digital_ok 100.00% 0.00% 99.95% 0.00% 0.199177 11.029186 -1.041831 8.893652 -0.222010 9.581355 14.945686 3.048237 0.670635 0.047658 0.554153
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.825316 0.522115 0.695832 4.306276 0.692785 -1.080765 1.308034 -0.083458 0.652723 0.624824 0.385366
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.308793 -0.368579 0.226212 2.970729 0.579486 -1.056604 1.542107 0.636713 0.661285 0.662695 0.385162
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 17.143504 -1.260821 6.749224 3.983216 9.681971 -1.238624 1.945630 -0.032471 0.356453 0.639015 0.421516
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.861040 -1.687697 -1.286060 -0.622870 1.239466 -0.571972 0.815096 0.185856 0.670745 0.682644 0.408526
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.067087 -0.577792 -1.056955 0.480409 -0.149597 2.034022 2.050729 32.661155 0.666836 0.673298 0.399134
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 9.163891 10.868635 7.873551 8.947569 9.056348 9.612377 2.214482 2.193923 0.027098 0.029285 0.000933
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.259235 -1.350156 -1.168653 0.191788 -0.270454 -1.074779 -0.037627 -1.192470 0.633021 0.655676 0.419630
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.689582 1.047059 0.617844 -0.614066 0.215938 0.648874 15.517156 1.609642 0.615566 0.638817 0.420699
200 N18 RF_maintenance 100.00% 100.00% 97.73% 0.00% 19.596596 41.330291 3.362020 0.284269 10.004091 9.613341 3.116216 0.368886 0.039535 0.190794 0.121311
201 N18 RF_maintenance 100.00% 87.61% 87.61% 0.00% 13.964625 15.427065 2.654892 3.480814 6.048026 7.233921 -0.077894 -2.762873 0.575222 0.557366 0.347521
202 N18 digital_ok 100.00% 87.61% 87.61% 0.00% 13.134317 12.206676 1.409443 -1.237922 2.265584 3.396119 -1.178548 38.134244 0.583813 0.566860 0.344152
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
205 N19 RF_ok 100.00% 87.61% 87.61% 0.00% 13.542682 13.224737 0.482514 -0.819066 1.280729 2.020684 -0.369955 21.227089 0.569350 0.552072 0.334850
206 N19 RF_ok 100.00% 87.61% 87.61% 0.00% 13.569173 13.093499 1.014788 -0.851465 9.435508 0.787156 -1.137895 5.699657 0.577721 0.567339 0.343591
207 N19 RF_ok 100.00% 87.61% 87.61% 0.00% 14.300735 13.546104 1.193885 -1.012921 2.535316 2.429628 -0.523317 -0.176168 0.554584 0.544590 0.316793
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 16.046918 20.392866 8.066250 9.862405 9.553443 9.119306 30.737495 96.828053 0.032090 0.033599 0.000514
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 15.991789 17.419834 7.732718 8.367449 9.756749 11.178375 19.513380 25.343960 0.038207 0.036553 0.000831
210 N20 dish_maintenance 100.00% 87.61% 87.61% 0.00% 20.300114 19.857852 1.763754 3.541828 1.219430 0.755937 -0.194621 2.079904 0.563489 0.555707 0.355330
211 N20 RF_ok 100.00% 87.61% 87.61% 0.00% 12.205723 12.848455 -0.796229 -0.242823 1.564908 1.028652 2.535230 -0.458183 0.533263 0.545595 0.353714
219 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
220 N18 RF_maintenance 100.00% 87.61% 87.61% 0.00% 12.740039 12.537831 0.310695 -0.592451 1.640589 1.563450 4.919567 -0.998219 0.567698 0.561209 0.337596
221 N18 RF_ok 100.00% 87.61% 87.61% 0.00% 12.523405 12.483654 -0.874016 -0.794471 3.475735 0.987885 3.756871 -0.026393 0.555064 0.569417 0.343368
222 N18 RF_ok 100.00% 87.61% 87.61% 0.00% 12.476304 12.893994 -0.201392 -0.173257 3.154607 1.164883 3.872940 -1.214390 0.565306 0.577860 0.346243
223 N19 RF_ok 100.00% 87.61% 87.61% 0.00% 13.273669 13.962740 -1.029091 1.789729 1.065303 3.750098 0.237528 1.658488 0.547565 0.470860 0.350694
224 N19 RF_ok 100.00% 87.61% 87.61% 0.00% 16.658931 16.545705 4.711070 4.108753 8.300993 8.515824 -3.993684 -3.898861 0.528588 0.541306 0.330561
225 N19 RF_ok 100.00% 87.61% 100.00% 0.00% 13.425214 19.726064 0.757554 3.965484 1.624941 10.374178 -0.853684 1.780010 0.568277 0.093913 0.470148
226 N19 RF_ok 100.00% 87.61% 87.61% 0.00% 13.105875 13.586976 0.054338 0.842178 1.041687 2.865877 -0.877152 -1.167107 0.562474 0.570981 0.350665
227 N20 RF_ok 100.00% 87.61% 87.61% 0.00% 12.891285 13.121007 -1.037782 -0.226166 2.663823 1.304277 16.279106 -0.687587 0.524767 0.548322 0.337680
228 N20 RF_maintenance 100.00% 87.61% 87.61% 0.00% 17.609470 21.032558 -1.003862 -0.521504 5.080377 9.408666 54.128719 34.531761 0.435728 0.421117 0.239365
229 N20 RF_maintenance 100.00% 87.61% 87.61% 0.00% 13.310721 13.235575 1.228904 0.860256 2.019721 1.922174 15.459815 -1.815588 0.542197 0.547168 0.354693
237 N18 RF_ok 100.00% 87.61% 87.61% 0.00% 12.167353 11.982209 -0.353130 -1.321145 2.369697 2.612209 1.209633 -0.551556 0.501122 0.541054 0.350916
238 N18 RF_ok 100.00% 87.61% 87.61% 0.00% 13.041433 12.569771 1.216834 0.404058 2.396583 3.020977 -1.411165 -1.648038 0.557753 0.560156 0.345870
239 N18 RF_ok 100.00% 87.61% 87.61% 0.00% 12.788192 12.835008 0.340514 0.279694 1.261443 2.423386 -0.057339 1.795668 0.558076 0.565457 0.347127
240 N19 RF_maintenance 100.00% 87.61% 87.61% 0.00% 24.622907 51.531142 2.233361 0.824992 5.796930 8.171401 -0.871693 2.360972 0.423993 0.337564 0.200484
241 N19 RF_ok 100.00% 87.61% 87.61% 0.00% 13.225617 13.758695 -0.550263 0.497998 1.596118 1.853246 8.603994 22.231298 0.548096 0.515574 0.351707
242 N19 RF_ok 100.00% 87.61% 87.61% 0.00% 51.676600 13.740200 -0.036753 1.248083 15.664673 2.556785 2.908687 -0.941524 0.255769 0.562178 0.425950
243 N19 RF_ok 100.00% 87.61% 87.61% 0.00% 60.769247 13.410694 0.565890 -1.239744 7.983730 2.064088 -0.461545 0.652480 0.238795 0.539540 0.413753
244 N20 RF_maintenance 100.00% 87.61% 87.61% 0.00% 13.848828 12.689887 0.862909 -0.662036 3.418608 2.190567 3.122144 9.141732 0.443483 0.520808 0.334854
245 N20 RF_ok 100.00% 87.61% 87.61% 0.00% 14.221176 13.347596 2.799889 0.424993 4.446936 2.427188 -2.751054 -0.447810 0.548928 0.551900 0.354790
246 N20 RF_maintenance 100.00% 87.61% 87.61% 0.00% 18.959080 18.305374 -0.523644 -0.589735 6.031629 7.565431 5.591771 0.048921 0.266201 0.261837 0.100348
261 N20 RF_ok 100.00% 87.61% 87.61% 0.00% 13.565414 13.328847 0.577820 -0.554202 1.474903 1.381062 0.687457 8.313205 0.541740 0.535186 0.353564
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 15.952798 17.452218 7.841702 8.501792 9.614492 10.188394 16.779908 27.208937 0.031952 0.027885 0.003716
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 10.139621 12.085084 3.959308 5.831387 3.254750 9.592242 15.482776 4.057770 0.390306 0.043817 0.304277
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.153663 2.367415 1.229619 1.288374 0.699923 0.981483 -1.297261 -2.098505 0.534336 0.553094 0.389420
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.617946 -0.695404 1.349158 -1.342180 0.700197 -0.476298 -1.495419 0.720733 0.561154 0.564903 0.396372
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.832889 -0.582020 -0.773819 -1.001036 0.680525 -0.482827 0.641985 -0.194231 0.493694 0.556676 0.397888
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.911521 2.652197 -1.154420 -1.475710 -0.562576 -0.124614 1.205546 -0.001178 0.496191 0.537571 0.382689
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 7, 8, 9, 10, 15, 16, 18, 19, 21, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 42, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 74, 77, 78, 79, 80, 81, 82, 84, 86, 87, 90, 92, 93, 94, 95, 96, 97, 100, 101, 102, 103, 104, 108, 109, 110, 111, 113, 114, 115, 117, 119, 120, 121, 122, 123, 126, 128, 131, 132, 133, 135, 136, 138, 140, 142, 143, 145, 146, 155, 156, 158, 159, 161, 165, 166, 167, 170, 179, 180, 181, 182, 183, 185, 187, 189, 191, 200, 201, 202, 203, 205, 206, 207, 208, 209, 210, 211, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320]

unflagged_ants: [4, 5, 17, 20, 22, 41, 43, 44, 45, 46, 48, 49, 61, 62, 64, 65, 66, 67, 69, 70, 73, 83, 85, 88, 89, 91, 98, 99, 105, 106, 107, 112, 116, 118, 124, 125, 127, 129, 130, 137, 139, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 164, 168, 169, 184, 186, 190, 324, 325, 329, 333]

golden_ants: [5, 17, 20, 41, 44, 45, 65, 66, 67, 69, 70, 83, 85, 88, 91, 98, 99, 105, 106, 107, 112, 116, 118, 124, 127, 129, 130, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 164, 168, 169, 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_2459935.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.dev11+g87299d5
3.1.5.dev197+g9b7c3f4
In [ ]: