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 = "2459887"
data_path = "/mnt/sn1/2459887"
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: 11-3-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/2459887/zen.2459887.25247.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1851 ant_metrics files matching glob /mnt/sn1/2459887/zen.2459887.?????.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/2459887/zen.2459887.?????.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 2459887
Date 11-3-2022
LST Range 22.352 -- 8.314 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
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 62 / 201 (30.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 127 / 201 (63.2%)
Redcal Done? ❌
Never Flagged Antennas 74 / 201 (36.8%)
A Priori Good Antennas Flagged 56 / 96 total a priori good antennas:
3, 7, 15, 16, 17, 19, 29, 31, 37, 44, 51, 53,
54, 55, 56, 59, 68, 71, 72, 81, 84, 86, 88,
94, 101, 103, 107, 108, 109, 111, 117, 121,
122, 123, 127, 136, 140, 142, 143, 144, 158,
161, 162, 164, 165, 169, 170, 181, 183, 184,
185, 186, 187, 189, 190, 191
A Priori Bad Antennas Not Flagged 34 / 105 total a priori bad antennas:
8, 43, 48, 49, 58, 61, 62, 64, 74, 82, 89,
90, 95, 102, 115, 120, 125, 126, 132, 137,
138, 139, 148, 149, 168, 207, 220, 221, 222,
238, 239, 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_2459887.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% 10.719506 -0.530051 12.046937 0.089358 7.394188 0.764442 0.823623 1.394651 0.034275 0.672143 0.547523
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.144060 1.828982 4.351309 2.813506 -1.284910 0.155118 5.196702 1.614534 0.662704 0.661358 0.395627
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.105587 0.023977 -0.315108 -0.832076 0.279240 0.787856 0.437998 -0.014785 0.685561 0.674157 0.396202
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.807786 -0.892519 0.147122 -0.381166 0.250123 2.228109 8.417034 8.785600 0.678926 0.674309 0.393310
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.523776 -1.478264 -0.630097 -0.395199 -0.816566 0.506677 2.318422 0.654613 0.670344 0.667784 0.384640
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.019539 -0.300295 0.240656 0.304241 0.184647 0.995307 0.701609 1.819509 0.670882 0.666853 0.395499
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.798238 -0.755100 -2.332144 -1.960632 1.205839 0.682491 1.575647 0.085105 0.667437 0.666365 0.402277
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.904123 -0.200520 0.404126 -0.120472 0.025407 0.698744 5.166027 2.925231 0.682556 0.679526 0.396679
16 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.863381 -1.644480 -0.706331 -0.100760 -0.307157 0.386793 8.766207 3.834170 0.683893 0.680179 0.389771
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.432373 0.666426 -0.055820 -0.353578 1.109593 0.478220 8.523576 5.159808 0.687512 0.683316 0.393206
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.832002 15.228359 -0.658892 -0.113291 1.576008 3.399566 16.228729 28.366371 0.658176 0.454561 0.469130
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.665552 -1.088206 -1.674869 -0.985309 9.822370 -0.043154 7.057516 -0.107459 0.682418 0.689895 0.390330
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.444217 -1.028163 -0.468265 -1.431430 1.871316 -0.964262 2.956012 -0.717398 0.682802 0.688849 0.392979
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.372215 0.389816 -0.254237 -0.067638 1.019382 -0.878914 0.203056 -0.101030 0.666624 0.663670 0.392167
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% 30.974190 10.064657 -0.684028 -1.590993 4.367778 2.777617 8.970812 13.544773 0.454763 0.606732 0.315256
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.795751 12.113581 12.092436 12.310925 7.440636 10.308091 2.343958 1.879501 0.033852 0.038607 0.004796
28 N01 RF_maintenance 100.00% 0.00% 86.22% 0.00% 13.475650 28.003505 1.543115 0.597048 4.744020 11.405001 2.635795 18.286343 0.363242 0.158086 0.263390
29 N01 digital_ok 100.00% 0.00% 100.00% 0.00% -1.097165 12.583962 -0.357836 11.833321 -0.005634 10.280584 -0.244336 0.468294 0.691886 0.037097 0.586424
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.075579 -0.378873 -1.728261 -0.015674 0.813575 -0.444774 3.436018 -0.002557 0.691479 0.688479 0.380878
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.282155 -1.141068 3.083906 0.506776 1.656752 1.732900 1.865904 5.516536 0.694563 0.689097 0.383865
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.867956 23.247597 1.076472 -0.464892 15.095786 5.861124 74.299131 20.943250 0.614447 0.594507 0.298429
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 12.599547 1.229544 5.303834 -1.546814 7.409140 1.705912 0.883690 6.247168 0.043394 0.654999 0.493019
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.949203 0.344634 -1.458725 -2.068695 54.668323 -1.807671 2.787224 0.981394 0.617113 0.640009 0.401224
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.175553 7.905466 0.063993 -0.131726 1.262207 2.096212 0.411087 2.385333 0.676506 0.677589 0.394587
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.023284 0.094275 -2.254165 0.277170 0.304311 1.586009 -0.258404 7.868074 0.687564 0.688433 0.400396
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.001115 0.183361 0.018996 0.153432 1.175618 1.247372 3.691198 1.828193 0.689454 0.693101 0.399389
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.021713 0.517461 -0.055243 0.059142 -0.168133 0.505681 -0.135878 0.332963 0.686486 0.686364 0.387499
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.300296 0.199734 -0.989811 -0.479865 0.246357 0.138738 0.315095 1.214041 0.692290 0.687808 0.376056
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.047326 0.917995 -0.150061 0.538654 0.791347 0.418452 0.489157 0.140882 0.702414 0.691936 0.388747
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.019147 -0.367269 3.169879 -1.915521 3.418435 0.151211 -2.422926 0.155209 0.694356 0.700471 0.382088
44 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.802424 1.919630 0.255518 -0.267513 0.525201 0.514759 22.242869 19.096329 0.687381 0.689652 0.370616
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.589017 0.507355 0.066459 -0.198505 -0.151071 -0.567884 0.002688 2.537659 0.693045 0.685344 0.380291
46 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 35.546524 12.685096 0.701128 12.362105 5.827092 10.381047 2.338155 3.326476 0.310275 0.037554 0.199785
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 11.695452 1.840795 5.076218 -2.269014 7.417801 -1.612776 1.261555 2.667164 0.039546 0.654361 0.482992
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.772225 2.030771 0.355732 1.105320 -1.808358 -0.596811 -0.702109 -1.285766 0.653911 0.661776 0.393213
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.039314 0.656920 -2.249227 0.968109 -1.902144 -0.921067 0.097955 -0.885189 0.623991 0.652024 0.395286
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.904215 18.152015 0.025813 0.911611 2.080706 10.612386 15.202345 58.628769 0.668058 0.617340 0.372844
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 25.596456 0.805720 15.461721 4.381873 7.559629 0.373951 9.454770 7.765375 0.037259 0.678557 0.527956
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.425873 6.764834 -0.276700 -0.004366 0.658631 1.491139 0.590248 0.505442 0.691077 0.698000 0.388976
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.210989 2.523208 -0.437924 -0.550166 1.592995 1.044072 2.341624 6.495000 0.696867 0.701861 0.390172
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.832612 12.886756 12.094975 12.598049 7.460979 10.309105 2.117236 1.256363 0.045879 0.045300 0.001197
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.473169 13.641036 0.681223 12.488940 2.275363 10.330090 0.839364 3.269241 0.689923 0.035407 0.520828
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.099555 13.708741 0.319271 12.725880 -0.228088 10.324919 1.653992 1.402360 0.696756 0.038660 0.538714
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 31.175085 -0.343297 6.825618 0.815885 7.681252 0.666011 2.054997 2.420950 0.514570 0.703077 0.378032
58 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.267323 1.776635 2.428741 2.893015 2.828234 2.480612 -1.406294 -1.477814 0.692383 0.699858 0.372148
59 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 2.165427 5.504470 -0.696093 0.934210 4.083241 1.133015 39.911209 32.256004 0.686351 0.681015 0.368348
60 N05 RF_maintenance 100.00% 0.00% 98.81% 0.00% 3.277547 12.769726 3.587813 12.473242 2.595366 10.237000 -2.496924 2.700764 0.685235 0.081017 0.526439
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.945648 2.447119 -1.181495 -0.239171 -0.900714 -2.261390 -0.579880 2.819560 0.638254 0.636290 0.378338
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.083580 1.276171 -0.638743 0.895087 -1.823573 -0.500179 0.505396 -1.317703 0.648754 0.673058 0.388910
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.318386 12.874015 -0.818319 5.446153 -1.975340 10.275112 -0.440906 2.545749 0.632544 0.043535 0.471306
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.833592 -0.120187 -2.167447 -0.113852 -1.995089 -2.131048 0.074936 -0.945887 0.606948 0.634871 0.392648
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.333628 1.099768 0.460568 0.564282 2.433322 2.053041 1.187979 0.700821 0.669353 0.688947 0.402333
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.006329 1.367911 2.392816 1.867105 1.448773 1.466483 -0.043508 1.783707 0.675407 0.690781 0.393327
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.243433 -0.961934 2.396350 1.636725 0.218410 0.235665 0.524326 2.284267 0.681987 0.694904 0.384409
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.194750 28.641607 0.427781 16.573623 0.584455 9.995762 -0.203461 8.785558 0.692607 0.032480 0.547725
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.253563 -0.661852 0.305459 0.106794 -0.468153 1.372872 -0.041029 0.195808 0.692256 0.704205 0.380056
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.615259 -0.413982 -0.772316 -0.844020 0.356999 0.357532 0.215124 1.182629 0.700218 0.707667 0.377027
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.197700 -0.386138 0.619501 0.708164 0.047144 0.459040 3.614918 0.851707 0.708535 0.706897 0.374318
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 3.039521 0.180930 0.613208 0.632469 0.478553 0.568751 11.919454 1.451142 0.691200 0.700473 0.365713
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.330496 -1.084760 2.762936 7.198794 1.338530 1.374474 -2.257814 -0.315040 0.702352 0.650102 0.392684
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.156123 -0.113004 3.372941 1.354679 2.220498 0.345513 -2.571977 -0.933304 0.694672 0.706602 0.378299
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 22.462370 27.790873 -0.323175 -1.472423 4.087977 5.438597 34.001069 14.066320 0.555902 0.513908 0.246246
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 33.252057 -0.732893 -0.990068 -0.735418 2.013175 -3.090873 1.778455 -0.333685 0.469779 0.651257 0.370309
79 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.421122 -0.437456 -2.371212 -1.611595 44.236244 -2.373983 10.709186 -0.654368 0.619129 0.659155 0.403215
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 9.307056 14.099841 2.082962 5.291399 5.732992 10.274266 6.820103 1.027353 0.303908 0.040921 0.203711
81 N07 digital_ok 100.00% 0.00% 0.00% 0.00% -0.594869 6.182797 -0.531878 8.896582 -0.228669 7.992832 -0.216309 0.756853 0.649563 0.489472 0.420530
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.317559 -0.510147 0.015674 1.944071 -0.312340 0.107978 -0.383635 -0.143964 0.664557 0.674758 0.385574
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.809715 -0.438883 -0.229692 -0.238512 -0.407815 -0.096313 -0.424289 0.672967 0.676760 0.690883 0.381851
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 2.138396 25.364021 5.130855 16.045782 0.906691 9.954476 -0.076744 4.632935 0.666712 0.038239 0.456146
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.001115 -0.081658 0.301367 0.902027 -0.511892 -0.666490 -0.417989 -0.102106 0.691806 0.698916 0.378317
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.357101 -0.550114 2.277842 1.415690 2.556446 -0.389780 0.116318 15.274090 0.680280 0.694865 0.370763
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 18.274004 7.458441 1.564502 -0.123597 17.754036 2.734493 10.501774 1.198858 0.607220 0.716276 0.343871
88 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.183096 0.203760 0.159165 0.506640 -0.923999 1.221622 8.069685 2.545100 0.695296 0.702395 0.364121
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.081347 0.016702 -0.075348 0.388214 -0.574327 -0.230646 -0.521203 -0.304457 0.696818 0.702530 0.369804
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.018445 -0.721874 -2.379038 0.764582 -0.618707 -0.075347 -0.114276 3.855876 0.705250 0.696444 0.373983
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.602597 -0.068827 0.088558 -0.206375 -0.550500 0.238902 0.023119 -0.222560 0.691009 0.704216 0.384532
92 N10 RF_maintenance 100.00% 0.00% 16.69% 0.00% 40.779336 47.221097 0.476836 -0.165127 5.565705 8.734354 0.274952 0.764450 0.292284 0.246191 0.095091
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 2.405360 0.138134 2.404164 -0.298787 1.992327 0.420882 2.979554 -0.241520 0.675564 0.694518 0.392938
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 12.009222 -1.085765 12.242765 0.498494 7.397631 1.569089 0.836510 8.795396 0.033246 0.686329 0.457051
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.221258 -0.554298 -1.639626 0.624966 -1.503525 -2.001672 0.797743 0.379853 0.647144 0.675456 0.401789
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.010018 13.686997 5.062053 5.498809 7.381857 10.310278 0.915824 0.780509 0.033816 0.038833 0.002858
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.200575 3.974664 -0.346380 -0.332379 -2.002293 3.982200 -0.394037 9.357313 0.635561 0.612236 0.398926
98 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.869136 0.464425 -0.197949 -2.035486 -0.435680 -0.293463 0.900184 1.929863 0.645830 0.676317 0.399188
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 1.104991 -0.845022 -0.061637 0.326195 -2.760439 2.167694 -1.525976 -0.358275 0.670006 0.677402 0.391001
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -1.211997 -1.016811 -0.084630 0.733204 0.726105 -0.737150 0.013379 -0.053042 0.667943 0.683787 0.383538
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.929628 6.129008 -0.787413 0.524631 0.450878 0.183475 0.254791 0.470192 0.691858 0.696616 0.378759
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.386597 0.189276 -1.313914 2.741531 -0.054610 0.211722 -0.827507 3.874130 0.698791 0.694090 0.376178
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.491930 5.307463 -0.945937 3.175662 96.399707 3.616850 6.730537 -1.788970 0.687355 0.698040 0.368028
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.172128 62.770521 8.162148 8.280422 -1.697148 4.257969 -0.233658 -0.129667 0.644296 0.681302 0.374377
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.485516 -0.346055 -1.995172 0.452666 -0.760977 -0.357851 -0.574876 -0.163343 0.706712 0.704786 0.366655
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.656812 0.196552 1.147849 0.817430 0.608093 0.836446 -0.126343 0.249463 0.689517 0.700913 0.367216
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 3.672300 1.359219 -0.523934 -1.312297 0.818162 0.269216 8.227279 6.011947 0.694107 0.706645 0.365309
108 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 10.913483 3.194586 12.019948 -0.956442 7.415829 0.034395 1.752706 0.450292 0.041974 0.706595 0.482886
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -1.124239 12.588796 0.572885 12.172368 0.135055 10.288283 1.157438 1.774548 0.693726 0.036030 0.478764
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.743146 26.976584 -0.388807 16.209923 1.599395 9.937183 8.228455 4.120652 0.693990 0.033491 0.474376
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.172305 12.448306 0.339487 12.300827 0.509845 10.295170 4.870699 2.491101 0.681200 0.036266 0.470141
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.887369 1.264747 -0.162280 -0.747093 -0.180531 -0.214231 0.276408 -0.102524 0.670053 0.678019 0.397952
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.895705 13.696026 4.803014 5.371364 7.380940 10.296628 1.480593 0.754102 0.036468 0.030923 0.003308
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.739977 0.461515 1.141191 -0.844700 2.283931 -1.394490 1.156610 -0.360069 0.546749 0.649544 0.419827
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.696562 0.687129 2.148606 1.678384 0.271320 0.239129 -2.046472 -0.943686 0.630280 0.649911 0.412803
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.110379 0.182647 -0.255817 0.097064 -0.197252 -0.457788 3.804850 -0.000756 0.641740 0.660720 0.390618
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 11.842196 14.227957 12.138563 12.902709 7.395825 10.277983 1.320695 3.496842 0.027800 0.032391 0.002700
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.697741 0.789877 -0.160057 0.504965 0.629086 1.296641 0.215107 0.727091 0.668185 0.688302 0.389190
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.589524 2.640349 -2.123277 4.488137 -0.547518 1.611935 -0.273273 0.823578 0.682402 0.648749 0.387174
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.361096 1.899574 3.070818 2.185126 1.127447 0.856711 0.366714 -2.137411 0.676897 0.700252 0.370404
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.458352 5.118422 -1.166419 0.763704 0.577537 2.456609 5.716922 16.739896 0.700070 0.707914 0.376838
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.650731 6.988493 -0.793527 0.265601 2.919725 0.605137 0.563769 -0.304300 0.708487 0.712556 0.376959
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.102414 8.486933 0.364346 0.588991 0.978818 1.875876 0.419161 1.668139 0.706475 0.713190 0.373236
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.787916 -0.291577 -0.193144 0.155836 0.171948 0.442768 0.947740 0.823204 0.705706 0.714093 0.374816
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.543551 -1.327022 -1.227228 0.532060 0.614093 0.620564 -0.235777 -0.273005 0.701150 0.703405 0.374317
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.092663 1.325803 -1.071723 0.547608 2.875074 0.171624 3.401481 0.047900 0.696955 0.697282 0.380217
127 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.260585 -0.070374 -0.220850 -0.285588 0.904647 1.425299 1.195854 5.993303 0.696342 0.707101 0.389042
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.813569 -0.441038 2.182053 0.520889 -0.419557 0.480220 -0.266552 -0.041038 0.683499 0.700619 0.389863
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.480724 -1.860333 0.719755 0.661137 0.032857 0.802504 -0.008062 2.441272 0.682263 0.695460 0.396933
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.055627 0.497086 -0.189569 -0.333250 -0.491175 1.023529 2.082286 3.452477 0.665395 0.684944 0.392801
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.894423 13.811084 5.118182 5.665428 7.410588 10.262673 2.242681 -0.034327 0.035048 0.040455 0.002083
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.128576 0.543274 -0.590754 -1.864060 -2.195109 -1.262421 -0.271713 -0.198460 0.633873 0.640025 0.401311
133 N11 not_connected 100.00% 100.00% 83.58% 0.00% 12.433453 17.950321 4.813777 3.870134 7.441521 9.227982 1.371132 0.815756 0.042907 0.172715 0.096687
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -1.169558 12.532651 -0.003694 12.567233 0.847650 10.311786 0.288039 1.251890 0.638945 0.039792 0.479722
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 1.633937 0.049465 2.126909 2.058250 4.705733 7.677156 0.033381 -0.024587 0.628609 0.652750 0.387802
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.144838 -1.002723 -0.545184 0.222875 1.027442 0.633557 0.470037 1.502487 0.649666 0.668447 0.391074
138 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.853855 -0.605000 0.153177 0.615491 0.372710 -0.003681 3.218716 0.141405 0.670811 0.685639 0.392786
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.387007 -0.948639 0.960569 -1.480626 -1.466439 -2.534384 -1.366795 0.164562 0.675020 0.680595 0.379870
140 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.137011 13.254388 -0.647492 12.415615 -0.840794 10.263036 0.658775 2.452059 0.690064 0.045598 0.557982
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.468984 -0.579411 -1.025842 0.534611 0.511332 -2.700635 0.179340 -1.469718 0.691908 0.705958 0.374339
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.606292 12.440808 -0.823879 12.493773 2.060902 10.309031 0.378876 1.864076 0.693317 0.045151 0.554725
143 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.005706 -0.573777 12.208308 -0.245061 7.392121 0.822985 0.255832 -0.222642 0.039146 0.710446 0.563400
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.597354 -0.819747 -0.438178 6.467969 1.676804 -0.782390 -0.405172 -0.142346 0.700974 0.663049 0.396762
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.255950 3.396621 0.715900 8.896650 1.784788 7.561690 -0.111246 0.784252 0.692709 0.605077 0.418099
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.006585 0.763230 -1.748722 0.780660 -1.218903 -1.650748 -0.094876 -1.533122 0.661793 0.698455 0.393398
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.796060 -1.549931 1.335088 2.056978 0.182611 -0.064588 -0.178302 -0.162702 0.684644 0.692431 0.380904
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.982032 -0.530760 3.675127 1.503712 -1.066555 0.592398 -0.267769 -0.061068 0.669669 0.695567 0.397081
149 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.103823 0.755793 -2.418324 1.788016 0.216424 0.003681 -0.863123 -1.741921 0.681559 0.692489 0.398716
150 N15 RF_maintenance 100.00% 100.00% 2.05% 0.00% 11.597052 -0.342206 12.078031 -0.282523 7.411930 0.752083 2.070010 -0.438526 0.044336 0.291947 0.154765
155 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.660882 -0.992283 -0.196304 1.700561 0.745521 14.103619 1.633024 0.789172 0.639869 0.652611 0.407927
156 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.061935 -0.301094 12.027543 1.947243 7.241242 0.607358 1.412630 0.036427 0.093702 0.654370 0.532539
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.003817 -0.268458 0.137527 0.060550 -0.402428 0.290052 0.000756 0.220958 0.653788 0.671720 0.397791
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.496608 -0.690786 -1.157819 -1.850220 0.741977 2.310610 1.350816 12.069595 0.670655 0.684324 0.401236
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.041788 28.375917 -2.354668 -1.420304 -2.192718 2.863040 -0.205519 0.800181 0.644763 0.537746 0.366404
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.916742 -1.174292 -0.687845 -1.576123 0.346491 0.220077 -0.110911 0.232072 0.681904 0.693184 0.379568
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.843743 29.900464 -1.006209 -1.372575 -0.171542 -0.098308 -0.483680 0.884198 0.686851 0.569936 0.351934
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 3.389591 0.351451 -1.031467 0.123564 13.607433 20.105520 2.261066 3.005729 0.686472 0.697422 0.376437
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.622218 0.918755 -0.560446 -0.058941 0.127612 1.120682 -0.206692 0.901388 0.699620 0.702840 0.383702
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.718730 -0.137879 1.267095 -0.999773 19.919644 0.594504 1.085611 0.990044 0.691435 0.704020 0.381904
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 19.077974 -0.324740 8.984849 -0.886635 3.793455 0.427797 -0.031998 -0.131639 0.415555 0.698642 0.429505
166 N14 RF_maintenance 100.00% 0.00% 100.00% 0.00% 19.162079 11.626424 1.552292 11.977512 11.780451 10.279047 78.407151 0.793019 0.606397 0.034713 0.429518
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.576912 -1.128428 -1.906911 0.755664 0.178900 0.659614 -0.998657 2.029173 0.700377 0.697994 0.390609
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.853728 -0.943844 -0.225985 -1.174221 0.643697 0.741735 -0.246405 -0.077324 0.687940 0.700168 0.394335
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 2.905369 14.498598 -1.368816 -1.927394 13.254330 -0.743488 34.133619 0.259878 0.654893 0.654668 0.385637
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 11.558380 -1.314753 12.277552 -1.611115 7.389774 11.423321 0.738403 0.021284 0.038929 0.690040 0.565914
179 N12 RF_maintenance 100.00% 100.00% 94.33% 0.00% 11.720305 13.409216 12.273635 13.029458 7.360296 9.998304 0.674990 1.252310 0.060788 0.104594 0.045330
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.103820 13.316106 12.178218 12.649494 7.384100 10.321506 0.448850 2.184498 0.048955 0.051400 0.003647
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.497459 -0.395357 -0.564573 -0.071917 0.717366 1.921957 -0.138615 4.920251 0.689747 0.690576 0.385039
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.559036 6.060989 -1.561845 3.382359 -0.620050 4.085326 -0.686868 -1.498664 0.695292 0.678231 0.385324
183 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 11.055851 -0.926813 11.256758 -1.106561 7.415727 0.469753 0.073893 0.197456 0.042081 0.691330 0.513478
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 10.937773 12.857714 12.174818 12.515887 7.334499 10.219304 0.751603 1.195691 0.072662 0.049585 0.022682
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 7.861454 0.885561 11.133684 8.460081 6.036186 0.342828 0.241320 0.315118 0.363324 0.602974 0.418638
186 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 10.531628 1.124951 12.203593 2.120417 7.406317 0.477746 2.027810 -1.955918 0.045884 0.696644 0.532504
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 3.435241 1.384224 7.822567 1.765530 8.121787 -0.193352 0.991092 -0.709975 0.598530 0.695178 0.421553
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 10.124677 10.277194 1.993287 -0.760819 4.720103 8.626113 0.768281 0.467769 0.350968 0.371935 0.175620
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 42.189420 12.649695 -0.741704 12.603921 4.078192 10.368471 55.177004 2.700093 0.498158 0.036369 0.387381
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.185778 -0.008309 4.376056 -0.486217 -0.107285 0.619794 10.418654 0.548271 0.637601 0.670296 0.423041
200 N18 RF_maintenance 100.00% 100.00% 60.56% 0.00% 12.563233 36.602377 5.054552 0.305794 7.432940 9.214808 1.634094 -0.075249 0.047541 0.205606 0.138901
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.446021 5.398330 5.118830 4.598546 5.540742 6.996243 -1.905057 -2.831546 0.641447 0.648245 0.382307
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% 0.559346 1.998515 0.533240 -0.821682 -2.159940 -1.216723 -1.064669 3.224931 0.672683 0.637048 0.393162
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 13.153345 14.666083 4.760641 5.118027 7.415916 10.276080 2.610814 3.247364 0.034156 0.043195 0.002793
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.696007 3.523951 -0.083246 0.270573 -2.159948 -1.942734 0.173894 5.613097 0.666401 0.613769 0.409873
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.456032 0.837129 -2.268045 -0.532164 7.523381 -2.497391 1.039636 0.465800 0.648641 0.658177 0.385814
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.609195 1.414536 0.858207 -0.268034 -0.359336 -1.130398 -1.049250 -1.039969 0.648609 0.652583 0.375106
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% 6.618149 3.681558 5.282733 3.635814 6.599683 4.619866 -3.462181 -2.575439 0.636046 0.656789 0.402980
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.410939 -1.227545 -0.852094 -0.802330 -2.810992 -2.649778 2.235380 -1.013918 0.666275 0.659272 0.394667
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.605896 -0.143231 -0.906722 -1.175000 -1.201994 -2.121335 1.826983 -0.339537 0.633314 0.661859 0.397467
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.738912 0.401562 -0.028413 -0.628345 -1.652095 -2.696455 2.795908 -0.715381 0.665422 0.665533 0.397122
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.451377 1.065065 -2.272165 -0.187833 -1.601210 28.031132 0.839195 5.258536 0.647046 0.663234 0.396220
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.964776 6.645131 5.436368 5.211898 6.261228 8.674990 -3.536675 -3.240777 0.636421 0.626980 0.385518
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% 4.772636 1.501399 1.136712 -1.972190 39.707110 -2.372716 1.594057 -0.413077 0.546449 0.637034 0.430269
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.105397 -0.862212 0.581871 0.441729 -1.912291 -1.121057 -0.676014 -0.964506 0.664050 0.656797 0.404054
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.571014 0.653401 -0.286158 1.424895 -1.539287 -0.397581 -1.049380 -1.225049 0.659279 0.657501 0.401118
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% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
242 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
243 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 263.900116 262.948964 inf inf 7090.357174 6585.263795 7640.194530 6757.739134 nan nan nan
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% 258.767423 258.714689 inf inf 7089.086359 7294.042412 7073.934332 6644.562412 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.469153 13.428701 -0.701568 8.043099 -0.880236 10.312043 14.075086 3.027583 0.661154 0.048656 0.555426
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.203397 1.265701 0.582478 0.652403 -1.129589 -1.000685 2.630790 1.724577 0.560012 0.554100 0.391076
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% -0.041368 -1.376484 0.689148 -2.107436 -1.260801 -0.957149 -0.948473 -0.078100 0.596083 0.572798 0.404980
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 0.265895 -1.290857 -1.870986 -1.507967 4.282188 -1.334088 10.545768 1.382178 0.554221 0.569151 0.400444
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.509580 0.643245 -1.353553 -2.169198 -1.991329 -1.032374 0.886086 1.074878 0.528183 0.555021 0.394617
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, 15, 16, 17, 18, 19, 22, 27, 28, 29, 31, 32, 34, 35, 36, 37, 44, 46, 47, 50, 51, 52, 53, 54, 55, 56, 57, 59, 60, 63, 68, 71, 72, 73, 77, 78, 79, 80, 81, 84, 86, 87, 88, 92, 94, 96, 97, 101, 103, 104, 107, 108, 109, 110, 111, 113, 114, 117, 119, 121, 122, 123, 127, 131, 133, 135, 136, 140, 142, 143, 144, 145, 150, 155, 156, 158, 159, 161, 162, 164, 165, 166, 169, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 203, 205, 206, 208, 209, 210, 211, 219, 223, 224, 225, 226, 227, 228, 229, 237, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 329]

unflagged_ants: [5, 8, 9, 10, 20, 21, 30, 38, 40, 41, 42, 43, 45, 48, 49, 58, 61, 62, 64, 65, 66, 67, 69, 70, 74, 82, 83, 85, 89, 90, 91, 93, 95, 98, 99, 100, 102, 105, 106, 112, 115, 116, 118, 120, 124, 125, 126, 128, 129, 130, 132, 137, 138, 139, 141, 146, 147, 148, 149, 157, 160, 163, 167, 168, 202, 207, 220, 221, 222, 238, 239, 324, 325, 333]

golden_ants: [5, 9, 10, 20, 21, 30, 38, 40, 41, 42, 45, 65, 66, 67, 69, 70, 83, 85, 91, 93, 98, 99, 100, 105, 106, 112, 116, 118, 124, 128, 129, 130, 141, 146, 147, 157, 160, 163, 167, 202]
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_2459887.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 [ ]: