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

Load Auto Metrics¶

In [6]:
use_auto_metrics = False

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

# if it exists, load and extract relevant information
if len(auto_metrics_file) > 0:
    auto_metrics_file = auto_metrics_file[0]
    print(f'Found auto_metrics results file at {auto_metrics_file}.')
    
    auto_metrics = load_metric_file(auto_metrics_file)
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
    auto_ex_ants = auto_metrics['ex_ants']['r2_ex_ants']
    
    use_auto_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping auto_metrics.')
Found auto_metrics results file at /mnt/sn1/2460106/zen.2460106.42132.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 343 ant_metrics files matching glob /mnt/sn1/2460106/zen.2460106.?????.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/2460106/zen.2460106.?????.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 'startTime' 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 2460106
Date 6-10-2023
LST Range 11.706 -- 18.740 hours
X-Engine Status ❌ ✅ ✅ ❌ ❌ ❌ ❌ ❌
Number of Files 631
Total Number of Antennas 202
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
RF_maintenance: 67
RF_ok: 18
digital_ok: 84
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 202 (0.0%)
Antennas in Commanded State (observed) 0 / 202 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 35 / 202 (17.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 90 / 202 (44.6%)
Redcal Done? ❌
Never Flagged Antennas 111 / 202 (55.0%)
A Priori Good Antennas Flagged 26 / 84 total a priori good antennas:
7, 9, 15, 17, 19, 37, 38, 40, 41, 42, 51, 56,
86, 101, 112, 118, 121, 123, 140, 151, 153,
161, 164, 165, 169, 202
A Priori Bad Antennas Not Flagged 53 / 118 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 50, 52, 57, 60,
63, 64, 68, 73, 74, 79, 80, 84, 89, 95, 97,
102, 108, 113, 114, 115, 120, 125, 126, 132,
133, 135, 139, 179, 206, 220, 221, 222, 223,
224, 228, 229, 237, 238, 239, 240, 241, 244,
245, 261, 324, 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_2460106.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 0.00% 0.00% 0.00% 0.00% 0.104370 -0.613317 -0.067176 -1.132201 0.237294 -0.606752 0.316970 -0.554723 0.716840 0.670902 0.477730
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.897599 3.113470 -0.516468 -0.797513 -1.214429 0.363698 -0.949641 6.761602 0.717229 0.646103 0.469295
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.862793 3.192670 0.006932 3.603544 0.171145 2.154326 0.309920 2.288783 0.733398 0.690348 0.477297
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.606857 -0.733264 -1.199823 -0.649286 -0.825916 -0.285360 0.269752 2.999231 0.738259 0.698263 0.470515
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.236863 2.415025 1.795224 1.913126 1.026753 1.317574 -0.827845 -0.767467 0.713296 0.666485 0.470043
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.207950 0.037435 3.799737 0.244856 2.869194 0.815424 3.430517 0.272452 0.739682 0.693405 0.472376
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.100116 -1.171058 0.536739 -1.162916 -0.367841 -1.125369 -1.213058 -0.609856 0.722532 0.681306 0.476339
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 8.849926 -1.017361 0.221090 -0.879450 -0.584392 -0.271963 0.384120 -0.085547 0.671854 0.693918 0.429332
16 N01 RF_maintenance 100.00% 100.00% 67.06% 0.00% 9.371415 10.387470 20.673281 21.184173 2.372551 2.585604 3.407940 3.743398 0.041967 0.168966 0.110221
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.751989 3.243595 1.375121 4.957175 1.067475 2.509685 1.298364 6.130079 0.756040 0.714271 0.462954
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.238435 4.435318 0.582124 3.114879 0.483856 0.580723 7.665063 38.818783 0.692944 0.526439 0.511640
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.593057 1.775117 -1.055330 2.532779 -0.765535 1.993197 -0.305211 4.492995 0.758857 0.720965 0.475324
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.394933 0.046558 1.595785 0.616558 1.476286 1.213009 2.274357 0.891034 0.757897 0.712990 0.476012
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.907834 -0.314393 -0.786119 -0.307080 -0.614447 -0.370607 -0.154964 0.023680 0.752639 0.703797 0.481949
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.192004 -1.637788 1.443088 -0.690718 0.576731 -0.027142 0.970956 -0.147794 0.718912 0.666809 0.478394
27 N01 RF_ok 100.00% 100.00% 19.53% 0.00% 14.434412 16.317396 19.012614 8.210835 2.397681 2.696926 5.403567 27.406961 0.057567 0.226261 0.171192
28 N01 RF_ok 100.00% 0.00% 0.00% 0.00% -0.858489 7.997379 0.349925 8.155591 1.059258 0.557719 0.461886 8.082372 0.753144 0.431262 0.606574
29 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.010117 10.445382 20.377026 20.663551 2.365059 2.697061 5.301236 4.661400 0.042508 0.053122 0.010783
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.878808 -0.001731 1.253351 -1.073473 0.578382 -0.995171 -1.091933 -0.661846 0.753636 0.728777 0.462111
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.958585 0.338918 -0.405531 0.808983 -0.167297 0.797677 0.182392 1.041237 0.774402 0.736793 0.469504
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 20.491376 -0.312129 0.398416 -1.193836 0.317157 -0.029069 2.546697 7.959364 0.731402 0.716954 0.407762
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 10.039547 0.347905 13.012615 0.002899 2.374731 -0.774340 3.378744 -1.081074 0.055456 0.684785 0.554471
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.283541 -0.589316 0.293641 -0.738417 -0.496616 -1.295267 -1.235927 -0.947212 0.727127 0.679253 0.478810
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.213147 3.825242 0.736810 0.355161 0.476408 0.372820 0.871984 0.638661 0.696156 0.642464 0.451586
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 8.067906 7.071175 6.400423 8.620104 3.300491 3.517042 3.069970 9.674981 0.716943 0.664775 0.457211
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.272269 0.599444 -0.698715 0.681997 -0.188553 1.008132 0.469992 3.984292 0.725976 0.684197 0.454087
40 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.106653 0.825914 0.687489 0.613923 0.874593 0.743553 1.260889 24.656713 0.753819 0.717853 0.455895
41 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.390539 2.810139 -0.034555 3.942827 0.025476 2.535307 0.244588 2.477960 0.765918 0.729678 0.456254
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.119870 4.673855 -0.019391 7.556762 0.054234 3.095669 0.605684 4.506761 0.780867 0.737302 0.469406
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.011986 -0.043620 -1.212587 0.346501 -0.842751 0.526164 -0.537199 0.630799 0.785820 0.748372 0.462189
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.628463 -0.034632 -1.183538 -0.114422 -1.078401 0.039038 -0.564987 0.299583 0.784844 0.745446 0.469794
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.093212 1.724352 0.470945 0.057486 0.509048 -0.068117 0.635349 2.355455 0.785174 0.735404 0.469638
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.239301 -1.190706 -0.411602 -0.682831 -0.098675 -1.339989 0.209875 -0.885579 0.779450 0.728537 0.488652
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.113210 0.716767 -0.432602 0.514383 -1.074471 -0.164788 -0.914910 -1.196502 0.741683 0.681369 0.474359
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.833582 -0.946505 0.411794 -0.936953 0.386536 -1.470905 0.534522 -0.509963 0.727300 0.670849 0.470536
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.492617 0.670278 0.024133 0.371933 0.138610 0.395535 0.295758 0.423448 0.700564 0.642909 0.453733
51 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.802849 1.136543 -0.594775 1.109269 -0.398146 1.395449 34.901406 1.249573 0.710808 0.666969 0.440444
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.578511 2.562698 0.204167 -0.287489 0.281292 -0.117679 0.854107 0.162896 0.729587 0.679474 0.446112
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.331709 0.277159 -0.155736 -0.390069 0.552351 0.496709 2.266279 2.585388 0.742958 0.703492 0.439836
54 N04 dish_maintenance 100.00% 0.00% 0.00% 0.00% 11.388276 4.352429 5.029239 5.992215 2.386370 2.146509 4.011446 2.613867 0.424898 0.491614 0.211352
55 N04 RF_maintenance 100.00% 100.00% 0.00% 0.00% 35.320023 -0.623039 14.070148 -0.537218 2.598584 -0.862565 3.141198 -0.255704 0.052653 0.721761 0.573459
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.196511 5.912525 -0.652059 0.583648 -0.433325 0.505829 0.136341 2.443193 0.785361 0.741197 0.441412
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.829300 -0.405782 -0.687434 -0.739606 0.079396 0.187431 -0.044509 0.070550 0.794347 0.748344 0.462415
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.647284 9.990512 20.730947 21.316036 2.365459 2.701766 4.518327 4.456107 0.048150 0.046203 0.002783
59 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.351611 10.590264 0.213754 21.277546 0.193116 2.706556 0.334626 3.530834 0.791072 0.045487 0.602420
60 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.151126 -0.685859 0.542190 -0.847266 0.187536 -1.299531 0.684455 0.985096 0.785045 0.736822 0.483513
61 N06 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
62 N06 digital_ok 0.00% 0.00% 0.00% 0.00% -0.447903 0.939710 1.397747 0.609783 0.869004 -0.041142 1.365845 -1.132071 0.745291 0.691072 0.467147
63 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.042946 3.145232 -0.511433 2.582301 -1.134762 2.120190 -0.726739 -0.205227 0.741821 0.649964 0.485454
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.325174 -1.268183 -1.222561 -0.478874 -1.267721 -0.524348 -0.444730 -0.188191 0.728907 0.667716 0.466763
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.697913 -0.110192 0.168926 -0.727497 0.702127 -0.232915 0.370343 -0.054617 0.697030 0.637387 0.456021
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.028005 0.589458 0.261718 1.079719 0.361605 1.260552 0.347672 1.258857 0.705416 0.663047 0.442847
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.787860 -0.139205 -0.790929 0.754487 -0.448018 0.838161 1.373314 1.646133 0.729980 0.688828 0.445113
68 N03 RF_ok 0.00% 0.00% 0.00% 0.00% 2.323477 1.433627 1.300370 1.815557 1.256611 1.547415 1.757972 2.783200 0.749108 0.707255 0.447048
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.191189 -0.112007 0.275891 -0.283484 0.129098 -0.105446 1.306634 0.404758 0.763578 0.722329 0.444759
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.407596 0.094571 2.235035 0.447837 1.417585 0.350109 1.702344 0.979814 0.777558 0.741209 0.449290
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.603186 -0.692585 -0.893240 -0.082370 -0.620270 0.182436 -0.342310 0.481783 0.792683 0.752328 0.456366
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.022215 -0.304502 -0.409131 -0.353737 -0.217470 0.092667 0.414483 0.119015 0.798492 0.755891 0.467093
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.895006 1.562069 -0.362011 1.763368 0.055836 1.401572 0.725779 3.107177 0.800131 0.758967 0.468202
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.037255 -1.091950 -0.685047 -0.988377 -0.731631 -0.322212 -0.752901 0.155809 0.795077 0.751723 0.469134
77 N06 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 5.053217 0.940521 0.183609 0.778971 0.406065 0.097440 0.755072 -1.208274 0.655537 0.690625 0.405524
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.307607 -0.834141 0.449772 -0.913813 -0.201013 -1.311483 0.705158 -0.863928 0.742963 0.688532 0.455282
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.033463 2.088215 -0.112743 1.709650 -1.004221 1.094552 -1.105136 -0.901816 0.725044 0.650290 0.466686
81 N07 RF_maintenance 100.00% 0.00% 100.00% 0.00% 94.534657 94.967755 inf inf -1.614950 -1.631070 -4.035313 -4.150820 0.378012 0.060529 0.191123
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 94.542745 95.007337 inf inf -1.614950 -1.631070 -4.035313 -4.150820 0.409217 0.273919 0.054045
83 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 94.544115 95.001922 inf inf -1.614950 -1.631070 -4.035313 -4.150820 0.384528 0.273784 0.052980
84 N08 RF_ok 0.00% 0.00% 0.00% 0.00% 1.240746 2.050125 1.243650 1.823131 0.393228 1.282716 -1.243679 -0.871886 0.726423 0.677815 0.445777
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.789418 -0.855941 -0.878169 -1.047934 -0.833588 -0.698741 -0.765185 -0.494990 0.761038 0.722860 0.452141
86 N08 digital_ok 100.00% 100.00% 0.00% 0.00% 9.429992 0.126715 18.517519 -0.392187 2.371804 0.116660 2.693890 4.549413 0.062767 0.733453 0.548757
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 30.847250 1.584614 3.971725 -1.007143 2.035694 -0.524396 10.352451 -0.212273 0.722143 0.750185 0.376929
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.377172 1.378597 0.343735 1.345052 0.362424 1.107979 0.510905 1.133879 0.798422 0.758164 0.458702
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.522882 0.577589 0.398001 0.643200 0.616601 0.894313 0.480571 0.620154 0.804579 0.764258 0.467528
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.642871 0.883725 9.182940 1.438470 1.586356 1.135135 3.981422 1.537472 0.784477 0.762291 0.465234
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.216615 0.018791 0.466968 0.289624 0.628375 0.544386 1.011185 0.478286 0.805222 0.758623 0.484191
92 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.507081 9.680939 20.841165 21.171377 2.356139 2.692855 4.451459 4.831008 0.036612 0.035692 0.001680
93 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.264049 10.396515 20.736571 21.419268 2.374906 2.711336 4.174383 4.766256 0.036925 0.040121 0.001525
94 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.265700 2.374038 0.342163 3.798450 0.833490 2.587436 1.338787 2.594941 0.775612 0.723723 0.468405
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.745678 -0.176738 -0.824098 0.156588 -1.118171 -0.478801 -0.203818 -1.216760 0.752739 0.699386 0.458761
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.677107 10.965912 0.717709 -0.508462 -0.124757 -0.566463 -1.171552 -0.234981 0.736419 0.633508 0.384118
97 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.026385 0.385428 -0.812886 0.956193 -1.386048 0.509586 -0.873130 2.581727 0.724833 0.666011 0.457765
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.044841 5.164198 -0.319051 0.776613 0.247792 1.086389 0.116195 0.763957 0.744047 0.700030 0.452456
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.969327 -0.746814 -0.817704 -1.148381 -1.201063 -0.674527 -0.867484 0.715216 0.755698 0.715254 0.447451
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.180665 2.292505 -0.446072 0.045266 -1.171519 0.201409 -1.017260 0.399485 0.767295 0.731375 0.435365
104 N08 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.019570 35.137157 4.124639 7.390471 2.702897 3.411440 4.324425 5.036466 0.784992 0.741555 0.452352
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.609447 0.447799 -0.393477 0.729384 -0.225293 0.556768 0.187281 0.743781 0.795090 0.755664 0.447623
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.281960 -0.553302 -0.062502 -0.085588 0.073393 -0.069103 0.780134 0.172385 0.802619 0.759837 0.465908
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.881774 1.826822 -0.386562 -0.854461 -0.472489 -0.738145 0.152467 0.047955 0.807888 0.762970 0.452569
108 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.192562 1.461465 -0.977478 0.335557 -0.872747 0.270385 -0.282292 0.438608 0.805765 0.764004 0.473594
109 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 5.383747 10.196242 2.625795 20.971346 2.038898 2.697057 2.595110 3.687711 0.511643 0.050767 0.345847
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 28.820437 -0.167639 3.069468 0.281737 0.603843 0.596766 1.671670 0.281713 0.748472 0.744500 0.396667
111 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.876814 0.558851 1.958114 1.058748 0.762112 1.025071 6.895527 1.071189 0.749453 0.735856 0.397619
112 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 3.091442 0.539008 17.066292 0.301507 -0.753997 -0.191397 1.953293 -1.246230 0.666034 0.713570 0.450283
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.728972 3.054289 2.328220 2.483637 1.595863 2.022097 -0.565295 -0.313123 0.726234 0.671927 0.453359
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.334451 -0.625831 1.990719 -0.837392 1.288865 -1.453112 -0.746806 -0.891388 0.714224 0.682429 0.437981
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.351132 -0.178250 -1.217459 -0.030569 -0.548801 -0.714961 -0.482153 -1.134157 0.713959 0.649494 0.448573
117 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 94.498900 94.932024 inf inf -1.614950 -1.631070 -4.035313 -4.150820 0.407827 0.482193 0.044706
118 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 94.529527 94.984651 inf inf -1.614950 -1.631070 -4.035313 -4.150820 0.413749 0.504279 0.029761
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.511272 0.692809 2.949004 -0.055718 2.394223 0.514069 2.631887 0.238269 0.753245 0.711906 0.450786
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.403636 5.905436 1.468960 7.768110 0.642155 3.338560 -0.347744 7.145429 0.719331 0.719137 0.438286
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.439890 0.850527 -0.679397 -0.939380 -0.586836 -1.192416 -0.119629 -0.841165 0.777696 0.734738 0.452826
123 N08 digital_ok 0.00% 0.00% 0.58% 0.00% 2.256877 0.993102 2.088002 0.950990 1.326082 0.184302 -0.582731 0.236673 0.763966 0.700118 0.466395
124 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.835151 10.591252 21.091588 21.540374 2.371472 2.714210 3.657402 7.093173 0.053545 0.056080 0.001645
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.740050 -1.090444 2.737356 0.318082 1.886140 0.438258 2.991488 0.591802 0.804787 0.762952 0.469232
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.224792 0.252042 0.614413 0.045658 0.868242 0.095744 0.801365 0.185160 0.809184 0.765399 0.482799
127 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.075923 4.391741 20.814649 3.287192 2.362107 2.398214 3.187734 3.210088 0.048596 0.510174 0.336934
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.099489 -0.835644 -0.013334 -0.789346 0.038782 -0.630688 0.672087 1.412122 0.801737 0.756451 0.471988
131 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.588992 8.174797 -0.410209 12.468349 -0.590313 1.234003 -0.966348 2.560300 0.755166 0.476445 0.502729
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.601386 -1.403946 -0.395934 -1.120522 -1.155139 -1.271484 -1.013027 -0.709228 0.741625 0.692012 0.442633
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.158649 -0.781103 -1.148380 -0.620476 -1.345325 -1.330026 -0.539199 -1.007041 0.724671 0.666694 0.447840
134 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.470839 2.438233 3.268019 1.853782 1.068414 1.289085 7.385422 -0.778315 0.685358 0.613533 0.450507
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.461806 0.265955 -0.201727 0.570834 -0.270776 0.793398 0.200534 0.625852 0.669508 0.619377 0.458854
136 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 8.236527 15.301576 20.424691 3.636237 2.352663 2.477636 4.231969 3.825709 0.050201 0.336289 0.220914
137 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 94.547442 95.012097 inf inf -1.614950 -1.631070 -4.035313 -4.150820 0.412689 0.495385 0.044450
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.293910 0.281910 0.635349 -1.099834 -0.108762 -1.307309 -1.198496 -0.365548 0.727027 0.684922 0.458680
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.932331 -0.105904 0.536671 0.211284 0.463397 0.214076 4.797157 1.152983 0.756689 0.715449 0.446443
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.396124 -0.341242 0.073630 0.108908 -0.157308 0.122593 0.283530 0.259976 0.770796 0.727146 0.452666
142 N13 RF_ok 100.00% 0.00% 0.00% 0.00% -1.109601 -0.234274 -0.195739 0.322464 -0.156803 0.290216 6.899263 1.938530 0.783866 0.739726 0.464901
143 N14 RF_maintenance 100.00% 0.00% 100.00% 0.00% 10.140125 10.143067 -0.518426 21.331848 2.559943 2.708464 1.320466 5.115129 0.460115 0.051457 0.359584
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.630169 -1.187290 -1.097516 -1.194441 -0.514907 -0.699380 -0.453157 -0.545283 0.801518 0.757802 0.473751
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.264783 0.874068 0.242631 1.195315 0.545078 0.980880 0.533143 1.235514 0.807763 0.765461 0.477091
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.883861 -0.451513 -1.218949 -0.835347 -1.306271 -1.398865 -0.597757 -0.328376 0.801270 0.755838 0.483856
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 1.784316 0.193656 2.130530 0.850134 1.924418 0.743796 1.646945 0.752263 0.806462 0.760041 0.477939
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.296828 0.345091 -0.002378 0.410396 0.029157 0.128339 0.211499 0.352842 0.796706 0.750904 0.472526
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.344728 -0.324686 0.706277 -0.173319 1.148231 0.117554 2.602833 1.120721 0.783586 0.738813 0.459338
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.243653 0.001731 0.280064 -0.093486 0.482315 0.169328 0.821626 0.192499 0.774633 0.725318 0.454986
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.937736 -0.156038 -0.772552 0.778571 -0.413293 0.213715 -0.288481 2.787040 0.699810 0.694952 0.388898
152 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.956516 -1.264275 -1.252643 -1.248163 -0.986356 -1.311400 -0.218300 -0.724979 0.728373 0.669252 0.443695
153 N16 digital_ok 100.00% 100.00% 0.00% 0.00% 8.873083 -0.010118 12.662526 -0.062170 2.367347 -0.024484 3.378212 0.460168 0.052638 0.646706 0.487809
154 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.493825 -0.672285 -0.205975 -0.817821 -0.997247 -1.440846 -1.075979 -0.948098 0.683718 0.619413 0.441948
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 8.570057 10.998164 20.555551 4.306911 2.355543 2.398458 4.314801 2.637253 0.046134 0.321682 0.211865
156 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.883303 -0.381142 6.244970 0.359800 2.996325 0.644476 3.947494 0.389336 0.693086 0.638977 0.467959
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.363160 0.048690 -0.033428 0.258692 -0.189746 0.111164 0.189874 0.263289 0.711444 0.661370 0.466186
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -1.150884 -0.676796 -0.405274 -0.322037 -0.398698 -0.177715 0.301844 1.281481 0.730230 0.679471 0.468737
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.066779 6.865732 0.941654 0.782440 0.283340 -0.848759 0.664386 0.319797 0.724240 0.623807 0.422979
160 N13 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.573722 10.693400 20.718756 3.485711 2.373146 2.374025 4.141797 2.394292 0.054406 0.434328 0.332021
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.086828 22.462855 0.405256 0.087039 0.412425 -0.371847 0.595786 -0.067741 0.771368 0.650511 0.413527
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.148973 -0.628223 -1.183885 -0.144598 -0.801518 0.220911 -0.453637 -0.023680 0.779409 0.736216 0.460001
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.433013 0.226177 -0.187843 0.060181 0.010523 0.323355 0.182199 0.304899 0.793475 0.749622 0.468506
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 3.594156 0.671069 4.907984 0.534843 3.207552 0.146459 5.160257 0.682370 0.795187 0.753475 0.468424
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 16.471171 11.406956 1.533749 0.233443 -0.318490 -0.175477 2.645672 0.766719 0.736461 0.740200 0.409847
166 N14 RF_maintenance 100.00% 100.00% 0.00% 0.00% 17.429033 29.140055 21.472430 6.444783 2.454047 2.984746 4.014284 2.982550 0.046362 0.425114 0.266062
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.028659 0.303165 0.176688 0.524009 0.474411 0.835224 0.878777 1.234381 0.803319 0.760049 0.473899
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.825209 -0.491809 0.419800 0.005840 0.405841 0.137507 0.559305 0.138401 0.795538 0.754642 0.469247
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.355672 6.687518 0.294296 0.562249 0.327519 -0.753480 0.365282 0.264886 0.787571 0.715491 0.440677
170 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 1.756980 0.658578 2.880005 0.558700 1.411211 0.574399 2.973496 0.619498 0.771600 0.728128 0.447485
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.297143 0.368465 1.148068 1.229676 0.245940 0.337929 0.697994 0.827523 0.741099 0.692013 0.448949
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.379700 -0.437829 0.099160 -0.546262 -0.516817 -0.722850 -1.147089 -0.215381 0.723390 0.670740 0.446884
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.745718 3.054488 2.281239 2.416946 1.495926 1.913099 -0.608024 -0.351738 0.679021 0.610828 0.445074
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.082400 0.962069 1.006903 0.983198 0.700952 0.884042 0.865359 0.903968 0.735786 0.684334 0.475183
180 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.281782 7.921544 1.070732 0.877361 1.310522 1.194095 3.001116 -0.347616 0.743686 0.611914 0.427710
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.540381 0.070371 0.669585 0.017989 0.736208 0.105762 0.671298 0.787487 0.762039 0.712503 0.466111
182 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.423917 10.392352 -0.185866 20.955039 -1.087807 2.652836 -0.470955 4.376560 0.768684 0.064870 0.584010
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.288696 -0.153563 -0.038092 0.596611 0.023677 1.020432 0.119079 0.676895 0.772652 0.733622 0.453655
184 N14 dish_maintenance 100.00% 0.00% 0.00% 0.00% 17.953671 10.229031 15.647958 7.749105 1.516988 2.486053 3.147208 2.840863 0.333017 0.444382 0.224788
185 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.253722 11.843146 -0.094763 0.785963 -0.662596 0.299813 0.047807 0.527119 0.770213 0.735164 0.468234
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.079855 -0.574323 0.002378 -0.641842 -0.815589 -1.273824 -1.134022 -1.029934 0.785343 0.745164 0.458348
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.761980 -1.170487 -0.829241 -0.388770 -0.902214 -0.346407 -0.667557 -0.073450 0.793408 0.754140 0.465521
189 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 1.890517 2.236143 1.435782 1.699382 0.552446 1.076853 -1.090213 -0.868338 0.749452 0.699415 0.462312
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.172612 -1.024381 -0.058756 -0.326031 0.414566 -0.057792 0.315620 -0.088434 0.769571 0.720034 0.449108
191 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.356506 0.666742 0.288206 0.694011 0.199300 0.568515 1.498494 0.727094 0.756177 0.704790 0.447334
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.837394 3.248693 2.461526 2.619331 1.726762 2.173370 -0.482369 -0.182220 0.692268 0.637526 0.442614
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.940248 2.824816 2.502012 2.308199 1.759221 1.825996 -0.449743 -0.473626 0.672818 0.618070 0.436692
200 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
201 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
202 N18 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.253585 5.204670 0.438153 -0.273161 0.229832 -0.303608 1.499641 -0.074110 0.779277 0.730335 0.462328
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.695992 0.714082 7.750213 1.276640 -0.034297 0.612673 4.344931 1.978763 0.717986 0.727906 0.468307
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.526730 0.683722 2.121302 2.135067 0.689268 0.722834 1.375216 1.436937 0.765122 0.724109 0.451233
207 N19 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.001925 14.206490 12.442072 5.465350 2.376727 2.660078 3.366249 3.888962 0.055003 0.432018 0.346223
208 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% 4.012583 5.406392 10.361757 21.047241 1.882164 2.243667 3.696122 44.086273 0.759451 0.047309 0.646390
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 4.006920 5.055875 19.906073 20.648911 2.296091 2.736432 14.928767 22.444574 0.040327 0.042862 0.001200
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.878706 4.027909 0.081808 0.388746 0.257740 0.575951 0.305328 0.372010 0.751204 0.696701 0.455006
211 N20 RF_maintenance 100.00% 0.00% 100.00% 0.00% -1.109052 10.256009 -0.434271 13.297162 -0.753395 2.703503 -0.005456 4.306198 0.722752 0.049012 0.602853
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.823868 -0.680789 -0.551012 -1.073921 -0.776053 -0.568305 -0.462938 -0.604812 0.744280 0.691717 0.480533
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.502238 -0.707367 -0.744628 -0.781729 -1.363581 -1.453123 -0.637237 -0.972207 0.754425 0.707251 0.480013
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.524045 0.078854 -0.567879 -0.133101 -0.937643 -0.769111 -0.637465 -1.187620 0.761056 0.712352 0.478964
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.776533 -1.082569 -0.519179 -1.217970 -0.563199 -1.049056 -0.192235 -0.653152 0.759697 0.716454 0.466970
224 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.125860 3.093718 2.685774 2.551436 1.950637 2.077329 -0.260976 -0.231406 0.723329 0.680252 0.455414
225 N19 RF_maintenance 100.00% 0.00% 0.29% 0.00% 0.406572 7.854244 0.424296 12.302642 -0.382275 1.532202 -1.183061 4.662192 0.748255 0.422195 0.572917
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.739157 7.188467 -0.709988 -0.385535 -1.347552 -0.143975 -0.834542 -0.593706 0.751729 0.666722 0.445612
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 0.441779 -1.189574 0.808157 -1.232651 -0.094101 -1.327255 10.391921 -0.369953 0.743334 0.696300 0.460233
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.266503 -0.947256 -0.178142 -1.133041 -0.852909 -0.955807 -0.767526 -0.302381 0.731291 0.682269 0.446226
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.426594 0.578976 0.291067 0.737475 -0.226954 0.185116 -1.208637 -1.300769 0.716672 0.657981 0.460454
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.303015 -1.085935 0.369236 -1.085516 -0.067243 -1.037137 0.389735 -0.826922 0.724556 0.677388 0.483040
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.488051 0.487471 0.429981 0.512067 -0.431885 -0.201388 -1.240035 -1.282244 0.737158 0.683832 0.488480
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.923818 -0.141838 -0.890049 -0.343522 -1.227079 -1.167623 -0.825870 -1.057224 0.745881 0.692775 0.486306
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.322494 -0.512932 0.507977 -0.750236 0.050754 -1.445632 0.535703 -0.822885 0.743794 0.697550 0.472308
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.637367 -0.494350 -0.495210 -0.219646 -1.245887 -1.004058 -0.906258 -1.163937 0.743478 0.695517 0.473276
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.605049 0.583909 -0.837710 0.464915 -0.407866 -0.231366 2.354612 -1.035591 0.686733 0.683137 0.425605
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.873935 -1.129920 0.241431 -1.098517 0.407619 -1.337575 1.059435 -0.763685 0.685975 0.686190 0.432154
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.072188 0.216221 -0.373354 0.868904 -0.769177 0.234937 0.149194 1.018799 0.734890 0.684155 0.461716
245 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.286540 -0.645441 0.119258 -1.007298 -0.674455 -1.464617 -1.167720 -0.425503 0.723444 0.672302 0.465716
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% 1.925511 10.577032 5.686365 12.624997 0.604840 2.696881 4.240215 3.597310 0.667775 0.046583 0.554342
261 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.077409 -0.594744 -0.010278 -0.405261 -0.495491 -0.789388 -0.587975 -1.120875 0.706568 0.655773 0.464642
262 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.374681 5.469132 -0.063139 0.198585 -0.166145 0.118055 0.316836 0.509998 0.707152 0.644773 0.472822
320 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.843797 -0.499004 -1.071367 -0.860142 -1.197309 -1.013211 -0.650954 -0.608833 0.518784 0.410861 0.352056
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.700465 1.879423 0.552007 0.772423 -0.010523 0.352220 -1.006867 -1.071011 0.507533 0.393442 0.345936
325 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.409719 -1.211440 0.451802 -1.268240 -0.400288 -1.177654 -1.214152 -0.686045 0.562700 0.486613 0.389465
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 9.780241 10.330340 12.674985 13.368897 2.381840 2.709769 3.598450 3.994468 0.049730 0.047757 0.002796
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.676697 0.627655 0.824241 -1.160341 -0.263852 -1.180721 1.964850 -0.616897 0.478747 0.368802 0.312716
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: [4, 7, 9, 15, 16, 17, 18, 19, 27, 28, 29, 32, 34, 36, 37, 38, 40, 41, 42, 47, 51, 54, 55, 56, 58, 59, 61, 77, 78, 81, 82, 83, 86, 87, 90, 92, 93, 94, 96, 101, 104, 109, 110, 111, 112, 117, 118, 121, 123, 124, 127, 131, 134, 136, 137, 140, 142, 143, 151, 153, 155, 156, 159, 160, 161, 164, 165, 166, 169, 180, 182, 184, 185, 200, 201, 202, 204, 205, 207, 208, 209, 210, 211, 225, 226, 227, 242, 243, 246, 262, 329]

unflagged_ants: [3, 5, 8, 10, 20, 21, 22, 30, 31, 35, 43, 44, 45, 46, 48, 49, 50, 52, 53, 57, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 79, 80, 84, 85, 88, 89, 91, 95, 97, 102, 103, 105, 106, 107, 108, 113, 114, 115, 120, 122, 125, 126, 128, 132, 133, 135, 139, 141, 144, 145, 146, 147, 148, 149, 150, 152, 154, 157, 158, 162, 163, 167, 168, 170, 171, 172, 173, 179, 181, 183, 186, 187, 189, 190, 191, 192, 193, 206, 220, 221, 222, 223, 224, 228, 229, 237, 238, 239, 240, 241, 244, 245, 261, 320, 324, 325, 333]

golden_ants: [3, 5, 10, 20, 21, 30, 31, 44, 45, 53, 62, 65, 66, 67, 69, 70, 71, 72, 85, 88, 91, 103, 105, 106, 107, 122, 128, 141, 144, 145, 146, 147, 148, 149, 150, 152, 154, 157, 158, 162, 163, 167, 168, 170, 171, 172, 173, 181, 183, 186, 187, 189, 190, 191, 192, 193, 320, 325]
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_2460106.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.1.1.dev3+gb291d34
3.2.3.dev158+gd5cadd5
In [ ]: