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 = "2459997"
data_path = "/mnt/sn1/2459997"
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: 2-21-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/2459997/zen.2459997.21300.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1850 ant_metrics files matching glob /mnt/sn1/2459997/zen.2459997.?????.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/2459997/zen.2459997.?????.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 2459997
Date 2-21-2023
LST Range 4.630 -- 14.587 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
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 66
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
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 62 / 93 total a priori good antennas:
3, 7, 9, 15, 16, 17, 29, 30, 31, 37, 38, 40,
42, 44, 45, 53, 54, 55, 65, 66, 67, 71, 72,
81, 86, 93, 94, 101, 103, 107, 109, 111, 112,
121, 122, 123, 124, 127, 128, 136, 140, 145,
147, 151, 158, 161, 162, 163, 164, 165, 170,
173, 181, 182, 183, 184, 187, 189, 191, 192,
193, 202
A Priori Bad Antennas Not Flagged 33 / 105 total a priori bad antennas:
4, 22, 35, 43, 46, 48, 49, 50, 61, 62, 73,
82, 89, 90, 115, 120, 125, 126, 132, 133, 135,
137, 228, 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_2459997.csv

Build DataFrame¶

In [20]:
# build dataframe
to_show = {'Ant': [f'<a href="{ant_to_report_url(ant)}" target="_blank">{ant}</a>' for ant in ants],
           'Node': [f'N{nodes[ant]:02}' for ant in ants], 
           'A Priori Status': [a_priori_statuses[ant] for ant in ants]}
           #'Worst Metric': worst_metrics, 'Worst Modified Z-Score': worst_zs}
df = pd.DataFrame(to_show)

# create bar chart columns for flagging percentages:
bar_cols = {}
if use_auto_metrics:
    bar_cols['Auto Metrics Flags'] = [float(ant in auto_ex_ants) for ant in ants]
if use_ant_metrics:
    if np.sum(list(a_priori_flag_frac.values())) > 0:  # only include this col if there are any a priori flags
        bar_cols['A Priori Flag Fraction in Ant Metrics'] = [a_priori_flag_frac[ant] for ant in ants]
    for ap in antpols:
        bar_cols[f'Dead Fraction in Ant Metrics ({ap})'] = [dead_ant_frac[ap][ant] for ant in ants]
    bar_cols['Crossed Fraction in Ant Metrics'] = [crossed_ant_frac[ant] for ant in ants]
if use_redcal:
    bar_cols['Flag Fraction Before Redcal'] = [redcal_prior_flag_frac[ant] for ant in ants]
    bar_cols['Flagged By Redcal chi^2 Fraction'] = [redcal_flagged_frac[ant] for ant in ants]  
for col in bar_cols:
    df[col] = bar_cols[col]

# add auto_metrics
if use_auto_metrics:
    for label, modz in all_modzs.items():
        df[label] = modz
z_score_cols = [col for col in df.columns if 'Modified Z-Score' in col]        
        
# add ant_metrics
ant_metrics_cols = {}
if use_ant_metrics:
    for ap in antpols:
        ant_metrics_cols[f'Average Dead Ant Metric ({ap})'] = [average_dead_metrics[ap][ant] for ant in ants]
    ant_metrics_cols['Average Crossed Ant Metric'] = [average_crossed_metrics[ant] for ant in ants]
    for col in ant_metrics_cols:
        df[col] = ant_metrics_cols[col]   

# add redcal chisq
redcal_cols = []
if use_redcal:
    for ap in antpols:
        col_title = f'Median chi^2 Per Antenna ({ap})'
        df[col_title] = [cspa[ant, ap] for ant in ants]
        redcal_cols.append(col_title)

# sort by node number and then by antenna number within nodes
df.sort_values(['Node', 'Ant'], ascending=True)

# style dataframe
table = df.style.hide_index()\
          .applymap(lambda val: f'background-color: {status_colors[val]}' if val in status_colors else '', subset=['A Priori Status']) \
          .background_gradient(cmap='viridis', vmax=mean_round_modz_cut * 3, vmin=0, axis=None, subset=z_score_cols) \
          .background_gradient(cmap='bwr_r', vmin=dead_cut-.25, vmax=dead_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .background_gradient(cmap='bwr_r', vmin=crossed_cut-.25, vmax=crossed_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .background_gradient(cmap='plasma', vmax=4, vmin=1, axis=None, subset=redcal_cols) \
          .applymap(lambda val: 'font-weight: bold' if val < dead_cut else '', subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val < crossed_cut else '', subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .applymap(lambda val: 'color: red' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .bar(subset=list(bar_cols.keys()), vmin=0, vmax=1) \
          .format({col: '{:,.4f}'.format for col in z_score_cols}) \
          .format({col: '{:,.4f}'.format for col in ant_metrics_cols}) \
          .format({col: '{:,.2%}'.format for col in bar_cols}) \
          .applymap(lambda val: 'font-weight: bold', subset=['Ant']) \
          .set_table_styles([dict(selector="th",props=[('max-width', f'70pt')])])

Table 2: RTP Per-Antenna Metrics Summary Table¶

This admittedly very busy table incorporates summary information about all antennas in the array. Its columns depend on what information is available when the notebook is run (i.e. whether auto_metrics, ant_metrics, and/or redcal is done). These can be divided into 5 sections:

Basic Antenna Info: antenna number, node, and its a priori status.

Flag Fractions: Fraction of the night that an antenna was flagged for various reasons. Note that auto_metrics flags antennas for the whole night, so it'll be 0% or 100%.

auto_metrics Details: If auto_metrics is included, this section shows the modified Z-score signifying how much of an outlier each antenna and polarization is in each of four categories: bandpass shape, overall power, temporal variability, and temporal discontinuities. Bold red text indicates that this is a reason for flagging the antenna. It is reproduced from the auto_metrics_inspect.ipynb nightly notebook, so check that out for more details on the precise metrics.

ant_metrics Details: If ant_metrics is included, this section shows the average correlation-based metrics for antennas over the whole night. Low "dead ant" metrics (nominally below 0.4) indicate antennas not correlating with the rest of the array. Negative "crossed ant" metrics indicate antennas that show stronger correlations in their cross-pols than their same-pols, indicating that the two polarizations are probably swapped. Bold text indicates that the average is below the threshold for flagging.

redcal chi^2 Details: If redcal is included, this shows the median chi^2 per antenna. This would be 1 in an ideal array. Antennas are thrown out when they they are outliers in their median chi^2, usually greater than 4-sigma outliers in modified Z-score.

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 9.796582 13.373339 10.124122 10.937332 7.639939 9.568962 2.498469 3.252955 0.028843 0.031463 0.003133
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.963767 -0.392647 2.763130 -1.025018 -0.343454 -0.708694 1.907839 -0.481607 0.577431 0.613547 0.406056
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.285014 -0.785259 0.461669 0.391818 0.451129 1.490678 0.606096 0.298403 0.599397 0.610175 0.389328
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.084172 0.145732 -1.040914 0.074117 -0.054346 0.431598 24.427224 30.474800 0.610830 0.625649 0.385590
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.376508 3.742967 3.346655 3.084001 3.840276 5.025790 -3.000453 -2.522990 0.596845 0.610688 0.375249
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.221758 -0.659446 3.252037 -0.762271 -0.295155 -0.095827 5.396427 -0.763972 0.585748 0.626398 0.392038
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.838126 -0.652513 -0.123551 -1.010417 -0.424012 0.270441 1.514105 -0.176602 0.597700 0.624828 0.386019
15 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.023182 13.112497 9.563874 10.359197 7.624461 9.571619 0.794524 1.055915 0.027209 0.026510 0.001406
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.072731 -0.745706 10.093652 0.901560 7.625719 1.808856 1.674305 3.777152 0.033102 0.619485 0.502253
17 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 1.114884 12.653512 0.669229 10.941370 0.996327 9.620041 2.215419 2.103927 0.607582 0.043899 0.541822
18 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.773494 -0.282521 -0.840512 0.475867 -0.081326 -0.300821 -0.291974 1.949744 0.620515 0.639544 0.384698
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.279352 -1.473949 1.747044 -0.631793 0.506451 -0.058759 2.277445 -0.261524 0.615178 0.634477 0.381522
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.380379 0.467818 -0.454520 0.332215 0.763109 1.129324 1.305973 0.665234 0.609720 0.618809 0.374641
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.566261 -0.417360 0.274532 -0.173963 0.755146 1.355975 -0.817711 -1.698982 0.585818 0.603198 0.378763
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
28 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.063480 12.880477 9.757712 10.372631 7.706795 9.608069 1.651749 0.796776 0.029427 0.037055 0.007824
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 1.231014 -0.047362 1.161190 -1.122376 1.079710 0.024441 8.689495 -0.311259 0.606922 0.643011 0.391692
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.410293 -1.009415 1.090112 1.200217 1.216113 -0.445637 1.231098 10.112125 0.631311 0.637837 0.379013
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 22.642938 20.529037 1.355183 3.074045 0.749758 5.169472 10.338400 38.499869 0.506513 0.536906 0.250286
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.509463 13.993329 4.894661 5.398587 7.679167 9.578447 2.426820 1.687320 0.034788 0.048425 0.009166
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.990783 -0.745013 1.365534 -1.079050 0.624719 -1.281709 -0.855367 -0.290321 0.599220 0.598518 0.375570
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.407764 8.235790 1.046347 1.013068 1.518055 2.094114 0.145516 1.166367 0.593642 0.609528 0.402215
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.353004 24.268145 -0.483108 13.529772 0.146789 9.579141 -0.648070 6.692385 0.609472 0.031600 0.489191
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.592481 0.299605 -1.186687 2.962155 -0.087781 0.067646 6.302130 15.961542 0.614515 0.610291 0.391198
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 9.425210 0.842947 9.792773 0.888369 7.707361 0.127183 2.204801 0.744308 0.038782 0.622387 0.470419
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.172728 0.027992 -0.043528 0.321690 1.345624 0.910551 -0.157237 1.492567 0.610951 0.639232 0.378015
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.579848 2.492293 0.733400 8.480859 1.098285 1.871555 1.199242 2.790844 0.625799 0.538558 0.405632
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.066642 0.196612 0.042915 0.897039 -0.828472 0.677375 -1.069371 1.332580 0.631136 0.644046 0.378514
44 N05 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.041251 4.158877 0.524023 0.837982 -0.383176 1.346043 0.653016 35.170355 0.624983 0.633287 0.372583
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.950978 -0.229793 -0.455621 -0.914832 -0.218809 -0.453425 0.195263 -0.683748 0.629153 0.652876 0.392160
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.852374 13.639903 4.803613 5.032563 7.672586 9.529180 5.150789 1.526409 0.031231 0.058291 0.018359
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.081753 0.755540 -0.106474 1.507832 -1.024270 2.071446 -0.392997 -3.108375 0.598007 0.622826 0.384845
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.454403 -0.557696 0.063950 -0.250453 -0.296478 -0.544159 0.226013 0.053987 0.560173 0.602369 0.383860
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.789937 1.202680 0.032348 1.907843 -0.265241 1.393950 -0.121813 -0.347011 0.596507 0.608638 0.399405
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 6.446513 1.687970 0.083252 0.268664 2.458136 0.988358 51.103773 0.443684 0.602384 0.622848 0.394335
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.350739 5.755903 0.078854 0.383957 1.362327 1.488612 3.242847 2.111265 0.616300 0.634927 0.393023
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.919046 1.886087 -0.306659 -0.771637 2.437183 1.423509 18.241043 17.312437 0.626987 0.649387 0.396145
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 25.536533 -0.435542 4.780690 -0.306691 1.281183 0.208310 7.025813 1.389487 0.449416 0.648265 0.379134
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.344101 13.772162 10.172569 10.881278 7.706172 9.594195 1.882358 4.728489 0.027627 0.031426 0.003302
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.346692 0.566921 -0.427702 1.795097 -0.685151 2.781749 -0.696809 0.278224 0.624208 0.653902 0.378403
57 N04 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.767745 1.847627 10.418166 -0.795383 7.569517 1.463396 3.859707 4.648662 0.046806 0.649998 0.505424
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 119.646770 122.862774 inf inf 2759.470462 2743.764913 11389.084919 11386.865619 nan nan nan
59 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 168.122793 168.648325 inf inf 3182.673914 3302.930827 10522.251415 11083.149283 nan nan nan
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.294429 12.729802 -0.284608 10.892749 0.241427 9.567914 14.120246 4.340825 0.629313 0.075104 0.504812
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.697355 -0.188242 0.005891 -0.994540 1.003035 -0.978188 0.541844 2.523052 0.575479 0.613331 0.376130
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.253770 0.915168 -0.766910 1.070764 -0.908770 0.351007 2.196188 -1.884936 0.580578 0.619885 0.382743
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 1.113466 13.152206 -0.220751 5.432714 -0.469877 9.632814 -0.486617 4.400645 0.592755 0.046074 0.472997
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.102581 -0.120982 -0.666412 -0.457180 -0.928435 -1.204872 6.379935 0.031313 0.588589 0.584696 0.367347
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 23.267372 22.017959 13.019299 13.266608 7.824141 9.683493 8.295054 10.287782 0.053092 0.028527 0.019482
66 N03 digital_ok 0.00% 0.00% 0.00% 100.00% 0.637693 0.682477 -1.182420 3.578618 2.415052 1.052159 -0.301375 3.796874 0.215772 0.202083 -0.307308
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.336331 -0.486040 -1.021486 1.973794 -0.586477 1.155233 10.003461 2.540531 0.620560 0.629625 0.381632
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 25.156114 0.334257 13.136063 0.820229 7.689359 0.209314 10.143453 -0.360841 0.035369 0.649053 0.523473
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.643525 -0.168173 0.697538 0.986946 -0.179900 1.971518 0.357529 1.271343 0.630116 0.652749 0.380108
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.986933 -0.200213 -0.036357 0.279242 0.846461 1.509138 -0.160614 -0.575323 0.633041 0.657671 0.374610
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 3.934694 -0.188490 0.795981 1.431325 0.110238 0.108415 0.469722 0.990467 0.628013 0.659953 0.373691
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.384381 13.916516 10.474638 11.223995 7.554801 9.435277 2.354881 2.626325 0.033024 0.038855 0.006022
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.465228 0.904655 -1.145406 0.146928 0.913662 3.100563 -0.188144 0.281665 0.642129 0.659744 0.376879
74 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.654576 0.166427 0.101643 -0.235395 -0.553868 1.305885 -0.629878 4.412259 0.641966 0.656338 0.377467
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 56.123016 24.392577 0.787791 -0.332267 4.943794 3.044862 20.864866 -0.802532 0.317528 0.488379 0.278716
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 28.348047 0.651597 -0.269535 1.279756 2.122966 1.059847 -0.316610 0.940472 0.442702 0.629901 0.374053
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.688675 13.442813 -1.135354 5.427643 -1.153799 9.487067 0.775967 0.022349 0.591878 0.041312 0.462697
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.313759 14.274394 0.435557 5.338055 -0.679122 9.476545 -1.251188 2.254634 0.603330 0.062903 0.467063
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.409626 13.573707 0.238758 9.532718 0.130898 9.308639 0.183376 3.259286 0.566314 0.041190 0.443403
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.995087 1.006467 -0.814430 -0.098926 0.222593 -1.131427 -0.197769 -1.105925 0.601327 0.623766 0.393106
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.151858 0.004218 0.368453 0.701993 0.771383 -0.072267 0.153384 1.421381 0.606188 0.621588 0.381161
84 N08 RF_maintenance 100.00% 64.76% 100.00% 0.00% 18.610397 24.294852 12.756594 13.603336 6.006543 9.412000 8.292698 9.016510 0.207450 0.037572 0.136826
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.295902 1.053134 0.480563 -1.159118 -1.025073 0.032523 -1.869970 -0.222503 0.634395 0.652808 0.377319
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.979624 0.969391 -0.696127 -0.524597 0.981965 0.228091 1.675049 24.475305 0.623128 0.652120 0.363935
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.818033 4.356367 0.646905 -0.028465 12.182105 1.572357 63.920057 33.251270 0.548496 0.657238 0.342929
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.034603 0.534732 0.520387 1.234486 -0.300319 -0.822789 -0.185076 -0.166633 0.632619 0.654494 0.364950
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.608632 0.257171 0.403776 1.180779 -0.732824 0.274307 -0.460846 -0.307548 0.631161 0.655607 0.369847
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.004783 -0.401693 -1.055789 -0.353674 -0.362827 -1.216318 -0.040102 3.427522 0.636793 0.661802 0.376940
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.546034 0.079151 0.661913 0.651658 -0.264212 0.086315 0.100841 -0.045040 0.621395 0.652329 0.381986
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.867865 0.172172 10.037188 0.549031 7.777694 1.573760 0.991079 1.412118 0.036578 0.653762 0.444080
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.202323 13.015217 10.152426 10.952879 7.617549 9.528469 4.368516 3.483700 0.030788 0.024952 0.002809
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.830205 13.228296 10.256910 10.763707 7.582212 9.579757 4.333857 1.418139 0.025324 0.025296 0.001046
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.382510 1.769370 -0.555878 0.729298 3.144524 2.480376 -0.365104 -0.186170 0.442397 0.454689 0.208005
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 4.568303 18.339145 3.496279 1.503450 3.547690 3.303336 -4.406617 -2.639809 0.600784 0.507820 0.355031
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.140115 4.060846 -0.899503 1.229983 -1.225294 0.524602 1.156038 17.709751 0.583854 0.557487 0.366985
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.281242 6.730979 -0.111287 1.363833 0.475905 1.367990 0.326296 -0.103460 0.623521 0.638750 0.374689
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.084768 0.696955 -0.524859 -1.102068 -0.064143 0.815170 -1.029124 11.197075 0.627698 0.651874 0.376527
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.238558 3.126973 1.894264 -1.043520 0.381463 0.087769 0.244062 42.655810 0.632566 0.650190 0.364260
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.922363 56.422646 -0.170970 7.293430 3.545161 -0.088497 2.307273 0.787642 0.636783 0.631408 0.363895
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.448619 0.268736 0.285321 1.217851 0.785953 0.230853 0.146745 -0.284303 0.638312 0.656817 0.365511
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.019495 -0.751731 -0.555973 -0.011026 -0.587737 -1.049528 0.859432 -0.419632 0.636790 0.648466 0.363213
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 3.692586 1.842426 0.002013 -0.216714 0.380073 0.047471 6.025065 7.607221 0.629929 0.660341 0.369850
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.930909 39.812838 10.077950 1.179237 7.675892 3.665477 3.617754 3.860061 0.035785 0.296848 0.160324
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.742378 12.801277 10.126323 10.644197 7.770629 9.670089 1.427947 3.369527 0.058314 0.034104 0.014613
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 23.348219 13.503149 6.820589 0.028381 4.027373 -0.083331 1.523231 -0.511062 0.488824 0.606637 0.336728
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 31.010530 12.693897 1.279156 10.732182 1.447509 9.652016 3.966135 3.937303 0.491684 0.065312 0.322390
112 N10 digital_ok 100.00% 33.84% 97.46% 2.54% 2.564049 12.532952 7.330176 10.818986 0.752085 9.441639 1.251109 1.924775 0.209609 0.077690 -0.102581
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.727566 14.021118 4.534943 5.420502 7.572173 9.470424 3.633731 1.930536 0.034126 0.031395 0.001492
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 4.115726 0.760118 -0.109081 -0.015263 4.129620 -0.787907 1.074152 -0.932920 0.571039 0.611923 0.382086
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.196049 -0.906359 -0.893236 0.094671 -0.910758 -0.686640 -0.348837 2.510782 0.571652 0.600621 0.388083
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.717656 14.249544 10.180575 11.194544 7.592898 9.549028 3.435039 7.131425 0.027816 0.032730 0.003142
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.228304 1.244162 0.145938 0.833515 -0.334910 0.769325 -0.065017 0.400372 0.601548 0.623962 0.386905
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.649731 1.511025 2.819908 -0.751154 0.301751 0.649064 3.335522 -0.593595 0.613906 0.649058 0.380060
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.650872 3.224690 -1.034747 6.023289 -0.475924 -0.656827 16.506071 28.592495 0.640534 0.630159 0.366676
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.862571 6.102126 -0.938660 -0.994772 0.685404 0.389702 0.198484 -0.408340 0.639703 0.662903 0.372654
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.744364 8.256762 0.915254 1.329382 0.614927 0.539217 0.023698 1.261211 0.644580 0.663547 0.373870
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 10.031027 0.140480 10.321598 0.904913 7.555283 0.699998 1.366643 0.882506 0.042877 0.662415 0.459530
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.069677 -0.099275 0.778039 1.243455 1.601942 -0.518992 1.237837 0.367110 0.637670 0.649506 0.373379
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.009753 0.219790 -0.462562 1.319961 0.672947 0.473569 3.693610 3.735079 0.637670 0.651436 0.375826
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 9.578980 0.181780 10.031327 0.731710 7.767134 1.506330 0.918358 0.679468 0.035071 0.661683 0.444190
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% -0.068695 -0.603279 -1.190092 -0.174148 -0.287188 -0.111336 2.068006 6.458143 0.645975 0.660686 0.387268
131 N11 not_connected 100.00% 0.00% 12.65% 0.00% -0.521363 12.783206 0.127076 5.372693 -0.070683 8.572654 -1.483594 0.416877 0.606882 0.254590 0.424779
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.724379 0.136086 0.050466 -1.153448 -1.024379 -0.821948 -0.360455 -0.409545 0.594157 0.602940 0.374059
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.211579 -1.289091 -1.165068 -0.448739 -0.937595 -1.098743 0.170984 2.420721 0.573689 0.604353 0.390874
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.100011 14.138496 4.669709 5.392148 7.589426 9.523757 1.726270 2.234214 0.042230 0.034596 0.004103
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.123435 -1.182912 -1.044989 -1.224182 2.728764 0.561908 1.329902 -0.214389 0.578733 0.610774 0.402652
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.074434 0.035284 9.735434 -0.405499 7.737407 0.161493 2.823899 -0.093686 0.042579 0.606794 0.458770
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.297132 -0.506943 0.187527 -1.197744 0.831389 -0.502939 2.332343 2.755797 0.588766 0.621865 0.389080
139 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.700269 -1.041690 -0.482978 -0.324396 -0.239447 -0.866118 7.676527 5.688866 0.628217 0.648568 0.373600
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.151333 -0.666504 -0.151927 0.524153 0.757536 -0.392192 0.656275 -1.813723 0.629223 0.654169 0.373232
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.301240 12.778111 -0.645516 10.899329 1.430996 9.592119 34.584824 3.078922 0.635348 0.049326 0.526502
143 N14 RF_maintenance 100.00% 99.95% 100.00% 0.00% 10.681797 12.780584 9.955796 10.866631 7.180197 9.583013 1.000721 2.662670 0.101288 0.030613 0.053974
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.450110 0.596862 -0.930849 3.850842 0.337839 0.669598 -0.287428 0.742290 0.640919 0.640207 0.375313
145 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.369056 0.503340 -0.782379 0.025470 -0.658065 -0.153183 -0.574855 -1.273342 0.618244 0.644043 0.374371
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.409453 -1.056213 2.132668 2.654885 0.940654 -0.056915 4.520440 0.561913 0.629243 0.643537 0.374160
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.108787 0.040392 -0.397924 -0.323974 1.018985 2.131016 0.319107 -0.045850 0.638578 0.657641 0.390718
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.281510 -1.294330 -0.472837 -1.101340 -0.187516 0.265871 1.107581 0.302893 0.633804 0.649994 0.392254
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.382676 2.832439 -0.990589 -1.080205 -0.630238 -0.816670 -0.232614 -0.543431 0.630797 0.627195 0.381777
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 22.117954 0.853944 -0.237274 0.800688 2.170967 -0.940160 0.667782 0.653513 0.467706 0.580622 0.340173
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.401794 -0.937082 9.886895 -0.794961 7.762993 -0.000637 4.014725 1.771265 0.044395 0.612576 0.474185
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.745571 12.591866 8.030319 10.686150 2.396454 9.658437 5.790041 4.081205 0.443586 0.040965 0.349111
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.583836 -0.184113 0.239115 0.959692 0.074810 0.870854 0.330242 0.486025 0.595544 0.621049 0.389247
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.231701 -0.212429 -0.127952 0.030396 1.482885 1.563633 10.169574 35.341389 0.608325 0.631941 0.389820
159 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.394352 -0.900922 -0.249604 -0.394820 -0.156898 1.071613 -0.565432 1.197490 0.620631 0.642321 0.379380
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.534559 28.899944 0.225804 -0.033927 0.423698 0.962703 -0.142858 0.758705 0.626323 0.516661 0.343947
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.515211 -1.156316 0.229988 -0.940554 -0.255605 0.413406 7.208388 -0.035323 0.637920 0.655009 0.379153
163 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
164 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 27.011534 0.143533 -0.170117 -0.488836 4.210227 0.231189 4.481844 -0.108551 0.500793 0.654209 0.368707
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.074437 0.138354 0.845214 0.658167 0.234522 -0.406873 0.899159 -2.300897 0.634830 0.656245 0.371841
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.961185 -0.839439 -1.204521 -0.539319 0.676035 0.161833 -0.746257 3.542883 0.640633 0.656122 0.380801
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.686743 -0.885208 0.310601 -0.026271 1.438724 0.833045 0.182155 1.465951 0.635978 0.650749 0.388208
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.463340 -1.040138 -0.687068 -1.212732 0.621169 0.325317 -0.786094 -1.412697 0.636149 0.652480 0.390641
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.645128 -0.552621 10.375445 -0.566302 7.596757 0.324995 4.993093 4.200044 0.043748 0.646029 0.510355
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.838766 1.438014 -1.172006 -0.005891 -1.079114 0.101880 -0.540710 0.718221 0.579754 0.575780 0.359260
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 11.906658 13.599343 4.305248 5.076997 7.821157 9.694635 6.363011 11.086388 0.035984 0.043023 0.004628
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.230147 -0.776027 -0.813258 -0.724936 -0.870507 0.520507 -0.490262 14.350499 0.603315 0.629517 0.390869
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.152660 13.412354 -1.210681 11.019409 0.459453 9.485076 36.201862 4.042281 0.621698 0.056063 0.514857
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.713604 0.157452 1.282882 0.886757 -0.111260 0.626647 0.180665 7.266241 0.624086 0.642134 0.385398
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.071774 12.525558 -0.573272 10.629936 -0.537573 9.645299 11.960757 3.784031 0.635009 0.050724 0.497537
183 N13 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 23.474563 -0.238285 6.590068 -0.875423 7.888261 0.407798 0.609406 -0.458321 0.416883 0.649563 0.393720
185 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.719781 -0.281167 3.540616 0.778838 4.333582 0.077157 -3.199168 -0.848462 0.605792 0.650592 0.388013
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 2.497104 -0.844478 0.543683 -0.317725 -0.149004 -0.520408 -0.100851 -0.878424 0.618885 0.655483 0.382703
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 7.988805 -0.784987 9.390085 -0.067673 5.823712 0.724744 1.661257 -0.393590 0.294947 0.648615 0.457092
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 8.940918 12.416741 9.723237 10.757010 7.932084 9.705517 6.418883 4.911823 0.028396 0.032130 0.001657
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.946234 -1.361201 -0.409812 0.269251 0.161820 -0.727836 0.273612 -1.924809 0.626028 0.645647 0.395264
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 0.224918 -0.532670 1.429754 -0.086282 -0.021132 0.422937 16.224215 0.878054 0.604394 0.624343 0.386273
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 2.374494 6.133642 2.491040 4.135543 2.364449 7.770541 -0.033208 -5.508087 0.587821 0.572544 0.380731
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.969628 0.431550 4.490747 0.979650 6.027521 1.403533 -5.259996 -0.759869 0.553940 0.592731 0.403457
200 N18 RF_maintenance 100.00% 100.00% 53.78% 0.00% 11.485083 36.784843 4.694637 0.048373 7.752278 5.190195 3.078116 9.742996 0.041850 0.216069 0.140965
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.954907 4.536954 2.899105 3.616840 2.458978 6.406191 -1.698724 -4.676962 0.603727 0.607621 0.379334
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.800932 2.485666 1.535402 -1.091795 0.911291 -0.350981 -1.934731 41.444822 0.614510 0.610951 0.373273
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.507131 14.423999 1.461406 -0.785468 -0.228583 0.370365 28.990270 1.764292 0.615389 0.646672 0.386297
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.304760 0.990997 3.302357 -0.682817 5.062371 -0.765764 63.536652 12.039441 0.373650 0.620959 0.446873
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.114785 5.646402 -0.171266 2.747016 1.632697 2.494309 0.095738 0.784423 0.572830 0.511945 0.367946
207 N19 RF_ok 100.00% 100.00% 99.95% 0.00% 226.017546 226.549590 inf inf 3186.276362 3242.621012 10978.121511 11460.679898 0.095718 0.504177 0.471763
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.125748 13.228798 -1.158635 5.450428 -1.067285 9.482856 0.265715 2.082822 0.573813 0.040274 0.487655
220 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.028087 -1.120850 0.557586 -0.439013 -0.694714 -0.762618 4.842971 -1.502833 0.606838 0.614324 0.378881
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.885149 -0.551991 -0.683300 -0.673349 -0.396830 -1.335370 4.840723 -0.987933 0.590964 0.621716 0.379980
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.178028 -0.252084 0.039287 0.120723 -0.373048 -0.680216 6.103389 -1.685474 0.599906 0.626581 0.379629
223 N19 RF_ok 100.00% 100.00% 99.95% 0.00% 232.089025 232.496085 inf inf 3285.790785 3246.874969 11439.124670 11086.449125 0.026614 0.222068 0.166668
224 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
225 N19 RF_ok 100.00% 0.00% 89.89% 0.00% -0.272139 12.763311 0.851472 5.217960 -0.641417 9.285670 -1.824207 2.754427 0.610787 0.143454 0.494033
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.637282 21.335782 -0.371519 0.432474 -0.957920 4.238126 -0.849737 -0.374144 0.602382 0.505247 0.360211
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 3.414768 -0.198283 2.107380 -1.197504 0.781024 -1.172762 14.302718 7.385592 0.498397 0.601971 0.405678
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.761710 0.519842 1.063019 -1.201315 0.549825 -1.109296 0.894726 1.441650 0.580338 0.588183 0.367837
229 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.333734 0.550913 0.813001 1.263734 -0.253270 1.072948 6.887078 -2.954844 0.587324 0.601708 0.392096
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.012796 -0.383616 0.148846 -1.220075 -0.711105 -0.665354 1.204210 -0.609100 0.546037 0.599497 0.394531
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.004218 -0.516278 0.999820 0.473127 -0.260469 -0.794309 -2.139007 -2.453630 0.598377 0.616848 0.388135
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.858612 -0.881808 -0.021050 0.117403 -0.536254 -0.939804 0.040102 1.057651 0.598263 0.616251 0.385080
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.689112 -0.120627 0.315364 -0.360820 -0.534037 -1.211477 15.140466 6.668098 0.592008 0.612667 0.386389
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.814617 -1.007787 -0.154164 0.115479 -0.923183 -0.652241 1.772263 -1.481005 0.590963 0.618603 0.395652
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 20.529523 1.032781 0.397181 1.466185 2.611831 1.615181 -1.282062 -1.163361 0.453864 0.613733 0.387755
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 20.317753 -1.120882 1.108944 -1.180915 2.816525 -0.813413 -1.583066 -0.066349 0.464654 0.600434 0.382770
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.541694 -0.780738 -0.657432 -1.218081 -0.520295 -0.519413 4.323092 9.952514 0.556137 0.602598 0.386833
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.857914 0.236934 0.746587 -1.008250 -0.032485 -1.171204 -2.374526 0.831788 0.584734 0.598065 0.383442
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.187249 13.804786 -0.550386 4.969120 -0.738001 9.581714 -0.085705 0.604907 0.573057 0.039889 0.486853
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 0.048962 1.851930 0.431925 -0.244382 -0.609524 -0.509082 8.549258 1.522719 0.578586 0.574231 0.375699
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 10.754428 13.389675 5.108052 5.409533 -0.444141 -0.368224 0.461755 3.563399 0.560536 0.571817 0.386044
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.895224 1.526559 2.443322 1.072473 1.531381 0.274406 -2.438797 0.629797 0.506336 0.527172 0.388099
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 2.574933 2.543156 1.079681 1.283812 0.560727 1.486707 -0.787013 -2.697645 0.483745 0.508704 0.369473
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.421698 -0.995988 1.177704 -1.160338 0.446032 -1.128413 -2.341866 1.052290 0.519031 0.524629 0.383326
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.344031 -0.225621 -0.171901 -0.461620 0.032485 -0.813067 0.430184 -1.213863 0.486513 0.512679 0.371487
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.917948 3.726712 -0.700773 -1.050513 -0.506218 -0.381742 2.900019 0.476185 0.468340 0.491161 0.354527
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, 7, 8, 9, 15, 16, 17, 18, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 40, 42, 44, 45, 47, 51, 52, 53, 54, 55, 57, 58, 59, 60, 63, 64, 65, 66, 67, 68, 71, 72, 74, 77, 78, 79, 80, 81, 84, 86, 87, 92, 93, 94, 95, 96, 97, 101, 102, 103, 104, 107, 108, 109, 110, 111, 112, 113, 114, 117, 121, 122, 123, 124, 127, 128, 131, 134, 136, 139, 140, 142, 143, 145, 147, 151, 155, 156, 158, 159, 161, 162, 163, 164, 165, 170, 173, 179, 180, 181, 182, 183, 184, 185, 187, 189, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 220, 221, 222, 223, 224, 225, 226, 227, 229, 240, 242, 243, 244, 246, 261, 262]

unflagged_ants: [4, 5, 10, 19, 20, 21, 22, 35, 41, 43, 46, 48, 49, 50, 56, 61, 62, 69, 70, 73, 82, 83, 85, 88, 89, 90, 91, 105, 106, 115, 118, 120, 125, 126, 132, 133, 135, 137, 141, 144, 146, 148, 149, 150, 157, 160, 166, 167, 168, 169, 171, 186, 190, 228, 237, 238, 239, 241, 245, 320, 324, 325, 329, 333]

golden_ants: [5, 10, 19, 20, 21, 41, 56, 69, 70, 83, 85, 88, 91, 105, 106, 118, 141, 144, 146, 148, 149, 150, 157, 160, 166, 167, 168, 169, 171, 186, 190]
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_2459997.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.1
In [ ]: