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 = "2459962"
data_path = "/mnt/sn1/2459962"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 1-17-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/2459962/zen.2459962.21330.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1849 ant_metrics files matching glob /mnt/sn1/2459962/zen.2459962.?????.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/2459962/zen.2459962.?????.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 2459962
Date 1-17-2023
LST Range 2.337 -- 12.289 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1849
Total Number of Antennas 196
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 196 (0.0%)
Antennas in Commanded State (observed) 0 / 196 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 64 / 196 (32.7%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 124 / 196 (63.3%)
Redcal Done? ❌
Never Flagged Antennas 72 / 196 (36.7%)
A Priori Good Antennas Flagged 54 / 93 total a priori good antennas:
3, 5, 7, 9, 15, 16, 17, 19, 20, 29, 31, 40,
42, 53, 54, 55, 56, 67, 71, 72, 81, 85, 86,
93, 94, 101, 103, 109, 111, 121, 122, 123,
128, 136, 143, 144, 146, 147, 148, 149, 150,
151, 161, 165, 169, 170, 173, 182, 184, 185,
187, 189, 192, 193
A Priori Bad Antennas Not Flagged 33 / 103 total a priori bad antennas:
22, 35, 43, 46, 48, 61, 64, 73, 74, 82, 89,
95, 102, 115, 125, 132, 137, 205, 206, 211,
220, 221, 222, 223, 229, 237, 238, 239, 245,
261, 324, 325, 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_2459962.csv

Build DataFrame¶

In [20]:
# build dataframe
to_show = {'Ant': [f'<a href="{ant_to_report_url(ant)}" target="_blank">{ant}</a>' for ant in ants],
           'Node': [f'N{nodes[ant]:02}' for ant in ants], 
           'A Priori Status': [a_priori_statuses[ant] for ant in ants]}
           #'Worst Metric': worst_metrics, 'Worst Modified Z-Score': worst_zs}
df = pd.DataFrame(to_show)

# create bar chart columns for flagging percentages:
bar_cols = {}
if use_auto_metrics:
    bar_cols['Auto Metrics Flags'] = [float(ant in auto_ex_ants) for ant in ants]
if use_ant_metrics:
    if np.sum(list(a_priori_flag_frac.values())) > 0:  # only include this col if there are any a priori flags
        bar_cols['A Priori Flag Fraction in Ant Metrics'] = [a_priori_flag_frac[ant] for ant in ants]
    for ap in antpols:
        bar_cols[f'Dead Fraction in Ant Metrics ({ap})'] = [dead_ant_frac[ap][ant] for ant in ants]
    bar_cols['Crossed Fraction in Ant Metrics'] = [crossed_ant_frac[ant] for ant in ants]
if use_redcal:
    bar_cols['Flag Fraction Before Redcal'] = [redcal_prior_flag_frac[ant] for ant in ants]
    bar_cols['Flagged By Redcal chi^2 Fraction'] = [redcal_flagged_frac[ant] for ant in ants]  
for col in bar_cols:
    df[col] = bar_cols[col]

# add auto_metrics
if use_auto_metrics:
    for label, modz in all_modzs.items():
        df[label] = modz
z_score_cols = [col for col in df.columns if 'Modified Z-Score' in col]        
        
# add ant_metrics
ant_metrics_cols = {}
if use_ant_metrics:
    for ap in antpols:
        ant_metrics_cols[f'Average Dead Ant Metric ({ap})'] = [average_dead_metrics[ap][ant] for ant in ants]
    ant_metrics_cols['Average Crossed Ant Metric'] = [average_crossed_metrics[ant] for ant in ants]
    for col in ant_metrics_cols:
        df[col] = ant_metrics_cols[col]   

# add redcal chisq
redcal_cols = []
if use_redcal:
    for ap in antpols:
        col_title = f'Median chi^2 Per Antenna ({ap})'
        df[col_title] = [cspa[ant, ap] for ant in ants]
        redcal_cols.append(col_title)

# sort by node number and then by antenna number within nodes
df.sort_values(['Node', 'Ant'], ascending=True)

# style dataframe
table = df.style.hide_index()\
          .applymap(lambda val: f'background-color: {status_colors[val]}' if val in status_colors else '', subset=['A Priori Status']) \
          .background_gradient(cmap='viridis', vmax=mean_round_modz_cut * 3, vmin=0, axis=None, subset=z_score_cols) \
          .background_gradient(cmap='bwr_r', vmin=dead_cut-.25, vmax=dead_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .background_gradient(cmap='bwr_r', vmin=crossed_cut-.25, vmax=crossed_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .background_gradient(cmap='plasma', vmax=4, vmin=1, axis=None, subset=redcal_cols) \
          .applymap(lambda val: 'font-weight: bold' if val < dead_cut else '', subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val < crossed_cut else '', subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .applymap(lambda val: 'color: red' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .bar(subset=list(bar_cols.keys()), vmin=0, vmax=1) \
          .format({col: '{:,.4f}'.format for col in z_score_cols}) \
          .format({col: '{:,.4f}'.format for col in ant_metrics_cols}) \
          .format({col: '{:,.2%}'.format for col in bar_cols}) \
          .applymap(lambda val: 'font-weight: bold', subset=['Ant']) \
          .set_table_styles([dict(selector="th",props=[('max-width', f'70pt')])])

Table 2: RTP Per-Antenna Metrics Summary Table¶

This admittedly very busy table incorporates summary information about all antennas in the array. Its columns depend on what information is available when the notebook is run (i.e. whether auto_metrics, ant_metrics, and/or redcal is done). These can be divided into 5 sections:

Basic Antenna Info: antenna number, node, and its a priori status.

Flag Fractions: Fraction of the night that an antenna was flagged for various reasons. Note that auto_metrics flags antennas for the whole night, so it'll be 0% or 100%.

auto_metrics Details: If auto_metrics is included, this section shows the modified Z-score signifying how much of an outlier each antenna and polarization is in each of four categories: bandpass shape, overall power, temporal variability, and temporal discontinuities. Bold red text indicates that this is a reason for flagging the antenna. It is reproduced from the auto_metrics_inspect.ipynb nightly notebook, so check that out for more details on the precise metrics.

ant_metrics Details: If ant_metrics is included, this section shows the average correlation-based metrics for antennas over the whole night. Low "dead ant" metrics (nominally below 0.4) indicate antennas not correlating with the rest of the array. Negative "crossed ant" metrics indicate antennas that show stronger correlations in their cross-pols than their same-pols, indicating that the two polarizations are probably swapped. Bold text indicates that the average is below the threshold for flagging.

redcal chi^2 Details: If redcal is included, this shows the median chi^2 per antenna. This would be 1 in an ideal array. Antennas are thrown out when they they are outliers in their median chi^2, usually greater than 4-sigma outliers in modified Z-score.

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 11.018655 14.580405 11.979823 -0.978874 8.187951 5.448921 2.449671 0.524876 0.033095 0.393379 0.315431
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.202467 -0.837837 1.594862 1.022614 4.689136 0.024730 3.431404 -0.068668 0.657949 0.664608 0.354849
5 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 1.255571 9.129690 0.536247 0.402043 1.190003 1.665284 1.330227 0.870632 0.663900 0.655581 0.336090
7 N02 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
8 N02 RF_maintenance 100.00% 100.00% 100.00% 0.00% 262.162550 261.782395 inf inf 4432.215480 4491.806756 303.028085 333.987297 nan nan nan
9 N02 digital_ok 100.00% 100.00% 100.00% 0.00% 257.803010 257.977099 inf inf 4566.058650 4588.764789 361.614615 389.537962 nan nan nan
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 3.718344 -0.468197 -1.729180 -1.647478 0.386318 0.526122 -0.731689 0.144884 0.657823 0.671715 0.334953
15 N01 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
16 N01 digital_ok 100.00% 100.00% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.104327 0.391893 0.087646
17 N01 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
18 N01 RF_maintenance 100.00% 100.00% 35.91% 0.00% 11.998406 18.615781 11.912974 -1.097204 8.209835 7.565820 2.423672 1.692797 0.029445 0.275732 0.213202
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.835835 -1.435793 -0.980517 -0.627461 10.741179 79.007396 0.748832 28.597952 0.675473 0.676298 0.337777
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.664319 -1.310472 2.419704 -1.306861 24.083188 -0.370388 4.572243 -0.853598 0.666700 0.680467 0.336235
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.086945 0.022564 -0.513994 0.108831 -0.130153 0.414739 -0.010144 0.497570 0.661812 0.665325 0.326523
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.356182 -0.657929 0.215144 0.200955 -0.780429 -0.791685 -0.399190 -0.564106 0.638894 0.648900 0.330624
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.406445 12.204973 11.978934 12.184054 8.229446 10.289536 2.547820 2.551710 0.033020 0.035699 0.003674
28 N01 RF_maintenance 100.00% 2.33% 74.47% 0.00% 12.788258 26.486755 -0.153434 1.922213 26.884865 9.103905 0.902726 3.140616 0.401713 0.200279 0.273071
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 11.292000 12.844340 11.488683 11.702293 8.211778 10.252186 2.448370 2.445680 0.029778 0.035853 0.006214
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.677884 -0.073003 -0.829000 0.574747 0.602557 0.866600 -0.778495 0.751085 0.679177 0.686091 0.337636
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.275733 -1.938819 1.311766 1.184409 9.701620 1.645235 2.531963 1.622737 0.687295 0.687413 0.331093
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.388216 22.709260 0.007934 3.146379 0.408414 7.712201 0.408783 5.770997 0.677455 0.600837 0.316340
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 12.912988 14.272539 5.271625 5.339217 8.210554 10.221052 2.481211 2.473837 0.034590 0.048085 0.009852
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.671097 -0.137670 1.367461 -1.402100 2.884424 -1.445795 0.315643 -1.040110 0.648272 0.644658 0.327591
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 28.107603 27.624883 15.805674 15.417791 8.033267 9.948529 2.563644 2.615942 0.031485 0.029155 0.001450
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.845259 0.389206 -1.793867 0.933080 -0.229915 1.765854 -1.464593 1.282604 0.673953 0.680425 0.353677
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.241485 0.278355 0.400145 0.668948 0.822861 2.131256 1.095181 1.056907 0.678199 0.687257 0.348866
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 10.428448 0.123880 11.511755 0.540166 8.248615 0.496702 2.498133 0.732294 0.037550 0.681273 0.532149
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.859700 -0.313460 0.098165 -0.098883 0.939195 0.015510 0.292659 0.130495 0.681102 0.688810 0.330965
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.994294 13.439700 12.316748 12.804632 8.175224 10.202358 2.422414 2.492336 0.026792 0.026150 0.001347
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.054590 -0.475099 -0.040581 0.720623 0.139141 1.153677 0.192200 0.853632 0.690085 0.692818 0.331042
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -2.184443 -0.303595 -0.892701 -0.680034 -0.629199 0.276788 -1.208662 -0.594287 0.689198 0.700504 0.333786
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.291349 2.137481 0.414444 0.635073 0.034362 0.737372 0.680506 0.908241 0.684428 0.688134 0.324126
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.340049 0.475272 -0.861270 -1.220210 -0.145195 -0.654976 -0.505388 -1.350513 0.684436 0.700336 0.338800
47 N06 not_connected 100.00% 100.00% 99.46% 0.00% 12.066029 13.848126 5.056065 4.887642 8.199954 10.181620 2.488072 2.367589 0.031112 0.056019 0.018010
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.261304 0.300755 0.473848 2.378769 -1.054475 1.319355 -0.381323 0.494556 0.652961 0.667062 0.336492
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.386690 -0.131317 -0.944506 -0.048124 1.148937 6.779730 -0.334376 0.103211 0.611678 0.648688 0.333120
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.306830 1.408295 1.054990 1.062700 1.900228 2.209065 2.696423 1.831586 0.630574 0.666447 0.325776
51 N03 dish_maintenance 100.00% 99.95% 0.00% 0.00% 24.688104 4.299562 15.208830 -0.706061 8.159646 3.567481 2.829627 -0.217879 0.041553 0.571901 0.437384
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.019420 8.039288 -0.185304 0.569723 0.657169 1.209501 0.081518 0.755374 0.682542 0.689406 0.342348
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.736108 5.421829 0.408552 0.440923 1.340590 3.229005 0.826196 0.957235 0.689489 0.692759 0.340344
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.906601 13.059098 11.990927 12.461807 8.228376 10.247213 2.532360 2.479339 0.026740 0.026000 0.001241
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.262248 13.154718 11.321982 11.638309 8.213353 10.257421 2.446216 2.572695 0.028872 0.032163 0.003157
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.543998 13.986801 0.929209 12.623993 0.760514 10.228902 1.513376 2.478420 0.687206 0.037793 0.561159
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.619384 0.182180 10.163256 0.675313 14.941721 1.357034 6.686004 0.866114 0.375988 0.700991 0.408305
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.532990 12.740901 11.862779 12.341587 8.197263 10.227314 2.526720 2.512548 0.035541 0.035279 0.001459
59 N05 RF_maintenance 100.00% 99.19% 0.00% 0.00% 11.606409 0.102443 11.330183 1.368421 8.170353 5.297156 2.448308 2.234419 0.057230 0.693462 0.554364
60 N05 RF_maintenance 100.00% 0.00% 88.64% 0.00% 0.683908 12.493611 -0.200255 12.365667 -0.037304 10.073261 0.093511 2.164372 0.685196 0.111647 0.531818
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.827090 0.262649 -0.585157 -1.757444 -0.561961 -1.579457 -0.459403 -1.361388 0.633657 0.661899 0.326253
62 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.755502 0.238656 -0.658409 1.480192 18.029745 0.238234 0.236826 0.266930 0.619272 0.667429 0.340625
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.015606 13.257107 -0.569941 5.368199 -1.158836 10.264232 -0.936835 2.593543 0.650255 0.045300 0.500960
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.463786 0.514440 -1.081298 -1.300329 -1.449698 -0.998030 -0.927798 -0.385177 0.637492 0.633649 0.318026
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.563683 0.617155 0.731300 1.253791 0.854298 1.954825 1.344115 1.641429 0.660170 0.676849 0.355389
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.100312 1.358238 -1.359256 -1.480703 0.434866 0.199339 -1.202555 -1.195820 0.670692 0.689273 0.353380
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 2.080939 12.864904 0.013590 1.738888 0.301419 1.927908 0.238826 1.928489 0.682981 0.673717 0.333874
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 23.732647 28.505951 1.605131 16.335722 5.999518 9.980154 1.687950 2.792452 0.423270 0.030109 0.319702
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.807109 -0.827826 0.530605 0.870684 0.316956 1.705089 0.938049 1.041470 0.687658 0.699012 0.327822
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.462756 -0.950331 0.069731 0.115852 0.470444 0.721731 0.291557 0.202080 0.694304 0.703536 0.325702
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 9.396515 -0.175553 1.009518 1.062682 1.628745 0.906496 1.387554 1.292933 0.703632 0.707453 0.320884
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.444779 13.991465 12.449394 12.827692 8.234219 10.176277 2.429187 2.458040 0.026698 0.025289 0.001551
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.842191 1.535131 -1.427041 -1.166455 -0.409291 -0.481271 -1.168961 -1.089342 0.703206 0.711639 0.326003
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.315114 -0.292225 -0.332541 -0.733749 -0.477217 0.786757 -0.713023 -0.237711 0.700163 0.709164 0.326328
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 39.335517 0.155645 -0.169993 -0.093626 8.839181 -1.236250 2.098880 -0.686231 0.516569 0.667524 0.332298
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 33.868527 -0.343391 -0.661731 1.729860 2.988075 4.223737 -0.128779 0.562036 0.496931 0.673480 0.336634
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.915957 13.576348 -1.799046 5.398267 15.329016 10.202984 0.680877 2.405634 0.636896 0.040211 0.463501
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.813456 14.495695 -0.377222 5.280220 0.287090 10.204819 -0.139988 2.482178 0.632998 0.044334 0.467020
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.671097 13.662426 0.365714 10.705293 0.290008 10.127564 0.461971 2.501249 0.638053 0.038664 0.476062
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.235226 0.050464 0.630187 2.469198 0.167326 2.016196 0.835922 2.839508 0.656563 0.665043 0.340103
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.400864 0.178394 0.520935 0.364549 -0.015510 -0.244052 0.754211 0.574796 0.670585 0.684855 0.336662
84 N08 RF_maintenance 100.00% 49.97% 100.00% 0.00% 19.073155 24.480637 15.257606 15.731929 10.925714 10.021119 7.652393 2.602322 0.281422 0.034719 0.169876
85 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.556429 0.863312 1.869550 1.617140 11.317100 1.252328 1.942552 1.783147 0.685650 0.696263 0.326311
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.838581 0.198173 1.825417 1.909147 0.666792 1.425698 2.388303 3.871565 0.676711 0.691085 0.309711
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.768647 9.479537 -0.411922 -0.343232 -0.763354 0.731886 -0.241728 -0.328598 0.706013 0.714006 0.318405
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.629384 0.854006 0.682812 0.795533 0.089862 -0.298682 1.018198 0.926311 0.697156 0.708100 0.313040
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.523964 0.545528 0.286346 0.921417 -0.518428 0.087974 0.525362 1.046105 0.700141 0.706780 0.314686
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.077177 -1.215269 1.017210 1.575993 27.831290 0.867600 0.384276 1.835376 0.690790 0.699738 0.315170
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.314797 -0.148343 0.009792 -0.467672 -0.673059 -0.874301 0.124161 -0.362248 0.688451 0.705638 0.325728
92 N10 RF_maintenance 100.00% 0.00% 18.12% 0.00% 37.683107 43.163515 0.830297 0.963527 7.230653 22.454788 1.091379 1.961120 0.348572 0.303164 0.074483
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.487093 -0.285693 2.803494 -1.381575 3.111150 -0.509845 4.268031 -1.178249 0.676956 0.696186 0.334599
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 12.136558 13.229095 12.194580 12.212923 7.990350 10.225536 2.452677 2.450262 0.031428 0.026006 0.002606
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.135289 -0.585474 -1.436527 1.114413 -1.245688 -0.342936 -1.390034 0.042342 0.646129 0.671062 0.344026
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.405546 13.879878 5.101189 5.525399 8.177481 10.175443 2.445811 2.457430 0.033388 0.038243 0.002752
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.790539 6.375643 -1.229946 2.220065 -0.582937 4.390388 -0.943283 1.952882 0.633288 0.574060 0.330411
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.709062 10.167751 -0.179680 1.395426 0.270538 1.745006 0.093376 1.747648 0.687386 0.695791 0.330772
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.172301 0.184175 -1.753376 -1.116040 0.210877 0.945838 -1.320497 -0.329803 0.693578 0.701739 0.326039
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.929872 6.266460 -1.014402 -1.530747 156.296845 -1.294857 14.226986 -1.223703 0.680709 0.708104 0.325129
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.986283 56.681685 -0.913388 8.219276 0.466336 9.629640 -0.649086 10.777571 0.705748 0.686065 0.318518
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.597384 -0.136682 -0.300956 0.168674 -0.478074 -0.471802 -0.218031 0.138562 0.702653 0.707568 0.312032
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 2.282803 1.529351 -1.509727 -0.727078 -0.675922 -1.181130 -1.137354 -0.611070 0.701940 0.709668 0.310483
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.814852 1.847278 0.071361 -0.555917 0.176414 0.571965 0.668475 -0.067066 0.698580 0.713582 0.313859
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.020718 40.602907 11.914892 0.697524 8.234033 6.625854 2.543420 1.145183 0.034889 0.350462 0.187700
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.921109 12.644890 11.950687 12.040308 8.214094 10.263054 2.431715 2.540991 0.026924 0.026774 0.001295
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 27.493341 27.176745 15.954268 16.045665 8.066825 9.960656 2.483745 2.539167 0.024262 0.026705 0.001278
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.159240 12.518176 1.000268 12.184282 1.152840 10.267242 1.544432 2.542948 0.682375 0.036729 0.453506
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -1.543492 -0.806248 0.526958 0.234441 0.875097 0.724251 0.913108 0.358999 0.675196 0.690456 0.341954
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.135635 14.124439 4.835570 5.393038 8.192429 10.221908 2.542468 2.496713 0.035214 0.030770 0.002402
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.195492 9.723333 18.495128 12.822641 22.351260 14.382918 32.273472 10.602623 0.020705 0.027707 0.003966
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.494199 -0.795892 -1.464222 -0.517622 -1.426823 -1.702321 -0.997352 -0.829506 0.618215 0.647465 0.341390
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.048630 14.390090 12.084470 12.787448 8.190179 10.242266 2.496489 2.652902 0.027733 0.031901 0.002856
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.272227 1.317998 0.045029 0.652134 -0.181648 0.928228 0.463443 0.925930 0.661819 0.680860 0.340736
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.643417 1.434534 3.437919 -1.159256 3.792012 -0.039253 5.033082 -0.895972 0.676471 0.701916 0.326207
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.794169 4.695849 -1.323644 7.183222 0.256549 25.697419 -0.248251 6.352977 0.699875 0.680768 0.320322
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 10.413532 7.762366 0.417571 1.146132 0.159544 1.220442 0.783589 1.253621 0.706319 0.712066 0.315420
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.926770 10.636301 1.216245 1.127720 1.285827 0.789335 1.602782 1.278223 0.710047 0.718740 0.318044
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.703636 -0.146223 0.268445 0.792273 -0.018256 0.584762 0.573433 0.978813 0.709900 0.718612 0.318400
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.419544 -0.208795 -0.169473 0.910439 -0.463250 -0.075117 0.004390 0.983771 0.705654 0.712446 0.316773
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.240643 5.038322 -1.047926 1.432479 6.433178 0.679930 5.487082 1.647210 0.649473 0.707779 0.319371
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.091107 -0.022564 0.929479 0.550686 1.562086 1.381011 1.308343 0.765014 0.695146 0.710417 0.329836
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.688108 12.211815 12.070588 12.340615 8.189925 10.229017 2.418659 2.461814 0.030213 0.028250 0.001088
131 N11 not_connected 100.00% 0.00% 1.24% 0.00% -0.286304 11.836055 -0.224554 5.130802 -0.660428 8.555645 -0.837931 1.763817 0.656428 0.372384 0.385830
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.664939 0.950242 -0.586455 -1.810030 0.350053 -1.368728 -1.172154 -1.419908 0.641975 0.655640 0.334151
133 N11 not_connected 100.00% 97.57% 0.00% 0.00% 12.789503 -0.368099 4.814372 -1.835484 8.160597 -1.212567 2.444769 -1.333578 0.058838 0.645902 0.463957
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.857992 -1.230335 -0.810919 -1.856970 0.853310 7.007202 -0.213524 -0.890620 0.637318 0.665264 0.360250
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.959140 1.327850 11.447482 0.278561 8.210840 1.728140 2.505409 0.292150 0.040030 0.652553 0.455355
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.088747 -0.633309 0.532564 -1.785309 0.497514 -1.082180 0.711221 -1.492581 0.646439 0.674344 0.345435
139 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.225493 -0.271118 1.648476 -0.977350 0.601612 5.234397 0.370327 -0.560167 0.669634 0.676941 0.330470
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.032636 -0.490660 -0.860220 -0.215446 -0.282987 -1.251594 -0.355704 -0.430917 0.689670 0.705958 0.326510
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.563562 -1.360824 -0.009792 0.872989 0.669193 1.085389 0.241916 -0.168997 0.695428 0.708210 0.322100
142 N13 RF_maintenance 100.00% 0.00% 99.95% 0.00% 2.071968 12.450444 -0.446429 12.375942 0.829185 10.239503 1.884939 2.500974 0.699383 0.049649 0.536013
143 N14 digital_ok 100.00% 0.00% 100.00% 0.00% -0.335003 13.076075 1.400126 12.475404 1.575791 10.174135 1.874206 2.552851 0.701942 0.041387 0.555703
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.712852 -0.361795 -1.166714 7.701250 0.220283 7.870384 -0.834463 9.449034 0.707790 0.654064 0.332262
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.322064 -0.461899 -1.006741 4.990108 -0.321451 6.702264 -0.723484 6.819531 0.706597 0.692305 0.320450
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 12.524684 -1.130536 4.812210 -0.185878 8.147844 -1.494302 2.383596 -0.792361 0.039779 0.696787 0.532427
147 N15 digital_ok 100.00% 99.78% 99.78% 0.00% nan nan inf inf nan nan nan nan 0.617905 0.593415 0.303352
148 N15 digital_ok 100.00% 99.73% 99.73% 0.00% 254.142014 254.505014 inf inf 4343.567446 4343.780375 474.911710 474.301030 0.652853 0.590604 0.443212
149 N15 digital_ok 100.00% 99.84% 99.78% 0.00% 264.317305 264.271192 inf inf 6143.297871 6142.161215 948.714763 948.052245 0.489197 0.490010 0.195409
150 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.228434 -0.892630 -0.795827 -1.556869 12.037155 -0.672018 -0.456646 -1.404100 0.680762 0.694152 0.347405
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 26.267966 1.431790 -0.185182 0.418435 3.432611 0.437481 -0.266940 0.221896 0.547199 0.631552 0.311317
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.396044 -0.505835 11.634167 -1.704747 8.215724 4.798852 2.511616 -0.764241 0.042601 0.664462 0.480714
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 4.695591 12.289178 10.645914 12.049326 11.587044 10.264450 10.181995 2.550224 0.407401 0.038246 0.286994
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.207906 -0.260864 0.220035 0.786401 0.203894 0.911066 0.486250 1.000093 0.653805 0.673938 0.342808
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.416406 -0.315781 0.193677 -0.837395 1.393376 1.047079 0.567118 0.434265 0.668778 0.689023 0.342004
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.719870 31.865773 -1.790043 -0.764980 -1.301989 3.350105 -1.389202 0.066106 0.643093 0.538955 0.301446
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.717978 -1.242926 -0.114631 -0.843435 -0.429175 -0.167140 0.185672 -0.597979 0.684792 0.698476 0.326258
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.115027 28.763376 0.245025 -0.752548 0.038716 2.272528 0.466594 -0.414901 0.690780 0.587123 0.292270
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.066967 -1.138374 -1.264603 -1.505273 1.269187 0.095414 -0.799286 -1.507158 0.700433 0.711216 0.323813
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.462540 1.714116 -0.012105 0.509928 0.093548 1.067274 0.241855 0.751172 0.705940 0.712613 0.323475
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.788683 0.610228 1.671951 -0.096127 2.237489 1.272051 2.272809 0.180221 0.698180 0.712819 0.318964
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 30.379415 0.392013 -0.588521 -1.252562 1.877400 -0.503188 0.012093 -1.031304 0.571611 0.711560 0.315441
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.723991 10.765463 -0.093880 2.597335 25.353692 7.496434 1.811487 1.890333 0.695999 0.687999 0.328074
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.250859 -1.079694 -1.368247 -0.464126 -0.278808 1.030334 -1.094796 -0.004390 0.699978 0.709714 0.334998
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.825736 -1.616760 0.612385 -0.461077 0.992572 0.476918 1.004495 -0.197711 0.689806 0.703102 0.338893
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 3.484173 13.147432 -0.783497 -1.395324 -0.054019 -0.593983 -0.555703 -1.352081 0.684419 0.679361 0.334326
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 11.775514 -1.085557 12.315575 -1.186462 8.202658 0.332570 2.561981 -0.521296 0.041749 0.698408 0.530173
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.199389 2.951878 -1.222732 0.728723 -1.609468 1.276703 -1.004625 0.470089 0.628985 0.616292 0.319986
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 13.094734 13.350449 4.476605 4.905414 8.231443 10.242990 2.679331 2.734452 0.040358 0.044389 0.003822
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.101419 -0.687089 -0.834832 -1.519550 4.799830 -0.191297 -0.612670 -1.333004 0.661899 0.683206 0.338650
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.606991 13.363164 -1.724034 12.549278 0.111954 10.201637 -0.257048 2.511310 0.681257 0.056616 0.536410
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.180268 -0.857815 0.513055 0.294816 0.672962 0.505396 0.842266 0.846003 0.689221 0.698711 0.330227
182 N13 digital_ok 100.00% 0.00% 99.95% 0.00% -0.467595 12.304871 -0.224932 12.022367 13.989725 10.248010 0.805231 2.495309 0.698632 0.052065 0.504238
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.505912 0.531540 -0.769534 0.041795 -0.034536 -0.244676 -0.559375 0.092467 0.688976 0.697872 0.314823
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -1.201240 -1.011858 -1.458227 -0.521367 16.701193 -0.640967 0.103343 -0.249052 0.698732 0.711269 0.318665
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 37.124605 0.070669 -0.368482 -1.738523 3.208172 -0.406605 0.157802 -1.474634 0.583365 0.708153 0.320233
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.003041 -1.491953 -1.623354 -0.576287 -0.560729 -1.499064 -1.369614 -0.894974 0.702730 0.713449 0.335134
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.002907 0.934423 -1.115204 1.231142 2.453526 20.493794 -0.866556 2.391618 0.697155 0.706085 0.332514
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 9.963478 12.112375 11.442343 12.172071 8.243538 10.284856 2.518574 2.610722 0.028432 0.031993 0.001605
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.496299 -1.879512 -0.577722 0.537798 -0.411265 -0.573455 -0.313902 -0.365894 0.683002 0.700000 0.352254
191 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.927313 -0.601421 1.707618 -0.577791 2.033595 0.056825 3.210880 -0.245689 0.671369 0.690193 0.345337
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.682440 5.783622 5.863502 6.061352 6.260541 8.247002 2.013701 2.114866 0.620226 0.637579 0.354566
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.271770 -0.437115 5.971443 1.641859 6.438504 0.961925 2.098742 0.470307 0.606533 0.652764 0.378778
200 N18 RF_maintenance 100.00% 100.00% 41.16% 0.00% 12.885337 36.956566 4.983686 0.722085 8.200607 7.758298 2.471190 0.947619 0.041299 0.269339 0.182420
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.236192 4.001316 3.462718 5.323713 3.283232 6.858278 1.308883 1.883484 0.670218 0.662191 0.338652
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% -0.195225 1.731967 1.785734 -1.451618 0.672348 -0.780917 0.393116 0.578708 0.680414 0.668620 0.328173
205 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.934610 2.788026 -0.110039 -0.445041 -0.564535 -0.891283 -0.628030 0.081019 0.674877 0.663027 0.323421
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.897059 2.829758 3.048500 0.196263 2.193540 0.149803 1.008408 -0.420084 0.674628 0.667309 0.330572
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.587034 3.685737 1.501638 -0.632141 0.937455 11.714265 0.279503 -0.316184 0.656730 0.662843 0.314329
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.269095 11.654249 11.584528 12.693814 8.614334 9.760678 4.552646 6.874580 0.033973 0.036274 0.001104
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.751150 7.274791 11.036605 11.097076 7.868126 10.073469 3.527514 3.748794 0.041614 0.040216 0.002269
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 12.832132 5.212297 -0.994050 -1.192976 -1.030179 -0.619004 -0.707538 -1.065035 0.673017 0.651277 0.341312
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.351576 1.201860 -1.633456 0.143463 0.991691 -0.311217 -1.245381 -0.520598 0.630575 0.650091 0.337927
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.142857 -1.315056 0.323651 -0.386566 -0.551593 -0.442586 -0.113223 -0.955601 0.666954 0.671617 0.329954
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.647662 -0.124092 -1.828551 -0.790858 -0.876413 -1.201615 -0.891908 -1.213075 0.656529 0.676144 0.330847
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.255541 -0.223940 -0.582996 0.276649 -1.371108 -0.639132 -0.839396 -0.584171 0.664797 0.683173 0.333667
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.195108 1.484156 -1.814438 1.437568 -1.546086 1.427978 -1.300049 0.324467 0.651111 0.682334 0.337804
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.675964 5.505249 6.306227 6.142595 7.983650 8.379621 2.264708 2.141342 0.637183 0.654969 0.343944
225 N19 RF_ok 100.00% 0.00% 70.96% 0.00% 0.852830 12.510914 0.835061 5.085289 -0.924246 9.856606 -0.034482 1.346739 0.670926 0.213851 0.502243
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.574542 20.270874 -0.127307 1.580840 -1.105266 3.905361 -0.693434 0.389146 0.665584 0.600354 0.328087
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 2.954442 0.935840 -1.769318 0.196412 8.074020 -0.636983 0.301878 -0.561323 0.634436 0.666882 0.333721
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.577177 22.478650 -0.793766 -0.253118 3.305879 4.802103 6.414585 4.945074 0.583021 0.561792 0.275068
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.026899 -0.641013 1.452221 1.771533 0.952089 0.788131 1.117448 0.231162 0.648627 0.665187 0.352403
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.051886 0.100069 0.117428 -1.768104 1.020712 -1.476925 0.019807 -1.607151 0.610282 0.653126 0.345261
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.145059 -0.135097 0.910169 0.464006 -0.059418 -0.759323 -0.141562 -0.442289 0.662892 0.669929 0.341839
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.130948 -1.957041 -0.283603 0.233571 -0.830602 -0.834221 -0.802785 -0.242796 0.662853 0.673297 0.339647
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 28.804038 58.737435 -0.863171 1.082022 71.392233 5.083672 5.448985 1.005939 0.497796 0.463346 0.190387
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.822622 4.739129 -1.223757 0.584778 -1.315795 0.750359 -0.722320 2.201701 0.653223 0.629183 0.335490
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 24.838171 1.247584 0.756855 2.169832 6.776124 15.049174 0.513024 0.824209 0.554100 0.668294 0.352308
243 N19 RF_ok 100.00% 19.63% 0.00% 0.00% 69.291291 2.716011 1.129576 -1.689345 6.403097 -1.273517 0.808341 -1.336267 0.328116 0.654391 0.448301
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.861004 2.761267 1.758472 -0.871895 3.028082 0.090577 1.649185 -0.085396 0.554615 0.637181 0.337144
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.972474 2.617383 -0.013944 -1.127410 -0.847968 -0.918313 -0.609754 -1.205301 0.643171 0.648216 0.338073
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.353467 8.557856 -1.016407 0.543903 5.938308 6.663695 0.452595 0.529642 0.379911 0.379158 0.147854
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.790875 1.412333 0.530767 -0.417010 -0.435661 -1.361812 0.254236 -0.776723 0.642529 0.647850 0.343530
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.683762 7.507973 10.898960 11.435241 8.253978 10.233809 3.332510 3.786189 0.032384 0.027526 0.004254
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 7.230572 13.228488 3.292135 7.935323 3.117008 10.264543 5.934620 2.581048 0.496157 0.046379 0.401011
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.024561 1.876845 1.191186 1.943705 0.367215 0.792598 0.391222 0.593488 0.547193 0.554918 0.344516
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% -0.197912 -1.051366 1.311116 -1.463340 -0.081664 -1.432069 0.078392 -0.788330 0.581411 0.578641 0.354051
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.854507 -0.473111 1.433712 -1.032995 47.005489 -1.432082 0.204699 -0.781557 0.448315 0.564395 0.359303
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.295099 2.034986 -0.582187 -1.779381 -0.384882 -0.563419 0.144513 -0.813249 0.500290 0.548856 0.351430
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, 8, 9, 15, 16, 17, 18, 19, 20, 27, 28, 29, 31, 32, 34, 36, 40, 42, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 62, 63, 67, 68, 71, 72, 77, 78, 79, 80, 81, 84, 85, 86, 87, 90, 92, 93, 94, 96, 97, 101, 103, 104, 108, 109, 110, 111, 113, 114, 117, 120, 121, 122, 123, 126, 128, 131, 133, 135, 136, 139, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 155, 156, 159, 161, 165, 166, 169, 170, 173, 179, 180, 182, 184, 185, 187, 189, 192, 193, 200, 201, 207, 208, 209, 210, 224, 225, 226, 227, 228, 240, 241, 242, 243, 244, 246, 262, 320, 329]

unflagged_ants: [10, 21, 22, 30, 35, 37, 38, 41, 43, 44, 45, 46, 48, 61, 64, 65, 66, 69, 70, 73, 74, 82, 83, 88, 89, 91, 95, 102, 105, 106, 107, 112, 115, 118, 124, 125, 127, 132, 137, 140, 141, 157, 158, 160, 162, 163, 164, 167, 168, 171, 181, 183, 186, 190, 191, 202, 205, 206, 211, 220, 221, 222, 223, 229, 237, 238, 239, 245, 261, 324, 325, 333]

golden_ants: [10, 21, 30, 37, 38, 41, 44, 45, 65, 66, 69, 70, 83, 88, 91, 105, 106, 107, 112, 118, 124, 127, 140, 141, 157, 158, 160, 162, 163, 164, 167, 168, 171, 181, 183, 186, 190, 191, 202]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459962.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.3.dev3+gb08b74d
In [ ]: