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 = "2459904"
data_path = "/mnt/sn1/2459904"
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-20-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/2459904/zen.2459904.25267.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1850 ant_metrics files matching glob /mnt/sn1/2459904/zen.2459904.?????.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/2459904/zen.2459904.?????.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 2459904
Date 11-20-2022
LST Range 23.473 -- 9.430 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 7
dish_ok: 1
RF_maintenance: 52
RF_ok: 19
digital_ok: 98
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 N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 85 / 201 (42.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 138 / 201 (68.7%)
Redcal Done? ❌
Never Flagged Antennas 53 / 201 (26.4%)
A Priori Good Antennas Flagged 67 / 98 total a priori good antennas:
3, 7, 9, 15, 19, 21, 29, 30, 31, 37, 38, 42,
44, 45, 51, 53, 54, 55, 56, 59, 68, 71, 81,
83, 84, 86, 93, 94, 98, 99, 100, 101, 103,
107, 108, 109, 111, 116, 117, 118, 121, 122,
123, 130, 136, 140, 142, 143, 146, 155, 158,
161, 164, 165, 167, 170, 181, 182, 183, 184,
185, 186, 187, 189, 190, 191, 202
A Priori Bad Antennas Not Flagged 22 / 103 total a priori bad antennas:
22, 35, 50, 62, 64, 79, 89, 115, 120, 125,
132, 139, 148, 149, 168, 207, 223, 238, 324,
325, 329, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459904.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.722809 -0.469387 9.970069 0.336988 8.947819 0.708852 1.837454 4.167797 0.032153 0.657573 0.484170
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.338674 0.565986 1.763002 0.575252 -0.435916 5.151984 -2.812603 -1.951904 0.654633 0.660900 0.414902
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.651857 0.058807 -0.311942 -0.322721 -0.256087 0.970584 -0.580413 -0.614734 0.651384 0.661154 0.408183
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.077443 -0.904880 0.851439 2.775868 -0.394919 -0.373148 20.430145 29.887682 0.645428 0.653488 0.403921
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.479550 -1.442665 -1.051584 -0.309978 0.147403 1.043006 8.908600 6.690933 0.648059 0.662746 0.404567
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.121020 -0.309047 8.291603 0.092570 4.622994 0.733641 0.868971 -0.480532 0.470929 0.656489 0.475191
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.092617 -0.591223 -1.270270 -0.779506 0.164181 0.469727 1.077172 0.937468 0.633144 0.647576 0.407240
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.919895 0.014777 9.353586 1.186348 8.948692 -0.071910 0.715200 2.495049 0.032012 0.660836 0.475232
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.467457 -1.265460 -0.603535 0.303265 1.632609 1.129085 0.402596 3.350104 0.658673 0.667181 0.410456
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.537781 0.815205 -0.151453 -0.128097 0.971659 0.437743 1.165761 0.976807 0.654460 0.669549 0.406715
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.681339 10.063248 -0.648587 0.287278 1.176695 0.995612 21.794739 30.699409 0.637103 0.450004 0.471134
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.017924 -1.482833 0.692153 1.134736 0.324110 0.387666 5.277423 13.394097 0.638787 0.668381 0.402632
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.957515 -1.052394 3.552975 -1.047595 0.216040 -0.857595 1.796264 -1.068831 0.634102 0.676164 0.417168
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.032190 -0.571553 -0.416416 4.424461 1.010206 -0.417863 1.157665 0.483333 0.638653 0.632847 0.407768
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.787178 -0.334698 0.509128 0.103859 0.998749 1.666630 0.090656 -0.685828 0.613000 0.636578 0.402193
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.514527 10.847497 10.001265 10.548749 9.112210 10.245355 4.693718 3.427552 0.031091 0.035355 0.004545
28 N01 RF_maintenance 100.00% 0.00% 85.46% 0.00% 12.234666 25.901897 1.103562 0.785172 4.253589 8.307235 9.413033 24.269273 0.352041 0.156030 0.257615
29 N01 digital_ok 100.00% 0.00% 100.00% 0.00% -1.366678 11.270455 -0.243620 10.125599 -0.245080 10.224146 -0.111575 0.854628 0.658524 0.033744 0.501239
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.413426 -0.358738 -0.714667 0.257939 1.558901 0.083154 47.642482 0.351283 0.658084 0.674585 0.399181
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.005543 -1.190010 1.006119 1.150017 2.354248 1.220547 5.844277 2.826762 0.664205 0.672491 0.403387
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.051647 23.146935 -0.083476 2.323278 13.239252 1.485364 7.367349 7.155846 0.598951 0.565693 0.330540
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 11.380127 -0.599967 4.238248 0.293745 9.026409 -0.190828 2.976619 1.027838 0.040272 0.654873 0.456546
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.251254 -0.128985 -0.221037 -1.005779 -1.174082 -1.478361 1.012427 0.513104 0.610342 0.631325 0.395165
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.518945 7.559601 -0.152349 0.156189 1.302634 2.092233 0.704520 2.825611 0.636494 0.658490 0.408823
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.360671 0.120661 -1.111506 0.500426 0.597419 0.668184 0.957116 17.522593 0.651159 0.669911 0.416648
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.045822 -0.263882 -0.169280 0.475273 0.671745 1.007675 13.891126 4.383061 0.655800 0.676685 0.418189
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.123438 0.541698 -0.218118 0.259203 -0.683370 0.720523 0.817588 0.933757 0.656808 0.671403 0.399979
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.146027 0.519213 -0.816418 -0.310808 0.867420 -0.184092 -0.056953 -0.060259 0.662449 0.671805 0.386802
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.534279 11.823077 10.220642 11.018463 8.904445 10.139703 2.865737 4.239152 0.032105 0.030578 0.000846
43 N05 RF_maintenance 0.00% 91.14% 91.14% 0.00% -0.539701 0.519499 0.249962 0.305368 -1.057126 -0.001319 -1.380059 1.912488 0.120068 0.116705 0.036034
44 N05 digital_ok 0.00% 91.14% 91.14% 0.00% -1.634205 0.008485 -0.372144 -0.426740 -0.755794 0.334046 -1.067681 -0.358367 0.118430 0.113285 0.033715
45 N05 digital_ok 100.00% 91.14% 91.14% 0.00% -0.589001 3.839589 -0.087298 0.156591 0.189059 1.886709 1.296528 7.815731 0.119151 0.114433 0.033900
46 N05 RF_maintenance 0.00% 91.14% 91.14% 0.00% -1.062865 1.720279 1.225169 2.243649 -0.518301 0.772240 0.433635 -2.723371 0.129396 0.122271 0.040711
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 10.571687 1.235454 4.048398 -1.084819 8.981779 -1.497319 2.257635 4.299825 0.036990 0.641777 0.441859
48 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.248177 0.744846 0.040136 1.886948 -1.198563 1.188695 5.363950 -2.878932 0.622541 0.660492 0.404671
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.046221 0.621111 -0.708873 -1.521051 -0.300143 -0.538332 1.536792 41.414409 0.576440 0.619684 0.388934
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.726674 2.244339 -0.152406 0.593478 0.281876 1.211279 3.260677 3.231136 0.618930 0.647057 0.395070
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 23.644349 0.619291 12.861607 -0.023029 9.317998 2.357082 19.318836 9.591420 0.036448 0.671687 0.477565
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.734770 5.907335 -0.652825 0.220157 0.021378 1.008737 2.563887 3.029357 0.656628 0.679325 0.407026
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.312196 1.886704 -0.404670 -0.152371 1.741596 0.890711 5.569983 10.194209 0.666227 0.683760 0.405477
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.745319 11.537065 10.008906 10.785964 9.049304 10.228543 4.941836 3.168262 0.031269 0.030936 0.001295
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 1.228156 12.249797 0.279937 10.689410 2.369628 10.240154 9.025914 6.117764 0.663865 0.033331 0.450370
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.041683 12.277889 0.062786 10.892898 -0.256835 10.168091 1.279513 3.087204 0.666999 0.035132 0.467740
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 27.075521 -0.242052 6.591137 0.939258 3.502386 0.290434 5.978992 4.145806 0.454494 0.683651 0.405635
58 N05 RF_maintenance 100.00% 91.14% 100.00% 0.00% 0.487337 11.171947 -0.812230 10.657828 0.199551 10.283502 7.960211 6.050487 0.115496 0.027109 0.064760
59 N05 digital_ok 100.00% 100.00% 91.19% 0.00% 10.178464 10.369789 9.372582 10.026462 8.844003 9.378822 1.386202 2.035188 0.032494 0.070588 0.027825
60 N05 RF_maintenance 100.00% 91.14% 100.00% 0.00% -1.275340 11.020796 0.222847 10.695737 -1.244618 10.189768 -0.600123 6.069127 0.126790 0.039152 0.066492
61 N06 not_connected 100.00% 0.27% 0.00% 0.00% 10.073824 0.267286 3.462590 -1.400546 7.857535 -1.988227 0.335658 2.188170 0.286137 0.647806 0.480932
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.345640 0.947704 -1.424325 1.464081 -1.206755 -0.159953 2.349114 -2.033023 0.612238 0.665174 0.404232
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.355435 11.401918 0.500334 4.711988 -0.758463 10.260134 0.221869 5.059285 0.608648 0.041652 0.415796
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.033554 0.371303 -0.835111 0.550203 -1.313693 -1.402007 0.537006 -1.833214 0.589365 0.630744 0.400966
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.377282 0.942548 0.116613 0.734075 0.877214 2.309667 0.018221 0.446512 0.626591 0.663051 0.429678
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.050949 1.116250 1.996765 1.769506 1.810830 0.701216 0.380234 3.030465 0.634491 0.667124 0.418785
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.059035 -0.852805 1.928239 1.828184 -0.232692 0.438798 2.617047 3.280240 0.645664 0.673160 0.409005
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.155266 26.430087 0.327289 14.169425 0.002182 10.110831 -0.224575 17.211372 0.659958 0.029871 0.454512
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.203491 -0.272815 -0.005286 0.421894 -0.897525 2.215034 0.378370 0.992403 0.663160 0.686650 0.390311
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.512958 -0.310094 -0.716308 -0.370062 0.551960 1.211248 0.305067 0.004203 0.674399 0.693642 0.388257
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 6.906009 -0.279283 0.296221 0.846686 0.768618 0.178766 0.395582 1.901938 0.682172 0.694218 0.385276
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.139106 -0.260960 0.290556 0.786432 0.001319 0.070947 2.745610 2.241238 0.668519 0.686526 0.382630
73 N05 RF_maintenance 100.00% 91.14% 91.14% 0.00% -1.068478 0.546937 -0.686839 1.911843 0.332748 7.036317 -0.002919 1.047334 0.118264 0.119288 0.035478
74 N05 RF_maintenance 100.00% 91.14% 91.14% 0.00% -1.249691 1.691295 0.380248 -1.101299 -0.540177 2.195842 -0.511747 6.200754 0.120799 0.117348 0.033937
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 22.434880 24.746303 0.616255 -0.803962 3.218527 3.936461 9.544493 3.718299 0.519851 0.487897 0.205962
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 31.693844 -0.347815 -0.083061 0.106405 2.833334 -1.688792 -0.800006 0.972547 0.453882 0.647236 0.378759
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.144419 -0.301511 -0.432115 -0.825587 -0.515068 -1.240416 -0.871418 -0.779712 0.615078 0.647163 0.399054
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 8.790527 12.641939 2.967666 4.581347 6.318151 10.150358 26.666756 2.243225 0.299322 0.037166 0.182269
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% -0.568558 -0.320124 -0.597380 3.397281 -0.573551 20.033638 -0.069295 1.000991 0.059120 0.077815 0.012141
82 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 2.134794 -0.465321 -0.141556 1.759336 -0.308565 -0.671198 -0.102079 0.305539 0.064473 0.069065 0.011453
83 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.783559 -0.314241 -0.443242 -0.043025 0.021467 -1.120498 -0.573945 1.016637 0.071978 0.068484 0.013745
84 N08 digital_ok 100.00% 49.24% 100.00% 0.00% 19.879900 23.373468 12.957742 13.693645 7.225852 10.009554 7.875737 8.837912 0.221675 0.032913 0.125092
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.157566 0.006058 -0.156869 0.340802 -0.568645 -0.413251 0.199021 -0.432963 0.661548 0.680149 0.389192
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.166176 -0.477808 1.546593 1.307382 1.783820 -1.120583 0.159889 25.841150 0.654319 0.680893 0.377451
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.692216 6.385799 0.920711 -0.444387 19.043757 2.928956 8.962040 3.970488 0.599843 0.700959 0.357668
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.133627 0.255201 0.015684 0.594766 -0.760730 -0.041391 -0.336546 -0.314831 0.668167 0.689731 0.374399
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.289751 0.072817 -0.304851 0.498508 -0.952607 -0.545970 -0.570407 -0.228555 0.667529 0.687779 0.383010
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.567876 -0.330369 1.168159 0.907793 -0.622973 -0.908032 0.280435 9.107256 0.655158 0.679468 0.386885
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.594895 -0.455494 -0.077588 -0.058350 -0.304974 -0.329682 -0.208611 -0.302290 0.654875 0.686543 0.398262
92 N10 RF_maintenance 100.00% 0.00% 17.57% 0.00% 37.260234 43.805480 0.266530 0.656131 6.019786 7.581704 0.663818 15.849614 0.285645 0.242056 0.097811
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 1.926219 0.436544 1.909725 0.045733 0.913207 0.563316 6.594464 -0.492379 0.648458 0.681278 0.402888
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 10.777379 -0.970952 10.144157 -0.397858 9.029193 1.689928 2.300234 4.508048 0.030909 0.674796 0.401876
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.470194 -0.029745 -0.403826 1.203381 -0.275988 -0.509059 -1.122361 12.285899 0.621043 0.663957 0.408346
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.910083 12.237181 4.037919 4.759831 8.861395 10.097553 2.234326 1.619572 0.032521 0.035663 0.002002
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.886751 3.651592 0.750539 -0.092512 -1.280675 -0.926153 -1.615291 20.271171 0.608708 0.599115 0.398547
98 N07 digital_ok 0.00% 100.00% 100.00% 0.00% 0.784806 0.684555 -0.309010 0.005286 -0.497137 0.086171 -0.004203 2.757269 0.067771 0.066042 0.013332
99 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 0.099845 -0.736431 0.574163 0.407882 -0.746911 1.794616 5.693460 -0.432025 0.063082 0.058567 0.009200
100 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -1.199045 -0.906032 -0.204473 0.751991 0.845265 -0.434405 0.663154 0.939125 0.052779 0.057634 0.006267
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.849578 7.327925 -0.925215 0.754973 0.380349 1.245920 -0.321179 -0.405317 0.656880 0.677191 0.399646
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.270154 0.533684 -0.407308 2.025422 -0.462463 -0.300535 -0.690387 12.144316 0.669212 0.675297 0.386575
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.716570 4.847408 4.431918 0.211290 0.539587 1.184330 15.749532 5.761208 0.642556 0.689836 0.387567
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.965970 58.714842 6.698987 7.180800 1.548155 2.825495 0.272989 1.741764 0.617667 0.665702 0.385389
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.291651 -0.649760 -1.050239 -0.156271 0.788664 -1.043387 -0.334718 -0.329307 0.674684 0.690787 0.370988
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.296215 0.164604 0.869381 0.795045 -1.403077 -0.599970 0.191808 -0.276697 0.661364 0.688868 0.376876
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.312367 -0.203580 -1.413702 -0.970759 -0.102273 -0.548845 1.167868 5.761629 0.668861 0.692568 0.381253
108 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 9.825466 2.971221 9.930007 -0.558719 9.004208 -0.278099 3.604688 0.162566 0.037530 0.693052 0.445888
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.656198 11.154846 9.988932 10.428238 9.066629 10.241752 1.212626 3.433721 0.028928 0.031807 0.001724
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.003202 24.968551 -0.130667 13.860717 5.228490 9.956879 9.038721 8.175764 0.660636 0.029662 0.384860
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.023993 11.110298 0.216510 10.536805 -0.093904 10.232577 -0.479365 4.242451 0.655867 0.033565 0.404776
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.584356 0.968359 -0.189018 -0.272742 0.351447 1.258835 0.416107 -0.305226 0.644359 0.667689 0.406268
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.665650 12.284014 3.812838 4.652951 8.896605 10.129777 3.797711 1.843053 0.033571 0.030666 0.001823
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.558535 0.598959 1.041397 -0.081471 5.901451 -0.972630 1.468569 -0.597071 0.508758 0.637410 0.431105
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.392957 1.286706 2.920501 2.091367 1.590070 0.640668 -4.088122 -1.401185 0.601109 0.636657 0.423048
116 N07 digital_ok 100.00% 100.00% 100.00% 0.00% -0.558461 0.202046 -0.877674 -0.365707 -0.275620 -0.140857 4.553117 3.772654 0.081754 0.074955 0.019049
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 10.679548 12.599657 10.033105 11.029121 8.924014 10.235364 3.207826 7.608425 0.026318 0.025050 0.000765
118 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.216764 1.234021 -0.536193 0.388438 -0.069419 -0.192873 0.689562 3.263181 0.060153 0.057081 0.006945
119 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 0.828186 1.544368 -1.185893 1.982178 0.520074 7.788890 0.202716 3.625795 0.066681 0.066571 0.011924
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.558676 2.453508 2.377066 2.515935 0.721632 1.372388 1.653680 -3.798043 0.643789 0.680453 0.384658
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.300237 4.146445 -0.540570 1.826845 0.671476 3.636839 57.120083 27.417107 0.668592 0.687584 0.381145
122 N08 digital_ok 100.00% 99.51% 0.00% 0.00% 24.255568 6.414419 11.762393 0.433746 8.642746 1.086579 10.027987 -0.488384 0.092176 0.698044 0.494504
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.254854 8.494488 0.180820 0.732804 0.948025 0.810801 -0.450965 0.446138 0.683405 0.703711 0.381662
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.796892 -0.357805 -0.451214 0.293498 -0.310786 0.176008 0.538446 1.174942 0.679994 0.703418 0.380511
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.044350 -1.284484 -0.713094 0.515663 -0.174514 -0.648845 -0.283356 -0.565854 0.669305 0.693114 0.382121
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.406594 4.868704 -1.237924 1.226864 3.784346 0.852571 7.286472 2.112138 0.665172 0.688640 0.389489
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.123659 0.044214 -0.153923 0.053260 2.111065 1.007642 -0.158805 0.299402 0.665427 0.695875 0.403343
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.778057 0.187505 1.266094 0.847000 -0.264794 1.212341 -0.242781 0.331031 0.658189 0.686204 0.400825
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.674897 -1.960507 -0.244103 0.067175 -0.277982 0.113797 -0.630638 0.123072 0.657889 0.683059 0.408421
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.276888 0.461479 -0.317653 0.075104 -0.746964 0.750934 2.198044 6.683569 0.640080 0.669711 0.403227
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.741114 12.377644 4.084231 4.902953 8.982867 10.176968 4.963706 -0.096024 0.033687 0.037060 0.001744
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.849353 0.564834 0.620568 -1.374269 -0.320891 -0.947552 -1.758892 0.075124 0.608865 0.624323 0.407800
133 N11 not_connected 100.00% 100.00% 82.59% 0.00% 11.172815 16.527779 3.822520 3.301860 8.965953 9.057958 2.759574 1.520357 0.038933 0.176605 0.088877
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -1.012391 11.183393 -0.053606 10.762857 0.832752 10.175444 0.176193 2.603057 0.593796 0.035815 0.410200
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 5.478841 -0.017095 8.009149 4.662733 12.407568 19.081068 0.653801 1.139930 0.412558 0.598929 0.435406
137 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.038792 -0.664815 -0.535456 -0.585476 1.172032 2.063183 2.937325 2.857000 0.068263 0.066629 0.011521
138 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.567947 -0.586935 0.611630 1.424435 0.372855 0.094090 3.244727 -0.358506 0.069163 0.068272 0.013319
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.664505 -0.397670 1.839685 -0.805999 0.111966 -1.749606 -2.507286 -0.903639 0.641924 0.657553 0.392005
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.742274 3.609892 0.389965 3.472056 -0.627591 4.186170 7.482043 -1.265939 0.662095 0.678396 0.382921
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.317680 -0.611147 -0.945866 0.932792 1.676374 -1.586202 -0.291430 -2.421387 0.666861 0.693578 0.382702
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 1.482739 11.035507 -1.402887 10.699964 1.767127 10.235843 32.653834 3.443018 0.672182 0.043156 0.491608
143 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 9.964610 28.639750 10.096552 2.852430 8.834849 6.318400 0.719127 4.581080 0.034652 0.332984 0.215622
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.757735 -0.763315 -0.635887 3.513150 0.634822 -0.475731 -0.592437 -0.047962 0.676604 0.682194 0.386450
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.264166 2.192483 -0.562679 6.627019 -0.128422 12.758338 0.969468 1.881097 0.669725 0.628459 0.405691
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 10.976570 2.010965 3.835416 1.329753 8.933279 -0.601528 0.713915 -2.563745 0.036678 0.686949 0.493068
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.513896 -1.270654 0.978781 2.006568 0.153421 -0.596320 0.344766 0.477350 0.656769 0.683005 0.393379
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.817022 -0.322241 2.934474 1.521502 -0.498879 0.599369 3.230633 -0.331241 0.643084 0.683697 0.408445
149 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.806353 1.143464 -0.992321 2.123396 -0.599280 0.534248 0.040502 -2.803112 0.655073 0.678839 0.408665
150 N15 RF_maintenance 100.00% 0.00% 100.00% 0.00% 4.663098 11.222068 4.335311 10.603991 7.418555 10.190038 -5.048832 1.823692 0.330002 0.036069 0.219376
155 N12 digital_ok 100.00% 100.00% 73.08% 0.00% 9.502190 0.242961 9.659811 -0.603912 9.073090 1.377476 1.548121 4.143811 0.033702 0.205988 -0.020112
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.188717 10.807673 -1.611346 10.403067 -0.186370 10.230614 12.089842 1.760625 0.606949 0.049932 0.434515
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.062612 -0.028239 0.014148 0.408808 -0.047211 0.748385 -0.222172 0.279236 0.611849 0.647514 0.421540
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.735478 -0.396550 -0.906707 -1.062441 1.708710 2.165811 12.514755 36.277167 0.633484 0.664076 0.419749
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.081539 30.176818 -1.305750 -0.672633 -1.017044 3.140048 0.000267 0.626796 0.612451 0.505681 0.363496
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.599507 -1.048853 -0.735763 -1.087799 -0.121982 0.536642 0.740825 2.470814 0.654460 0.678701 0.395887
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.724632 28.011658 -0.538528 -0.722332 -0.248642 1.010372 -0.036470 1.726132 0.660437 0.559281 0.349139
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.563834 -0.026004 2.717776 1.572415 0.693200 -0.896951 -2.944948 -2.405465 0.671239 0.695036 0.381782
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.006058 0.973710 -0.630222 0.162879 0.065816 1.276552 0.618485 2.727877 0.676739 0.693662 0.390129
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.644858 0.192253 1.897250 -0.512437 11.843146 2.157195 2.755042 2.106503 0.660308 0.694631 0.393215
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 27.899361 -0.236848 2.928062 0.272552 3.901875 0.213536 1.187839 0.241728 0.495081 0.685443 0.391609
166 N14 RF_maintenance 100.00% 9.89% 100.00% 0.00% 50.120744 10.529465 0.162380 10.249623 5.509920 10.216043 1.169660 2.281796 0.254192 0.030676 0.134056
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.561937 -1.167916 -0.709670 3.559530 0.304258 -0.912585 -1.096247 5.629319 0.672239 0.674226 0.404467
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.714689 -1.050270 -0.334154 -0.759555 1.684780 1.350790 0.403696 2.063995 0.659756 0.688853 0.408137
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.886143 1.746645 -1.397911 -1.288664 0.439118 -1.408855 -0.893356 -1.350791 0.658195 0.669227 0.405753
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.458012 -0.522274 10.163148 -1.282687 8.888049 0.773622 1.884925 6.405843 0.035364 0.673258 0.497022
179 N12 RF_maintenance 100.00% 100.00% 88.00% 0.00% 10.590403 11.629971 10.156842 11.089411 8.794156 9.437727 1.606062 2.397926 0.059423 0.144075 0.074613
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.230396 11.911480 0.306645 10.831950 -0.008191 10.172534 43.715713 4.520454 0.644854 0.048860 0.477933
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.394014 -0.111207 -0.629460 0.121233 0.867034 -0.290481 -0.266096 10.096928 0.661922 0.677516 0.394797
182 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.022415 4.104822 -1.018196 3.620483 -0.249119 4.678294 24.895268 -2.146842 0.670455 0.675567 0.388716
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.214893 1.701687 0.631723 4.917431 1.439750 -0.565655 2.632765 0.153258 0.660566 0.632413 0.381762
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 10.001183 11.480593 10.079415 10.703035 8.991751 10.198930 1.658114 2.066858 0.025864 0.025298 0.001062
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 14.157161 -1.295065 8.762379 4.388578 9.282018 -1.606914 0.357183 0.214831 0.299718 0.652502 0.442774
186 N14 digital_ok 100.00% 100.00% 48.97% 0.00% 9.345602 11.343733 10.092433 9.057612 9.022612 8.691596 4.824396 2.719008 0.029994 0.225048 0.126235
187 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 10.050040 7.824178 9.820172 3.041367 9.093423 8.080914 4.447211 -1.455514 0.039817 0.350597 0.214186
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 8.663309 8.780949 1.530190 -0.117773 2.580299 5.760504 0.722161 0.063224 0.346854 0.374604 0.180938
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 42.700760 11.317012 -0.211205 10.795411 3.691871 10.179120 15.512804 4.937938 0.473235 0.032283 0.320865
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.961169 0.359900 3.569435 -0.122295 -0.072319 0.393909 14.185140 1.795007 0.609255 0.656625 0.437597
200 N18 RF_maintenance 100.00% 100.00% 45.78% 0.00% 11.375817 34.675500 4.028756 0.950707 9.086919 8.641990 3.177589 -1.275162 0.044813 0.218030 0.134738
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.140414 6.178676 5.453954 4.656489 7.164902 7.113479 -6.202621 -5.575051 0.616206 0.640394 0.385975
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.880490 2.126198 1.132200 -0.347340 -0.740749 -0.705231 -0.142216 5.914346 0.646946 0.624367 0.389944
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.883241 13.086375 3.778137 4.438707 9.034839 10.223537 5.061452 5.495733 0.033588 0.039919 0.000931
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.699123 3.163230 0.425856 -0.784580 -1.118540 -0.628815 -0.815553 18.045303 0.635749 0.633865 0.390999
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.191698 1.997792 -0.528692 -0.761316 15.546781 -1.100510 -0.702918 6.175064 0.620296 0.637516 0.388924
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.090006 2.694941 1.754074 -0.219452 0.796739 -0.479298 -2.362876 -0.972715 0.619563 0.636818 0.379072
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% 7.303578 4.392048 5.584407 3.803699 7.461269 5.152786 -6.574224 -4.720782 0.606605 0.644373 0.410114
220 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.822014 -0.654126 0.317582 -0.039419 -1.689222 -1.439013 5.083440 -1.701694 0.637981 0.646813 0.398185
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 1.925069 0.313551 -0.921989 -0.194284 -0.473659 -1.633699 4.934894 0.063976 0.605742 0.651578 0.406487
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.732714 0.637813 1.001032 -0.187910 -0.608654 -2.053170 7.530842 -0.619824 0.638751 0.653462 0.403518
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.674084 0.939861 -1.250911 -0.888490 -1.504449 -1.718374 -0.561541 -0.244499 0.620214 0.646516 0.400009
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.324449 6.751257 5.651249 5.166944 7.481685 8.335345 -6.437710 -6.392588 0.611133 0.628286 0.401575
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.421445 1.612244 1.190653 -1.016729 1.455258 -0.979065 6.137335 -0.812039 0.518748 0.625374 0.437079
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.385273 -0.607178 1.551681 1.004536 -0.465727 -0.887143 -2.762846 -2.725546 0.635501 0.645413 0.411228
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.459328 2.218521 -0.160921 0.789520 -1.170210 -0.505099 9.241913 8.303409 0.627630 0.586668 0.415701
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% nan nan inf inf nan nan nan nan 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% 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.011236 12.286466 -0.655823 6.920536 -0.770178 10.269183 10.759853 6.539395 0.620606 0.044760 0.462497
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.096447 2.426098 1.478058 1.786179 0.677783 0.490079 -0.228596 -1.799314 0.517505 0.537188 0.399956
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.740171 -1.044741 1.616529 -1.145185 0.230361 -0.488922 -2.698958 0.408722 0.552040 0.552503 0.411479
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.742339 -0.927447 -1.178465 -0.144575 -0.945654 -1.347481 -0.374641 -1.510491 0.485314 0.539846 0.403273
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.406309 0.728282 -1.118596 -1.325169 -1.175038 -0.942409 1.630026 -0.193788 0.480163 0.530748 0.399869
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 7, 8, 9, 15, 18, 19, 21, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 63, 68, 71, 73, 74, 77, 78, 80, 81, 82, 83, 84, 86, 87, 90, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 107, 108, 109, 110, 111, 113, 114, 116, 117, 118, 119, 121, 122, 123, 126, 130, 131, 133, 135, 136, 137, 138, 140, 142, 143, 145, 146, 150, 155, 156, 158, 159, 161, 164, 165, 166, 167, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 202, 203, 205, 206, 208, 209, 210, 211, 219, 220, 221, 222, 224, 225, 226, 227, 228, 229, 237, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320]

unflagged_ants: [5, 10, 16, 17, 20, 22, 35, 40, 41, 50, 62, 64, 65, 66, 67, 69, 70, 72, 79, 85, 88, 89, 91, 105, 106, 112, 115, 120, 124, 125, 127, 128, 129, 132, 139, 141, 144, 147, 148, 149, 157, 160, 162, 163, 168, 169, 207, 223, 238, 324, 325, 329, 333]

golden_ants: [5, 10, 16, 17, 20, 40, 41, 65, 66, 67, 69, 70, 72, 85, 88, 91, 105, 106, 112, 124, 127, 128, 129, 141, 144, 147, 157, 160, 162, 163, 169]
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_2459904.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.0.5.dev6+gfb03830
3.1.5.dev171+gc8e6162
In [ ]: