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 = "2459996"
data_path = "/mnt/sn1/2459996"
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-20-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/2459996/zen.2459996.21305.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1850 ant_metrics files matching glob /mnt/sn1/2459996/zen.2459996.?????.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/2459996/zen.2459996.?????.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 2459996
Date 2-20-2023
LST Range 4.565 -- 14.522 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 75 / 198 (37.9%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 135 / 198 (68.2%)
Redcal Done? ❌
Never Flagged Antennas 63 / 198 (31.8%)
A Priori Good Antennas Flagged 61 / 93 total a priori good antennas:
3, 7, 9, 15, 16, 17, 19, 20, 29, 30, 37, 38,
40, 41, 42, 45, 53, 54, 55, 56, 65, 71, 72,
81, 83, 86, 91, 93, 94, 101, 105, 106, 107,
109, 111, 112, 121, 122, 123, 124, 127, 136,
144, 145, 151, 158, 161, 165, 168, 169, 170,
173, 182, 184, 186, 187, 189, 191, 192, 193,
202
A Priori Bad Antennas Not Flagged 31 / 105 total a priori bad antennas:
22, 35, 43, 46, 48, 49, 50, 62, 64, 73, 74,
89, 115, 132, 133, 137, 139, 179, 220, 221,
222, 228, 229, 237, 238, 239, 240, 241, 245,
261, 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_2459996.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% 10.867127 14.402133 12.701402 13.387460 7.204115 9.215343 0.401677 1.028140 0.029501 0.031100 0.002442
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.736198 -0.238289 3.300752 -1.154984 2.208593 2.598610 6.330372 9.204934 0.590359 0.616123 0.416498
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.089229 -0.639424 0.840712 0.365466 0.622341 1.191009 0.504564 0.360945 0.609132 0.614903 0.401880
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.084859 0.230279 -0.927503 0.234074 0.133720 0.759392 12.092893 10.190438 0.617928 0.631226 0.397090
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.491839 4.326801 3.529185 3.534911 3.655646 5.025273 -1.823438 -1.171753 0.601852 0.613101 0.384626
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.537785 -0.227383 4.477688 -0.698110 -0.451732 -0.008677 2.622076 -0.193927 0.594278 0.630517 0.401902
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.801882 -0.367679 -0.097343 -1.145643 0.940967 0.458615 3.290128 -0.316976 0.604693 0.628807 0.396828
15 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 11.135793 14.104904 12.039992 12.701208 7.224542 9.249155 0.191354 0.566020 0.027646 0.026516 0.001605
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 11.174616 -0.223251 12.665316 0.993484 7.219150 2.156950 0.462620 0.361633 0.031837 0.630606 0.505013
17 N01 digital_ok 100.00% 0.00% 69.08% 0.00% 1.265703 3.871250 1.064694 6.416981 1.561947 86.251027 3.110893 6.912896 0.617454 0.233366 0.500763
18 N01 RF_maintenance 100.00% 100.00% 50.76% 0.00% 11.861972 19.312593 12.671403 0.385120 7.323177 4.205414 0.380722 14.181728 0.029076 0.214897 0.162845
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.593680 0.363637 -0.538548 0.712104 -0.155759 4.773429 -0.439605 0.407424 0.627271 0.645339 0.394088
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.546354 -1.416494 1.083285 -0.576603 6.168828 -0.644037 0.808651 -0.330056 0.623544 0.639190 0.391296
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.510417 0.597885 -0.232437 0.319294 0.251910 1.242458 0.246214 0.855508 0.610834 0.620285 0.383231
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.575529 -0.276205 -0.016333 -0.572053 -0.263426 1.342623 -0.455168 -0.258556 0.588993 0.603135 0.389841
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.498260 13.439099 12.730858 13.171506 7.319440 9.296498 1.669203 1.326949 0.033075 0.037091 0.004778
28 N01 RF_maintenance 100.00% 0.00% 86.22% 0.00% 9.909585 25.939192 1.668397 4.299828 6.271291 5.246005 2.965014 15.467416 0.354704 0.155373 0.260816
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 11.175181 13.887099 12.278213 12.723323 7.299406 9.289128 0.355362 0.208221 0.029270 0.036395 0.007220
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 1.021874 0.305520 0.976816 -1.209775 6.368035 -0.105359 0.906209 -0.285080 0.624792 0.650121 0.398136
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.831225 -0.692274 1.625009 1.362353 1.524369 0.548666 0.745229 1.589843 0.638499 0.645441 0.388558
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 24.211414 23.654336 2.036286 4.420498 1.087093 7.141768 6.088913 28.827656 0.511086 0.534540 0.243137
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 12.765985 15.057330 6.509686 6.823987 7.256666 9.231118 0.568911 0.464860 0.033625 0.046680 0.008662
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.191450 -0.923458 1.330918 -1.161288 0.325737 -1.241754 -1.214759 0.047600 0.598666 0.601008 0.389683
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.109396 9.104376 1.594950 1.166811 1.058356 1.746824 0.223589 0.547498 0.600025 0.612974 0.414789
37 N03 digital_ok 100.00% 0.00% 92.70% 0.00% 0.710821 22.084636 -0.121245 15.425311 -0.840953 8.534221 -0.176385 2.350294 0.615447 0.130955 0.521117
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.451055 0.306416 -1.207422 3.529648 -0.097549 0.145470 5.082399 8.615295 0.622438 0.613918 0.406643
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 10.449631 1.485743 12.312785 1.138282 7.297242 0.469523 0.403830 4.933371 0.037081 0.620375 0.467186
41 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.572694 0.406681 0.100300 0.553196 1.186824 0.949833 1.016714 4.932760 0.620537 0.641858 0.387858
42 N04 digital_ok 100.00% 99.41% 99.57% 0.00% 192.201782 193.481888 inf inf 3250.071066 3219.891047 5246.879288 5233.037828 0.567798 0.439477 0.443936
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.055578 0.270031 -0.252445 1.100521 -0.884481 0.941359 -0.365463 1.110227 0.638229 0.649789 0.388532
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.910287 0.730377 -1.291029 0.662317 -0.407125 0.974993 -0.689236 -0.288722 0.642407 0.656952 0.390680
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.564583 2.664682 1.121918 0.985755 -0.084537 1.910723 0.193607 4.086138 0.630741 0.641228 0.385543
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.698157 0.003281 -0.042782 -1.071829 -0.159468 -0.557608 -0.039444 -0.573267 0.632183 0.652625 0.403172
47 N06 not_connected 100.00% 99.24% 99.30% 0.00% 186.449213 187.443624 inf inf 3263.015200 3249.092319 5532.496020 5457.483722 0.438734 0.369952 0.330988
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.073028 1.118047 -0.337671 1.644562 -1.178603 1.945032 -0.750841 -1.447168 0.598038 0.619169 0.397787
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.460398 -0.350218 0.544301 -0.321857 -0.619483 -0.685183 0.007637 0.798637 0.560325 0.599775 0.394987
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.988060 1.509169 0.578020 2.316171 -0.086572 1.717244 -0.095405 0.123979 0.600658 0.611636 0.411001
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 7.047061 2.092761 0.214648 0.139180 3.354883 1.035974 26.671990 2.095241 0.608972 0.626871 0.405449
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.756525 6.795090 1.228781 1.264871 1.417341 1.800716 0.889335 0.401035 0.621898 0.636409 0.404038
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.615592 2.579076 -1.107366 -1.005297 0.313213 4.171501 2.215976 8.049147 0.635712 0.650135 0.407598
54 N04 digital_ok 100.00% 99.57% 99.73% 0.00% 226.630674 227.098978 inf inf 3123.044619 3146.634305 4551.567046 4605.007787 0.452409 0.344987 0.362994
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.509942 14.818780 12.763800 13.317504 7.298073 9.265633 0.791391 2.307654 0.027930 0.030755 0.002733
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.542382 0.910356 0.016585 2.417113 -0.183879 4.064709 -0.319763 4.482077 0.631681 0.656192 0.388013
57 N04 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.445548 0.064834 12.439832 -1.352550 7.133433 -0.053126 1.144500 1.147852 0.046232 0.659343 0.507272
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.393052 13.761122 12.594065 13.287871 7.237164 9.226071 1.474256 1.353501 0.036476 0.036209 0.001836
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.623039 0.920267 12.644704 1.421078 7.122241 2.862096 0.289868 1.756893 0.047600 0.646242 0.492728
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.586292 13.701306 0.067738 13.329098 0.471000 9.207881 4.682389 1.908670 0.633288 0.073788 0.507573
61 N06 not_connected 100.00% 99.46% 99.57% 0.00% nan nan inf inf nan nan nan nan 0.509222 0.408881 0.406201
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.210264 1.585231 0.071931 1.283612 1.663444 0.568137 1.072235 -1.129084 0.571495 0.614793 0.396210
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 1.348650 14.146432 -0.715343 6.867181 -0.357701 9.306919 -0.304594 1.876263 0.587455 0.044664 0.467549
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.193914 -0.077187 -0.935485 -0.395015 -0.734612 -1.220619 0.716497 0.729338 0.584233 0.582448 0.383078
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 25.573229 23.819132 16.151280 16.153198 7.408880 9.306543 3.396996 4.547491 0.044247 0.027004 0.010137
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.060278 1.918696 -1.326561 -0.366779 0.672145 0.008351 -0.532777 1.307832 0.615573 0.631542 0.410893
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.479416 -0.116240 -1.238737 0.454550 1.664528 0.447128 0.104745 1.179580 0.624656 0.634925 0.395768
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 27.467786 0.104745 16.274819 0.083525 7.233146 -0.444714 3.894323 -0.064034 0.036182 0.651442 0.524534
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.810295 -0.140373 1.366723 1.250067 0.291600 1.786653 -0.032267 0.337791 0.636776 0.655180 0.392603
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.990896 0.038496 0.220793 0.317666 0.891749 1.097191 0.040666 -0.179264 0.638585 0.657945 0.383310
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.518628 0.124749 1.294552 1.921134 0.711905 0.798711 2.354969 0.775957 0.632938 0.660367 0.382802
72 N04 digital_ok 100.00% 99.51% 99.62% 0.00% 195.169802 195.121731 inf inf 3207.357339 3181.763796 5180.156568 4977.466906 0.554428 0.370817 0.493792
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.514441 1.209564 -1.069912 0.188983 0.898140 -0.138230 -0.342731 -0.054967 0.647967 0.659908 0.389016
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.083364 0.285327 -0.123543 -0.335109 -0.537313 1.636108 -1.065580 0.611337 0.646583 0.655525 0.391697
77 N06 not_connected 100.00% 99.57% 99.62% 0.00% nan nan inf inf nan nan nan nan 0.371739 0.325867 0.325147
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 28.955570 1.277913 -0.309347 1.485922 2.106773 1.306237 5.620044 0.342679 0.434002 0.621538 0.381830
79 N11 not_connected 100.00% 98.86% 98.92% 0.00% 246.486238 246.684330 inf inf 3071.133829 3126.405062 4157.081471 4426.729752 0.481387 0.468144 0.457847
80 N11 not_connected 100.00% 99.19% 99.30% 0.00% nan nan inf inf nan nan nan nan 0.495933 0.476937 0.420175
81 N07 digital_ok 100.00% 98.70% 99.03% 0.00% 218.303917 218.715884 inf inf 3025.619523 3095.403550 4669.576645 4806.633660 0.481120 0.342410 0.333598
82 N07 RF_maintenance 100.00% 99.08% 99.19% 0.00% 154.481296 156.607375 inf inf 2636.272249 2624.329600 4901.496759 4789.126195 0.456901 0.369089 0.348112
83 N07 digital_ok 100.00% 99.35% 99.51% 0.00% 245.277144 245.417851 inf inf 3261.501748 3332.069689 5002.955920 5189.898200 0.474969 0.374229 0.390069
84 N08 RF_maintenance 100.00% 56.76% 100.00% 0.00% 20.108250 26.238893 15.772642 16.543339 5.545584 9.100726 3.178874 3.907092 0.213337 0.036306 0.143863
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.031451 0.539471 -0.281549 -0.529270 -0.793606 0.263746 -1.216144 -0.421644 0.642985 0.656889 0.386446
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.884004 1.388001 0.968565 0.258418 0.183229 0.741989 0.599199 13.926068 0.628390 0.654044 0.370511
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 26.310760 6.670014 1.830822 0.336838 7.887792 1.036728 39.125500 7.793856 0.521909 0.662927 0.356558
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.418641 1.405463 1.050635 1.874652 -0.159973 -0.614029 1.123712 0.510558 0.637990 0.654021 0.376892
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.788443 0.802245 1.075238 1.617129 -0.334670 0.625616 -0.424662 -0.262386 0.635508 0.653540 0.381404
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.247478 -0.202466 0.147456 -1.221558 2.876494 15.390265 0.429437 4.987320 0.636797 0.656013 0.387852
91 N09 digital_ok 100.00% 99.35% 99.46% 0.00% 228.287030 228.329143 inf inf 3522.125287 3513.083088 5830.835121 5830.236858 0.468812 0.279867 0.396651
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.950466 0.392796 12.614316 0.607180 7.329208 1.145085 0.029985 1.446945 0.035281 0.649295 0.445975
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.334133 13.997242 12.733976 13.399696 7.199415 9.180272 1.784458 1.552713 0.029992 0.024994 0.002268
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.988259 14.238880 12.887994 13.179521 7.245396 9.215550 0.509562 0.481274 0.025289 0.025244 0.001067
95 N11 not_connected 100.00% 98.81% 99.08% 0.00% 249.001359 248.634776 inf inf 3019.118585 2989.809871 4405.259807 4225.580217 0.580259 0.440622 0.451899
96 N11 not_connected 100.00% 99.14% 99.08% 0.00% 251.955874 251.627298 inf inf 4186.439901 4185.959227 7066.612692 7101.893707 0.520452 0.520874 0.448773
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.218995 4.861102 -0.802782 2.105509 -1.280344 1.200955 -0.729522 5.684677 0.583390 0.541483 0.389885
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.647686 7.732572 0.402760 1.673182 0.599577 1.497984 0.324488 1.758732 0.631300 0.641911 0.384795
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.609261 1.244971 -1.376311 -0.460281 0.385138 0.897315 -0.362583 7.245024 0.637708 0.656392 0.381889
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.551360 3.976645 1.752388 -1.226798 1.959192 1.830691 -1.107362 2.463103 0.642845 0.655413 0.371916
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.402868 60.077864 0.894917 9.065462 2.458458 0.047686 1.372575 1.183063 0.644535 0.634985 0.376524
105 N09 digital_ok 100.00% 99.19% 99.19% 0.00% 240.735997 239.806933 inf inf 4172.937494 4171.678234 7476.522968 7470.267339 0.469273 0.507864 0.356741
106 N09 digital_ok 100.00% 99.19% 99.35% 0.00% 213.631928 214.003726 inf inf 3301.390585 3273.349303 5251.460507 5121.988186 0.554344 0.380591 0.422234
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 5.321694 2.681989 0.355985 -0.051809 0.442953 -0.057400 13.366704 8.599086 0.630456 0.655314 0.382106
108 N09 RF_maintenance 100.00% 99.30% 99.30% 0.00% nan nan inf inf nan nan nan nan 0.465841 0.369288 0.226628
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.829615 13.776997 12.716345 13.041087 7.329061 9.303214 0.165906 1.242185 0.045823 0.032953 0.007553
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 26.856834 13.874953 8.919403 0.236293 1.758064 -0.107350 1.059401 0.228184 0.472138 0.601454 0.342836
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 32.269730 13.710123 1.959634 13.146863 1.102406 9.281582 3.316202 1.700617 0.488605 0.062686 0.331838
112 N10 digital_ok 100.00% 61.62% 95.68% 4.32% 2.841113 13.452800 9.144266 13.241538 0.504648 9.073522 -0.046952 0.515831 0.189523 0.068227 -0.117001
113 N11 not_connected 100.00% 98.92% 98.97% 0.00% nan nan inf inf nan nan nan nan 0.574662 0.554243 0.478692
114 N11 not_connected 100.00% 99.08% 99.03% 0.00% 248.678040 247.863898 inf inf 3131.071314 3012.848296 4856.700174 4321.553993 0.524985 0.538288 0.479062
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.266542 -0.564593 -1.402808 0.193847 -0.927642 -0.631031 0.059612 -0.464520 0.570127 0.596574 0.398574
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.898951 15.366967 12.770016 13.692653 7.171720 9.200010 0.747919 2.635189 0.027959 0.031445 0.002701
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.970271 1.677212 0.785521 1.123962 0.052088 1.003627 2.316019 1.731227 0.608597 0.629918 0.399675
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.634844 1.791451 3.769642 -0.841932 0.672490 0.712373 1.001121 -0.383277 0.626789 0.656803 0.385603
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.016954 3.615182 -1.260342 7.582553 -0.515269 -0.199098 4.205991 13.408322 0.647866 0.636630 0.373287
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.327466 6.861755 -0.473551 -1.064064 1.165635 0.149559 -0.279987 -0.729972 0.649643 0.668424 0.380905
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.128486 8.990024 1.461095 1.779918 1.059084 0.951922 -0.194830 0.582784 0.653788 0.663625 0.383759
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 11.136365 0.460256 12.935840 1.250021 7.156589 1.036588 0.308290 1.003557 0.041260 0.662823 0.462288
125 N09 RF_maintenance 100.00% 99.08% 99.03% 0.00% nan nan inf inf nan nan nan nan 0.531938 0.513402 0.340781
126 N09 RF_maintenance 100.00% 99.30% 99.51% 0.00% nan nan inf inf nan nan nan nan 0.436693 0.381553 0.345390
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 10.760119 0.682855 12.598866 0.868091 7.344407 1.649631 0.168045 1.028283 0.033312 0.656509 0.448338
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.205746 -0.640656 -0.924318 -0.022553 -0.209779 -1.084554 1.126127 1.927638 0.644921 0.653279 0.399245
131 N11 not_connected 100.00% 0.00% 19.14% 0.00% -0.755573 13.664640 -0.067393 6.756148 -0.501678 8.048474 -0.714870 0.203539 0.603877 0.251248 0.441475
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.048155 -0.046172 -0.491167 -1.173534 -0.351141 -0.676836 -0.293716 -0.355275 0.589727 0.599463 0.387308
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.050435 -1.383009 -1.279098 -0.585145 -1.070386 -0.917162 -0.580870 0.256137 0.575662 0.601403 0.401777
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.558033 15.628786 6.238589 6.821141 7.189493 9.209901 0.099895 0.516684 0.040298 0.034157 0.003228
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.480914 -1.064096 -0.781803 -1.333037 1.583193 0.148944 11.821925 0.476544 0.584004 0.613554 0.415340
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 10.030860 7.940554 12.254443 -0.146664 7.326006 -0.082860 0.971075 0.967069 0.040046 0.599854 0.434201
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.007021 -0.212722 0.397830 -1.272194 0.881298 -0.785731 0.249223 0.807597 0.598342 0.628012 0.400727
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.895669 1.461300 1.385825 -1.143269 0.669931 -0.757478 -1.227795 0.227342 0.624524 0.626570 0.376705
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.298984 -0.969022 -0.067932 -0.489057 -0.669865 -1.011797 3.777175 2.762924 0.641565 0.657210 0.379399
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.603430 -0.228235 0.090089 0.552246 0.497024 -0.379628 0.268228 -1.005966 0.643218 0.662379 0.380194
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.156022 13.765669 -0.535953 13.341237 1.119737 9.227276 15.480873 1.555955 0.647417 0.048063 0.527209
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.917890 13.735999 12.496926 13.312289 6.749671 9.215735 0.193702 1.251763 0.097846 0.029750 0.051355
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.154683 0.617770 -0.692665 7.285779 0.089299 8.885156 -0.263715 0.676623 0.647985 0.615767 0.396480
145 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.006226 -0.456137 3.035977 -0.459582 0.440173 5.313930 0.004855 -0.528351 0.634779 0.659112 0.395338
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.202662 0.581714 -1.212320 0.257087 -1.041909 -0.165541 -0.126361 -0.875976 0.621841 0.642149 0.387488
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.021958 -1.066101 2.746142 3.188704 0.025941 0.847159 -0.009834 -0.140515 0.631638 0.639918 0.388870
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.682610 0.306374 -0.148349 -0.329662 0.737129 1.532393 -0.651417 -0.481832 0.639147 0.652097 0.405203
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.802282 -1.044663 0.512172 -1.174023 2.568009 0.070152 0.233921 -0.513203 0.632570 0.644805 0.409743
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.185280 2.661901 -1.324686 -1.248953 -0.575278 -0.787621 2.553706 1.081722 0.631620 0.623704 0.399197
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 23.159089 0.997857 -0.449056 1.012436 2.380872 -0.653646 4.707920 0.359367 0.473861 0.582720 0.356112
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.777215 -0.814439 12.440497 -0.724952 7.370893 -0.064093 1.431287 0.443821 0.041822 0.615607 0.464170
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.444373 13.590786 10.324272 13.097914 2.755354 9.316828 1.632829 1.534751 0.440386 0.039265 0.342744
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.810294 -0.003281 0.686665 1.192148 0.366192 1.037392 0.163444 -0.142797 0.603781 0.628910 0.399967
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.858675 -0.207435 0.069057 0.051847 1.227788 1.618141 4.641976 14.199375 0.620192 0.643246 0.398013
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.569638 27.208682 -0.856980 -0.398776 -0.929894 2.187918 0.028276 1.847463 0.596082 0.484920 0.351880
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.392969 -1.042782 0.141136 -0.563209 0.104471 1.010001 -0.364209 -0.007275 0.633930 0.651730 0.386616
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.285990 31.015432 0.641828 0.110154 0.476167 0.972446 -0.200247 0.126885 0.639125 0.526149 0.354093
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.479084 -1.111535 0.217394 -1.016176 -0.669125 0.090637 1.221308 -0.335904 0.649203 0.663007 0.388459
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.518212 1.746419 0.522292 0.982999 0.423599 1.687179 -0.104174 0.525237 0.648200 0.660948 0.390915
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.258567 0.365566 1.339724 1.855180 2.734112 1.939879 -0.195969 1.672248 0.641621 0.649842 0.381660
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 27.550027 0.544015 0.510740 -0.431279 1.886681 0.189886 0.301862 -0.361664 0.500824 0.658683 0.373388
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.658913 0.421979 1.427726 0.747082 0.703715 -0.466129 0.007275 -1.031740 0.639507 0.653577 0.381954
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.339470 -0.666372 -1.162779 -0.422917 0.939989 0.098162 -0.850107 3.289527 0.644804 0.656239 0.398048
168 N15 digital_ok 100.00% 99.08% 99.24% 0.00% nan nan inf inf nan nan nan nan 0.519415 0.484058 0.479833
169 N15 digital_ok 100.00% 98.76% 98.81% 0.00% nan nan inf inf nan nan nan nan 0.533147 0.524307 0.456572
170 N15 digital_ok 100.00% 99.08% 99.08% 0.00% nan nan inf inf nan nan nan nan 0.418964 0.386198 0.381441
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.968106 1.573623 -1.217703 0.249951 -1.185426 -0.288659 -0.227793 1.089751 0.586351 0.576340 0.374320
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 13.258529 14.769406 5.816594 6.447266 7.371720 9.356253 2.380686 5.012671 0.035277 0.040583 0.003644
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.858515 -0.726591 -0.053111 -0.948598 -0.008351 -0.171315 -0.406522 -0.401869 0.615223 0.639793 0.398201
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.178284 14.510408 -1.184486 13.482025 0.084377 9.167174 15.826168 1.634341 0.634776 0.054342 0.526494
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.211866 0.392513 1.918470 1.382856 0.208618 0.065203 -0.231896 2.976971 0.637431 0.651170 0.393589
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.191453 13.534459 0.473986 13.031173 5.912832 9.308372 0.655310 1.447257 0.647136 0.050608 0.492945
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.628604 1.581816 -0.214518 0.802306 0.620508 0.554181 0.027392 0.362854 0.634827 0.649935 0.375423
184 N14 digital_ok 100.00% 99.41% 99.24% 0.00% nan nan inf inf nan nan nan nan 0.498909 0.604614 0.532055
185 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.131715 0.254340 3.821906 0.883021 4.249512 0.355758 -2.339906 -0.865468 0.614155 0.656467 0.393950
186 N14 digital_ok 100.00% 99.14% 99.08% 0.00% nan nan inf inf nan nan nan nan 0.613739 0.621761 0.587594
187 N14 digital_ok 100.00% 99.14% 99.19% 0.00% 226.200109 226.266898 inf inf 2746.209978 2724.485651 5249.047966 5293.911460 0.495708 0.371315 0.486876
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 9.942089 13.435312 12.244858 13.181912 7.354749 9.345053 2.361846 1.943715 0.028476 0.031309 0.001095
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.399117 -1.292630 -0.017157 0.144993 0.211484 -0.854808 -0.191510 -1.119607 0.628177 0.642766 0.406433
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 0.587329 0.012955 2.185598 -0.064088 0.092431 1.006919 7.221419 0.014578 0.610120 0.629491 0.404319
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.245547 6.851769 2.940151 4.783480 5.016647 7.777561 1.126161 -2.702181 0.588390 0.568815 0.393138
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 7.373918 1.169425 4.918604 1.446269 5.846074 1.830329 -2.937247 -0.866746 0.555350 0.592325 0.414029
200 N18 RF_maintenance 100.00% 100.00% 50.22% 0.00% 12.762284 39.350012 6.280765 0.139798 7.340323 5.146055 1.332017 6.510855 0.040660 0.217657 0.140599
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.287877 5.135849 3.067233 4.120904 3.110074 6.420312 -1.353022 -2.489843 0.616185 0.615938 0.386373
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.893802 2.415787 1.457181 -1.112706 1.089801 -0.815684 -0.932053 22.876606 0.628220 0.623373 0.380629
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.488666 15.662447 2.318113 -0.842786 0.184163 0.068674 15.903692 1.706884 0.629224 0.656557 0.395500
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.956372 0.823132 4.501225 -0.599584 4.558300 -1.076451 23.776744 3.078405 0.396166 0.630824 0.451274
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.344846 5.816574 0.316437 3.533676 0.385799 2.236927 1.047076 1.329350 0.584055 0.523564 0.376381
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.665695 -0.467995 -0.847772 -1.032009 -0.987345 9.129474 5.545959 -0.254259 0.613889 0.621823 0.384091
208 N20 dish_maintenance 100.00% 98.92% 98.97% 0.00% 187.205703 186.749532 inf inf 4089.422548 4085.733474 6082.331603 5932.034804 0.453834 0.471848 0.427323
209 N20 dish_maintenance 100.00% 99.14% 99.08% 0.00% 239.298027 239.258323 inf inf 3162.825640 3215.625753 4810.449242 4924.612653 0.426515 0.395498 0.340653
210 N20 dish_maintenance 100.00% 98.86% 99.08% 0.00% 264.544124 264.542408 inf inf 4162.325348 4162.464922 7415.077982 7419.414074 0.482302 0.397652 0.434852
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.052731 14.214762 -1.320435 6.875940 -1.226222 9.166612 0.106931 0.843843 0.582086 0.039401 0.490921
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.959736 -0.878356 0.368063 -0.577994 -0.639897 -0.135671 1.519532 -0.954852 0.620250 0.623354 0.387992
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.550504 -0.598990 0.014650 -0.897333 2.795338 -1.339112 0.736615 -0.765957 0.611729 0.630344 0.388093
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.313735 -0.232522 -0.088191 -0.042685 -0.879050 0.125553 2.330215 -0.721008 0.617130 0.635966 0.387866
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.635734 -0.819661 -0.857803 -0.520105 -1.048651 35.969433 0.662169 9.593281 0.602464 0.610722 0.383901
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.476983 6.190598 5.119792 4.666541 6.215553 7.531420 -2.931404 -2.480123 0.582198 0.605437 0.381072
225 N19 RF_ok 100.00% 0.00% 87.41% 0.00% 0.057299 13.692040 0.866734 6.592055 -0.762275 8.900217 -1.320179 1.160762 0.621773 0.151142 0.506867
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.563602 22.265974 -0.672788 0.412051 -1.222613 3.497436 -0.717497 2.097121 0.611554 0.509138 0.376328
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 3.312428 -0.515156 2.897425 -0.901756 0.450582 15.083222 9.153849 4.037592 0.517277 0.607444 0.414504
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.221938 0.760895 0.943929 -1.345856 0.521118 -1.008016 3.321271 1.217071 0.586829 0.593646 0.378679
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.690550 1.007901 0.806948 1.430050 -0.219239 1.236613 -0.877939 -1.427759 0.593089 0.601954 0.401790
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.227474 -0.535300 0.512843 -1.381440 -0.808267 -1.217581 0.880776 -0.307893 0.563919 0.608944 0.403226
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.354859 -0.514762 0.935944 0.695687 -0.111154 -0.565927 -0.964107 -1.311861 0.609707 0.624522 0.397825
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.944304 -0.340702 -0.308127 0.368212 -0.463704 -0.444094 2.435809 2.266051 0.611559 0.626196 0.395153
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.613085 -0.174417 -0.014650 -0.461241 -0.374290 -1.069321 3.248625 1.081614 0.605282 0.621611 0.393536
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.703066 -0.836319 -0.397501 0.105986 -1.092504 -0.377326 0.670221 -0.973510 0.605044 0.627344 0.402651
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 22.747140 0.753150 -0.238064 1.121900 2.150279 0.879043 0.092358 -0.155520 0.467190 0.622786 0.394461
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 20.821633 -1.374777 0.986236 -1.297616 2.739661 -1.044660 0.346544 -0.319375 0.478866 0.609272 0.393011
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.835364 -1.123079 -0.379642 -1.390725 -0.729349 -0.514624 1.721171 4.192055 0.567503 0.610094 0.398573
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.153805 -0.133849 1.126935 -0.495306 0.645015 -1.136856 -1.561094 0.678760 0.591509 0.604151 0.395604
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.236268 14.835648 -0.826704 6.313262 -0.507935 9.276080 0.013233 0.220199 0.582185 0.038537 0.490164
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.317052 1.672689 0.424349 -0.254744 -0.834069 -0.334980 -0.147751 -0.118260 0.589044 0.580964 0.389575
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 11.511412 14.673028 6.484462 6.671431 -0.049036 -0.307070 0.610957 1.600119 0.571046 0.578084 0.398735
320 N03 dish_maintenance 100.00% 100.00% 100.00% 0.00% 15.802372 14.744538 8.961146 9.249745 7.333196 9.340460 0.935888 2.311901 0.059816 0.051144 0.007718
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 2.716104 3.178144 1.013222 1.464214 0.891336 1.491083 4.569019 -0.165034 0.486954 0.512258 0.383723
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 1.595170 -0.691650 1.096705 -0.552008 0.446375 4.733016 -0.803850 1.037007 0.524213 0.523549 0.396337
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.486782 0.214582 0.354594 -1.058736 13.189623 -1.237962 5.320090 2.203351 0.496824 0.514629 0.385404
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.091491 3.294689 -0.564896 -1.248732 -1.122637 -0.860503 1.156613 1.218492 0.477123 0.496360 0.369714
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, 15, 16, 17, 18, 19, 20, 27, 28, 29, 30, 32, 34, 36, 37, 38, 40, 41, 42, 45, 47, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 63, 65, 68, 71, 72, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 90, 91, 92, 93, 94, 95, 96, 97, 101, 102, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 117, 120, 121, 122, 123, 124, 125, 126, 127, 131, 134, 135, 136, 142, 143, 144, 145, 151, 155, 156, 158, 159, 161, 165, 168, 169, 170, 173, 180, 182, 184, 185, 186, 187, 189, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 223, 224, 225, 226, 227, 242, 243, 244, 246, 262, 320, 324, 325, 329]

unflagged_ants: [5, 10, 21, 22, 31, 35, 43, 44, 46, 48, 49, 50, 62, 64, 66, 67, 69, 70, 73, 74, 85, 88, 89, 103, 115, 118, 128, 132, 133, 137, 139, 140, 141, 146, 147, 148, 149, 150, 157, 160, 162, 163, 164, 166, 167, 171, 179, 181, 183, 190, 220, 221, 222, 228, 229, 237, 238, 239, 240, 241, 245, 261, 333]

golden_ants: [5, 10, 21, 31, 44, 66, 67, 69, 70, 85, 88, 103, 118, 128, 140, 141, 146, 147, 148, 149, 150, 157, 160, 162, 163, 164, 166, 167, 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_2459996.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 [ ]: