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 = "2460081"
data_path = "/mnt/sn1/2460081"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 5-16-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/2460081/zen.2460081.42132.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 360 ant_metrics files matching glob /mnt/sn1/2460081/zen.2460081.?????.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/2460081/zen.2460081.?????.sum.known_good.omni.calfits. Skipping redcal chisq.

Figure out some general properties¶

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

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

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

Load a priori antenna statuses and node numbers¶

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

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

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

Summarize auto metrics¶

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

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

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

Summarize ant metrics¶

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

Summarize redcal chi^2 metrics¶

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

Get FEM switch states¶

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

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

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

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

Find X-engine Failures¶

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

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

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

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

Build Overall Health DataFrame¶

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

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

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

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

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

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

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

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

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

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

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

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

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

Table 1: Overall Array Health¶

In [18]:
HTML(table.render())
Out[18]:
JD 2460081
Date 5-16-2023
LST Range 15.163 -- 17.098 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 360
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 94
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 198 / 198 (100.0%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 94 / 198 (47.5%)
Redcal Done? ❌
Never Flagged Antennas 0 / 198 (0.0%)
A Priori Good Antennas Flagged 94 / 94 total a priori good antennas:
5, 7, 9, 10, 15, 16, 17, 19, 20, 21, 29, 30,
31, 37, 38, 40, 41, 42, 44, 45, 53, 54, 55,
56, 62, 65, 66, 67, 69, 70, 71, 72, 81, 83,
85, 86, 88, 91, 93, 94, 101, 103, 105, 106,
107, 109, 111, 112, 118, 121, 122, 123, 124,
127, 128, 136, 140, 141, 144, 145, 146, 147,
148, 149, 150, 151, 157, 158, 160, 161, 162,
163, 164, 165, 166, 167, 168, 169, 170, 171,
172, 173, 181, 182, 183, 184, 186, 187, 189,
190, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 0 / 104 total a priori bad antennas:
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_2460081.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
4 N01 RF_maintenance 100.00% 95.56% 100.00% 0.00% -1.027623 6.400834 -0.920032 -0.482963 -0.654046 -0.365800 0.178811 -0.062334 0.131485 0.101487 0.064317
5 N01 digital_ok 0.00% 95.28% 98.33% 0.00% 0.033257 0.836475 0.368295 2.934652 0.909281 1.730467 0.762913 1.031311 0.141228 0.124332 0.074220
7 N02 digital_ok 0.00% 100.00% 100.00% 0.00% -0.746976 -0.178323 -0.376622 0.163851 -0.062632 0.298413 0.628552 1.329898 0.046738 0.049486 0.013327
8 N02 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.150938 1.187378 1.152883 1.158921 0.637176 0.456687 -1.530110 -1.776585 0.045808 0.046553 0.013437
9 N02 digital_ok 0.00% 100.00% 100.00% 0.00% 1.203352 -0.417203 2.970222 -0.442591 2.789305 0.351613 0.620608 -0.429431 0.045098 0.043529 0.014181
10 N02 digital_ok 0.00% 85.56% 91.11% 0.00% -0.761633 -0.718391 -0.675794 -0.628178 -1.201810 -0.052193 -0.274499 -0.082591 0.160397 0.167574 0.087232
15 N01 digital_ok 100.00% 95.28% 91.94% 0.00% 5.494702 -0.371066 -0.361526 -0.559918 -0.230288 0.104607 1.342085 1.458314 0.126516 0.135308 0.078503
16 N01 digital_ok 0.00% 100.00% 100.00% 0.00% -0.377676 0.689810 -0.192898 0.885373 -0.310237 -0.006182 -0.024604 -1.100314 0.083870 0.082694 -0.075953
17 N01 digital_ok 100.00% 28.61% 91.94% 0.00% 0.171486 1.065966 0.831801 8.374912 1.183978 -0.311545 0.601406 2.207389 0.216315 0.127875 0.106520
18 N01 RF_maintenance 100.00% 31.11% 100.00% 0.00% 1.146382 2.908871 1.287202 1.600152 0.895290 0.259899 2.585546 5.525687 0.232693 0.101266 0.110422
19 N02 digital_ok 0.00% 38.33% 54.72% 0.00% -0.387796 0.005943 -0.189493 0.227481 -0.105789 0.119930 0.627561 1.480001 0.229085 0.201952 0.132080
20 N02 digital_ok 0.00% 43.89% 81.39% 0.00% 1.095046 -0.621641 1.415519 -0.277273 3.448827 0.185342 1.586542 0.412182 0.213383 0.190689 0.115137
21 N02 digital_ok 0.00% 72.50% 85.83% 0.00% 0.127253 0.090322 -0.010522 0.256749 0.649110 0.702223 -0.029199 -0.247757 0.174337 0.183884 0.106896
22 N06 not_connected 0.00% 90.83% 91.11% 0.00% -0.765577 -0.850281 -0.190505 -0.541820 -0.110244 -0.399305 0.365552 0.008050 0.140574 0.164422 0.087740
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.061590 11.149028 10.248079 6.564187 0.998012 0.308346 1.634856 18.124474 0.037141 0.032786 0.003088
28 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.880706 6.339714 10.542804 4.322067 1.906469 0.447550 1.536075 5.928101 0.016774 0.085626 0.044269
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 4.900678 5.783702 10.341742 10.518627 1.885368 1.642695 1.304557 0.812705 0.016895 0.019379 0.002557
30 N01 digital_ok 0.00% 18.89% 43.06% 0.00% -0.064831 -0.801948 0.214988 -0.643852 2.863671 -0.218642 1.639046 0.265817 0.263618 0.223965 0.161934
31 N02 digital_ok 0.00% 38.06% 54.72% 0.00% 0.336749 0.528451 1.009930 3.302717 1.314745 1.068146 0.580148 0.600958 0.244496 0.210867 0.139213
32 N02 RF_maintenance 100.00% 38.89% 54.72% 0.00% 9.288635 -0.866615 0.181330 -0.949487 -0.769513 -0.551583 0.961165 0.483686 0.215118 0.206241 0.121188
34 N06 not_connected 100.00% 100.00% 91.11% 0.00% 5.513876 -0.573430 6.351491 -0.504078 1.902845 -0.803038 1.813282 0.614941 0.019274 0.158625 0.071740
35 N06 not_connected 0.00% 91.11% 93.61% 0.00% -0.534212 -0.956129 -0.239886 -0.537416 -1.033305 -0.245189 -0.656346 -0.442277 0.142265 0.167239 0.079772
36 N03 RF_maintenance 0.00% 100.00% 100.00% 0.00% 2.155461 2.115721 1.039926 0.645892 0.579358 0.702927 0.347333 0.061145 0.041756 0.045733 0.007628
37 N03 digital_ok 100.00% 95.28% 100.00% 0.00% -0.851013 10.021914 -0.582169 12.596069 -0.941827 1.691146 0.582246 2.516621 0.144356 0.018738 0.068893
38 N03 digital_ok 0.00% 91.94% 97.78% 0.00% -0.051336 -0.165913 0.000380 0.570044 0.148164 0.619749 1.805883 3.511587 0.143107 0.136208 0.077299
40 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 0.173983 0.020433 0.379319 -0.400138 0.008680 0.748818 15.338409 0.860582 0.084043 0.083101 -0.069889
41 N04 digital_ok 0.00% 38.06% 15.00% 0.00% 0.473894 1.272776 1.028639 3.000102 1.330113 1.479591 0.566201 0.546998 0.208682 0.219947 0.141747
42 N04 digital_ok 0.00% 100.00% 100.00% 0.00% -0.140876 -0.008864 -0.155983 -0.798239 -0.346155 0.419748 0.388421 0.285554 0.082239 0.082830 -0.094676
43 N05 RF_maintenance 0.00% 17.50% 11.67% 0.00% -0.680536 0.067818 -0.588004 0.696666 -0.014694 0.978559 0.711128 0.977966 0.274526 0.252682 0.181389
44 N05 digital_ok 0.00% 100.00% 100.00% 0.00% -0.760403 0.361012 -0.523202 0.441955 -0.169573 0.853761 1.775661 1.858090 0.040302 0.043789 0.012359
45 N05 digital_ok 0.00% 38.06% 54.72% 0.00% 0.646436 0.683612 0.886076 0.554038 1.257405 0.990056 2.020613 2.805305 0.248476 0.209032 0.139637
46 N05 RF_maintenance 0.00% 38.89% 54.72% 0.00% -0.215962 -0.871088 0.153160 -0.937731 0.453317 -0.593854 -0.061409 -0.702090 0.221617 0.202489 0.131020
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 44.499555 43.803216 inf inf 481.169362 483.381287 2404.652671 2390.180570 0.086592 0.082208 0.033028
48 N06 not_connected 0.00% 91.11% 93.61% 0.00% -0.641040 0.012146 -0.837089 0.130024 -0.917015 -0.515230 0.122613 -0.387767 0.147068 0.168902 0.084278
49 N06 not_connected 0.00% 91.11% 94.72% 0.00% -0.492058 -0.671452 0.705176 -0.741619 0.444953 -0.862254 0.633790 -0.175593 0.154272 0.168508 0.082765
50 N03 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.463786 0.490804 -0.054025 1.336252 0.226058 1.237532 -0.338737 -0.268986 0.043015 0.042640 0.010843
51 N03 dish_maintenance 100.00% 94.44% 98.06% 0.00% 0.661399 -0.206724 0.176446 -0.202228 0.600597 0.162405 20.993847 0.104134 0.141017 0.133264 0.075831
52 N03 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.953449 1.420038 0.577491 0.203384 0.662595 0.575214 0.815122 0.180308 0.042487 0.044091 0.011274
53 N03 digital_ok 0.00% 23.06% 6.67% 0.00% -0.279733 -0.522032 -0.191009 -0.496082 1.071045 -0.996863 1.388971 0.605880 0.222675 0.227555 0.153049
54 N04 digital_ok 0.00% 100.00% 68.61% 0.00% 2.252088 0.840434 0.673187 -0.364554 1.258738 1.260808 -0.051637 0.104073 0.095783 0.156893 0.055858
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% -0.262402 19.970290 -0.077816 7.909094 -0.547944 1.720785 -0.817062 -0.021837 0.041547 0.016640 0.013704
56 N04 digital_ok 0.00% 25.28% 10.83% 0.00% -0.736784 2.219539 -0.940773 2.064529 -0.858310 0.626920 -0.443344 0.445217 0.245282 0.259733 0.175333
57 N04 RF_maintenance 0.00% 16.39% 8.06% 0.00% -0.811906 -0.279714 -0.712561 -0.583873 -0.773572 0.455213 0.386231 0.590138 0.263781 0.264628 0.184087
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.599862 5.710652 10.538055 10.885646 1.917499 1.685294 1.406383 1.222096 0.017233 0.017499 0.001083
59 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.082859 0.543555 10.545113 0.707075 1.912220 1.358968 1.892630 1.211594 0.017792 0.046841 0.020456
60 N05 RF_maintenance 100.00% 38.89% 100.00% 0.00% -0.146866 5.622026 -0.063475 10.913598 0.968580 1.587251 1.144053 1.599339 0.217599 0.032214 0.080337
61 N06 not_connected 100.00% 99.72% 99.72% 0.00% 44.502334 44.973031 inf inf 678.523470 677.055817 2324.791290 2291.735332 0.990878 0.200352 0.080034
62 N06 digital_ok 0.00% 91.11% 93.61% 0.00% -0.227039 0.056896 1.059680 0.094323 0.428991 -0.667412 1.144916 -0.513840 0.153080 0.169867 0.086010
63 N06 not_connected 100.00% 91.11% 100.00% 0.00% -0.780528 5.847068 -0.940575 6.485142 -0.705734 1.629512 0.293051 1.278001 0.157679 0.020171 0.074856
64 N06 not_connected 0.00% 93.33% 97.50% 0.00% -0.788846 -0.651007 -0.872126 -0.064946 -0.784076 0.065980 -0.766979 -0.713375 0.151298 0.152085 0.079392
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 10.761035 9.987249 13.117887 12.974022 1.896362 1.677025 1.190786 1.044625 0.017184 0.016641 0.000716
66 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 0.657745 10.368241 0.729424 13.094858 0.462089 1.592495 -0.309345 1.135910 0.028128 0.018085 0.005224
67 N03 digital_ok 0.00% 100.00% 100.00% 0.00% -0.532930 0.171054 -0.058376 1.150021 -0.029669 0.918036 0.126380 0.112651 0.028299 0.028777 0.003306
68 N03 dish_maintenance 100.00% 100.00% 5.83% 0.00% 11.307184 -0.209982 13.137546 -0.107184 1.868502 -0.862906 2.957040 -0.443125 0.017865 0.233627 0.086536
69 N04 digital_ok 0.00% 10.00% 4.17% 0.00% 0.863002 0.393387 1.397879 -0.655265 1.079566 -0.308496 1.113917 0.101585 0.269100 0.288252 0.182282
70 N04 digital_ok 0.00% 100.00% 100.00% 0.00% 0.313549 1.094898 1.128762 2.232723 0.257530 2.075182 0.393024 0.086847 0.040913 0.037437 -0.011720
71 N04 digital_ok 0.00% 100.00% 100.00% 0.00% 1.450082 0.184313 -0.206920 0.407668 0.188745 0.552178 0.215779 0.222432 0.047392 0.046620 0.014019
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 0.638987 2.348242 2.187034 9.595573 0.712982 -0.497126 13.648498 1.410258 0.083557 0.068075 -0.053042
73 N05 RF_maintenance 0.00% 14.44% 8.06% 0.00% -0.649126 1.271037 -0.605569 1.851741 -0.070699 0.962220 0.900476 3.057519 0.255811 0.261093 0.179223
74 N05 RF_maintenance 0.00% 38.06% 11.67% 0.00% -0.757577 -0.557054 -0.403202 -0.557181 -0.824175 -0.204923 0.574955 0.834576 0.229055 0.236274 0.163692
77 N06 not_connected 100.00% 99.72% 99.72% 0.00% 61.908470 61.623302 inf inf 584.736084 591.376797 2262.710925 2291.628824 0.538276 0.556862 0.028874
78 N06 not_connected 100.00% 94.44% 97.50% 0.00% 7.125940 -0.064680 0.311443 0.182992 -0.554547 -0.597856 -0.057936 -0.872019 0.151040 0.148519 0.086830
79 N11 not_connected 0.00% 93.33% 97.50% 0.00% 0.005367 -0.773610 0.820353 -0.808488 0.374407 -0.527556 1.292926 0.235499 0.150225 0.152470 0.080178
80 N11 not_connected 0.00% 100.00% 100.00% 0.00% -0.669289 0.916480 -0.605521 0.972509 -1.088825 0.393796 0.183294 -0.468858 0.054033 0.050070 0.014819
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 22.521640 18.108592 24.194583 27.551465 7.328393 12.856499 91.726226 119.902950 0.016511 0.016504 0.000808
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.405599 17.504384 21.107588 20.505771 8.525765 6.097512 78.161278 56.841021 0.016451 0.016415 0.000795
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 12.005960 14.134701 22.901151 23.972225 8.001190 7.187008 91.857787 107.670030 0.016483 0.016482 0.000806
84 N08 RF_maintenance 100.00% 8.06% 100.00% 0.00% 1.876238 10.675430 2.953735 13.190380 1.838409 1.649033 0.281335 2.422617 0.268759 0.022552 0.089395
85 N08 digital_ok 0.00% 2.50% 2.78% 0.00% -0.498047 -0.005367 -0.518024 -0.680148 -1.343513 -0.373241 -0.785728 -0.539101 0.314885 0.312439 0.195383
86 N08 digital_ok 0.00% 2.50% 2.78% 0.00% 0.302030 -0.069028 1.067515 0.102395 0.960289 0.413216 0.001903 1.637447 0.317414 0.325154 0.221442
87 N08 RF_maintenance 100.00% 11.67% 2.78% 0.00% 12.538234 0.640882 2.617598 -0.708998 1.580603 -0.538924 6.398697 -0.240298 0.255462 0.326140 0.214111
88 N09 digital_ok 0.00% 100.00% 100.00% 0.00% 0.183813 0.632335 0.788764 1.380631 0.747587 0.665166 0.147137 0.022818 0.059674 0.062407 0.024051
89 N09 RF_maintenance 0.00% 25.28% 3.33% 0.00% 0.355240 0.314083 0.762854 0.955009 1.124686 1.379055 1.802596 1.638668 0.238630 0.281158 0.173039
90 N09 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.656355 -0.873747 -0.597230 -0.703338 -1.247021 -1.036096 -0.667865 -0.813846 0.058778 0.061906 0.021295
91 N09 digital_ok 100.00% 98.89% 98.61% 0.00% 48.424362 48.923753 inf inf 680.305006 685.093282 2286.321472 2282.704654 0.079801 0.081114 0.036009
92 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.860369 0.052778 10.592006 0.369292 1.905118 0.696630 1.041261 0.154384 0.016510 0.035554 0.011510
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 4.975612 5.784912 10.622714 10.952178 1.864791 1.627316 0.956151 0.768431 0.016538 0.016539 0.000591
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 5.319002 2.330472 10.726903 9.315237 1.789717 -0.188893 1.397489 0.929364 0.016562 0.035640 0.010804
95 N11 not_connected 0.00% 93.33% 98.89% 0.00% 0.019733 -0.565025 -0.094639 -0.310912 -0.165575 -0.831271 0.806695 0.101011 0.152225 0.153135 0.079368
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% -0.003971 6.280181 0.142398 -0.514665 -0.679618 -0.602204 -0.170760 -0.017061 0.048179 0.047380 0.013082
97 N11 not_connected 0.00% 99.72% 100.00% 0.00% -1.032009 0.256366 -0.890579 0.346252 -0.656893 0.118928 0.695898 3.475184 0.127076 0.121933 0.068265
101 N08 digital_ok 0.00% 10.83% 3.89% 0.00% 2.013980 2.332176 0.189767 0.875643 0.820247 1.269415 -0.204191 0.376646 0.255300 0.251464 0.175290
102 N08 RF_maintenance 0.00% 2.50% 2.78% 0.00% -0.934410 0.096119 -0.855811 -0.246549 -0.122920 0.441665 -0.130924 2.308217 0.309524 0.296519 0.187473
103 N08 digital_ok 0.00% 100.00% 100.00% 0.00% 1.190798 0.749762 1.091040 -0.860398 0.553389 -0.435030 -1.110242 -0.681116 0.061849 0.060304 0.026650
104 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 2.191982 20.442450 2.111093 6.154536 2.297640 1.816289 0.885280 0.125797 0.063568 0.064899 0.025403
105 N09 digital_ok 100.00% 99.17% 98.89% 0.00% 66.003926 61.100507 inf inf 892.835830 859.494737 3190.494149 3119.964658 0.055952 0.071149 -0.002139
106 N09 digital_ok 0.00% 24.44% 2.50% 0.00% 0.009681 0.111095 0.234151 0.345201 0.089303 0.415861 1.179856 0.788415 0.233384 0.310388 0.163259
107 N09 digital_ok 0.00% 100.00% 100.00% 0.00% 0.679770 1.227024 0.372218 -0.199979 0.850616 0.057206 0.813756 0.596566 0.056687 0.059880 0.019522
108 N09 RF_maintenance 100.00% 98.89% 99.17% 0.00% 48.680601 48.468591 inf inf 757.465630 757.093404 2427.023794 2417.553512 0.100660 0.086346 0.078631
109 N10 digital_ok 100.00% 99.72% 99.44% 0.00% 53.741724 53.848423 inf inf 640.574728 643.393701 2545.158906 2556.341739 0.065667 0.059437 0.008925
110 N10 RF_maintenance 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.088802 0.058577 0.045123
111 N10 digital_ok 100.00% 98.89% 99.17% 0.00% 59.548730 59.592311 inf inf 667.958530 661.249598 2570.716388 2584.284943 0.131762 0.101772 0.061433
112 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 0.502998 1.442206 1.280828 8.859354 0.526110 -0.434079 1.269867 1.146260 0.060931 0.050767 -0.039816
113 N11 not_connected 0.00% 98.61% 100.00% 0.00% 1.646413 1.809714 1.490509 1.641024 1.169871 1.153260 -0.547335 -0.818125 0.131641 0.126992 0.071216
114 N11 not_connected 0.00% 100.00% 100.00% 0.00% 1.373580 0.679615 1.249143 3.337602 0.805003 -0.681570 -1.061227 0.132621 0.052248 0.051208 0.017514
115 N11 not_connected 100.00% 99.72% 99.44% 0.00% 65.908495 65.968621 inf inf 806.417213 805.090357 2656.423332 2642.848836 0.047400 0.131456 0.078419
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 19.714057 13.738295 27.578864 24.097964 13.735782 7.524026 225.330148 158.595927 0.016196 0.016159 0.000821
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 10.842445 12.165726 22.973710 23.174239 8.834029 7.691182 187.204504 136.808551 0.016101 0.016172 0.000780
120 N08 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.480282 -0.415220 2.430526 -0.744810 2.731770 -0.771575 0.233930 -1.047224 0.061984 0.063497 0.027098
121 N08 digital_ok 0.00% 2.50% 2.78% 0.00% -0.422387 1.615182 -0.707403 1.168823 -0.286450 1.377204 -0.280352 1.334664 0.334981 0.307095 0.219591
122 N08 digital_ok 0.00% 2.50% 2.78% 0.00% 1.496736 0.889340 -0.221046 -0.794164 0.017703 -0.397031 -0.349027 -0.753384 0.320975 0.318769 0.211553
123 N08 digital_ok 0.00% 2.50% 2.78% 0.00% 1.995033 2.616310 0.870715 1.068752 1.155664 1.122528 0.413150 0.310973 0.289057 0.313122 0.201115
124 N09 digital_ok 100.00% 100.00% 3.06% 0.00% 4.914514 -0.049963 10.752343 0.665890 1.892162 0.990483 1.970504 1.369089 0.021545 0.282333 0.081183
125 N09 RF_maintenance 100.00% 75.28% 3.33% 0.00% -0.180593 0.062550 5.399725 1.351659 -0.461231 0.895479 1.189518 0.793333 0.183726 0.274996 0.128801
126 N09 RF_maintenance 0.00% 78.61% 4.72% 0.00% 0.354255 0.204255 0.703608 0.792979 0.428177 1.152623 1.276414 1.030665 0.183661 0.234527 0.117359
127 N10 digital_ok 100.00% 100.00% 97.50% 0.00% 4.752456 -0.971416 10.578555 -0.631789 1.903839 -0.699943 1.546000 0.273294 0.017697 0.136054 0.058648
128 N10 digital_ok 0.00% 95.28% 97.50% 0.00% -0.226195 -0.528227 -0.363069 -0.400242 0.006182 -0.762321 1.562985 0.728742 0.117377 0.135402 0.068879
131 N11 not_connected 100.00% 99.72% 99.44% 0.00% 62.157460 62.226639 inf inf 524.027825 528.661597 2214.961808 2251.055620 0.056534 0.086246 0.061665
132 N11 not_connected 0.00% 98.61% 100.00% 0.00% -1.031483 -0.543485 -0.862051 -0.606921 -1.096799 -0.300009 0.490756 0.396531 0.118176 0.119509 0.063689
133 N11 not_connected 100.00% 99.72% 99.72% 0.00% 53.736123 53.832983 inf inf 599.557695 590.418853 2350.062924 2352.630009 0.064079 0.079847 0.047100
134 N11 not_connected 0.00% 100.00% 100.00% 0.00% 0.379037 1.166753 2.596686 1.111114 0.475749 0.477811 2.675406 -1.154405 0.109295 0.113750 0.063953
135 N12 RF_maintenance 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.135477 0.084696 0.034890
136 N12 digital_ok 100.00% 99.44% 99.72% 0.00% 51.870414 52.241606 inf inf 597.229510 594.260935 2427.320958 2465.691742 0.164629 0.112523 0.092381
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.022080 21.077299 20.533686 25.095399 8.613744 9.405570 142.222930 215.037387 0.016126 0.016112 0.000741
139 N13 RF_maintenance 0.00% 64.17% 67.78% 0.00% 0.060518 -0.449014 0.035373 -0.848501 -0.694165 -0.744621 -0.407052 0.202790 0.193931 0.179698 0.112904
140 N13 digital_ok 0.00% 3.33% 23.89% 0.00% 0.141238 -1.091245 0.301819 -0.851683 0.502053 -0.976109 0.189655 0.045306 0.276225 0.232301 0.157853
141 N13 digital_ok 0.00% 2.50% 23.61% 0.00% -0.293486 -0.706962 0.079118 -0.380347 0.058945 -0.941215 0.229358 -0.631625 0.285630 0.241293 0.157049
142 N13 RF_maintenance 100.00% 2.50% 100.00% 0.00% -0.395091 5.764062 -0.346616 10.929288 0.408360 1.643122 3.965532 1.117794 0.263361 0.024896 0.099671
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.719080 5.703728 10.271065 10.904928 1.767267 1.617805 0.437129 0.640462 0.045386 0.017899 0.021515
144 N14 digital_ok 0.00% 75.28% 6.67% 0.00% -0.386846 -0.729119 -0.308592 -0.123034 0.226019 -0.831328 -0.097643 -0.756209 0.184449 0.242334 0.117329
145 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 2.449226 2.670694 -0.030158 -0.423371 -0.584078 -0.415688 -0.643345 0.002693 0.020528 0.020940 0.002470
146 N14 digital_ok 0.00% 90.00% 64.72% 0.00% -0.632416 -0.856114 -0.586412 -0.979214 -0.664523 -0.825326 -0.561370 -0.742212 0.139319 0.182593 0.084116
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 67.318532 67.317006 inf inf 728.425520 728.331795 2291.299940 2291.155567 0.051152 0.116113 0.038925
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 60.835862 61.165567 inf inf 749.943776 749.870117 2312.060647 2360.589789 nan nan nan
149 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 73.105838 73.006513 inf inf 699.726459 714.814822 2504.343672 2552.233616 nan nan nan
150 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 58.247363 58.278674 inf inf 773.171291 774.326931 2382.513874 2379.002579 0.118150 0.090575 0.014695
151 N16 digital_ok 100.00% 98.61% 100.00% 0.00% 4.323441 -0.330419 -0.563211 0.985917 -0.748834 0.476507 -0.823534 1.332627 0.123546 0.117336 0.061982
155 N12 RF_maintenance 100.00% 99.44% 99.44% 0.00% 65.727499 65.746729 inf inf 675.661751 675.733779 2211.586204 2257.627716 0.420734 0.374150 0.059009
156 N12 RF_maintenance 100.00% 98.89% 100.00% 0.00% 0.635076 5.699451 6.381012 10.800774 1.118924 1.647102 2.848340 1.172480 0.112071 0.019997 0.052341
157 N12 digital_ok 0.00% 83.33% 76.94% 0.00% 0.346980 0.246078 0.562597 0.682411 0.631355 0.883634 0.626704 0.490475 0.139142 0.154831 0.083172
158 N12 digital_ok 0.00% 68.33% 68.33% 0.00% -1.000435 -1.021172 -0.961873 -0.937395 -0.814895 -0.721753 -0.033027 2.544661 0.184903 0.170498 0.101754
159 N13 RF_maintenance 100.00% 64.17% 68.61% 0.00% -0.128965 5.547121 0.214823 0.180088 0.172436 -0.393248 0.671312 0.581364 0.190656 0.163385 0.092089
160 N13 digital_ok 100.00% 100.00% 67.78% 0.00% 5.115694 -0.604976 10.549045 -0.420035 1.865857 0.166339 0.805734 -0.211785 0.024049 0.181605 0.091179
161 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 0.337041 10.804634 0.435370 0.525438 0.846693 -0.422408 -0.945020 -1.327728 0.034227 0.032212 0.005468
162 N13 digital_ok 0.00% 100.00% 100.00% 0.00% -0.458522 -1.020999 -0.350541 -0.865028 -1.307586 -0.421100 -1.405056 -1.493081 0.038637 0.031650 0.004565
163 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 2.351242 2.552846 0.850171 -0.380450 0.433349 -0.740223 -0.602803 -0.163171 0.020434 0.020621 0.003212
164 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 2.350046 2.454743 0.929907 0.003467 0.915162 -0.639746 -1.050422 -0.881161 0.019653 0.020219 0.002304
165 N14 digital_ok 100.00% 88.61% 64.72% 0.00% 5.902744 -0.444971 1.067201 -0.415023 -0.100215 -0.212102 -0.157027 -0.926466 0.138617 0.188420 0.083836
166 N14 digital_ok 100.00% 100.00% 64.72% 0.00% 4.937368 -0.483870 10.712256 -0.139166 1.869040 -0.614321 0.907937 -0.715060 0.017800 0.187031 0.082291
167 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 62.462757 62.496944 inf inf 646.581437 653.963021 2380.352563 2417.363487 0.058208 0.033154 -0.021515
168 N15 digital_ok 100.00% 99.72% 100.00% 0.00% 67.285412 67.032337 inf inf 694.176760 682.483519 2373.193411 2378.647989 0.108453 0.058165 0.049696
169 N15 digital_ok 100.00% 100.00% 99.72% 0.00% 72.539317 72.840267 inf inf 780.220126 777.177693 2420.082131 2400.790932 0.049196 0.138787 0.068968
170 N15 digital_ok 100.00% 99.72% 99.72% 0.00% 61.534268 61.678828 inf inf 832.034251 826.062080 2570.040784 2551.541967 0.541261 0.543336 0.008897
171 N16 digital_ok 0.00% 98.61% 100.00% 0.00% -0.325722 -1.145458 1.112208 -0.841107 0.408169 -0.378972 0.614710 0.063046 0.113413 0.121227 0.061786
172 N16 digital_ok 0.00% 98.61% 100.00% 0.00% 1.102166 0.309191 1.046993 0.264988 0.605937 -0.489854 -1.068635 -0.968500 0.120789 0.127379 0.063423
173 N16 digital_ok 0.00% 98.61% 100.00% 0.00% 1.626105 1.764448 1.487650 1.609404 1.147424 1.077417 -0.959056 -1.179187 0.131100 0.129481 0.065624
179 N12 RF_maintenance 100.00% 64.17% 68.33% 0.00% -0.356819 -0.127517 0.556436 0.664836 0.162326 11.032023 0.408014 3.042235 0.189785 0.169006 0.105358
180 N13 RF_maintenance 100.00% 65.28% 100.00% 0.00% -0.530377 6.014569 -0.716695 11.005214 -0.249121 1.632459 3.406044 1.456380 0.188239 0.032291 0.079742
181 N13 digital_ok 0.00% 71.11% 71.11% 0.00% 1.085642 1.032745 1.757849 2.314918 1.170164 1.496523 0.113141 2.738178 0.181206 0.162906 0.095333
182 N13 digital_ok 100.00% 100.00% 100.00% 0.00% -0.724961 5.711705 -0.510508 10.739589 -1.217911 1.594799 -0.865628 -0.342311 0.035648 0.021864 0.018807
183 N13 digital_ok 0.00% 86.94% 84.72% 0.00% -0.223522 0.842776 0.479122 0.906627 1.112729 1.022994 0.292582 0.190289 0.154016 0.149043 0.087709
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 2.672031 2.367825 6.616533 -0.407880 -0.837122 -0.923380 1.355254 -1.006020 0.020414 0.021003 0.003482
185 N14 RF_maintenance 0.00% 88.61% 68.06% 0.00% -0.611833 -0.092887 -0.837925 0.079561 -0.752797 0.284597 -0.252701 -0.170768 0.141643 0.186505 0.085164
186 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 2.303824 2.319495 0.199900 0.758894 -0.499083 0.167390 -1.121563 -1.523409 0.020364 0.020221 0.002542
187 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 2.334135 2.299694 -0.564389 0.732602 -1.048721 -0.047323 -0.822102 -1.632466 0.021291 0.020617 0.002341
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.089685 0.046857 0.071405
190 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 65.039892 64.827830 inf inf 671.998081 664.522545 2325.271690 2262.776204 0.084731 0.054671 0.061850
191 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 42.859151 42.296841 inf inf 663.275190 667.042298 2340.443703 2324.656625 0.085254 0.075117 0.045199
192 N16 digital_ok 0.00% 98.61% 100.00% 0.00% 1.337482 1.978670 1.231567 1.759667 0.786704 1.229881 -1.114564 -1.505695 0.126784 0.123198 0.070569
193 N16 digital_ok 0.00% 98.61% 100.00% 0.00% 1.874637 1.689151 1.674948 1.550217 1.324627 1.003019 -1.947504 -2.142666 0.128598 0.129280 0.064273
200 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.494131 6.134646 6.230050 6.462589 1.861874 1.615096 0.706068 0.231602 0.018288 0.018863 0.000709
201 N18 RF_maintenance 0.00% 86.94% 91.39% 0.00% 0.677530 1.469700 0.741403 1.433489 0.196621 0.821224 -1.068398 -1.511773 0.154560 0.142573 0.086500
202 N18 digital_ok 0.00% 86.94% 90.28% 0.00% -0.200110 -0.913254 0.036490 -0.887759 -0.943717 -0.597357 -0.691511 3.966682 0.153999 0.142975 0.079805
204 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% 3.640050 3.228264 1.843406 -0.596972 1.430959 -0.283921 4.069911 -0.647806 0.115407 0.119065 0.062650
205 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 2.946836 -0.715446 5.007446 -0.603480 -0.656950 -0.144546 0.303721 -0.437126 0.086829 0.121476 0.079092
206 N19 RF_ok 0.00% 100.00% 100.00% 0.00% 0.246415 0.770473 2.148623 3.186808 -0.433565 -0.377623 -0.049754 -0.107771 0.103145 0.113257 0.053892
207 N19 RF_ok 100.00% 99.44% 99.44% 0.00% nan nan inf inf nan nan nan nan 0.071428 0.098055 0.060176
208 N20 dish_maintenance 100.00% 99.17% 99.44% 0.00% 69.458278 69.588894 inf inf 747.909071 740.355594 2264.634216 2208.128572 0.106310 0.056606 0.068866
209 N20 dish_maintenance 100.00% 99.17% 99.17% 0.00% nan nan inf inf nan nan nan nan 0.141367 0.127728 0.042640
210 N20 dish_maintenance 100.00% 99.17% 99.44% 0.00% nan nan inf inf nan nan nan nan 0.353688 0.368787 0.061812
211 N20 RF_ok 100.00% 98.61% 100.00% 0.00% -0.464711 5.898427 -0.392141 6.449051 -0.455313 1.625459 0.214582 0.666412 0.130497 0.017802 0.081354
220 N18 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.717152 -0.890393 -0.470108 -0.901703 -1.342845 -0.525734 -1.021850 -1.038204 0.045876 0.048717 0.014485
221 N18 RF_ok 0.00% 100.00% 100.00% 0.00% -0.895941 -0.770858 -0.911023 -0.978327 -0.372338 -0.817743 -0.652530 -0.924541 0.045759 0.046490 0.014989
222 N18 RF_ok 0.00% 100.00% 100.00% 0.00% -0.660540 -0.615707 -0.639669 -0.542003 -1.298652 -1.127194 -0.766648 -1.149917 0.048546 0.049802 0.016972
223 N19 RF_ok 100.00% 99.44% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.048024 0.075538 0.006515
224 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 70.863123 70.918606 inf inf 711.828249 696.843367 2354.623412 2311.088648 0.059890 0.077750 0.023013
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% -0.289961 5.470937 -0.151969 6.220356 -1.262584 1.253954 -1.430515 -0.592580 0.041807 0.029769 0.016249
226 N19 RF_ok 0.00% 100.00% 100.00% 0.00% -1.097984 3.963645 -0.994095 -0.510711 -1.141027 -0.703347 -0.996974 -1.276980 0.041910 0.041071 0.010642
227 N20 RF_ok 100.00% 98.61% 100.00% 0.00% 0.526645 -0.023723 2.405851 0.123882 0.222835 0.855943 5.502664 5.175141 0.129520 0.126499 0.069116
228 N20 RF_maintenance 0.00% 98.61% 100.00% 0.00% -0.226181 -0.611510 -0.235046 -0.614727 -1.415873 -0.196280 -1.017388 -1.027875 0.127176 0.121194 0.063306
229 N20 RF_maintenance 0.00% 98.61% 100.00% 0.00% -0.164879 -0.028010 -0.282180 0.162695 -1.256984 -0.624861 -1.403781 -1.760525 0.127523 0.120251 0.066585
237 N18 RF_ok 0.00% 100.00% 100.00% 0.00% -0.161464 -0.843632 0.575838 -0.786564 0.771130 -0.199086 0.895585 -0.225249 0.116587 0.119166 0.065225
238 N18 RF_ok 0.00% 100.00% 100.00% 0.00% -0.305117 -0.400161 -0.142950 -0.094383 -1.002954 -0.960615 -0.711247 -0.973004 0.113171 0.116686 0.065075
239 N18 RF_ok 0.00% 100.00% 100.00% 0.00% -0.866932 -0.335253 -0.685458 -0.157246 -1.465499 -0.963538 -0.955924 -0.625532 0.117611 0.119330 0.064462
240 N19 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.808914 -0.526254 -0.459124 -0.952287 -1.376850 -0.938558 -1.233248 -1.396500 0.042273 0.041862 0.011982
241 N19 RF_ok 0.00% 100.00% 100.00% 0.00% -1.113804 -0.926225 -0.853994 -0.557708 -1.256972 -1.259153 -1.051331 -1.471802 0.106237 0.117876 0.061221
242 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 4.173650 -0.144030 -0.640761 0.000011 -0.751741 -0.890350 -0.601122 -1.434537 0.101072 0.115803 0.059813
243 N19 RF_ok 0.00% 100.00% 100.00% 0.00% 0.181510 -0.913008 0.238536 -0.701579 -0.603750 -0.353362 -1.105136 -0.705960 0.106165 0.111304 0.057389
244 N20 RF_maintenance 0.00% 98.61% 100.00% 0.00% -0.217918 -0.428831 0.255142 0.302196 0.178851 0.183006 0.466468 0.580465 0.126548 0.125483 0.064852
245 N20 RF_ok 0.00% 98.61% 100.00% 0.00% -0.545484 -0.633078 -0.368602 -0.823823 -1.153328 -0.501452 -0.352284 0.168892 0.128713 0.119867 0.064460
246 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% -0.788777 6.110962 -0.990311 6.093509 -0.907971 1.579237 -1.061047 -0.703598 0.040188 0.016586 0.018555
261 N20 RF_ok 0.00% 100.00% 100.00% 0.00% -0.890352 -0.635299 -0.932902 -0.760806 -1.130944 -1.157769 -0.548469 -1.249933 0.042481 0.037671 0.008361
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 2.664740 4.265989 -0.213683 0.483630 0.330745 0.483460 -0.719828 -0.784185 0.043523 0.040291 0.008132
320 N03 dish_maintenance 0.00% 100.00% 100.00% 0.00% 0.775090 0.962681 0.682812 0.909729 0.201633 0.392516 -0.817304 -1.085018 0.083352 0.071159 0.032840
324 N04 not_connected 0.00% 100.00% 100.00% 0.00% 0.408814 0.566825 -0.000380 0.227259 -0.830817 -0.514436 -0.794352 -1.121672 0.073699 0.065755 0.026293
325 N09 dish_ok 0.00% 100.00% 100.00% 0.00% -0.161831 -0.951773 -0.099321 -0.593791 -0.893530 -0.344568 -0.315390 -0.001903 0.077101 0.071377 0.029095
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.408603 5.885545 6.105049 6.558738 1.856816 1.617276 1.200707 0.932636 0.018236 0.018377 0.001086
333 N12 dish_maintenance 0.00% 100.00% 100.00% 0.00% 0.154431 -0.346897 -0.077520 -0.664660 -0.395534 -0.485022 0.837902 0.067769 0.079789 0.073777 0.029907
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [4, 5, 7, 8, 9, 10, 15, 16, 17, 18, 19, 20, 21, 22, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 117, 118, 120, 121, 122, 123, 124, 125, 126, 127, 128, 131, 132, 133, 134, 135, 136, 137, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 324, 325, 329, 333]

unflagged_ants: []

golden_ants: []
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_2460081.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

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