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 = "2459928"
data_path = "/mnt/sn1/2459928"
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: 12-14-2022
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/2459928/zen.2459928.21312.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1850 ant_metrics files matching glob /mnt/sn1/2459928/zen.2459928.?????.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/2459928/zen.2459928.?????.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 2459928
Date 12-14-2022
LST Range 0.099 -- 10.055 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 94
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 201 (0.0%)
Antennas in Commanded State (observed) 0 / 201 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 18
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 60 / 201 (29.9%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 134 / 201 (66.7%)
Redcal Done? ❌
Never Flagged Antennas 67 / 201 (33.3%)
A Priori Good Antennas Flagged 54 / 94 total a priori good antennas:
3, 7, 9, 10, 15, 16, 19, 20, 21, 29, 30, 37,
38, 40, 42, 53, 54, 55, 56, 71, 72, 81, 86,
94, 100, 101, 103, 107, 109, 111, 121, 122,
123, 128, 129, 130, 136, 140, 143, 146, 158,
161, 164, 165, 169, 170, 181, 182, 183, 185,
187, 189, 191, 202
A Priori Bad Antennas Not Flagged 27 / 107 total a priori bad antennas:
22, 35, 43, 46, 48, 61, 62, 64, 73, 74, 77,
79, 89, 95, 115, 120, 125, 132, 137, 139, 237,
238, 239, 245, 324, 325, 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_2459928.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.557802 13.784962 10.319060 0.900457 8.701133 4.722942 1.176285 7.377610 0.032275 0.344805 0.275334
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.016524 -0.301973 -1.238314 -1.941083 5.785124 1.977497 81.731003 40.275483 0.644483 0.657326 0.412863
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.117669 -0.118320 -0.199563 -0.240997 -0.449106 1.660312 0.551123 2.417796 0.642754 0.648430 0.407956
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.106341 -1.129309 0.976874 3.437169 -0.400499 -0.426468 9.651523 9.518358 0.636511 0.630709 0.400756
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.623864 -1.099495 -1.004252 -0.341286 0.022166 0.330705 4.809086 1.878890 0.640804 0.639978 0.400365
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.026634 -0.679497 8.487246 -0.002653 3.368805 0.849211 0.213410 -0.304810 0.465373 0.641552 0.469425
10 N02 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.920728 15.829012 10.250338 2.261515 8.742602 5.191941 0.768593 3.124872 0.030547 0.337761 0.259924
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.790974 -0.772793 10.282763 0.473988 8.705137 1.967408 1.114732 2.747323 0.031238 0.654992 0.534034
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.466549 1.785512 0.126254 -0.018711 0.230907 0.926797 1.471612 1.127546 0.643512 0.655589 0.403647
18 N01 RF_maintenance 100.00% 100.00% 52.16% 0.00% 10.386974 16.751298 10.261776 -0.038899 8.858972 8.455822 1.059133 20.943407 0.028754 0.223253 0.169560
19 N02 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
20 N02 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 2.699675 0.040655 -0.215626 4.633670 -0.533538 0.221783 0.420925 0.052762 0.622079 0.603406 0.395733
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.961638 -0.465623 -0.125223 -0.162030 2.216333 0.036850 -0.227188 -1.051501 0.592772 0.605611 0.390652
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.132599 10.151005 10.322314 10.755152 8.833731 9.140371 2.625033 1.955167 0.034460 0.038403 0.005365
28 N01 RF_maintenance 100.00% 0.00% 84.92% 0.00% 12.622844 24.032012 -1.575394 0.741923 3.738922 8.055007 5.678800 21.792476 0.356485 0.162969 0.258228
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 9.814714 10.579750 9.879029 10.316564 8.820318 9.126133 1.036637 0.419157 0.029552 0.034735 0.005435
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.159155 0.149419 -0.335548 0.205088 1.006791 0.544472 10.175190 1.072390 0.650661 0.661662 0.398092
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.370449 -1.415330 0.970750 0.880122 1.641848 0.320334 0.886993 1.115841 0.659369 0.659007 0.400808
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 19.400249 2.570442 0.670364 1.544484 7.510612 8.813716 12.583733 61.276813 0.545809 0.621213 0.356110
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.227812 11.598061 4.218055 4.521169 8.782016 9.100013 1.639244 1.082233 0.032751 0.042351 0.006635
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.017741 -0.314878 0.678177 -1.953365 -0.760645 -1.069827 -1.284696 0.093714 0.604952 0.594473 0.386255
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.608891 7.812879 0.042979 0.106309 0.864414 2.355425 1.373301 2.310539 0.643028 0.653219 0.400191
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.657076 0.467030 -2.003761 0.555011 0.796994 1.400233 -0.579491 4.665545 0.655741 0.661277 0.405315
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.151658 0.332628 -0.173596 0.186429 0.610794 1.352506 4.966975 1.060679 0.656147 0.667601 0.407609
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 9.208618 0.696039 9.909634 0.186487 8.791222 0.316312 1.110844 -0.340773 0.036432 0.659891 0.536565
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.504044 0.052016 -0.524392 -0.290670 1.749185 0.013409 -0.303681 0.541032 0.655921 0.663114 0.391482
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.320093 10.979209 10.614886 11.305687 8.562931 8.941604 0.785929 1.340594 0.030571 0.028918 0.002014
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.086769 0.043247 -1.047053 0.307772 -0.870654 0.465158 -0.881633 0.895603 0.660854 0.656044 0.396313
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.503250 -0.003329 -1.039527 -0.980426 -0.628474 0.897145 -0.882872 -0.301307 0.655659 0.665492 0.394535
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.324379 0.845260 -0.145936 0.259099 -0.300168 1.079220 0.041939 2.666183 0.645241 0.642479 0.387531
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.058362 2.045704 1.249967 1.857447 -0.028618 -0.083658 -0.154923 -1.958119 0.634852 0.663230 0.409896
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.425289 11.351604 4.022830 4.114881 8.735036 9.038126 1.307693 0.179534 0.029868 0.049056 0.013366
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.165440 1.135581 0.097734 1.655130 2.411918 1.048548 0.597633 -2.078011 0.605490 0.616639 0.385313
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.011762 -0.051884 -0.828264 -1.893299 0.150736 -0.310163 0.450304 14.932706 0.554456 0.592535 0.382064
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.415122 1.613801 0.226630 0.626239 2.260274 2.145982 25.683258 7.704957 0.609969 0.647018 0.370491
51 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 21.832735 3.516532 13.287402 -0.437944 8.944517 6.926004 8.739309 -0.137606 0.037815 0.548891 0.435506
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.561224 6.558855 -0.785179 0.232657 1.005774 1.420645 2.235834 1.137825 0.661341 0.670540 0.396816
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.620358 2.717812 -0.257457 -0.012582 1.789024 2.122124 3.147626 4.178098 0.666986 0.675609 0.403186
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.606403 10.724362 10.340076 11.010356 8.768957 9.090722 2.340428 1.205626 0.030387 0.029039 0.001279
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.032038 11.328771 10.352247 10.898650 8.795303 9.100900 1.070665 2.651636 0.027534 0.030300 0.002592
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.829861 11.461442 0.133900 11.151335 -0.127725 9.033649 1.551367 1.227464 0.659126 0.036923 0.559336
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.800853 6.616919 8.269832 0.160709 8.116408 2.102197 26.406443 2.768259 0.387134 0.668441 0.444061
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.220565 10.467158 10.213127 10.890597 8.749632 9.103750 2.735880 2.149944 0.033858 0.033928 0.001397
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.009954 0.675713 9.716903 0.748692 8.554699 2.754363 1.135659 2.758881 0.046748 0.652937 0.539918
60 N05 RF_maintenance 100.00% 0.00% 98.54% 0.00% 0.858602 10.386099 -0.698171 10.924418 -0.304928 9.099117 1.091392 2.874702 0.643779 0.070243 0.530902
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.644462 3.066638 -1.115222 0.953334 0.577276 2.003234 -0.504686 0.528691 0.586713 0.563013 0.367991
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.449628 0.674022 -1.023204 0.872339 -0.748240 -0.900630 1.183038 -0.615887 0.565894 0.628578 0.396980
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.125262 10.768413 -0.741458 4.552838 -0.415297 9.178886 -0.093462 2.935506 0.594162 0.041441 0.481814
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.221419 0.511295 -1.383659 -0.985292 2.713779 -1.629199 1.535722 -0.212657 0.574944 0.567008 0.366633
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.581464 1.152204 0.103136 0.792594 0.730088 1.639717 0.526852 -0.148216 0.638720 0.659461 0.407519
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.182034 1.644177 2.578889 1.847461 2.464011 0.804279 0.160266 0.642411 0.643927 0.664674 0.401151
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.465664 -0.816742 1.253709 1.132319 -0.651354 0.774246 0.651612 2.283222 0.649568 0.667174 0.397486
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 20.337353 24.000585 0.971674 14.526627 3.392044 9.130233 0.461658 9.048369 0.362510 0.028885 0.270598
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.500185 -0.447845 -0.038256 0.515874 -0.294473 1.288830 -0.293115 -0.354608 0.659604 0.671643 0.387518
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.686825 -0.043482 -0.542968 -0.302195 1.151149 1.676556 1.182891 1.124885 0.666415 0.678418 0.388704
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.403647 -0.116936 0.353178 0.703747 0.846650 0.270011 0.300984 0.273671 0.676102 0.680137 0.388254
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 2.127572 11.517170 0.426423 11.332072 -0.077034 8.953913 6.767553 1.043179 0.662248 0.034657 0.555924
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.816294 1.093957 -1.636268 1.073139 0.361054 -0.030178 -0.641157 -0.405818 0.669429 0.666362 0.388983
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.387878 2.129227 -0.453594 -1.026273 -0.161553 1.778184 -0.981972 3.434885 0.657606 0.664808 0.384437
77 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.845254 1.348306 0.039034 -0.833838 -1.385506 0.009718 2.437086 -0.632082 0.625818 0.580173 0.393879
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 30.904613 0.016773 -0.581637 0.866492 3.424251 -1.043881 0.892716 0.974644 0.394347 0.627233 0.393464
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.301527 -0.674960 -2.023615 -0.453866 -1.225494 -1.716895 0.469391 -1.332565 0.598627 0.633431 0.402353
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 2.824165 11.883662 2.921721 4.445700 3.205520 9.040795 2.196925 1.197666 0.602411 0.043717 0.471186
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.608742 11.152461 -0.331474 9.388600 -1.146434 8.871614 -0.027440 1.820510 0.614074 0.035686 0.484690
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.230283 -0.929066 0.052930 3.418915 -0.647933 32.265683 -0.370443 4.288254 0.632907 0.605072 0.393533
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.868198 -0.349907 -0.155627 0.040971 0.243397 -0.440022 -0.436474 0.498221 0.642485 0.660658 0.392460
84 N08 RF_maintenance 100.00% 58.22% 100.00% 0.00% 18.906570 21.420634 13.490319 14.054461 7.263291 9.030351 4.056892 5.562896 0.215009 0.034552 0.136900
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.330720 0.780229 -0.290758 0.441412 0.835378 0.309979 -0.064648 -0.512873 0.661356 0.670369 0.389374
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.893378 -0.145402 0.470640 0.710878 3.260593 -0.361671 0.452093 21.169338 0.653050 0.668979 0.380440
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.293093 6.933136 -0.975202 -0.308257 -0.187315 1.224095 -0.028175 1.373352 0.679320 0.690543 0.386344
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.259600 0.717435 0.055315 0.438886 -0.653683 -0.128822 1.839668 0.771930 0.660506 0.676460 0.377118
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.002522 0.346247 -0.296062 0.522906 -0.500692 -0.311078 -0.518478 -0.336759 0.669569 0.676038 0.380592
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.481399 -0.593817 0.933420 0.977292 -1.200431 -0.704056 0.361864 4.112565 0.656855 0.660648 0.379903
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.453415 -0.275228 0.059903 -0.057301 -0.447508 -0.469535 0.720216 0.159763 0.654761 0.674071 0.393597
92 N10 RF_maintenance 100.00% 6.70% 25.03% 0.00% 34.884898 40.165887 0.343758 0.965777 4.688584 6.445999 0.867136 8.524954 0.280836 0.235246 0.092144
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 2.016646 0.248577 2.060617 0.117763 0.958445 0.376188 3.590218 -0.277818 0.639997 0.661389 0.398552
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.537732 10.801214 10.495659 10.773127 8.763329 9.083757 1.279794 0.814986 0.029962 0.026216 0.001744
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.857258 -0.831416 -1.431650 0.550106 -0.990255 -1.269110 -0.426163 0.269106 0.611545 0.645193 0.403594
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.754243 11.494964 4.047894 4.663585 8.598485 8.956507 1.256853 0.815630 0.033460 0.037514 0.002435
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.053358 5.080574 -0.396466 1.598634 0.138554 1.674481 6.478720 4.521810 0.556531 0.527379 0.366751
98 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.538662 3.459176 -0.304511 -0.156012 -0.525112 2.555361 0.328517 2.782530 0.609152 0.629672 0.389006
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.223434 -0.680147 0.762993 -0.021656 -0.144624 2.275470 3.739268 -0.445499 0.615787 0.648200 0.401364
100 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 156.240283 152.280310 inf inf 4503.613803 4584.962700 6992.918116 7034.846095 nan nan nan
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.765509 8.569069 -0.757557 0.926749 0.312800 1.754470 0.306441 0.045909 0.661443 0.673549 0.390806
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.416506 0.886305 -1.435690 2.228372 0.292633 0.732926 0.196702 7.573978 0.667067 0.661212 0.381017
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.031855 4.882711 -0.820591 -0.404247 17.497919 2.174830 9.803111 8.208954 0.665824 0.680377 0.379748
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.601841 56.469430 7.043079 7.402038 1.532354 0.094561 -0.125138 -0.094654 0.599628 0.651726 0.385072
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.170052 -0.369959 -0.127829 0.553031 0.882573 -0.312974 -0.235049 -0.178057 0.670777 0.676508 0.371725
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.410371 0.159277 1.133233 0.658199 0.756783 -0.619283 -0.087983 -0.154057 0.657505 0.660245 0.367486
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 2.242890 3.036605 -0.551622 -0.613891 -0.389448 -0.318963 3.929711 5.175480 0.668474 0.679989 0.375490
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.681722 11.132643 10.269390 -0.734241 8.786561 5.232193 1.976742 3.509122 0.037961 0.380879 0.250346
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.483332 10.436074 10.298632 10.624130 8.867157 9.151810 0.801263 1.891998 0.026434 0.026725 0.001241
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 23.905768 22.627757 13.924412 14.249320 8.733581 8.968124 4.189290 4.265489 0.023998 0.026059 0.001160
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.188226 10.388944 0.181954 10.733765 -0.305168 9.152454 9.322505 2.048516 0.649044 0.035075 0.474315
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.177476 -0.356804 -0.086945 -0.074242 1.255865 3.151418 0.261637 -0.430815 0.638807 0.655909 0.406008
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.460097 11.560166 3.802361 4.539713 8.640884 8.996563 1.905269 0.614346 0.034360 0.030655 0.001939
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.904759 12.247671 13.315429 11.091463 10.622641 11.412344 276.102031 111.297680 0.024008 0.027835 0.002360
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.433786 1.610722 1.320118 2.112755 0.116915 1.176463 -1.695261 -1.542146 0.600391 0.624339 0.413621
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -1.289738 0.067116 -1.334541 -0.288328 0.438358 -0.125675 -0.074773 -0.068529 0.609868 0.627457 0.393569
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.458075 11.812334 10.407747 11.296036 8.653485 9.113745 1.454081 3.543581 0.026965 0.030996 0.002655
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.178437 0.885342 -0.528982 0.283618 -0.076202 0.517686 0.828904 2.015948 0.636667 0.658722 0.398763
119 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.783095 2.634173 2.638660 2.116410 -0.695299 0.420079 1.268135 -1.854047 0.645141 0.675684 0.384121
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.099892 4.343878 -1.882715 -0.058887 1.655220 1.252038 14.005199 18.562914 0.670044 0.683313 0.382748
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.143522 5.998623 4.526638 0.665343 2.633968 1.271602 0.483017 -0.425306 0.655209 0.685008 0.388588
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.303271 8.496652 0.445353 0.716437 0.378080 0.653508 -0.208973 -0.036510 0.681053 0.691261 0.381048
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.791022 -0.312530 -0.409082 0.374232 -0.809353 0.048853 1.443344 0.634277 0.675358 0.682813 0.370048
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.144336 -0.262526 -1.071429 0.463352 -0.727448 0.261700 2.050795 -0.080898 0.674105 0.677285 0.376186
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.297718 4.915414 -1.639346 1.342517 7.119964 -0.119394 31.550792 0.717318 0.656880 0.669118 0.382716
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.003329 0.200848 0.018711 0.057969 1.058528 1.347879 1.080822 2.441855 0.659313 0.680127 0.395603
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.249907 10.029781 10.397197 10.892253 8.694792 9.022036 0.645393 0.776918 0.029596 0.025988 0.001772
129 N10 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
130 N10 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
131 N11 not_connected 100.00% 0.00% 88.00% 0.00% 3.454952 11.428463 3.378784 4.701107 2.964698 8.870021 -2.414802 -0.109562 0.629866 0.144151 0.469337
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.919098 0.467054 -0.549298 -2.064523 -1.080401 -1.296200 -0.818311 0.019907 0.603541 0.615206 0.396070
133 N11 not_connected 100.00% 100.00% 0.00% 0.00% 11.049126 -0.306853 3.788565 -1.969234 8.748573 -1.520066 1.790181 -0.663772 0.059825 0.608243 0.474125
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.648086 -0.731490 0.022486 -2.101854 4.107939 1.501553 10.723947 -0.021462 0.607087 0.643908 0.417179
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 2.125352 0.594099 4.577276 1.017420 24.788617 13.156102 0.653340 -0.069288 0.565711 0.628368 0.398337
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.177346 -0.823055 -0.140301 -1.824149 1.391597 -0.106984 1.285770 0.706650 0.617690 0.650585 0.405429
138 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.518208 -0.458579 1.305343 -1.429654 -0.154541 -1.702642 -1.292697 -0.274209 0.646014 0.651473 0.384832
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.546223 -0.228078 -1.561856 -0.631229 -0.265727 -0.548426 5.387586 3.541323 0.661558 0.684937 0.386459
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.342971 -0.671959 -0.670804 0.352613 1.353959 -1.734590 0.585690 -1.047831 0.665351 0.686584 0.382180
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.106126 10.323987 -1.037347 10.927710 2.860097 9.109445 23.856053 1.700909 0.671004 0.045302 0.534161
143 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 3.500034 -0.644310 6.583893 -0.179085 -0.076109 1.961433 -0.356765 -0.453166 0.595969 0.691682 0.414021
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.362667 0.585151 -0.684420 0.581262 0.372411 0.609076 -0.483730 0.427043 0.677712 0.688519 0.378618
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.182724 0.629622 -0.570130 4.538795 -0.167903 4.366826 0.078505 0.401997 0.674628 0.656834 0.386403
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 10.779783 -1.270634 3.798526 -0.563500 8.700223 -0.979848 0.590087 -1.018591 0.037404 0.670873 0.528965
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.417344 -1.311804 0.880841 2.165860 -1.235900 -0.475097 -0.061157 0.830167 0.651920 0.661586 0.386116
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.711251 -0.353808 3.191452 1.661706 0.132068 0.930503 -0.275921 -0.273085 0.631375 0.662584 0.399519
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.677802 0.701833 -1.884816 1.637874 -0.423897 -0.297916 -0.140751 -1.405184 0.649682 0.660010 0.402021
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.660876 -0.175146 1.286849 0.444049 -0.285710 -1.468482 0.248864 1.140342 0.642954 0.655008 0.411124
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.377365 -0.454096 9.950310 -1.828280 8.827272 1.684291 0.922068 1.766441 0.035160 0.640236 0.481155
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.328515 10.110980 6.817354 10.605765 1.731681 9.108781 1.254903 0.674174 0.522621 0.037339 0.410060
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.142995 -0.250359 -0.430581 0.394342 -0.507125 1.377027 -0.162802 0.383359 0.624375 0.646228 0.403273
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.020109 0.321960 -0.511904 -1.194705 1.664418 1.464677 3.224022 16.297776 0.639627 0.661679 0.405167
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.256715 10.181461 -2.056927 -1.730709 -1.436930 6.095458 -0.497414 73.061871 0.613440 0.605193 0.374860
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.589126 -0.788517 -0.640826 -1.111475 -0.554046 1.215842 0.848143 1.385295 0.655807 0.669846 0.386999
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.858147 26.150532 -0.383989 -1.059025 0.106246 0.776211 -0.121660 0.733267 0.660849 0.544233 0.340705
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.113944 0.050363 2.098698 1.111461 -0.009736 -1.329059 -0.339200 -0.770679 0.673134 0.689285 0.377688
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.106123 1.163217 -0.568575 0.213534 -0.091147 0.780183 -0.019907 1.614786 0.677974 0.686484 0.384498
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.839284 0.442377 0.970204 -0.377819 4.612645 1.959081 1.054476 1.514573 0.669471 0.687237 0.378897
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 29.929878 0.206826 2.166085 0.286964 4.019833 0.502570 0.425424 -0.226775 0.507444 0.682168 0.376991
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.358153 2.746037 0.094640 1.770034 -0.252390 6.769960 4.522902 -0.334483 0.671338 0.688271 0.390648
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.104279 -1.421283 -1.630044 3.822621 1.398131 -0.004791 -0.685918 3.295093 0.672741 0.656721 0.395464
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.764936 -0.922505 -0.064348 -0.769593 1.687243 1.382046 -0.368562 1.481016 0.656451 0.673325 0.401018
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.656301 2.984396 -1.346425 -1.967194 0.901540 2.540822 -0.416351 20.018338 0.655293 0.654587 0.395622
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.278854 -0.580889 10.547130 -1.446037 8.609047 2.141862 1.242743 2.236382 0.036458 0.663506 0.527320
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.105804 -0.387151 1.776397 2.640332 0.212002 6.200521 0.207933 0.599352 0.626423 0.644221 0.397174
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.055117 11.157159 -0.502667 11.085874 1.750012 9.043441 19.714082 2.363967 0.651082 0.051785 0.532213
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.497539 -0.230922 -0.482639 0.009812 -0.419995 0.419434 -0.170899 5.155659 0.661752 0.673341 0.390637
182 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.219915 4.294336 -1.419838 3.363382 0.295711 2.926175 9.720552 -0.501958 0.671681 0.674946 0.386955
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.648793 0.161675 1.742049 5.702517 -0.137935 -0.894123 1.095593 0.027863 0.652523 0.628650 0.367170
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.222647 -0.794889 -0.411126 3.535291 0.004791 -1.319936 1.295196 0.726627 0.666403 0.662393 0.376597
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 19.173418 -1.423296 8.021305 4.545952 8.485399 -0.974729 0.232600 0.005645 0.387685 0.647627 0.402783
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.786922 -1.248707 -2.108272 -0.922805 1.714489 0.067686 0.690547 -0.332524 0.677768 0.691367 0.395712
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.091874 -0.705832 -1.906232 2.164079 -0.088521 2.136191 0.820351 15.144350 0.672463 0.671571 0.386067
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 8.871040 10.020157 9.772237 10.673347 8.851719 9.153113 0.763621 1.243136 0.028221 0.030618 0.001099
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.071790 1.634314 -1.116824 0.037562 -0.311327 -0.405406 -0.359558 -1.408907 0.649841 0.658027 0.403202
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.592351 0.359867 1.030697 -0.803820 0.370703 1.343830 10.397895 1.336388 0.632502 0.655899 0.413165
200 N18 RF_maintenance 100.00% 100.00% 31.95% 0.00% 11.294259 33.491073 3.962755 0.432488 8.881626 7.342048 1.907114 -0.182130 0.039516 0.226008 0.152844
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.273404 5.557104 2.951989 4.361248 3.102095 5.628047 -0.066664 -2.354099 0.649048 0.647001 0.385554
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.306988 0.499289 1.452494 -1.882427 0.366239 0.375549 -1.069535 23.737221 0.658187 0.650504 0.381543
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.779997 12.374050 3.713832 4.262245 8.821566 9.133588 2.678604 2.966962 0.033433 0.040990 0.001597
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.162249 2.460399 -0.326248 -0.797669 -1.271696 -0.673066 -0.362506 5.484925 0.647137 0.636432 0.380042
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.525191 0.975116 1.130831 -1.328996 13.453613 -1.503691 -0.287830 4.829714 0.651003 0.646986 0.383782
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.578153 2.818817 1.144177 -1.986927 0.351317 15.686571 -0.482446 -0.153455 0.634226 0.624183 0.368641
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.673554 10.802805 9.376540 11.789888 8.722264 10.176011 13.211378 84.829346 0.031969 0.029936 0.001634
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.604346 8.227609 9.293653 9.753225 9.022023 9.498960 13.919508 22.287678 0.037367 0.035173 0.001563
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 12.314207 5.804202 2.071802 3.743436 -0.740612 -1.313803 -0.327380 0.142420 0.629930 0.617042 0.398406
211 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 0.686061 4.100803 2.102058 3.354643 0.584099 3.732216 2.053653 -2.261719 0.614616 0.626832 0.403104
219 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.000793 4.842444 5.237638 3.650419 6.739067 3.860876 -3.176469 -2.705555 0.617307 0.647282 0.406002
220 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.349993 -1.344769 0.097223 -0.876639 -1.054630 -1.259319 5.000116 -1.236057 0.642564 0.647064 0.388219
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.916356 -0.549495 -1.368390 -1.184398 -0.058928 -1.348627 4.546517 -0.569829 0.630824 0.651242 0.390260
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.125778 -0.662408 -0.625259 -1.617249 0.065869 34.303905 2.249631 -0.019026 0.638971 0.642878 0.394419
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.790824 1.191161 -2.000441 -0.964054 -0.826076 45.713349 0.509832 18.994489 0.629737 0.603581 0.388869
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.374346 7.156159 5.483856 5.115180 6.896300 6.989520 -2.979704 -3.378631 0.624904 0.638021 0.385912
225 N19 RF_ok 100.00% 0.00% 98.43% 0.00% 4.879579 11.006162 3.885161 4.326760 3.547629 9.047106 -2.400226 0.749704 0.645587 0.083896 0.548965
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.106452 5.046081 3.454555 4.060095 2.926778 5.789704 -2.152176 -2.834765 0.644763 0.616090 0.388220
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 2.633227 4.391834 2.370640 3.366358 1.221075 3.426291 8.552883 -2.427779 0.621902 0.643298 0.386959
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.488922 8.610673 0.905546 3.048223 3.596652 5.587867 69.217393 33.304599 0.588837 0.525522 0.336121
229 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.849875 5.342410 4.068883 4.045669 3.942788 5.093845 2.491826 -2.856455 0.612904 0.632118 0.405318
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.660233 -0.158253 -0.510394 -2.058265 -0.113055 -0.616130 -0.516752 -0.810538 0.579485 0.625240 0.404667
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.487441 -0.688229 0.685782 0.029427 -0.649519 -0.101615 -1.364569 -1.641671 0.640447 0.647498 0.402185
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.839640 -1.659349 -0.438363 -0.510129 -1.121691 -0.469963 1.183677 1.015416 0.637313 0.648173 0.397620
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.251216 39.538771 2.726144 1.514204 4.802674 6.689370 7.512094 9.579887 0.507676 0.419607 0.259292
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.824025 4.782325 -1.319456 0.140144 -1.059658 -0.343851 6.587755 18.353376 0.628671 0.592898 0.396075
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 55.824915 1.427047 0.140523 1.132444 5.044591 -0.551491 44.091953 -0.007419 0.345581 0.653054 0.493347
243 N19 RF_ok 100.00% 5.51% 0.00% 0.00% 54.770087 2.387655 0.648660 -2.000648 6.038644 -0.604273 -0.533993 0.154240 0.291405 0.628594 0.481215
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.254714 0.028012 2.202091 -0.146793 4.254360 0.310951 1.558002 7.527685 0.432185 0.632285 0.444124
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 2.802262 0.868437 2.747984 0.052988 1.892810 -0.904153 -2.250190 -0.692381 0.625228 0.636591 0.403186
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.162264 5.290086 2.794015 3.289023 4.804386 6.819423 2.842880 -2.274359 0.331920 0.331501 0.165094
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 5.024572 4.162750 3.777739 2.875382 3.480733 2.252902 -1.808726 3.927600 0.617303 0.630852 0.399560
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.394073 8.065802 9.326384 9.968183 8.437331 8.582959 14.105777 18.065885 0.036565 0.028884 0.006774
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 9.302814 11.161941 5.270920 6.889828 4.003003 9.151831 13.900020 3.106771 0.356168 0.044193 0.279815
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.541638 2.300284 0.904392 1.362172 0.379897 0.314042 0.572012 -0.663064 0.509817 0.539073 0.384097
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.572158 -1.131797 1.026453 -1.784556 0.571435 -0.279130 -0.990693 0.479691 0.551104 0.548802 0.394292
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.034316 -0.971617 -1.481014 -1.384374 -1.259909 -0.554596 6.234349 1.059506 0.493238 0.547006 0.391875
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.063716 0.823220 -1.165706 -2.010737 -0.789532 -0.630509 1.063760 1.137384 0.478570 0.528072 0.382737
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 7, 8, 9, 10, 15, 16, 18, 19, 20, 21, 27, 28, 29, 30, 32, 34, 36, 37, 38, 40, 42, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 78, 80, 81, 82, 84, 86, 87, 90, 92, 94, 96, 97, 100, 101, 102, 103, 104, 107, 108, 109, 110, 111, 113, 114, 117, 119, 121, 122, 123, 126, 128, 129, 130, 131, 133, 135, 136, 138, 140, 142, 143, 145, 146, 155, 156, 158, 159, 161, 164, 165, 166, 169, 170, 179, 180, 181, 182, 183, 185, 187, 189, 191, 200, 201, 202, 203, 205, 206, 207, 208, 209, 210, 211, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 240, 241, 242, 243, 244, 246, 261, 262, 320, 329]

unflagged_ants: [5, 17, 22, 31, 35, 41, 43, 44, 45, 46, 48, 61, 62, 64, 65, 66, 67, 69, 70, 73, 74, 77, 79, 83, 85, 88, 89, 91, 93, 95, 98, 99, 105, 106, 112, 115, 116, 118, 120, 124, 125, 127, 132, 137, 139, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 167, 168, 184, 186, 190, 237, 238, 239, 245, 324, 325, 333]

golden_ants: [5, 17, 31, 41, 44, 45, 65, 66, 67, 69, 70, 83, 85, 88, 91, 93, 98, 99, 105, 106, 112, 116, 118, 124, 127, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 167, 168, 184, 186, 190]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459928.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.dev11+g87299d5
3.1.5.dev197+g9b7c3f4
In [ ]: