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 = "2459991"
data_path = "/mnt/sn1/2459991"
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-15-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/2459991/zen.2459991.21309.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 1832 ant_metrics files matching glob /mnt/sn1/2459991/zen.2459991.?????.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/2459991/zen.2459991.?????.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 2459991
Date 2-15-2023
LST Range 4.238 -- 14.193 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1832
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
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 64 / 198 (32.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 123 / 198 (62.1%)
Redcal Done? ❌
Never Flagged Antennas 75 / 198 (37.9%)
A Priori Good Antennas Flagged 50 / 93 total a priori good antennas:
3, 7, 15, 16, 19, 20, 29, 40, 42, 45, 53, 54,
55, 71, 72, 81, 85, 86, 93, 94, 101, 103, 107,
109, 111, 112, 121, 122, 123, 124, 127, 128,
136, 144, 151, 158, 161, 162, 165, 170, 173,
182, 184, 186, 187, 189, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 32 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 62, 64, 73, 74,
82, 89, 90, 115, 125, 126, 132, 133, 137, 139,
220, 222, 228, 229, 237, 238, 239, 245, 261,
324, 325
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_2459991.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% 12.627323 16.501330 10.041473 10.823606 9.083055 10.725615 0.247238 0.602029 0.029485 0.031094 0.002372
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.269809 -0.393690 2.287343 0.151155 2.368079 -0.777392 6.223954 0.772029 0.584551 0.608564 0.406668
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.328991 0.081472 0.323938 0.304860 0.252641 2.017894 1.157959 1.244494 0.604743 0.604496 0.391296
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.541677 -0.117545 -1.168702 -0.147266 0.264373 0.545808 10.430264 8.454005 0.613049 0.622523 0.388599
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.215588 -1.678700 -0.466309 0.191583 -0.341858 0.705685 0.669655 0.859836 0.612736 0.619940 0.384878
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.467563 -0.862811 3.068647 -1.002544 0.981004 -0.045500 2.212466 -0.422922 0.587279 0.620485 0.395015
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.153368 -0.459216 -0.782834 -1.263864 0.876161 1.444643 1.485848 0.486222 0.600275 0.614721 0.384924
15 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 12.939311 16.196488 9.454638 10.218791 9.092976 10.721991 -0.229557 -0.088883 0.027892 0.026418 0.001709
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 12.901976 -1.104856 10.006926 0.897450 9.081576 2.370310 0.262071 2.428141 0.031158 0.617010 0.491048
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.163131 2.112986 0.546852 0.568688 0.309792 0.956344 2.050180 2.346387 0.614376 0.625088 0.390561
18 N01 RF_maintenance 100.00% 100.00% 39.90% 0.00% 13.670223 20.563308 9.980625 -0.415700 9.241352 5.930229 0.176857 16.657857 0.029811 0.223973 0.169527
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.736278 -0.807418 -1.022609 1.845025 -0.463813 10.072524 0.257502 11.838051 0.620219 0.622368 0.380798
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.515609 -1.667058 1.337756 -0.939209 6.280610 0.998124 1.263694 -0.581911 0.613395 0.627992 0.382320
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.338303 0.378512 -0.552968 0.185183 0.268716 1.716801 -0.211414 0.220369 0.603267 0.608237 0.375569
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.445465 -0.195997 0.579395 0.191527 0.663453 0.975016 -0.447933 -1.098665 0.578274 0.588150 0.378985
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.093565 15.348140 10.040876 10.623430 9.206473 10.784325 1.474650 1.024430 0.033465 0.036352 0.003897
28 N01 RF_maintenance 100.00% 0.00% 87.61% 0.00% 12.576202 29.328071 0.023514 3.056162 5.043936 7.780274 3.893547 19.646332 0.359751 0.150977 0.268294
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 13.000774 15.930090 9.640470 10.228727 9.186640 10.765426 0.167960 -0.191867 0.029808 0.034457 0.005137
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.648748 -0.054698 1.871291 -1.327441 1.304824 0.266967 0.883978 -0.174215 0.610944 0.642821 0.391784
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.521897 -1.606392 1.138207 0.650520 1.158151 1.646432 0.346796 2.556459 0.632493 0.635316 0.381594
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.953082 32.447673 -0.429847 2.768864 0.665140 0.408389 4.004844 7.376646 0.606169 0.514311 0.355610
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 14.808685 17.357968 4.579881 5.047853 9.165321 10.734323 0.860552 0.506575 0.033978 0.043348 0.006257
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.763420 -0.479670 1.243522 -1.131971 3.506808 -1.025913 -0.648412 -0.005058 0.586042 0.575001 0.375721
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 31.451010 31.790927 13.206975 13.310546 9.272035 10.650294 2.975776 3.082472 0.031080 0.028609 0.001657
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.939761 0.663241 -1.102065 0.924101 1.792385 1.315448 -0.793992 1.564402 0.615781 0.615417 0.403948
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.125314 0.002474 0.288544 0.672534 -0.011074 0.330968 3.634122 1.028847 0.620064 0.613222 0.398932
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 12.231622 0.557571 9.669812 0.665782 9.141904 -0.459918 0.162075 0.718013 0.036144 0.617318 0.467508
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.150759 0.387626 0.010747 0.194598 1.613578 0.502632 -0.094849 1.423424 0.618895 0.635200 0.378514
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.121497 3.615713 -1.296586 8.526023 18.124463 2.994529 -0.144810 0.208832 0.637251 0.524540 0.423217
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.366040 -0.003412 0.178665 0.798092 -0.727943 0.717802 -0.932082 0.731080 0.632896 0.635493 0.381400
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.456271 -0.067335 -0.418128 -0.353424 -0.733313 0.603441 -0.881110 -0.587335 0.630170 0.641030 0.379265
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.217316 5.346282 0.294065 0.894414 -0.720051 2.134940 0.068782 14.805736 0.620312 0.622234 0.372198
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.430249 -0.024121 -0.721184 -0.939180 -0.364616 -0.029319 -0.487940 -0.831601 0.621042 0.638556 0.391158
47 N06 not_connected 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.702472 0.574691 0.215928
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.575933 1.135149 -0.189094 1.795240 -0.751342 2.236178 -0.301760 -1.827805 0.587713 0.608603 0.387994
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.215736 -0.408398 -0.148923 -0.236382 0.876459 -0.756130 -0.053814 0.132528 0.548589 0.585404 0.383518
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.403119 18.827554 0.420942 1.470847 0.167171 2.916222 17.872576 76.068288 0.592373 0.538547 0.380344
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 10.569575 5.223066 0.189829 1.942266 3.631252 4.405093 25.743274 3.772217 0.506352 0.507988 0.260373
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.030747 7.763062 -0.390894 0.683119 0.927712 0.912596 1.729646 1.019308 0.624047 0.627410 0.392446
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.963035 3.391205 -1.325683 -0.497545 0.643905 12.624525 1.988477 5.102559 0.636603 0.641218 0.396463
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 32.677657 -0.727755 4.719534 -0.620552 1.556550 0.332412 3.092811 0.785119 0.454762 0.642000 0.382130
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 12.985909 16.300007 9.531454 10.205637 9.139938 10.699455 0.204518 1.267887 0.028618 0.031217 0.002434
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.566666 0.233357 -0.643474 1.457415 -0.307619 0.818879 -0.558007 1.601302 0.629723 0.648004 0.376323
57 N04 RF_maintenance 100.00% 100.00% 0.00% 0.00% 13.804931 2.785906 10.361347 -1.033116 8.973035 1.813695 1.088087 2.361695 0.041694 0.645719 0.500162
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.197518 15.833218 9.946412 10.746761 9.094681 10.695314 1.701777 1.360331 0.034559 0.034378 0.001695
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 13.213728 1.022748 9.508011 0.774779 8.910888 2.517976 0.004921 1.751585 0.044961 0.625687 0.489120
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.692681 15.728322 -0.424354 10.773292 -0.291029 10.712398 7.663793 1.936352 0.623435 0.063644 0.506256
61 N06 not_connected 100.00% 99.89% 99.84% 0.00% 251.104905 251.588339 inf inf 3124.375992 3201.799971 5178.490591 5415.919629 0.332155 0.354246 0.243817
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.320099 0.792125 -0.916940 1.139821 0.202993 0.077544 1.103223 -0.644912 0.565523 0.603104 0.385319
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 2.297295 16.349364 -0.185030 5.072838 1.117314 10.813923 -0.284663 1.527856 0.582153 0.042546 0.469641
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.208175 0.089580 -0.655724 -0.713106 -0.422601 -0.946819 0.884903 1.896906 0.578881 0.564765 0.370732
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.571673 1.769952 0.562291 1.185523 -0.413544 0.614940 0.402824 -0.001076 0.599766 0.611745 0.403330
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.171127 2.029376 -1.275756 -0.753086 2.403250 0.124337 -0.414832 0.364674 0.618315 0.627976 0.399822
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.811830 -0.509372 -0.765173 0.792101 -0.449077 1.006947 0.117887 2.715557 0.627598 0.627263 0.388743
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 22.968186 32.582848 0.986152 13.998764 4.463110 10.635834 0.038023 6.650179 0.367214 0.028079 0.268092
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.526385 0.373132 0.426303 0.961419 -0.584061 1.462216 -0.537389 -0.554229 0.627301 0.640483 0.372923
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.618130 -0.232789 -0.067640 0.213440 0.516389 1.561952 0.184557 -0.079116 0.636753 0.648079 0.372871
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.886359 -0.415239 0.732897 1.173827 -0.188321 -0.064869 2.354943 0.443674 0.631030 0.654045 0.372104
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 13.425996 17.217995 10.428551 11.146087 8.966508 10.528361 0.462274 0.597222 0.033960 0.036909 0.004328
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.750627 0.925421 -1.227310 -0.842425 0.826089 -0.295898 -0.519291 -0.751360 0.642521 0.650861 0.377260
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.345299 0.013029 0.013713 -0.344819 -0.174036 1.446803 -1.024383 2.226698 0.641252 0.644248 0.377554
77 N06 not_connected 100.00% 99.89% 99.95% 0.00% 264.385859 264.810852 inf inf 3074.885065 3091.427598 6322.626448 6175.430651 0.317030 0.278060 0.333876
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 38.742808 0.775794 -0.302513 1.484790 2.303732 0.939636 2.741577 -0.001108 0.424756 0.613094 0.377667
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.853950 16.696899 -1.295046 5.093615 -0.651203 10.636299 0.722917 -0.575496 0.581382 0.038657 0.455574
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.468085 17.709423 0.473475 4.997544 -0.662624 10.667388 -0.415928 0.537739 0.597264 0.046441 0.474686
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.486386 16.783900 0.228392 9.412204 -0.587739 10.408492 0.158463 1.208758 0.576512 0.037468 0.446599
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.350655 1.549841 -0.932575 -0.127770 -0.260162 -0.903800 -0.267708 -0.054708 0.608019 0.620554 0.393598
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.592986 -0.014325 0.320356 0.550115 -0.013603 0.240074 -0.531262 0.481021 0.613136 0.615803 0.381793
84 N08 RF_maintenance 100.00% 71.40% 100.00% 0.00% 23.857874 29.016775 12.806951 13.558946 7.656448 10.649885 2.650913 3.036270 0.194950 0.035704 0.127592
85 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.244509 0.338943 -1.262454 -0.748328 8.705720 0.421567 1.070882 0.795360 0.639311 0.648238 0.378893
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.186728 1.483311 -0.613642 -0.109657 2.960323 0.256923 0.252718 16.560311 0.631364 0.646044 0.364332
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.596146 5.437831 -0.680856 -0.227964 0.363531 1.143308 27.663047 29.415674 0.631363 0.651839 0.354197
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.963520 0.072520 0.499654 0.976591 -0.156068 -0.598760 0.982521 0.121564 0.637871 0.648217 0.366432
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.789033 0.463643 0.202524 1.034804 -0.397914 -0.477140 -0.630172 -0.408666 0.636623 0.649717 0.370236
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.137792 -0.217623 -1.150952 -0.335741 -0.535580 -1.332559 -0.278427 2.290467 0.641719 0.656828 0.376923
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.827016 -0.464847 -0.098692 -0.135693 -0.821180 -0.598431 0.214679 0.867651 0.621470 0.641172 0.377504
92 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.723075 15.838854 9.925850 10.555534 9.262463 10.818587 -0.128622 0.443725 0.026716 0.025258 0.001454
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 13.091571 16.052847 10.077461 10.851289 9.048125 10.646472 1.480238 0.911130 0.025489 0.024794 0.001074
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 13.979195 16.328669 10.167456 10.643471 8.987006 10.704872 0.533055 0.097863 0.025230 0.025111 0.001050
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 8.388110 4.578605 -0.735266 0.868672 0.522808 0.666100 0.744321 0.451510 0.532415 0.570381 0.342936
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.444201 24.461386 3.776443 1.698372 3.895162 2.943339 -2.459306 -1.433049 0.596611 0.493834 0.369351
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.109332 5.725140 -0.625779 1.105986 0.014947 2.903043 0.410923 8.624094 0.578992 0.535039 0.382656
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.581223 9.048000 -0.277951 1.320572 -0.173741 1.605528 0.576960 0.731378 0.632798 0.634610 0.379095
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.748619 1.358464 -1.259279 -0.708055 0.046682 1.081470 0.334780 6.992824 0.635639 0.646467 0.374536
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.854912 4.394980 1.980290 -1.162815 0.062781 7.116630 0.048195 6.296158 0.642528 0.646053 0.366976
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.393217 70.744085 -0.951861 7.151882 3.103983 -0.073493 0.134600 0.258084 0.644520 0.627251 0.373988
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.622995 0.089800 -0.283956 0.430133 0.188340 -0.523969 -0.597708 -0.369239 0.642949 0.652334 0.367982
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.604688 -1.125989 -0.953292 -0.305329 1.228511 -0.796602 -0.128321 0.187060 0.642905 0.642094 0.366472
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 4.022236 1.899088 -0.567562 -0.993314 0.291065 0.048987 6.421768 5.543558 0.634700 0.655516 0.369271
108 N09 RF_maintenance 100.00% 100.00% 0.11% 0.00% 12.788336 49.358268 9.984651 1.181519 9.169805 4.327720 0.853244 7.546179 0.032951 0.281573 0.154682
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 12.570970 15.825191 10.017683 10.505258 9.241072 10.783019 -0.022185 1.016421 0.027991 0.033248 0.003490
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.807796 17.181958 6.828126 0.104139 2.533375 -0.210240 -0.188499 -0.283594 0.587368 0.592856 0.362019
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 39.860222 15.673635 1.083426 10.595305 4.615899 10.774775 7.784303 1.074023 0.483174 0.056266 0.328221
112 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 12.764566 15.988881 9.812269 10.758102 9.165880 10.775058 -0.174247 0.081988 0.029886 0.030832 0.001070
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 15.068890 17.374787 4.223585 5.088764 9.027119 10.618328 0.937236 0.027394 0.035109 0.031197 0.002024
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 23.098298 16.108636 21.356371 13.872931 35.548257 12.247020 928.614206 147.897888 0.017367 0.023298 0.003556
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.120315 -0.940009 -0.935750 0.223803 -0.087917 -0.789223 -0.541442 -0.882749 0.564793 0.587117 0.390529
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 13.771340 17.552946 10.116623 11.102604 9.029371 10.699603 0.855934 2.720751 0.028455 0.031088 0.002145
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.520398 1.915463 -0.010747 0.724982 0.113363 0.356076 -0.064115 0.513756 0.610554 0.622003 0.391000
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.458928 2.150230 2.820728 -0.873299 -0.635958 0.989264 0.687760 -0.116200 0.623024 0.646352 0.378786
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.769862 3.589016 -0.947741 6.130034 0.801499 -0.524893 3.479745 13.841427 0.643895 0.623681 0.370409
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.113326 8.136704 -1.090082 -1.096527 -0.133338 0.845125 -0.247732 -0.753915 0.647162 0.659969 0.373217
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.952150 10.329133 0.870167 1.152525 0.024902 0.287387 -0.069915 0.778251 0.651146 0.658058 0.373865
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 12.938419 0.003311 10.266880 0.795340 8.999647 0.353539 0.084600 0.563367 0.039314 0.659398 0.463751
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.059819 0.052217 -0.073295 1.002195 1.163240 0.310283 1.090616 0.933235 0.644054 0.648865 0.372262
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.284913 0.011123 -0.975699 1.213785 1.760731 -0.034165 3.860424 0.001076 0.644755 0.645270 0.377237
127 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.768238 0.587546 0.819843 0.598478 1.851378 1.096573 15.697080 6.553770 0.633821 0.652036 0.384672
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% -0.342101 -0.302112 -1.304807 -0.281244 -0.457590 0.561227 0.081532 4.626813 0.641802 0.649001 0.390212
131 N11 not_connected 100.00% 0.00% 3.93% 0.00% -0.267858 15.296495 0.116917 4.888239 -0.883533 9.295809 -0.711395 -0.209071 0.601469 0.278150 0.431899
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.603261 0.685740 -0.215517 -1.337504 1.272804 -0.938272 0.833594 0.205311 0.583506 0.586030 0.379628
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.205169 -1.465399 -1.270970 -0.332159 -0.888285 -1.193290 -0.530357 0.693778 0.566542 0.590936 0.394579
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 14.514238 17.324317 4.369308 5.052791 9.018214 10.646659 -0.089670 0.191764 0.039584 0.034453 0.002812
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.026554 -1.454053 -0.934952 -1.366134 1.693029 0.787587 11.833189 0.013722 0.568667 0.600328 0.405971
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 11.762303 -0.585037 9.612858 -0.603817 9.212933 0.702106 0.809156 -0.495819 0.038376 0.603257 0.456753
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.378024 -0.752887 0.300639 -1.308407 1.144166 -0.390518 0.434935 0.429004 0.591075 0.617141 0.392204
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.511850 1.973235 1.613324 -0.857397 1.225660 -0.345117 -0.670859 -0.115464 0.619648 0.611545 0.373707
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.370965 -1.155903 -0.837484 -0.154756 -0.838140 -0.770013 3.420092 2.851832 0.637742 0.648005 0.374032
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.452493 -0.915234 -0.167935 0.669716 1.226956 -0.634646 1.211341 -0.717973 0.636939 0.654224 0.373727
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.922869 15.793636 -0.577187 10.779729 2.288659 10.724087 18.165699 0.800097 0.641603 0.044229 0.531394
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 13.564125 15.768363 9.902520 10.753184 8.662094 10.764823 -0.130430 0.718235 0.089959 0.029808 0.046934
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -1.082930 4.561935 -1.136842 8.396113 -0.087470 11.074324 -0.614834 0.238578 0.649330 0.520513 0.427137
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.936161 -0.002474 1.531852 1.222261 -0.197080 3.019302 -0.171228 -1.246362 0.635746 0.652207 0.374304
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.098022 0.862708 -0.713562 0.487250 -0.647084 0.157482 -0.487365 -1.463653 0.617743 0.637676 0.373705
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.446419 -1.475638 1.349419 2.523260 -0.104959 -0.301179 0.844761 0.678123 0.626844 0.629453 0.376384
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.653454 0.121041 -0.484478 -0.420676 1.241204 1.766569 -0.604288 -0.720476 0.629432 0.642458 0.391210
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.160988 -1.463951 -0.676558 -1.230077 -0.254526 1.063659 -0.102534 -0.251492 0.626431 0.636512 0.397205
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.633803 3.463146 -1.030756 -1.173180 -1.068522 -0.431624 0.518506 0.776457 0.624196 0.613242 0.392372
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 16.029593 1.299342 0.215307 0.683569 4.075352 -0.923481 7.406933 -0.097824 0.531990 0.560277 0.352806
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 12.185806 -1.322054 9.766744 -1.133625 9.237896 0.041540 1.241151 1.147454 0.039468 0.604027 0.467327
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 5.484753 15.530136 8.469073 10.551291 5.709877 10.802987 1.111610 1.104116 0.399244 0.037851 0.311809
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.283531 -0.327942 0.085999 0.871790 -0.312912 1.059241 -0.241975 -0.125547 0.598213 0.614781 0.390664
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.148351 -0.343237 -0.021729 0.004108 1.494072 1.868758 2.429534 13.323817 0.612233 0.629308 0.391138
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.697103 23.482901 -1.342536 -0.778508 -0.089585 5.794077 -0.461058 42.586377 0.584205 0.530643 0.358530
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.182651 -1.068869 -0.434705 -0.483757 -0.516814 1.766102 -0.680811 0.541633 0.627882 0.640604 0.379834
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.096651 34.791317 0.120592 -0.262542 0.248695 1.277266 -0.345985 0.450808 0.633065 0.506421 0.350898
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.419197 -1.234366 0.065114 -1.109681 0.981632 1.169368 7.592276 0.042596 0.647129 0.655170 0.379542
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.554636 1.698968 -0.080166 0.596232 -0.227285 1.163955 -0.370055 0.934461 0.645377 0.653362 0.382160
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.294351 -0.102398 -0.359842 1.602626 -0.684003 1.339894 1.861719 0.691260 0.642413 0.641616 0.374757
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 28.125870 0.302073 -0.620897 -0.727606 4.854178 0.078786 18.491499 0.258153 0.536680 0.649918 0.375989
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.301560 0.252975 0.712377 0.800173 -0.211303 -0.292995 0.096698 -1.014178 0.635542 0.651354 0.372315
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.217680 -1.108937 -1.278030 -0.906215 1.174336 -0.352672 -0.220706 0.754276 0.633353 0.643994 0.384142
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.044022 -1.463696 0.370578 -0.193096 0.863051 0.943322 -0.421222 0.843923 0.628509 0.635127 0.391340
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.948509 -1.261703 -0.784835 -1.335757 0.661245 0.664979 -0.681951 -0.600407 0.628578 0.637476 0.394875
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 13.735451 -0.581584 10.317057 -0.494080 9.003628 0.084801 1.616072 5.450876 0.038446 0.630195 0.500381
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.144085 1.946168 -1.262560 -0.428233 -0.623987 0.494761 -0.284183 1.336551 0.571601 0.561999 0.367237
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 15.223476 16.398387 3.942938 4.696564 9.285953 10.791371 2.512020 3.917358 0.035687 0.041035 0.003846
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.336614 -1.015247 -1.022447 -0.602949 0.167912 13.495874 -0.495880 2.327457 0.608736 0.623933 0.388740
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.326976 16.544895 -1.362726 10.919060 0.052455 10.645380 13.822472 1.295786 0.628377 0.050847 0.530510
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.568795 -0.147414 0.801287 0.676448 0.301914 -0.008065 -0.186806 3.150430 0.631526 0.638551 0.385762
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.230627 15.443711 -1.155353 10.489422 0.989484 10.820878 4.077660 0.915330 0.641204 0.045210 0.496614
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.275364 0.626088 -0.478853 0.204836 1.032513 0.018881 0.928701 0.099794 0.629342 0.639460 0.372568
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 23.720744 -0.274450 5.028317 -1.210076 6.897883 0.897934 3.532705 -0.132623 0.507418 0.646366 0.385609
185 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.764828 -0.496191 3.930997 0.956279 4.934498 -0.145196 -1.077146 -0.251114 0.608201 0.645958 0.385827
186 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 4.180330 -0.937577 0.592517 -0.151492 -0.674148 -0.922924 -0.034021 -0.795632 0.619575 0.648898 0.385136
187 N14 digital_ok 100.00% 43.78% 0.00% 0.00% 11.448530 -1.108430 9.505835 -0.257459 7.745683 2.087733 0.286165 -0.256014 0.220051 0.642015 0.475059
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 11.509788 15.302471 9.583509 10.616640 9.321066 10.828830 4.197950 1.625294 0.028400 0.030954 0.001151
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.319734 -1.570248 -0.567291 0.418923 -0.349719 -0.123594 -0.479872 -1.093972 0.620488 0.632556 0.399636
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 0.878841 -0.434219 1.381504 -0.228034 0.422543 0.778972 7.177611 1.165977 0.597833 0.611596 0.392458
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.850562 8.142580 3.268770 4.674426 5.098604 8.709152 0.985086 -2.999240 0.586712 0.561673 0.395570
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 8.962032 1.181449 5.009447 1.613266 7.275331 2.293557 -2.941769 -0.413208 0.551221 0.579077 0.402424
200 N18 RF_maintenance 100.00% 100.00% 63.48% 0.00% 14.817532 45.307696 4.351215 -0.052182 9.264599 4.940924 0.738186 11.802055 0.040825 0.204018 0.137040
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.653889 5.866307 3.174328 4.045233 2.854528 7.087923 -0.480278 -2.357296 0.610798 0.606211 0.380996
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.997024 4.073281 1.736309 -1.235881 1.241864 -0.496051 -0.337793 21.123720 0.622282 0.603713 0.379949
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.863209 18.088739 1.160198 -0.918574 -0.330339 0.859614 11.055742 1.435963 0.619056 0.641026 0.388212
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 10.199209 1.212298 3.495713 -1.158539 6.096314 -0.764930 11.592993 2.940658 0.377266 0.610334 0.451030
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.972281 7.471100 -0.767990 2.437314 3.656003 3.331147 -0.463337 0.165994 0.589608 0.489303 0.406160
207 N19 RF_ok 100.00% 99.95% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.425738 0.088021 0.366981
208 N20 dish_maintenance 100.00% 99.89% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.467405 0.471997 0.384300
209 N20 dish_maintenance 100.00% 99.84% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.483597 0.556966 0.322380
210 N20 dish_maintenance 100.00% 99.89% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.306169 0.407279 0.360005
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.528083 16.412565 -1.204404 5.114173 -0.956041 10.656081 -0.133072 0.398001 0.569162 0.038415 0.487574
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.330604 -1.249101 0.591433 -0.332089 -0.433969 0.008065 2.706850 -1.132355 0.611085 0.607132 0.379536
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 3.263604 -0.365384 -0.904091 -0.638841 4.746304 -0.786064 6.579606 -0.715323 0.589288 0.612937 0.380584
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.492410 -0.255641 -0.077934 0.186498 -0.639906 -0.619087 2.797483 -1.216475 0.600871 0.617671 0.381715
223 N19 RF_ok 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.385171 0.442919 0.356026
224 N19 RF_ok 100.00% 99.89% 99.84% 0.00% 283.932537 283.208483 inf inf 3124.896838 3079.431375 5071.040409 4937.759493 0.500417 0.501466 0.440947
225 N19 RF_ok 100.00% 0.00% 94.81% 0.00% -0.532760 15.989284 0.837437 4.863295 -0.718906 10.462438 -1.054365 0.911865 0.602848 0.119936 0.512902
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.336984 26.887581 -0.351066 0.722475 -1.046229 3.796161 -0.814520 0.043682 0.594906 0.496099 0.376041
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 5.586228 0.113076 1.996496 -0.878990 2.276265 7.059631 4.599889 1.463113 0.477798 0.589896 0.415952
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.046935 -0.089279 1.181137 -1.282900 0.712887 -1.052655 0.087819 1.028085 0.581670 0.576099 0.378963
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.563391 0.633217 0.973472 1.456755 -0.357338 1.441721 0.240760 -1.890732 0.584959 0.590604 0.396612
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 3.594799 -0.234649 0.029870 -1.353557 -0.788700 -0.947788 -0.516639 -0.896873 0.541545 0.588469 0.392592
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.043800 -0.403554 1.076067 0.423618 -0.224503 -0.759496 -1.360662 -1.532191 0.599875 0.606487 0.388437
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.969043 -1.428249 0.090518 0.173041 -0.638213 -0.747742 1.607234 1.105415 0.599444 0.606094 0.388474
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.533212 0.060948 0.169122 -0.303871 -0.156404 -1.117310 8.944671 4.509626 0.585291 0.599434 0.390154
241 N19 RF_ok 100.00% 99.95% 99.89% 0.00% 293.505892 292.932088 inf inf 2978.503447 3030.123119 4510.775180 4594.185285 0.380810 0.330846 0.307946
242 N19 RF_ok 100.00% 99.95% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.377234 0.341494 0.242711
243 N19 RF_ok 100.00% 99.89% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.480569 0.266644 0.397894
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.169393 -1.287156 -0.867859 -0.842097 0.016104 -0.930368 1.978528 5.158827 0.546203 0.590508 0.396107
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.656222 0.661648 0.778096 -1.061661 -0.066437 -1.331378 -1.355786 0.354806 0.581727 0.583706 0.388232
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% 0.244357 17.563898 -0.104190 4.008853 -0.743029 10.754274 -0.747046 -0.258417 0.568501 0.037763 0.485129
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.396587 2.629401 0.341142 -0.211467 0.289682 -0.836245 2.811039 2.269969 0.573459 0.559645 0.385136
262 N20 dish_maintenance 100.00% 0.98% 13.86% 0.00% 13.961361 15.366612 5.197997 5.498678 3.975100 5.928965 0.167858 2.276379 0.270735 0.247830 0.126044
320 N03 dish_maintenance 100.00% 100.00% 100.00% 0.00% 17.636207 16.307133 6.707690 7.163225 9.225773 10.829844 0.408596 1.702041 0.054592 0.046939 0.007100
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 3.345950 3.161247 1.185306 1.450579 0.926293 1.502930 2.107581 -0.531944 0.483254 0.499732 0.371947
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.396392 -1.010032 1.277158 -1.355399 1.008792 -1.175376 -1.217604 -0.035882 0.520048 0.515451 0.389487
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.864105 -0.481520 -1.286733 -0.943973 10.853583 -1.239619 6.629389 1.405442 0.475401 0.505909 0.376359
333 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.807416 4.911504 -0.997134 -1.248146 -0.443735 -0.602600 0.746422 1.200271 0.464141 0.480906 0.355760
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 7, 15, 16, 18, 19, 20, 27, 28, 29, 32, 34, 36, 40, 42, 45, 47, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 63, 68, 71, 72, 77, 78, 79, 80, 81, 84, 85, 86, 87, 92, 93, 94, 95, 96, 97, 101, 102, 103, 104, 107, 108, 109, 110, 111, 112, 113, 114, 117, 120, 121, 122, 123, 124, 127, 128, 131, 134, 135, 136, 142, 143, 144, 151, 155, 156, 158, 159, 161, 162, 165, 170, 173, 179, 180, 182, 184, 185, 186, 187, 189, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 221, 223, 224, 225, 226, 227, 240, 241, 242, 243, 244, 246, 262, 320, 329, 333]

unflagged_ants: [5, 8, 9, 10, 17, 21, 22, 30, 31, 35, 37, 38, 41, 43, 44, 46, 48, 49, 56, 62, 64, 65, 66, 67, 69, 70, 73, 74, 82, 83, 88, 89, 90, 91, 105, 106, 115, 118, 125, 126, 132, 133, 137, 139, 140, 141, 145, 146, 147, 148, 149, 150, 157, 160, 163, 164, 166, 167, 168, 169, 171, 181, 183, 190, 220, 222, 228, 229, 237, 238, 239, 245, 261, 324, 325]

golden_ants: [5, 9, 10, 17, 21, 30, 31, 37, 38, 41, 44, 56, 65, 66, 67, 69, 70, 83, 88, 91, 105, 106, 118, 140, 141, 145, 146, 147, 148, 149, 150, 157, 160, 163, 164, 166, 167, 168, 169, 171, 181, 183, 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_2459991.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 [ ]: