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 = "2460017"
data_path = "/mnt/sn1/2460017"
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: 3-13-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/2460017/zen.2460017.21283.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/2460017/zen.2460017.?????.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/2460017/zen.2460017.?????.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 2460017
Date 3-13-2023
LST Range 5.940 -- 15.902 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 42, 70
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 66 / 198 (33.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 133 / 198 (67.2%)
Redcal Done? ❌
Never Flagged Antennas 64 / 198 (32.3%)
A Priori Good Antennas Flagged 64 / 93 total a priori good antennas:
3, 5, 7, 15, 16, 17, 31, 37, 38, 40, 42, 45,
53, 54, 55, 56, 65, 66, 67, 70, 71, 72, 81,
83, 86, 93, 94, 101, 103, 109, 111, 112, 118,
121, 122, 123, 124, 127, 128, 136, 140, 147,
148, 149, 150, 151, 158, 161, 165, 167, 168,
169, 170, 173, 181, 182, 184, 187, 189, 190,
191, 192, 193, 202
A Priori Bad Antennas Not Flagged 35 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 50, 57, 61, 62, 64,
73, 89, 90, 115, 120, 125, 132, 133, 135, 139,
179, 220, 228, 229, 237, 238, 239, 241, 245,
320, 324, 325, 329, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2460017.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% 0.00% 100.00% 0.00% 1.007285 13.321359 0.112639 10.300872 1.123122 8.765206 -0.503069 1.071276 0.547980 0.038692 0.481750
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.902461 11.714394 2.192983 2.117169 2.024690 5.816571 -2.217040 19.648662 0.544279 0.434129 0.350869
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.083299 13.106878 9.620942 10.031534 7.404202 8.817073 0.175215 0.276613 0.039934 0.035048 0.002809
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.833461 0.000301 -0.797410 -0.114196 0.227509 1.111752 3.436093 8.809473 0.563470 0.574445 0.352929
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.202732 -1.476993 -0.181609 0.277891 0.216939 0.765230 1.192165 1.350672 0.561682 0.569169 0.346079
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.396318 -0.500815 3.062921 -0.850245 0.248814 -0.098653 2.146977 -0.324502 0.539024 0.567789 0.351855
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.126426 -1.220117 -0.058074 -1.002682 -1.195854 0.115428 -0.831419 0.096531 0.555157 0.561829 0.348322
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 26.818268 -0.328250 2.880674 2.816064 2.483193 0.443684 0.387314 3.559000 0.405670 0.552779 0.352270
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% -0.534734 13.280007 3.027057 10.276617 0.240592 8.754805 2.811149 1.019411 0.542172 0.033069 0.440737
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.576472 6.727118 0.779210 9.195472 0.790612 4.672614 -0.336668 2.628617 0.568170 0.343156 0.427444
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.258834 7.746426 9.648155 0.528971 7.385450 4.428462 0.171988 27.551686 0.034882 0.381460 0.306931
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.324374 -0.504177 -0.702463 0.251780 -0.110082 -0.423859 -0.473338 3.046028 0.575306 0.588111 0.350910
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.948073 -1.311508 2.061225 -0.850702 1.348084 1.251685 2.406154 -0.071760 0.562189 0.585173 0.349301
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.096348 -0.178056 -0.235713 0.280835 0.624494 1.126354 0.861509 0.876258 0.559939 0.562543 0.340734
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.813276 -0.223540 0.008031 -0.070375 0.096054 0.379781 -0.809629 -1.012945 0.531397 0.544774 0.343392
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.140618 12.443717 9.707889 10.121264 7.370286 8.817654 1.598443 1.423031 0.029375 0.029801 0.000587
28 N01 RF_maintenance 100.00% 100.00% 13.18% 0.00% 9.523191 18.143203 9.483525 3.724113 7.384212 4.262241 -0.078365 22.350431 0.028332 0.249171 0.188369
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.439046 -0.150226 2.579218 0.648749 0.112743 1.459767 3.409872 2.006181 0.567418 0.581729 0.350651
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.469675 -0.715101 0.529943 -1.172974 0.621866 0.459318 3.644913 -0.168513 0.571026 0.597498 0.353623
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.782593 -1.193334 1.301191 1.162142 1.414284 -0.346255 1.321452 9.242128 0.587060 0.590521 0.346375
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 19.479965 23.263555 1.402230 3.180511 3.675111 0.487834 8.105245 9.679692 0.471569 0.471170 0.213124
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.145013 13.972261 4.696577 5.005359 7.407755 8.828312 1.884708 1.775678 0.034000 0.042671 0.005604
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.579481 -0.037465 0.126137 -1.267258 -0.513198 -1.333877 1.370684 -0.274629 0.536997 0.532569 0.335672
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.103507 7.594916 1.118247 0.956936 1.819242 2.208109 -0.411130 0.261718 0.540092 0.544076 0.368447
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.473401 21.165612 -0.365402 12.103078 0.199007 8.776249 0.080998 3.414445 0.558941 0.031046 0.441636
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.524123 0.468549 -1.283136 2.577012 0.142054 -0.492445 0.627428 8.100029 0.568108 0.549210 0.367695
40 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.172618 0.925227 2.550620 -0.162398 -0.196058 1.283339 2.284850 31.843430 0.560960 0.580588 0.356890
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.575606 0.822408 1.634279 0.926321 1.613167 -0.175922 0.014787 0.246906 0.579147 0.591431 0.354501
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.896368 2.947398 2.789926 -0.530997 2.154237 0.877139 0.735300 2.488671 0.232416 0.231510 -0.277895
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.144388 -0.062226 -0.356856 0.813129 -1.075113 0.840884 -0.835906 0.381891 0.593252 0.596972 0.345882
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.972496 0.111473 -1.156469 0.296820 -0.724111 0.908647 -0.771735 -0.056442 0.593914 0.606845 0.349644
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 1.053728 3.745516 0.503169 0.937763 0.056355 1.095833 -0.178992 10.512510 0.580869 0.589770 0.344116
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.514236 -0.407023 -0.421886 -1.037470 0.255937 -0.618728 -0.559901 -0.716772 0.579705 0.599785 0.356425
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.186512 13.661135 4.607605 4.659283 7.344959 8.732441 2.086484 0.541544 0.031862 0.049344 0.011644
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.364934 1.080530 -0.577378 1.393171 -1.107131 1.867094 -0.085173 -1.727134 0.536261 0.561181 0.346998
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.472246 -0.025422 -0.450648 -0.150073 -0.330507 -0.336530 -0.024520 4.952570 0.501152 0.537637 0.345360
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.981897 0.537403 -0.006090 1.749686 0.320311 1.462633 0.303953 0.632416 0.540915 0.541650 0.364225
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.727689 1.689387 -0.068674 0.335298 1.483454 1.765088 40.768029 1.286841 0.551624 0.559782 0.362119
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.200979 5.460051 0.503350 0.225374 1.681224 1.444726 1.611473 1.179488 0.568545 0.574970 0.362867
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.166263 1.660150 0.014792 -0.565486 2.812861 0.257470 6.872972 0.938213 0.580465 0.590757 0.363855
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 9.507843 4.333038 2.307112 0.101233 5.284778 2.667016 1.584561 2.560058 0.300150 0.348595 0.154763
55 N04 digital_ok 100.00% 9.99% 100.00% 0.00% 0.469664 50.480992 0.760116 6.340068 0.590561 8.775099 2.059009 0.867673 0.249280 0.037802 0.085326
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.729444 0.130952 -0.765123 2.030757 -0.511677 5.842517 -0.219323 0.914091 0.595500 0.595555 0.340933
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.698773 -0.391427 2.328583 -0.704633 2.272487 0.659255 -1.787180 1.295188 0.592114 0.605747 0.341974
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.129236 12.812446 9.620680 10.234953 7.327400 8.760948 1.393781 1.304736 0.034810 0.034736 0.002141
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.058330 0.577454 9.680805 1.406846 7.223844 1.911386 0.314460 0.986798 0.043020 0.594197 0.451767
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.433126 12.723766 -0.177371 10.259740 0.335199 8.751397 0.561680 2.145832 0.579653 0.062172 0.463173
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.588837 -0.199594 -0.034344 -1.009756 -0.335603 -1.284829 -0.447392 0.009762 0.522344 0.556731 0.341959
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.625391 0.599948 -0.577372 0.807042 -0.983206 0.209846 1.302786 -0.423086 0.521540 0.559820 0.347862
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 1.215673 13.192235 -0.502993 5.030554 -0.151718 8.849673 -0.315955 2.321048 0.533474 0.043878 0.418261
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.297237 -0.032531 -1.156371 -0.528315 -0.650106 -1.005754 2.171122 -0.024904 0.525935 0.519831 0.334420
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 21.687690 20.834139 12.434178 12.497324 7.464623 8.857853 4.424209 5.680763 0.022536 0.024539 0.002254
66 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.246770 1.147574 6.666679 2.259594 0.165014 0.371284 4.817298 3.837156 0.501179 0.559081 0.380904
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.190883 0.016606 -1.272184 1.090440 -0.392079 1.271024 5.632613 2.461886 0.572881 0.567205 0.359719
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 23.500158 0.544774 12.563954 0.712086 7.293507 0.505848 4.629113 -0.480628 0.031683 0.590932 0.452431
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.735445 0.684340 0.316189 2.859471 0.346230 0.884669 2.172852 1.273009 0.590121 0.584832 0.344409
70 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.155529 1.412287 1.241203 3.140153 2.944918 0.886287 4.172340 0.627273 0.244971 0.230476 -0.275619
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.116272 -0.538942 0.166493 4.132867 0.554087 -0.042951 -0.232677 0.219111 0.593374 0.587338 0.335740
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 1.110256 1.855392 1.456277 6.933687 0.815647 1.009316 0.857020 16.951738 0.597679 0.535752 0.356450
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.388877 0.212745 -0.889280 -0.654442 0.931773 0.139643 -0.375215 -0.075989 0.603632 0.613235 0.345996
74 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.733728 0.015764 -0.304325 -0.341546 -0.180954 1.276043 -0.298429 4.027985 0.599716 0.611143 0.349942
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 46.325988 18.933871 0.428118 -0.551670 3.736438 2.573210 3.264185 0.092680 0.329963 0.463247 0.263683
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 27.087895 0.533966 -0.405594 1.109337 1.697969 0.986770 1.020529 -0.352043 0.386589 0.565062 0.340496
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.952356 13.471854 -0.956457 5.044055 -0.996444 8.702000 0.550712 -0.236141 0.528888 0.039230 0.426619
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.668570 14.293164 0.038069 4.953037 -0.981947 8.706443 -0.646453 0.830887 0.541747 0.051333 0.435457
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 123.974671 56.352964 29.303648 25.606434 38.622402 23.434021 490.704175 442.739347 0.021138 0.016385 0.003567
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 27.983637 55.048395 22.629695 23.944024 12.106397 15.018940 391.835707 375.563277 0.020670 0.018009 0.002301
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 24.929540 32.347546 20.431751 22.756611 10.324078 18.151176 243.320291 286.614367 0.021176 0.019175 0.001949
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.982492 23.069129 9.303909 12.820079 0.938881 8.685211 5.253890 3.875421 0.445145 0.042416 0.347247
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.696789 0.227003 -0.946588 -0.646920 -0.342743 0.338206 -0.067304 0.393839 0.591110 0.598058 0.349412
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.558853 1.204988 -0.458470 -0.054364 0.312153 0.569418 0.516045 17.931589 0.592925 0.601908 0.339384
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.840978 6.572815 -0.271611 -0.046422 0.599791 0.280728 1.784924 1.706169 0.601888 0.619687 0.343102
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.595729 0.547946 0.665709 0.895755 0.479685 -0.566077 0.064659 -0.108608 0.594233 0.607636 0.333870
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.342690 0.354180 0.325952 0.970520 -0.256627 0.215823 -0.766418 -0.331135 0.595463 0.608394 0.339785
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.230628 -0.327374 -0.807624 -0.494893 -0.182780 -1.378052 -0.003518 1.215374 0.593937 0.612486 0.345905
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.379063 -0.288341 0.683273 0.431447 0.107662 -0.229541 0.003518 0.212807 0.570065 0.597452 0.347951
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.570092 -0.038544 9.602962 0.495322 7.414443 1.885209 -0.008485 0.517247 0.034804 0.595815 0.403746
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.826786 12.967015 9.737362 10.327913 7.284389 8.727927 1.528033 1.328989 0.029638 0.025082 0.002554
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.439322 13.209966 9.835934 10.140977 7.337933 8.768014 0.506900 0.381798 0.025348 0.025491 0.001060
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.189359 1.666173 -0.997796 0.598477 2.101378 2.120751 -0.375514 -0.248488 0.396468 0.409619 0.188702
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 3.989397 18.399647 2.990648 1.221200 3.420324 2.649540 -2.507471 -1.534269 0.537883 0.447834 0.330878
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.305503 3.605195 -1.048543 0.653450 -1.131476 0.307713 -0.656273 12.706943 0.523548 0.496369 0.338376
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.965028 7.476350 -0.104356 1.278034 0.622303 1.507598 -0.225461 -0.152261 0.577658 0.582681 0.353590
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.434970 0.993491 -1.201771 -0.608497 0.134873 0.843441 -0.841646 7.358547 0.586048 0.598577 0.347805
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.626505 2.808859 7.510139 -0.732640 -0.362175 0.283898 2.492478 15.842739 0.503887 0.596802 0.355933
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.003765 53.604909 -0.744493 6.603242 1.735312 -0.486503 0.896969 0.689139 0.595578 0.583415 0.334656
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.046493 0.179913 0.493657 1.020287 0.997791 0.069558 -0.196217 0.051457 0.598247 0.608411 0.336050
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.134286 1.200462 -0.782528 -0.348057 -0.676450 -0.519530 0.017682 -0.412607 0.599043 0.611960 0.338675
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 3.294027 0.077189 0.178744 -0.306539 0.400309 0.467620 1.867211 1.637500 0.589219 0.608720 0.339297
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.587101 38.112920 9.649932 1.133328 7.357540 2.629882 1.223183 1.540787 0.033856 0.283033 0.147099
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.402468 12.784245 9.685898 10.016517 7.389735 8.829050 0.157262 1.441276 0.052458 0.034003 0.012712
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.690424 9.750766 5.185672 -0.127068 1.414777 0.588611 -0.099580 -0.079972 0.552761 0.551497 0.338099
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 17.148124 12.710336 0.684381 10.100143 5.680691 8.812072 18.364039 1.683877 0.487361 0.051475 0.361895
112 N10 digital_ok 100.00% 78.66% 100.00% 0.00% 1.658192 12.339101 6.955322 10.164696 0.524086 8.543474 0.301804 0.808772 0.175865 0.060783 -0.094467
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.355342 14.043141 4.365460 5.039053 7.261761 8.695258 1.349176 0.712610 0.033613 0.031479 0.001315
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 12.119073 0.729128 4.521922 -0.296781 7.232812 -0.906558 -0.240335 -0.378472 0.043322 0.539686 0.418166
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.108481 -0.848779 -1.179861 -0.055956 -1.113280 -0.767236 -0.686576 -0.538106 0.506331 0.528169 0.350123
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.995633 43.004901 21.106266 22.784292 12.867170 15.894412 314.031534 308.005120 0.017728 0.016423 0.001254
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 36.113674 38.919902 26.291649 26.190574 17.986660 20.733839 568.766554 538.204853 0.018908 0.019656 0.001139
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.051891 1.617787 2.734184 -0.776850 0.190078 0.935672 2.311730 1.244783 0.571806 0.596024 0.350397
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.149935 2.748211 2.294007 5.729197 2.065718 -0.522429 11.332922 19.431774 0.587667 0.576463 0.331322
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.731740 5.878025 -0.859974 -1.019165 -0.328910 0.434427 -0.655399 -0.718062 0.601322 0.613394 0.340673
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.850291 5.406220 3.371218 1.511361 4.477983 1.726041 -2.808252 -1.768502 0.589342 0.617467 0.347589
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 9.677247 0.813416 9.903163 0.758618 7.244533 0.535428 0.078360 0.487460 0.039797 0.608469 0.416660
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.856289 0.182295 0.515704 0.878461 0.331016 -0.058442 0.976097 0.425194 0.595910 0.604207 0.340914
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.319390 6.089365 -0.803872 1.947764 -0.312548 -0.366761 2.347430 -0.099273 0.595228 0.598257 0.345241
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 9.265495 -0.310912 9.601673 2.567528 7.406759 0.552953 -0.005360 1.257947 0.031590 0.589285 0.387186
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.160077 -0.285249 -1.056362 -0.501935 -0.269725 -0.412071 -0.181426 4.534753 0.582374 0.591797 0.363301
131 N11 not_connected 100.00% 0.00% 47.49% 0.00% -0.831663 12.507023 -0.306560 4.895844 -0.694771 7.632219 -0.990090 0.212449 0.539245 0.221584 0.390719
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.910434 0.704167 -0.527878 -1.154445 -0.511006 -1.021481 -0.289207 0.065893 0.527686 0.526292 0.344114
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.855019 -0.984815 -1.124301 -0.499050 -1.289319 -1.009980 -0.474508 0.958141 0.503149 0.533923 0.356925
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.926430 14.430174 3.959381 4.481268 7.239557 8.686267 0.064211 0.673670 0.039501 0.034625 0.003023
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.784480 -1.128032 -0.858806 -1.271668 3.452514 0.488925 1.675553 0.164400 0.514236 0.537832 0.368744
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 8.850718 -0.771551 9.318631 -0.435691 7.374281 0.820344 0.905584 -0.336525 0.037322 0.541984 0.398122
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 30.712945 45.827108 23.641716 25.164916 21.036331 11.652021 452.226397 402.188828 0.020079 0.018434 0.001759
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.850280 1.475335 1.100701 -1.006655 0.338431 -0.872511 -1.321813 -0.014147 0.562721 0.555156 0.335934
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 15.611037 -0.246467 -0.494754 -0.190072 16.613540 0.628769 178.331375 20.567145 0.517141 0.592344 0.331997
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.712134 -0.690786 0.082741 0.418311 1.278110 -0.665699 0.394738 -0.834907 0.590178 0.605370 0.340279
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.730289 12.812925 -0.265209 10.264674 2.266360 8.785256 23.552503 1.698251 0.595967 0.042842 0.491246
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.128568 12.679884 9.549077 10.230318 6.849538 8.807262 -0.112966 1.013814 0.088424 0.029609 0.047413
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.670959 0.401729 -0.798021 3.065297 0.210723 -0.175525 -0.466857 0.470831 0.602626 0.595551 0.344949
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.058651 -0.297667 1.681825 0.871127 0.710929 2.258842 -0.116290 -0.991656 0.589355 0.609255 0.349164
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.480867 -0.571247 -1.022831 -0.848421 -1.260058 -1.464442 -0.662405 -0.303300 0.562689 0.582047 0.343828
147 N15 digital_ok 100.00% 98.11% 97.84% 0.00% 177.551373 177.334439 inf inf 2976.362832 3014.081180 5183.676064 5366.398997 0.398161 0.383868 0.350614
148 N15 digital_ok 100.00% 97.95% 98.33% 0.00% 202.518057 202.117681 inf inf 2941.654954 2949.318953 4987.792688 4989.349019 0.365703 0.322096 0.343934
149 N15 digital_ok 100.00% 97.95% 97.84% 0.00% 223.772501 223.718549 inf inf 3904.438006 3905.016688 7976.804697 7980.011361 0.406569 0.387956 0.400296
150 N15 digital_ok 100.00% 97.78% 97.68% 0.00% 223.248820 223.656574 inf inf 3926.945348 3930.341090 6726.834280 6316.103827 0.412156 0.400022 0.343456
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 21.015109 0.502370 -0.513002 0.939569 1.953786 -1.018949 0.251479 12.765539 0.416046 0.497456 0.303947
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.197777 -0.976195 9.461483 -1.010667 7.394226 0.234395 1.512146 1.159458 0.038273 0.543094 0.408388
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.943688 12.609829 7.890362 10.056708 2.347573 8.824442 2.614818 1.774608 0.368656 0.037335 0.285362
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.658681 -0.409056 0.314691 0.913387 0.533573 0.937860 -0.596935 0.068209 0.539589 0.556225 0.356987
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.499236 -0.170773 0.208940 0.051720 1.771360 1.365961 2.031532 18.431944 0.555101 0.572051 0.355868
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.386374 24.550813 -1.013925 -0.495094 -0.859113 2.327566 -0.090240 2.141201 0.531059 0.432547 0.313739
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.250501 -0.839794 -0.194173 -0.321117 0.258501 1.204494 -0.584858 0.783023 0.577948 0.591760 0.347592
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.187292 27.648953 0.325294 -0.077400 0.857391 0.836668 0.038313 1.148220 0.585363 0.470206 0.317747
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.873951 -0.974260 -0.301335 -1.139087 -0.165474 0.393200 1.163549 0.238375 0.597111 0.608039 0.346293
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.756994 1.168480 0.123667 0.599820 0.597671 1.087157 -0.104120 1.403026 0.598913 0.608073 0.349012
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.468741 0.306049 -0.172004 1.456990 -0.197111 2.328385 0.946480 1.477613 0.595442 0.599832 0.340776
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 23.399425 0.072390 -0.417113 -0.624556 1.681555 0.449051 3.911983 -0.347303 0.482048 0.602984 0.344154
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.798566 -0.033571 0.866603 0.553720 0.815901 -0.649814 0.428956 -0.884050 0.584079 0.599214 0.342750
167 N15 digital_ok 100.00% 97.51% 97.95% 0.00% 228.617412 228.971016 inf inf 2933.298353 2907.437242 5229.167558 5109.052966 0.447923 0.387451 0.376259
168 N15 digital_ok 100.00% 98.00% 98.11% 0.00% 184.994545 184.046457 inf inf 2953.494139 3144.796296 4754.084223 5080.791959 0.388833 0.388036 0.339173
169 N15 digital_ok 100.00% 97.62% 98.06% 0.00% 173.289290 172.057364 inf inf 2330.610106 2497.447317 5267.041236 5478.590294 0.366375 0.354649 0.336114
170 N15 digital_ok 100.00% 98.00% 98.22% 0.00% 181.024386 181.763372 inf inf 2881.432463 2882.052326 5703.538207 5707.097979 0.427088 0.357816 0.334186
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.452443 1.093696 -0.649752 0.345580 -0.954905 -0.527803 -0.509538 0.956200 0.510800 0.497480 0.333099
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 11.528780 13.289252 4.115335 4.684002 7.433133 8.839309 2.577091 5.154014 0.034905 0.039879 0.003263
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.421799 -0.450152 -0.030963 0.514167 -0.236960 1.598319 -0.757309 -0.257702 0.545789 0.568098 0.352970
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.138567 13.382142 -1.056477 10.387945 1.130337 8.738045 15.299025 2.370967 0.575906 0.048952 0.481861
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.078647 -0.074289 0.913928 0.622097 -0.404906 0.820598 -0.505840 3.881162 0.582411 0.589511 0.351312
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.065760 12.508848 -0.418865 9.992828 -1.005089 8.818235 5.891596 1.439243 0.594647 0.044560 0.455705
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.236669 0.678022 0.537848 0.847262 1.410596 0.614532 0.918455 0.007297 0.584073 0.594015 0.340605
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 12.559810 -0.441984 5.849724 -0.846840 4.392185 0.693590 9.753117 0.223715 0.467019 0.601419 0.361514
185 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.228351 -0.391484 3.066878 0.674392 3.955125 -0.269383 -2.517887 0.146518 0.567045 0.600486 0.354053
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.041173 -0.967920 0.152411 -0.302951 -0.672532 -0.993724 -0.394233 -0.745669 0.592959 0.599999 0.351118
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.259156 -1.074042 -1.016000 -0.490814 0.451172 0.464683 7.519985 0.029785 0.575142 0.588124 0.352287
189 N15 digital_ok 100.00% 97.73% 97.24% 0.00% nan nan inf inf nan nan nan nan 0.456451 0.462956 0.435552
190 N15 digital_ok 100.00% 97.84% 97.51% 0.00% nan nan inf inf nan nan nan nan 0.434456 0.444601 0.396983
191 N15 digital_ok 100.00% 97.62% 97.84% 0.00% 207.450863 206.506624 inf inf 2956.843926 2955.281342 5317.094296 5334.907768 0.409094 0.382612 0.347016
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 1.659590 6.147413 1.987397 3.884861 2.443851 7.271473 -0.143409 -3.015305 0.522953 0.494726 0.351833
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.588445 0.882214 4.064618 1.244182 5.928662 1.575196 -3.315692 -0.552963 0.489304 0.520658 0.364782
200 N18 RF_maintenance 100.00% 100.00% 49.27% 0.00% 11.166016 33.948676 4.493354 -0.115899 7.395161 3.433210 0.965207 11.187440 0.040786 0.209558 0.137386
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.673485 4.428986 2.472354 3.333016 2.399151 5.962483 -0.815805 -2.265714 0.558986 0.554625 0.342550
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.563349 0.921430 1.198406 -1.148349 0.388934 -0.524280 -0.710032 35.733919 0.571315 0.563008 0.339040
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.324900 13.307978 1.209092 -0.879925 0.045134 0.617025 9.271601 2.363121 0.578262 0.594789 0.350274
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.040828 0.194015 3.873261 -1.280373 5.103956 -0.430232 13.309019 3.065688 0.312022 0.571071 0.418392
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.415841 5.843987 -0.538781 2.607145 4.774853 2.286783 0.115389 0.439207 0.529409 0.449341 0.344789
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.853061 2.242887 -0.845248 -0.485946 -1.111720 -0.921868 6.436596 0.122507 0.547304 0.537729 0.339712
208 N20 dish_maintenance 100.00% 97.78% 98.16% 0.00% nan nan inf inf nan nan nan nan 0.437574 0.308185 0.385588
209 N20 dish_maintenance 100.00% 97.73% 98.06% 0.00% nan nan inf inf nan nan nan nan 0.359531 0.334754 0.331406
210 N20 dish_maintenance 100.00% 97.30% 97.68% 0.00% nan nan inf inf nan nan nan nan 0.448588 0.372794 0.340704
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.084229 13.256013 -1.232246 5.065247 -1.002719 8.721334 -0.170276 0.758343 0.506565 0.038596 0.428440
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.078206 -0.731034 0.172586 -0.493040 -1.075317 -0.607896 1.514417 -0.867994 0.560007 0.558783 0.343741
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.040614 -0.218564 -1.272915 -0.721117 -0.597930 -1.378093 4.491730 -0.468538 0.543596 0.565995 0.345212
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.267343 0.006558 -0.473939 -1.196460 -0.646481 26.247354 1.931388 -0.349263 0.554159 0.547492 0.339993
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.462215 -0.889485 -1.032126 -0.411472 -1.175258 -0.926535 0.865760 8.095732 0.545566 0.568948 0.347201
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.755383 5.513401 4.218955 3.772183 6.236156 6.886426 -3.111419 -2.317596 0.524155 0.542666 0.342313
225 N19 RF_ok 100.00% 0.00% 94.71% 0.00% -0.805715 12.833072 0.342101 4.830814 -1.009125 8.484937 -1.243263 1.107575 0.558305 0.122437 0.459531
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.513814 19.480792 -0.692359 0.467399 -1.136251 2.973158 -0.648902 -0.581122 0.544067 0.452578 0.333061
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 3.419442 0.707641 2.202306 -0.560713 0.899109 -1.053179 5.496226 4.923114 0.426274 0.522629 0.363855
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.044692 0.325621 0.624455 -1.204734 -0.098772 -0.943183 0.864823 1.549016 0.525257 0.516003 0.339223
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.185759 0.630091 0.557364 1.087041 -0.340051 1.015999 -0.942580 -1.772757 0.524332 0.531227 0.359267
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.002538 -0.212217 0.362577 -1.195379 -0.938414 -0.989122 -0.059985 -0.385133 0.490824 0.537507 0.356103
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.325613 -0.218050 0.546344 0.145384 -0.575390 -1.042941 -1.164310 -1.097784 0.552351 0.556368 0.353007
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.018217 -1.224978 -0.301438 -0.470106 -1.019197 -1.171626 -0.267317 2.019097 0.550452 0.555699 0.350069
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.261224 0.226598 0.225507 -0.953416 -0.840369 -1.410195 8.240762 6.533704 0.498137 0.555598 0.363886
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.821929 -0.969259 -0.579118 0.006090 -1.185545 -0.897343 0.495579 -0.513431 0.539977 0.559616 0.360046
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 21.434145 0.518897 -0.354613 0.981559 1.700943 0.656464 -1.087302 0.322767 0.408716 0.553377 0.353803
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 18.307962 -0.804290 0.774897 -1.130992 3.314827 -0.909637 2.296486 0.148362 0.433644 0.534695 0.348519
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.583033 -0.646579 -0.465695 -1.150067 -0.965975 -0.946488 2.834493 6.463930 0.494408 0.537866 0.354674
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.032531 0.499682 0.742808 -0.649048 -0.104662 -1.021878 -1.815494 0.246717 0.531689 0.529530 0.350334
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.470210 13.804396 -0.972636 4.588043 -0.892098 8.801546 -0.994759 0.014759 0.509809 0.037339 0.429225
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% -0.723487 -0.172209 -0.225690 -0.410997 -0.914164 -1.145960 17.317462 4.829651 0.518459 0.521009 0.347533
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 10.218282 12.908938 4.994393 4.928364 -0.448743 -0.574756 -0.305356 2.768180 0.496749 0.504145 0.348213
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.122633 1.125446 1.937534 0.953346 1.085043 0.134717 -1.725651 1.474724 0.447190 0.458140 0.344691
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.837520 2.600670 0.868246 1.219479 -0.108438 1.250562 -1.363831 -1.667770 0.431517 0.439869 0.327581
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.900037 -0.771038 0.772382 -1.280487 0.058442 -1.177425 -1.639195 0.320644 0.459294 0.455404 0.341979
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.583749 -0.093818 -1.088270 -1.092571 -0.286253 -0.847739 2.392361 -0.133752 0.424224 0.439927 0.327275
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.711618 1.425533 -0.497080 -1.011511 -0.783012 -0.855204 0.501492 -0.033473 0.400561 0.426810 0.316521
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, 5, 7, 15, 16, 17, 18, 27, 28, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 49, 51, 52, 53, 54, 55, 56, 58, 59, 60, 63, 65, 66, 67, 68, 70, 71, 72, 74, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 92, 93, 94, 95, 96, 97, 101, 102, 103, 104, 108, 109, 110, 111, 112, 113, 114, 117, 118, 121, 122, 123, 124, 126, 127, 128, 131, 134, 136, 137, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 161, 165, 167, 168, 169, 170, 173, 180, 181, 182, 184, 185, 187, 189, 190, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 221, 222, 223, 224, 225, 226, 227, 240, 242, 243, 244, 246, 261, 262]

unflagged_ants: [8, 9, 10, 19, 20, 21, 22, 29, 30, 35, 41, 43, 44, 46, 48, 50, 57, 61, 62, 64, 69, 73, 85, 88, 89, 90, 91, 105, 106, 107, 115, 120, 125, 132, 133, 135, 139, 141, 144, 145, 146, 157, 160, 162, 163, 164, 166, 171, 179, 183, 186, 220, 228, 229, 237, 238, 239, 241, 245, 320, 324, 325, 329, 333]

golden_ants: [9, 10, 19, 20, 21, 29, 30, 41, 44, 69, 85, 88, 91, 105, 106, 107, 141, 144, 145, 146, 157, 160, 162, 163, 164, 166, 171, 183, 186]
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_2460017.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.dev13+gd6c757c
3.2.3.dev121+gc95c57f
In [ ]: