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 = "2459897"
data_path = "/mnt/sn1/2459897"
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-13-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/2459897/zen.2459897.25283.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1849 ant_metrics files matching glob /mnt/sn1/2459897/zen.2459897.?????.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/2459897/zen.2459897.?????.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 2459897
Date 11-13-2022
LST Range 23.017 -- 8.969 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1849
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 N05, N07, N14
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 91 / 201 (45.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 134 / 201 (66.7%)
Redcal Done? ❌
Never Flagged Antennas 51 / 201 (25.4%)
A Priori Good Antennas Flagged 68 / 96 total a priori good antennas:
3, 7, 9, 16, 19, 21, 29, 30, 31, 37, 38, 44,
45, 51, 53, 54, 55, 56, 59, 68, 71, 72, 81,
83, 84, 86, 93, 94, 98, 99, 100, 101, 103,
107, 108, 109, 111, 116, 117, 118, 121, 122,
123, 130, 136, 140, 142, 143, 144, 146, 158,
161, 162, 163, 164, 165, 167, 170, 181, 183,
184, 185, 186, 187, 189, 190, 191, 202
A Priori Bad Antennas Not Flagged 23 / 105 total a priori bad antennas:
48, 49, 62, 64, 79, 89, 95, 115, 120, 125,
132, 139, 148, 149, 168, 220, 221, 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_2459897.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.433298 -0.485478 9.175304 0.333308 9.417381 0.476345 1.285874 3.051625 0.032663 0.667088 0.456544
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.960329 1.081744 2.208060 0.793229 4.869568 16.245073 4.938082 8.090713 0.672774 0.665186 0.406276
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.534997 -0.022363 -0.592622 -0.364824 -0.174855 1.186230 -0.321437 -0.446950 0.672345 0.670350 0.401332
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.870433 -0.643533 0.067261 0.410767 0.200499 1.519096 17.297468 18.334858 0.664123 0.670110 0.399520
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.529367 -1.154617 -0.861691 -0.268392 -0.590273 0.644040 6.655339 1.159983 0.655092 0.664832 0.393760
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.202945 0.387021 7.278660 0.043888 3.586933 0.315702 0.475111 1.722022 0.510803 0.661482 0.462728
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.310655 -0.745527 -1.639531 -1.085405 -0.845360 0.328349 0.778326 -0.132616 0.646524 0.657004 0.412417
15 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.688945 -0.048591 -0.039906 0.103989 0.016441 1.288652 2.704581 2.010714 0.670633 0.675684 0.405022
16 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.880380 -0.877982 -0.814793 0.209093 0.547520 0.965093 3.043162 5.175514 0.673263 0.673524 0.397636
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.269795 0.759274 -0.379385 -0.046130 0.133348 0.649761 3.827123 3.014559 0.673710 0.679715 0.398933
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.874013 10.214648 -0.822986 0.189949 0.603116 1.949526 18.880779 27.331018 0.652229 0.456872 0.474401
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.716469 -1.083665 0.499657 -0.536680 0.257093 3.695947 10.803421 8.774968 0.658780 0.682730 0.401697
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.485410 -1.040293 3.096193 -1.618044 0.507497 0.802651 0.980649 -0.624121 0.653769 0.683290 0.411758
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.296414 0.154119 -0.637823 4.097599 0.676924 -0.617407 0.414530 0.084900 0.652051 0.631568 0.408986
22 N06 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.192438 10.634915 9.204823 9.955516 9.550129 10.072616 3.423811 2.906070 0.031743 0.035609 0.004487
28 N01 RF_maintenance 100.00% 0.00% 84.37% 0.00% 11.703071 24.449042 0.885404 0.800818 4.813473 9.104036 7.012946 21.215999 0.361301 0.155700 0.261645
29 N01 digital_ok 100.00% 0.00% 100.00% 0.00% -1.098053 11.079984 -0.504711 9.568663 -0.153083 10.046068 -0.289575 0.641196 0.679028 0.033719 0.484732
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.606225 -0.512863 -1.127039 0.231892 0.749929 -0.061475 19.316484 0.641975 0.676037 0.683740 0.391916
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.008584 -1.198886 0.739489 1.145945 2.159437 0.800948 4.709266 1.121803 0.681667 0.683040 0.400358
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.349464 21.598143 -0.273665 2.144007 14.671546 5.500422 5.245060 6.374573 0.611072 0.577014 0.318429
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
35 N06 not_connected 100.00% 100.00% 100.00% 0.00% 228.227832 228.348814 inf inf 5121.960595 5139.496387 8664.070227 8767.742189 nan nan nan
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.217823 7.320104 -0.324642 0.144660 0.890415 2.212280 0.512990 1.926163 0.657605 0.671490 0.406625
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.401608 0.225966 -1.027981 0.435975 0.165591 0.919957 -0.856756 12.694377 0.672063 0.681125 0.413594
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.008280 -0.042086 -0.317733 0.399424 0.683306 0.832028 8.734561 3.110257 0.675732 0.686634 0.412125
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.113620 0.465400 -0.384780 0.272761 -0.791352 0.646717 -0.609768 -0.205173 0.677513 0.682390 0.392352
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.143438 0.407826 -1.061920 -0.187631 0.959418 -0.041894 -0.358192 0.934835 0.683589 0.683422 0.380475
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.117354 0.936923 -0.429477 0.677718 1.092507 0.388460 -0.054055 -0.156091 0.691356 0.687132 0.395536
43 N05 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.432541 0.394820 0.186927 0.262850 -0.736147 0.171330 -1.666091 0.896264 0.057515 0.052793 0.007420
44 N05 digital_ok 0.00% 100.00% 100.00% 0.00% -1.614819 -0.025833 -0.477393 -0.396991 -0.331128 0.594941 -1.273660 -0.532489 0.054307 0.049921 0.005397
45 N05 digital_ok 0.00% 100.00% 100.00% 0.00% -0.551838 2.106691 -0.268259 0.020273 0.137042 1.333270 -0.113116 3.922013 0.060220 0.052583 0.006570
46 N05 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.915511 1.443336 0.941123 1.777085 -0.179890 0.566956 -0.225412 -2.665624 0.070085 0.059883 0.011857
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 10.317965 1.716096 3.662683 -1.435466 9.443581 -1.209003 1.461359 6.012936 0.036865 0.648575 0.410431
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.011859 1.312998 1.180843 1.237743 -0.393104 0.287784 -1.844658 -2.607459 0.642581 0.664394 0.406985
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.109764 0.438898 -1.509918 0.621588 -0.900388 -1.558000 0.302527 -0.768741 0.611798 0.648251 0.401344
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.625082 2.600004 -0.221371 0.607844 7.565264 3.336276 34.207482 29.345620 0.627644 0.657560 0.387101
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 22.634367 0.703078 11.871250 -0.099513 9.686330 2.505956 12.458398 6.825454 0.036265 0.682232 0.440573
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.594273 5.903894 -0.780417 0.221650 0.018999 0.908811 0.895639 1.415749 0.677026 0.690278 0.401007
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.234069 2.480084 -0.635201 -0.193949 1.046417 1.348495 3.705301 7.384899 0.686892 0.697617 0.400133
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.454710 11.322642 9.212273 10.179049 9.494383 10.018251 2.646956 1.463679 0.042720 0.042105 0.001300
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.476051 11.970290 0.159803 10.091423 4.562796 10.034382 3.146024 3.883556 0.684945 0.032818 0.426268
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.016582 12.046409 -0.140647 10.281267 -0.058302 9.962189 2.057612 1.369894 0.687622 0.035308 0.438601
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 25.840167 -0.157587 5.836599 0.884096 5.020408 0.779892 3.981819 3.248822 0.478559 0.694906 0.394219
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 0.352593 10.959485 -0.935102 10.056199 -0.484072 10.011912 1.530119 1.515379 0.053118 0.026195 0.025288
59 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 9.871833 10.190072 8.616481 9.466448 9.324033 9.293106 0.743175 1.366143 0.030749 0.050496 0.014348
60 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% -1.174953 10.870393 0.145091 10.093192 -1.416388 10.023539 -1.403816 3.750888 0.064161 0.032962 0.025278
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 2.191468 2.129759 -1.444198 0.017427 1.749611 -1.780227 -0.658250 5.198289 0.628311 0.632814 0.387384
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.156306 1.574735 0.420242 1.032590 -0.772230 -0.339619 -0.339706 -2.203076 0.643159 0.672240 0.395971
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.111117 11.242379 0.333963 4.524831 -0.120561 10.075058 0.077764 3.731751 0.629111 0.041577 0.398673
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.953097 0.302822 -0.824120 0.220674 -1.260189 -1.546291 0.472346 -1.435736 0.604310 0.637908 0.396812
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.199479 0.872944 -0.015734 0.685892 0.865119 1.087468 0.082841 0.937449 0.645693 0.672206 0.422803
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.100101 1.108737 1.541603 1.685200 2.265732 0.326607 -0.102594 2.576884 0.655287 0.676175 0.412269
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.975368 -0.729816 1.556892 1.638053 -0.107541 0.652250 1.124553 3.566833 0.666725 0.683803 0.402575
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.880450 25.465666 0.057628 13.325076 0.491090 9.914490 0.010198 12.875283 0.680816 0.029374 0.446974
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.114150 -0.310238 -0.141857 0.368680 -0.091801 0.833878 0.034476 0.458255 0.683428 0.697323 0.383253
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.497034 -0.440232 -0.928171 -0.395801 1.331893 0.819743 0.448420 0.910523 0.693089 0.703627 0.380613
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 6.910589 -0.312684 0.055316 0.823619 0.267423 0.321673 0.165033 1.046160 0.701791 0.704129 0.377597
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 1.867607 -0.166411 0.149535 0.766552 0.685499 0.022644 6.681661 1.949424 0.686959 0.696929 0.377504
73 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% -1.052226 0.398642 -0.670373 2.126260 -0.160903 9.487658 -0.303906 0.352249 0.056597 0.058182 0.008701
74 N05 RF_maintenance 0.00% 100.00% 100.00% 0.00% -1.121539 1.808031 0.317858 -1.076833 -1.117107 2.446694 -1.680559 3.017022 0.058431 0.055230 0.006964
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 21.166633 23.835591 0.493702 -0.785967 3.651436 2.942701 9.043529 3.977471 0.533331 0.492099 0.208275
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 29.534849 -0.474829 -0.165396 -0.242069 3.245353 -2.318754 0.824143 0.656831 0.469047 0.657330 0.375868
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.934626 -0.318654 -0.472793 -1.013139 -0.880442 -1.665385 0.431512 -0.899858 0.632097 0.658289 0.397602
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 8.197016 12.382308 2.588413 4.402796 6.584239 9.975138 18.345717 1.483505 0.304563 0.037702 0.174610
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% -0.457414 -0.777167 -0.769965 2.613227 -0.312088 19.111511 -0.415464 1.083136 0.070214 0.084056 0.013517
82 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.529524 -0.386604 -0.307376 1.624453 -0.016441 -1.139845 -0.431342 0.135707 0.068637 0.075383 0.012196
83 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.481900 -0.184075 -0.584021 0.015734 -0.402909 -1.037450 -0.754182 0.518731 0.073262 0.075377 0.013951
84 N08 digital_ok 100.00% 35.15% 100.00% 0.00% 19.160204 22.662040 11.947061 12.890732 7.692729 9.802180 5.689183 6.846209 0.233763 0.034452 0.127823
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.218900 0.148665 -0.015875 0.904723 -0.094306 -0.296488 -0.227844 -0.111249 0.681472 0.688159 0.383412
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.917596 -0.331381 1.444645 1.248453 3.465567 -0.300289 0.291475 23.226559 0.670771 0.689176 0.371893
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.923263 6.761874 0.474169 -0.223000 19.835618 2.631198 19.465332 1.340204 0.632966 0.710749 0.362887
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.133808 0.238475 -0.225194 0.624431 -0.991236 0.796650 3.361905 0.542004 0.683718 0.697374 0.370645
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.282401 0.179320 -0.424443 0.531387 -0.657981 0.036961 -0.599445 -0.107468 0.681943 0.696001 0.382736
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.457312 -0.404130 0.906631 0.836645 -1.276718 -0.717214 0.091742 5.659662 0.670542 0.689450 0.388381
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.490543 0.012831 -0.252133 0.029283 -0.588787 -0.174737 -0.176661 -0.301709 0.671407 0.695987 0.400440
92 N10 RF_maintenance 100.00% 0.00% 16.06% 0.00% 35.299377 42.264314 0.149063 0.718891 6.474073 8.051414 0.505267 11.128136 0.291427 0.244732 0.099747
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 1.721570 0.409129 1.573856 -0.000152 1.718188 0.563603 6.661926 -0.303658 0.664733 0.692044 0.401781
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 10.531748 -0.611352 9.331923 0.113386 9.430811 2.036628 1.632614 3.844929 0.030833 0.685523 0.373642
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.397888 -0.040839 -0.395085 0.838963 -0.082943 -0.889262 0.665138 2.311520 0.637134 0.675143 0.403452
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.539000 12.005516 3.652359 4.567762 9.333257 9.916151 1.596088 1.181670 0.032735 0.035931 0.002016
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.768057 3.666840 0.628586 0.077208 -0.485535 -0.212382 -1.046281 15.274690 0.623082 0.604351 0.399793
98 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 0.943951 5.567283 -0.452278 -0.045243 -0.097691 1.741249 0.349707 3.452661 0.073396 0.073375 0.014444
99 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.012831 -0.733434 0.366181 0.518289 -1.060461 1.888501 2.607634 -0.310743 0.066821 0.063323 0.010671
100 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -1.171005 -0.813210 -1.115098 0.095832 1.348287 -0.611978 0.257895 0.860181 0.053101 0.061288 0.006102
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.119981 6.570222 -0.986123 0.698702 0.049722 0.781588 0.157477 0.341785 0.675352 0.682653 0.396912
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.130589 0.411974 -0.988359 2.528134 0.037316 -0.240377 -0.372446 9.294918 0.686977 0.679985 0.383835
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.210863 4.758859 3.293074 0.420430 5.084569 1.442852 9.885952 7.880510 0.667215 0.695054 0.379080
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.933525 55.918134 6.097706 6.817051 0.712210 4.767114 0.176747 2.706214 0.633758 0.671392 0.377716
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.102860 -0.481594 -0.513178 0.606319 0.872991 -0.358524 -0.292702 -0.137608 0.688655 0.696001 0.371083
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.443821 0.185459 0.481804 0.813777 1.214099 -0.022569 0.133892 -0.122650 0.673495 0.693325 0.377261
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 2.983149 1.481799 -1.467741 -0.851735 0.036980 -0.354328 8.269998 10.778193 0.679695 0.696240 0.379114
108 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 9.554785 2.949259 9.142690 -0.513394 9.494201 -0.444406 2.764537 0.838845 0.037927 0.700230 0.403095
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -1.061995 11.004991 0.068254 9.843289 -0.351270 10.093046 2.503789 2.713166 0.676597 0.032951 0.399154
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 5.405487 24.064018 -0.221974 13.037591 13.109388 9.783677 1.693122 6.043903 0.655454 0.029568 0.366029
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.146882 10.935417 -0.084593 9.945729 -0.037888 10.098287 2.853791 3.177754 0.672422 0.033375 0.391333
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.419093 1.257942 -0.448096 -0.299419 0.765169 0.477335 0.136425 -0.265104 0.661538 0.678339 0.402071
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.294170 12.048647 3.445267 4.468095 9.347939 9.933405 2.264890 1.019052 0.034172 0.030585 0.002267
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.293366 0.561314 0.784844 -0.368452 6.874482 -1.637815 1.902380 -0.484356 0.526762 0.649474 0.428624
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.229254 0.988653 2.608020 1.626470 2.452533 0.389719 -3.247664 -1.249804 0.617824 0.647279 0.420920
116 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 0.216292 0.123346 -0.785793 0.297297 1.233726 0.021435 10.099048 -0.017289 0.081534 0.087780 0.018526
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 10.356370 12.395025 9.239455 10.411431 9.373568 9.997995 1.854122 4.923011 0.026725 0.025558 0.000901
118 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.341585 0.909431 -0.631333 0.446907 -0.479209 0.372177 1.592506 3.160716 0.061321 0.061724 0.007494
119 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.674228 1.054812 -1.511256 1.951348 -0.452187 3.003410 0.158932 3.387095 0.066280 0.073910 0.011521
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.331175 2.148047 2.023467 2.039527 0.851272 1.153484 1.429222 -3.075833 0.661147 0.684390 0.379503
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.456994 4.207498 -0.891569 0.695431 0.457100 0.443539 30.262336 22.364132 0.686573 0.694197 0.382860
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.781143 6.239839 -0.889149 0.411686 2.623136 1.266855 -0.180079 -0.388054 0.697931 0.700503 0.383960
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.879390 7.842005 -0.053813 0.704561 0.669659 0.800966 -0.257913 0.846961 0.696793 0.703532 0.383335
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.980543 -0.213007 -0.596512 0.300894 -0.322395 0.079489 0.683843 1.246537 0.688116 0.700854 0.386735
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.260706 -0.703788 -0.915026 0.587139 0.545178 -0.359638 0.105860 0.001918 0.680678 0.692163 0.390802
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.442621 2.540228 -1.192850 0.941728 3.023477 0.314995 5.723799 0.608796 0.678944 0.686177 0.394316
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.096702 -0.200278 -0.437434 0.034842 1.978894 1.271114 1.379924 1.878160 0.681122 0.701613 0.402346
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.718738 -0.243267 1.034233 0.719859 -0.175134 1.180703 -0.130981 0.172245 0.674678 0.696785 0.398573
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.433023 -1.688313 -0.374326 0.085828 -0.408689 0.424028 -0.200214 0.106362 0.673852 0.694112 0.404308
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.197511 0.575665 -0.491952 0.038198 -0.635748 0.762155 2.565229 5.340694 0.654756 0.683810 0.396239
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.398689 12.135540 3.696341 4.700583 9.466167 10.006166 3.481041 -0.018187 0.033455 0.037189 0.001562
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.875108 0.454395 0.477704 -1.243370 -0.289683 -0.984191 -0.856896 -0.132147 0.624228 0.638644 0.406614
133 N11 not_connected 100.00% 100.00% 82.37% 0.00% 10.843096 15.958799 3.454919 3.221668 9.436075 8.989935 2.109120 1.806625 0.039248 0.177719 0.084250
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.950284 10.992788 -0.310469 10.157975 0.292589 9.984050 0.070370 1.841181 0.619985 0.035551 0.395384
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 4.261036 0.047771 6.908707 4.762860 12.310134 20.419342 0.450055 0.862083 0.468797 0.601994 0.412548
137 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.038827 -0.606913 -0.780860 -0.284010 1.654077 2.675574 1.410423 2.073087 0.070707 0.078102 0.012044
138 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.775743 -0.411767 -0.268187 0.739042 0.415377 0.336349 1.734327 -0.148354 0.069152 0.076942 0.013028
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.847484 -0.603145 1.648034 -1.021667 0.110690 -2.277754 -1.921893 -0.058459 0.659930 0.663767 0.391751
140 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.571828 11.606165 0.399952 10.038153 -0.592736 10.092645 3.813118 3.505247 0.675826 0.041212 0.460365
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.300516 -0.677076 -1.082648 0.548029 0.454722 -2.050042 1.226225 -1.511508 0.680588 0.692299 0.379916
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.557041 10.858614 0.952980 10.101553 0.331839 10.040445 2.858957 2.602180 0.672721 0.040320 0.460892
143 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 9.662114 -0.346224 9.296688 0.087576 9.318233 1.121804 0.388435 -0.292203 0.027741 0.096855 0.079552
144 N14 digital_ok 0.00% 100.00% 100.00% 0.00% -0.762384 -0.674754 -0.718361 3.303889 0.299355 -1.028096 -0.480906 -0.045538 0.093932 0.111395 0.044385
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% -1.080691 2.013236 -0.641659 6.462420 0.486866 18.308714 0.119600 1.487419 0.097686 0.125544 0.049020
146 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 0.275121 1.188359 -1.668448 0.914850 -0.624371 -0.955651 0.334594 -2.282454 0.101019 0.119653 0.054846
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.858386 -1.273111 0.828951 1.892670 1.361206 -0.398488 -0.004403 -0.165935 0.672594 0.686746 0.387837
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.795109 -0.379739 2.619179 1.425086 -1.196829 0.412347 -0.401050 -0.160507 0.659903 0.691978 0.402609
149 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.943400 0.928890 -0.972640 1.695314 -1.042162 -0.077937 -0.819370 -2.456571 0.672774 0.690683 0.402136
150 N15 RF_maintenance 100.00% 100.00% 0.11% 0.00% 10.055713 -0.209132 9.201154 -1.010529 9.521618 1.114131 3.043681 0.269974 0.039531 0.280914 0.104758
155 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.653332 0.165128 -0.512809 6.139280 1.500523 21.922647 2.185753 1.310919 0.621504 0.571886 0.421183
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.251639 10.608988 0.337877 9.828295 18.141303 10.045107 4.976156 0.980120 0.621556 0.036486 0.401240
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.071503 -0.184420 -0.210923 0.361094 -0.512662 0.414926 -0.393727 0.014702 0.633652 0.657450 0.414692
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.183813 -0.397319 -1.097448 -1.048483 1.464455 1.020050 9.174159 27.349480 0.653282 0.671903 0.413325
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.098663 28.352735 -1.267047 -0.761767 -1.225770 2.553900 -0.228039 1.825711 0.629851 0.507620 0.372590
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.683319 -0.957988 -0.891039 -0.927979 -0.164713 1.197104 0.466315 1.001257 0.669336 0.679694 0.388742
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.650044 26.916329 -0.722340 -0.797204 -0.423160 0.670361 -0.344426 1.333461 0.673865 0.555812 0.361448
162 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 9.642511 11.656613 9.139125 10.181257 9.405574 9.975411 1.391555 1.791245 0.043998 0.049326 0.004144
163 N14 digital_ok 0.00% 100.00% 100.00% 0.00% -0.379684 0.844649 -0.802102 0.142250 0.162676 0.450996 1.212110 1.954712 0.092284 0.097412 0.041811
164 N14 digital_ok 100.00% 100.00% 100.00% 0.00% -0.469897 0.105905 1.513400 -0.508019 12.899840 1.167828 1.053523 1.900156 0.098100 0.099068 0.046130
165 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 27.570513 -0.178722 1.870478 0.272046 3.555251 0.144091 0.929866 -0.137788 0.099377 0.107669 0.051161
166 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 28.272875 9.934550 -0.066989 9.676321 2.580974 10.010027 2.733306 1.765060 0.098597 0.027094 0.040223
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.628863 -0.923427 -0.626620 0.898303 0.367197 0.303292 -1.169039 5.555941 0.687037 0.689798 0.400210
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.702113 -0.943380 -0.558055 -0.712348 1.051101 0.691001 0.041001 2.366750 0.677230 0.693618 0.400743
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.842026 1.562363 -1.545691 -1.469406 0.301474 -1.372877 -0.590529 1.748256 0.674390 0.677701 0.401130
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.120222 -0.525754 9.356038 -1.348983 9.357096 13.195500 1.299197 4.617480 0.035556 0.684763 0.462226
179 N12 RF_maintenance 100.00% 100.00% 90.27% 0.00% 10.251307 11.521860 9.349111 10.478712 9.306502 9.177077 1.104638 1.815541 0.059467 0.122395 0.058549
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.748547 11.601642 9.279679 10.220127 9.391726 10.015624 1.068254 3.589754 0.045975 0.048580 0.004004
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.403704 -0.159184 -0.810534 0.182629 0.427084 0.782519 -0.426239 7.542471 0.677441 0.680325 0.397117
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.009792 3.648776 -0.956334 3.037413 -0.165518 4.212288 15.660775 -2.264412 0.683287 0.674492 0.401775
183 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 9.701888 -0.627008 8.550147 -0.682269 9.528514 0.461376 0.284134 0.499113 0.038835 0.677779 0.425476
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 9.681900 11.290525 9.282244 10.108833 9.435114 9.968777 1.091270 1.554801 0.025631 0.025130 0.001051
185 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 7.826843 0.952798 8.638480 6.900778 9.256445 2.263875 0.365478 0.218920 0.069926 0.125447 0.057435
186 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 9.210047 1.548500 9.292235 2.033554 9.442853 0.884178 2.964058 -2.947454 0.030220 0.114057 0.061817
187 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 9.729155 1.511114 9.048311 1.657553 9.522346 0.361592 3.159072 -0.366541 0.028771 0.118646 0.071034
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 8.137141 8.417056 1.274701 0.057046 3.448964 6.904321 1.058548 3.307379 0.349225 0.371930 0.176322
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 37.290104 11.109076 -0.442502 10.186659 4.943295 10.015528 25.989004 3.840711 0.493627 0.033128 0.319422
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.957540 0.226076 3.160944 -0.123931 -0.416333 0.087256 17.505002 0.699056 0.625591 0.665757 0.429276
200 N18 RF_maintenance 100.00% 100.00% 51.54% 0.00% 11.011217 33.409458 3.645937 0.546740 9.576951 8.220199 2.425540 -0.777636 0.043801 0.215851 0.121554
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.640369 5.508258 4.949382 3.961468 7.676295 6.821347 -4.898246 -4.315333 0.628208 0.642786 0.391526
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.722550 1.853372 0.951211 -0.365755 -0.290782 -0.905596 -0.549143 5.938743 0.656579 0.628154 0.401992
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.494510 12.822744 3.414435 4.269836 9.508659 10.056027 3.219736 4.501856 0.033351 0.040012 0.000882
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.767631 2.261961 0.313456 -0.733014 -1.171121 -0.941234 -0.492208 10.254139 0.646848 0.636179 0.402722
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.551340 0.435075 -0.897029 -1.020019 11.007044 -2.045390 1.341695 4.698012 0.630598 0.645501 0.396866
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.372678 1.812582 1.550606 -0.398683 1.177975 5.006177 -1.319331 -0.997722 0.633915 0.637925 0.381253
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.787629 3.836312 5.075571 3.181919 8.005479 5.249009 -5.128889 -3.654730 0.621040 0.649489 0.411321
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.814735 -0.623759 0.216351 -0.313520 -1.052854 -1.605277 3.828678 -0.963408 0.647997 0.650281 0.403761
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.532625 0.048683 -1.086240 -0.542589 -0.085455 -2.037553 3.059253 -0.394594 0.615546 0.655016 0.409369
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.828880 0.606976 0.892179 -0.462635 -0.572079 -2.420330 5.241811 -0.398758 0.646026 0.656354 0.407294
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.544894 1.538553 -1.319514 0.521154 -0.471753 -1.529648 0.419679 1.263704 0.627708 0.658428 0.408871
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.784703 6.023536 5.126011 4.443062 7.875296 8.225146 -5.120429 -4.912419 0.621920 0.630385 0.401805
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.345224 1.427366 1.156483 -1.237190 2.341768 -2.004814 1.770521 -0.766662 0.522448 0.631159 0.441689
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.535542 -0.666173 1.378416 0.671264 0.130425 -0.799540 -1.969534 -2.027739 0.646810 0.649254 0.414902
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.516434 2.418033 -0.002719 1.086658 0.889459 1.278645 0.137121 5.527100 0.639984 0.585453 0.424033
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% 230.009121 230.173767 inf inf 6025.339000 6102.083577 11332.605841 11657.467799 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% 229.265960 229.310716 inf inf 5125.659562 5033.686153 8788.466227 8451.375159 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% 241.853137 241.887171 inf inf 6859.234279 6858.288328 13756.523833 13755.225828 nan nan nan
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 229.497418 229.726013 inf inf 5120.952221 5125.712659 8838.890279 8895.313942 nan nan nan
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.362974 11.915931 -0.859056 6.583386 -0.636986 10.052230 10.592163 4.082583 0.642022 0.045939 0.439565
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.887702 2.115901 1.321185 1.398075 0.778237 0.453294 -0.001918 -1.479434 0.541249 0.547966 0.399756
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.814652 -1.028553 1.451208 -1.351985 0.740084 -1.030826 -2.153378 0.071464 0.575539 0.563085 0.412629
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.917694 -1.199986 -1.040947 -0.420068 -0.444410 -1.474952 3.529020 -0.280634 0.520341 0.557449 0.408865
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.394912 0.669869 -1.312588 -1.484711 -0.969156 -0.823809 1.085081 1.210276 0.503114 0.542068 0.398066
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, 8, 9, 16, 18, 19, 21, 22, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 63, 68, 71, 72, 73, 74, 77, 78, 80, 81, 82, 83, 84, 86, 87, 90, 92, 93, 94, 96, 97, 98, 99, 100, 101, 102, 103, 104, 107, 108, 109, 110, 111, 113, 114, 116, 117, 118, 119, 121, 122, 123, 126, 130, 131, 133, 135, 136, 137, 138, 140, 142, 143, 144, 145, 146, 150, 155, 156, 158, 159, 161, 162, 163, 164, 165, 166, 167, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 202, 203, 205, 206, 207, 208, 209, 210, 211, 219, 222, 224, 225, 226, 227, 228, 229, 237, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320]

unflagged_ants: [5, 10, 15, 17, 20, 40, 41, 42, 48, 49, 62, 64, 65, 66, 67, 69, 70, 79, 85, 88, 89, 91, 95, 105, 106, 112, 115, 120, 124, 125, 127, 128, 129, 132, 139, 141, 147, 148, 149, 157, 160, 168, 169, 220, 221, 223, 238, 324, 325, 329, 333]

golden_ants: [5, 10, 15, 17, 20, 40, 41, 42, 65, 66, 67, 69, 70, 85, 88, 91, 105, 106, 112, 124, 127, 128, 129, 141, 147, 157, 160, 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_2459897.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 [ ]: