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 = "2460078"
data_path = "/mnt/sn1/2460078"
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: 5-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/2460078/zen.2460078.42105.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 361 ant_metrics files matching glob /mnt/sn1/2460078/zen.2460078.?????.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/2460078/zen.2460078.?????.sum.known_good.omni.calfits. Skipping redcal chisq.

Figure out some general properties¶

In [9]:
# Parse some general array properties, taking into account the fact that we might be missing some of the metrics
ants = []
pols = []
antpol_pairs = []

if use_auto_metrics:
    ants = sorted(set(bl[0] for bl in auto_metrics['modzs']['r2_shape_modzs']))
    pols = sorted(set(bl[2] for bl in auto_metrics['modzs']['r2_shape_modzs']))
if use_ant_metrics:
    antpol_pairs = sorted(set([antpol for dms in ant_metrics_dead_metrics.values() for antpol in dms.keys()]))
    antpols = sorted(set(antpol[1] for antpol in antpol_pairs))
    ants = sorted(set(antpol[0] for antpol in antpol_pairs) | set(ants))
    pols = sorted(set(utils.join_pol(ap, ap) for ap in antpols) | set(pols))
if use_redcal:
    antpol_pairs = sorted(set([ant for cspa in cspa_med_dict.values() for ant in cspa.keys()]) | set(antpol_pairs))
    antpols = sorted(set(antpol[1] for antpol in antpol_pairs))
    ants = sorted(set(antpol[0] for antpol in antpol_pairs) | set(ants))
    pols = sorted(set(utils.join_pol(ap, ap) for ap in antpols) | set(pols))

# Figure out remaining antennas not in data and also LST range
data_files = sorted(glob.glob(os.path.join(data_path, 'zen.*.sum.uvh5')))
hd = io.HERAData(data_files[0])
unused_ants = [ant for ant in hd.antpos if ant not in ants]    
hd_last = io.HERAData(data_files[-1])

Load a priori antenna statuses and node numbers¶

In [10]:
# try to load a priori antenna statusesm but fail gracefully if this doesn't work.
a_priori_statuses = {ant: 'Not Found' for ant in ants}
nodes = {ant: np.nan for ant in ants + unused_ants}
try:
    from hera_mc import cm_hookup

    # get node numbers
    hookup = cm_hookup.get_hookup('default')
    for ant_name in hookup:
        ant = int("".join(filter(str.isdigit, ant_name)))
        if ant in nodes:
            if hookup[ant_name].get_part_from_type('node')['E<ground'] is not None:
                nodes[ant] = int(hookup[ant_name].get_part_from_type('node')['E<ground'][1:])
    
    # get apriori antenna status
    for ant_name, data in hookup.items():
        ant = int("".join(filter(str.isdigit, ant_name)))
        if ant in a_priori_statuses:
            a_priori_statuses[ant] = data.apriori

except Exception as err:
    print(f'Could not load node numbers and a priori antenna statuses.\nEncountered {type(err)} with message: {err}')

Summarize auto metrics¶

In [11]:
if use_auto_metrics:
    # Parse modzs
    modzs_to_check = {'Shape': 'r2_shape_modzs', 'Power': 'r2_power_modzs', 
                      'Temporal Variability': 'r2_temp_var_modzs', 'Temporal Discontinuties': 'r2_temp_diff_modzs'}
    worst_metrics = []
    worst_zs = []
    all_modzs = {}
    binary_flags = {rationale: [] for rationale in modzs_to_check}

    for ant in ants:
        # parse modzs and figure out flag counts
        modzs = {f'{pol} {rationale}': auto_metrics['modzs'][dict_name][(ant, ant, pol)] 
                 for rationale, dict_name in modzs_to_check.items() for pol in pols}
        for pol in pols:
            for rationale, dict_name in modzs_to_check.items():
                binary_flags[rationale].append(auto_metrics['modzs'][dict_name][(ant, ant, pol)] > mean_round_modz_cut)

        # parse out all metrics for dataframe
        for k in modzs:
            col_label = k + ' Modified Z-Score'
            if col_label in all_modzs:
                all_modzs[col_label].append(modzs[k])
            else:
                all_modzs[col_label] = [modzs[k]]
                
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
else:
    mean_round_modz_cut = 0

Summarize ant metrics¶

In [12]:
if use_ant_metrics:
    a_priori_flag_frac = {ant: np.mean([ant in apxa for apxa in ant_metrics_apriori_exants.values()]) for ant in ants}
    dead_ant_frac = {ap: {ant: np.mean([(ant, ap) in das for das in ant_metrics_dead_ants_dict.values()])
                                 for ant in ants} for ap in antpols}
    crossed_ant_frac = {ant: np.mean([np.any([(ant, ap) in cas for ap in antpols])
                                      for cas in ant_metrics_crossed_ants_dict.values()]) for ant in ants}
    ant_metrics_xants_frac_by_antpol = {antpol: np.mean([antpol in amx for amx in ant_metrics_xants_dict.values()]) for antpol in antpol_pairs}
    ant_metrics_xants_frac_by_ant = {ant: np.mean([np.any([(ant, ap) in amx for ap in antpols])
                                     for amx in ant_metrics_xants_dict.values()]) for ant in ants}
    average_dead_metrics = {ap: {ant: np.nanmean([dm.get((ant, ap), np.nan) for dm in ant_metrics_dead_metrics.values()]) 
                                 for ant in ants} for ap in antpols}
    average_crossed_metrics = {ant: np.nanmean([cm.get((ant, ap), np.nan) for ap in antpols 
                                                for cm in ant_metrics_crossed_metrics.values()]) for ant in ants}
else:
    dead_cut = 0.4
    crossed_cut = 0.0

Summarize redcal chi^2 metrics¶

In [13]:
if use_redcal:
    cspa = {ant: np.nanmedian(np.hstack([cspa_med_dict[cal][ant] for cal in redcal_files])) for ant in antpol_pairs}
    redcal_prior_flag_frac = {ant: np.mean([np.any([afd[ant, ap] and not ant in flagged_by_redcal_dict[cal] for ap in antpols])
                                            for cal, afd in post_redcal_ant_flags_dict.items()]) for ant in ants}
    redcal_flagged_frac = {ant: np.mean([ant in fbr for fbr in flagged_by_redcal_dict.values()]) for ant in ants}

Get FEM switch states¶

In [14]:
HHautos = sorted(glob.glob(f"{data_path}/zen.{JD}.*.sum.autos.uvh5"))
diffautos = sorted(glob.glob(f"{data_path}/zen.{JD}.*.diff.autos.uvh5"))

try:
    db = mc.connect_to_mc_db(None)
    session = db.sessionmaker()
    startJD = float(HHautos[0].split('zen.')[1].split('.sum')[0])
    stopJD = float(HHautos[-1].split('zen.')[1].split('.sum')[0])
    start_time = Time(startJD,format='jd')
    stop_time = Time(stopJD,format='jd')

    # get initial state by looking for commands up to 3 hours before the starttime
    # this logic can be improved after an upcoming hera_mc PR
    # which will return the most recent command before a particular time.
    search_start_time = start_time - TimeDelta(3*3600, format="sec")
    initial_command_res = session.get_array_signal_source(starttime=search_start_time, stoptime=start_time)
    if len(initial_command_res) == 0:
        initial_source = "Unknown"
    elif len(command_res) == 1:
        initial_source = initial_command_res[0].source
    else:
        # multiple commands
        times = []
        sources = []
        for obj in command_res:
            times.append(obj.time)
            sources.append(obj.source)
        initial_source = sources[np.argmax(times)]
    
    # check for any changes during observing
    command_res = session.get_array_signal_source(starttime=start_time, stoptime=stop_time)
    if len(command_res) == 0:
        # still nothing, set it to None
        obs_source = None
    else:
        obs_source_times = []
        obs_source = []
        for obj in command_res:
            obs_source_times.append(obj.time)
            obs_source.append(obj.source)

    if obs_source is not None:
        command_source = [initial_source] + obs_source
    else:
        command_source = initial_source
    
    res = session.get_antenna_status(starttime=startTime, stoptime=stopTime)
    fem_switches = {}
    right_rep_ant = []
    if len(res) > 0:
        for obj in res:
            if obj.antenna_number not in fem_switches.keys():
                fem_switches[obj.antenna_number] = {}
            fem_switches[obj.antenna_number][obj.antenna_feed_pol] = obj.fem_switch
        for ant, pol_dict in fem_switches.items():
            if pol_dict['e'] == initial_source and pol_dict['n'] == initial_source:
                right_rep_ant.append(ant)
except Exception as e:
    print(e)
    initial_source = None
    command_source = None
    right_rep_ant = []
name 'startTime' is not defined

Find X-engine Failures¶

In [15]:
read_inds = [1, len(HHautos)//2, -2]
x_status = [1,1,1,1,1,1,1,1]
s = UVData()
s.read(HHautos[1])

nants = len(s.get_ants())
freqs = s.freq_array[0]*1e-6
nfreqs = len(freqs)

antCon = {a: None for a in ants}
rightAnts = []
for i in read_inds:
    s = UVData()
    d = UVData()
    s.read(HHautos[i])
    d.read(diffautos[i])
    for pol in [0,1]:
        sm = np.abs(s.data_array[:,0,:,pol])
        df = np.abs(d.data_array[:,0,:,pol])
        sm = np.r_[sm, np.nan + np.zeros((-len(sm) % nants,len(freqs)))]
        sm = np.nanmean(sm.reshape(-1,nants,nfreqs),axis=1)
        df = np.r_[df, np.nan + np.zeros((-len(df) % nants,len(freqs)))]
        df = np.nanmean(df.reshape(-1,nants,nfreqs),axis=1)

        evens = (sm + df)/2
        odds = (sm - df)/2
        rat = np.divide(evens,odds)
        rat = np.nan_to_num(rat)
        for xbox in range(0,8):
            xavg = np.nanmean(rat[:,xbox*192:(xbox+1)*192],axis=1)
            if np.nanmax(xavg)>1.5 or np.nanmin(xavg)<0.5:
                x_status[xbox] = 0
    for ant in ants:
        for pol in ["xx", "yy"]:
            if antCon[ant] is False:
                continue
            spectrum = s.get_data(ant, ant, pol)
            stdev = np.std(spectrum)
            med = np.median(np.abs(spectrum))
            if (initial_source == 'digital_noise_same' or initial_source == 'digital_noise_different') and med < 10:
                antCon[ant] = True
            elif (initial_source == "load" or initial_source == 'noise') and 80000 < stdev <= 4000000 and antCon[ant] is not False:
                antCon[ant] = True
            elif initial_source == "antenna" and stdev > 500000 and med > 950000 and antCon[ant] is not False:
                antCon[ant] = True
            else:
                antCon[ant] = False
            if np.min(np.abs(spectrum)) < 100000:
                antCon[ant] = False
for ant in ants:
    if antCon[ant] is True:
        rightAnts.append(ant)
            
x_status_str = ''
for i,x in enumerate(x_status):
    if x==0:
        x_status_str += '\u274C '
    else:
        x_status_str += '\u2705 '

Build Overall Health DataFrame¶

In [16]:
def comma_sep_paragraph(vals, chars_per_line=40):
    outstrs = []
    for val in vals:
        if (len(outstrs) == 0) or (len(outstrs[-1]) > chars_per_line):
            outstrs.append(str(val))
        else:
            outstrs[-1] += ', ' + str(val)
    return ',<br>'.join(outstrs)
In [17]:
# Time data
to_show = {'JD': [JD]}
to_show['Date'] = f'{utc.month}-{utc.day}-{utc.year}'
to_show['LST Range'] = f'{hd.lsts[0] * 12 / np.pi:.3f} -- {hd_last.lsts[-1] * 12 / np.pi:.3f} hours'

# X-engine status
to_show['X-Engine Status'] = x_status_str

# Files
to_show['Number of Files'] = len(data_files)

# Antenna Calculations
to_show['Total Number of Antennas'] = len(ants)

to_show[' '] = ''
to_show['OPERATIONAL STATUS SUMMARY'] = ''

status_count = {status: 0 for status in status_colors}
for ant, status in a_priori_statuses.items():
    if status in status_count:
        status_count[status] = status_count[status] + 1
    else:
        status_count[status] = 1
to_show['Antenna A Priori Status Count'] = '<br>'.join([f'{status}: {status_count[status]}' for status in status_colors if status in status_count and status_count[status] > 0])

to_show['Commanded Signal Source'] = ', '.join(command_source if hasattr(command_source, '__iter__') else [str(command_source)])
to_show['Antennas in Commanded State (reported)'] = f'{len(right_rep_ant)} / {len(ants)} ({len(right_rep_ant) / len(ants):.1%})'
to_show['Antennas in Commanded State (observed)'] = f'{len(rightAnts)} / {len(ants)} ({len(rightAnts) / len(ants):.1%})'

if use_ant_metrics:
    to_show['Cross-Polarized Antennas'] = ', '.join([str(ant) for ant in ants if (np.max([dead_ant_frac[ap][ant] for ap in antpols]) + crossed_ant_frac[ant] == 1) 
                                                                                 and (crossed_ant_frac[ant] > .5)])

# Node calculations
nodes_used = set([nodes[ant] for ant in ants if np.isfinite(nodes[ant])])
to_show['Total Number of Nodes'] = len(nodes_used)
if use_ant_metrics:
    node_off = {node: True for node in nodes_used}
    not_correlating = {node: True for node in nodes_used}
    for ant in ants:
        for ap in antpols:
            if np.isfinite(nodes[ant]):
                if np.isfinite(average_dead_metrics[ap][ant]):
                    node_off[nodes[ant]] = False
                if dead_ant_frac[ap][ant] < 1:
                    not_correlating[nodes[ant]] = False
    to_show['Nodes Registering 0s'] = ', '.join([f'N{n:02}' for n in sorted([node for node in node_off if node_off[node]])])
    to_show['Nodes Not Correlating'] = ', '.join([f'N{n:02}' for n in sorted([node for node in not_correlating if not_correlating[node] and not node_off[node]])])

# Pipeline calculations    
to_show['  '] = ''
to_show['NIGHTLY ANALYSIS SUMMARY'] = ''
    
all_flagged_ants = []
if use_ant_metrics:
    to_show['Ant Metrics Done?'] = '\u2705'
    ant_metrics_flagged_ants = [ant for ant in ants if ant_metrics_xants_frac_by_ant[ant] > 0]
    all_flagged_ants.extend(ant_metrics_flagged_ants)
    to_show['Ant Metrics Flagged Antennas'] = f'{len(ant_metrics_flagged_ants)} / {len(ants)} ({len(ant_metrics_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Ant Metrics Done?'] = '\u274C'
if use_auto_metrics:
    to_show['Auto Metrics Done?'] = '\u2705'
    auto_metrics_flagged_ants = [ant for ant in ants if ant in auto_ex_ants]
    all_flagged_ants.extend(auto_metrics_flagged_ants)    
    to_show['Auto Metrics Flagged Antennas'] = f'{len(auto_metrics_flagged_ants)} / {len(ants)} ({len(auto_metrics_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Auto Metrics Done?'] = '\u274C'
if use_redcal:
    to_show['Redcal Done?'] = '\u2705'    
    redcal_flagged_ants = [ant for ant in ants if redcal_flagged_frac[ant] > 0]
    all_flagged_ants.extend(redcal_flagged_ants)    
    to_show['Redcal Flagged Antennas'] = f'{len(redcal_flagged_ants)} / {len(ants)} ({len(redcal_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Redcal Done?'] = '\u274C' 
to_show['Never Flagged Antennas'] = f'{len(ants) - len(set(all_flagged_ants))} / {len(ants)} ({(len(ants) - len(set(all_flagged_ants))) / len(ants):.1%})'

# Count bad antennas with good statuses and vice versa
n_apriori_good = len([ant for ant in ants if a_priori_statuses[ant] in good_statuses.split(',')])
apriori_good_flagged = []
aprior_bad_unflagged = []
for ant in ants:
    if ant in set(all_flagged_ants) and a_priori_statuses[ant] in good_statuses.split(','):
        apriori_good_flagged.append(ant)
    elif ant not in set(all_flagged_ants) and a_priori_statuses[ant] not in good_statuses.split(','):
        aprior_bad_unflagged.append(ant)
to_show['A Priori Good Antennas Flagged'] = f'{len(apriori_good_flagged)} / {n_apriori_good} total a priori good antennas:<br>' + \
                                            comma_sep_paragraph(apriori_good_flagged)
to_show['A Priori Bad Antennas Not Flagged'] = f'{len(aprior_bad_unflagged)} / {len(ants) - n_apriori_good} total a priori bad antennas:<br>' + \
                                            comma_sep_paragraph(aprior_bad_unflagged)

# Apply Styling
df = pd.DataFrame(to_show)
divider_cols = [df.columns.get_loc(col) for col in ['NIGHTLY ANALYSIS SUMMARY', 'OPERATIONAL STATUS SUMMARY']]
try:
    to_red_columns = [df.columns.get_loc(col) for col in ['Cross-Polarized Antennas', 'Nodes Registering 0s', 
                                                          'Nodes Not Correlating', 'A Priori Good Antennas Flagged']]
except:
    to_red_columns = []
def red_specific_cells(x):
    df1 = pd.DataFrame('', index=x.index, columns=x.columns)
    for col in to_red_columns:
        df1.iloc[col] = 'color: red'
    return df1

df = df.T
table = df.style.hide_columns().apply(red_specific_cells, axis=None)
for col in divider_cols:
    table = table.set_table_styles([{"selector":f"tr:nth-child({col+1})", "props": [("background-color", "black"), ("color", "white")]}], overwrite=False)

Table 1: Overall Array Health¶

In [18]:
HTML(table.render())
Out[18]:
JD 2460078
Date 5-13-2023
LST Range 14.959 -- 16.900 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 361
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: 94
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas 40, 42, 70, 72, 112
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 68 / 198 (34.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 103 / 198 (52.0%)
Redcal Done? ❌
Never Flagged Antennas 94 / 198 (47.5%)
A Priori Good Antennas Flagged 48 / 94 total a priori good antennas:
5, 15, 17, 29, 31, 37, 38, 40, 42, 55, 65,
66, 70, 72, 81, 83, 86, 88, 93, 94, 109, 111,
112, 118, 121, 124, 127, 136, 147, 148, 149,
150, 151, 160, 161, 165, 166, 167, 168, 169,
170, 181, 182, 184, 187, 189, 190, 191
A Priori Bad Antennas Not Flagged 48 / 104 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 57, 64, 73, 74,
80, 89, 95, 97, 102, 108, 113, 115, 120, 132,
133, 134, 139, 179, 185, 201, 206, 207, 220,
221, 222, 223, 224, 228, 229, 237, 238, 239,
240, 241, 244, 245, 261, 320, 324, 325, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2460078.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.956446 9.182437 -0.938973 -0.346562 -0.407938 0.063189 0.110564 17.747138 0.439412 0.328542 0.280260
5 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.308852 1.095701 0.599769 3.365007 0.936622 1.478776 0.068452 4.870287 0.454399 0.440956 0.288448
7 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.741523 0.001528 -0.330136 0.406943 -0.142015 0.351083 2.863046 3.072476 0.459931 0.455291 0.284742
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.605949 1.698921 1.227112 1.132146 0.655802 0.530708 -1.357642 -1.281462 0.425641 0.424800 0.264354
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.452061 -0.278953 3.325143 -0.157869 2.563853 0.538237 2.066579 -0.239742 0.443031 0.451629 0.280137
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.007948 -0.730963 -0.574964 -0.353730 -1.161850 -0.024069 -0.457797 -0.177574 0.435452 0.433712 0.272200
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 7.823922 0.297492 0.057138 0.097597 -0.138173 0.710359 -0.084412 0.432269 0.359767 0.453326 0.288462
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.077336 1.483493 0.277165 0.902791 -0.659747 0.271842 -0.921221 -1.237165 0.447563 0.436564 0.282006
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.570685 1.253800 1.041751 8.898572 1.460764 -0.397060 0.366963 2.485841 0.470108 0.373613 0.318757
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.569626 3.541382 1.167398 1.223166 0.892583 0.495613 7.995672 10.505721 0.439714 0.271955 0.317392
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.233665 0.016465 -0.025636 0.048591 0.238071 -0.631082 -0.223952 -1.020535 0.475741 0.470655 0.289653
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.857402 -0.702880 0.915711 -0.223732 1.828104 0.353191 0.189841 -0.124370 0.470053 0.469895 0.284487
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.295780 0.232691 0.168789 0.466720 0.824470 0.799566 0.020920 0.553840 0.450202 0.454226 0.274937
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.712817 -0.861073 -0.056991 -0.316258 -0.035301 -0.013763 0.013589 0.226397 0.416286 0.418860 0.267007
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.582588 14.932785 10.667043 6.890773 1.374717 0.653892 1.925618 38.267797 0.064959 0.057255 -0.005165
28 N01 RF_maintenance 100.00% 100.00% 56.51% 0.00% 6.323268 8.813576 10.938964 4.779681 1.910677 0.024429 0.724594 9.160194 0.028157 0.200570 0.151308
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 6.305900 7.535473 10.733074 11.031748 1.908447 1.650110 0.828512 0.345606 0.029329 0.035465 0.006707
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.078782 -0.634828 0.198999 -0.362346 0.599016 -0.127466 1.319803 0.075365 0.485167 0.490085 0.292714
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.657437 0.810460 1.810701 3.292524 17.094215 1.521670 98.233735 1.566350 0.479401 0.484224 0.291020
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.343389 3.311538 0.274874 0.032143 -0.647548 1.629558 13.587221 91.067586 0.394934 0.451713 0.237383
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.097810 -0.455160 6.604395 -0.656803 1.903805 -1.079035 0.501129 0.134205 0.040013 0.443159 0.308158
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.435670 -0.811336 -0.256787 -0.310889 -1.145088 -0.315931 -0.728261 -0.156177 0.431858 0.431981 0.270552
36 N03 RF_maintenance 100.00% 99.17% 99.17% 0.00% nan nan inf inf nan nan nan nan 0.182165 0.111545 0.107818
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.736212 13.937093 -0.898001 13.777044 -0.394377 1.716541 0.684682 2.802937 0.432227 0.029630 0.337515
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.114813 0.160496 0.124216 0.804545 0.818742 1.143670 3.530014 5.882268 0.443885 0.444497 0.282004
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.535503 0.188930 0.473208 -0.243276 0.321455 1.166741 16.802491 3.535723 0.197800 0.193058 -0.255082
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.865970 1.635269 1.234687 2.414649 1.378336 1.566055 0.341106 0.453919 0.480317 0.483486 0.299236
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.002386 0.430789 -0.040158 -0.523994 -0.394821 0.584895 -0.381234 -0.192190 0.217998 0.206420 -0.256133
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.827717 0.325535 -0.745167 0.986204 -0.177659 1.042023 0.430029 1.223514 0.496962 0.501077 0.303792
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.717119 0.732996 -0.379467 0.691575 -0.098399 0.816115 -0.467717 -0.170638 0.492546 0.505405 0.301883
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.949243 1.052288 1.099044 0.766425 1.351974 0.732445 0.793447 1.443770 0.491601 0.495338 0.297567
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.176340 -0.685119 0.370842 -0.823611 0.811669 -0.291755 0.337973 -0.165159 0.480867 0.488456 0.298144
47 N06 not_connected 100.00% 96.68% 96.95% 0.00% nan nan inf inf nan nan nan nan 0.436784 0.385327 0.386182
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.458097 1.084228 -0.916148 -0.021792 -0.858151 -0.573904 0.260421 -0.524267 0.437969 0.438636 0.267587
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.441580 -0.567323 0.967494 -0.911950 0.427380 -0.967676 0.848171 -0.382449 0.419760 0.430253 0.269077
50 N03 RF_maintenance 100.00% 99.17% 98.61% 0.00% nan nan inf inf nan nan nan nan 0.179986 0.203930 0.130235
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.282243 0.127010 0.466220 0.009565 0.856935 0.549389 19.538789 0.557685 0.430254 0.432594 0.280280
52 N03 RF_maintenance 100.00% 99.45% 98.89% 0.00% 76.628377 76.417815 inf inf 777.383287 776.504784 2809.744791 2855.096810 0.218020 0.300622 0.308231
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.053468 -0.389693 -0.094250 -0.564246 0.877912 -0.931986 2.481825 -0.307594 0.470255 0.464462 0.292256
54 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.171891 1.485426 0.739767 -0.436192 1.319950 1.227472 -0.672958 -0.117362 0.260496 0.314898 0.147379
55 N04 digital_ok 100.00% 77.84% 100.00% 0.00% -0.100787 25.654652 -0.067101 8.315162 -0.226196 1.741598 2.414360 2.036085 0.190861 0.038130 0.072451
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.804251 1.912343 -0.853716 2.139684 -0.525058 1.258642 0.262742 2.846527 0.495887 0.495240 0.296142
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.835249 0.042713 -0.816523 -0.246921 -0.533152 0.439125 0.150511 1.997124 0.498252 0.506716 0.298333
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.944286 7.454641 10.937647 11.410185 1.907856 1.652746 0.583964 0.567571 0.035431 0.035695 0.002871
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.542892 0.873644 10.945936 1.007122 1.927834 1.079114 0.689812 1.273186 0.043584 0.505763 0.368057
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.084148 7.342736 0.077217 11.438888 0.183396 1.606637 -0.155880 1.282888 0.475651 0.070696 0.368011
61 N06 not_connected 100.00% 95.01% 95.57% 0.00% nan nan inf inf nan nan nan nan 0.450465 0.301381 0.342982
62 N06 digital_ok 0.00% 0.00% 0.00% 0.00% -0.068601 0.234797 1.714001 0.003420 0.600380 -0.635112 0.968234 -0.605329 0.414972 0.449404 0.273411
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.634448 7.652993 -0.794300 6.854914 -0.574218 1.707491 1.131289 1.869892 0.444789 0.042633 0.329805
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.671729 -0.600084 -0.643063 0.226865 -0.438485 0.170824 0.258105 0.617864 0.436097 0.428026 0.266791
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 13.714734 12.798977 13.597907 13.566305 1.892482 1.672208 2.431327 3.131291 0.023170 0.029244 0.006788
66 N03 digital_ok 100.00% 96.12% 100.00% 0.00% 0.991498 13.224188 0.769345 13.693805 0.486660 1.701187 0.053175 4.147593 0.156490 0.043565 0.072344
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.415473 0.422073 0.093710 1.523308 0.364666 1.243237 1.774838 1.241323 0.457290 0.456508 0.286555
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 14.378932 -0.080163 13.621631 -0.243352 1.941352 -0.652329 3.456109 0.542951 0.030594 0.465090 0.362749
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.262310 -0.068197 1.670200 -0.340453 1.460153 -0.116197 2.015543 -0.031305 0.488783 0.489800 0.290580
70 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.459201 1.511177 1.275694 2.620859 0.712900 2.438081 4.942615 3.754211 0.225312 0.211280 -0.255163
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.276263 0.486495 -0.089051 0.683185 0.207444 0.806695 0.643268 2.152079 0.505195 0.513384 0.303307
72 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.847278 1.110708 2.488801 6.749471 0.764699 1.979160 8.104957 1.195785 0.222991 0.201116 -0.253885
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.459869 1.831603 -0.447729 1.929727 -0.031844 1.285642 0.115883 0.510346 0.511038 0.517239 0.304884
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.685517 -0.414321 -0.422538 -0.377833 -1.223063 -0.166761 -0.870841 0.271546 0.496841 0.512970 0.304396
77 N06 not_connected 100.00% 96.95% 96.95% 0.00% 102.676577 102.608225 inf inf 977.548200 1010.545444 3128.664380 3355.502642 0.360908 0.398910 0.233019
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 9.977291 0.085148 0.463903 0.071132 -0.357820 -0.560686 3.346161 -0.738099 0.338449 0.457189 0.270805
79 N11 not_connected 100.00% 9.42% 0.00% 0.00% 0.521635 -0.736773 2.031933 -0.575112 21.422617 -0.611697 12.100259 -0.172103 0.377089 0.447203 0.284233
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.702726 1.356259 -0.600360 0.947504 -1.191938 0.364300 -0.749444 -1.223728 0.442152 0.421078 0.276807
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 79.778403 46.765289 30.488592 39.402898 12.215356 180.697844 249.814768 1196.586884 0.017788 0.018092 0.001537
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 13.772900 69.177633 20.725338 42.397783 8.613486 79.406927 146.073600 750.181782 0.016844 0.018682 0.003322
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 18.833795 22.112750 24.751189 24.481247 11.034753 8.786674 329.613549 224.644980 0.016384 0.017150 0.001034
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.425358 14.326678 0.402376 13.764014 -0.403323 1.519660 -1.163084 2.360659 0.455861 0.048423 0.335862
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.573260 -0.268861 -0.855490 -0.051373 -0.930272 0.311604 -0.460083 0.000854 0.485486 0.490489 0.287879
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.793461 0.312958 1.385925 0.599156 1.463318 0.470057 0.400566 6.275245 0.499713 0.505231 0.291079
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 14.473107 1.160656 2.880794 -0.775206 1.021923 -0.677003 2.794186 2.156138 0.417891 0.518169 0.283319
88 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.306832 1.057468 1.010567 1.728349 0.926465 1.021365 6.126748 3.005593 0.507718 0.514027 0.292676
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.774469 0.643153 1.044927 1.291608 1.296253 1.139993 -0.066163 -0.000854 0.513901 0.522421 0.304643
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.461131 -0.044317 -0.620819 0.249089 -1.329044 6.106076 -0.703430 5.548218 0.504905 0.520687 0.304464
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.267056 0.458386 1.100550 0.939686 1.431715 1.095276 0.755423 0.301412 0.498548 0.513272 0.309322
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.254485 0.393339 10.990183 0.646859 1.928012 0.862496 0.666266 1.136315 0.032382 0.496372 0.341484
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.435370 7.541706 11.025554 11.480287 1.911483 1.655509 1.100217 0.997899 0.029004 0.024978 0.002000
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.813475 2.994670 11.163256 9.683936 1.975122 -0.711614 0.564522 0.443754 0.026194 0.325064 0.206768
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.291112 -0.562689 0.066849 -0.442850 -0.393983 -1.120595 0.112216 -0.701304 0.439375 0.455341 0.276595
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.224641 8.498082 0.182817 -0.455239 -0.783463 -0.586802 -1.105772 1.182253 0.444999 0.369194 0.253764
97 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.043088 0.716408 -0.817337 0.773504 -0.735860 0.291999 -0.387201 3.264981 0.440091 0.426608 0.266977
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.902293 3.193467 0.423094 1.189284 1.074239 1.380902 0.301953 1.885523 0.467548 0.468301 0.283845
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.851205 0.419700 -0.713193 -0.003420 -0.215856 0.313983 -0.402371 2.889474 0.487251 0.489960 0.286051
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.712246 1.357437 1.144045 -0.726019 0.487389 -0.356781 -1.256099 0.219143 0.468684 0.502859 0.292270
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.858215 26.662884 2.448277 6.596439 1.836719 1.757904 1.545375 2.083842 0.502509 0.498434 0.290737
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.410094 0.338853 -0.196361 0.939104 0.397305 0.655265 -0.264154 0.569168 0.512418 0.519401 0.295283
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.225208 0.497562 0.468388 0.659607 0.511024 0.650267 -0.019661 1.049322 0.514688 0.525617 0.300131
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.871240 1.199492 0.162134 -0.346095 0.362532 -0.277526 1.630622 0.726792 0.509403 0.517912 0.296342
108 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.283789 2.089766 1.726729 2.579142 1.128865 1.477063 2.123911 1.218673 0.502293 0.516027 0.304416
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.138718 7.501754 11.050187 11.263757 1.878155 1.655519 0.282660 0.839382 0.056776 0.034708 0.015529
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.844746 -0.141875 0.437496 0.155745 -0.767586 0.596060 8.750131 -0.137520 0.388088 0.491991 0.290899
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 9.228922 7.463346 1.849183 11.333243 1.011484 1.615730 18.212432 1.138668 0.391390 0.060702 0.270253
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% 0.680087 2.233272 1.474058 9.403364 0.289622 -0.657443 0.296882 0.212841 0.192349 0.142671 -0.216713
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.300972 2.467187 1.595883 1.640574 1.178829 1.173358 -1.542845 -1.567404 0.423834 0.416869 0.259128
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.937983 1.866337 1.344694 4.076764 0.871382 -0.356239 -1.469635 2.307192 0.415351 0.370436 0.249125
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.914986 -0.760757 -0.474324 -0.615407 0.024163 -0.865203 0.201472 1.160029 0.424494 0.424094 0.262728
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 16.537729 31.677595 22.495244 28.066143 6.923858 10.483560 186.215496 308.072384 0.017314 0.017569 0.001323
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 16.152529 15.201435 23.609817 21.241743 9.486320 7.351423 275.613175 146.027267 0.016404 0.016986 0.000808
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.055540 -0.166231 2.770900 -0.875254 2.349822 -0.589821 0.820120 -0.676024 0.474071 0.483787 0.283668
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.457668 2.298413 0.920257 1.368174 0.183544 1.510195 -1.019095 4.756469 0.474302 0.505257 0.295007
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.515598 1.428152 0.142566 -0.588767 0.484827 -0.240913 1.018663 -0.355351 0.506737 0.515138 0.293670
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.823780 0.587742 1.417639 0.309087 0.953399 -0.359042 -1.497755 -1.083304 0.482223 0.512371 0.298081
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 6.316916 0.346683 11.158710 1.001447 1.913361 1.093775 0.521302 1.294056 0.039917 0.532179 0.356318
125 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.823667 0.540456 4.582896 1.698700 1.294899 1.200122 0.381398 0.101434 0.490785 0.524709 0.307232
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.930530 0.499188 1.365742 1.132210 1.790603 1.170481 89.929832 0.422343 0.469510 0.521133 0.306735
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.053343 -1.046575 10.976925 -0.764690 1.906112 -0.929908 0.217350 0.052174 0.033852 0.499248 0.342439
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.001528 -0.441373 -0.236136 -0.497055 0.196367 -1.034014 1.772118 0.216539 0.482777 0.488752 0.304198
131 N11 not_connected 100.00% 0.00% 72.30% 0.00% -1.012173 6.809610 -0.797535 6.607459 -1.358726 0.906930 -0.553006 0.308855 0.453657 0.192485 0.314531
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.167618 -0.542823 -0.855361 -0.392274 -0.787019 -0.336277 0.019622 -0.085222 0.449401 0.444372 0.271574
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.476175 -0.884515 -0.429227 -0.960565 -0.480342 -0.871448 -0.458024 -0.447794 0.434722 0.433790 0.268024
134 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.529452 1.643478 2.943260 1.066432 0.233843 0.482890 2.102622 -1.215849 0.362383 0.392234 0.251937
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.916655 -0.820525 -0.469439 -0.760102 0.032605 -0.272807 14.442268 -0.241127 0.393600 0.395092 0.259661
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 5.781871 0.287116 10.741771 0.139414 1.930548 0.076259 0.817206 1.338929 0.036267 0.404640 0.274159
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 14.753863 25.049293 21.919793 21.933881 7.527483 5.839896 229.851472 143.568650 0.016429 0.016949 0.000767
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.324946 -0.512505 0.064093 -0.868120 -0.863712 -0.699894 -0.931023 0.697146 0.451450 0.458063 0.274413
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.451409 -1.036198 0.497478 -0.956892 0.937220 -0.583527 1.365843 0.869725 0.486918 0.490066 0.283409
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.109277 -1.088821 0.250979 -0.900612 0.481049 0.381925 1.006105 0.223643 0.499510 0.501534 0.287958
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.197548 7.505149 -0.181593 11.450777 0.210939 1.647484 5.799983 0.757232 0.508823 0.042964 0.402739
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.370176 7.575106 11.044410 11.439495 1.987391 1.739138 1.217604 1.747246 0.042243 0.030258 0.009963
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.132024 -0.908021 -0.162539 -0.712904 0.402909 -0.907340 0.225637 -0.302156 0.521889 0.522447 0.303590
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.426639 1.054018 0.547737 1.845992 0.894161 1.231025 -0.183428 0.307760 0.517935 0.518063 0.301381
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.617037 -0.669748 -0.435528 -0.679496 -0.463079 -1.004853 0.237738 -0.547094 0.481610 0.496403 0.300776
147 N15 digital_ok 100.00% 96.12% 97.51% 0.00% nan nan inf inf nan nan nan nan 0.356298 0.330265 0.356355
148 N15 digital_ok 100.00% 96.95% 97.23% 0.00% 110.702726 110.735980 inf inf 1253.583461 1253.702366 4593.466340 4592.167045 0.210298 0.239502 0.232671
149 N15 digital_ok 100.00% 96.40% 96.68% 0.00% nan nan inf inf nan nan nan nan 0.346933 0.350447 0.278269
150 N15 digital_ok 100.00% 97.51% 96.68% 0.00% nan nan inf inf nan nan nan nan 0.317987 0.463854 0.356124
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.871700 -0.193210 -0.486868 1.252897 -0.470508 0.567857 1.335808 3.920713 0.367733 0.435115 0.261008
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.263020 -0.791889 10.883690 -0.358675 1.909584 0.262974 1.038629 -0.247499 0.037972 0.402672 0.286645
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.359024 7.432406 7.687579 11.319893 0.386792 1.719123 1.431709 1.680379 0.341813 0.036874 0.248053
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.667173 0.529552 0.798226 1.002215 0.854843 0.996560 0.175633 -0.017324 0.423607 0.433684 0.272389
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.986563 -0.935911 -0.828209 -0.908921 -0.689235 -0.562913 0.397309 0.832739 0.442805 0.450536 0.277894
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.075311 7.702394 0.414190 0.447683 0.154374 -0.289706 0.121802 4.141137 0.436780 0.355097 0.249789
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 6.577231 -0.527263 10.947932 -0.160616 1.935057 0.227650 0.693419 0.242345 0.042643 0.488181 0.375542
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.726139 14.071386 0.616349 0.788871 1.013061 -0.107567 -0.210036 1.646764 0.492835 0.400795 0.267426
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.276456 -0.869728 -0.381307 -0.952296 -1.141180 -0.342446 1.788214 -0.350421 0.496654 0.506464 0.296156
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.535389 1.065317 0.588003 0.865912 1.144349 1.169939 0.925215 1.032096 0.514428 0.518811 0.301707
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 1.130766 0.887137 2.234913 0.702725 1.545933 0.882922 1.165028 1.037611 0.505853 0.515396 0.295511
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 7.653903 -0.266826 1.247079 -0.198961 0.052068 0.091834 0.271430 -0.326411 0.415521 0.515423 0.281402
166 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 6.347657 -0.331527 11.121032 -0.258049 1.926121 -0.766996 0.855831 -0.203250 0.032459 0.495542 0.341945
167 N15 digital_ok 100.00% 95.84% 95.84% 0.28% nan nan inf inf nan nan nan nan 0.386230 0.408787 0.275082
168 N15 digital_ok 100.00% 96.40% 96.12% 0.28% 83.945373 84.224213 inf inf 962.112107 953.600175 3082.897309 3025.479819 0.330116 0.336917 0.288180
169 N15 digital_ok 100.00% 95.57% 96.12% 0.00% 99.892973 99.927558 inf inf 948.757300 945.503620 3046.836416 3038.396892 0.250490 0.293985 0.225975
170 N15 digital_ok 100.00% 94.74% 95.57% 0.00% 93.596238 93.182648 inf inf 709.928909 718.710342 3019.180544 3079.780686 0.338734 0.352172 0.325180
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.234807 -1.218367 1.271717 -0.701643 0.466352 -0.459335 1.140327 1.238833 0.432857 0.443566 0.279230
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.610957 0.628643 1.122858 0.205351 0.576918 -0.345439 -1.424659 -1.042362 0.426131 0.424424 0.270784
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.283201 2.423613 1.611134 1.618499 1.193041 1.136356 -1.462692 -1.419709 0.394728 0.382628 0.249103
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.198476 -0.644782 0.973124 -0.282056 0.901741 -0.105394 0.782750 -0.133503 0.447989 0.457026 0.287034
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.224825 7.815349 -0.499375 11.533799 0.024267 1.650681 2.436535 0.990385 0.458763 0.050280 0.365310
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.471981 1.174334 1.827170 2.420917 1.747473 9.385465 2.515762 13.366281 0.478838 0.482596 0.294210
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.536705 7.422078 -0.366805 11.253539 -1.166126 1.642109 -0.239821 1.189514 0.491438 0.046228 0.357612
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.925406 1.147458 0.756396 1.250532 1.138321 1.324150 1.353242 3.151642 0.494040 0.500728 0.287735
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 6.728218 -0.340148 9.747238 -0.126660 0.537095 0.331162 0.930226 -0.111897 0.257235 0.510759 0.325916
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.463805 0.101221 -0.774126 0.323999 -0.463923 0.459404 -0.358399 -0.001219 0.506469 0.511119 0.296235
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.790387 -1.046914 -0.431331 -0.956370 -1.340254 -0.542270 -0.897079 -0.707252 0.494153 0.498621 0.289927
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.397448 -0.356652 0.764647 -0.377213 8.506380 -0.600206 7.317241 0.996553 0.485939 0.486603 0.292420
189 N15 digital_ok 100.00% 95.29% 95.01% 0.28% nan nan inf inf nan nan nan nan 0.322196 0.315857 0.307579
190 N15 digital_ok 100.00% 95.84% 95.84% 0.28% 92.298887 92.159245 inf inf 957.394604 964.873158 3061.326529 3113.677492 0.299207 0.308738 0.240771
191 N15 digital_ok 100.00% 95.57% 95.29% 0.00% 105.223033 105.291714 inf inf 1026.162429 1012.793851 3448.244759 3333.524459 0.322746 0.344253 0.275822
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.515858 2.672509 1.747611 1.766050 1.374556 1.309033 -1.616150 -1.661099 0.400831 0.389618 0.252012
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.522266 2.211320 1.750944 1.486995 1.388620 1.025931 -1.630819 -1.582032 0.390995 0.384663 0.248615
200 N18 RF_maintenance 100.00% 100.00% 17.45% 0.00% 7.103392 15.512776 6.477439 0.580713 1.954080 1.724866 1.509373 3.271181 0.037588 0.224282 0.144041
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.010777 2.029188 0.758914 1.415655 0.041144 0.928112 -0.670134 -1.417710 0.451507 0.436837 0.276636
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% 0.018699 -0.914347 0.059486 -0.953399 -1.032054 -0.759754 -1.036664 0.901120 0.473142 0.478202 0.283548
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.457323 4.684595 2.109233 -0.392821 2.056567 0.329632 13.361566 2.216194 0.487788 0.490814 0.286696
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.185022 -0.657435 4.876017 -0.363893 -0.887735 0.010492 0.395058 0.144073 0.344931 0.488430 0.322398
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.489039 1.379534 2.166681 3.491688 -0.100953 -0.322546 0.542915 1.277529 0.437124 0.414095 0.252084
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.191606 -0.867534 -0.720272 -0.555946 -0.915816 -0.478790 1.536182 -0.151066 0.454302 0.471527 0.287316
208 N20 dish_maintenance 100.00% 94.46% 95.57% 0.55% 104.252904 104.262804 inf inf 954.429068 954.868041 2972.735918 3001.206489 0.379285 0.331220 0.221325
209 N20 dish_maintenance 100.00% 95.57% 95.84% 0.83% nan nan inf inf nan nan nan nan 0.320296 0.361506 0.206085
210 N20 dish_maintenance 100.00% 95.57% 95.01% 1.11% nan nan inf inf nan nan nan nan 0.419431 0.419160 0.136198
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.475538 7.672820 -0.358117 6.820791 -0.541305 1.651335 0.171537 0.575077 0.436321 0.037308 0.348005
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.675127 -0.824866 -0.483550 -0.727331 -1.075772 -0.239380 0.112755 -0.280158 0.457002 0.455822 0.276917
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.502299 -0.718185 -0.461895 -0.765931 -1.374219 -0.571978 -0.253989 -0.630987 0.466292 0.468505 0.282788
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.645393 -0.574888 -0.667275 -0.669486 -1.355227 -1.168094 0.733150 -0.636234 0.470384 0.474092 0.283244
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.673854 -0.431996 -0.011524 0.206838 0.013763 0.243129 0.788130 1.499328 0.465069 0.464930 0.275173
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.724980 2.506607 1.929110 1.694200 1.591055 1.221509 -1.672659 -1.614930 0.423930 0.428475 0.261780
225 N19 RF_ok 100.00% 0.00% 100.00% 0.00% -0.130168 7.133659 -0.143546 6.581728 -0.998132 1.423815 -0.386721 1.342616 0.464135 0.134565 0.356612
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.051318 5.224958 -0.931075 -0.567159 -0.799804 -0.563010 -0.508327 0.197217 0.458404 0.404763 0.272389
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 0.950430 -0.711913 2.635204 -0.870999 0.061253 -0.908890 5.537258 -0.286347 0.405858 0.444460 0.286694
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.015709 -0.575990 -0.228469 -0.423072 -1.330427 -0.115712 0.211480 -0.034210 0.441389 0.434398 0.270835
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.109487 0.143006 -0.259596 0.068305 -1.062008 -0.518839 -0.771763 -1.034463 0.436066 0.422891 0.276342
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.002141 -0.846467 0.734036 -0.552778 0.383855 -0.183250 0.733672 -0.065734 0.417237 0.433039 0.277982
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.145315 -0.280712 -0.140128 -0.180157 -0.947624 -0.713484 -0.110498 -0.136222 0.449007 0.447037 0.285113
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.979322 -0.560780 -0.953083 -0.546381 -0.822209 -1.145626 -0.547342 -0.388904 0.456944 0.453876 0.285812
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.222302 -0.349642 0.005867 -0.922575 -0.852558 -0.937866 -1.029799 -0.337843 0.453826 0.454650 0.282395
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.151706 -0.912686 -0.913097 -0.689709 -0.892933 -0.934087 -0.395469 -0.661503 0.459145 0.455862 0.286251
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.485925 -0.039106 -0.616197 -0.123444 -0.658683 -0.804517 0.245595 -0.877707 0.363427 0.447156 0.276805
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.550212 -0.883988 -0.223653 -0.470483 0.172652 -0.267001 19.260041 -0.086020 0.372614 0.445045 0.275584
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.098066 -0.381322 0.324507 0.442956 -0.113406 0.223901 0.023461 0.325998 0.437724 0.436852 0.268856
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.483112 -0.364916 -0.395645 -0.586572 -1.353977 -0.479097 -0.405460 1.698837 0.443189 0.433916 0.272354
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.848772 7.964215 -0.868136 6.453316 -0.914442 1.657484 -0.080526 0.241905 0.431161 0.036866 0.339202
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.371456 -0.559656 -0.458610 -0.877053 -1.256791 -1.091320 -0.761463 -0.469653 0.435420 0.425195 0.270919
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 4.062245 6.019676 -0.021839 0.874094 0.491047 1.038857 0.720903 0.896494 0.435014 0.423123 0.278428
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.240891 1.467790 0.746254 0.891970 0.047197 0.357849 -1.290616 -1.243789 0.335811 0.296905 0.220631
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.777269 1.040531 0.009792 0.156546 -0.975237 -0.586157 1.444370 -0.074268 0.324089 0.301289 0.209349
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.108152 -0.893438 -0.115648 -0.313963 -1.180139 -0.123420 -0.784778 -0.011838 0.360594 0.340188 0.238615
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.941225 7.663759 6.353060 6.935295 1.900665 1.650227 0.296614 0.194857 0.038968 0.037739 0.002391
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.470569 -0.051625 0.082869 -0.411714 -0.050509 -0.292668 1.318455 1.363749 0.328318 0.315293 0.212658
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [4, 5, 15, 17, 18, 27, 28, 29, 31, 32, 34, 36, 37, 38, 40, 42, 47, 50, 51, 52, 55, 58, 59, 60, 61, 63, 65, 66, 68, 70, 72, 77, 78, 79, 81, 82, 83, 84, 86, 87, 88, 90, 92, 93, 94, 96, 104, 109, 110, 111, 112, 114, 117, 118, 121, 124, 125, 126, 127, 131, 135, 136, 137, 142, 143, 147, 148, 149, 150, 151, 155, 156, 159, 160, 161, 165, 166, 167, 168, 169, 170, 180, 181, 182, 184, 187, 189, 190, 191, 200, 204, 205, 208, 209, 210, 211, 225, 226, 227, 242, 243, 246, 262, 329]

unflagged_ants: [7, 8, 9, 10, 16, 19, 20, 21, 22, 30, 35, 41, 43, 44, 45, 46, 48, 49, 53, 54, 56, 57, 62, 64, 67, 69, 71, 73, 74, 80, 85, 89, 91, 95, 97, 101, 102, 103, 105, 106, 107, 108, 113, 115, 120, 122, 123, 128, 132, 133, 134, 139, 140, 141, 144, 145, 146, 157, 158, 162, 163, 164, 171, 172, 173, 179, 183, 185, 186, 192, 193, 201, 202, 206, 207, 220, 221, 222, 223, 224, 228, 229, 237, 238, 239, 240, 241, 244, 245, 261, 320, 324, 325, 333]

golden_ants: [7, 9, 10, 16, 19, 20, 21, 30, 41, 44, 45, 53, 54, 56, 62, 67, 69, 71, 85, 91, 101, 103, 105, 106, 107, 122, 123, 128, 140, 141, 144, 145, 146, 157, 158, 162, 163, 164, 171, 172, 173, 183, 186, 192, 193, 202]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2460078.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

# Figure out where to draw the nodes
node_centers = {}
for node in sorted(set(list(nodes.values()))):
    if np.isfinite(node):
        this_node_ants = [ant for ant in ants + unused_ants if nodes[ant] == node]
        if len(this_node_ants) == 1:
            # put the node label just to the west of the lone antenna 
            node_centers[node] = hd.antpos[ant][node] + np.array([-14.6 / 2, 0, 0])
        else:
            # put the node label between the two antennas closest to the node center
            node_centers[node] = np.mean([hd.antpos[ant] for ant in this_node_ants], axis=0)
            closest_two_pos = sorted([hd.antpos[ant] for ant in this_node_ants], 
                                     key=lambda pos: np.linalg.norm(pos - node_centers[node]))[0:2]
            node_centers[node] = np.mean(closest_two_pos, axis=0)
In [25]:
def Plot_Array(ants, unused_ants, outriggers):
    plt.figure(figsize=(16,16))
    
    plt.scatter(np.array([hd.antpos[ant][0] for ant in hd.data_ants if ant in ants]), 
                np.array([hd.antpos[ant][1] for ant in hd.data_ants if ant in ants]), c='w', s=0)

    # connect every antenna to their node
    for ant in ants:
        if nodes[ant] in node_centers:
            plt.plot([hd.antpos[ant][0], node_centers[nodes[ant]][0]], 
                     [hd.antpos[ant][1], node_centers[nodes[ant]][1]], 'k', zorder=0)

    rc_color = '#0000ff'
    antm_color = '#ffa500'
    autom_color = '#ff1493'

    # Plot 
    unflagged_ants = []
    for i, ant in enumerate(ants):
        ant_has_flag = False
        # plot large blue annuli for redcal flags
        if use_redcal:
            if redcal_flagged_frac[ant] > 0:
                ant_has_flag = True
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=7 * (2 - 1 * float(not outriggers)), fill=True, lw=0,
                                                color=rc_color, alpha=redcal_flagged_frac[ant]))
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=6 * (2 - 1 * float(not outriggers)), fill=True, color='w'))
        
        # plot medium green annuli for ant_metrics flags
        if use_ant_metrics: 
            if ant_metrics_xants_frac_by_ant[ant] > 0:
                ant_has_flag = True
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=6 * (2 - 1 * float(not outriggers)), fill=True, lw=0,
                                                color=antm_color, alpha=ant_metrics_xants_frac_by_ant[ant]))
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=5 * (2 - 1 * float(not outriggers)), fill=True, color='w'))
        
        # plot small red annuli for auto_metrics
        if use_auto_metrics:
            if ant in auto_ex_ants:
                ant_has_flag = True                
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=5 * (2 - 1 * float(not outriggers)), fill=True, lw=0, color=autom_color)) 
        
        # plot black/white circles with black outlines for antennas
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4 * (2 - 1 * float(not outriggers)), fill=True, color=['w', 'k'][ant_has_flag], ec='k'))
        if not ant_has_flag:
            unflagged_ants.append(ant)

        # label antennas, using apriori statuses if available
        try:
            bgc = matplotlib.colors.to_rgb(status_colors[a_priori_statuses[ant]])
            c = 'black' if (bgc[0]*0.299 + bgc[1]*0.587 + bgc[2]*0.114) > 186 / 256 else 'white'
        except:
            c = 'k'
            bgc='white'
        plt.text(hd.antpos[ant][0], hd.antpos[ant][1], str(ant), va='center', ha='center', color=c, backgroundcolor=bgc)

    # label nodes
    for node in sorted(set(list(nodes.values()))):
        if not np.isnan(node) and not np.all(np.isnan(node_centers[node])):
            plt.text(node_centers[node][0], node_centers[node][1], str(node), va='center', ha='center', bbox={'color': 'w', 'ec': 'k'})
    
    # build legend 
    legend_objs = []
    legend_labels = []
    
    # use circles for annuli 
    legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgecolor='k', markerfacecolor='w', markersize=13))
    legend_labels.append(f'{len(unflagged_ants)} / {len(ants)} Total {["Core", "Outrigger"][outriggers]} Antennas Never Flagged')
    legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markerfacecolor='k', markersize=15))
    legend_labels.append(f'{len(ants) - len(unflagged_ants)} Antennas {["Core", "Outrigger"][outriggers]} Flagged for Any Reason')

    if use_auto_metrics:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=autom_color, markersize=15))
        legend_labels.append(f'{len([ant for ant in auto_ex_ants if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas Flagged by Auto Metrics')
    if use_ant_metrics: 
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=antm_color, markersize=15))
        legend_labels.append(f'{np.round(np.sum([frac for ant, frac in ant_metrics_xants_frac_by_ant.items() if ant in ants]), 2)} Antenna-Nights on' 
                             f'\n{np.sum([frac > 0 for ant, frac in ant_metrics_xants_frac_by_ant.items() if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas '
                             'Flagged by Ant Metrics\n(alpha indicates fraction of time)')        
    if use_redcal:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=rc_color, markersize=15))
        legend_labels.append(f'{np.round(np.sum(list(redcal_flagged_frac.values())), 2)} Antenna-Nights on' 
                             f'\n{np.sum([frac > 0 for ant, frac in redcal_flagged_frac.items() if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas '
                             'Flagged by Redcal\n(alpha indicates fraction of time)')

    # use rectangular patches for a priori statuses that appear in the array
    for aps in sorted(list(set(list(a_priori_statuses.values())))):
        if aps != 'Not Found':
            legend_objs.append(plt.Circle((0, 0), radius=7, fill=True, color=status_colors[aps]))
            legend_labels.append(f'A Priori Status:\n{aps} ({[status for ant, status in a_priori_statuses.items() if ant in ants].count(aps)} {["Core", "Outrigger"][outriggers]} Antennas)')

    # label nodes as a white box with black outline
    if len(node_centers) > 0:
        legend_objs.append(matplotlib.patches.Patch(facecolor='w', edgecolor='k'))
        legend_labels.append('Node Number')

    if len(unused_ants) > 0:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markerfacecolor='grey', markersize=15, alpha=.2))
        legend_labels.append(f'Anntenna Not In Data')
        
    
    plt.legend(legend_objs, legend_labels, ncol=2, fontsize='large', framealpha=1)
    
    if outriggers:
        pass
    else:
        plt.xlim([-200, 150])
        plt.ylim([-150, 150])        
       
    # set axis equal and label everything
    plt.axis('equal')
    plt.tight_layout()
    plt.title(f'Summary of {["Core", "Outrigger"][outriggers]} Antenna Statuses and Metrics on {JD}', size=20)    
    plt.xlabel("Antenna East-West Position (meters)", size=12)
    plt.ylabel("Antenna North-South Position (meters)", size=12)
    plt.xticks(fontsize=12)
    plt.yticks(fontsize=12)
    xlim = plt.gca().get_xlim()
    ylim = plt.gca().get_ylim()    
        
    # plot unused antennas
    plt.autoscale(False)    
    for ant in unused_ants:
        if nodes[ant] in node_centers:
            plt.plot([hd.antpos[ant][0], node_centers[nodes[ant]][0]], 
                     [hd.antpos[ant][1], node_centers[nodes[ant]][1]], 'k', alpha=.2, zorder=0)
        
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4, fill=True, color='w', ec=None, alpha=1, zorder=0))
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4, fill=True, color='grey', ec=None, alpha=.2, zorder=0))
        if hd.antpos[ant][0] < xlim[1] and hd.antpos[ant][0] > xlim[0]:
            if hd.antpos[ant][1] < ylim[1] and hd.antpos[ant][1] > ylim[0]:
                plt.text(hd.antpos[ant][0], hd.antpos[ant][1], str(ant), va='center', ha='center', color='k', alpha=.2) 

Figure 1: Array Plot of Flags and A Priori Statuses¶

This plot shows all antennas, which nodes they are connected to, and their a priori statuses (as the highlight text of their antenna numbers). It may also show (depending on what is finished running):

  • Whether they were flagged by auto_metrics (red circle) for bandpass shape, overall power, temporal variability, or temporal discontinuities. This is done in a binary fashion for the whole night.
  • Whether they were flagged by ant_metrics (green circle) as either dead (on either polarization) or crossed, with the transparency indicating the fraction of the night (i.e. number of files) that were flagged.
  • Whether they were flagged by redcal (blue circle) for high chi^2, with the transparency indicating the fraction of the night (i.e. number of files) that were flagged.

Note that the last fraction does not include antennas that were flagged before going into redcal due to their a priori status, for example.

In [26]:
core_ants = [ant for ant in ants if ant < 320]
outrigger_ants = [ant for ant in ants if ant >= 320]
Plot_Array(ants=core_ants, unused_ants=unused_ants, outriggers=False)
if len(outrigger_ants) > 0:
    Plot_Array(ants=outrigger_ants, unused_ants=sorted(set(unused_ants + core_ants)), outriggers=True)

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.1.1.dev3+gb291d34
3.2.3.dev158+gd5cadd5
In [ ]: