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 = "2459925"
data_path = "/mnt/sn1/2459925"
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: 12-11-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/2459925/zen.2459925.21296.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 1850 ant_metrics files matching glob /mnt/sn1/2459925/zen.2459925.?????.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/2459925/zen.2459925.?????.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 2459925
Date 12-11-2022
LST Range 23.898 -- 9.854 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 94
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
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 57 / 201 (28.4%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 112 / 201 (55.7%)
Redcal Done? ❌
Never Flagged Antennas 89 / 201 (44.3%)
A Priori Good Antennas Flagged 45 / 94 total a priori good antennas:
3, 9, 10, 15, 16, 19, 21, 29, 30, 42, 54, 55,
56, 72, 81, 86, 93, 94, 99, 100, 101, 103,
106, 109, 111, 121, 122, 123, 128, 136, 143,
146, 147, 148, 149, 158, 161, 164, 165, 170,
182, 183, 185, 187, 189
A Priori Bad Antennas Not Flagged 40 / 107 total a priori bad antennas:
8, 22, 43, 46, 48, 52, 61, 62, 64, 73, 74,
77, 79, 82, 89, 95, 102, 114, 115, 120, 125,
132, 135, 137, 139, 166, 179, 205, 206, 211,
220, 221, 226, 227, 229, 238, 245, 324, 325,
333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459925.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% 7.700342 -1.136732 11.224239 0.462733 4.702400 0.614537 3.034032 0.223563 0.035938 0.756828 0.649176
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.047895 -0.264888 0.037517 -0.234807 14.590640 28.291408 -0.932510 -0.254701 0.761896 0.758844 0.241418
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.405894 -0.343030 -0.103492 -0.249059 -0.626938 -0.174199 0.063134 -0.076497 0.765396 0.758403 0.231469
7 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.088492 -1.088307 0.935715 3.578440 -0.677736 2.342839 1.021493 2.074369 0.759070 0.745073 0.233997
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.717797 -0.888615 -0.862150 -0.142128 -0.597270 0.058783 -0.514179 -0.025470 0.757702 0.746229 0.239052
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 2.399122 -0.949851 8.839370 0.139466 4.585902 0.603860 1.047134 0.299952 0.643769 0.743994 0.293754
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.304896 -1.115834 0.828110 -0.986808 20.560620 0.118971 1.051421 -0.282555 0.736663 0.735898 0.254630
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 7.383112 -0.065285 10.607705 0.879828 4.771957 0.507447 3.040493 0.164938 0.036162 0.755826 0.637902
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 7.488184 -1.119869 11.197790 0.484549 4.714272 0.888732 3.020240 0.040102 0.034809 0.762411 0.638394
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.320252 0.543922 0.152801 0.080212 -0.513083 -0.244206 -0.015865 -0.384390 0.763187 0.761103 0.234933
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.643992 35.489159 11.228925 -0.247208 4.750467 14.099806 3.024642 1.103490 0.030925 0.594681 0.500259
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.384329 -1.048363 -0.237381 2.577726 10.208402 51.104373 -0.200392 0.761341 0.760062 0.745294 0.236381
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.000934 -0.735894 3.820897 -1.753369 3.336328 -1.080353 3.380548 -1.670689 0.748564 0.753906 0.246097
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.307959 -0.654100 -0.067917 4.717974 -0.248424 0.885539 0.386128 2.337993 0.741624 0.719018 0.243482
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.286225 -0.216686 -0.619349 -0.697407 0.021075 -0.057404 -1.011012 -1.080705 0.709716 0.702598 0.260272
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.047643 8.052085 11.232208 11.608120 4.773418 5.891905 3.065631 1.953088 0.037322 0.040690 0.004100
28 N01 RF_maintenance 100.00% 0.00% 41.62% 0.00% 13.784687 35.418022 -0.672480 1.097332 6.798901 14.425912 1.291203 2.257688 0.527916 0.296955 0.319011
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 7.526190 7.781558 10.827025 11.216168 4.749296 5.808088 3.033905 1.875947 0.030756 0.037516 0.006931
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.681692 -0.849537 -0.861258 0.299029 17.068934 -0.070903 -0.824759 -0.171758 0.769159 0.764171 0.229951
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.814098 -0.489273 0.884097 1.142194 -0.011980 1.687894 0.996573 0.549123 0.773376 0.763001 0.232847
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.696815 -0.073825 1.140640 1.575293 17.592685 9.108353 1.304300 1.459199 0.703186 0.749508 0.214525
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.523764 -0.940864 5.329313 -0.299246 4.834825 -0.356343 3.105024 -1.258878 0.046416 0.718114 0.530243
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.113788 -0.246115 0.424391 -2.087624 7.392068 -0.709609 -0.676690 -1.429028 0.713282 0.698828 0.265146
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.867305 3.868100 -0.222965 -0.094871 1.097930 1.741995 0.534854 0.369431 0.753525 0.742178 0.234887
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.586130 1.464779 -1.967662 0.735600 0.986104 0.580465 -1.740414 0.663539 0.761140 0.750932 0.238390
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.739326 0.886983 0.049498 0.293909 1.255283 0.436437 0.627470 0.334447 0.767315 0.758602 0.233606
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.866017 -0.600545 -0.167178 0.309002 0.372820 -0.228435 -0.070746 -0.003281 0.767594 0.758012 0.225626
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.574101 -0.490092 -0.665732 -0.115411 0.134312 0.477931 -0.475923 -0.471190 0.773646 0.762485 0.224073
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 7.653693 8.935616 11.539188 12.175305 4.665510 5.736313 3.004852 1.871643 0.032227 0.030003 0.002546
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.702490 -0.386940 -0.983669 0.512203 0.560432 0.113349 -1.662701 0.122871 0.770601 0.759153 0.229527
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.860774 -0.720518 -2.072535 -0.129032 -0.587585 0.346622 -1.854946 -0.053660 0.768389 0.764861 0.232556
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.977686 -0.545721 -0.045856 0.391059 0.123581 -0.369614 0.106944 0.053287 0.762461 0.747887 0.229460
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.451558 0.851828 1.350082 1.409781 1.586917 -1.035871 1.378992 -0.311418 0.754643 0.749775 0.253692
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.912379 0.028284 5.109183 -2.116375 4.841845 -1.086606 3.134565 -1.604623 0.040221 0.715988 0.513716
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.220779 -0.041101 -0.282989 0.914731 -0.948673 -1.192585 -1.306153 -0.608185 0.720229 0.706813 0.261267
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.274512 -0.374517 -1.120227 -0.942126 -0.739611 8.708609 -1.281074 -1.489434 0.688314 0.696262 0.265055
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.047958 3.167559 0.343978 1.184728 6.863610 6.708088 2.759605 2.396223 0.733161 0.717933 0.226407
51 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 12.560732 1.358298 14.493640 0.229254 5.085972 1.903120 3.333543 0.589782 0.053204 0.749521 0.606092
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.301979 3.652233 -0.938605 0.122757 -0.538543 0.504743 -0.571810 -0.013460 0.768351 0.756281 0.234641
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.643876 2.212565 -0.122048 0.068065 0.203373 0.712699 0.459305 0.269626 0.774972 0.764566 0.232152
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 7.246093 8.413005 11.260340 11.889738 4.785904 5.838661 3.091965 1.915636 0.031433 0.030132 0.001247
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 7.504267 8.476298 11.290663 11.797582 4.838248 5.918716 3.085767 1.985980 0.028372 0.032734 0.003900
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.172937 9.322631 0.248008 12.040403 -0.031221 5.825108 0.459604 1.913290 0.775740 0.041780 0.618551
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.257921 -0.618695 9.048852 0.377969 8.682577 0.691198 1.185353 0.184700 0.575039 0.769567 0.270966
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.732009 8.375363 11.108515 11.754580 4.934797 5.977993 3.205034 2.032039 0.037401 0.037252 0.000921
59 N05 RF_maintenance 100.00% 99.95% 0.00% 0.00% 7.499023 -0.943442 11.216535 1.355345 4.698435 1.285537 3.023882 0.742536 0.081943 0.759191 0.574939
60 N05 RF_maintenance 100.00% 0.00% 63.95% 0.00% 1.210100 8.292129 -0.382900 11.766462 -0.160803 5.856319 -0.178857 1.975520 0.759645 0.156869 0.536946
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.268590 0.567997 -0.492401 0.652387 0.297292 3.711480 -1.141950 -0.801524 0.716220 0.702628 0.237676
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.216644 -0.878894 -0.288660 0.394823 3.578484 -0.202278 -1.172042 -0.867591 0.696710 0.720514 0.256073
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.211648 8.027004 -1.264957 5.593732 -1.998938 5.882023 -1.683938 1.933733 0.711916 0.046792 0.511620
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.531503 0.229657 -1.633534 -0.578699 -1.634309 -1.142125 -1.536331 -0.772177 0.696304 0.671973 0.257534
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.840577 1.116124 0.367598 0.868103 3.731506 2.163715 1.224208 1.099563 0.743615 0.735967 0.249075
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.187825 0.070810 2.394261 1.989346 1.085621 1.668492 2.800104 1.455147 0.753341 0.745013 0.240510
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.435262 0.323558 1.443536 1.166542 2.164597 0.588502 1.888085 1.007553 0.761546 0.752552 0.233008
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.140626 14.217768 0.463454 15.803283 0.681397 5.962051 0.981251 1.984846 0.773089 0.042068 0.627400
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.065253 -0.842361 0.134582 0.541797 0.749069 1.321203 0.358523 0.298722 0.773765 0.764246 0.223570
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.189259 -0.742889 -0.517678 -0.223718 -0.593496 1.428368 -0.444976 -0.021542 0.779641 0.769931 0.222725
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.629621 -0.881181 0.133818 0.875034 0.370429 1.484923 0.538565 0.535995 0.784809 0.772777 0.220838
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 2.601773 9.211028 0.770826 12.210780 0.523046 5.798237 0.794552 1.918881 0.778378 0.038153 0.612336
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.568702 -0.529260 -1.788558 1.264348 -0.086738 1.369379 -2.151401 0.775955 0.780139 0.767845 0.225227
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.137688 -0.186491 -0.824298 -0.925070 -1.236989 1.804176 -1.706674 -0.644841 0.768615 0.765077 0.230554
77 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.855623 0.000934 -0.362172 -0.273779 0.051014 -0.679836 -1.338342 -1.354845 0.737202 0.694684 0.254535
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 9.902343 -0.314849 -0.092064 0.421959 1.061128 -1.385128 -0.379314 -0.883108 0.575852 0.716544 0.253211
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.334925 -0.672865 -1.854618 -0.849209 -2.046075 -1.489802 -1.715015 -1.838480 0.716267 0.718885 0.263451
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 2.306950 8.632267 2.274839 5.507011 0.826445 5.784990 0.834353 1.875802 0.700159 0.048729 0.488518
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.197709 8.583630 -0.214684 10.272564 -0.217586 5.800633 0.344221 1.983745 0.727714 0.039983 0.525409
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.576022 0.099514 0.154655 2.098549 -0.419315 0.408313 0.359217 1.287112 0.742683 0.723899 0.240787
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.074409 0.397218 0.021367 0.315964 -0.649761 0.129735 0.112704 0.426547 0.754553 0.744586 0.235892
84 N08 RF_maintenance 100.00% 19.35% 100.00% 0.00% 10.026507 9.579431 14.280645 14.962031 3.342634 5.901357 0.786645 1.961470 0.463372 0.039483 0.277598
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.267474 0.770677 0.390932 1.245154 -0.535964 -0.617682 0.504135 0.854360 0.774728 0.759334 0.223422
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.229936 -0.222978 1.715770 1.619041 7.371690 -0.052053 1.368218 0.893362 0.770048 0.761884 0.216877
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.232495 6.077051 -0.815264 -0.396530 3.794028 0.102502 -0.584606 -0.358023 0.784442 0.777818 0.217932
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.078028 0.633934 0.348678 0.719457 -1.147473 1.349856 0.224770 0.199859 0.779689 0.771806 0.213748
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.355636 0.605171 0.008048 0.773703 0.511531 -0.198718 0.033987 0.055104 0.784668 0.772682 0.215659
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.537136 -0.869711 1.544517 1.275229 6.741303 -0.120226 1.156097 0.478146 0.773799 0.764555 0.214517
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.192252 0.397305 0.283738 0.229894 -0.186149 0.005837 0.251838 0.015163 0.772006 0.769471 0.224567
92 N10 RF_maintenance 100.00% 0.00% 5.51% 0.00% 26.816226 28.229748 1.811615 2.309763 5.644268 6.549813 1.381630 0.687728 0.442638 0.400648 0.069364
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.604199 0.023485 2.099734 0.291673 4.392520 -0.009836 1.991911 -0.028149 0.753816 0.753632 0.238448
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 7.511531 8.462164 11.451772 11.665763 4.769853 5.817124 3.050963 1.897645 0.032594 0.027157 0.002510
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.223204 -0.620600 -1.816882 0.001229 -0.417767 -2.274813 -2.246629 -1.276281 0.725429 0.726493 0.262713
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 7.932999 8.404636 5.127027 5.699920 4.693176 5.730658 3.053506 1.869371 0.034903 0.041080 0.002937
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.646031 2.255673 -1.930643 1.991096 23.972507 9.777942 -1.440112 -0.285966 0.701098 0.637558 0.274505
98 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.028029 0.025250 -0.169403 -0.342590 1.841318 -0.646214 0.674373 0.457140 0.717574 0.707262 0.251946
99 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 0.816240 0.163353 0.910526 0.333712 -0.046804 5.084501 0.974899 0.577038 0.729403 0.724551 0.250487
100 N07 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.256087 4.871067 -0.802497 0.661858 -0.110532 0.779539 -0.330769 0.721281 0.763944 0.752297 0.236947
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.794614 -0.678145 -2.030543 3.125436 -0.671245 1.065834 -1.767145 1.620791 0.772948 0.750698 0.228050
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.208015 2.860871 1.261585 -0.655075 49.967059 1.016946 0.193568 -0.273091 0.765744 0.767435 0.231753
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.823957 15.368675 7.110714 8.495960 6.623081 5.321574 3.659496 3.326061 0.740313 0.757322 0.215565
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.273150 -0.081956 0.033550 0.789922 -0.564683 0.102895 0.164446 0.306390 0.786309 0.772038 0.212322
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% -0.099926 -0.438110 1.643116 1.088512 9.109730 0.516356 1.332982 0.290777 0.777887 0.761968 0.208381
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.278768 -0.060885 -0.847970 -1.003791 -1.382560 -0.848735 -0.751382 -0.784648 0.782845 0.776038 0.213871
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.305850 14.132654 11.194290 0.205870 4.755216 5.949403 3.056585 -0.549880 0.040682 0.544986 0.305795
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 7.477670 7.835238 11.220464 11.500874 4.763379 5.845411 3.030272 1.920182 0.026778 0.026433 0.001340
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 14.354531 14.442270 15.181028 15.465179 4.740524 5.831378 3.053155 1.883039 0.025218 0.028109 0.001395
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.425111 7.613387 0.323816 11.623589 0.368820 5.834186 0.606000 1.936181 0.755800 0.041464 0.457061
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.714696 -0.828788 0.096455 -0.060449 -0.644128 1.021698 0.169063 0.007962 0.745566 0.743746 0.249344
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 7.620019 8.486176 4.927958 5.590300 4.685531 5.757120 3.033629 1.861245 0.036965 0.031037 0.003086
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.911769 -0.810082 -1.765373 -1.019895 -2.140915 -1.358406 -2.093988 -1.821229 0.706030 0.708360 0.269859
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.083746 0.321808 0.783308 1.565079 -1.449104 -0.718716 -0.588586 -0.405759 0.701466 0.694895 0.291816
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.101232 0.765015 -0.532714 0.589853 3.355263 1.325651 0.788990 1.816762 0.713922 0.702668 0.259074
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.339565 8.750341 11.354068 12.211426 4.717637 5.880445 3.048932 1.950786 0.027773 0.033608 0.003705
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.347849 0.343848 -0.233988 0.556468 1.741631 0.341478 0.183107 0.669259 0.741428 0.733520 0.250791
119 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.628607 0.346261 2.730515 1.536642 2.159273 -0.531187 2.785466 -0.254501 0.757560 0.744289 0.240647
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.213685 5.002901 -1.419603 -0.034416 0.581311 1.317237 -0.932636 0.415551 0.774289 0.764987 0.225132
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.126810 3.967867 0.180076 0.707254 47.716477 0.112050 -0.631292 0.568821 0.774819 0.765317 0.219645
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.539987 5.245230 0.359734 0.681266 -0.210008 0.514145 0.889696 0.756750 0.791119 0.778988 0.213705
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.481976 0.200736 -0.118332 0.673365 -0.104439 -0.156127 0.231468 0.558111 0.788684 0.776606 0.210631
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.676117 -0.365287 -0.861267 0.785916 -0.980833 1.337225 -0.785252 0.409573 0.788045 0.776088 0.214176
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.965164 1.395367 -0.022982 1.044468 14.384189 0.267138 -0.103642 0.502621 0.701250 0.768505 0.203547
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.805441 -0.695479 0.026319 0.144207 0.419159 0.028125 -0.007683 0.087294 0.772417 0.772740 0.229474
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 7.404230 7.989695 11.294659 11.729786 4.671913 5.768454 3.011070 1.881075 0.031855 0.026373 0.002659
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.697281 -1.133867 -0.153646 0.211983 0.051566 0.083005 0.138775 0.152243 0.760988 0.756773 0.239504
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.043849 -0.767414 -0.089815 0.233183 -0.603404 -0.172069 0.111177 0.232414 0.749242 0.747287 0.242188
131 N11 not_connected 100.00% 0.00% 41.51% 0.00% 2.236970 8.493950 2.630912 5.753766 0.878733 5.601714 1.029535 1.557100 0.726836 0.280160 0.399798
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.548730 0.283751 -1.218688 -1.792732 -0.997322 -1.849955 -2.102843 -1.195076 0.717449 0.710633 0.261820
133 N11 not_connected 100.00% 98.32% 0.00% 0.00% 7.650984 -0.641669 4.901952 -1.596079 4.709441 -2.008928 3.008208 -1.071646 0.084877 0.697825 0.455943
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.689962 -1.119338 -0.165206 -2.050617 1.859418 -0.043582 2.067379 -0.164786 0.710691 0.704841 0.277118
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.297308 -0.875853 5.759523 2.275130 34.183165 26.016038 5.888725 2.688364 0.661974 0.695350 0.260213
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.326538 -0.071995 -0.076663 -1.537090 -0.050429 -0.665437 0.533728 -0.570020 0.726840 0.721209 0.259179
138 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 120.537560 115.473460 inf inf 3195.597897 3392.333729 261.812911 311.123040 nan nan nan
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.676691 0.194197 0.767240 -1.876426 -1.617490 -2.097507 -0.574512 -1.694660 0.747611 0.732240 0.248285
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.821401 -0.512574 -1.266310 -0.989556 -0.754258 -1.281254 -0.742196 -1.741636 0.769158 0.759266 0.236084
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.608230 -1.114525 -0.675616 -0.071490 0.257666 -1.964091 -0.166841 -1.378895 0.777073 0.762967 0.230285
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -1.216701 8.199518 -1.116171 11.788499 0.989468 5.797319 -0.451071 1.912679 0.782849 0.062486 0.538752
143 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.532389 -0.541751 6.728501 -0.095393 4.254007 0.841614 3.404341 0.287926 0.744500 0.779317 0.230008
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.275623 -0.244089 -0.517640 0.535762 -0.260262 1.201393 -0.023247 0.585344 0.789808 0.778724 0.214922
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.779796 0.198070 -0.437012 5.293670 -0.587728 16.638998 0.305031 2.862877 0.790043 0.753854 0.220520
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 7.687093 -0.633599 4.892065 -0.909325 4.751173 -0.719981 3.029607 -1.910087 0.039691 0.766501 0.563274
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 133.805114 111.207095 inf inf 4691.479732 4566.041017 332.904250 346.387259 nan nan nan
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 104.465129 104.851383 inf inf 3761.078669 3931.481162 309.581504 310.189234 nan nan nan
149 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 174.648418 174.216670 inf inf 4229.892561 4365.473679 214.075849 246.113052 nan nan nan
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 1.388457 -1.236246 0.831539 -0.001229 -1.611932 -1.564100 -0.440594 -1.359388 0.742480 0.737713 0.264315
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.403622 -0.805099 10.873897 -1.666740 4.792939 2.082293 3.052150 0.349936 0.038949 0.704216 0.468167
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.039626 7.561497 5.306245 11.458880 29.477088 5.817615 6.612628 1.886316 0.666364 0.041360 0.456100
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.138132 -0.768992 -0.368728 0.371533 0.410673 0.609122 0.674608 1.374658 0.728581 0.719819 0.261606
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.331070 -0.910428 -0.508285 -1.154593 -0.458598 4.545929 0.347670 0.091225 0.744351 0.734708 0.258029
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.068306 7.669244 -1.897545 -0.975409 -2.261970 0.318903 -1.921011 -0.125640 0.732389 0.615702 0.236534
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.709839 -1.005223 -0.568914 -0.996437 -0.005837 0.040138 0.300577 -0.152052 0.765061 0.752088 0.234446
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.391458 15.348508 -0.276056 -0.246664 -0.531677 1.636883 0.345342 -0.366746 0.773528 0.674297 0.214290
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.795318 -0.414166 1.495618 0.646987 0.402905 -0.970129 0.145547 -0.976892 0.763912 0.765545 0.236530
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.589455 -0.378116 -0.504254 0.222565 -0.587163 0.421372 -0.157250 0.418469 0.788522 0.776372 0.219946
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.163244 -0.289817 1.156957 -0.352833 10.923280 1.264646 1.609997 -0.046936 0.783758 0.777411 0.214968
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 5.111990 -0.810386 2.836331 0.326160 5.108946 0.001305 1.843095 0.742597 0.683809 0.778345 0.205974
166 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.272488 0.082080 0.089785 1.307716 0.259136 -0.569863 0.670736 -0.536063 0.786856 0.770012 0.228931
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.637034 -0.707612 -1.746887 3.886337 0.032553 0.910891 -2.076492 2.288326 0.779206 0.758395 0.230550
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.013932 -0.711134 -0.034154 -0.618554 -0.112850 -0.422596 0.444003 0.003281 0.770072 0.767175 0.234025
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.206582 0.251103 -1.242707 -1.892531 -1.194645 1.026862 -0.773007 -1.434007 0.764619 0.744965 0.242045
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 7.767903 -0.318127 11.468057 -1.247978 4.752600 0.465691 3.073108 -0.487161 0.041825 0.752452 0.569844
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.745921 -0.505723 1.560437 2.415031 0.612757 1.229742 2.406010 2.703244 0.739907 0.728983 0.249592
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.392315 8.752372 -0.436206 11.948135 0.086974 5.908048 0.357998 1.983719 0.756963 0.063207 0.544520
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.132845 -0.614125 -0.360637 0.192591 0.530175 1.426975 0.289441 0.708872 0.768847 0.757751 0.235803
182 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.411065 1.601570 -0.464310 2.755114 16.380769 1.280026 -1.892286 0.544726 0.778283 0.747298 0.244820
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.772515 -0.244329 0.982764 5.163882 0.289528 1.757870 1.395389 2.405162 0.768791 0.739571 0.211783
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.181587 -0.854938 -0.243624 3.619889 0.547598 2.842318 0.814899 3.011190 0.783381 0.765624 0.213861
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 3.347310 -0.722997 8.855985 4.516414 6.501749 1.832496 1.462650 2.891231 0.605614 0.756086 0.240688
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.025456 -1.147489 -2.076353 -1.134802 0.189793 -0.371863 -1.569691 -1.845804 0.788486 0.778592 0.227559
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.484941 -1.096666 -0.146077 2.291159 55.806312 1.502197 -0.932306 2.067614 0.742609 0.771254 0.234812
189 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 7.301749 10.302539 10.670618 0.002206 4.816432 9.917657 3.109388 -0.224425 0.032048 0.537016 0.378904
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.861789 -0.592378 -0.901132 -0.580681 -0.460390 -1.460164 -0.282193 -1.739179 0.759287 0.744325 0.247657
191 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.758976 -0.728108 1.076685 -0.619486 0.603802 -0.204891 1.673091 0.085814 0.745900 0.744663 0.243893
200 N18 RF_maintenance 100.00% 100.00% 14.59% 0.00% 7.686571 30.284076 5.080603 -1.137534 4.811337 6.738676 3.087347 0.568427 0.048923 0.368361 0.268086
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.309668 3.523281 4.390513 3.773670 3.450700 3.290059 2.485640 1.201507 0.720044 0.718479 0.263778
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% 1.107889 1.485721 -0.152876 -0.064179 -1.774926 -0.571160 -1.260235 -0.894860 0.763957 0.730951 0.234918
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.248545 9.413933 -0.651040 -0.138918 4.811154 5.883147 3.135164 1.998109 0.036706 0.046877 0.003150
205 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.349795 3.180434 -0.190959 -1.196926 -1.396449 -1.406081 -1.117744 -1.188203 0.763561 0.746051 0.223525
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.433665 0.974947 0.481290 -1.713909 2.181052 -1.850023 -0.637997 -1.664056 0.768460 0.752788 0.227442
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.045079 2.295920 0.609401 -1.235571 -1.008113 19.353597 -0.541829 -1.508382 0.753937 0.747282 0.223925
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.847993 5.041383 10.093728 11.829592 4.699938 6.511054 3.201385 3.092974 0.033799 0.035182 0.000909
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.193587 5.671448 10.214287 10.249537 4.810354 6.207624 3.223115 2.278986 0.040834 0.039963 0.000620
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 4.109543 1.967603 1.878628 3.697817 2.663097 0.499714 2.421754 2.001085 0.749719 0.725675 0.240065
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.461256 1.988057 1.549992 2.658841 1.633371 1.501137 0.077313 0.417467 0.727061 0.713820 0.264627
219 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.413046 3.345390 4.893468 4.139100 4.340477 4.041788 2.811471 1.382026 0.702175 0.709911 0.276919
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.021152 -1.142841 -0.898539 -1.022175 -2.591770 -2.096544 -1.962679 -1.856950 0.759004 0.747153 0.239999
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.320990 0.454354 -0.403800 -1.312090 -0.894374 -1.950910 -1.092240 -1.872770 0.739566 0.749942 0.237510
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 2.613940 0.969086 -0.230907 -1.199460 -0.842041 11.442488 -1.294814 -1.723924 0.762852 0.755129 0.233935
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.806583 2.037839 -1.974812 -0.406854 -1.492844 29.395718 -1.904622 -1.194962 0.757950 0.756249 0.230645
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.119189 3.357681 4.603159 4.278052 3.924342 4.207094 2.602541 1.461171 0.731412 0.726285 0.254945
225 N19 RF_ok 100.00% 0.00% 49.35% 0.00% 4.031424 8.514574 3.156498 5.358318 1.681827 5.763976 1.515497 1.828055 0.753867 0.192517 0.559850
226 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.189402 3.132669 2.742299 3.109389 0.866255 2.638737 1.145213 0.938217 0.755053 0.698444 0.252365
227 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 3.645894 2.564721 1.726166 2.680393 0.200397 1.082852 0.480402 0.438763 0.738198 0.735147 0.243211
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.528208 1.406925 -0.356312 2.416722 5.515529 3.241656 2.275016 1.672901 0.689039 0.676017 0.204122
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.613222 2.317337 3.363618 3.296311 2.667744 2.402572 1.555397 0.768013 0.719621 0.717223 0.266272
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 3.911587 1.950922 1.614335 -2.032228 11.623499 -0.677042 -0.653083 -1.374875 0.687860 0.726293 0.255530
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.926288 0.021147 0.353532 -0.141569 -1.394189 -0.082986 -0.997947 -1.682679 0.756823 0.745267 0.246848
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.441505 0.721196 -0.408125 0.356746 0.076184 16.460276 -1.559099 -1.306429 0.758617 0.748867 0.241169
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.080697 30.000193 2.209944 -0.050945 2.614456 6.134338 1.166301 2.178077 0.676251 0.576262 0.192914
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.292859 4.463661 -1.537044 0.622205 -0.362256 -1.186713 -1.869738 -0.359736 0.758329 0.717994 0.231274
242 N19 RF_ok 100.00% 9.41% 0.00% 0.00% 26.651056 1.463661 -0.669083 1.085230 30.221869 -1.250149 2.183816 -0.704513 0.527835 0.752038 0.337563
243 N19 RF_ok 100.00% 5.68% 0.00% 0.00% 45.206616 2.922119 0.128548 -1.991612 4.058255 0.192931 1.485927 -1.331549 0.506504 0.742714 0.364440
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.008419 0.656409 2.861840 -0.650770 2.395010 -1.237470 -0.470600 -1.579271 0.648516 0.742096 0.259391
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 3.101557 0.905581 2.095218 -0.410645 0.186728 -2.009070 0.646888 -1.623017 0.743558 0.741218 0.249002
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.195663 5.189784 1.690753 2.278871 3.335248 4.427311 1.993590 0.893095 0.496022 0.489980 0.135865
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 4.158265 2.532714 3.071190 2.428906 1.617177 1.051383 1.450320 0.252391 0.735759 0.729464 0.248344
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.298551 4.908770 10.023967 10.708382 4.919920 5.870895 3.182384 2.248501 0.040142 0.031014 0.008468
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.701781 6.288930 -0.395521 7.940578 -0.690135 5.985498 0.227745 1.988181 0.746358 0.055102 0.615920
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 2.665717 1.833967 0.484968 0.957590 -0.940950 -1.150262 -1.029226 -1.064749 0.642764 0.635060 0.272457
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.130446 -0.572000 0.615320 -2.110766 -0.572147 0.566235 -1.182314 -0.003686 0.699716 0.685031 0.234403
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.675649 0.104797 -1.830725 -1.588210 21.015595 -0.141678 1.293418 -0.026578 0.598432 0.603212 0.293834
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.313591 1.377661 -1.131491 -2.081721 3.279818 0.295127 1.865749 0.551905 0.558742 0.567747 0.307077
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, 9, 10, 15, 16, 18, 19, 21, 27, 28, 29, 30, 32, 34, 35, 36, 42, 47, 49, 50, 51, 54, 55, 56, 57, 58, 59, 60, 63, 68, 72, 78, 80, 81, 84, 86, 87, 90, 92, 93, 94, 96, 97, 99, 100, 101, 103, 104, 106, 108, 109, 110, 111, 113, 117, 119, 121, 122, 123, 126, 128, 131, 133, 136, 138, 142, 143, 145, 146, 147, 148, 149, 155, 156, 158, 159, 161, 164, 165, 170, 180, 182, 183, 185, 187, 189, 200, 201, 203, 207, 208, 209, 210, 219, 222, 223, 224, 225, 228, 237, 239, 240, 241, 242, 243, 244, 246, 261, 262, 320, 329]

unflagged_ants: [5, 7, 8, 17, 20, 22, 31, 37, 38, 40, 41, 43, 44, 45, 46, 48, 52, 53, 61, 62, 64, 65, 66, 67, 69, 70, 71, 73, 74, 77, 79, 82, 83, 85, 88, 89, 91, 95, 98, 102, 105, 107, 112, 114, 115, 116, 118, 120, 124, 125, 127, 129, 130, 132, 135, 137, 139, 140, 141, 144, 150, 157, 160, 162, 163, 166, 167, 168, 169, 179, 181, 184, 186, 190, 191, 202, 205, 206, 211, 220, 221, 226, 227, 229, 238, 245, 324, 325, 333]

golden_ants: [5, 7, 17, 20, 31, 37, 38, 40, 41, 44, 45, 53, 65, 66, 67, 69, 70, 71, 83, 85, 88, 91, 98, 105, 107, 112, 116, 118, 124, 127, 129, 130, 140, 141, 144, 150, 157, 160, 162, 163, 167, 168, 169, 181, 184, 186, 190, 191, 202]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459925.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.dev11+g87299d5
3.1.5.dev197+g9b7c3f4
In [ ]: