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 = "2459951"
data_path = "/mnt/sn1/2459951"
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: 1-6-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/2459951/zen.2459951.21322.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 1849 ant_metrics files matching glob /mnt/sn1/2459951/zen.2459951.?????.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/2459951/zen.2459951.?????.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 2459951
Date 1-6-2023
LST Range 1.613 -- 11.564 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1849
Total Number of Antennas 196
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 196 (0.0%)
Antennas in Commanded State (observed) 0 / 196 (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 58 / 196 (29.6%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 135 / 196 (68.9%)
Redcal Done? ❌
Never Flagged Antennas 61 / 196 (31.1%)
A Priori Good Antennas Flagged 59 / 93 total a priori good antennas:
3, 7, 9, 10, 15, 16, 29, 30, 31, 37, 38, 40,
42, 45, 53, 54, 55, 56, 67, 70, 71, 72, 81,
86, 88, 93, 94, 101, 103, 106, 107, 109, 111,
121, 122, 123, 128, 136, 140, 143, 146, 151,
158, 161, 162, 164, 165, 167, 170, 173, 181,
182, 185, 187, 189, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 27 / 103 total a priori bad antennas:
22, 35, 46, 48, 49, 61, 62, 64, 74, 79, 82,
89, 115, 125, 132, 137, 139, 207, 220, 226,
229, 245, 261, 324, 325, 329, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459951.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% 0.00% 0.00% 9.139907 11.623075 10.619348 -1.076153 7.728252 6.999368 1.154173 19.824885 0.033705 0.357553 0.284355
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.168173 1.663469 0.076394 -0.548352 2.981183 3.313406 39.351418 53.340456 0.633060 0.657979 0.410364
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.124680 -0.186729 0.108467 -0.078806 0.011968 1.410914 2.123164 -0.098025 0.637344 0.657014 0.407790
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.883123 -0.152017 -1.292669 -0.221398 -0.279937 0.096755 23.273115 22.814991 0.643796 0.661981 0.399447
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.406746 -1.076062 -0.546378 -0.005017 -0.066060 0.542502 4.562852 5.204824 0.643758 0.658646 0.394307
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.722644 -0.674735 8.814613 -0.385305 3.362793 0.135893 0.350905 -0.375775 0.478891 0.657990 0.470238
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.478000 -0.855381 -1.290607 -1.458288 -0.375041 0.822098 0.210428 6.446937 0.635208 0.656098 0.401540
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.330827 14.536484 10.009200 -0.966633 7.733921 4.066442 0.246451 3.886109 0.034648 0.359704 0.275544
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.373243 -0.743480 10.587516 0.521711 7.731384 2.137292 0.984667 6.815376 0.033107 0.661763 0.537687
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.629315 1.654290 0.456555 0.407297 0.855101 0.878871 2.380222 0.416642 0.643037 0.661380 0.404576
18 N01 RF_maintenance 100.00% 100.00% 53.16% 0.00% 9.980893 17.544593 10.591501 -0.248068 7.902387 4.557082 1.109652 30.886784 0.029993 0.222298 0.169849
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.379286 -0.770625 -1.111490 -0.934836 0.704524 0.823575 0.245968 0.887215 0.647712 0.670417 0.394783
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.630120 -1.241334 2.513628 -0.702972 0.019075 -0.229715 1.283742 -0.004410 0.643862 0.666828 0.399409
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.592719 0.525756 -0.714586 -0.188880 0.239076 1.254070 0.041737 -0.090381 0.636054 0.646282 0.389085
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.893975 -0.499169 0.006275 -0.136245 2.346652 1.805863 -0.348598 -1.476710 0.609919 0.630289 0.397084
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.765489 10.045629 10.644033 10.999338 7.868653 8.764784 3.609394 2.662312 0.036807 0.041635 0.006781
28 N01 RF_maintenance 100.00% 0.00% 84.80% 0.00% 9.506415 23.449861 -0.825025 1.215374 5.013308 4.793703 5.556848 24.688252 0.368606 0.163857 0.274082
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 9.358743 10.433372 10.228402 10.586532 7.864101 8.754626 1.091782 0.547989 0.029916 0.037106 0.007579
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.172512 0.102308 -0.572701 0.561806 5.023244 0.416590 5.415319 0.064277 0.654485 0.669517 0.396165
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.096934 0.271118 1.063519 1.532746 1.377491 0.946762 1.203772 6.056246 0.660377 0.663392 0.388287
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.504555 10.012706 0.841465 2.048888 8.479523 6.095564 81.939936 118.456554 0.566213 0.613303 0.335451
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.685284 11.449252 4.917758 5.155767 7.798967 8.705192 1.438359 1.024818 0.034578 0.047594 0.008940
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.532234 -0.681477 1.282198 -1.031432 -0.616470 -1.116311 -0.617227 -0.635414 0.621319 0.625787 0.392270
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.398415 6.701667 0.346159 0.293961 0.763850 1.423435 2.276859 2.517681 0.632654 0.647043 0.407847
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.780670 0.250605 -1.278321 0.775197 0.512468 0.890781 -0.824791 11.901226 0.645630 0.656690 0.409516
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.335695 0.285741 0.453441 0.838129 0.076852 0.723744 5.203004 3.424125 0.648578 0.662990 0.410384
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 8.734075 0.401932 10.265986 0.594419 7.858301 -0.688520 0.982433 0.498020 0.038843 0.658285 0.515614
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.693806 0.052542 -0.395263 0.016849 1.780953 0.001947 -0.524111 1.686021 0.650234 0.666862 0.391857
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.894480 10.936024 10.874059 11.474071 7.591462 8.497359 0.626477 1.840590 0.026985 0.026013 0.001317
43 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.053027 0.217168 0.011678 0.585915 -0.446826 0.446309 0.616144 5.187806 0.659173 0.670745 0.394424
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.498998 0.223906 -1.344583 0.133964 -0.359540 0.271045 -0.910392 -0.266485 0.662839 0.678387 0.390245
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -0.033789 1.448226 0.459289 0.343128 -0.309883 1.344650 0.294294 4.552837 0.655586 0.666376 0.385362
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.965578 0.092755 -0.656121 -0.967921 -0.463048 -0.512910 -0.294483 -0.681784 0.656618 0.680447 0.404417
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 9.962217 11.184112 4.728754 4.762694 7.760463 8.634629 1.290732 0.061375 0.030883 0.052909 0.015367
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.137033 0.925587 0.695377 1.786069 -0.768258 2.100394 -1.951305 -2.739286 0.628413 0.649438 0.397700
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.199797 -0.482872 -0.235946 -0.599682 0.128408 -0.334471 0.036840 2.325664 0.579724 0.626527 0.399997
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.997171 4.749850 0.546236 1.060401 0.611086 2.297219 52.637934 140.181127 0.621554 0.622384 0.381424
51 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 21.680926 3.624694 13.471429 -0.750142 8.033986 4.826865 13.183725 7.742011 0.042795 0.545921 0.421798
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.664057 5.713217 -0.419865 0.550631 0.947043 0.884360 1.575943 0.760192 0.652503 0.665124 0.399897
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.569821 2.471652 -0.026934 0.122963 1.707359 1.135002 4.490799 10.244131 0.658526 0.671024 0.405990
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.196125 10.652443 10.653148 11.234719 7.797119 8.694892 2.664331 1.346680 0.026858 0.025886 0.001293
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 207.621380 207.066074 inf inf 3605.488838 3883.275762 9416.594521 11118.779192 nan nan nan
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.131740 11.359134 0.660606 11.349084 -0.030276 8.597377 4.779962 1.346225 0.655675 0.039905 0.541101
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 21.367770 0.640439 7.968447 1.263605 4.412331 0.090677 6.889739 3.368810 0.424149 0.675872 0.407431
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.708953 10.322776 10.519843 11.109114 7.728749 8.649801 1.967205 1.520923 0.036770 0.036633 0.001670
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.777258 0.728493 10.570607 2.101534 7.578097 2.385267 0.773021 11.196006 0.050147 0.666419 0.538718
60 N05 RF_maintenance 100.00% 0.00% 99.78% 0.00% 0.639263 10.265636 -0.286783 11.148482 -0.022513 8.689216 2.258164 3.683729 0.656105 0.076723 0.534868
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.446166 -0.233083 -0.115740 -1.496074 1.690485 -1.210735 -0.642344 1.319372 0.598065 0.641102 0.393745
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.170452 1.185788 -0.641478 1.339401 -0.828378 -0.066124 1.110673 -1.422314 0.600578 0.648504 0.398920
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.121435 10.679255 -0.451991 5.195002 -0.013810 8.803204 0.699906 3.692633 0.620626 0.047895 0.498067
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.013398 0.013398 -0.708719 -0.979387 -0.916725 -1.211792 3.115016 0.250797 0.608032 0.611312 0.382571
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.802865 0.958582 0.792914 1.148091 0.501288 0.608516 -0.036458 0.860430 0.628336 0.650981 0.415294
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.862640 1.274490 -1.362846 -1.208346 2.102609 -0.418676 -0.720918 2.696878 0.646181 0.664167 0.407957
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.392910 -0.414501 -0.039863 1.258256 -0.037142 0.432446 1.774540 7.082136 0.653122 0.665364 0.400670
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 20.056712 24.056853 1.505994 14.580675 4.257297 8.722866 0.471132 13.405059 0.367440 0.030783 0.270977
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.562757 -0.058489 0.626824 0.683633 -0.232925 1.209240 0.372248 0.666952 0.652866 0.671048 0.389708
70 N04 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
71 N04 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.239715 11.375933 10.988271 11.503612 7.628666 8.514400 1.003436 1.486902 0.026897 0.025308 0.001621
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.519026 0.696021 -1.500416 0.668983 0.947776 6.010821 -0.115888 -0.028580 0.671994 0.679021 0.383172
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.605154 0.716693 0.074241 -0.744369 -0.464632 2.283611 -1.684836 2.189914 0.669280 0.679827 0.381544
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 37.462195 0.936951 0.092057 -0.031467 5.720322 -0.667548 70.306944 -0.895764 0.413060 0.645630 0.411797
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 28.721962 0.299789 -0.447361 1.237954 1.704442 0.101063 1.379047 3.765261 0.453609 0.654064 0.387867
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.067394 -0.308651 -1.475668 0.121014 -1.010631 -1.081997 0.393951 -1.752018 0.610961 0.645048 0.400782
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.898695 11.725847 -0.022972 5.090148 -0.246861 8.625277 3.367635 1.667842 0.609096 0.054690 0.475593
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.204206 11.051021 -0.032434 9.657905 -0.217238 8.374144 -0.182269 2.598303 0.606704 0.039917 0.470623
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.664796 -0.205385 0.390322 2.078563 0.284877 0.190924 -0.499032 0.419654 0.626505 0.638017 0.396922
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.445480 0.255262 0.158479 0.445279 0.525313 0.418335 -0.622661 1.724251 0.637908 0.656691 0.398251
84 N08 RF_maintenance 100.00% 48.73% 100.00% 0.00% 17.786375 21.294247 13.535443 14.110766 6.255657 8.652211 5.615022 7.156747 0.223948 0.036665 0.143963
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.125136 0.186857 0.045642 0.722416 -0.164691 -0.037798 -0.557314 0.034525 0.653674 0.667798 0.391800
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.213121 -0.395883 2.372532 1.710639 3.838826 -0.482146 1.093502 26.914009 0.632540 0.655779 0.375031
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.646007 6.367249 0.774685 -0.081280 14.197525 1.098920 11.986795 4.269749 0.585337 0.684122 0.369477
88 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.318460 0.213178 0.401276 1.108406 -0.794455 0.262761 8.326059 4.397710 0.658564 0.672876 0.373439
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.807257 0.405221 0.355700 0.963498 -0.737441 -0.591596 -0.577996 -0.182463 0.664312 0.678880 0.377314
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.049351 -0.550613 1.084365 1.509218 -0.794686 -0.562564 1.255863 6.471080 0.659708 0.671027 0.377251
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.330246 -0.188905 0.592538 0.433237 -0.788036 -0.668055 -0.020831 -0.130914 0.658121 0.679302 0.390121
92 N10 RF_maintenance 100.00% 0.00% 11.79% 0.00% 31.737297 37.832307 0.748411 1.282633 4.524380 5.072380 0.477165 11.119533 0.292590 0.250913 0.089063
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 2.200896 1.231153 2.627714 -0.475224 0.185372 0.542469 7.225290 1.845933 0.645421 0.671337 0.393464
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.142777 10.745579 10.791301 11.005423 7.782274 8.678641 1.362845 1.094258 0.032095 0.026392 0.002737
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.612182 -0.484186 -0.699159 0.859348 -0.524924 -0.153450 2.050876 6.436225 0.625059 0.655627 0.399894
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.251708 11.357533 4.727609 5.255295 7.609386 8.499426 1.479716 0.962574 0.033320 0.040066 0.003361
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.084102 7.302360 -1.128269 3.417583 0.700497 4.874588 1.881905 4.134689 0.606232 0.478091 0.403528
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.531577 7.478427 -0.270478 1.080027 0.114797 1.280106 0.438521 1.490769 0.656428 0.669034 0.391202
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.689471 1.146678 -0.712192 -1.469233 0.542402 0.597441 -0.296949 9.905663 0.661696 0.676890 0.390668
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.001940 4.867750 3.901946 -1.028648 9.151663 1.423185 9.388112 15.796449 0.641644 0.679515 0.389985
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.772876 53.198896 -0.282407 7.864090 3.281601 4.067781 2.535903 6.372467 0.666149 0.645425 0.379471
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.104939 -0.157416 0.083145 1.004145 0.795210 -0.631213 -0.134302 0.042971 0.667397 0.677105 0.371488
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% -0.089454 0.406465 1.974347 1.347798 14.265342 -0.331695 0.974679 2.094735 0.644820 0.672078 0.372647
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 2.277283 1.188476 -0.876521 -0.951523 0.449697 -0.479066 14.588566 12.253471 0.667005 0.686440 0.379532
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.274095 35.636116 10.579200 0.765434 7.800386 4.439757 2.659066 5.316311 0.036039 0.303351 0.176237
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.074947 10.321607 10.628567 10.876161 7.910255 8.786096 0.720852 2.683488 0.026746 0.026784 0.001303
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 23.426302 22.668059 14.026448 14.285446 7.763520 8.555178 6.129152 6.452752 0.024118 0.027123 0.001508
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.052582 10.283426 0.679966 10.983822 0.330618 8.797297 15.688762 3.338890 0.657786 0.037419 0.471528
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.060394 -0.535457 0.244138 -0.051602 0.772872 1.981348 1.427876 -0.480812 0.649901 0.667289 0.399514
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.962804 11.391880 4.505475 5.148013 7.632714 8.547309 2.250990 0.889939 0.035711 0.030962 0.002536
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.895057 0.785619 -1.482248 0.065540 3.884288 -0.894619 0.686078 -0.770132 0.597071 0.641836 0.400150
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.978922 -0.801220 -1.033760 -0.410030 -0.547265 -1.225523 0.096337 0.053754 0.594921 0.626211 0.405590
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.011413 11.712090 10.686689 11.486366 7.658298 8.653244 1.920669 5.338919 0.028056 0.032351 0.003146
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 1.484714 1.216015 0.076185 0.722704 -0.551545 -0.461087 -0.266559 0.439347 0.623383 0.654009 0.403996
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.227157 1.200219 2.873825 -1.161649 0.790358 0.722895 8.175846 4.567427 0.639876 0.675094 0.391517
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.277972 2.931170 -1.370937 6.471387 0.719878 1.110819 13.671122 23.938924 0.667440 0.653222 0.376031
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.798793 5.906858 0.490430 0.790692 2.389981 1.140545 0.093446 -0.374494 0.668201 0.683854 0.383823
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.801266 7.368536 0.716759 1.120071 0.825838 0.027815 0.101299 1.534647 0.674336 0.685789 0.381196
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.566988 0.165659 0.180574 0.676371 -0.356163 0.447343 2.073505 1.660331 0.674599 0.685805 0.379347
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.090814 -0.735520 -0.006275 1.095943 -0.111134 -0.448771 1.411826 -0.278616 0.671095 0.682979 0.379176
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 26.469920 6.080049 0.411597 1.653982 5.659491 1.045867 14.261890 0.246792 0.541563 0.679601 0.359856
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.171717 0.140065 0.235328 0.401033 2.010618 1.273641 2.002997 2.173702 0.668035 0.686304 0.392072
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 8.379619 9.906150 10.686081 11.101143 7.706077 8.594078 0.387697 1.025716 0.031258 0.028440 0.001517
131 N11 not_connected 100.00% 0.00% 22.01% 0.00% -0.706806 10.732416 0.093921 5.122429 -0.864423 7.958096 -1.246431 -0.023856 0.637401 0.267152 0.451849
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.714766 0.831983 -0.224800 -1.444779 0.379593 -0.683320 -0.710391 -0.369499 0.618930 0.630692 0.389034
133 N11 not_connected 100.00% 100.00% 0.00% 0.00% 10.528884 -0.456595 4.508964 -1.469381 7.763884 -0.578996 2.175482 -0.342350 0.053060 0.624852 0.480277
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.407031 -0.917451 -0.160084 -1.325420 3.309941 0.439001 26.395132 0.369497 0.602992 0.636584 0.424277
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 8.332832 1.734355 10.207076 2.808512 7.915701 16.186169 2.063241 0.914540 0.041389 0.613560 0.461658
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.140721 -0.612626 -0.137195 -1.436335 1.348890 -0.516043 1.920992 2.690633 0.611277 0.648315 0.410979
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.862505 -0.441504 1.506794 -0.932465 0.487039 -1.077546 -1.855029 0.318565 0.641248 0.652708 0.388228
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.512455 -0.563665 -0.836003 -0.336582 -0.528520 -0.166316 7.146416 5.106533 0.653917 0.680026 0.388659
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.984203 -0.411897 -0.488188 0.697458 1.139055 -0.493307 1.237747 -1.986367 0.659025 0.682404 0.383682
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.443380 10.290609 -0.949365 11.154373 1.347730 8.710592 28.728317 2.698307 0.663863 0.050829 0.537257
143 N14 digital_ok 100.00% 0.00% 100.00% 0.00% -0.838640 10.685922 0.780784 11.188821 1.066652 8.483787 1.150067 3.901110 0.666057 0.042728 0.557892
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.021753 0.123684 -1.086617 0.483279 -0.015471 -0.443031 -0.681629 -0.328695 0.674873 0.686642 0.379993
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.950567 1.680356 -0.957677 6.592736 0.008516 7.364022 -0.032703 1.936255 0.673154 0.631813 0.396279
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 10.280316 -0.932108 4.521932 0.074903 7.753062 -1.074995 0.254912 -1.434383 0.038451 0.675778 0.521316
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.304001 -1.293947 1.657516 2.418164 0.885755 -0.495728 -0.061208 -0.235500 0.656125 0.671142 0.384827
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.959549 -0.027416 -0.732149 -0.702827 1.138771 1.790661 -0.512478 -0.667353 0.663676 0.682360 0.396487
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.140549 -1.125963 -1.023339 -1.136922 -0.549584 0.524829 0.102485 0.083502 0.656930 0.676393 0.400712
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.376673 -0.754641 -1.299744 -1.163050 -0.944985 -0.421912 1.283025 2.498670 0.652214 0.669783 0.403035
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 23.137614 0.477613 -0.303360 0.372281 2.654755 -0.972317 5.072810 0.346272 0.492583 0.614009 0.360421
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 8.797548 -0.802647 10.303127 -1.185423 7.913346 0.033171 0.932933 1.237234 0.037283 0.637129 0.477916
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 5.158781 10.090509 9.541306 10.895797 5.710102 8.801188 1.073276 2.980914 0.367505 0.040923 0.279697
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.377098 -0.156134 0.022582 0.672610 0.055236 0.465560 0.001810 0.042017 0.622311 0.648056 0.407469
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.465422 -0.357087 -0.444749 -0.651506 1.993152 1.681546 8.197610 19.817672 0.637656 0.663201 0.409844
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.141042 26.478816 -1.517684 -0.586089 -0.747029 2.041068 -0.191986 2.382056 0.613641 0.502612 0.352832
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.834395 -0.961918 -0.147446 -0.914392 -0.476324 1.606021 1.081379 0.853984 0.648103 0.670451 0.393563
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.708772 25.710074 0.018015 -0.512168 -0.036383 1.129294 -0.374020 3.036398 0.653684 0.547239 0.344138
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.085227 -0.852806 -0.464634 -1.020292 1.413964 0.484065 7.822955 0.112815 0.667291 0.684618 0.385170
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.163528 0.994395 -0.101575 0.478126 -0.140624 0.782543 -0.069709 2.123992 0.670369 0.683423 0.388698
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.613672 0.394851 1.713447 -0.239881 8.156229 2.077326 1.420909 2.284507 0.661295 0.684855 0.385303
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 25.967778 0.028244 2.839966 0.635431 3.864816 0.115403 1.559594 2.252417 0.508651 0.680388 0.378531
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.127559 0.912275 0.641127 2.372206 0.126423 6.945156 7.419767 5.872508 0.664538 0.671594 0.385755
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.271985 -0.784678 -1.519668 0.175048 1.643943 0.069707 0.502840 5.796625 0.670610 0.681748 0.390931
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.774059 -0.937246 0.132540 -0.431143 1.519528 0.374278 0.164708 1.145566 0.660978 0.677973 0.397351
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.142697 -0.790641 -0.922084 -1.344958 1.770657 0.184698 -0.344415 -1.042553 0.656144 0.678436 0.397646
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 9.830151 -0.412715 10.816298 -0.914857 7.635355 0.537571 1.325513 3.606236 0.040278 0.673601 0.527739
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.397812 2.006496 -1.391009 0.345678 -1.231063 1.422657 -0.565519 1.097941 0.609643 0.592610 0.377944
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 11.150528 11.013074 4.281705 4.806682 7.978685 8.838154 4.070177 9.466363 0.041019 0.047151 0.005136
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.061039 -0.708035 -0.249264 -1.057522 0.273087 21.066920 -0.322520 8.146484 0.631147 0.655960 0.404498
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.263952 10.896191 -0.122877 11.285292 1.270787 8.620074 27.565549 3.332976 0.646167 0.055677 0.538327
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.580741 0.040394 0.369314 0.511068 0.193668 0.372192 -0.200373 7.094876 0.654386 0.670256 0.396523
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.372799 10.071647 -1.453217 10.868587 0.067096 8.806999 17.796660 3.359972 0.663493 0.051183 0.512245
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.356027 1.083418 -0.345650 0.914305 1.096627 -0.027367 0.467287 0.429062 0.654096 0.669504 0.377112
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.040995 -0.553459 -0.664067 -0.261902 0.434983 -0.001947 1.057503 1.525208 0.665779 0.682629 0.378093
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 29.113019 -0.175904 4.317769 0.105122 11.759933 0.293871 9.079372 0.163471 0.495841 0.676304 0.391328
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.624308 -1.165185 -1.370851 -0.355925 0.253614 -1.058589 -0.616898 -0.113214 0.672834 0.689208 0.395032
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.298248 -0.194587 -1.167662 -1.248873 0.244447 0.220596 2.619079 31.753353 0.668506 0.684457 0.388135
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 8.244673 9.890493 10.120313 10.929530 8.146546 8.816214 11.174808 1.790189 0.028230 0.031651 0.001590
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.927886 -1.302416 -0.568720 0.265351 -0.199258 -0.406435 0.126375 -1.630552 0.654507 0.677694 0.405404
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.105019 0.372173 1.434958 -0.488796 0.851307 0.507653 21.197377 2.959395 0.641686 0.665539 0.405976
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.523363 6.313249 4.828584 4.839339 6.008102 6.920686 -5.319265 -5.295750 0.599276 0.618269 0.396114
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.031680 0.122055 4.917246 1.125962 6.153898 1.101030 -5.360827 -0.912536 0.584091 0.632777 0.425717
200 N18 RF_maintenance 100.00% 100.00% 45.86% 0.00% 10.729054 30.634064 4.705056 0.793880 7.929859 6.187045 2.437722 -0.488417 0.041421 0.220983 0.150153
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.396309 4.808293 3.045240 4.250902 3.528439 5.850239 -1.464525 -4.453640 0.637715 0.639073 0.392316
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.266711 0.856154 1.625675 -1.468200 1.054813 0.792195 -2.108811 48.485638 0.647548 0.644023 0.387282
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.899020 2.417949 0.100858 -0.413290 -0.821153 -0.423830 -0.053404 10.350592 0.641893 0.638374 0.377990
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.984836 1.299746 0.831158 -0.869545 3.823010 -0.703041 2.232649 3.819266 0.643150 0.644529 0.378796
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.458728 2.660090 1.425305 0.153927 0.699072 2.040082 -1.016304 -1.220318 0.630003 0.636690 0.360148
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.543267 12.460450 9.883795 11.337550 7.487627 7.967316 25.113823 105.360298 0.034560 0.037451 0.001339
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.718377 6.841338 9.640783 9.830670 7.439863 8.577529 21.287887 18.849469 0.043980 0.043675 0.001235
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 11.369519 10.604573 -0.682576 -0.897476 -0.485435 -0.533943 0.404266 -0.267446 0.644510 0.659702 0.395779
211 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 0.430542 -0.478358 -1.016179 0.144096 -0.638134 -0.641791 10.999303 -0.559873 0.604235 0.635671 0.398622
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.180823 -0.925264 0.485538 -0.537322 -0.657711 0.800809 3.469143 -1.475760 0.632133 0.642869 0.394729
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.245440 -0.365892 -0.687324 -0.746785 3.497505 -0.844254 4.430986 -0.904873 0.625067 0.647618 0.398537
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.150830 -0.200399 0.038402 0.220874 -0.110078 -0.458382 6.554434 -1.224972 0.632113 0.657534 0.401418
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.691267 1.509918 -1.505403 0.014677 -0.501740 5.122532 0.145197 5.162431 0.620893 0.656491 0.396251
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.287526 6.102652 5.168279 4.899155 6.015337 7.009394 -5.407781 -5.313833 0.611425 0.634742 0.386650
225 N19 RF_ok 100.00% 0.00% 89.45% 0.00% 1.274366 10.697313 1.092444 4.949131 -0.806341 8.598283 -1.909600 1.193010 0.644685 0.124020 0.536404
226 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.081295 0.913187 0.182180 1.276679 -0.900675 2.186703 -1.254097 -1.783533 0.639329 0.658569 0.397303
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.418151 0.529065 -1.247232 0.118404 0.370741 -0.684012 22.647178 0.453687 0.612681 0.646476 0.386936
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 21.285553 20.069751 -0.204110 -0.345374 1.934160 2.730276 44.692171 39.597252 0.484596 0.508294 0.222716
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.875530 0.210934 1.642526 1.409252 -0.174124 0.753023 -0.427183 -2.738392 0.622183 0.643563 0.403783
237 N18 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.064544 0.100390 -0.026508
238 N18 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.094337 0.113422 0.084345
239 N18 RF_ok 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.420192 0.506622 0.429445
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 26.387444 26.222398 0.269779 2.028758 4.045799 6.549179 115.177833 78.105379 0.483232 0.449495 0.245938
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.587312 2.752589 -0.676890 0.690436 -1.011215 0.044062 5.353723 26.244543 0.624713 0.606395 0.393870
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 43.491058 1.930899 0.743498 1.676631 4.519182 1.959867 21.366205 -1.632837 0.369404 0.649142 0.455150
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 49.282867 1.919436 1.006736 -1.284258 8.025914 -0.562098 -1.123381 -0.602261 0.324383 0.633707 0.464067
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.014292 1.558317 1.621924 -0.523257 2.428076 1.022391 4.467847 11.767350 0.520141 0.606068 0.390726
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.223396 2.040814 -0.305101 -1.438177 -0.787392 -0.680926 -0.590533 2.766807 0.616181 0.623590 0.393911
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.660498 6.994664 -1.141247 -0.457198 3.994968 4.787509 3.367754 -0.361408 0.329509 0.338942 0.164550
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.417898 1.259108 0.891271 -0.289692 -0.494374 -0.889946 -1.250532 1.296938 0.615078 0.625214 0.396838
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.381474 6.908396 9.715665 10.146123 7.268711 8.216824 18.640088 25.854834 0.033891 0.028547 0.004821
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 9.322063 11.253719 5.645838 7.391127 2.858356 8.771445 30.087914 3.970068 0.367181 0.047429 0.282432
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.227342 2.439843 1.203496 1.635965 0.256630 1.113635 0.574669 -1.729764 0.519765 0.541846 0.392274
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.637499 -0.667504 1.291652 -1.300553 0.778357 -0.750216 -2.059424 -0.001810 0.544174 0.554300 0.398620
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.558456 -0.895553 0.644466 -0.233545 0.299309 -0.938958 3.746640 -0.269684 0.453308 0.551583 0.402163
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.365258 2.013960 -0.640122 -1.380086 -0.694478 -0.743887 1.271285 1.307752 0.488153 0.529019 0.387734
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, 8, 9, 10, 15, 16, 18, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 40, 42, 43, 45, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 67, 68, 70, 71, 72, 73, 77, 78, 80, 81, 84, 86, 87, 88, 90, 92, 93, 94, 95, 96, 97, 101, 102, 103, 104, 106, 107, 108, 109, 110, 111, 113, 114, 117, 120, 121, 122, 123, 126, 128, 131, 133, 135, 136, 140, 142, 143, 145, 146, 151, 155, 156, 158, 159, 161, 162, 164, 165, 166, 167, 170, 173, 179, 180, 181, 182, 185, 187, 189, 191, 192, 193, 200, 201, 202, 205, 206, 208, 209, 210, 211, 221, 222, 223, 224, 225, 227, 228, 237, 238, 239, 240, 241, 242, 243, 244, 246, 262, 320]

unflagged_ants: [5, 17, 19, 20, 21, 22, 35, 41, 44, 46, 48, 49, 61, 62, 64, 65, 66, 69, 74, 79, 82, 83, 85, 89, 91, 105, 112, 115, 118, 124, 125, 127, 132, 137, 139, 141, 144, 147, 148, 149, 150, 157, 160, 163, 168, 169, 171, 183, 184, 186, 190, 207, 220, 226, 229, 245, 261, 324, 325, 329, 333]

golden_ants: [5, 17, 19, 20, 21, 41, 44, 65, 66, 69, 83, 85, 91, 105, 112, 118, 124, 127, 141, 144, 147, 148, 149, 150, 157, 160, 163, 168, 169, 171, 183, 184, 186, 190]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459951.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.1.5.dev215+gd2b157e
In [ ]: