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

Load Auto Metrics¶

In [6]:
use_auto_metrics = False

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

# if it exists, load and extract relevant information
if len(auto_metrics_file) > 0:
    auto_metrics_file = auto_metrics_file[0]
    print(f'Found auto_metrics results file at {auto_metrics_file}.')
    
    auto_metrics = load_metric_file(auto_metrics_file)
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
    auto_ex_ants = auto_metrics['ex_ants']['r2_ex_ants']
    
    use_auto_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping auto_metrics.')
Found auto_metrics results file at /mnt/sn1/2459898/zen.2459898.25299.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1848 ant_metrics files matching glob /mnt/sn1/2459898/zen.2459898.?????.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/2459898/zen.2459898.?????.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 2459898
Date 11-14-2022
LST Range 23.087 -- 9.033 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1848
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 7
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 96
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 201 (0.0%)
Antennas in Commanded State (observed) 0 / 201 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 18
Nodes Registering 0s N20
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 63 / 201 (31.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 128 / 201 (63.7%)
Redcal Done? ❌
Never Flagged Antennas 73 / 201 (36.3%)
A Priori Good Antennas Flagged 54 / 96 total a priori good antennas:
3, 7, 9, 19, 21, 29, 30, 31, 37, 38, 45, 51,
53, 54, 55, 56, 59, 68, 71, 81, 84, 86, 93,
94, 101, 103, 108, 109, 111, 117, 121, 122,
123, 130, 136, 140, 142, 143, 158, 161, 164,
165, 167, 170, 181, 183, 184, 185, 186, 187,
189, 190, 191, 202
A Priori Bad Antennas Not Flagged 31 / 105 total a priori bad antennas:
4, 35, 43, 46, 48, 49, 61, 62, 64, 79, 82,
89, 90, 95, 115, 120, 125, 132, 137, 138, 139,
148, 149, 168, 207, 220, 221, 238, 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_2459898.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.629796 -0.534120 9.151693 0.231509 8.201751 0.830654 1.403947 4.696636 0.034695 0.667324 0.556389
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.493804 0.988848 2.126121 1.458290 1.564964 0.751830 -2.950019 -2.811431 0.668257 0.662566 0.407637
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.363794 -0.112305 -0.475815 -0.457298 -0.075005 1.087954 -0.256000 -0.343892 0.668659 0.668679 0.404750
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.935367 -0.705961 0.160558 0.283989 0.092513 1.706336 10.270807 21.047802 0.662160 0.668460 0.400698
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.299193 -1.239691 -0.757378 -0.363547 -0.546120 0.613617 7.043016 0.968094 0.654912 0.663537 0.392474
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.112084 0.226571 7.264261 -0.035449 2.179370 0.581957 1.151548 0.064480 0.511876 0.662419 0.463245
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.098761 -0.861942 -1.504173 -1.148201 -0.038457 0.373156 -0.100482 0.454875 0.646317 0.659270 0.408305
15 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.625241 -0.035170 0.022472 0.018187 -0.034524 0.881084 2.586367 1.060819 0.666552 0.674471 0.406166
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.937254 -0.875173 -0.722511 0.112774 0.824035 0.911135 0.922485 2.013809 0.668809 0.671403 0.399504
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.378166 0.777083 -0.286237 -0.183786 1.600192 0.920140 0.542094 1.429258 0.671902 0.677944 0.402015
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.942673 10.359291 -0.764021 0.037336 0.680403 1.268752 12.025925 20.566665 0.654747 0.454507 0.475105
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 2.131122 -1.224463 0.556399 -0.411799 1.073378 2.017609 13.765178 11.727534 0.655624 0.681258 0.401010
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.447868 -1.148354 3.155668 -1.742965 -0.438775 0.882317 1.392238 -0.811527 0.653333 0.683408 0.412018
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.132943 -0.037356 -0.535102 3.948701 1.282744 -0.244001 2.239346 0.794346 0.652929 0.636434 0.408486
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% 28.750664 8.055867 -0.790228 -1.020396 6.302474 4.085316 8.797632 3.572832 0.439864 0.596684 0.318621
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.485339 10.846931 9.182903 9.730693 8.285359 9.343693 3.737157 2.878513 0.032759 0.037465 0.005057
28 N01 RF_maintenance 100.00% 0.00% 84.79% 0.00% 12.339293 25.438943 0.880206 0.633712 5.249527 10.870497 7.481755 16.744759 0.359250 0.158940 0.259601
29 N01 digital_ok 100.00% 0.00% 100.00% 0.00% -1.167115 11.295670 -0.412308 9.346889 0.586109 9.307037 0.037336 0.752839 0.675962 0.035634 0.573756
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.201822 -0.628165 -1.014055 0.136154 0.908195 0.550013 14.280007 0.728971 0.675582 0.683698 0.391233
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.049779 -1.280599 0.798183 1.057325 1.748183 2.638702 5.274911 2.062946 0.682860 0.683287 0.396322
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.303299 21.327405 0.158919 1.995941 13.845890 6.038668 4.986511 6.835324 0.579661 0.575874 0.259780
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 11.303660 1.187604 3.877803 -0.719352 8.266111 3.796988 2.177967 2.014119 0.041281 0.653656 0.501912
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.456593 -0.061970 0.935412 -1.676900 -0.398026 -1.647916 0.301402 -0.181158 0.633978 0.634727 0.400109
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.604958 7.588663 -0.237246 0.034591 1.337745 1.928672 0.605881 2.203597 0.660389 0.670204 0.403192
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.117132 0.149993 -1.375259 0.343794 0.362926 1.176274 0.362805 16.349727 0.672330 0.681679 0.410484
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.007952 -0.029365 -0.220335 0.283173 1.070500 2.026597 9.427205 4.055551 0.675015 0.687335 0.410542
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.245397 0.477333 -0.289976 0.152225 -0.336961 0.719594 -0.403698 -0.192984 0.672014 0.680946 0.396398
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.156069 0.438433 -0.956462 -0.354095 1.479847 -0.376511 -0.351931 -0.115420 0.677841 0.682116 0.385664
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.130557 1.029327 -0.312932 0.582634 1.182464 0.264010 0.161714 0.396727 0.688322 0.687816 0.399815
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.530581 0.373014 -0.179019 0.167009 -1.061707 0.436040 -1.412971 0.985548 0.692304 0.690917 0.395295
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.530650 0.126123 -1.383766 0.122905 0.352938 0.783567 -0.157238 0.509717 0.688801 0.696965 0.394960
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -0.502886 1.733301 -0.167675 -0.043321 0.734341 2.732391 1.478154 7.881353 0.675665 0.675584 0.388701
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.943129 1.472015 1.010984 1.603891 0.399537 0.106369 0.698684 -1.982559 0.665914 0.695200 0.409399
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 10.560206 1.650330 3.700995 -1.611291 8.245255 -1.215317 2.111198 4.152888 0.038306 0.650626 0.491069
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.862389 1.166460 0.835264 1.059578 -0.829503 -0.190951 -0.857794 -2.366675 0.638139 0.665395 0.408414
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.082898 0.869940 -1.231322 0.921489 -1.266125 -0.767337 0.148963 -0.987386 0.606711 0.646988 0.403217
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.933430 3.102750 -0.301084 0.398698 0.613123 1.510275 2.198878 1.625928 0.642326 0.664808 0.389640
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 23.573489 0.603279 11.824181 -0.194521 8.424809 2.759274 13.896657 5.846866 0.037847 0.686086 0.546914
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.824062 6.280316 -0.685252 0.117799 0.686205 1.146184 1.807815 0.865690 0.677637 0.692905 0.397846
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.246292 2.487426 -0.531508 -0.274083 1.189476 0.897066 3.848385 9.668625 0.682690 0.696511 0.400090
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.696555 11.558538 9.188733 9.950019 8.294546 9.350387 4.080447 2.632367 0.043973 0.043593 0.001117
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.359948 12.303711 0.207809 9.864737 3.366941 9.342909 3.704064 4.972609 0.678564 0.035202 0.516958
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.295143 12.331116 -0.036914 10.051074 -0.005146 9.308330 0.391108 1.839161 0.682983 0.036582 0.529419
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 27.785466 -0.021802 5.304981 0.182797 3.228709 1.294257 8.918184 6.153406 0.480514 0.696270 0.398557
58 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.475428 11.202998 -0.821711 9.829420 -0.178449 9.330744 2.632050 2.420295 0.684635 0.036302 0.497019
59 N05 digital_ok 100.00% 100.00% 61.31% 0.00% 10.160451 10.813222 9.052489 9.754608 8.295059 8.620250 4.203544 2.940755 0.044074 0.214018 0.146436
60 N05 RF_maintenance 100.00% 0.00% 99.40% 0.00% -1.328980 11.102781 -0.205450 9.867968 -1.512238 9.307984 -0.853814 4.164670 0.685003 0.076497 0.539038
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.253824 1.912667 -1.304370 -0.084646 0.660606 -1.754346 -0.070917 3.482432 0.624488 0.633323 0.382976
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.870425 1.537675 0.095391 0.881931 -1.061686 -0.342846 -0.746588 -2.056131 0.638604 0.670555 0.397937
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.093935 11.478051 0.020096 4.360649 -0.753725 9.358878 1.134742 4.561758 0.621523 0.043417 0.475106
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.817242 0.169771 -1.154649 0.067373 -1.494832 -1.749742 -0.440390 -1.660289 0.598680 0.637116 0.403194
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.383202 1.088133 0.067707 0.582492 1.201078 2.054244 0.037207 1.034431 0.654982 0.682259 0.411542
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.096301 1.197306 1.639296 1.560725 2.778964 1.252598 -0.144487 1.492194 0.661592 0.683882 0.402135
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.138180 -0.785832 0.991419 0.902707 0.004216 0.507525 1.024752 3.721246 0.669555 0.689679 0.394886
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.863541 26.420451 0.186827 13.069349 0.526904 9.142095 -0.056360 12.950820 0.678584 0.031493 0.539020
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.010043 -0.412324 -0.070311 0.260162 -0.240573 2.044738 0.212449 2.626158 0.678849 0.697392 0.388185
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.542138 -0.364646 -0.829365 -0.454964 1.383838 1.112422 0.487181 0.504268 0.687706 0.702447 0.387840
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.133322 -0.281861 0.169427 0.706904 0.692874 0.856496 0.762539 2.047720 0.696256 0.703102 0.385272
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.034725 -0.032309 0.231341 0.676077 0.440958 0.616206 2.707982 0.803689 0.683929 0.697293 0.382091
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.090330 0.288830 -1.019121 2.163195 0.395897 15.225572 1.492916 3.106709 0.696886 0.691055 0.389347
74 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.929007 7.286186 -0.040541 -1.185884 -0.764725 6.345443 0.032877 12.794787 0.693256 0.683787 0.377166
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 22.524886 24.681795 0.124178 -0.903051 2.668254 2.991381 5.633626 1.385723 0.525771 0.494053 0.205574
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 30.408831 -0.582154 -0.431979 -0.376490 2.490197 -2.144229 -0.590940 0.662229 0.459294 0.653593 0.381779
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.539437 -0.450619 -0.818286 -1.152480 -1.569888 -1.540349 -0.965455 -0.731958 0.625850 0.654249 0.402249
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 8.799202 12.676411 2.258104 4.238478 6.410858 9.288524 20.177044 1.693233 0.298899 0.039378 0.202785
81 N07 digital_ok 100.00% 0.00% 0.00% 0.00% -0.629672 -0.816041 -0.679343 2.890978 -0.721247 24.501209 -0.356904 1.374894 0.634691 0.638822 0.391941
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.635923 -0.537944 -0.235639 1.506277 0.432204 -1.049251 -0.405327 -0.070343 0.648998 0.666159 0.393627
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.669882 -0.298025 -0.491021 -0.067718 -0.529116 -0.253489 -0.630278 0.312282 0.662875 0.684733 0.391304
84 N08 digital_ok 100.00% 34.85% 100.00% 0.00% 19.844206 23.350135 11.896002 12.631156 6.460297 9.074038 6.139206 6.818384 0.233567 0.036014 0.153831
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.187058 -0.197432 -0.565219 0.176862 -0.399654 -0.403356 -0.553667 -0.200991 0.678790 0.692519 0.386890
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.951791 -0.433526 0.835553 0.495365 4.419575 -0.866604 0.473059 15.129331 0.667481 0.691101 0.379702
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.337865 7.014480 0.905984 -0.344120 17.898605 2.638163 1.259623 2.075902 0.596052 0.709772 0.354607
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.098203 0.391116 -0.097888 0.533948 -0.806055 1.187954 1.394597 0.035110 0.681943 0.696980 0.374821
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.232978 0.167584 -0.339769 0.413863 -0.635058 0.016029 -0.631408 -0.281082 0.683670 0.696696 0.380848
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.571021 -0.567237 0.998663 0.771207 -0.674346 -0.922372 0.621007 3.097651 0.674212 0.689945 0.383044
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.688285 -0.203692 -0.166166 -0.095772 -0.681796 -0.337410 -0.003779 -0.151933 0.674552 0.696445 0.395145
92 N10 RF_maintenance 100.00% 0.00% 17.10% 0.00% 36.849734 44.058971 0.156047 0.605284 7.125749 9.345229 1.445931 13.562483 0.292283 0.242964 0.098386
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 1.723191 0.311671 1.688035 -0.111970 1.908678 0.639183 10.266317 -0.106957 0.659908 0.689375 0.404089
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 10.705887 -0.646774 9.312275 0.075050 8.220498 1.424378 1.513783 5.956991 0.032416 0.682187 0.462038
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.081152 -0.271471 -0.732603 0.672905 -0.288075 -1.038623 -1.209632 -1.143846 0.631884 0.671104 0.410361
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.795932 12.267520 3.689842 4.400274 8.135603 9.290660 1.729075 1.281220 0.033430 0.037376 0.002266
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.025043 3.709651 0.273940 -0.102555 -0.831367 -0.980564 -0.867867 16.447496 0.617623 0.602157 0.401648
98 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.723296 2.075878 -0.361726 -0.063795 0.195051 0.120943 -0.193956 2.006654 0.630684 0.655793 0.398606
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.352769 -0.787910 0.446731 0.434212 -1.170473 3.132621 2.943430 -0.250987 0.635105 0.669078 0.399542
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -1.260348 -0.767770 -1.010019 -0.025379 1.833970 -0.223919 0.950707 2.360630 0.654870 0.677454 0.390853
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.376827 6.886279 -0.916063 0.594372 0.098517 0.855294 0.017255 -0.202895 0.679337 0.694909 0.386904
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.261144 0.483486 -0.774227 1.756181 -0.410463 0.175296 -0.972273 11.918039 0.686407 0.689280 0.383558
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.384801 4.883742 3.770116 0.364050 2.078900 0.641291 13.221214 7.811160 0.659250 0.699663 0.384414
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.920782 58.056785 6.078861 6.725225 0.398730 6.286847 0.689049 1.932053 0.631221 0.673320 0.384920
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.245037 -0.505556 -0.460950 0.433270 0.487429 -0.177247 0.078084 -0.173289 0.687248 0.698462 0.374191
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.428693 0.133204 0.623880 0.694529 -0.627133 0.273881 1.328610 -0.311573 0.676423 0.695489 0.377161
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.457538 -0.178147 -1.395722 -0.927744 -0.720731 -0.661498 0.470449 2.938572 0.683092 0.699004 0.382516
108 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 9.755639 3.278735 9.119611 -0.604642 8.239963 -0.076392 2.878152 0.546141 0.039510 0.700715 0.489462
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -1.060845 11.228978 0.157699 9.619800 -0.074127 9.325400 -0.397235 2.724300 0.678587 0.035121 0.473092
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.325515 25.008769 -0.360356 12.781674 8.442334 9.043923 2.172681 6.204259 0.670249 0.031391 0.455555
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.010311 11.143763 0.054168 9.720976 0.187406 9.323328 -0.364914 3.258414 0.666066 0.035421 0.463760
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.499724 1.202093 -0.330625 -0.374716 -0.004216 0.887636 0.221496 -0.295905 0.654174 0.673472 0.407175
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.596006 12.302647 3.484587 4.302161 8.139941 9.288873 2.160260 1.135137 0.035272 0.030892 0.002793
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.254375 0.474894 0.862351 -0.497378 4.637429 -1.513033 2.922189 -0.690583 0.520110 0.644537 0.431863
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.226478 0.967953 2.242312 1.465749 1.807617 0.651577 -3.084422 -0.983533 0.613049 0.643454 0.421484
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.434475 0.041734 -0.474880 0.204335 0.363079 -0.131336 -0.169949 -0.103264 0.626197 0.651497 0.400232
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 10.617101 12.701138 9.213526 10.179473 8.173094 9.341826 2.004961 5.356116 0.027503 0.031606 0.002321
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.237654 1.248745 -0.564012 0.353848 -0.628605 0.508416 -0.153017 1.050395 0.652934 0.679362 0.393767
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.845341 1.980569 -1.743869 1.710911 -0.365328 6.035329 0.236052 4.255455 0.668055 0.666778 0.385601
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.385600 2.178510 2.060965 1.857578 0.645509 1.068379 3.306503 -3.031642 0.663205 0.696088 0.377437
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.952968 4.604096 -0.698944 0.585777 0.671512 0.996573 38.807650 16.148996 0.688324 0.704245 0.383865
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.041865 6.469288 -0.710879 0.300208 4.091148 1.056229 -0.236933 -0.365592 0.695493 0.707511 0.385212
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.150161 8.300566 0.045241 0.603676 0.942628 0.570252 -0.252465 0.752883 0.696452 0.710548 0.384717
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.924253 -0.188356 -0.491869 0.211231 -0.289474 0.178374 0.094980 0.777536 0.693192 0.709251 0.384759
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.136408 2.504335 -0.786897 0.413017 0.861701 1.815402 0.233955 1.111136 0.683897 0.694327 0.380921
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.487824 2.165207 -1.118038 0.875243 4.206909 -0.158160 2.379548 0.625174 0.683614 0.689727 0.389226
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.125653 -0.044265 -0.339614 -0.018187 2.358419 1.536832 0.109643 0.896112 0.681815 0.701984 0.401796
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.679100 0.292219 1.087358 0.607309 -0.277117 1.528207 -0.076921 0.026232 0.670733 0.693806 0.401713
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.792505 -1.592337 0.337724 0.633387 -0.023389 0.458593 -0.561574 0.156147 0.666238 0.689085 0.407628
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.437250 0.588508 -0.398598 -0.052552 -0.785152 0.566292 2.461371 5.689353 0.647126 0.679034 0.403092
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.665238 12.408477 3.733986 4.533602 8.220851 9.279076 3.829935 -0.010994 0.033941 0.039051 0.001733
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.139512 0.398956 0.121307 -1.336778 -0.702392 -1.269746 -1.688494 0.165552 0.618380 0.634136 0.409574
133 N11 not_connected 100.00% 100.00% 82.09% 0.00% 11.112551 16.645301 3.494796 3.043509 8.216273 8.897218 2.456139 1.350921 0.041298 0.177314 0.101857
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.892919 11.220749 -0.207914 9.929186 1.463667 9.330154 0.599287 2.414405 0.624063 0.037746 0.477622
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 4.391565 -0.240414 6.983955 4.618353 15.739827 32.162330 1.265477 2.748725 0.469577 0.610588 0.409812
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.138915 -0.706689 -0.657779 -0.499999 1.868443 3.822149 1.565176 1.883535 0.637109 0.666748 0.401472
138 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.742029 -0.462433 -0.186575 0.613861 0.025489 0.367256 1.357423 -0.257153 0.659083 0.681137 0.399765
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.635892 -0.530180 1.294457 -1.210803 -0.374417 -1.978358 -2.224105 -0.421961 0.663253 0.674774 0.384960
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.383984 3.165727 -0.053638 2.702884 -1.141723 3.361145 4.917104 -0.411011 0.676971 0.689730 0.378589
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.279839 -0.831546 -0.989955 0.390135 0.508692 -2.113806 0.387391 -1.803182 0.679897 0.702410 0.380986
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.920583 11.087537 -1.442415 9.873393 1.549045 9.316797 30.945464 3.033284 0.685149 0.045145 0.563106
143 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 9.886684 -0.373314 9.269345 0.013497 8.129384 1.114678 0.740990 -0.114701 0.036956 0.706037 0.563913
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.410916 -0.688678 -0.613537 3.137007 0.094903 -0.447214 -0.216302 0.133118 0.689256 0.687345 0.390344
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.204058 1.914306 -0.550899 6.356678 1.527521 17.940288 0.512601 3.490714 0.682834 0.623629 0.415361
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.227786 1.152016 -1.633162 0.747333 -0.071346 -1.324248 -0.002536 -2.247662 0.645552 0.693877 0.406617
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.805801 -1.392291 1.076907 1.783629 2.317238 -0.472850 0.304036 0.002536 0.668302 0.687290 0.394138
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.786458 -0.391639 2.716420 1.321827 -0.674635 0.192626 0.391379 0.304349 0.652638 0.689731 0.411925
149 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.753404 0.890422 -1.312580 1.523229 -1.138699 0.014276 1.012236 -1.966877 0.663597 0.686249 0.409445
150 N15 RF_maintenance 100.00% 100.00% 1.30% 0.00% 10.267634 -0.143497 9.177506 -1.107533 8.290646 0.283960 3.365208 0.246330 0.041405 0.268066 0.135974
155 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.578247 0.306093 -0.416610 6.368325 2.181993 29.757659 4.202350 1.931839 0.627000 0.558088 0.421347
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.182043 10.803997 -0.565250 9.602899 3.524201 9.309413 11.414805 1.084929 0.632747 0.039088 0.490944
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.098158 -0.233834 -0.110379 0.278991 0.073864 0.812985 -0.120806 0.390506 0.640664 0.664995 0.406429
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.450312 -0.513697 -0.999434 -1.102429 2.178938 1.706128 11.268624 29.269304 0.657290 0.678534 0.409419
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.020273 17.879625 -1.620917 -1.228749 -1.589464 7.950244 0.149782 5.509785 0.631647 0.587166 0.378867
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.697097 -1.062140 -0.780729 -1.172967 -0.121228 1.007326 1.306509 0.952458 0.669686 0.688656 0.388512
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.710246 28.436714 -0.612330 -0.749983 0.281852 0.337905 0.076700 0.704712 0.673958 0.567364 0.352718
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.184497 -0.344029 2.116631 0.999865 0.718259 -1.009452 -1.805985 -1.532750 0.683086 0.701303 0.381687
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.175795 0.942063 -0.680449 0.072820 0.066782 0.518540 0.258646 3.276243 0.688402 0.699599 0.391357
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.513686 0.052639 1.674561 -0.583229 15.770551 0.944271 2.786656 3.204195 0.671901 0.699742 0.395488
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 29.022537 -0.215419 1.929973 0.162072 2.535767 0.294947 2.269998 0.128453 0.514930 0.692020 0.392699
166 N14 RF_maintenance 100.00% 0.00% 100.00% 0.00% 29.649807 10.442469 0.028125 9.459555 1.694203 9.319807 1.366292 2.129884 0.535255 0.034462 0.364172
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.487792 -0.996627 -0.990366 0.787908 0.388013 0.634910 -0.857944 6.922467 0.684635 0.693661 0.403330
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.656905 -0.949000 -0.452251 -0.805344 1.379336 0.927390 -0.074033 2.120771 0.672041 0.695079 0.409028
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.970020 1.549947 -1.432040 -1.615182 0.446918 -1.573323 0.327695 -0.650298 0.667035 0.676099 0.408333
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.371656 -0.383605 9.330297 -1.025410 8.162752 0.861167 1.479188 7.891143 0.037041 0.681703 0.563340
179 N12 RF_maintenance 100.00% 100.00% 85.01% 0.00% 10.526652 11.649551 9.323166 10.223407 8.142540 8.692954 1.295716 1.895434 0.065109 0.150173 0.086977
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.960844 11.938959 9.253363 9.994009 8.166700 9.304884 1.172021 3.746133 0.047738 0.049994 0.003684
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.446745 -0.048820 -0.695893 0.118474 0.841669 0.984978 0.124535 8.273233 0.677390 0.686376 0.392852
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.030405 3.659232 -1.340778 2.852738 -0.717967 3.912604 28.487524 -1.590472 0.684029 0.682771 0.392729
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.556601 0.312941 0.427130 4.526388 1.176115 -2.210934 2.433733 0.977272 0.676676 0.646620 0.396915
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 9.922798 11.540056 9.257450 9.881026 8.258540 9.304049 1.899770 2.314316 0.026292 0.025474 0.001127
185 N14 digital_ok 100.00% 6.82% 0.00% 0.00% 7.982198 0.901737 8.624613 6.774747 7.637223 0.990766 1.462757 1.394994 0.284762 0.596530 0.439561
186 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 9.443676 1.423626 9.267172 1.841198 8.239103 0.446020 3.334086 -2.633390 0.044082 0.693043 0.538749
187 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 9.940791 1.471223 9.025606 1.479382 8.331928 0.252428 3.404133 -0.346917 0.043894 0.692273 0.544612
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 8.249285 8.902188 1.300309 -0.105965 3.209816 7.838382 0.908024 5.289089 0.345859 0.370965 0.177707
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 41.465455 11.312630 -0.455636 9.957135 3.399679 9.373977 4.976376 4.051985 0.478390 0.034357 0.369124
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.106655 0.124882 3.184922 -0.212893 -0.255931 0.333746 10.082677 0.908081 0.619758 0.664359 0.435422
200 N18 RF_maintenance 100.00% 100.00% 53.63% 0.00% 11.273405 34.840499 3.685254 0.425652 8.323265 9.271627 2.592618 -0.425421 0.047259 0.216435 0.152946
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.723752 5.582671 4.554203 3.779499 6.474915 6.368458 -4.766769 -4.285750 0.627797 0.645492 0.386249
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.553584 1.867862 0.600511 -0.436622 -1.253561 -0.693872 0.237475 6.236597 0.659278 0.631747 0.394847
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.782201 13.120766 3.455803 4.108264 8.253342 9.352652 3.564572 4.758846 0.034736 0.041878 0.001508
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.590985 2.382654 -0.052073 -0.845136 -1.694283 -0.804708 -0.905147 10.809621 0.652100 0.642780 0.400398
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.308115 0.341996 -0.908930 -1.183694 21.635537 -1.962896 -0.711781 5.252929 0.635392 0.649544 0.396652
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.253861 1.961778 1.182740 -0.854507 0.279996 -0.796921 -1.995819 -0.923837 0.633054 0.642400 0.382975
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
211 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
219 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.894730 3.871402 4.676639 2.997888 6.832205 4.462787 -5.030884 -3.453945 0.621111 0.651400 0.410071
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.185340 -0.853418 -0.144182 -0.490692 -1.843164 -1.768279 2.446044 -1.179904 0.651314 0.653288 0.399498
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.516507 -0.010043 -0.978934 -0.669669 -0.134333 -1.769041 2.809040 -0.314150 0.619274 0.657872 0.407312
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.603830 0.361805 0.523545 -0.623652 -0.615153 -2.570629 6.741962 -0.496354 0.651670 0.659666 0.405050
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.462701 1.442421 -1.687460 0.308248 -0.694712 -1.345653 -0.358641 5.855684 0.632594 0.662878 0.408976
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.881955 6.131185 4.727598 4.247888 6.860707 7.688422 -4.989627 -4.817818 0.624399 0.633935 0.402914
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 250.762215 250.856351 inf inf 5341.678916 5285.064138 9062.049574 8901.648946 nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
227 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
228 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
229 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 5.463420 1.394192 1.191310 -1.387045 1.257659 -1.592118 3.948979 -0.651947 0.524483 0.632451 0.440846
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.335595 -0.868786 1.007983 0.499331 -0.900717 -0.781359 -2.101736 -2.186081 0.649729 0.652516 0.413594
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.531808 2.365429 -0.079993 0.296160 -1.178976 -0.818010 0.079751 7.251661 0.639957 0.589153 0.421358
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
241 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
242 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
243 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
245 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
246 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
261 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.451757 12.212142 -0.739013 6.393666 -0.624823 9.339592 7.202004 5.190729 0.645182 0.046930 0.547495
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.895224 1.960952 0.910572 1.168395 -0.141785 -0.085938 -0.947530 -1.873827 0.539555 0.549267 0.399397
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.464536 -1.313720 1.055671 -1.507374 -0.045940 -0.110522 -1.963281 0.415059 0.574618 0.564702 0.412667
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.826172 -0.842919 -1.615932 -1.163907 -0.880133 -0.654323 2.807870 -0.052386 0.507152 0.553172 0.402339
333 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.321073 0.633224 -1.158046 -1.675349 -1.454584 -0.370941 4.657455 0.300216 0.502090 0.543856 0.399215
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 7, 8, 9, 18, 19, 21, 22, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 45, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 73, 74, 77, 78, 80, 81, 84, 86, 87, 92, 93, 94, 96, 97, 101, 102, 103, 104, 108, 109, 110, 111, 113, 114, 117, 119, 121, 122, 123, 126, 130, 131, 133, 135, 136, 140, 142, 143, 145, 150, 155, 156, 158, 159, 161, 164, 165, 166, 167, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 202, 203, 205, 206, 208, 209, 210, 211, 219, 222, 223, 224, 225, 226, 227, 228, 229, 237, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 333]

unflagged_ants: [4, 5, 10, 15, 16, 17, 20, 35, 40, 41, 42, 43, 44, 46, 48, 49, 61, 62, 64, 65, 66, 67, 69, 70, 72, 79, 82, 83, 85, 88, 89, 90, 91, 95, 98, 99, 100, 105, 106, 107, 112, 115, 116, 118, 120, 124, 125, 127, 128, 129, 132, 137, 138, 139, 141, 144, 146, 147, 148, 149, 157, 160, 162, 163, 168, 169, 207, 220, 221, 238, 324, 325, 329]

golden_ants: [5, 10, 15, 16, 17, 20, 40, 41, 42, 44, 65, 66, 67, 69, 70, 72, 83, 85, 88, 91, 98, 99, 100, 105, 106, 107, 112, 116, 118, 124, 127, 128, 129, 141, 144, 146, 147, 157, 160, 162, 163, 169]
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_2459898.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.dev4+g1a49ae0
3.1.5.dev171+gc8e6162
In [ ]: