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 = "2460040"
data_path = "/mnt/sn1/2460040"
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: 4-5-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/2460040/zen.2460040.21293.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 1851 ant_metrics files matching glob /mnt/sn1/2460040/zen.2460040.?????.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/2460040/zen.2460040.?????.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 2460040
Date 4-5-2023
LST Range 7.454 -- 17.416 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas 40, 72
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N05, N07, N10, N14
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 177 / 198 (89.4%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 115 / 198 (58.1%)
Redcal Done? ❌
Never Flagged Antennas 0 / 198 (0.0%)
A Priori Good Antennas Flagged 93 / 93 total a priori good antennas:
5, 7, 9, 10, 15, 16, 17, 19, 20, 21, 29, 30,
31, 37, 38, 40, 41, 42, 44, 45, 53, 54, 55,
56, 65, 66, 67, 69, 70, 71, 72, 81, 83, 85,
86, 88, 91, 93, 94, 101, 103, 105, 106, 107,
109, 111, 112, 118, 121, 122, 123, 124, 127,
128, 136, 140, 141, 144, 145, 146, 147, 148,
149, 150, 151, 157, 158, 160, 161, 162, 163,
164, 165, 166, 167, 168, 169, 170, 171, 172,
173, 181, 182, 183, 184, 186, 187, 189, 190,
191, 192, 193, 202
A Priori Bad Antennas Not Flagged 0 / 105 total a priori bad antennas:
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_2460040.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
4 N01 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.330402 1.536393 0.153717 -0.279885 0.840104 0.243448 0.228359 -0.369681 0.027364 0.027612 0.001256
5 N01 digital_ok 0.00% 100.00% 100.00% 0.00% -0.419742 0.233651 1.003630 1.559265 -0.387986 -1.091585 -0.046188 -0.349125 0.026638 0.025545 0.001154
7 N02 digital_ok 100.00% 100.00% 100.00% 0.00% 0.533645 -0.252324 0.499468 0.708168 3.101435 3.001207 17.183806 15.727355 0.071722 0.081469 0.015600
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.751156 4.142880 8.408426 8.835007 39.239184 36.665239 -2.873929 -2.724637 0.511469 0.506823 0.339074
9 N02 digital_ok 0.00% 100.00% 100.00% 0.00% -0.526616 0.828958 1.593887 0.328485 0.472172 -1.109262 2.702775 -0.478361 0.062748 0.039328 0.020384
10 N02 digital_ok 100.00% 100.00% 100.00% 0.00% 3.465282 1.734232 -1.005864 -1.032423 5.222596 4.538253 19.503966 13.257506 0.029037 0.028253 0.001505
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.920668 4.634752 5.385184 5.125813 86.621724 143.175505 3.814089 9.955127 0.408121 0.527981 0.349638
16 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 4.077464 4.826142 -0.922075 0.515808 2.489195 4.818099 1.722017 -0.639806 0.030353 0.036732 0.003465
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 4.052147 3.166532 3.092283 0.513338 183.583234 89.918148 10.902354 20.416450 0.538115 0.373067 0.386266
18 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% -0.204798 0.965184 -0.288770 -1.091963 74.914166 7.113257 168.041788 14.299654 0.029356 0.029020 0.001913
19 N02 digital_ok 0.00% 100.00% 100.00% 0.00% -0.340772 -0.781522 0.848085 0.988334 -0.649156 1.796700 -0.303450 1.341455 0.029649 0.027784 0.001742
20 N02 digital_ok 100.00% 100.00% 100.00% 0.00% 0.362840 0.552028 2.398936 0.101344 1.668445 -0.043769 10.640328 -0.515045 0.026152 0.027794 0.002110
21 N02 digital_ok 0.00% 100.00% 100.00% 0.00% 0.857677 0.393933 0.710009 0.735473 1.166366 3.607317 1.006197 -0.601273 0.027235 0.026386 0.001336
22 N06 not_connected 100.00% 100.00% 100.00% 0.00% -0.565827 -0.510837 0.190150 0.331172 4.339451 6.272689 2.846927 3.817907 0.031379 0.029747 0.002189
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.335667 0.990725 2.108571 -1.266611 0.597348 9.766453 5.069643 104.898622 0.025138 0.029060 0.003069
28 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.344343 1.464350 2.056135 -1.409291 1.482388 6.974312 3.072450 4.876050 0.025235 0.029105 0.003134
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 0.317538 0.145254 0.387951 0.250138 0.576089 -0.128323 5.565672 1.943852 0.029044 0.027638 0.001901
30 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 1.301461 2.629837 0.068585 -1.171145 7.482783 10.323192 32.960007 48.574708 0.027334 0.028217 0.001682
31 N02 digital_ok 0.00% 100.00% 100.00% 0.00% 2.549517 -0.301125 2.932478 1.102329 1.782221 3.201809 3.170607 2.466805 0.023564 0.026080 0.002129
32 N02 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.633954 1.346415 0.114191 0.049709 2.319770 3.336299 -0.484820 1.049701 0.027098 0.027029 0.001233
34 N06 not_connected 0.00% 100.00% 100.00% 0.00% 1.054681 -0.740717 -1.462017 -0.467459 0.506390 0.068842 1.629721 3.029566 0.029375 0.029557 0.001673
35 N06 not_connected 100.00% 100.00% 100.00% 0.00% -0.825878 0.060176 -0.349706 -0.801147 -0.280220 -1.148103 10.512103 -1.015517 0.029799 0.029406 0.001563
36 N03 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.577558 0.998883 2.517676 1.901627 1.747663 1.854168 1.444262 1.359963 0.024929 0.024732 0.001125
37 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 3.500418 -0.294358 0.722679 4.588273 2.262711 1.516296 0.670514 7.043340 0.026361 0.020738 0.004274
38 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 2.324018 1.530709 2.071689 1.859074 1.090029 5.373804 7.814065 13.414418 0.024619 0.024523 0.001017
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 4.436756 4.183719 3.983668 4.932005 156.893346 149.158255 24.589155 7.204119 0.188083 0.188274 -0.255322
41 N04 digital_ok 100.00% 100.00% 100.00% 0.00% -0.611459 -0.285263 1.243404 1.053626 -0.762117 4.533642 -0.460402 0.079346 0.031379 0.029751 0.002086
42 N04 digital_ok 0.00% 100.00% 100.00% 0.00% 0.901900 -0.430130 0.538305 1.320444 0.328367 1.118596 0.062307 3.927448 0.036877 0.042123 0.006449
43 N05 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.953151 -0.785260 0.114006 0.917950 0.434619 -0.985409 -0.737772 -0.758512 0.027489 0.026392 0.001361
44 N05 digital_ok 0.00% 100.00% 100.00% 0.00% 0.734143 -0.544922 0.132901 0.609050 0.119802 -0.902610 -0.391979 -0.458623 0.027409 0.026407 0.001372
45 N05 digital_ok 100.00% 100.00% 100.00% 0.00% -0.460019 -0.537100 0.776900 0.621789 -0.140836 0.952197 0.060096 5.111224 0.027151 0.026510 0.001390
46 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 0.918479 1.379801 -0.341785 -1.369158 2.662153 6.626150 13.001688 17.592292 0.027661 0.028191 0.001472
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 1.233940 1.267135 -1.378032 -0.932318 0.886174 -0.302941 4.987885 -0.086143 0.031384 0.046770 0.007330
48 N06 not_connected 0.00% 100.00% 100.00% 0.00% -0.394871 0.070632 -0.481529 0.146018 -0.889732 1.183602 0.440322 1.697508 0.033699 0.032484 0.002022
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 3.665969 4.111259 3.492157 5.665956 148.716971 116.263903 10.425591 22.329072 0.506098 0.527586 0.329105
50 N03 RF_maintenance 0.00% 100.00% 100.00% 0.00% 2.405699 1.258109 1.916061 2.398625 0.703650 0.316643 0.824716 1.917626 0.025451 0.023825 0.001328
51 N03 dish_maintenance 100.00% 100.00% 100.00% 0.00% 2.985941 2.250799 0.814074 0.579334 35.009272 4.402926 240.442136 0.475109 0.044896 0.026604 0.004170
52 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.239830 0.816338 2.580671 2.094196 4.065591 1.049179 10.509408 2.338166 0.026344 0.025054 0.001278
53 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 1.786834 2.025542 2.049670 0.611534 3.537644 8.473678 11.995155 20.116947 0.050401 0.045112 0.015109
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 4.404580 1.437214 -0.460719 -0.229670 5.489950 1.129280 5.703208 9.248637 0.041386 0.044960 0.011147
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 3.182542 3.295809 -1.091127 -1.090278 1.515998 4.911058 1.693643 -0.366720 0.029970 0.028075 0.001962
56 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 1.030071 -0.681970 0.335366 1.532977 0.313927 12.501175 0.108860 0.483733 0.030211 0.027219 0.001787
57 N04 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.207247 0.068662 0.015707 0.351069 1.515290 1.325060 -0.307231 -0.621612 0.032376 0.038504 0.004784
58 N05 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.492033 1.427154 2.097648 2.181609 0.015616 -0.065441 2.367422 1.570772 0.025732 0.024714 0.001106
59 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.248907 0.005031 2.135856 0.830851 -0.540355 1.839767 0.667843 4.850643 0.026561 0.026881 0.001229
60 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.145419 1.446731 0.321961 2.225568 3.057701 0.847665 6.202680 5.261464 0.028599 0.024510 0.002506
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 3.117621 4.027010 3.160271 5.076575 136.154244 132.329881 8.574665 7.475446 0.493428 0.524620 0.340077
62 N06 not_connected 100.00% 100.00% 100.00% 0.00% -0.153390 0.370838 -0.339485 0.915667 -0.015930 1.652662 1.140741 7.472009 0.031592 0.031554 0.001734
63 N06 not_connected 100.00% 100.00% 100.00% 0.00% 0.110240 1.365434 0.618195 -1.294641 6.537350 1.168023 15.983890 3.943467 0.039252 0.042954 0.005893
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 3.590284 4.185313 5.103846 4.608342 129.956292 134.390351 11.517563 8.939421 0.531501 0.522227 0.326356
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% -0.594900 -0.024163 4.792347 4.347880 2.779783 2.654530 9.702132 13.070677 0.022478 0.021136 0.001225
66 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 4.989771 -0.026637 -0.637819 4.523011 5.288236 3.173924 21.246211 14.260703 0.028641 0.021012 0.005105
67 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 2.798278 1.394882 0.926424 1.643444 2.353208 3.020258 6.545652 3.573098 0.026088 0.024808 0.001346
68 N03 dish_maintenance 100.00% 100.00% 100.00% 0.00% -0.413111 3.904401 4.880117 -0.694964 2.432209 27.142494 11.686483 1.288335 0.023394 0.028396 0.003992
69 N04 digital_ok 100.00% 100.00% 100.00% 0.00% -0.489225 1.154565 0.993006 0.109212 -0.416479 7.248234 0.793177 1.099299 0.030780 0.028971 0.002723
70 N04 digital_ok 0.00% 100.00% 100.00% 0.00% -0.485403 -0.710028 0.877085 1.282799 0.543863 1.156522 0.251759 -0.027027 0.027345 0.027570 0.001230
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 5.263396 4.498183 4.315427 4.119329 158.577255 156.114992 6.456425 9.963634 0.561489 0.544593 0.356276
72 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 4.132633 4.237316 1.643945 0.064064 171.572710 292.325022 39.099467 21.461125 0.197238 0.194993 -0.254689
73 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.108007 0.112122 -0.830692 -0.357692 4.395003 22.482862 0.629275 0.710474 0.027895 0.027511 0.001445
74 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 2.071694 0.870264 -1.194848 -1.024049 45.625179 34.483316 144.371209 118.676057 0.028748 0.027760 0.001446
77 N06 not_connected 100.00% 100.00% 100.00% 0.00% 0.021142 -0.826352 0.243256 0.801203 2.996049 1.085735 9.629842 3.024082 0.030920 0.030638 0.001648
78 N06 not_connected 0.00% 100.00% 100.00% 0.00% -0.452670 0.022381 -0.149905 0.651268 -0.690754 -0.085686 -0.700319 0.577396 0.042212 0.038700 0.006542
79 N11 not_connected 0.00% 100.00% 100.00% 0.00% -0.302484 1.285592 -0.824088 -1.280824 -0.689591 -0.632089 0.205611 -1.145436 0.031530 0.030921 0.001319
80 N11 not_connected 0.00% 100.00% 100.00% 0.00% -0.299826 1.119756 -0.121996 -1.196286 0.007397 -0.407761 -0.685139 1.273142 0.031611 0.029780 0.002191
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 9.086288 8.221649 23.502845 14.075922 324.143048 81.676324 2606.999323 685.298929 0.017573 0.016699 0.000913
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.325604 10.396183 12.407743 14.619225 85.298993 123.589530 503.722953 824.357522 0.017021 0.016413 0.000895
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 5.554688 7.533678 12.985236 12.578287 83.328442 78.217199 641.246061 597.801124 0.016679 0.016524 0.000783
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 4.345389 0.817732 7.471419 4.601393 70.097223 1.965973 -2.003535 9.193498 0.537654 0.081311 0.409634
85 N08 digital_ok 0.00% 100.00% 100.00% 0.00% -0.202218 -0.403128 -0.575430 -0.723966 -0.455207 0.345910 0.004530 0.181890 0.031200 0.029505 0.002364
86 N08 digital_ok 100.00% 100.00% 100.00% 0.00% -0.174391 -0.284386 -0.315699 -0.553972 5.737063 2.583543 7.600480 14.360993 0.030304 0.029285 0.002176
87 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.180911 1.823594 2.549316 0.032510 1.806037 5.752360 3.247281 0.770712 0.028671 0.028686 0.001307
88 N09 digital_ok 100.00% 100.00% 100.00% 0.00% -0.759109 -0.536666 0.072784 0.001057 7.744171 6.241920 28.844572 28.301643 0.029131 0.027693 0.001856
89 N09 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.840982 -0.618914 0.038509 -0.017459 -0.875749 -0.752870 -0.510528 -0.647905 0.032669 0.028644 0.002460
90 N09 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.116526 0.801285 -0.335625 -1.137607 0.011377 1.426163 0.252056 1.504430 0.031301 0.029604 0.002103
91 N09 digital_ok 0.00% 100.00% 100.00% 0.00% -0.842006 -0.713703 0.045089 -0.036275 -0.530712 -0.672564 -0.048983 -0.275686 0.027368 0.027313 0.001308
92 N10 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.377536 -0.391196 2.111522 0.812871 0.732746 1.456296 0.431681 0.499687 0.027059 0.026284 0.001422
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 1.303154 1.388384 2.202571 2.264484 0.190110 0.047857 4.395493 3.414352 0.024763 0.024090 0.001111
94 N10 digital_ok 0.00% 100.00% 100.00% 0.00% 1.157356 1.320721 2.305143 2.101328 0.232076 0.113242 1.678507 1.035202 0.024519 0.024291 0.001023
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 2.819160 4.043615 5.268876 7.054327 109.348532 82.962118 1.824648 0.650526 0.384612 0.383994 0.176052
96 N11 not_connected 0.00% 100.00% 100.00% 0.00% -0.136818 -0.828826 -0.191554 -0.477056 0.999199 -0.227705 -0.331874 -0.888725 0.029880 0.030014 0.001772
97 N11 not_connected 100.00% 100.00% 100.00% 0.00% -0.272836 0.267546 -0.889553 -0.931447 -0.849038 0.888577 -0.326189 8.933429 0.029603 0.029580 0.001585
101 N08 digital_ok 0.00% 100.00% 100.00% 0.00% 0.489822 -0.194195 1.754727 1.944992 -0.128960 0.493651 1.659954 1.761846 0.028193 0.025026 0.001960
102 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 0.693802 0.238769 0.060463 0.115631 2.707317 3.700329 -0.631886 5.303892 0.031285 0.029187 0.002191
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 5.561392 1.540885 0.540694 0.440422 4.134287 2.753090 2.606176 6.438676 0.029374 0.026265 0.002035
104 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 0.694367 14.724648 1.682811 10.528679 12.905533 2.585298 3.844919 33.769279 0.026068 0.017791 0.004774
105 N09 digital_ok 0.00% 100.00% 100.00% 0.00% -0.525582 -0.364373 0.246655 0.370841 0.736538 -0.997321 -0.371469 -0.863336 0.029139 0.026900 0.001987
106 N09 digital_ok 0.00% 100.00% 100.00% 0.00% -0.747944 -0.713685 -0.180831 -0.131592 0.391402 -0.836288 2.253094 -0.807730 0.029413 0.027727 0.001719
107 N09 digital_ok 100.00% 100.00% 100.00% 0.00% -0.779508 -0.674243 -0.290120 -0.630351 0.041249 0.989179 2.935906 5.769827 0.031798 0.029742 0.002525
108 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% -0.504015 -0.272382 1.004684 1.250353 0.995436 -0.868726 16.841471 0.399871 0.026453 0.026329 0.001203
109 N10 digital_ok 0.00% 100.00% 100.00% 0.00% 1.398642 1.408484 2.193508 1.998454 0.906312 1.312501 0.639157 3.137606 0.026916 0.025009 0.001551
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 3.167149 2.618679 1.230336 1.206417 12.222821 0.982368 1.501299 0.772654 0.025620 0.025376 0.000993
111 N10 digital_ok 100.00% 100.00% 100.00% 0.00% -0.787841 1.442280 1.182889 2.083906 -0.780476 0.823871 -0.071804 4.332598 0.026135 0.024356 0.001339
112 N10 digital_ok 0.00% 100.00% 100.00% 0.00% -0.679447 1.203444 1.245963 2.197166 -0.824967 1.598792 -0.078648 2.727501 0.027755 0.024430 0.002118
113 N11 not_connected 0.00% 100.00% 100.00% 0.00% 1.011958 1.182752 -1.136343 -1.273742 -0.100072 -0.311916 3.006738 0.684782 0.030524 0.029472 0.001444
114 N11 not_connected 0.00% 100.00% 100.00% 0.00% 0.858685 -0.295824 -1.279541 -0.424686 -0.481684 0.704181 -0.073525 -0.947484 0.029316 0.029957 0.001723
115 N11 not_connected 100.00% 0.00% 0.00% 0.00% 3.709740 4.250960 5.014353 6.511900 133.873655 104.515430 6.518532 2.724026 0.520328 0.523491 0.338264
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.383457 8.537762 12.255577 17.464578 72.166571 179.019142 588.693001 1120.434541 0.018095 0.016279 0.001479
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 5.572599 7.207402 14.162027 14.989338 130.404470 72.433012 892.712809 625.757338 0.016579 0.016314 0.000798
120 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.171482 1.774606 3.346777 1.477676 3.545430 6.667353 18.767000 23.227746 0.024999 0.025461 0.001188
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.728073 5.442703 8.106279 -0.787701 49.745334 188.320472 1.227461 46.950914 0.557497 0.516496 0.327398
122 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 1.016315 0.859249 1.512662 0.887052 5.409646 2.824823 1.748510 2.090291 0.026611 0.026055 0.001340
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.125720 5.054699 8.812077 7.778632 27.197340 67.029434 -5.088887 -1.253832 0.546826 0.542940 0.343660
124 N09 digital_ok 0.00% 100.00% 100.00% 0.00% 1.325299 -0.564272 2.349315 1.128370 -0.520045 -0.089946 0.856672 1.766669 0.032743 0.029120 0.003255
125 N09 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.573112 -0.706055 0.342815 0.199654 1.995959 -0.816107 -0.432257 -0.252267 0.027070 0.026899 0.001197
126 N09 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.741504 -0.345910 0.058649 0.395539 1.752025 -0.371723 0.620073 0.176046 0.027621 0.026945 0.001313
127 N10 digital_ok 0.00% 100.00% 100.00% 0.00% 1.430825 0.511528 2.106082 0.125616 0.810559 3.523312 0.223641 -0.605360 0.025202 0.026723 0.001405
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 0.249647 1.510958 0.612501 -0.321936 0.473020 4.559241 1.237364 4.627040 0.026735 0.027322 0.001231
131 N11 not_connected 0.00% 100.00% 100.00% 0.00% -0.634884 1.116514 -0.681632 -1.499852 -0.698443 -0.089161 0.544171 -0.718236 0.032177 0.032841 0.001623
132 N11 not_connected 100.00% 100.00% 100.00% 0.00% -0.525296 -0.198155 -0.505374 -0.840374 5.765889 -0.289705 0.091020 -0.059446 0.029668 0.029370 0.001648
133 N11 not_connected 0.00% 100.00% 100.00% 0.00% -0.381517 -0.803131 -0.609029 -0.461714 -0.650211 -0.910528 0.655182 -0.004530 0.032069 0.030692 0.002195
134 N11 not_connected 0.00% 100.00% 100.00% 0.00% 1.104596 1.202075 -1.256748 -1.247250 0.016678 -0.049791 0.222901 0.700524 0.031199 0.029586 0.002220
135 N12 RF_maintenance 100.00% 99.84% 99.84% 0.00% nan nan inf inf nan nan nan nan 0.110748 0.105811 0.097451
136 N12 digital_ok 100.00% 99.89% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.164985 0.093743 0.051075
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.720135 10.207227 19.769193 14.857149 261.919457 145.060406 1801.625558 898.659671 0.016299 0.016323 0.000745
139 N13 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.407888 -0.463437 0.240852 -0.441704 -0.296056 0.094631 -0.304310 -0.781421 0.032317 0.031519 0.002501
140 N13 digital_ok 0.00% 100.00% 100.00% 0.00% -0.284436 1.120563 0.728007 -0.204474 3.644336 0.613211 2.315424 1.852406 0.029705 0.028503 0.001723
141 N13 digital_ok 0.00% 100.00% 100.00% 0.00% -0.730051 1.356669 1.227149 -0.121712 -0.535021 0.451162 -0.240362 -0.532159 0.028694 0.027887 0.001610
142 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.420471 1.418614 -0.018723 2.218356 6.176090 0.320420 28.631357 2.661926 0.028384 0.025131 0.002489
143 N14 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.242904 1.461866 2.007008 2.186328 3.213690 0.076839 1.108111 2.198648 0.097041 0.024845 0.013378
144 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 0.002398 1.013744 0.670674 -0.374482 0.324726 14.183109 0.393998 1.488105 0.028750 0.027820 0.001562
145 N14 digital_ok 100.00% 100.00% 100.00% 0.00% -0.074372 0.266951 0.909789 0.493715 0.676607 18.603508 -0.354694 -0.070030 0.026833 0.027101 0.001269
146 N14 digital_ok 0.00% 100.00% 100.00% 0.00% -0.651799 -0.721841 -0.492991 -0.278320 0.433358 -0.576412 -0.336174 -1.073254 0.029602 0.029415 0.001598
147 N15 digital_ok 100.00% 99.95% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.106107 0.233266 0.091371
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.103398 0.113097 0.081462
149 N15 digital_ok 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.064268 0.027198 0.026995
150 N15 digital_ok 100.00% 99.89% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.127382 0.186888 0.122377
151 N16 digital_ok 0.00% 100.00% 100.00% 0.00% -0.518089 0.387504 -0.407335 -1.016035 -0.675346 -0.806195 -0.574142 0.019231 0.032449 0.030335 0.002419
155 N12 RF_maintenance 100.00% 99.95% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.045980 0.065082 0.022044
156 N12 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.008364 1.485011 2.029050 2.036012 0.686255 1.067837 1.826033 3.719025 0.028676 0.025768 0.001980
157 N12 digital_ok 0.00% 100.00% 100.00% 0.00% -0.633755 -0.781778 0.947043 0.851560 -0.807040 -0.554838 -0.429675 -0.648981 0.028500 0.026492 0.001653
158 N12 digital_ok 100.00% 100.00% 100.00% 0.00% 0.203024 0.213775 0.751745 0.782007 1.689150 3.380811 3.416091 11.503531 0.026841 0.026259 0.001208
159 N13 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.345730 -0.636053 -0.476149 -0.362198 0.797040 -1.143884 -0.712729 -0.190252 0.032163 0.031457 0.002437
160 N13 digital_ok 0.00% 100.00% 100.00% 0.00% 1.254141 0.639328 2.090654 0.328370 0.180056 2.078212 0.792906 0.371078 0.056564 0.034774 0.011343
161 N13 digital_ok 0.00% 100.00% 100.00% 0.00% 0.174774 1.391329 0.903403 -0.088962 0.139272 0.460097 -0.318809 0.581068 0.035565 0.031991 0.003261
162 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 2.381156 1.749259 -0.569314 -0.167227 4.809276 3.700235 8.304927 -0.007984 0.055587 0.038340 0.008244
163 N14 digital_ok 100.00% 100.00% 100.00% 0.00% -0.279998 -0.613409 0.875601 0.841121 0.384434 1.679761 4.138332 4.278818 0.029590 0.026819 0.002139
164 N14 digital_ok 100.00% 100.00% 100.00% 0.00% -0.100402 -0.643516 0.859232 1.085605 6.338854 1.351356 -0.120398 0.848062 0.027197 0.026814 0.001414
165 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 0.617935 0.168068 0.193207 0.154822 0.984608 -0.667975 0.088336 -0.309113 0.028453 0.027210 0.001616
166 N14 digital_ok 0.00% 100.00% 100.00% 0.00% -0.847298 2.036813 1.374046 -0.613425 -0.302614 1.941105 0.361997 0.021357 0.026052 0.028050 0.001522
167 N15 digital_ok 100.00% 99.84% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.140404 0.079529 0.073887
168 N15 digital_ok 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.085445 0.068289 0.032325
169 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.035237 0.036198 -0.015570
170 N15 digital_ok 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.179059 0.105326 0.091080
171 N16 digital_ok 0.00% 100.00% 100.00% 0.00% 0.404961 -0.633641 -0.332901 0.174248 -0.221197 -0.714668 -0.843808 -0.610344 0.030117 0.030560 0.001883
172 N16 digital_ok 0.00% 100.00% 100.00% 0.00% 3.234746 0.946927 2.458056 0.675879 3.353724 3.940494 2.243846 1.898061 0.030547 0.030991 0.002129
173 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.820339 4.166776 9.133039 9.559502 17.096501 14.151368 -6.592147 -4.737729 0.514748 0.503986 0.311741
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.592885 4.402251 3.657204 4.940480 174.489630 151.193625 9.383695 14.219393 0.542605 0.517148 0.335455
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.872331 1.308665 4.762057 2.320450 154.269009 0.059369 29.250589 4.168812 0.564213 0.035086 0.328350
181 N13 digital_ok 0.00% 100.00% 100.00% 0.00% -0.778087 -0.830571 1.383516 1.181365 -0.279585 -0.604691 -0.044485 2.491270 0.067732 0.034879 0.013092
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 3.715676 1.463060 6.004459 1.979456 113.744703 0.310074 8.508674 3.115065 0.567565 0.038284 0.356512
183 N13 digital_ok 0.00% 100.00% 100.00% 0.00% -0.022381 -0.165688 0.362274 0.308983 0.043005 -0.007397 -0.573915 0.974652 0.031035 0.029460 0.001910
184 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 1.039226 0.611668 1.812294 -0.015707 2.069840 0.384109 2.406974 -0.349657 0.029541 0.027507 0.001825
185 N14 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.763772 0.572440 -0.566907 -0.204772 3.498283 -0.378122 0.255264 -0.327693 0.028073 0.028142 0.001291
186 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 3.233866 2.566801 -1.138559 -1.170235 1.543385 2.642992 1.956881 0.678039 0.031455 0.029731 0.002175
187 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 1.095123 2.677997 0.137302 -1.149499 1.333738 7.622655 7.703817 4.299826 0.027207 0.027942 0.001313
189 N15 digital_ok 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.095295 0.130840 0.089036
190 N15 digital_ok 100.00% 99.89% 99.84% 0.00% nan nan inf inf nan nan nan nan 0.094559 0.097126 0.050532
191 N15 digital_ok 100.00% 99.89% 99.84% 0.00% nan nan inf inf nan nan nan nan 0.073856 0.059363 0.028126
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.720588 4.148566 8.914348 9.716396 23.262776 11.149527 -5.435389 -7.217316 0.517772 0.499012 0.318855
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.797088 4.118370 9.335086 9.482002 12.638791 16.295074 -7.039106 -6.672189 0.511036 0.501602 0.312472
200 N18 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.054604 -0.312219 -1.299427 -0.667274 1.087253 -0.736424 2.607022 1.351250 0.039555 0.039382 0.003693
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.610076 4.128270 8.045797 9.243651 50.729380 24.034715 -2.043784 -5.772264 0.540946 0.482879 0.343380
202 N18 digital_ok 100.00% 100.00% 100.00% 0.00% -0.220177 0.258440 -0.230958 -0.881901 -0.471715 -0.138619 -0.557722 7.210098 0.038742 0.067848 0.021576
204 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% -0.302390 0.549558 1.035958 0.093357 0.805015 0.658030 15.558977 0.760397 0.027990 0.026992 0.001018
205 N19 RF_ok 0.00% 100.00% 100.00% 0.00% 0.915099 -0.141162 -1.277999 -0.974990 -0.435594 0.371131 0.182642 2.721971 0.029515 0.029593 0.001705
206 N19 RF_ok 0.00% 100.00% 100.00% 0.00% 0.361131 1.009047 -0.774774 -0.995539 2.392653 0.080636 -0.116004 -0.993549 0.029922 0.029596 0.001817
207 N19 RF_ok 0.00% 100.00% 100.00% 0.00% -0.459981 -0.669535 -0.487157 -0.419831 -0.617129 -0.837418 0.902889 -0.017914 0.045333 0.038624 0.007425
208 N20 dish_maintenance 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.125242 0.159065 0.103165
209 N20 dish_maintenance 100.00% 99.89% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.115840 0.064580 0.039386
210 N20 dish_maintenance 100.00% 99.89% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.146592 0.105314 0.134727
211 N20 RF_ok 0.00% 100.00% 100.00% 0.00% -0.090220 1.340586 -0.727928 -1.304173 -1.161635 -0.270965 -1.141586 1.401781 0.032134 0.030631 0.002265
220 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 0.588737 -0.162783 0.057219 -0.072654 4.834098 3.900628 25.885574 20.917488 0.032369 0.031097 0.002354
221 N18 RF_ok 100.00% 100.00% 100.00% 0.00% -0.769002 -0.704368 -0.287135 -0.228170 2.336126 1.953435 4.461820 5.459435 0.031337 0.030008 0.002204
222 N18 RF_ok 100.00% 100.00% 100.00% 0.00% -0.708933 -0.749969 -0.452388 -0.415851 0.529182 0.764432 5.191909 6.476821 0.029538 0.029453 0.001667
223 N19 RF_ok 0.00% 100.00% 100.00% 0.00% 0.347384 1.039527 -0.681985 -0.942673 -0.019941 0.360110 -0.670943 -0.416283 0.070432 0.053538 0.028458
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.822721 4.109189 9.503080 9.613114 8.748780 14.445449 -7.483008 -6.465565 0.473347 0.465123 0.331216
225 N19 RF_ok 0.00% 100.00% 100.00% 0.00% -0.442605 1.340120 -0.286472 -1.171865 -0.339296 0.576396 -0.746782 2.165784 0.030523 0.032268 0.002943
226 N19 RF_ok 0.00% 100.00% 100.00% 0.00% -0.601544 -0.132247 -0.624933 0.066156 -0.980189 0.483610 -0.634739 -0.892111 0.029448 0.030081 0.001712
227 N20 RF_ok 0.00% 100.00% 100.00% 0.00% 0.849983 -0.309681 -1.104568 -0.659257 -0.724046 -0.453312 -0.481135 -1.159364 0.031644 0.029962 0.002242
228 N20 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.762336 0.443625 -0.033539 -0.579989 -0.776606 -0.462229 -0.552461 -1.075027 0.030093 0.029414 0.001796
229 N20 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.139113 0.643616 0.457216 0.944208 3.041183 2.286236 2.115199 -0.985314 0.029625 0.029652 0.001585
237 N18 RF_ok 0.00% 100.00% 100.00% 0.00% 0.034272 -0.803782 -0.767961 -0.570056 -0.318632 0.228181 0.280864 3.007893 0.029442 0.029390 0.001639
238 N18 RF_ok 0.00% 100.00% 100.00% 0.00% -0.642302 -0.625023 -0.276393 -0.501904 -0.379249 2.389867 -0.837373 -0.887393 0.029865 0.029454 0.001695
239 N18 RF_ok 0.00% 100.00% 100.00% 0.00% -0.705718 -0.699496 -0.196924 -0.155439 -0.284206 -0.548517 -0.171540 -0.289902 0.031481 0.029840 0.002145
240 N19 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.345205 -0.594087 -0.803002 -0.673103 -0.927808 -1.130933 0.070918 -0.359656 0.029487 0.029467 0.001668
241 N19 RF_ok 0.00% 100.00% 100.00% 0.00% -0.707313 -0.617732 -0.516827 -0.345888 -1.229349 -0.656137 -0.732626 -0.938886 0.031074 0.029519 0.002136
242 N19 RF_ok 0.00% 100.00% 100.00% 0.00% -0.608630 0.179248 0.320974 0.695404 -0.987654 -0.748092 -1.000134 -0.712542 0.029990 0.029669 0.001789
243 N19 RF_ok 0.00% 100.00% 100.00% 0.00% 0.335286 -0.168164 0.346109 -0.580450 -0.224363 -1.060429 -0.654399 -0.830409 0.029814 0.029416 0.001712
244 N20 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.046798 -0.253214 -0.760657 -0.822388 -0.804317 0.296726 0.482033 -0.626849 0.030947 0.030265 0.002007
245 N20 RF_ok 0.00% 100.00% 100.00% 0.00% -0.650677 -0.370700 0.097026 -0.207222 -0.575890 -0.673636 -0.552595 -0.106636 0.030080 0.029550 0.001803
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% 3.449300 1.245568 5.267494 -0.882442 122.158218 0.187389 4.606505 -0.232231 0.501731 0.032412 0.251118
261 N20 RF_ok 0.00% 100.00% 100.00% 0.00% -0.701244 -0.428743 -0.497026 -0.506305 -0.652773 -1.067185 0.954872 -0.398448 0.030202 0.029600 0.001807
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% -0.320988 0.115464 0.912510 0.840857 -0.215331 0.639357 1.826061 10.508676 0.025465 0.025463 0.000830
320 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.907977 4.121472 7.759132 7.418043 60.011114 73.085226 -1.186553 3.978664 0.445882 0.420585 0.316775
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 3.705880 4.256365 6.812939 7.530370 87.121833 72.640470 1.565178 0.104751 0.437038 0.420192 0.307681
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 3.784808 4.331090 6.707785 5.264876 91.058240 128.252576 1.518570 8.444141 0.463824 0.441849 0.330268
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.314905 4.314096 6.521062 6.028563 94.420542 118.736909 5.886991 5.492299 0.440248 0.423439 0.309536
333 N12 dish_maintenance 0.00% 100.00% 100.00% 0.00% -0.071038 -0.135958 -0.903647 -0.906476 -0.639717 -1.073829 2.346655 -1.000638 0.034287 0.029799 0.003393
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, 5, 7, 8, 9, 10, 15, 16, 17, 18, 19, 20, 21, 22, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 117, 118, 120, 121, 122, 123, 124, 125, 126, 127, 128, 131, 132, 133, 134, 135, 136, 137, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 324, 325, 329, 333]

unflagged_ants: []

golden_ants: []
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_2460040.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 [ ]: