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 = "2460025"
data_path = "/mnt/sn1/2460025"
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: 3-21-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/2460025/zen.2460025.21284.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/2460025/zen.2460025.?????.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/2460025/zen.2460025.?????.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 2460025
Date 3-21-2023
LST Range 6.466 -- 16.428 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 40, 42, 70, 72, 112
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 70 / 198 (35.4%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 136 / 198 (68.7%)
Redcal Done? ❌
Never Flagged Antennas 61 / 198 (30.8%)
A Priori Good Antennas Flagged 66 / 93 total a priori good antennas:
3, 5, 7, 15, 16, 17, 29, 31, 37, 38, 40, 42,
45, 53, 54, 55, 65, 66, 67, 70, 71, 72, 81,
83, 86, 93, 94, 101, 103, 109, 111, 112, 118,
121, 122, 123, 124, 127, 128, 136, 140, 145,
147, 148, 149, 150, 151, 158, 161, 164, 165,
167, 168, 169, 170, 173, 181, 182, 184, 187,
189, 190, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 34 / 105 total a priori bad antennas:
8, 22, 43, 46, 48, 49, 50, 57, 62, 73, 74,
89, 90, 95, 115, 125, 132, 133, 139, 185, 220,
221, 228, 229, 237, 238, 241, 245, 261, 320,
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_2460025.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% 0.00% 100.00% 0.00% 0.700325 13.639772 0.322370 11.341105 0.703004 5.062694 -0.442169 2.108857 0.538498 0.037278 0.474135
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.392204 21.778628 -0.802568 -0.414024 -0.763705 0.961932 -0.989450 0.431132 0.551097 0.434608 0.356112
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.635687 13.475278 10.671229 11.088782 5.002975 5.143645 0.901716 0.977752 0.035078 0.030437 0.001511
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.029145 0.206295 -0.633293 0.191606 -0.046594 0.713926 7.141571 18.613376 0.564043 0.573983 0.354715
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.437246 3.499645 2.490504 2.419167 2.544468 2.580110 -1.928698 -1.726506 0.542805 0.550317 0.338306
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.586821 -0.521613 3.485007 -0.472221 1.015812 0.094256 3.094373 -0.449680 0.541631 0.567980 0.352908
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.262878 -1.237721 -0.379732 -0.750442 -0.912527 -0.026447 -1.261533 0.415197 0.556584 0.560673 0.348624
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 24.945455 -0.121636 0.645671 -0.169033 2.617654 0.516338 0.525153 3.597279 0.425114 0.565963 0.361112
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.244338 14.054935 -0.278107 11.341529 0.621804 5.050761 4.333329 3.349215 0.567192 0.036086 0.487306
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.403828 5.640602 1.074885 9.757086 0.970897 1.303244 0.107014 5.312044 0.568958 0.392653 0.412367
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.834395 5.409882 10.690323 1.366307 4.968377 1.679195 1.137954 54.059807 0.034661 0.360857 0.289729
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.277154 0.082598 -0.388806 0.610675 0.189219 -0.639023 -0.330604 -0.379174 0.577507 0.587353 0.351821
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.923981 -1.292330 2.247449 -0.473419 1.104661 0.172947 2.831225 -0.033068 0.564844 0.586054 0.348634
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.232123 -0.160197 -0.056110 0.449015 0.636530 1.520903 0.658346 0.617663 0.562175 0.571967 0.346356
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.984124 -0.756057 -0.292777 -0.690649 -0.223816 1.435855 -0.714809 -0.711559 0.533254 0.544207 0.344686
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.482362 12.739644 10.743915 11.168934 4.959327 5.124323 3.091660 2.659820 0.028344 0.029472 0.000927
28 N01 RF_maintenance 100.00% 100.00% 11.72% 0.00% 10.056786 18.022364 10.593009 4.206951 4.995307 0.540167 2.221547 16.563882 0.028740 0.254909 0.193577
29 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -1.095023 -0.693442 -0.562346 -0.446471 0.365578 0.201669 5.065759 1.433104 0.584972 0.591631 0.355638
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.516265 -0.901223 2.042753 -0.856357 1.986406 0.360035 1.548643 -0.317473 0.567153 0.597724 0.356798
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.817512 -0.191838 1.381794 2.144064 1.795124 0.097277 0.633686 6.120083 0.589336 0.591864 0.345957
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 19.801147 21.081383 -0.269400 -0.184684 -0.038704 -0.209278 1.655213 4.622357 0.472867 0.501528 0.205899
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.636141 14.272478 5.685636 5.997047 4.907724 5.068288 1.350939 3.153778 0.033134 0.047005 0.009034
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.444689 -0.800052 0.232967 -1.156108 -0.314559 -0.588777 4.404365 -0.201846 0.542570 0.542992 0.341948
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.011486 7.167339 1.298790 1.087831 1.758013 2.081499 0.133460 1.243767 0.539327 0.541100 0.367909
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.952956 22.437676 -0.387862 13.192041 -0.716033 5.117211 -1.098580 3.842078 0.535487 0.030453 0.431011
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.362772 2.599706 -0.184608 0.211090 0.552233 -0.328579 5.867988 16.427533 0.564304 0.543152 0.363874
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 1.188441 1.381775 0.078273 -0.405015 1.173296 0.415272 16.535793 2.297429 0.230238 0.218755 -0.277074
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.747215 1.150420 1.556585 2.276162 2.371146 0.142058 0.662918 1.033868 0.579657 0.586464 0.354584
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.678745 2.442158 -0.296651 -0.741085 1.045327 0.683570 0.167993 0.248016 0.249821 0.237420 -0.275046
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.660372 0.236113 -0.539325 1.042929 -0.830788 1.068998 -1.306624 0.940440 0.591833 0.599786 0.346665
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.820967 0.617168 -1.006544 0.658443 -0.335690 0.676164 -0.583877 0.082540 0.593483 0.608623 0.349697
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.331290 3.321582 0.960732 0.962887 0.394387 1.918612 0.584428 7.386712 0.581390 0.591754 0.341867
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.572220 -0.437474 0.056649 -1.056816 0.257396 -0.403717 0.057702 -0.283060 0.582072 0.603286 0.358192
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.891282 13.940350 5.595465 5.650342 4.920005 5.029842 3.339383 1.036125 0.031715 0.049947 0.012116
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.370465 0.791573 -0.523552 0.965936 -0.920709 1.007005 -1.208597 -2.122026 0.545273 0.561852 0.346708
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.630361 0.095854 -0.040511 -0.313472 -0.749714 -0.960793 -0.017796 3.495577 0.512246 0.540613 0.345958
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.729181 0.761818 0.537150 1.974124 0.510751 1.974233 0.001446 0.164859 0.538134 0.539365 0.364686
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.479275 1.768234 0.060928 -0.229666 1.828676 0.952553 111.840413 0.476920 0.550994 0.556942 0.364261
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.591441 5.087810 0.726603 0.490815 1.727885 1.552126 4.653946 0.834753 0.565929 0.569498 0.363064
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.419784 1.357420 0.050741 -0.455703 1.691194 -0.021291 13.286958 5.261665 0.573225 0.584617 0.364678
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 10.557001 3.467172 1.844072 -0.070255 2.421952 1.464157 -1.219070 0.154298 0.285841 0.348363 0.149141
55 N04 digital_ok 100.00% 15.72% 100.00% 0.00% 0.498142 49.785921 0.631304 7.529792 0.097063 5.410689 3.547164 1.371111 0.247134 0.037962 0.098751
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.770625 0.938556 -0.884895 2.683231 -0.687237 2.803316 -0.960699 0.670195 0.592369 0.595928 0.341922
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.721963 2.398584 -0.508703 -0.312076 -0.423573 0.605834 0.310589 1.347192 0.599000 0.599655 0.340621
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.460441 13.051178 10.632518 11.263232 4.885222 5.045263 2.052006 1.850217 0.034609 0.034288 0.002164
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.574228 1.090909 10.670493 1.384266 4.804580 2.124800 1.418109 16.400192 0.043042 0.597930 0.455154
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.367084 12.978697 0.139813 11.296075 0.546319 5.042871 1.026117 3.196870 0.582598 0.069698 0.466060
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 1.740686 0.568234 0.823578 0.888207 0.786365 0.045346 0.012089 6.591834 0.526182 0.545665 0.331880
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.459784 0.912482 0.033431 0.699609 -0.560758 -0.414170 0.910205 -1.595942 0.522010 0.562617 0.347376
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.383313 13.448801 -0.730568 6.044516 -0.730838 5.132507 -0.704640 3.435548 0.548008 0.042999 0.430703
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.531851 -0.300094 -1.093099 -0.093538 -0.878510 -0.913668 5.770873 1.296121 0.533303 0.527837 0.339056
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 23.254292 22.232966 13.539857 13.605962 5.040788 5.196007 5.583957 7.267854 0.023568 0.029165 0.006304
66 N03 digital_ok 100.00% 44.89% 100.00% 0.00% 2.804917 22.991794 2.035426 13.771855 1.686112 5.103534 -2.269447 7.466484 0.202389 0.042996 0.100563
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.378197 -0.369024 -0.253708 1.784057 0.096439 1.469488 7.718826 2.653820 0.568496 0.570157 0.361008
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 24.889674 0.808926 13.629334 0.706013 4.895640 -0.694576 6.441849 -0.687120 0.031884 0.582530 0.444201
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.710398 2.025218 1.556909 -0.623389 0.501025 0.967360 3.538287 1.693426 0.584191 0.595969 0.352180
70 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.397020 2.019301 1.397991 3.223020 2.353566 1.605937 5.272056 0.932138 0.253252 0.235950 -0.273517
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.826140 -0.099994 -0.334500 0.501437 0.449061 0.042524 -0.443217 1.376940 0.597158 0.612227 0.345773
72 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.245235 1.599816 2.860361 1.343755 1.231273 0.758978 12.242388 1.492393 0.261702 0.253070 -0.274179
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.640768 1.394928 -0.744445 0.638139 0.902862 3.339914 -0.000211 0.790066 0.603870 0.615470 0.347670
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.968661 0.129618 -0.344585 -0.031955 -0.685089 1.336126 -0.865600 2.530770 0.599710 0.612582 0.349576
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 48.955580 17.439700 0.654279 -0.520298 2.812411 0.477923 -0.106950 -0.340231 0.310961 0.472031 0.272353
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 25.023656 0.690882 -0.178437 0.830400 1.072100 0.115497 -0.205964 0.272178 0.393676 0.567905 0.339611
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.512973 13.727011 -0.640391 6.028627 -0.519350 4.997162 0.403672 0.308089 0.536790 0.038298 0.433310
80 N11 not_connected 100.00% 0.00% 72.29% 0.00% -0.194111 13.378652 -0.060189 5.718847 -0.723450 2.143425 -1.251957 1.850942 0.539287 0.128969 0.420860
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 45.796494 56.666370 27.859021 29.239712 12.680355 12.504513 713.125047 565.416978 0.017041 0.016200 0.001058
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 34.698763 46.675189 27.419898 25.649361 10.683919 12.763980 609.886311 512.910554 0.017831 0.017125 0.001129
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 43.267497 38.980905 28.334712 20.879632 13.165887 7.006566 649.194134 335.793330 0.016178 0.016813 0.000848
84 N08 RF_maintenance 100.00% 74.39% 100.00% 0.00% 17.634574 24.293433 13.144708 13.909152 3.440698 5.039666 4.809690 5.783240 0.191030 0.033286 0.128252
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.946980 -0.050778 -0.039046 -0.846622 -0.491906 -0.232822 -1.628213 0.026122 0.592518 0.587817 0.346231
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.205061 1.072266 0.693338 0.253907 1.171649 0.969927 0.232493 15.890443 0.591268 0.603650 0.341233
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.622805 5.846441 1.379844 0.241409 7.760236 1.364803 35.962915 3.597856 0.507688 0.619243 0.331122
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.363553 0.669013 0.891198 1.584306 0.559825 -0.239026 -0.076168 0.139952 0.596748 0.606363 0.334948
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.467834 0.471428 0.876662 1.360956 0.231315 0.815016 -0.333425 0.075410 0.593323 0.611868 0.341700
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.025450 -0.645531 -0.310862 -0.639630 -0.497203 -1.108916 0.216537 1.355238 0.582644 0.615248 0.347494
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.130155 0.294514 1.076056 0.853566 0.383740 0.709116 -0.147438 0.000211 0.578335 0.605732 0.352266
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.016796 0.113811 10.645140 0.644504 4.987911 1.486976 0.653123 1.374082 0.033714 0.600226 0.400718
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.295580 13.266012 10.742543 11.351760 4.856734 5.016446 3.057082 2.543450 0.029214 0.024958 0.002334
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.066814 13.533189 10.852492 11.174756 4.907516 5.060171 1.261405 1.270229 0.025489 0.025238 0.001083
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.546739 1.280358 -0.837538 0.422168 2.072043 1.040011 -0.936739 -0.598903 0.411899 0.412188 0.182711
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.525375 23.255013 0.890463 -0.382919 -0.085297 0.444241 -1.925615 0.088954 0.547953 0.449852 0.336578
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.440220 2.176695 -1.014563 0.172625 -1.002398 -1.061920 8.061896 13.575389 0.530831 0.523781 0.344301
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.427267 7.186181 0.265448 1.460661 0.884669 1.781786 0.129722 0.147352 0.572856 0.578564 0.352616
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.777471 0.701150 -0.815118 -0.819591 0.298782 0.283973 -1.004641 9.747763 0.590494 0.596909 0.348585
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.143463 4.073355 1.649580 -0.917272 0.637043 0.624641 -1.100075 18.788585 0.583738 0.605501 0.341129
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.756659 53.722665 0.789565 7.328868 2.085134 0.072069 1.933865 1.823169 0.597966 0.583426 0.336343
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.139839 0.642882 0.590991 1.448976 1.359385 0.576526 0.032046 0.084426 0.600657 0.610899 0.336178
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.650733 1.102798 1.271674 0.288992 0.365481 -0.103201 1.014779 -0.178548 0.594384 0.616238 0.340948
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.354726 -0.247583 -0.100847 -0.515879 0.583762 0.018300 1.279401 2.183732 0.595584 0.615553 0.342772
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.070008 37.632047 10.674787 1.428780 4.916816 2.083435 2.192368 2.917981 0.033171 0.297836 0.152521
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.811692 13.055810 10.724641 11.065037 4.969102 5.130769 0.838120 2.464226 0.056962 0.033873 0.016553
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 27.896992 0.188284 0.919518 0.058634 1.949542 0.167341 2.061651 -0.161761 0.473849 0.597189 0.335214
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 26.450748 13.006885 1.683204 11.148681 1.581189 5.109455 8.882335 2.852021 0.449451 0.056547 0.305856
112 N10 digital_ok 100.00% 0.92% 0.92% 99.08% -0.283612 6.988527 1.958818 9.951860 2.375726 2.305262 1.755607 1.170130 0.225454 0.134521 -0.224467
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.851927 14.305389 5.329603 6.019378 4.822168 4.981234 1.998064 1.382647 0.033145 0.031222 0.001266
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 12.645091 0.845214 5.482702 -0.283054 4.802612 -0.769678 0.582703 -0.772492 0.042104 0.545387 0.421801
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.948455 -0.681209 -1.105262 -0.161427 -0.888559 -1.156990 -0.440482 -0.391152 0.511581 0.532537 0.351014
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 30.278703 34.772910 23.768878 22.019088 8.073494 8.811244 392.765049 414.475600 0.017414 0.016617 0.000998
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 25.158826 40.626645 22.373155 28.955007 8.812888 15.646050 483.384677 922.623184 0.020952 0.018858 0.001945
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.472349 1.099036 3.061106 -0.591389 0.805800 0.620580 6.849210 4.544892 0.569664 0.591349 0.347493
121 N08 digital_ok 100.00% 0.05% 0.00% 0.00% 1.714061 2.850470 -0.979838 6.234532 -0.010674 0.494231 31.064795 25.907607 0.593865 0.580011 0.336366
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.087006 5.137825 -0.406065 -0.859970 0.360666 0.510843 -0.347131 -0.638132 0.606934 0.614453 0.341226
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.077569 7.511137 1.232459 1.509232 1.201350 0.954188 -0.126761 1.004756 0.607542 0.617473 0.341648
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 10.143752 0.429807 10.901084 1.041630 4.818860 1.442127 0.908626 0.847269 0.039166 0.620680 0.423065
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.186989 -0.466221 1.568244 1.516648 0.278821 -0.021390 0.636066 0.348883 0.599245 0.609481 0.343903
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.988599 0.359309 0.564099 1.332564 1.446262 1.259788 2.882819 0.088462 0.529693 0.611488 0.348103
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 9.825281 0.521737 10.641917 3.595040 4.982126 2.616988 0.622565 5.943755 0.030702 0.591643 0.384739
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.264179 -0.806989 -0.600884 -0.344230 -0.030077 -0.103985 2.225811 5.067168 0.584928 0.596190 0.363245
131 N11 not_connected 100.00% 0.00% 59.86% 0.00% -1.042401 12.914409 -0.321384 5.946081 -0.562121 4.178243 -1.225651 0.829150 0.546278 0.213679 0.396833
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.941601 -0.012362 -0.415624 -0.823362 -0.847022 -0.383215 -0.722975 -0.190757 0.536197 0.537622 0.346700
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.369261 -1.159120 -0.848283 -0.694143 -0.358867 -1.281146 -0.134869 1.189274 0.521063 0.538896 0.355092
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.487775 14.381496 5.463191 5.993600 4.825395 5.009433 0.741650 1.331877 0.038374 0.033849 0.002764
135 N12 RF_maintenance 100.00% 99.89% 99.89% 0.00% 170.755873 171.399380 inf inf 2074.901722 2064.644041 8100.727972 7987.774264 0.796369 0.756342 0.632512
136 N12 digital_ok 100.00% 99.89% 99.89% 0.00% 150.506796 151.127114 inf inf 1922.201260 1916.238328 8200.126260 8104.504061 0.561569 0.592106 0.358812
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 29.329864 52.769534 24.434838 24.504905 11.454479 7.070274 650.316985 474.791188 0.016420 0.016377 0.000748
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.207058 0.031372 0.852879 -1.119299 0.481705 -1.033574 -1.809577 0.044147 0.560448 0.564396 0.338296
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.897227 -1.199898 -0.111803 -0.621358 2.358643 -0.861460 36.998815 6.553810 0.580277 0.600005 0.343302
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.613972 -0.629849 0.169408 0.165797 1.052926 -0.604019 -0.145293 -1.492619 0.592706 0.604705 0.339456
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.261635 13.051860 -0.312234 11.305148 1.466525 5.082298 23.251892 2.510751 0.598837 0.043583 0.494035
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.867492 12.978686 10.517451 11.267617 4.428801 5.085770 0.631553 2.167023 0.100156 0.028985 0.057862
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.436318 1.077725 -0.509870 3.503333 0.879975 1.134109 -0.602380 0.356702 0.606513 0.605720 0.343824
145 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.035594 1.293001 0.083072 0.475561 0.246803 5.110373 0.244043 1.153146 0.603013 0.606745 0.345180
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.385680 -0.796201 -1.123446 -0.977149 -0.616638 -1.278661 -0.362174 0.213291 0.568858 0.590509 0.346209
147 N15 digital_ok 100.00% 99.51% 99.46% 0.00% nan nan inf inf nan nan nan nan 0.422833 0.438094 0.400366
148 N15 digital_ok 100.00% 99.62% 99.62% 0.00% nan nan inf inf nan nan nan nan 0.322716 0.395405 0.229447
149 N15 digital_ok 100.00% 99.57% 99.57% 0.00% 214.156440 214.333619 inf inf 2243.746441 2227.994821 9005.285344 8864.665376 0.307400 0.363530 0.332263
150 N15 digital_ok 100.00% 99.57% 99.68% 0.00% 220.916989 221.012996 inf inf 2587.191676 2588.727911 8727.717067 8933.997411 0.417820 0.293158 0.318114
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 18.536904 -0.450461 -0.502417 1.240170 0.888083 -0.019351 0.317794 13.985297 0.418828 0.516404 0.311795
155 N12 RF_maintenance 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.430346 0.464066 0.222421
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.190049 12.928091 8.470034 11.106815 0.866533 5.149795 4.244751 2.857829 0.393682 0.036604 0.306729
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.727698 -0.014418 0.675114 1.156228 0.531941 1.447781 -0.111281 0.190666 0.536758 0.551910 0.357183
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.343151 -0.024571 -1.124603 -1.119203 0.867305 0.510664 7.016709 23.004360 0.557623 0.565445 0.351860
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.586902 22.862977 -0.329426 -0.223016 -0.191605 0.710511 -0.100952 1.270008 0.532299 0.431387 0.308718
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.167997 -0.834637 0.170384 -0.258567 0.638415 1.189007 -0.327181 0.678786 0.578521 0.590877 0.346595
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.165575 28.313585 0.578752 0.318135 1.109582 -0.239071 -0.156814 0.419415 0.587764 0.482869 0.316463
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.009067 -1.387848 -0.102172 -1.008909 -0.221584 0.382966 2.084419 -0.590299 0.598690 0.611370 0.347998
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.684398 1.488070 0.451151 0.862646 0.765780 1.524677 0.102106 1.511691 0.602894 0.613898 0.349777
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.273515 1.168787 1.466155 1.556837 5.262000 2.647746 1.770938 2.164213 0.594065 0.606697 0.339116
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 23.808190 0.094479 0.406235 -0.238610 1.228886 0.539024 2.323968 -0.076736 0.472484 0.609730 0.338063
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.547959 -0.223221 1.213334 0.326335 0.827362 -0.943285 0.302032 -1.580168 0.588945 0.602162 0.341520
167 N15 digital_ok 100.00% 99.73% 99.84% 0.00% nan nan inf inf nan nan nan nan 0.299050 0.247791 0.249041
168 N15 digital_ok 100.00% 99.73% 99.73% 0.00% 214.818293 214.703977 inf inf 2018.737553 2021.427839 7426.409454 7327.370149 0.379829 0.469760 0.369164
169 N15 digital_ok 100.00% 99.73% 99.73% 0.00% 222.344596 222.211551 inf inf 2585.610641 2583.316401 11262.445625 11237.109596 0.341282 0.417355 0.258503
170 N15 digital_ok 100.00% 99.62% 99.46% 0.00% nan nan inf inf nan nan nan nan 0.328394 0.400397 0.278076
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.314276 -1.099125 0.526584 -0.571922 -0.782835 -0.888075 -0.126033 -0.867930 0.499629 0.540933 0.356947
173 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.389699 5.301756 3.260370 3.225041 4.045440 4.089830 -3.676307 -1.980130 0.497699 0.494774 0.341166
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.474989 -0.874461 0.291667 -0.563563 0.265056 0.223930 -0.133608 7.583735 0.557203 0.572718 0.356362
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.097144 13.717403 -0.872099 11.416520 0.768669 5.018215 23.712213 2.996438 0.574702 0.050039 0.479209
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.520461 0.771368 1.618893 1.108576 0.618129 0.654472 -0.005214 5.182906 0.581300 0.592252 0.352453
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.115234 12.822749 -1.101311 11.051225 -0.356272 5.145208 12.574978 3.029267 0.595039 0.044665 0.454043
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.232206 0.638261 0.087724 0.685014 1.297145 0.882849 0.208443 0.334731 0.588945 0.598857 0.339484
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 19.655629 -0.417456 7.656804 -0.474947 4.794534 -0.108277 1.990204 -0.167883 0.392546 0.607616 0.366185
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.229718 -0.190291 -1.105392 0.106722 -0.071671 0.149434 -0.232658 0.935324 0.598978 0.605145 0.347893
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.983006 -1.027295 0.075930 -0.602301 -0.567920 -0.672818 -0.881886 -0.694635 0.593926 0.603781 0.348939
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.143958 -0.685501 -0.712096 -0.188702 0.674400 0.208109 5.529444 -0.314014 0.583033 0.592622 0.351433
189 N15 digital_ok 100.00% 99.51% 99.57% 0.00% nan nan inf inf nan nan nan nan 0.509147 0.355203 0.406296
190 N15 digital_ok 100.00% 99.57% 99.62% 0.00% nan nan inf inf nan nan nan nan 0.514923 0.508074 0.429461
191 N15 digital_ok 100.00% 99.57% 99.57% 0.00% 197.727413 197.528135 inf inf 2048.091874 2035.817992 7971.515050 7835.059666 0.511595 0.566639 0.315792
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 2.201618 5.583899 1.884829 3.349759 1.320388 4.046067 -1.410626 -3.503268 0.526509 0.504220 0.348072
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.872589 4.709256 3.490780 3.046177 3.959686 3.733846 -3.727003 -3.381213 0.493709 0.501759 0.344792
200 N18 RF_maintenance 100.00% 100.00% 42.30% 0.00% 11.637257 34.866463 5.505996 0.120616 4.985587 1.519519 2.262098 3.041084 0.039915 0.219400 0.144806
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.657127 4.173262 2.082824 2.879858 1.731868 3.318381 -1.578656 -3.171280 0.557969 0.554287 0.341635
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.548454 0.511544 0.915033 -0.477730 0.573715 0.715129 -1.681931 58.606798 0.574953 0.570769 0.339575
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.594128 12.368886 1.801275 -0.716302 0.641578 0.253964 20.700302 1.819709 0.584510 0.598181 0.349006
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.662769 -0.976623 3.565865 -1.110407 2.446479 -0.296234 4.306870 5.536980 0.407664 0.581207 0.396791
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.309925 4.397943 0.726370 3.270827 0.010615 0.198223 -0.112275 0.826636 0.527272 0.476438 0.331283
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.002941 1.104792 -0.934537 -0.165395 -0.825860 0.156966 8.220719 0.328616 0.556227 0.553228 0.341202
208 N20 dish_maintenance 100.00% 99.78% 99.84% 0.00% nan nan inf inf nan nan nan nan 0.553867 0.515550 0.251413
209 N20 dish_maintenance 100.00% 99.84% 99.78% 0.00% nan nan inf inf nan nan nan nan 0.339016 0.537184 0.350624
210 N20 dish_maintenance 100.00% 99.89% 99.84% 0.00% nan nan inf inf nan nan nan nan 0.410324 0.504081 0.176155
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.060374 13.504665 -0.875884 6.052053 -0.504718 5.013218 0.405596 1.750543 0.518510 0.037476 0.438901
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.108162 -1.062101 0.031955 -0.755304 -0.754983 -0.625154 1.636208 -0.895893 0.563843 0.565263 0.345058
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.845517 -0.434064 -1.119654 -0.939333 0.070854 -1.166069 2.845805 -0.625600 0.557529 0.571783 0.345069
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.532064 -0.389108 -0.395074 -0.204892 -0.490319 -1.143732 4.474547 -1.146904 0.562448 0.577705 0.346319
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.304411 -1.313680 -0.553325 -1.083835 -0.762948 -1.060456 0.368274 18.634309 0.553886 0.572017 0.345299
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.269730 5.165693 3.708742 3.293898 4.220106 3.927473 -3.622414 -3.096251 0.518132 0.542775 0.338830
225 N19 RF_ok 100.00% 0.00% 89.84% 0.00% -0.348118 12.918935 0.373394 5.818300 -0.697324 4.843677 -1.465342 2.235302 0.562439 0.140494 0.457494
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.135687 18.079971 -0.794718 -0.026118 -0.970902 1.517419 -0.933265 -0.542648 0.551199 0.460300 0.332881
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 2.430449 -0.381742 2.561704 -0.697791 -0.498702 -0.836059 16.308757 1.991018 0.459268 0.542991 0.370841
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.260521 -0.165945 0.422947 -0.875839 -0.255958 -0.591175 1.454534 1.106704 0.534404 0.529461 0.342551
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.358335 0.618876 0.373599 0.831142 -0.232890 0.007470 -1.432419 -2.061452 0.529556 0.534754 0.358007
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.141962 -0.670237 0.609275 -0.964542 -0.129514 -0.167259 1.444907 -0.668829 0.506785 0.545161 0.356132
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.083549 -0.396273 0.447996 0.225116 -0.525502 -0.745405 -1.657774 -1.685398 0.555541 0.561115 0.354205
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.944797 -0.688982 -0.536837 -0.241583 -0.201971 -1.108954 0.461335 4.349339 0.554401 0.562387 0.351260
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.555170 -0.035457 0.521482 -1.079514 -0.516998 -0.963639 7.126053 3.478865 0.525215 0.561343 0.358494
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.329408 -0.944749 -0.554095 -0.212217 -1.033416 -0.910595 0.792361 -1.176353 0.554540 0.563619 0.359374
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 17.091583 0.981529 -0.128023 1.009105 1.054005 0.567927 -0.773772 -0.848068 0.420435 0.554287 0.349487
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 15.571044 -1.119397 0.605523 -0.883554 1.314577 -0.201500 7.399576 0.060324 0.437730 0.544976 0.350481
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.086560 -0.599994 -0.129311 -0.697427 -0.432395 -0.171790 3.577124 6.541892 0.514050 0.542967 0.350156
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.306377 0.195409 0.217029 -1.127782 -0.541609 -1.107910 -1.814961 1.256051 0.539831 0.537749 0.351699
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.579525 14.079886 -0.940319 5.597775 -0.319952 5.094412 -0.591411 0.701787 0.520210 0.036669 0.439970
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.307136 -0.238062 -0.091773 -0.491438 -0.613385 -1.088886 2.577571 -0.057082 0.526307 0.528719 0.349416
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 10.857567 13.396596 0.439757 0.595742 1.140641 0.503688 0.005940 2.400100 0.537557 0.538399 0.368119
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.166675 0.874862 1.769926 0.775822 1.128363 -0.067563 -2.459552 0.340387 0.442668 0.450447 0.341074
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.878969 2.527988 0.731366 0.958172 0.212219 0.567217 -1.829393 -2.061947 0.430745 0.434377 0.327233
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.026039 -0.920586 0.607984 -0.842926 -0.007470 -1.018308 -1.953205 0.437089 0.460696 0.455505 0.344117
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.180742 0.012362 -0.631303 -0.744805 -0.432955 -0.851291 -0.195187 -0.837592 0.428272 0.439620 0.329168
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.360614 3.223382 -0.148782 -0.673867 -0.757510 -0.654898 2.166145 0.469795 0.410740 0.415925 0.310856
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 5, 7, 15, 16, 17, 18, 27, 28, 29, 31, 32, 34, 35, 36, 37, 38, 40, 42, 45, 47, 51, 52, 53, 54, 55, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 70, 71, 72, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 101, 102, 103, 104, 108, 109, 110, 111, 112, 113, 114, 117, 118, 120, 121, 122, 123, 124, 126, 127, 128, 131, 134, 135, 136, 137, 140, 142, 143, 145, 147, 148, 149, 150, 151, 155, 156, 158, 159, 161, 164, 165, 167, 168, 169, 170, 173, 179, 180, 181, 182, 184, 187, 189, 190, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 222, 223, 224, 225, 226, 227, 239, 240, 242, 243, 244, 246, 262]

unflagged_ants: [8, 9, 10, 19, 20, 21, 22, 30, 41, 43, 44, 46, 48, 49, 50, 56, 57, 62, 69, 73, 74, 85, 88, 89, 90, 91, 95, 105, 106, 107, 115, 125, 132, 133, 139, 141, 144, 146, 157, 160, 162, 163, 166, 171, 183, 185, 186, 220, 221, 228, 229, 237, 238, 241, 245, 261, 320, 324, 325, 329, 333]

golden_ants: [9, 10, 19, 20, 21, 30, 41, 44, 56, 69, 85, 88, 91, 105, 106, 107, 141, 144, 146, 157, 160, 162, 163, 166, 171, 183, 186]
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_2460025.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.3.dev133+g7c00d5f
In [ ]: