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 = "2460013"
data_path = "/mnt/sn1/2460013"
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: 3-9-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/2460013/zen.2460013.21281.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 1851 ant_metrics files matching glob /mnt/sn1/2460013/zen.2460013.?????.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/2460013/zen.2460013.?????.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 2460013
Date 3-9-2023
LST Range 5.677 -- 15.639 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
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 42, 70
Total Number of Nodes 19
Nodes Registering 0s N15
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 62 / 198 (31.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 136 / 198 (68.7%)
Redcal Done? ❌
Never Flagged Antennas 61 / 198 (30.8%)
A Priori Good Antennas Flagged 65 / 93 total a priori good antennas:
3, 5, 7, 15, 16, 17, 29, 31, 37, 38, 40, 42,
45, 53, 54, 55, 65, 66, 67, 69, 70, 71, 72,
81, 86, 93, 94, 101, 103, 107, 109, 111, 112,
121, 122, 123, 124, 127, 128, 136, 140, 145,
147, 148, 149, 150, 151, 158, 161, 165, 167,
168, 169, 170, 173, 181, 182, 184, 187, 189,
190, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 33 / 105 total a priori bad antennas:
22, 35, 43, 46, 48, 50, 57, 61, 62, 64, 73,
74, 89, 90, 115, 125, 132, 133, 137, 139, 179,
220, 228, 229, 237, 238, 239, 241, 245, 324,
325, 329, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2460013.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% 0.00% 100.00% 0.00% 11.193853 15.507202 -0.034386 11.617946 5.662298 7.096236 -0.119659 2.220231 0.315488 0.039501 0.257903
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.201862 13.942277 2.270377 2.201257 1.757533 3.736513 -3.073604 1.956841 0.556114 0.436706 0.355037
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 11.963510 15.286825 11.037075 11.312054 6.109369 7.177366 1.098837 0.830513 0.040989 0.035318 0.002667
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.142793 -0.100193 -0.883031 -0.145980 0.436497 0.858296 6.017599 21.445622 0.575011 0.586565 0.357585
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.352453 4.324352 3.044835 3.144018 2.907852 3.641100 -3.020628 -2.327336 0.557450 0.567801 0.345854
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.709900 -0.809281 3.644597 -0.948142 0.317859 -0.050410 2.520229 -0.728408 0.550850 0.583097 0.360953
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.948974 -1.319412 0.015871 -1.233564 -0.757907 0.099835 -1.353286 -0.177412 0.565641 0.579293 0.357005
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 28.653840 0.057498 3.451549 2.465919 3.828800 0.662195 0.890810 4.396292 0.414364 0.568810 0.359882
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 1.945622 15.447911 3.456075 11.588968 0.344259 7.072015 5.020083 1.437201 0.545614 0.033510 0.445382
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.438442 8.248466 0.965312 10.446278 1.142081 3.807724 0.532902 3.772814 0.580115 0.346688 0.436480
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 12.158105 7.878714 11.082803 0.069092 6.065287 3.839957 1.373820 58.235028 0.035084 0.395078 0.319126
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.360279 -0.140440 -0.674667 0.621501 0.366398 -0.389277 0.220433 -0.918526 0.587081 0.602618 0.358752
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.030267 -1.304881 2.330994 -0.905313 1.454380 -0.282233 1.848064 -0.222058 0.575592 0.598874 0.356517
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.531651 0.283807 -0.271883 0.175199 0.683392 0.846894 0.565252 0.417190 0.568661 0.578009 0.348160
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.992555 -0.407259 -0.131275 -0.289061 0.212040 2.588913 -0.633159 -1.238686 0.543260 0.558091 0.350583
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.022832 14.469575 11.151138 11.425772 6.067418 7.165154 3.626132 2.945145 0.030040 0.029968 0.000495
28 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.202685 38.289429 10.902137 4.020956 6.068489 4.851386 0.999567 31.555851 0.027412 0.103462 0.067393
29 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -1.199711 -0.436013 2.920613 0.685376 0.054300 0.657973 5.875022 2.534233 0.581260 0.594820 0.358324
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.334638 -0.493933 0.556956 -1.327659 1.732213 0.288411 1.301523 -0.429735 0.584581 0.609811 0.360974
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.763229 -0.925232 1.326628 1.559926 1.894528 -0.195635 0.638354 10.045368 0.598486 0.602793 0.354536
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 23.811950 28.310502 1.717696 3.361390 0.325234 0.254790 3.215794 7.770501 0.473126 0.478080 0.203198
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 13.079897 16.219322 5.642760 5.811421 5.886984 6.988638 1.904291 1.402642 0.034116 0.044385 0.006734
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.508153 -0.511278 0.289560 -1.096651 -0.497883 -0.797070 2.334273 -0.432501 0.551602 0.552303 0.347458
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.523250 8.567472 1.236296 0.812246 1.736849 1.957972 0.075540 1.161359 0.557452 0.565320 0.376460
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.146733 25.238010 -0.262082 13.687262 -0.312044 7.073873 -1.191489 4.351710 0.574171 0.031826 0.457022
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.742463 0.686751 -1.241175 3.031148 -0.062001 -0.505107 3.239056 14.640357 0.582086 0.567125 0.371603
40 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.064612 0.846778 3.042186 -0.289866 -0.352838 0.366938 1.419100 14.480250 0.573316 0.597219 0.364004
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.516754 1.016438 1.583171 1.659199 2.561532 1.024168 0.371312 0.482912 0.592803 0.602545 0.359300
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.861500 2.814654 3.275763 -1.117550 1.895145 0.533219 0.507089 0.902941 0.239400 0.235644 -0.281933
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.540375 0.227571 -0.446595 0.746225 -0.909462 1.004776 -1.290697 1.024028 0.602935 0.610628 0.353239
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.851353 0.415919 -1.338647 0.292999 -0.571567 0.549768 -0.603622 -0.172435 0.604518 0.619706 0.356787
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 1.009524 1.773811 0.783378 0.740148 -0.089414 1.963462 0.810441 16.283226 0.591475 0.603573 0.352254
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.799450 -0.607093 -0.259086 -0.911229 -0.208460 -0.497635 -0.185785 -0.680666 0.590928 0.613091 0.364154
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 12.220729 15.825720 5.544312 5.424127 5.887782 6.934738 4.210616 1.346821 0.031712 0.051838 0.013281
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.287484 1.169338 -0.674315 1.528640 -0.818788 1.758506 1.298628 -2.714012 0.551513 0.574886 0.355820
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.653876 0.122415 -0.353545 0.108979 -0.663677 -0.503520 0.178134 6.823282 0.516727 0.552688 0.353315
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.894738 1.095608 0.247827 1.779515 -0.130277 1.784090 0.018194 -0.087221 0.561190 0.564925 0.372397
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.750290 1.968292 -0.182187 0.182839 2.243758 1.071934 87.938796 0.936826 0.570795 0.581403 0.367594
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.935174 5.997049 0.528321 0.134654 1.762662 1.419023 3.128064 1.013262 0.583774 0.594678 0.366360
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.014232 1.956092 -0.124187 -0.212872 2.124836 0.284687 14.336758 0.914027 0.593896 0.607843 0.368500
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 10.692494 4.761996 2.560390 0.225369 3.105745 2.099285 -1.846640 0.160937 0.302074 0.356432 0.153577
55 N04 digital_ok 100.00% 6.54% 100.00% 0.00% 0.611603 57.731245 0.851768 7.465238 0.204887 7.436212 3.101223 0.787603 0.256027 0.039901 0.092580
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.815573 0.551652 -0.875545 2.548813 -0.549792 3.336237 -1.111134 1.063175 0.605449 0.610188 0.348139
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.711872 0.544381 2.218444 -0.233987 1.407933 0.192725 -2.501844 0.828718 0.602869 0.618876 0.348928
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.563000 14.848679 11.078831 11.586298 5.859025 6.972257 2.988225 2.414089 0.035548 0.035355 0.001822
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.838811 0.677068 11.129830 1.214251 5.726287 2.496952 1.091346 4.051485 0.045185 0.609285 0.466541
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.594073 14.804989 -0.088219 11.618918 0.510901 6.975462 1.210040 3.717934 0.590620 0.069688 0.472441
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.255619 -0.231420 0.552053 -1.183622 2.359311 -0.860154 -0.236809 0.660298 0.531015 0.573155 0.352392
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.658755 1.302438 -0.448859 1.108627 -0.893433 -0.236274 0.785295 -1.814312 0.537747 0.576340 0.357126
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 1.500223 15.355811 -0.640757 5.845904 -0.283016 7.056155 -0.690885 3.884542 0.544484 0.044949 0.430332
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.393743 -0.374380 -1.186424 -0.628613 -0.855818 -1.033176 2.745347 0.231320 0.539888 0.537076 0.344349
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 26.074163 24.898225 14.245945 14.136088 6.117275 7.190007 6.894251 8.651129 0.022452 0.024366 0.002183
66 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.693129 0.910561 7.157304 3.936419 1.811575 0.203114 8.724074 4.035604 0.530069 0.577020 0.376590
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.287182 0.442657 -0.400952 1.633598 -0.277414 0.921730 9.519208 2.409721 0.587633 0.587944 0.359463
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 28.074537 0.983016 14.361013 1.037475 5.915292 -0.739817 7.811064 -1.350781 0.033319 0.608904 0.471734
69 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.407494 -0.388228 0.636562 2.883855 0.053063 2.025522 4.650468 0.831145 0.601444 0.605317 0.351265
70 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.120648 1.777746 1.358940 3.304639 3.040827 0.894276 4.900263 0.688420 0.252304 0.236204 -0.279854
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.588801 -0.486703 0.172309 4.731595 0.815096 -0.751489 -0.383272 0.716876 0.604012 0.602306 0.341957
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 1.410929 0.664268 1.761512 7.734261 0.700711 0.168856 0.727445 19.175678 0.608720 0.557260 0.359967
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.529675 0.665297 -1.012452 -0.044188 1.041194 2.811071 -0.064003 -0.001449 0.613552 0.625276 0.352800
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.745474 -0.077495 -0.245316 -0.462585 -0.507308 0.795612 -1.024802 3.089435 0.609862 0.625009 0.357144
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 59.347563 21.582609 0.705256 -0.421261 3.273586 1.015151 8.278825 -0.834775 0.299069 0.476559 0.289270
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 29.543856 0.949005 -0.408571 1.345391 1.277282 0.692231 0.340518 -0.128246 0.400736 0.579239 0.347132
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.752893 15.616667 -0.954224 5.843130 -0.340238 6.895142 0.388337 0.120388 0.543128 0.039705 0.439070
80 N11 not_connected 100.00% 0.00% 95.73% 0.00% -0.635324 16.179472 0.090637 5.680790 -0.881014 6.120755 -1.243557 2.052121 0.553383 0.071092 0.440915
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.644718 15.739500 0.508860 10.216340 1.188500 6.714848 0.045089 2.605932 0.530930 0.037314 0.406834
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.637790 0.189383 -0.588249 1.023148 0.653459 1.017306 -0.417317 4.916630 0.566660 0.570402 0.359984
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.022826 0.020772 0.643656 0.660095 1.197629 0.622391 -0.339355 0.776739 0.575269 0.582800 0.356429
84 N08 RF_maintenance 100.00% 71.85% 100.00% 0.00% 20.501318 27.349985 13.900407 14.478249 4.420397 6.983071 6.025413 6.952901 0.193583 0.035931 0.129354
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.683685 0.025523 -1.172629 -1.325671 -0.801596 -0.011595 -0.852731 -0.765247 0.603828 0.616905 0.355410
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.095223 1.481868 0.197912 -0.061403 1.638820 0.912087 0.891448 23.841378 0.601552 0.618446 0.345832
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.026517 6.980031 0.711505 -0.025306 10.395145 1.051548 50.700976 12.887169 0.559068 0.632745 0.333636
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.543156 0.814592 0.762851 1.151036 0.479112 -0.753197 -0.012388 -0.074941 0.605821 0.622020 0.340525
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.897639 0.245930 0.633208 1.062881 -0.214209 0.304357 -0.227547 -0.099792 0.604248 0.621601 0.346215
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.042592 -0.449746 -0.697992 -0.368266 -0.300705 -1.143749 0.010049 2.782810 0.604490 0.625745 0.352700
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.518671 -0.187058 0.900300 0.500393 0.278825 0.281304 0.023881 0.057611 0.582115 0.610738 0.354218
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.231320 -0.114641 11.081363 0.394627 6.001100 1.563001 0.857867 1.179117 0.035166 0.610322 0.413104
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.481636 15.062000 11.203225 11.685081 5.818172 6.929113 3.800899 2.974134 0.030064 0.025018 0.002772
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 12.340777 15.347938 11.318219 11.485909 5.885046 6.986929 1.642302 1.345476 0.025367 0.025291 0.000949
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.419599 2.086350 -0.932048 0.770421 2.310503 1.427430 -0.336134 -0.007255 0.411138 0.419955 0.191875
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 4.726400 19.225352 3.210805 1.550596 2.773439 2.305576 -3.785365 -2.203130 0.546464 0.457836 0.338168
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.537783 3.904689 -1.062126 0.875617 -0.888816 -0.478990 0.826596 14.832905 0.537631 0.512043 0.349935
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.947712 8.435431 0.077578 1.246075 0.759924 1.554085 0.054443 -0.050567 0.593032 0.605169 0.354449
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.942151 0.976032 -0.897203 -1.280507 0.510636 0.603278 -0.986817 8.823166 0.596580 0.617278 0.352396
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.566092 3.672568 1.839931 -1.190291 2.750911 0.608294 4.369396 8.139182 0.600268 0.614927 0.342054
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.614933 62.438640 0.143012 7.488586 4.488373 -0.061685 1.141424 0.255935 0.605464 0.598436 0.342662
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.020772 0.342872 0.477201 1.138329 1.516639 0.475681 0.007863 -0.211509 0.609771 0.623202 0.343228
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.122455 1.171034 -0.353166 -0.228405 0.026693 -0.743266 0.473439 -0.263466 0.607399 0.624722 0.344659
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 2.052183 1.412030 0.227014 -0.401104 1.157805 0.173922 2.453331 4.642709 0.601903 0.624083 0.346068
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.250443 44.028151 11.121953 1.079340 5.891482 2.656074 2.755234 2.958337 0.034030 0.288790 0.147109
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.980632 14.861417 11.169524 11.358749 5.979897 7.071576 1.032969 2.741944 0.057872 0.033467 0.015935
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.764857 11.464599 6.491632 -0.035086 6.123384 -0.392613 0.764395 -0.473238 0.502155 0.564556 0.328564
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 22.355941 14.784992 1.072716 11.452240 4.010660 7.063145 36.657419 3.208736 0.495330 0.057300 0.360651
112 N10 digital_ok 100.00% 67.37% 100.00% 0.00% 1.855768 14.376538 7.893853 11.519475 0.022602 6.840759 0.473036 1.222172 0.184611 0.067015 -0.094076
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.301331 16.278824 5.263285 5.835811 5.766277 6.874932 2.531996 1.404016 0.033652 0.031205 0.001475
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 14.213801 1.218908 5.433834 -0.034264 5.741693 -0.889508 0.699137 -0.832426 0.044709 0.555658 0.429266
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.303463 -0.964773 -1.317597 0.099866 -1.017202 -0.844458 -0.797210 0.462408 0.520404 0.544716 0.360360
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.124372 16.549943 11.221705 11.929257 5.772062 6.948136 2.021870 5.361189 0.027685 0.031422 0.002256
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.708212 1.890273 0.427749 0.715137 -0.419559 0.842661 0.197038 1.140532 0.568882 0.585651 0.362029
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.268439 1.781760 3.152116 -1.046549 0.488934 0.850215 4.809330 2.666298 0.585320 0.616160 0.355376
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.319349 3.492593 -1.017710 6.319224 0.089737 -0.230942 44.964390 32.606518 0.607359 0.595308 0.342050
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.299836 6.507381 -0.761913 -1.141730 0.095509 0.662417 -0.436784 -0.926563 0.610179 0.629189 0.347525
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.100359 8.629001 1.134539 1.191601 1.168784 0.917035 -0.168576 0.507849 0.615212 0.627555 0.346284
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 11.353958 0.864286 11.381610 0.760152 5.754668 1.041855 1.115334 0.814676 0.040370 0.622912 0.426439
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.285068 2.752523 1.031353 1.115239 1.319019 -0.265841 0.374641 0.243844 0.605614 0.615759 0.347416
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.191661 6.499591 -0.245558 1.757464 1.058531 0.794586 3.867214 0.296873 0.603386 0.613662 0.351680
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 10.823847 -0.070892 11.075052 1.843884 5.982191 -0.101536 0.756683 0.982967 0.032583 0.609171 0.401236
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.253992 -0.316042 -0.994688 -0.128970 -0.122520 -0.112960 1.296371 5.847424 0.593764 0.604992 0.370166
131 N11 not_connected 100.00% 0.00% 61.86% 0.00% -0.670717 14.858349 -0.259326 5.769296 -0.438238 6.146766 -1.193404 0.668973 0.550855 0.211947 0.401509
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.407297 -0.030984 -0.615244 -1.329978 0.322798 -0.265497 -0.851625 -0.436433 0.540393 0.544889 0.354004
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.891885 -1.151299 -1.188766 -0.448158 -0.590305 -0.870538 -0.292488 1.454482 0.518164 0.548913 0.364671
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.080246 16.779002 4.813447 5.220543 5.746044 6.874204 1.015061 1.528082 0.040098 0.034983 0.002932
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.984960 -1.508562 -1.021827 -1.211671 1.835446 0.509604 0.808874 0.473265 0.534563 0.560948 0.374535
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 10.268607 1.953299 10.765248 -0.518025 5.973378 0.489010 2.373540 0.914785 0.038690 0.560238 0.415566
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.286899 -0.392584 0.445400 -1.341232 2.214019 0.059329 1.477287 2.337606 0.553325 0.581388 0.363043
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.257821 1.924904 1.153038 -0.958187 0.490458 -0.665590 -1.493888 0.287320 0.577410 0.576106 0.340807
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.781811 -1.034894 -0.301188 -0.297384 -0.515874 -0.506813 5.873342 4.587557 0.597105 0.615633 0.348013
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.822708 -0.597318 0.000258 0.563815 1.245680 -0.273257 -0.054395 -1.846893 0.601293 0.620631 0.346804
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.228362 14.869954 -0.487351 11.627925 2.035921 7.024314 25.438815 2.665094 0.606044 0.045128 0.503960
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.021728 14.817029 10.972913 11.590713 5.287373 6.989688 0.819859 2.418862 0.098459 0.029910 0.055295
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.115695 0.644688 -0.764984 3.721065 0.164810 1.903043 -0.634184 0.239305 0.613341 0.609913 0.352735
145 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.116620 -0.501751 2.389291 0.362407 0.258476 6.501034 0.639256 -0.822154 0.597822 0.622839 0.355438
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.424025 -0.603063 -1.190213 -0.738732 -0.876600 -0.904916 -0.315379 -0.262328 0.574988 0.597424 0.351533
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 264.171449 263.763484 inf inf 2232.567975 2205.417681 8431.900291 8238.119882 nan nan nan
149 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 234.133054 233.118525 inf inf 2498.535934 2259.004735 7945.278664 8127.627964 nan nan nan
150 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 240.933632 240.719266 inf inf 2286.358583 2266.184824 8964.044929 8825.472668 nan nan nan
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 23.568896 0.715064 -0.544942 0.715849 1.607801 -0.239965 0.239784 0.058314 0.422797 0.520053 0.319453
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.767088 -1.181556 10.927635 -1.012305 6.001097 -0.181828 3.094103 0.933797 0.040193 0.565251 0.433037
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.166823 14.657196 8.981566 11.406241 1.644858 7.080465 3.146604 3.290635 0.402116 0.038452 0.315395
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.792466 -0.378816 0.456743 0.823308 0.411192 1.049497 0.181013 0.221608 0.559274 0.579685 0.362528
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.199127 -0.679800 0.005264 -0.203487 2.458541 2.156242 6.844024 25.894627 0.572704 0.592052 0.360696
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.542289 28.242901 -0.807475 -0.470185 -0.507413 1.331794 0.034876 1.251909 0.546891 0.448086 0.318806
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.053342 -1.174457 -0.041470 -0.653076 0.291677 1.545737 -0.494445 0.865263 0.589057 0.608648 0.353701
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.119248 32.681337 0.424878 -0.109792 1.019765 0.484143 -0.157268 1.149490 0.595484 0.482417 0.322665
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.928688 -1.226346 -0.083582 -0.893423 0.215812 0.541037 0.311632 -0.535311 0.607364 0.622817 0.353201
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.756633 1.439896 0.276264 0.574773 0.612744 1.349046 0.193126 2.257829 0.609817 0.623057 0.356117
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.123188 0.180286 0.533175 1.393160 3.844862 2.477604 0.668316 1.886752 0.604528 0.612694 0.347334
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 28.654101 -0.020477 0.047115 -0.702599 1.841113 0.261004 1.762927 -0.492659 0.475023 0.617368 0.344427
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.882389 0.079961 1.113582 0.727176 0.434272 -0.459788 0.563093 -1.992447 0.595083 0.611359 0.348222
167 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
168 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
169 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
170 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.697766 1.478545 -1.185812 -0.105400 -0.928620 -0.303734 -0.252865 0.600318 0.524793 0.513858 0.342781
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 13.495018 15.861574 5.017970 5.468860 6.006102 7.067579 4.811462 8.397562 0.035347 0.040517 0.003341
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.893592 -0.615878 -0.000258 0.247919 -0.303163 1.608768 -0.478619 1.097249 0.561250 0.588704 0.361017
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.117559 15.595807 -1.175557 11.754991 1.130890 6.936142 25.065860 3.516805 0.587958 0.051061 0.494714
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.378521 0.064698 1.396928 0.762686 0.360372 0.018938 -0.028629 7.582754 0.592763 0.605766 0.358635
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.088318 14.583523 -0.402167 11.341005 -0.649579 7.086205 8.744673 3.176138 0.604429 0.046886 0.466303
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.449209 0.075785 -0.124438 0.301976 1.647201 0.400673 0.511544 0.001449 0.594942 0.609089 0.346945
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 22.146613 -0.646332 7.508038 -1.015521 6.874405 0.264280 10.132976 -0.327898 0.415248 0.616321 0.371735
185 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.932758 -0.228383 3.265015 0.836118 3.274871 0.248528 -3.514524 -0.872907 0.574306 0.613528 0.361097
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.057784 -1.070158 0.234750 -0.285544 -0.762778 -0.369845 -1.056003 -0.969881 0.602290 0.613400 0.357232
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.294180 -0.777191 -1.195512 -0.026301 0.667035 0.764145 8.485239 -0.231996 0.586199 0.601581 0.358696
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
190 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 265.867044 265.774387 inf inf 2996.663446 2996.841423 13437.775317 13442.327176 nan nan nan
191 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 252.711495 253.203463 inf inf 2251.866301 2259.246717 8677.251708 8777.391716 nan nan nan
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 1.655661 7.027527 1.863001 4.277790 1.384481 5.718427 0.652346 -4.775853 0.537148 0.509131 0.362945
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 7.437267 1.040933 4.292126 1.389945 4.772440 1.488374 -4.730640 -0.808114 0.499616 0.535971 0.373936
200 N18 RF_maintenance 100.00% 100.00% 50.35% 0.00% 13.067290 40.290080 5.436024 0.015961 5.984918 2.649709 2.621429 6.768404 0.039748 0.215263 0.140793
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.045766 5.151715 2.611913 3.690664 2.617780 4.664370 -1.959742 -3.960101 0.569024 0.568283 0.349904
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.573961 0.855730 1.231481 -1.268718 0.757013 0.297695 -1.507303 59.735152 0.581676 0.580896 0.346781
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.810690 15.100832 1.645372 -0.901238 -0.019929 -0.144283 23.522584 1.817934 0.588492 0.608381 0.356528
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.733292 0.357167 4.480038 -1.141308 3.506559 -0.492742 52.238465 7.826622 0.353991 0.586887 0.417463
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.251758 6.428973 0.252730 2.970088 1.083660 1.562414 0.735853 0.826227 0.531231 0.470456 0.341182
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.978499 1.776115 -0.889680 -0.753940 -0.957220 -0.177721 7.889600 -0.188855 0.560397 0.558406 0.348603
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
210 N20 dish_maintenance 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.994350 0.997829 0.003483
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.010975 15.359406 -1.225957 5.868133 -0.642456 6.910211 0.094325 1.904609 0.521243 0.039045 0.443100
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.176579 -0.793291 0.211774 -0.491192 -0.710997 -0.010738 3.437270 -1.279185 0.572875 0.574424 0.351562
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.097460 -0.367207 -1.256998 -0.678881 0.300069 -1.201674 22.148654 -0.719730 0.560536 0.582311 0.351990
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.492698 -0.121081 -0.327161 0.087865 -0.440567 -0.205381 4.363204 -1.416258 0.567772 0.586942 0.352727
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.578311 -0.986495 -0.936412 -0.272840 -0.905144 -0.882657 0.952124 10.125756 0.558937 0.584438 0.354857
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.583967 6.335149 4.461618 4.164687 4.963505 5.443147 -4.864268 -4.067999 0.533318 0.555433 0.348486
225 N19 RF_ok 100.00% 0.00% 90.92% 0.00% -0.573215 14.862056 0.525578 5.612661 -0.786568 6.752264 -1.507852 2.436183 0.569664 0.134463 0.466758
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.669863 21.468539 -0.729835 0.567403 -0.994478 2.983193 -0.950534 -0.622743 0.556777 0.476610 0.342525
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 3.360768 1.209326 2.534052 -0.563033 -0.087846 -0.865366 12.891402 13.316036 0.452449 0.539702 0.369515
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.234605 0.400876 0.659824 -1.322599 0.010738 -0.804114 0.857121 1.307428 0.535785 0.533688 0.346923
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.348878 0.898009 0.578773 1.298619 -0.064549 0.592771 -1.777499 -2.610803 0.536901 0.546457 0.367025
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.043418 -0.559487 0.419480 -1.329290 -0.291562 -0.360175 0.587690 -0.942864 0.511041 0.556757 0.364032
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.155222 -0.303000 0.645125 0.528083 -0.561461 -0.873862 -1.935880 -2.117248 0.562473 0.572929 0.360507
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.027892 -0.993368 -0.365384 -0.202010 -0.455310 -1.037801 0.923361 3.309167 0.562835 0.572359 0.357752
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.713094 0.123125 0.352476 -0.882129 -0.898756 -1.234816 8.918601 5.124831 0.514376 0.571648 0.370250
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.879895 -1.074425 -0.523022 0.141826 -0.968279 -0.499792 1.179995 -1.121104 0.553148 0.574917 0.367233
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 23.001228 0.587906 -0.366062 1.149454 1.457290 0.759424 -0.878736 -0.519531 0.422250 0.568152 0.360121
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 21.066743 -1.036873 0.762213 -1.364736 1.876742 -0.417771 -1.336687 -0.070429 0.431361 0.553386 0.357396
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.791583 -0.656874 -0.429247 -1.334822 -0.604921 0.420262 3.045394 6.466643 0.510023 0.553043 0.361410
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.341525 0.276062 0.831796 -0.493627 -0.070238 -0.982402 -2.297027 -0.055324 0.542857 0.546341 0.358753
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.524152 15.994379 -0.947400 5.359798 -0.460396 7.033499 -0.739113 0.618195 0.525858 0.038090 0.445679
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% -0.337917 -0.024962 -0.017341 -0.221455 -0.518036 -1.067821 18.426604 5.108727 0.532924 0.538652 0.356468
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 11.995721 14.938369 5.640027 5.609040 -0.077979 -0.556564 0.138429 2.715621 0.512921 0.520533 0.357221
320 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.899645 1.473118 2.177057 1.207512 1.068695 0.542791 -1.816909 1.053432 0.461205 0.474391 0.355077
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 2.189690 3.265955 0.987797 1.464082 0.360648 1.370099 -1.447041 -2.467555 0.447181 0.455374 0.338565
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.265858 -0.868619 0.865561 -1.364391 0.087805 -1.260577 -2.162596 0.826741 0.474847 0.473791 0.353982
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.580006 -0.030655 -0.992723 -1.001956 -0.735431 -0.923895 1.954595 -0.418551 0.443531 0.459010 0.339344
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.104829 1.380475 -0.460796 -1.250012 -0.877196 -0.709793 1.409136 0.311252 0.421241 0.448067 0.328798
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, 5, 7, 8, 15, 16, 17, 18, 27, 28, 29, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 49, 51, 52, 53, 54, 55, 58, 59, 60, 63, 65, 66, 67, 68, 69, 70, 71, 72, 77, 78, 79, 80, 81, 82, 84, 86, 87, 92, 93, 94, 95, 96, 97, 101, 102, 103, 104, 107, 108, 109, 110, 111, 112, 113, 114, 117, 120, 121, 122, 123, 124, 126, 127, 128, 131, 134, 135, 136, 140, 142, 143, 145, 147, 148, 149, 150, 151, 155, 156, 158, 159, 161, 165, 167, 168, 169, 170, 173, 180, 181, 182, 184, 185, 187, 189, 190, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 221, 222, 223, 224, 225, 226, 227, 240, 242, 243, 244, 246, 261, 262, 320]

unflagged_ants: [9, 10, 19, 20, 21, 22, 30, 35, 41, 43, 44, 46, 48, 50, 56, 57, 61, 62, 64, 73, 74, 83, 85, 88, 89, 90, 91, 105, 106, 115, 118, 125, 132, 133, 137, 139, 141, 144, 146, 157, 160, 162, 163, 164, 166, 171, 179, 183, 186, 220, 228, 229, 237, 238, 239, 241, 245, 324, 325, 329, 333]

golden_ants: [9, 10, 19, 20, 21, 30, 41, 44, 56, 83, 85, 88, 91, 105, 106, 118, 141, 144, 146, 157, 160, 162, 163, 164, 166, 171, 183, 186]
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_2460013.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.3.dev121+gc95c57f
In [ ]: