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 = "2460018"
data_path = "/mnt/sn1/2460018"
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-14-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/2460018/zen.2460018.21276.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/2460018/zen.2460018.?????.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/2460018/zen.2460018.?????.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 2460018
Date 3-14-2023
LST Range 6.004 -- 15.966 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 69 / 198 (34.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 121 / 198 (61.1%)
Redcal Done? ❌
Never Flagged Antennas 77 / 198 (38.9%)
A Priori Good Antennas Flagged 59 / 93 total a priori good antennas:
3, 5, 7, 9, 15, 16, 17, 37, 40, 42, 45, 54,
55, 56, 65, 70, 71, 72, 81, 83, 86, 88, 93,
94, 101, 103, 107, 109, 111, 112, 118, 121,
122, 123, 124, 127, 136, 144, 147, 148, 149,
150, 151, 158, 161, 165, 167, 168, 169, 170,
173, 182, 184, 189, 190, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 43 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 57, 61, 62, 64,
73, 74, 89, 95, 97, 102, 115, 125, 132, 133,
135, 139, 179, 185, 207, 220, 221, 222, 223,
228, 229, 237, 238, 239, 240, 241, 244, 245,
320, 324, 325, 329
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2460018.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.655014 15.495830 0.434008 12.119271 0.780509 7.643046 1.079118 3.442981 0.585986 0.041668 0.517837
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.381996 26.612884 -0.496655 -0.182853 -0.876782 2.535241 -0.898290 0.935381 0.594286 0.480925 0.326443
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 12.245351 15.273478 11.218258 11.822725 6.989449 7.704058 2.988845 3.290027 0.036601 0.031687 0.001313
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.055802 0.304320 -0.615203 0.364954 -0.042984 0.649346 1.378937 4.391672 0.608650 0.616458 0.323277
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.128109 -1.162617 0.141899 0.716566 0.235369 0.741231 1.364488 2.117307 0.609315 0.614593 0.317787
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.482206 -0.212069 3.799693 -0.459409 1.565931 -0.124788 6.942162 -0.024825 0.593684 0.610868 0.321222
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.793609 -0.607242 0.303586 -0.672167 -0.650049 -0.043473 -0.666809 0.006842 0.602612 0.608002 0.324902
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 29.154870 0.132404 -0.040719 -0.141757 2.696214 0.696268 0.451382 0.809441 0.482268 0.611339 0.328381
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.346376 15.917474 -0.240700 12.121490 0.695198 7.624935 0.682594 3.742587 0.614468 0.039133 0.526770
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.739362 6.948780 1.155526 10.630806 0.924087 4.881064 1.554391 8.973717 0.615784 0.438238 0.388551
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 12.459139 9.318617 11.251040 1.243691 6.963126 4.155805 2.967501 9.888443 0.036202 0.432222 0.355020
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.179876 -0.337182 -0.462694 0.408164 -0.032773 0.224831 -0.284325 -0.201876 0.623493 0.627762 0.324525
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.421782 -0.959622 2.473680 -0.454984 1.588500 0.733989 3.339357 -0.464404 0.613866 0.627650 0.317337
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.165446 0.329789 0.036731 0.737992 0.538978 0.572577 0.460586 1.107302 0.608557 0.608686 0.312236
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.577228 -0.101521 0.206398 -0.043789 0.785634 1.084786 -0.391641 -0.649852 0.581183 0.589455 0.317059
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.985155 14.495966 11.309653 11.918341 6.960507 7.696163 3.377877 3.568544 0.029916 0.030181 0.000570
28 N01 RF_maintenance 100.00% 100.00% 11.67% 0.00% 11.637515 20.886549 11.137536 4.725780 6.980734 4.219876 3.215073 8.158865 0.029644 0.312410 0.244038
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.981111 -0.486485 -0.676815 -0.393800 0.031115 0.993541 0.110099 0.049888 0.629575 0.633560 0.322612
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.512792 -0.980342 0.620485 -0.813428 0.935135 0.252538 0.948644 -0.981933 0.623153 0.636906 0.320373
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.928191 -0.754609 1.685414 1.782838 1.438541 -0.101296 2.432886 3.736106 0.633625 0.635410 0.313708
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 21.452166 24.514426 -0.303877 0.117014 0.529228 0.071073 0.599653 1.284821 0.531202 0.549652 0.192982
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 13.464979 16.225755 5.767086 6.247917 6.922060 7.651778 3.057965 3.710022 0.034807 0.049849 0.009955
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.566052 -0.625794 0.427233 -1.100457 -0.364672 -1.031842 0.057602 -0.950776 0.587591 0.585397 0.313472
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.130001 8.852513 1.527302 1.425072 1.862315 1.839784 3.518598 3.595682 0.590134 0.592101 0.336414
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 1.918155 26.542612 -0.670053 14.832555 -0.458008 7.673141 -0.927640 3.963162 0.585379 0.031262 0.457764
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.516568 3.067734 -0.337391 0.095750 0.352645 -0.551044 0.152135 2.422316 0.611738 0.592978 0.333414
40 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.137452 1.386850 0.085987 -0.507740 0.306403 0.828404 0.624342 4.749820 0.621374 0.626648 0.323537
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.688918 1.449133 1.985992 1.615103 1.727086 -0.177136 2.316181 1.877395 0.626697 0.636672 0.320907
42 N04 digital_ok 100.00% 0.00% 0.00% 94.71% -0.542789 4.067641 -0.463451 3.331453 1.703335 2.124183 0.922718 4.046385 0.317440 0.312323 -0.253949
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.079687 -0.050749 -0.091125 1.326503 -0.887014 0.984959 -0.897408 1.507521 0.633006 0.641508 0.316340
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.106834 0.292851 -0.488498 0.175644 -0.920756 0.668664 -1.129945 0.080026 0.634661 0.648553 0.319461
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -0.102810 4.448417 0.920719 1.455112 0.015312 1.586848 0.852977 4.621252 0.625146 0.631712 0.309655
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.430139 -0.043316 -0.106744 -0.945722 0.248424 -0.277229 -0.225180 -1.459163 0.626423 0.641606 0.324710
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 12.408069 15.875587 5.669586 5.875095 6.928092 7.614089 3.509065 3.374828 0.031876 0.057045 0.016735
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.098378 1.154669 -0.280532 1.590399 -0.827912 1.861881 -0.981404 0.269211 0.591800 0.602432 0.318744
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.286064 0.392579 -0.089860 -0.024134 -0.311569 -0.119440 -0.195072 0.920817 0.560738 0.583825 0.315810
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.992021 1.699141 0.387108 2.344634 0.376774 1.435309 1.674196 4.918868 0.588436 0.592046 0.333719
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.577264 2.005202 -0.216157 -0.688962 1.296199 0.770761 15.870762 -0.295629 0.599115 0.605612 0.331097
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.978509 6.633214 0.878489 0.709050 1.277868 1.146615 1.453600 1.180498 0.614074 0.619307 0.328873
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.707514 2.091130 0.264593 -0.410253 2.504333 0.102635 2.761496 -0.718338 0.621760 0.630164 0.330287
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 14.339501 4.563191 2.537362 0.332906 4.077591 2.562655 1.517191 1.215274 0.337102 0.403809 0.153969
55 N04 digital_ok 100.00% 10.48% 100.00% 0.00% 1.062766 56.632945 1.110025 7.786080 0.858185 7.719939 0.967246 3.059678 0.315806 0.041611 0.138914
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.259948 0.447312 -0.588309 2.822263 -0.524594 5.232682 -1.012686 3.924202 0.634888 0.641624 0.311624
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.071745 3.531579 -0.214701 -0.284622 -0.108156 1.103917 -0.716772 -0.307221 0.640545 0.643337 0.311528
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.058577 14.903358 11.208783 12.039065 6.894070 7.634205 3.176046 3.426895 0.035995 0.036013 0.001853
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.996814 0.752699 10.752705 1.586291 6.791313 2.126687 2.908627 4.045183 0.050725 0.639362 0.475152
60 N05 RF_maintenance 100.00% 0.00% 87.57% 0.00% 0.525335 14.800557 0.149360 12.066710 0.420594 7.641693 0.299113 3.482202 0.627791 0.101294 0.470880
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.321500 -0.511933 0.483422 -0.630104 0.971773 -0.682982 -0.088391 -0.759177 0.576501 0.608545 0.314559
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.104222 0.933213 -0.194353 1.013642 -0.652267 0.259502 -0.332259 0.013542 0.572389 0.603723 0.317688
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.058021 15.378662 -0.319949 6.288833 -0.384585 7.706706 -0.678498 3.841814 0.594107 0.045442 0.448862
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.000202 0.050782 -0.987052 -0.085100 -0.702559 -0.611284 -0.270517 -0.254858 0.579471 0.574699 0.311736
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 25.348266 23.129207 14.334938 14.426112 7.015671 7.474266 3.951753 5.038083 0.022929 0.026480 0.003612
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.495517 1.800935 1.522254 1.495376 2.077977 0.778149 3.414168 2.908147 0.601547 0.610146 0.333868
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.198070 -0.461378 -1.090621 1.548489 -0.589377 1.429277 0.633346 2.669876 0.613983 0.620095 0.329373
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 27.385303 0.668125 14.470303 0.855580 6.892553 -0.152468 4.111377 0.254216 0.036039 0.628375 0.486905
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.411801 -0.244749 1.514963 -0.383963 0.089932 1.450746 1.909838 -0.333994 0.631659 0.643571 0.319567
70 N04 digital_ok 100.00% 0.00% 0.00% 94.00% -0.484415 2.025085 1.619256 3.876484 2.394322 1.447237 4.322529 4.422597 0.325951 0.316248 -0.250468
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 5.878137 -0.339352 -0.329907 0.489442 0.592221 0.644756 -0.398958 0.668635 0.640676 0.653794 0.313384
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.069887 1.691507 -0.396421 1.796101 0.443477 1.134624 -0.138082 6.961224 0.646258 0.653047 0.312310
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.664057 1.276629 -0.691305 -0.201749 0.739404 0.891451 -0.746903 -0.709445 0.645222 0.654802 0.317506
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.713752 0.171537 -0.054708 0.086070 -0.376955 1.185461 -0.839099 1.007204 0.639244 0.651834 0.322701
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 56.728942 22.044619 0.937769 -0.363179 3.952065 3.619302 2.435325 0.196519 0.363387 0.510721 0.249515
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 29.948240 0.860498 -0.094975 1.319343 1.888716 0.923171 0.545620 0.550668 0.444946 0.608611 0.314251
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.330503 15.652176 -0.713862 6.300229 -0.869802 7.596321 -0.706294 3.144637 0.582663 0.039991 0.448245
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.452867 16.574865 0.304379 6.203835 -0.258441 7.619822 -0.505786 3.429721 0.585050 0.054788 0.449331
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 39.454857 43.257267 26.948396 25.308747 14.915279 14.765719 136.164621 97.636542 0.025433 0.017063 0.006060
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 63.875445 48.955865 39.735016 24.186657 61.579826 15.745296 326.887951 93.614626 0.019572 0.023052 0.003423
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 35.600775 41.364629 26.999084 25.102390 12.659882 14.804876 128.383725 101.623081 0.026952 0.029043 0.005476
84 N08 RF_maintenance 100.00% 59.81% 100.00% 0.00% 20.483733 26.478411 14.039328 14.912149 5.538083 7.589644 2.314789 4.026595 0.247286 0.036482 0.154138
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.021695 -0.594748 -0.396486 -0.217043 0.167661 0.156008 -0.564713 -0.605039 0.635301 0.635517 0.314044
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.191125 1.480835 0.075131 0.408120 0.039569 0.886512 -0.354408 4.259531 0.638169 0.646885 0.308845
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.610676 7.963199 0.102300 0.423594 0.122615 0.895795 -0.161135 0.615898 0.647785 0.660143 0.309408
88 N09 digital_ok 100.00% 99.73% 99.68% 0.00% nan nan inf inf nan nan nan nan 0.423419 0.420015 0.295497
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.885209 0.739629 0.800972 1.587616 -0.249983 0.529596 0.424485 1.598379 0.635756 0.650016 0.308929
90 N09 RF_maintenance 100.00% 99.51% 99.51% 0.00% nan nan inf inf nan nan nan nan 0.490047 0.486056 0.330975
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.050753 0.373076 1.158445 1.033010 0.455125 0.302436 0.777402 0.858261 0.624044 0.645443 0.319017
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.612772 0.395531 11.198113 0.985207 6.983997 1.415425 2.883712 1.316535 0.035301 0.642289 0.407935
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.941005 15.075028 11.337605 12.142391 6.866955 7.606457 3.325006 3.553512 0.030581 0.025010 0.002937
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 12.686020 15.369622 11.449405 11.937574 6.900175 7.649080 3.170684 3.428080 0.025394 0.025378 0.001063
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.314073 1.579330 -0.762604 0.810735 2.598382 2.117359 -0.310321 0.378139 0.470924 0.472614 0.180491
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.725752 27.828344 1.310972 -0.207382 0.160938 1.386915 0.075138 -0.339404 0.592888 0.501302 0.310395
97 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.127042 2.870778 -0.857379 0.247174 -0.948280 0.124747 -0.963240 2.854924 0.575564 0.569743 0.317746
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.831487 8.935562 0.272633 1.823859 0.643043 1.647714 0.334342 2.298241 0.622320 0.629767 0.319788
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.346778 1.098172 -1.026053 -0.201165 0.462244 0.411430 -1.116893 0.997151 0.635043 0.641452 0.315082
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.866206 5.457856 4.026903 -0.406306 2.103077 1.935358 5.077994 4.637292 0.628359 0.648905 0.309413
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.697643 59.814703 -0.273979 7.794439 1.098238 1.183035 -0.490902 9.218463 0.646410 0.633157 0.309364
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.055154 0.451700 0.857680 1.648562 1.000059 0.313610 0.680915 1.724321 0.642331 0.650784 0.304105
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.523245 1.839309 -0.358221 0.210827 -0.749105 -0.185882 -0.551956 -0.162344 0.639926 0.651971 0.308121
107 N09 digital_ok 100.00% 99.68% 99.68% 0.00% nan nan inf inf nan nan nan nan 0.364042 0.431883 0.355882
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.646334 43.007526 11.250207 1.748639 6.932799 2.854735 3.177638 1.105695 0.034606 0.338134 0.173647
109 N10 digital_ok 100.00% 89.84% 100.00% 0.00% 11.219313 14.569407 10.754527 11.269170 6.926237 7.685745 2.830277 3.531695 0.083182 0.038083 0.032394
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.978371 0.171828 0.134015 0.179507 7.405950 0.801701 0.212457 0.192042 0.599254 0.640448 0.316100
111 N10 digital_ok 100.00% 0.00% 91.09% 0.00% 31.201133 14.811849 1.889410 11.914880 2.624853 7.684656 1.581109 3.507468 0.504331 0.081002 0.315018
112 N10 digital_ok 100.00% 10.37% 14.21% 76.23% -0.830131 8.575667 2.297748 10.803831 2.526277 5.539667 4.239579 4.258311 0.303433 0.205289 -0.195432
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.698333 16.284624 5.399025 6.294522 6.844316 7.579445 3.171997 3.296748 0.034006 0.031087 0.001802
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 14.594690 0.859719 5.570649 -0.174932 6.820110 -0.777469 2.806769 -0.904788 0.043620 0.588976 0.433794
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.012591 -0.784164 -1.043534 -0.026234 -0.801824 -0.676451 -0.910284 -0.539480 0.560939 0.577888 0.324847
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 28.339007 51.857508 23.720619 26.801290 11.530567 21.144604 96.430030 110.630198 0.017854 0.016414 0.001333
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 27.594903 65.075147 23.196618 34.277132 14.011834 29.759398 77.371104 172.654420 0.023751 0.019243 0.003546
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.682995 1.628015 3.313822 -0.416987 1.580933 1.311428 5.973884 0.964455 0.620109 0.638194 0.313939
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.999424 3.497241 -1.019942 6.879063 -0.005401 1.794929 0.954018 16.072083 0.638313 0.627055 0.305113
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.790323 6.843994 -0.625928 -0.727767 1.233716 0.546135 -0.800893 -1.095706 0.650120 0.654989 0.308854
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.411317 9.229338 1.435733 1.717503 1.113071 0.615792 1.222766 1.886561 0.651469 0.659458 0.309434
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 11.768110 0.356634 11.524038 1.323667 6.833629 1.031952 2.921529 1.582656 0.041036 0.659093 0.431086
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.150911 -0.353808 1.052650 1.599682 -0.305223 0.086492 0.718567 1.436798 0.639532 0.651154 0.314755
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 25.612750 8.178618 0.453122 2.469739 2.609456 1.064708 1.213415 2.602520 0.539593 0.644251 0.296910
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 11.243234 0.627939 11.191390 0.884485 6.960295 1.113319 2.873994 1.033877 0.034185 0.645409 0.407850
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.066408 -0.684929 -0.747228 -0.347639 -0.005649 -0.385345 -0.625770 0.326453 0.629395 0.636159 0.330984
131 N11 not_connected 100.00% 0.00% 33.17% 0.00% -0.864335 14.339909 -0.055317 6.130713 -0.495215 6.768809 -0.922437 1.414661 0.591848 0.301264 0.371137
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.628491 0.744158 -0.132737 -0.759950 -0.799687 -0.611808 -0.813950 -1.065000 0.581268 0.581520 0.320653
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.319497 -1.199673 -0.927867 -0.450035 -1.019948 -0.817123 -0.866040 -0.515931 0.567813 0.584363 0.328959
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.850735 16.297674 5.541909 6.259221 6.839687 7.603933 2.896643 3.325134 0.040145 0.034927 0.002945
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.490850 -1.147076 -0.659081 -0.992598 2.302961 0.377968 1.310632 0.076089 0.566888 0.586310 0.339048
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 10.731429 -0.020357 10.879067 -0.021234 6.956233 0.631622 3.134269 0.441351 0.040091 0.587373 0.414676
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 27.151400 73.164780 23.895299 30.263900 10.865328 18.037354 112.525796 106.084079 0.026677 0.022465 0.004214
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.364328 -0.047100 1.427393 -1.013691 0.627828 -1.084776 0.112503 -1.352915 0.606501 0.612742 0.313256
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.718963 -0.490447 -0.156114 -0.256126 0.005649 -1.038028 0.724697 -0.006842 0.631778 0.641448 0.311988
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.854593 -0.541623 0.359389 0.551375 1.400569 -0.429026 0.250522 -0.418379 0.638270 0.644034 0.309104
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.968896 14.912722 -0.059620 12.074809 1.803049 7.671528 3.799611 3.522593 0.642143 0.047942 0.509359
143 N14 RF_maintenance 100.00% 85.58% 100.00% 0.00% 12.348786 14.847050 11.127437 12.040087 6.393073 7.623270 2.574501 3.618157 0.128800 0.030141 0.077282
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.086925 0.899230 -0.504434 3.789407 0.593244 1.487425 -0.469818 5.132644 0.648082 0.646882 0.314042
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.423354 0.104497 -0.095697 -0.876819 -0.444850 -0.238365 -0.077017 -1.016502 0.644008 0.645839 0.312854
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.239062 -0.638943 -0.867051 -0.762454 -0.751887 -0.972596 -1.163357 -1.362940 0.613717 0.629950 0.314359
147 N15 digital_ok 100.00% 99.73% 99.78% 0.00% 193.464893 194.152890 inf inf 2694.354154 2674.731325 1175.157064 1182.906042 0.483516 0.345014 0.352575
148 N15 digital_ok 100.00% 99.68% 99.62% 0.00% 193.674536 196.200676 inf inf 2730.387331 2886.741744 2006.830268 2135.299477 0.404305 0.351644 0.245894
149 N15 digital_ok 100.00% 99.78% 99.84% 0.00% nan nan inf inf nan nan nan nan 0.238020 0.285359 0.145280
150 N15 digital_ok 100.00% 99.57% 99.57% 0.00% 213.217925 212.801032 inf inf 2972.666182 2941.208298 1485.626421 1449.402746 0.406241 0.389481 0.259931
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 22.927408 0.126037 -0.280200 1.504640 2.196292 -0.341924 -0.109191 4.267251 0.472780 0.561998 0.285188
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.161475 -0.866035 11.037437 -0.577962 6.975482 0.249736 3.287039 0.576780 0.041360 0.590813 0.427495
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.502822 14.656538 9.220467 11.845115 3.834737 7.688365 7.719581 3.615934 0.442268 0.037955 0.327121
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.520064 -0.076373 0.695016 1.420360 0.312530 1.461150 0.956205 2.047389 0.589309 0.606085 0.325715
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.150697 0.213114 -1.017688 -0.968271 1.065256 0.138315 0.034574 4.224382 0.605161 0.613224 0.321220
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.646199 27.209856 -0.703700 -0.163142 -0.388568 2.817977 -0.724797 0.850481 0.582354 0.494217 0.289697
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.080004 -0.948050 0.145054 0.024134 0.353500 1.387689 0.042816 0.289718 0.624487 0.633758 0.313642
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.357711 30.754474 0.689672 0.406163 1.055219 0.793463 0.710387 0.355003 0.632676 0.535160 0.287321
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.415104 -1.050173 -0.103312 -1.062221 -0.064451 0.407648 0.414188 -1.218085 0.641591 0.650374 0.315433
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.867573 2.009116 0.493801 1.108149 0.612344 1.487667 0.529693 1.839586 0.645551 0.653275 0.315395
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.548569 1.221148 0.285478 2.046972 -0.178971 1.467324 0.498729 3.032664 0.642182 0.647858 0.306562
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 27.556750 0.497009 0.156836 -0.188269 2.096678 0.425678 1.052187 -0.297721 0.524776 0.648566 0.305303
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.712584 0.006399 1.323321 0.688848 0.707034 -0.316064 1.603277 -0.334912 0.634996 0.640507 0.313440
167 N15 digital_ok 100.00% 99.57% 99.51% 0.00% 209.276438 208.825626 inf inf 2567.354447 2605.269202 1621.618709 1692.824296 0.426233 0.469764 0.295091
168 N15 digital_ok 100.00% 99.73% 99.73% 0.00% nan nan inf inf nan nan nan nan 0.388309 0.389386 0.168552
169 N15 digital_ok 100.00% 99.78% 99.62% 0.00% nan nan inf inf nan nan nan nan 0.317342 0.499064 0.337043
170 N15 digital_ok 100.00% 99.84% 99.84% 0.00% 253.553385 253.086130 inf inf 2566.140443 2531.829505 1674.150431 1623.847369 0.421753 0.399323 0.244870
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.163005 -0.974423 0.526595 -0.188210 -0.589604 -0.471191 -0.265278 -0.826753 0.546441 0.586306 0.330887
173 N16 digital_ok 100.00% 2.11% 2.97% 0.00% 6.763686 6.519354 4.312764 4.109399 5.592182 6.183705 1.800782 2.625849 0.385786 0.371030 0.169155
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.322748 -0.263023 0.101035 0.942886 1.197880 1.335554 -0.025798 1.260180 0.604938 0.617956 0.323709
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.108604 15.582303 -0.837110 12.211548 0.663157 7.617833 3.637504 3.798452 0.621512 0.054315 0.499578
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.989526 0.221685 1.459147 1.192483 -0.162905 0.946663 1.355197 2.625540 0.629491 0.637123 0.318994
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.160545 14.587861 -0.144045 11.783341 -0.918945 7.707156 0.445567 3.583537 0.636870 0.049078 0.469575
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.472383 1.469662 0.259382 0.802602 0.885107 0.692706 0.611576 0.548375 0.629588 0.639658 0.306106
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 23.393707 -0.085717 7.238115 -0.452209 6.847363 0.895845 4.461722 -0.562605 0.479237 0.646479 0.326388
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.684924 -0.015043 -0.992839 0.121024 -0.068449 0.020564 -1.110122 0.323955 0.641131 0.644657 0.315342
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.880882 -0.850295 0.475813 -0.245034 -0.446646 -0.780533 -0.382820 -0.923261 0.635240 0.641541 0.318148
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.217850 -0.896660 -0.803706 -0.308738 -0.015538 0.408770 1.244502 -0.864245 0.627534 0.632787 0.320461
189 N15 digital_ok 100.00% 99.78% 99.78% 0.00% nan nan inf inf nan nan nan nan 0.280422 0.336872 0.347050
190 N15 digital_ok 100.00% 99.57% 99.68% 0.00% 214.487299 214.406136 inf inf 2820.371678 2853.631374 1781.287774 1784.313681 0.378165 0.261720 0.291484
191 N15 digital_ok 100.00% 99.68% 99.68% 0.00% 234.900953 235.099405 inf inf 3445.518512 3444.403899 1310.610397 1309.248617 0.506956 0.447693 0.223604
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 1.278300 6.460096 1.994427 4.218259 2.680135 6.244954 1.217486 2.066489 0.573282 0.543584 0.336004
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 7.114001 5.514655 4.551446 3.902740 5.628637 5.800333 1.830827 1.877603 0.531702 0.541184 0.330398
200 N18 RF_maintenance 100.00% 100.00% 28.04% 0.00% 13.481678 38.488444 5.548237 0.236575 6.992908 2.731931 3.362299 3.249848 0.040470 0.261066 0.173928
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.330379 4.803239 2.912865 3.680135 2.363912 5.347019 1.098257 1.811573 0.599297 0.593009 0.320200
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 1.041566 1.118356 1.526824 -0.184772 0.828554 -0.074644 0.318662 10.334769 0.617665 0.611077 0.315347
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.818956 14.851714 1.715195 -0.636075 0.301463 0.157928 4.940868 -0.428514 0.630225 0.637466 0.316163
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.831455 -0.431798 3.569565 -0.435996 2.693809 0.325371 11.978791 0.336900 0.504386 0.618042 0.347157
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.042434 5.237606 -0.084802 3.443029 5.068034 2.267784 -0.923798 2.271676 0.583939 0.523846 0.311204
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.484512 1.872397 -0.669351 -0.077950 -0.818929 -0.721856 0.580724 -0.481461 0.600219 0.594662 0.310325
208 N20 dish_maintenance 100.00% 99.68% 99.73% 0.00% 245.442396 245.055666 inf inf 2914.806942 2850.590624 1364.709928 1352.210551 0.606402 0.328298 0.361663
209 N20 dish_maintenance 100.00% 99.57% 99.73% 0.00% nan nan inf inf nan nan nan nan 0.398482 0.374891 0.181470
210 N20 dish_maintenance 100.00% 99.84% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.406132 0.205405 0.222659
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.384737 15.393474 -0.980051 6.323289 -0.859954 7.599292 -0.940060 3.411753 0.563490 0.039375 0.477776
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.918079 -0.890342 0.433846 -0.433258 -0.749059 -1.047274 0.192779 -1.222268 0.607546 0.607545 0.317832
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.313657 -0.421727 -1.076585 -0.723092 -0.561920 -1.098444 -0.211633 -1.341500 0.598068 0.612613 0.315673
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.082815 -0.206283 -0.214551 0.084623 -0.748175 -0.656861 -0.205345 -0.927139 0.604624 0.616567 0.316518
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.629798 -0.941558 -0.725649 -0.322908 -1.091753 -0.853763 -0.687205 1.233226 0.596624 0.613154 0.315657
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.569473 5.962946 4.781271 4.154092 6.000260 6.060167 1.853784 2.087016 0.552452 0.577979 0.320940
225 N19 RF_ok 100.00% 0.00% 74.61% 0.00% -0.337032 14.843263 0.680624 6.053755 -0.778093 7.462393 -0.462847 2.469532 0.605268 0.188891 0.456362
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.358866 21.010942 -0.493448 0.437264 -1.050045 2.818360 -1.103503 0.186760 0.595652 0.504852 0.306827
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 4.324697 0.403741 2.824773 -0.020863 1.174638 -0.622984 3.031721 1.549990 0.501155 0.580445 0.338754
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.556310 0.090639 0.925969 -0.852654 0.177653 -1.021058 0.315186 -0.759851 0.578068 0.572383 0.320629
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.733086 0.778950 0.846830 1.273826 0.124666 1.026567 -0.199053 0.050249 0.572205 0.575584 0.333366
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.107001 -0.285843 0.758303 -0.862913 -0.630177 -0.679808 0.158067 -1.151004 0.553099 0.588110 0.326388
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.584589 -0.159196 1.285627 0.761670 0.282756 -0.481866 -0.042191 -0.538049 0.595224 0.598206 0.324658
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.365001 -0.705214 0.428743 0.150570 -0.264881 -0.942906 -0.358287 -0.188608 0.597393 0.601446 0.321996
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.780457 -0.000202 0.612388 -0.937784 -0.757441 -1.236932 1.854495 -0.057396 0.569681 0.601457 0.327553
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.312795 -1.041770 -0.336389 0.124238 -1.063352 -0.718352 -0.668066 -0.759374 0.596965 0.603117 0.328827
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 21.289252 1.302385 0.259115 1.535346 2.330576 1.485441 -0.164497 0.522776 0.470534 0.592762 0.320833
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 18.236371 -1.112997 1.157844 -0.758889 4.517254 -0.750338 4.563793 -0.964764 0.502256 0.584389 0.323726
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.470592 -0.805204 -0.162502 -1.102116 -0.672530 -0.301141 0.221936 0.541301 0.558738 0.586331 0.323448
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.275589 0.750063 1.066941 -0.590080 0.264588 -0.659642 -0.225682 -1.128686 0.580573 0.576654 0.326534
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.134906 16.032881 -0.764433 5.797694 -0.812475 7.674813 -1.253064 3.207612 0.562979 0.038113 0.475554
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% -0.548452 -0.252403 0.079074 -0.302091 -0.760621 -0.868762 3.017121 0.132367 0.568405 0.567770 0.321521
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 12.536410 15.845374 0.538684 0.593517 0.892307 0.671157 0.486394 1.143559 0.583143 0.581301 0.338645
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.652510 1.388740 2.404225 1.241802 1.818743 1.275742 0.704005 0.428498 0.473234 0.476769 0.329835
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 2.494218 3.069942 1.233718 1.469181 0.712277 1.686308 0.282434 0.229215 0.463127 0.463775 0.311905
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.408567 -0.731004 1.092546 -0.933660 0.733379 -0.676750 -0.156802 0.022034 0.491288 0.490014 0.324836
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.900899 0.067398 -0.341847 -0.974418 -0.239115 -0.801171 1.274677 -0.383453 0.449335 0.473399 0.312772
333 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.427825 4.054536 -0.277049 -0.648341 -0.491897 -0.243238 1.129424 0.393539 0.440218 0.454389 0.305796
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, 9, 15, 16, 17, 18, 27, 28, 32, 34, 36, 37, 40, 42, 45, 47, 50, 51, 52, 54, 55, 56, 58, 59, 60, 63, 65, 68, 70, 71, 72, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 88, 90, 92, 93, 94, 96, 101, 103, 104, 107, 108, 109, 110, 111, 112, 113, 114, 117, 118, 120, 121, 122, 123, 124, 126, 127, 131, 134, 136, 137, 142, 143, 144, 147, 148, 149, 150, 151, 155, 156, 158, 159, 161, 165, 167, 168, 169, 170, 173, 180, 182, 184, 189, 190, 191, 192, 193, 200, 201, 202, 204, 205, 206, 208, 209, 210, 211, 224, 225, 226, 227, 242, 243, 246, 261, 262, 333]

unflagged_ants: [8, 10, 19, 20, 21, 22, 29, 30, 31, 35, 38, 41, 43, 44, 46, 48, 49, 53, 57, 61, 62, 64, 66, 67, 69, 73, 74, 85, 89, 91, 95, 97, 102, 105, 106, 115, 125, 128, 132, 133, 135, 139, 140, 141, 145, 146, 157, 160, 162, 163, 164, 166, 171, 179, 181, 183, 185, 186, 187, 207, 220, 221, 222, 223, 228, 229, 237, 238, 239, 240, 241, 244, 245, 320, 324, 325, 329]

golden_ants: [10, 19, 20, 21, 29, 30, 31, 38, 41, 44, 53, 66, 67, 69, 85, 91, 105, 106, 128, 140, 141, 145, 146, 157, 160, 162, 163, 164, 166, 171, 181, 183, 186, 187]
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_2460018.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 [ ]: