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 = "2459880"
data_path = "/mnt/sn1/2459880"
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: 10-27-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/2459880/zen.2459880.27113.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 1767 ant_metrics files matching glob /mnt/sn1/2459880/zen.2459880.?????.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/2459880/zen.2459880.?????.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 2459880
Date 10-27-2022
LST Range 22.341 -- 7.850 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1767
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 7
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 96
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 N20
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 67 / 201 (33.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 176 / 201 (87.6%)
Redcal Done? ❌
Never Flagged Antennas 25 / 201 (12.4%)
A Priori Good Antennas Flagged 75 / 96 total a priori good antennas:
7, 10, 15, 16, 17, 19, 20, 21, 29, 30, 31,
37, 38, 42, 44, 45, 51, 53, 54, 55, 56, 59,
66, 67, 68, 71, 72, 81, 84, 86, 88, 91, 93,
94, 98, 101, 103, 106, 107, 108, 109, 111,
117, 121, 122, 123, 127, 128, 136, 140, 141,
142, 143, 144, 146, 147, 158, 160, 161, 162,
164, 165, 167, 169, 170, 181, 183, 184, 185,
186, 187, 189, 190, 191, 202
A Priori Bad Antennas Not Flagged 4 / 105 total a priori bad antennas:
89, 125, 137, 168
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_2459880.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 0.00% 0.00% 0.00% 0.00% -1.363853 -0.864372 -0.800806 0.062770 -0.768998 -0.387564 0.168094 3.018708 0.681280 0.675665 0.407326
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.734280 3.754454 3.286274 -0.283252 -0.068523 0.650949 5.880192 0.820305 0.679077 0.673229 0.398808
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.390555 0.263941 -0.749304 2.174374 -0.351422 1.079983 3.034936 -0.807768 0.683176 0.677863 0.395907
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.944290 -1.926712 0.700569 0.537543 -0.167915 0.274897 7.350503 16.669169 0.676472 0.675896 0.393903
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.812426 -0.959810 0.448612 0.393299 -0.393868 -0.281781 7.045885 1.724783 0.667596 0.667854 0.385916
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.012659 -1.412695 0.995032 0.496823 0.620328 -0.551896 0.036539 1.150121 0.671499 0.669803 0.397263
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.616758 -0.726270 5.621916 7.013757 0.947279 2.323968 2.853761 0.174952 0.662702 0.668001 0.403588
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 1.212437 0.677420 2.058761 -0.531304 -0.220949 -0.352524 10.657137 12.915845 0.679531 0.682634 0.396884
16 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.481465 -0.607942 -0.184410 -0.776626 1.237457 1.386838 7.573995 3.683924 0.680587 0.682626 0.391196
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.218531 1.337899 0.086089 0.461138 0.922431 0.093256 12.327205 4.558358 0.683579 0.685676 0.391719
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.383165 15.920550 1.751866 1.330299 1.428642 4.453410 22.595169 41.656396 0.665401 0.462523 0.477990
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.377051 0.215463 -0.265860 23.707320 1.111315 17.838541 7.291233 9.992997 0.679064 0.653995 0.400856
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.640610 4.346902 -0.005445 17.426412 -0.123916 1.449083 8.412850 0.681990 0.681902 0.674533 0.392790
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.424762 1.783159 -0.563941 9.052931 1.334271 4.031079 1.536385 35.965852 0.668376 0.659364 0.393863
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% 44.466454 9.866167 5.511566 17.866883 6.991047 7.886548 18.208711 43.339092 0.454760 0.606423 0.308086
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 16.660850 18.182261 59.085587 59.295204 6.828102 9.210042 3.509144 2.133976 0.032143 0.036347 0.004360
28 N01 RF_maintenance 100.00% 0.00% 85.00% 0.00% 20.250545 39.953143 7.771610 4.758232 5.697517 11.265247 6.736775 22.782630 0.354403 0.157736 0.258129
29 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -1.696441 -0.236383 -1.001380 0.369927 -0.526118 -0.369279 0.190232 7.748925 0.685755 0.683028 0.388788
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.735950 -1.147714 3.042534 -0.926853 1.204395 -0.547540 11.359151 0.366649 0.685861 0.688722 0.387058
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.171829 1.737660 1.641851 -0.149090 -0.660849 2.402565 4.841661 6.603957 0.695983 0.686111 0.395267
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.881740 26.739937 3.447844 4.736612 7.585586 8.795996 7.060306 160.239283 0.640519 0.618569 0.346488
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 19.110678 3.980410 25.323018 19.587887 6.762691 3.160096 1.595500 -1.128266 0.041977 0.661225 0.515741
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 7.482583 1.733425 42.669509 12.439530 4.364339 2.224541 -3.201116 0.550993 0.649273 0.641456 0.395815
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.972001 11.770929 1.036755 0.695105 0.147453 0.593612 1.056692 4.896971 0.679195 0.683105 0.398393
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.760957 1.149496 3.619318 4.408374 0.903052 -0.064163 0.194171 12.780076 0.685279 0.690206 0.401101
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.391128 0.397528 -0.086930 -0.649539 0.610395 0.080415 6.268017 2.154522 0.689230 0.695574 0.399691
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.170511 0.536726 -0.518504 -0.644852 0.307406 -0.882725 -0.742702 -0.674475 0.683019 0.687202 0.389005
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.080627 0.909647 1.869197 1.168662 1.998576 -1.050007 -0.509575 0.757328 0.687875 0.686439 0.380620
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 300.310503 301.447720 inf inf 4771.934138 4735.676671 9621.468163 9518.080319 nan nan nan
43 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 15.687810 3.621372 58.451853 -0.199054 6.810721 0.818164 2.945437 14.960894 0.040301 0.691439 0.509376
44 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 6.126678 4.161167 0.744397 3.620989 4.510454 1.785858 99.764165 31.136366 0.672794 0.686077 0.371043
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -0.939470 4.804063 0.019822 -0.157541 0.226128 3.756219 0.469948 16.914636 0.687420 0.674050 0.381827
46 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.805185 18.859672 -0.870867 59.525384 -0.222905 9.213397 4.558441 3.331556 0.680896 0.037020 0.505487
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 17.979875 3.772170 24.213271 13.340641 6.757178 1.405404 1.464986 4.689494 0.036980 0.658777 0.499137
48 N06 not_connected 100.00% 0.00% 0.00% 0.00% 3.052808 3.690008 24.993884 30.220122 1.450163 2.259403 1.141029 -1.800242 0.654553 0.669565 0.401244
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 2.057528 3.123289 11.907340 29.230237 1.179015 2.692326 1.480832 0.038539 0.625505 0.656110 0.396651
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.585484 17.016282 -0.164070 3.413317 2.698877 8.703513 39.472363 71.978105 0.666525 0.633639 0.377188
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 36.308980 1.630167 75.730728 0.584023 6.910022 3.243031 11.957449 11.316204 0.039879 0.693974 0.561380
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.133594 9.844373 0.641898 0.465154 1.514578 -0.648154 1.095810 0.248676 0.692048 0.699758 0.390241
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.734790 4.090924 -0.501002 0.821765 -0.195232 0.626837 5.868429 7.410762 0.695111 0.703848 0.392935
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 3.809419 20.271656 2.242431 60.145959 8.580576 9.184677 18.715730 3.222768 0.684071 0.034074 0.509981
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.039457 0.815788 1.331232 0.371596 0.105768 1.069937 1.841332 16.519739 0.691027 0.697267 0.375717
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 49.841228 1.505108 23.800854 -0.299972 3.963796 0.084788 2.743717 1.479996 0.521405 0.699248 0.381440
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 16.172326 18.916406 58.831361 60.426986 6.775586 9.270054 3.646926 2.830402 0.035987 0.033441 0.001613
59 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 16.981138 8.616047 4.543848 0.287735 7.111432 0.858117 140.727773 51.032544 0.654458 0.681671 0.375346
60 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 17.434158 18.567932 58.992775 60.292734 6.793753 9.244510 2.854635 3.574993 0.027355 0.026963 0.001423
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 5.658010 5.102412 4.745531 0.215246 2.339933 2.430274 -0.388819 3.667196 0.640015 0.636069 0.379797
62 N06 not_connected 100.00% 0.00% 0.00% 0.00% 2.010346 3.736812 20.060161 28.643999 0.941918 3.557887 1.196150 -1.323408 0.662781 0.674597 0.390200
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 13.494253 19.105018 19.873880 25.107032 1.878354 9.196790 0.707349 3.413647 0.602977 0.041918 0.445011
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 3.170418 2.122294 12.394753 23.704844 0.618385 1.740699 2.440894 -0.906579 0.611676 0.640534 0.395458
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.989842 1.507690 1.640641 1.854464 1.362319 0.518286 0.425852 0.375421 0.671455 0.688500 0.405126
66 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.070960 2.308395 12.058290 7.803140 3.124432 -0.044326 0.114794 1.619186 0.675704 0.691438 0.396120
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.966417 -0.429752 7.586932 3.759014 -0.155527 -0.314081 1.204264 3.651049 0.680875 0.694960 0.388556
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 2.985717 40.149427 2.205973 80.394966 -0.342219 8.941357 6.171525 12.213048 0.684182 0.030985 0.534975
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.328815 -0.837173 0.798551 -0.096327 1.087811 1.005742 -0.263333 -0.222647 0.689398 0.703300 0.381939
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.882389 -0.409999 0.907503 2.075495 1.159494 0.621316 1.099093 2.903381 0.695157 0.707030 0.380683
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 10.181190 -0.254598 3.234600 2.593897 0.298490 -0.028986 4.019427 1.539271 0.703825 0.705938 0.379579
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 353.131111 352.990169 inf inf 5392.510412 5354.016619 11706.552932 11502.567929 nan nan nan
73 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 15.513260 17.434641 58.082459 58.544125 6.837621 9.208891 3.772861 1.027677 0.027044 0.027075 0.001216
74 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 17.216330 15.427453 60.734973 58.023412 6.779325 8.238752 3.568189 32.479072 0.030152 0.338889 0.231148
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 34.890008 36.897369 20.789323 16.942011 3.205517 5.462152 15.424116 8.252871 0.543714 0.516737 0.189052
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 48.671705 1.059893 15.401753 20.736293 4.176932 1.097523 3.557934 0.271460 0.474109 0.655477 0.372147
79 N11 not_connected 100.00% 0.00% 0.00% 0.00% 4.491047 5.500322 36.832006 38.278449 2.988116 4.996344 -1.736557 -2.912429 0.652846 0.668691 0.398785
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 14.905261 20.794106 34.349076 24.386272 6.024373 9.221975 17.606371 1.548334 0.301055 0.038844 0.200084
81 N07 digital_ok 100.00% 0.00% 0.00% 0.00% -0.169641 0.224351 -0.446829 19.872624 0.004060 29.526065 -0.018904 0.829963 0.649606 0.632225 0.391285
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.185374 0.136486 0.220681 7.782270 0.196165 0.419189 0.119803 -0.603627 0.661871 0.675469 0.390832
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.534990 -0.467431 -0.876647 0.292726 -0.923958 -0.657831 -0.764915 0.325112 0.675773 0.689923 0.385639
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 2.737696 35.683610 32.907289 77.758859 0.293599 8.868758 24.811470 6.081454 0.650417 0.035635 0.432639
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.429698 0.464917 0.129295 -0.532981 -0.996587 -0.099495 -0.674507 -0.714235 0.684535 0.695303 0.384083
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.477483 8.295576 6.195641 2.630699 6.922714 0.952348 2.498204 23.843577 0.673744 0.671533 0.367844
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.163153 11.342578 4.792084 1.344464 17.170192 0.711236 27.112994 3.682769 0.641722 0.716180 0.357294
88 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 2.315020 0.601707 1.179396 1.306625 -0.436916 2.138838 16.458250 5.231961 0.687260 0.699769 0.371896
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.448520 -0.049183 -0.399908 0.580517 0.570686 -0.551866 -0.843689 -0.993281 0.693846 0.700417 0.378732
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.534601 -0.299456 0.605403 2.252028 -0.634824 -0.325281 1.284134 5.845359 0.691735 0.697143 0.377657
91 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.407226 -0.625253 0.538263 -0.012017 -0.565536 -0.486033 7.773794 1.147845 0.687261 0.704164 0.389265
92 N10 RF_maintenance 100.00% 0.00% 16.69% 0.00% 56.219960 64.041202 7.028716 8.470299 7.074045 9.614169 1.172320 6.462109 0.290537 0.244817 0.091215
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 3.677534 0.280068 11.411772 -0.202031 0.491868 -0.127213 5.302936 -0.205583 0.675767 0.694011 0.391632
94 N10 digital_ok 100.00% 0.00% 0.00% 0.00% -0.791356 -1.546545 1.905723 0.989439 3.444933 1.870229 9.527398 4.463989 0.680104 0.686259 0.395797
95 N11 not_connected 100.00% 0.00% 0.00% 99.66% 7.299539 6.642049 42.541963 42.480060 4.094876 7.694820 -2.440581 -2.200268 0.264622 0.266053 -0.306808
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 18.376234 20.278631 24.191615 25.456623 6.719644 9.262487 1.652108 0.787989 0.032972 0.040017 0.004710
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% 6.147858 5.987109 40.745759 2.452918 3.874963 0.422763 -3.226185 14.128993 0.633756 0.617626 0.396847
98 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 2.002771 15.941629 -0.500849 1.186130 0.377132 4.744249 1.514413 7.453283 0.648717 0.655341 0.380040
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 1.398862 -1.076499 1.372871 0.800117 -0.599075 3.843609 1.804353 -1.136781 0.653570 0.673796 0.392083
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.457411 -1.126635 1.929831 -0.676450 1.076278 -0.691150 0.864385 0.606263 0.667428 0.681619 0.386824
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 10.887662 13.255404 2.045142 2.165572 -0.492855 0.348928 1.387084 0.925647 0.690610 0.700070 0.383707
102 N08 RF_maintenance 100.00% 89.93% 100.00% 0.00% 18.335648 19.001769 53.797421 57.134287 7.531521 9.286342 1.446521 5.833773 0.140793 0.038978 0.066926
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 34.870620 36.552966 67.806127 68.827082 6.838999 9.196188 11.417617 10.524178 0.026023 0.028693 0.002737
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.298081 86.696726 37.904257 39.763199 2.502460 5.025400 0.085375 -0.242129 0.645737 0.678230 0.380121
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.055733 -0.374514 -0.431906 0.967274 -0.109016 0.189474 -0.217047 -0.625235 0.694393 0.701974 0.370523
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.204394 0.944047 5.616752 2.320152 3.364677 1.264758 0.053406 0.108950 0.683431 0.697955 0.370939
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 6.260719 2.745726 1.267539 1.175863 0.473472 0.423704 14.963868 10.098324 0.689557 0.701565 0.369227
108 N09 digital_ok 100.00% 59.76% 0.00% 0.00% 15.933883 4.010776 57.842307 0.672534 6.449413 -0.107202 2.317960 2.023700 0.196385 0.704454 0.490684
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.405919 18.750419 2.623720 58.567702 -0.434782 9.211982 4.582235 2.170671 0.691410 0.034648 0.466209
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.809773 37.939504 -0.423820 78.695262 -0.430008 8.899922 4.449238 5.435044 0.698924 0.032409 0.467440
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.122105 18.494135 1.767403 59.190320 -0.843787 9.199464 6.668207 2.812066 0.682660 0.034794 0.460874
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.012659 -0.203270 -0.497356 1.640550 -0.341917 1.597881 0.789360 -0.765736 0.671177 0.688698 0.400953
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 19.536657 20.304672 22.869125 24.812129 6.747240 9.260832 2.772488 1.127504 0.037504 0.031580 0.003764
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 12.720885 7.267264 12.696190 40.425812 4.318995 5.782322 2.003176 -2.926219 0.483128 0.653710 0.439747
115 N11 not_connected 100.00% 0.00% 0.00% 0.00% 4.055816 11.406941 34.351055 32.636067 2.381791 4.404164 -2.384570 -0.835142 0.634409 0.602953 0.398464
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.704203 1.018878 0.868191 -0.383084 1.757077 0.652859 -0.334013 -0.452240 0.643578 0.660053 0.393684
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 18.113901 20.856728 59.348550 62.207994 6.735442 9.224108 2.089368 4.447404 0.027432 0.030600 0.002011
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.613017 1.420072 -0.537006 1.236120 1.163729 1.328118 2.663299 2.589226 0.669915 0.687697 0.390192
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.317233 3.845576 7.448199 18.983811 -0.599688 7.875490 0.946311 3.097172 0.683004 0.653263 0.388823
120 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 24.222787 35.799630 28.363434 77.328737 5.534447 9.020083 -1.123919 11.135031 0.342216 0.037307 0.209491
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.434078 7.456748 -0.179884 0.803633 0.539252 -0.469506 50.073141 22.564905 0.691087 0.705713 0.384449
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 11.323024 10.282431 8.485894 1.146785 10.536349 -0.125837 2.794140 -1.008458 0.696896 0.709291 0.384958
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.745329 12.722402 1.814110 1.899657 -0.623335 -0.580956 -0.082026 0.837271 0.700457 0.709540 0.379189
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.842484 2.976087 -0.462309 -0.218160 -0.176656 -0.554370 1.167665 0.256724 0.701676 0.705187 0.376525
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.790005 0.063180 -0.689792 0.692015 -0.254916 1.747267 -0.036539 0.282445 0.688807 0.698602 0.372162
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 22.882742 0.685883 3.599631 1.429392 10.685592 -0.146483 174.351079 -0.079354 0.635897 0.698533 0.377421
127 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.140933 -0.222920 -0.685683 -0.078655 1.776283 0.532165 2.320551 8.057710 0.696221 0.706928 0.388658
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% -0.712344 0.146821 7.906866 2.421409 0.362639 1.682904 -0.052252 -0.195780 0.687070 0.701137 0.387298
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.809261 -1.796965 -0.446137 -0.457880 -0.457796 -0.801015 -0.528522 -0.382124 0.684866 0.697423 0.395205
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 3.002060 0.647602 -0.409159 -0.075745 -0.270842 0.099495 1.515015 3.382533 0.663459 0.687115 0.395144
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 18.188802 20.421482 24.408560 26.229431 6.772598 9.188550 4.024586 -0.370934 0.033815 0.038132 0.001753
132 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.839062 1.172113 40.229308 30.695167 4.270136 2.859783 -1.732473 -1.794682 0.638072 0.664215 0.413215
133 N11 not_connected 100.00% 100.00% 83.64% 0.00% 18.868413 25.854273 22.896825 17.115160 6.760859 8.866771 2.148870 0.997261 0.039870 0.174038 0.101740
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -1.678228 18.712098 0.083402 60.612262 -0.132714 9.258367 0.386411 1.533876 0.641285 0.038906 0.474855
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 6.146364 1.317244 1.215459 2.342071 0.595671 4.229366 -0.086381 -0.203100 0.631732 0.660070 0.394678
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.557650 -1.529285 -0.115346 -0.960098 2.881349 1.549632 1.195225 0.165182 0.650157 0.670282 0.395508
138 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.457101 -0.567573 0.256174 2.089030 -0.906526 -0.589410 7.492797 0.339005 0.671713 0.685817 0.398037
139 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.570058 4.330927 43.768277 38.030318 4.476612 4.461798 -3.322607 -2.126402 0.665580 0.687360 0.392752
140 N13 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
141 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 352.866880 352.693774 inf inf 4477.750205 4467.500008 8632.907232 8701.663120 nan nan nan
142 N13 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
143 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 17.011519 -1.311261 59.723692 -0.589511 6.717982 1.329468 0.549224 -0.969176 0.037581 0.709335 0.564938
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -1.371704 -0.726974 -0.372224 12.186318 0.214520 -0.512819 -0.268620 1.608855 0.697296 0.697387 0.380012
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.848651 4.267133 -0.975560 39.118765 2.509567 23.166445 0.096937 0.955477 0.694510 0.613203 0.410716
146 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.721808 8.437421 17.791784 44.378717 2.158732 6.506531 -0.321799 -3.877408 0.682614 0.692688 0.384230
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.812643 -0.608414 6.146614 9.295474 2.003099 -0.827193 0.277769 -0.293550 0.686340 0.694152 0.380577
148 N15 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.767543 -0.595580 18.190426 6.908854 0.739939 1.278693 -0.048008 -0.628645 0.670576 0.696699 0.394944
149 N15 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.535227 2.454154 11.692952 33.000752 -0.578053 3.403326 -0.695427 -2.323177 0.684093 0.695710 0.397232
150 N15 RF_maintenance 100.00% 100.00% 0.62% 0.00% 17.782749 5.238399 59.038129 39.851675 6.783216 6.252713 3.085430 -2.739817 0.049801 0.289075 0.141069
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 16.251488 -0.672356 57.019893 0.697701 6.776475 7.579019 1.118801 3.271431 0.063453 0.661861 0.536271
156 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.927946 -0.314634 53.529188 2.127636 4.768300 0.251073 1.854204 0.331204 0.385448 0.669973 0.484143
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.292767 -0.453741 0.658725 -0.062770 -0.858220 -0.142533 -0.128751 -0.658870 0.657278 0.673922 0.400759
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.190264 -0.728216 1.308323 4.442685 1.939319 1.632706 8.141127 27.105744 0.671613 0.686259 0.405529
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.950771 35.020742 30.938884 27.218199 1.977666 6.887256 -1.741270 15.800915 0.667997 0.540496 0.374738
160 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.095931 -1.204639 0.925676 5.367018 -0.881977 1.469714 1.572155 1.076992 0.680027 0.693823 0.384327
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.540070 41.630177 -0.611207 7.816576 -0.686195 3.009770 0.328461 1.866332 0.682456 0.570413 0.348104
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.838177 0.736260 6.546745 10.095632 5.239274 4.079101 2.478847 4.846923 0.694866 0.705479 0.380596
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.701379 0.223676 0.366663 -0.754618 -1.056779 -0.303388 -0.110576 1.048622 0.697163 0.702578 0.385671
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.328971 -0.024465 6.659570 3.063617 10.071728 1.413172 1.112292 1.434099 0.689279 0.705077 0.380751
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 27.817404 -0.116817 43.939970 3.352253 5.120547 -0.867215 -0.064081 -0.795175 0.415721 0.702400 0.428955
166 N14 RF_maintenance 100.00% 0.00% 94.85% 0.00% 44.874691 17.337601 10.662992 57.473254 3.877153 9.108228 17.222213 0.666766 0.545328 0.100003 0.390496
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.850191 -1.270342 13.310935 2.665420 0.567274 0.462172 -0.796855 4.226019 0.702304 0.699984 0.389561
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.975436 -1.355900 -0.672531 1.937745 0.861126 0.120174 -0.526583 -0.344610 0.689841 0.701594 0.390093
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 2.842031 7.124599 29.816115 37.108229 1.355971 7.638929 -1.290513 1.578212 0.687025 0.647588 0.395042
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 17.779059 -0.817391 60.085789 9.699587 6.729623 11.221828 1.541126 0.619059 0.041780 0.693255 0.584769
179 N12 RF_maintenance 100.00% 100.00% 99.94% 0.00% 18.042368 20.369555 60.104576 63.189713 6.701717 9.299377 1.153063 1.480209 0.054582 0.067020 0.015931
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 17.174275 19.553019 59.578013 60.999141 6.735544 9.260899 1.101250 3.034640 0.047944 0.050462 0.003966
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.242178 -1.177242 0.201113 -0.652281 -0.462062 1.229411 -0.279900 6.439926 0.689660 0.694071 0.386918
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.445298 6.607908 33.521651 41.794873 0.638395 5.452978 6.489922 -1.542584 0.634645 0.690227 0.398403
183 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 17.097735 -0.344619 54.945942 4.482480 6.767072 -0.680252 0.149191 -0.243908 0.044511 0.693644 0.526367
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 16.803200 19.141011 59.376410 60.284428 6.747673 9.167566 1.215459 1.248384 0.103295 0.053315 0.047316
185 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 15.975122 -1.250567 59.248109 17.625767 6.745651 -0.241642 0.783212 -0.800494 0.035670 0.683204 0.509481
186 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 1.489739 1.962043 18.267875 12.074230 11.204816 0.604954 3.545624 1.785486 0.675950 0.703703 0.388128
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 4.601608 2.412802 7.879326 29.641029 29.363097 3.252578 1.138644 4.688553 0.684957 0.701001 0.386666
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 1.748805 2.820707 6.210840 3.285874 -0.197262 2.478399 1.801486 0.791002 0.668128 0.687004 0.396400
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 61.462851 18.901103 7.497852 60.799947 4.809903 9.292535 57.962336 3.502125 0.496572 0.035216 0.377192
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 0.148996 0.740284 21.892033 0.628517 0.238005 -0.802545 17.169414 0.176359 0.639800 0.675393 0.423989
200 N18 RF_maintenance 100.00% 100.00% 53.37% 0.00% 19.132579 52.357246 24.023714 23.565961 6.816050 9.493257 2.554154 -1.037436 0.046238 0.214835 0.146489
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.630299 9.463646 49.456092 47.726960 5.774835 7.395466 -4.175964 -4.039477 0.642417 0.655079 0.383301
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 2.595438 4.653529 23.478140 2.362027 0.821397 3.034405 1.860698 3.214985 0.671366 0.640627 0.389622
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 19.858533 21.455289 22.616849 23.501759 6.773679 9.170722 3.130184 3.954394 0.032645 0.041389 0.002323
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.969680 7.269046 19.575601 6.837281 0.306174 2.778945 1.148070 5.042211 0.671172 0.603605 0.414405
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.336705 3.090963 21.700899 16.049659 17.797726 1.247085 4.461170 6.538424 0.666834 0.660331 0.382502
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.966361 4.554287 27.673543 22.361684 1.704452 3.074422 -0.274473 -1.264628 0.652481 0.654584 0.370935
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% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
211 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
219 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.950872 6.974951 49.490819 42.736482 5.907650 6.146781 -4.116949 -3.548999 0.614193 0.663006 0.405203
220 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.069541 7.417709 41.196126 42.506982 3.868215 6.006604 -0.815130 -3.673911 0.667542 0.667945 0.395609
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 4.696097 1.966949 2.148304 18.970240 1.944338 0.852665 3.477923 -0.023668 0.631961 0.667342 0.397255
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 7.380711 8.239279 42.996633 43.058508 4.394388 5.981307 0.886716 -3.253693 0.662457 0.667696 0.393166
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.844028 3.417368 10.059686 20.147360 1.056169 19.586060 3.129142 5.157858 0.640844 0.667476 0.389691
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 10.713082 10.145152 50.624877 50.741850 5.937598 8.377627 -4.019065 -4.569759 0.650822 0.649706 0.387822
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
227 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
228 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
229 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 5.165854 3.713378 0.966274 14.321800 1.411855 1.537775 0.272852 -0.557434 0.611090 0.641898 0.405564
238 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 1.523695 0.645866 26.330867 26.225967 1.381568 3.268067 -0.767669 -1.427460 0.666256 0.663801 0.403408
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.936151 4.189993 18.044090 35.238096 4.009928 5.866378 1.322495 9.731173 0.661406 0.665705 0.397882
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.352704 6.751781 14.779073 0.046435 0.400563 1.710809 9.130565 30.228088 0.653526 0.609593 0.409031
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 41.287751 4.083183 21.308704 32.201897 10.487072 2.760293 14.484331 -1.613574 0.500284 0.663790 0.405928
243 N19 RF_ok 100.00% 2.49% 0.00% 0.00% 86.427920 4.460188 18.875874 13.135513 6.289404 1.887982 -1.323183 -0.340150 0.299754 0.643616 0.514964
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
245 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
246 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
261 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 0.968909 19.561007 0.704499 38.025077 0.264261 9.212256 17.291445 3.514052 0.660753 0.047556 0.545454
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 2.566578 4.573827 26.293900 31.330189 1.482886 2.825911 6.538091 2.631766 0.568127 0.568281 0.395999
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 1.311536 -0.632663 26.939180 13.942649 1.326013 0.907578 -1.357674 -0.164448 0.603157 0.583554 0.405040
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.095122 -0.086035 3.566098 19.847070 0.410320 1.236627 8.625461 0.992294 0.524146 0.579077 0.406454
333 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.233564 2.589771 3.883618 12.987235 0.678143 2.041605 1.502418 2.105667 0.530686 0.561947 0.397250
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [4, 7, 8, 10, 15, 16, 17, 18, 19, 20, 21, 22, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 71, 72, 73, 74, 77, 78, 79, 80, 81, 82, 84, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 101, 102, 103, 104, 106, 107, 108, 109, 110, 111, 113, 114, 115, 117, 119, 120, 121, 122, 123, 126, 127, 128, 131, 132, 133, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 155, 156, 158, 159, 160, 161, 162, 164, 165, 166, 167, 169, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 202, 203, 205, 206, 207, 208, 209, 210, 211, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 324, 325, 329, 333]

unflagged_ants: [3, 5, 9, 40, 41, 65, 69, 70, 83, 85, 89, 99, 100, 105, 112, 116, 118, 124, 125, 129, 130, 137, 157, 163, 168]

golden_ants: [3, 5, 9, 40, 41, 65, 69, 70, 83, 85, 99, 100, 105, 112, 116, 118, 124, 129, 130, 157, 163]
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_2459880.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.4.dev44+g3962204
3.1.5.dev171+gc8e6162
In [ ]: