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 = "2459900"
data_path = "/mnt/sn1/2459900"
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-16-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/2459900/zen.2459900.25289.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 889 ant_metrics files matching glob /mnt/sn1/2459900/zen.2459900.?????.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/2459900/zen.2459900.?????.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 2459900
Date 11-16-2022
LST Range 23.216 -- 9.169 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 889
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 7
dish_ok: 1
RF_maintenance: 52
RF_ok: 19
digital_ok: 98
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 64 / 201 (31.8%)
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 58 / 98 total a priori good antennas:
3, 7, 9, 15, 19, 21, 29, 30, 37, 38, 42, 51,
53, 54, 55, 56, 59, 66, 68, 71, 72, 81, 84,
86, 93, 94, 98, 101, 103, 107, 108, 109, 111,
117, 121, 122, 123, 127, 136, 142, 143, 155,
158, 161, 164, 165, 170, 181, 182, 183, 184,
185, 186, 187, 189, 190, 191, 202
A Priori Bad Antennas Not Flagged 33 / 103 total a priori bad antennas:
8, 35, 43, 48, 49, 61, 62, 64, 74, 79, 82,
89, 95, 115, 120, 125, 132, 137, 138, 139,
148, 149, 168, 207, 220, 221, 222, 223, 238,
324, 325, 329, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459900.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% 10.890187 -0.142363 9.654534 0.304602 8.999499 0.463577 0.691835 3.066579 0.034963 0.615051 0.506037
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.114274 1.451953 1.559507 0.584725 8.292052 7.663594 28.848526 30.861026 0.618403 0.612124 0.351017
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.014768 0.032864 -0.329665 -0.363289 0.341481 1.563147 0.468125 -0.101031 0.619590 0.618015 0.348066
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.862466 -0.458521 0.762121 2.571873 -0.162117 0.343923 12.870226 14.717956 0.608191 0.606578 0.340965
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.579276 -1.250847 -0.962634 -0.367095 -0.026707 0.443702 3.346822 2.540415 0.608794 0.612536 0.340334
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.243058 0.309260 7.949680 0.028098 5.898426 -0.145298 0.109574 -0.390918 0.430819 0.605193 0.399314
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.478669 -0.379567 -1.170879 -0.761434 -0.245742 1.740597 2.318642 0.457280 0.587080 0.600717 0.342915
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 5.656917 7.188006 7.506683 8.564211 17.099970 11.403023 1.462588 4.814654 0.427872 0.403069 0.251578
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.216883 -1.545651 -0.537084 0.225138 2.934859 2.497208 0.770131 1.143187 0.624566 0.625660 0.348336
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.584100 0.892079 -0.147001 -0.135979 1.257987 0.669535 2.649459 1.595630 0.620887 0.630323 0.349025
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.185023 10.451201 -0.558195 0.212286 1.219894 2.589975 14.214080 27.605743 0.610183 0.407019 0.418346
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.196286 -1.122951 0.776951 1.076674 0.080809 2.078472 7.136792 6.249695 0.610495 0.625901 0.337006
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.491130 -1.140753 3.376458 -1.533218 1.059634 -0.779314 0.582718 -0.970341 0.596647 0.631492 0.347695
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.101364 -0.320714 -0.380722 4.118370 1.999409 1.024356 0.196376 0.064893 0.596358 0.583764 0.341946
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% 31.793991 10.037606 -0.786306 -0.864544 9.835950 6.425327 18.805050 17.130415 0.396282 0.540083 0.279722
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.729643 13.443399 9.677609 10.261509 9.225999 7.876621 2.398837 1.823300 0.033519 0.038131 0.004709
28 N01 RF_maintenance 100.00% 0.00% 94.71% 0.00% 12.488570 27.919202 1.378818 1.157943 1.994745 4.340025 4.327050 18.000216 0.303591 0.132749 0.205293
29 N01 digital_ok 100.00% 0.00% 100.00% 0.00% -1.342010 13.931772 -0.270704 9.868346 0.696886 7.855665 -0.423099 0.312539 0.627886 0.037219 0.534708
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.773209 -0.022886 -0.814369 0.210686 1.142076 -0.484113 8.354300 0.116908 0.624471 0.638058 0.334830
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.037532 -0.935564 0.930915 0.951367 2.081375 1.629874 2.161356 1.034936 0.631578 0.638199 0.334576
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.713118 23.938647 -0.080415 2.180356 14.352429 9.589611 2.534929 9.123658 0.579012 0.536067 0.286825
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 12.699940 1.631513 4.291224 -0.321806 9.124874 1.054258 0.716048 0.934190 0.044439 0.603735 0.450256
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.037867 -0.017236 0.387768 -1.328737 -0.220099 0.095019 -0.199519 0.318515 0.573076 0.580322 0.332128
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.959244 8.976191 -0.178753 0.067939 0.499205 2.405924 1.471634 3.454859 0.603305 0.622765 0.341331
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.566717 0.233590 -1.629301 1.026804 1.594163 1.705397 -0.754588 8.336635 0.617082 0.633425 0.348777
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.139435 0.098145 -0.178241 0.247790 0.124626 -0.646651 5.490561 1.271958 0.622324 0.642105 0.351218
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.300092 0.734480 -0.191835 0.220790 -0.618289 0.081418 -0.620419 0.677536 0.620353 0.634667 0.339700
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.490056 0.289398 -0.785879 -0.258750 2.919189 0.109855 -0.671445 0.349581 0.627119 0.636972 0.336822
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.666677 14.469827 9.895080 10.712626 8.791369 7.517121 0.310148 1.212083 0.035671 0.033262 0.001128
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.654996 0.477861 -0.191693 0.239990 -0.982892 0.577982 -1.626698 0.227162 0.641651 0.646207 0.337881
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.744124 0.513202 -1.384553 0.172580 -0.712770 0.376904 -1.061766 -0.481368 0.634787 0.650682 0.336881
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.399022 1.225956 -0.072117 0.105699 -0.422976 3.395789 -0.107688 3.769616 0.625264 0.634526 0.330306
46 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.974123 1.711552 1.042187 1.585533 2.265953 0.116805 4.684868 -0.287287 0.611040 0.646843 0.342352
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 11.785763 1.664595 4.114865 -1.637239 9.059525 -1.335062 0.769389 4.257382 0.038573 0.601434 0.434555
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.123029 1.497050 0.702470 0.803805 -0.902531 -0.838957 -1.441852 -1.645807 0.579945 0.615044 0.343730
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.109880 1.291970 -1.343504 0.850898 -0.978161 -0.729852 -0.227207 -1.154588 0.548205 0.598450 0.340328
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.931319 0.508529 0.229120 0.474735 7.728994 1.613093 35.897458 1.639733 0.544922 0.625003 0.324303
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 25.704798 0.791218 12.338102 -0.094043 9.524405 4.013411 8.831495 5.260860 0.042826 0.641543 0.510510
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.276801 6.805770 -0.659802 0.169232 -0.008001 1.092732 0.251053 0.246081 0.624899 0.649932 0.338319
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.390079 2.886810 -0.396676 -0.205980 2.544070 2.578724 2.291207 5.634395 0.634177 0.656602 0.340474
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.940082 14.187759 9.687227 10.486618 9.099603 7.756965 1.732250 0.893257 0.033765 0.033146 0.001324
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.713336 14.900780 0.361998 10.393932 2.702203 7.806901 2.563258 2.617446 0.626835 0.035227 0.476431
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.131730 15.012314 0.063181 10.593443 -0.169024 7.646205 1.298077 0.808203 0.630208 0.039332 0.491265
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 29.195723 0.330231 5.580525 0.266340 5.109349 0.092367 7.432355 1.810896 0.444438 0.653989 0.359075
58 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.738256 13.803051 -0.755146 10.366364 -0.689839 7.727714 1.005977 0.932544 0.634513 0.037034 0.456280
59 N05 digital_ok 100.00% 100.00% 72.44% 0.00% 11.586720 13.174004 9.609759 10.278505 8.763594 6.933603 0.338105 0.919943 0.045750 0.198276 0.125472
60 N05 RF_maintenance 100.00% 0.00% 96.06% 0.00% -1.420377 13.751264 -0.263064 10.399471 -1.378907 7.782199 -1.403131 2.542950 0.633604 0.080941 0.479256
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.935171 2.168601 -1.353428 0.051322 3.167411 -1.510802 0.061625 3.042372 0.572681 0.589411 0.318416
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.713830 1.769764 -0.045770 0.777993 -0.996541 -0.666210 -0.067683 -1.804426 0.577779 0.620251 0.335416
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.130228 14.144737 -0.064233 4.802644 0.114167 7.896641 0.049077 2.624073 0.562848 0.045982 0.414617
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.893724 0.498331 -1.288250 0.002499 -0.234294 -1.534853 1.112366 -1.231622 0.536530 0.586512 0.335371
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.268221 1.337548 0.086210 0.591525 0.117733 2.093529 0.854346 0.496914 0.601726 0.641534 0.351108
66 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.326486 1.410550 1.822116 1.596606 3.960479 0.241221 -0.344060 1.332805 0.611352 0.645271 0.343804
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.028537 -0.912233 1.082394 0.990516 -0.754439 -0.258344 0.409135 1.673798 0.620263 0.650157 0.335200
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 1.162370 30.206633 0.299219 13.634151 -0.136368 7.917583 0.496228 8.890970 0.632647 0.033058 0.503088
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.293354 -0.259702 0.021579 0.345035 -0.611194 2.106718 -0.313744 0.255346 0.630579 0.659643 0.331354
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.748153 -0.260319 -0.687743 -0.359066 1.695037 1.839865 -0.275506 -0.337759 0.638953 0.664203 0.334270
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.380401 -0.116670 0.243323 0.743260 1.198212 0.108062 0.319832 0.776565 0.645364 0.662928 0.331437
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 2.478614 -0.081809 0.355418 0.724129 0.088800 -0.245363 4.603053 0.876600 0.637151 0.660820 0.328997
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.291972 1.033956 -1.123328 1.751755 1.019431 10.898142 -0.725715 0.201913 0.648506 0.655791 0.333035
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.315511 2.047020 -0.125073 -1.028801 -0.090853 2.465716 -1.244258 2.401624 0.642358 0.653322 0.331518
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 23.029181 26.918168 -0.039390 -0.702351 2.570530 0.931499 7.851509 4.197269 0.478394 0.458154 0.182881
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 32.256524 -0.570751 -0.552611 -0.421691 1.166132 -1.872310 1.294933 0.049096 0.408924 0.606080 0.329429
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.586492 -0.555088 -0.942986 -1.255962 -0.113544 -0.182378 -0.244222 -0.646703 0.568720 0.609989 0.337918
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 9.138611 15.479982 2.005147 4.687908 4.507950 7.699317 11.905995 0.951353 0.266262 0.040407 0.172259
81 N07 digital_ok 100.00% 0.00% 0.00% 0.00% -0.558792 -0.100754 -0.520449 1.004039 -0.040446 36.720584 -0.385914 0.399069 0.581717 0.621244 0.340414
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.656064 -0.314300 -0.102362 1.638534 0.598452 -0.112798 -0.612240 0.045029 0.599552 0.629018 0.334434
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.496878 -0.117198 -0.342547 0.018401 -0.007303 0.263038 -0.702250 0.506173 0.614272 0.648930 0.334067
84 N08 digital_ok 100.00% 40.27% 100.00% 0.00% 21.238675 26.888500 12.407255 13.205140 7.255866 7.769065 3.926553 4.847495 0.210883 0.036002 0.130032
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.182678 0.184762 -0.418592 0.300605 -0.522893 -0.198974 -0.653138 1.619848 0.634714 0.657668 0.327786
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.342792 -0.398254 1.548134 1.238747 5.344062 -0.783321 0.094325 16.423683 0.623899 0.657474 0.325994
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.064792 6.255696 0.467911 -0.499953 21.629484 1.672926 16.740524 7.616030 0.596091 0.672772 0.323233
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.181143 0.553547 0.066110 0.580603 0.096763 0.596627 1.466964 0.304181 0.634660 0.664186 0.324785
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.272947 0.372609 -0.221495 0.515178 -0.962412 -0.821340 -0.661751 -0.256788 0.637979 0.664298 0.329817
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.575887 -0.741464 1.205610 0.905975 -0.049257 -0.650447 0.150727 4.124408 0.623548 0.653544 0.329151
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.407583 -0.016392 -0.021526 -0.032301 -0.757950 0.139866 -0.103457 -0.105666 0.627313 0.659304 0.338272
92 N10 RF_maintenance 100.00% 0.00% 31.72% 0.00% 39.566145 48.101515 0.526744 1.116067 3.456691 1.855674 1.426112 11.830912 0.269321 0.222917 0.069420
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 1.746661 0.606623 1.842232 0.014194 -0.392838 1.370497 4.694397 -0.200855 0.608433 0.648644 0.346920
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 11.958529 -0.624255 9.822841 -0.577174 9.111117 1.060928 0.724851 2.665163 0.033520 0.641239 0.423031
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.166254 -0.082981 -0.886851 0.599793 0.531889 -0.896622 0.254596 -0.152249 0.573205 0.630227 0.351571
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.173595 15.002830 4.112304 4.860751 8.828788 7.537154 0.912528 0.677679 0.033246 0.037553 0.002474
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.012873 3.618456 0.171096 0.057618 -0.719812 0.138387 -1.421571 10.504900 0.559976 0.564434 0.328669
98 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 1.437514 5.896159 -0.262458 -0.054762 -0.088333 2.109520 0.367048 4.026279 0.575792 0.613251 0.337795
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.324749 -0.718975 0.609078 0.425755 -0.084854 2.879291 2.304915 -0.425682 0.582582 0.632260 0.343650
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -1.386493 -0.699321 -0.170223 0.712862 2.309625 -0.551237 0.907685 2.345147 0.605916 0.641621 0.334457
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.599398 7.862690 -0.817151 0.682331 0.351310 1.446732 0.009599 -0.045814 0.630441 0.658477 0.331438
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.499102 0.649103 -0.850049 1.842840 0.981877 -0.044386 -0.678378 6.765556 0.639421 0.655037 0.325320
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.640912 5.354331 4.018538 0.466418 6.554435 2.060151 5.942609 4.754169 0.614107 0.667400 0.335335
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.094049 63.953695 6.356754 6.736783 2.907891 6.535547 0.555319 4.613076 0.584864 0.643020 0.332831
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.095617 -0.209950 -0.273177 0.527944 2.270868 -0.813014 -0.376019 -0.197192 0.638792 0.663409 0.321973
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.640950 0.340228 0.755684 0.752812 -0.200266 -0.148672 0.173725 -0.078925 0.631396 0.664093 0.326360
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.972877 0.581662 -0.687160 -0.291834 0.678744 0.036852 3.739831 5.310581 0.638050 0.665439 0.326912
108 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 11.054480 3.951451 9.615148 -0.504260 9.137878 0.514290 1.690947 -0.146853 0.042249 0.667005 0.449201
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -1.035680 13.841916 0.249267 10.145760 -0.420120 7.898158 4.414207 1.622928 0.622969 0.036936 0.423861
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 7.703070 28.554064 0.189366 13.357268 13.756810 7.699551 6.622866 4.469808 0.600547 0.032268 0.391434
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.193383 13.807650 0.209191 10.267650 0.390974 7.949662 0.122850 2.135130 0.609404 0.036947 0.414068
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.558841 0.754009 -0.213600 -0.247638 0.240237 2.306279 0.066761 -0.280617 0.597583 0.632059 0.346699
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.002075 15.058634 3.901452 4.757467 8.876606 7.599547 1.298411 0.561469 0.035607 0.030883 0.002969
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.415220 0.382212 0.967749 -0.617413 8.486760 -0.149063 2.293651 -0.677791 0.471892 0.602679 0.368934
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.925836 1.457994 2.121706 1.357312 2.348191 -0.323215 -2.532432 -1.265854 0.551946 0.599352 0.359530
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.023855 -0.054676 -0.469905 0.290014 1.070289 0.921639 1.891717 2.529146 0.567504 0.608435 0.341770
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 11.836014 15.429113 9.719874 10.720682 8.898981 7.739975 1.124333 3.375511 0.027462 0.031412 0.002268
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.427674 0.890750 -0.506768 0.363305 -0.202788 -0.551242 1.502321 2.683606 0.602643 0.641712 0.340922
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.836903 0.875794 -1.085498 2.152448 1.192716 12.111442 0.465990 3.052083 0.615405 0.634255 0.323105
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.801432 2.654880 2.246285 1.765588 -0.287449 0.622402 1.223979 -2.215870 0.618426 0.660805 0.328077
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.873615 4.553397 -0.640113 0.843414 1.004119 2.168726 22.002252 15.117789 0.639916 0.668336 0.329541
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.349354 7.055250 -0.745102 0.395463 1.382739 1.915595 -0.292880 -0.457130 0.648123 0.671744 0.330277
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.582860 9.026998 0.182989 0.649517 1.198624 0.832988 -0.530208 0.060873 0.648758 0.676325 0.331154
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.963356 -0.280613 -0.423988 0.268979 -0.501213 0.627968 0.318932 0.691034 0.646535 0.676335 0.332775
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.172877 -0.370731 -0.711339 0.515444 -0.061390 0.206184 0.393348 0.477956 0.639742 0.664018 0.330771
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.170218 4.476699 -1.057796 1.184290 7.087998 0.519026 3.979980 1.761047 0.621421 0.655430 0.331626
127 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.317475 0.333987 -0.160700 0.036503 3.823011 2.785967 0.680945 4.896652 0.631349 0.665057 0.343732
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.614701 0.014768 1.228474 0.772886 -0.763534 2.876197 -0.438890 0.678601 0.621082 0.656789 0.344567
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.893875 -1.609781 0.452484 0.660724 -0.603261 -0.148096 -0.250486 0.454066 0.614907 0.650135 0.349030
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.247260 0.535147 -0.273172 0.049423 -0.465153 1.745208 1.290016 2.942209 0.594601 0.638704 0.347783
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.975011 15.190420 4.147058 4.983644 9.112921 7.776536 2.841021 -0.251440 0.033703 0.039335 0.001956
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.124429 0.372408 0.012502 -1.246322 -0.254384 -0.711949 -0.584245 -0.044156 0.559842 0.591859 0.343948
133 N11 not_connected 100.00% 100.00% 92.91% 0.00% 12.414776 18.866831 3.904936 3.512331 9.059137 4.771880 1.448199 1.150087 0.042181 0.156921 0.079578
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.780825 13.838034 -0.079709 10.470982 0.373322 7.651044 -0.226268 1.215121 0.567376 0.040171 0.423609
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 5.021306 -0.546012 7.414029 4.303260 16.463483 25.678651 0.124977 0.880005 0.416920 0.581032 0.361637
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.043261 -0.644239 -0.472179 -0.514008 3.499072 3.668434 0.423562 1.089738 0.583953 0.625942 0.344620
138 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.861225 -0.247514 0.607616 1.295266 0.264935 -0.342546 1.275138 -0.148753 0.605095 0.639004 0.341121
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.881492 -0.915273 1.204730 -1.187417 0.407789 -1.372643 -1.502759 -0.159593 0.612765 0.635116 0.325696
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.414073 3.886545 -0.095336 2.597993 -0.571890 3.462006 2.660197 -1.497952 0.635579 0.652448 0.324377
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.318038 -0.569806 -0.862163 0.368638 1.488020 -1.451375 -0.192011 -1.624513 0.634674 0.664567 0.327498
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 1.380206 13.678952 -1.309040 10.405501 2.661068 7.804276 20.114853 1.738151 0.639378 0.048515 0.520233
143 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.172864 -0.093493 9.782075 0.091652 8.749228 2.492206 0.058532 -0.409110 0.039171 0.671009 0.533480
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.294885 -0.535963 -0.503874 3.311081 1.727256 0.679446 -0.548486 -0.191471 0.642508 0.651589 0.329931
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.218543 2.345066 -0.565018 6.433977 1.630387 17.112047 -0.158258 2.077404 0.638410 0.595740 0.351312
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.113182 1.459163 -1.445085 0.688898 0.438335 -0.920086 0.321857 -1.798308 0.591319 0.653275 0.349621
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.693985 -1.347146 1.106279 1.869244 2.355655 -0.174602 -0.141831 0.045572 0.621176 0.650385 0.334648
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.844698 -0.044337 2.881505 1.408476 -0.162397 1.886658 -0.023828 -0.278442 0.598844 0.649050 0.353343
149 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.925079 1.147676 -1.369037 1.406794 -0.562903 -0.570599 0.100960 -1.813248 0.611588 0.645931 0.351476
150 N15 RF_maintenance 100.00% 100.00% 2.25% 0.00% 11.618653 -0.846466 9.678106 -1.057518 9.160566 2.468061 1.908292 -0.300303 0.044183 0.282480 0.157403
155 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.478430 0.002824 -0.283676 6.286072 0.422086 31.006533 1.566401 1.265828 0.566630 0.523298 0.351532
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.314654 13.375053 -0.178649 10.131307 14.200022 7.836793 4.024612 0.537527 0.574169 0.040730 0.438027
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.498537 0.106161 -0.002499 0.330365 -0.385910 0.687546 -0.435886 0.017319 0.581316 0.615728 0.349751
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.324359 -0.220145 -0.846010 -1.043857 2.874916 1.555697 4.520090 18.048614 0.604600 0.631575 0.347375
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.474531 23.951372 -1.709360 -1.104126 -0.893384 8.940257 -0.443982 23.799981 0.581222 0.511281 0.309490
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.481692 -1.014655 -0.676966 -1.066532 -0.322853 1.738216 0.358428 0.719000 0.625958 0.650235 0.334273
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.653343 32.283088 -0.523329 -0.728571 0.710815 -0.206142 -0.487551 0.538463 0.630491 0.536684 0.305418
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 2.287720 -0.020135 1.972782 0.929236 0.007303 -1.454024 -1.224231 -1.525554 0.634541 0.658376 0.329615
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.476301 1.362045 -0.584384 0.106213 0.198620 1.271856 0.346438 1.673460 0.641529 0.658045 0.331536
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.380781 0.420518 1.714194 -0.541463 16.464658 1.954813 1.595350 1.183882 0.623061 0.658706 0.338147
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 30.350474 0.228503 2.162166 0.211839 4.545137 0.406835 0.849077 -0.256961 0.472076 0.652430 0.340739
166 N14 RF_maintenance 100.00% 0.00% 100.00% 0.00% 30.407162 12.804914 -0.359227 9.487332 2.821223 7.804742 7.527966 0.821396 0.493185 0.036249 0.330123
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.777040 -0.764483 -1.054922 0.837323 1.945493 0.100488 -1.131548 3.896698 0.633242 0.654630 0.344125
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.728443 -0.925280 -0.296628 -0.739350 2.947416 1.019400 -0.446345 1.142342 0.621980 0.655421 0.348338
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.091888 0.861281 -1.309238 -1.644415 0.694549 -0.547903 -0.707099 -0.993700 0.618088 0.637143 0.346593
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 11.649351 -0.259008 9.841488 -1.106703 8.849466 7.941495 0.710080 3.927063 0.039114 0.640875 0.525571
179 N12 RF_maintenance 100.00% 100.00% 93.25% 0.00% 11.723729 14.028537 9.836397 10.749949 8.592407 6.365271 0.472831 1.060064 0.068361 0.150835 0.078681
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.315062 14.679317 0.365558 10.536806 1.165872 7.673233 20.905610 2.169586 0.609375 0.053930 0.505920
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.755728 0.176407 -0.589476 0.106108 1.488487 0.346570 -0.504220 5.717699 0.625474 0.638125 0.331833
182 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.018722 4.385097 -1.401885 2.730539 0.339261 2.852450 13.658174 -1.737338 0.636369 0.632926 0.333352
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.027804 1.030319 1.264366 5.259897 1.385907 -0.737123 1.600124 0.799370 0.622590 0.593677 0.330950
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 11.193073 14.162015 9.756966 10.414323 9.122065 7.807206 0.630354 0.947378 0.026404 0.025242 0.001258
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 8.831418 0.944722 9.031475 7.006243 9.591932 0.863796 -0.008124 0.220139 0.269783 0.556665 0.378699
186 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 10.567049 2.034751 9.766262 1.784212 9.082559 0.703927 1.984415 -2.365577 0.049134 0.644243 0.490858
187 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.293942 1.748262 9.513884 1.395109 9.318634 -0.278375 2.078124 -0.424822 0.048415 0.649993 0.502123
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 8.289149 8.936631 1.653028 0.371704 2.624205 4.497500 1.123449 3.237133 0.298937 0.319841 0.131249
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 46.356441 13.981355 -0.320351 10.502345 10.607813 7.672581 57.650811 2.667004 0.402141 0.035820 0.306774
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.271834 0.233684 3.365328 -0.168390 0.147238 0.020692 11.183163 0.456541 0.565783 0.620580 0.373026
200 N18 RF_maintenance 100.00% 100.00% 70.42% 0.00% 12.705610 39.047771 4.087490 0.198860 9.311343 3.988008 1.672707 -0.783352 0.047542 0.190209 0.126996
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.399202 6.748059 4.384336 3.603529 7.225993 5.140970 -3.914820 -3.406343 0.569749 0.586368 0.328309
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.893656 1.835525 0.519231 -0.269022 -0.433002 -0.033562 -0.573957 4.452695 0.609433 0.583712 0.341800
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.235575 2.441342 0.365714 -1.319465 -0.898009 0.420550 -1.214723 5.912911 0.597851 0.593025 0.342185
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.552315 0.380693 -0.357031 -1.202246 24.999563 -1.326054 0.121497 3.286499 0.587930 0.600426 0.341445
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.994058 2.019636 1.068647 -0.974677 0.385890 0.450335 -1.324124 -0.906208 0.576282 0.593851 0.328295
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% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.141026 -0.904764 -0.225093 -0.532085 -1.367677 -1.520968 3.058633 -0.666148 0.595042 0.594505 0.340484
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.455629 -0.133806 -0.784266 -0.672016 0.536461 -0.936672 1.568696 -0.598387 0.564123 0.601328 0.344457
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.705241 0.507841 0.403128 -0.651452 -0.749095 -1.781026 3.708052 -0.778250 0.595599 0.601898 0.346958
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.477363 1.608123 -1.706013 0.313199 -0.753210 -1.258667 -0.058967 3.734087 0.575004 0.604197 0.347753
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.488978 7.290325 4.547420 4.050526 7.402512 5.851105 -4.021615 -3.880696 0.562874 0.572769 0.338380
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 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.675056 1.539774 1.471459 -1.464361 1.948433 -0.133594 1.733157 -0.337768 0.457184 0.562727 0.372880
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.242456 -0.331814 1.315686 0.825096 -0.035303 -1.523837 -2.101789 -1.978400 0.590015 0.585602 0.357480
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.347105 2.633741 0.066600 0.481550 -0.804599 -1.425725 -0.104097 4.344320 0.586127 0.526069 0.367622
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.451343 14.948781 -0.600858 6.866232 0.210391 7.884006 7.611985 2.683640 0.591870 0.049247 0.494668
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.090908 2.648176 0.915470 1.142890 1.880426 1.263186 0.179971 -1.271626 0.486864 0.492804 0.340956
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.992904 -1.321782 0.987008 -1.494584 1.171984 0.390777 -1.776346 -0.017319 0.517371 0.497908 0.355314
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.627474 -1.370449 -1.531402 -1.075799 -0.019384 0.129566 3.496478 0.277383 0.454737 0.502182 0.343722
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.089181 -0.051184 -1.049647 -1.638048 -0.649941 -0.162879 1.025715 0.209652 0.441858 0.483358 0.332875
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, 7, 9, 15, 18, 19, 21, 22, 27, 28, 29, 30, 32, 34, 36, 37, 38, 42, 46, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 68, 71, 72, 73, 77, 78, 80, 81, 84, 86, 87, 90, 92, 93, 94, 96, 97, 98, 101, 102, 103, 104, 107, 108, 109, 110, 111, 113, 114, 117, 119, 121, 122, 123, 126, 127, 131, 133, 135, 136, 142, 143, 145, 150, 155, 156, 158, 159, 161, 164, 165, 166, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 202, 203, 205, 206, 208, 209, 210, 211, 219, 224, 225, 226, 227, 228, 229, 237, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320]

unflagged_ants: [5, 8, 10, 16, 17, 20, 31, 35, 40, 41, 43, 44, 45, 48, 49, 61, 62, 64, 65, 67, 69, 70, 74, 79, 82, 83, 85, 88, 89, 91, 95, 99, 100, 105, 106, 112, 115, 116, 118, 120, 124, 125, 128, 129, 130, 132, 137, 138, 139, 140, 141, 144, 146, 147, 148, 149, 157, 160, 162, 163, 167, 168, 169, 207, 220, 221, 222, 223, 238, 324, 325, 329, 333]

golden_ants: [5, 10, 16, 17, 20, 31, 40, 41, 44, 45, 65, 67, 69, 70, 83, 85, 88, 91, 99, 100, 105, 106, 112, 116, 118, 124, 128, 129, 130, 140, 141, 144, 146, 147, 157, 160, 162, 163, 167, 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_2459900.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 [ ]: