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 = "2459954"
data_path = "/mnt/sn1/2459954"
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: 1-9-2023
In [5]:
# Per-season options
def ant_to_report_url(ant):
    return f'https://htmlpreview.github.io/?https://github.com/HERA-Team/H6C_Notebooks/blob/main/antenna_report/antenna_{ant}_report.html'

Load Auto Metrics¶

In [6]:
use_auto_metrics = False

# find the auto_metrics file
glob_str = os.path.join(data_path, f'zen.{JD}*.auto_metrics.h5')
auto_metrics_file = sorted(glob.glob(glob_str))

# if it exists, load and extract relevant information
if len(auto_metrics_file) > 0:
    auto_metrics_file = auto_metrics_file[0]
    print(f'Found auto_metrics results file at {auto_metrics_file}.')
    
    auto_metrics = load_metric_file(auto_metrics_file)
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
    auto_ex_ants = auto_metrics['ex_ants']['r2_ex_ants']
    
    use_auto_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping auto_metrics.')
Found auto_metrics results file at /mnt/sn1/2459954/zen.2459954.21284.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/2459954/zen.2459954.?????.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/2459954/zen.2459954.?????.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 2459954
Date 1-9-2023
LST Range 1.800 -- 11.762 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
Total Number of Antennas 196
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 196 (0.0%)
Antennas in Commanded State (observed) 0 / 196 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 56 / 196 (28.6%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 128 / 196 (65.3%)
Redcal Done? ❌
Never Flagged Antennas 68 / 196 (34.7%)
A Priori Good Antennas Flagged 52 / 93 total a priori good antennas:
3, 5, 7, 9, 10, 15, 16, 29, 37, 38, 40, 42,
45, 53, 54, 55, 56, 71, 72, 81, 86, 94, 101,
103, 109, 111, 121, 122, 123, 128, 136, 140,
143, 146, 151, 158, 161, 164, 165, 167, 170,
173, 181, 182, 185, 186, 187, 189, 191, 192,
193, 202
A Priori Bad Antennas Not Flagged 27 / 103 total a priori bad antennas:
22, 35, 43, 46, 48, 61, 62, 73, 82, 89, 90,
95, 114, 115, 125, 132, 137, 139, 207, 211,
237, 238, 239, 245, 324, 325, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459954.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.982293 12.253801 8.725013 -0.493274 10.117277 5.205779 0.039209 11.126861 0.032143 0.343736 0.274432
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.294218 2.925504 7.230268 5.041798 3.088661 0.369447 1.484246 2.220344 0.484456 0.590360 0.422028
5 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 1.051270 -0.895843 6.167581 2.359469 5.282012 1.387110 8.211994 7.318499 0.527988 0.624425 0.435026
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.164510 0.069247 -1.236413 -0.319254 -0.257816 0.550886 14.221942 18.017227 0.621251 0.638970 0.399118
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.390903 -1.331590 -0.669341 0.001217 -0.613940 0.255776 6.551418 2.065366 0.621372 0.635626 0.395522
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.610707 -1.097011 7.690103 -0.449478 5.944077 -0.136313 0.249026 -0.469570 0.443014 0.636024 0.474065
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.460623 -0.348272 -0.745199 -1.261975 -0.591308 1.598544 0.364888 9.977770 0.613542 0.634405 0.403646
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.410949 16.706179 8.662232 -0.796417 10.154798 4.887963 -0.413672 2.158317 0.031872 0.344051 0.266092
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.417106 -0.673679 9.205381 0.777684 10.154626 1.866683 0.228914 2.794649 0.030114 0.640593 0.518055
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.805171 1.599090 0.282589 0.254292 0.136810 0.571083 1.351892 2.164306 0.627179 0.644761 0.405878
18 N01 RF_maintenance 100.00% 100.00% 56.24% 0.00% 11.042776 17.662699 9.177728 -0.617782 10.332810 8.764376 0.145991 17.915155 0.029297 0.219268 0.167795
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.380320 -0.827760 -1.206851 -0.765776 1.840169 2.131405 0.692706 2.650305 0.627075 0.649059 0.396185
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.650911 -1.005294 2.275990 -1.016828 -0.126815 0.661039 0.938037 -0.369483 0.620620 0.646134 0.401968
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.307706 -0.495822 -0.678332 0.036823 0.328221 1.630581 0.495063 0.579944 0.616204 0.631138 0.397062
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.555291 -0.191722 0.984483 0.689478 1.344702 2.018111 -0.481347 -1.192118 0.580654 0.600381 0.394576
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.717927 11.458063 9.238286 9.682340 10.324583 11.947785 2.150768 1.577794 0.033909 0.036634 0.004855
28 N01 RF_maintenance 100.00% 0.00% 85.20% 0.00% 11.690615 26.436512 -0.474164 0.943280 6.772147 8.404050 8.215130 19.946316 0.353574 0.151143 0.273619
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.453657 11.920656 8.843105 9.290543 10.295612 11.909234 0.145807 -0.082794 0.029420 0.032951 0.004132
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.172352 -0.026542 -0.250207 0.555424 0.540434 0.436144 3.996217 0.592925 0.633408 0.651607 0.396622
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.632891 -0.213488 1.077960 1.002405 1.539770 0.442168 1.420108 3.135220 0.641301 0.642048 0.390625
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.635087 19.306352 -0.232656 2.295025 0.472284 7.973366 2.126658 30.779905 0.627387 0.556031 0.377387
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.931096 13.064691 3.883346 4.213089 10.237950 11.867183 1.065262 0.913674 0.031343 0.039280 0.005651
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.421240 -0.005211 0.956520 -1.288185 -0.725002 -0.803660 3.815518 0.265065 0.590734 0.586126 0.388035
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 26.346438 26.014653 12.350117 12.321745 10.463528 11.876242 5.032626 5.230390 0.029131 0.027194 0.001952
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.318263 0.510933 -1.131403 1.339318 0.510215 0.698855 -0.468137 4.870512 0.628364 0.637027 0.411441
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.215436 0.203798 0.053900 0.554273 -0.061468 0.547262 8.235874 2.361471 0.631409 0.646518 0.412405
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 9.809263 0.108832 8.878477 0.425488 10.299295 -0.430068 1.565880 0.798624 0.034248 0.639444 0.506016
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.663984 0.005211 -0.104823 -0.029821 2.188335 0.128545 -0.556551 0.364829 0.632210 0.650586 0.392328
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.019883 12.445913 9.503570 10.172659 9.993863 11.639114 1.415338 2.507979 0.026514 0.025844 0.001261
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.062092 0.399662 -0.250709 0.586379 -0.702467 0.374958 -0.173110 0.722506 0.631052 0.640276 0.388456
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.752982 0.061071 -0.579190 0.058662 -0.658165 0.154374 -1.065609 -0.377975 0.633733 0.649218 0.388225
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.091219 2.249711 0.116844 0.547646 -0.836276 1.981071 0.078405 5.228711 0.627345 0.636424 0.382583
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.103583 0.347389 -0.911577 -0.591993 -0.660394 -0.343002 -0.617183 -0.759808 0.628435 0.653486 0.404918
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.130786 12.789982 3.712779 3.855917 10.172729 11.770014 0.697538 -0.157818 0.029231 0.041760 0.008954
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.014413 1.271190 1.040080 2.318846 -1.122212 2.633795 -0.779482 -2.594888 0.595815 0.620242 0.398817
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.008439 -0.076364 -1.129553 0.188356 0.733028 -0.311001 0.635320 8.215340 0.542534 0.589692 0.395371
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.296173 21.250729 0.152735 1.220226 0.351493 2.547885 5.228912 52.863747 0.607017 0.554424 0.382715
51 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 23.110514 4.472870 11.836995 -0.494445 10.523701 5.386780 10.278098 3.030534 0.034927 0.527143 0.404152
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.267846 6.584387 -0.435354 0.476663 1.178984 0.404264 0.610596 1.320776 0.635358 0.647086 0.401245
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.966009 2.991803 0.040915 0.331849 1.370726 2.023737 3.696389 7.288513 0.641486 0.654647 0.406254
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.172176 12.110625 9.255937 9.907349 10.243630 11.866187 2.239378 1.334256 0.026458 0.025603 0.001186
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.671990 12.780606 9.264509 9.806459 10.281706 11.882770 1.001630 3.221565 0.027475 0.028884 0.001821
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.159401 12.903874 0.363792 10.031213 -0.619286 11.743274 2.150661 1.469323 0.640786 0.033732 0.523846
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.677548 -0.599393 6.311195 0.528275 5.621692 1.771063 8.618053 2.212030 0.512734 0.661158 0.432791
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.810046 11.821106 9.145585 9.802655 10.164109 11.834767 1.331802 1.135346 0.030866 0.031181 0.001873
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.894909 0.744078 5.594929 2.291443 28.061303 1.538173 186.494159 11.840929 0.048375 0.631694 0.522049
60 N05 RF_maintenance 100.00% 0.00% 99.95% 0.00% 0.584090 11.704068 -0.440060 9.831611 -0.532550 11.888803 1.970589 2.745781 0.626297 0.056106 0.517038
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.798490 0.251541 -0.774364 -1.239175 1.918122 -1.184282 -0.667431 0.397040 0.566051 0.603122 0.385428
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.789637 0.806091 -0.829333 1.594740 -0.837935 -0.184843 2.905872 -0.954955 0.560522 0.618215 0.402240
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.197889 12.149898 0.284445 4.239539 0.500765 11.968241 -0.808797 2.692689 0.592295 0.040157 0.477090
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.366613 0.446880 -0.278150 -0.973501 -0.683457 -0.632027 5.747564 5.758175 0.574745 0.571160 0.378563
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.596424 1.079491 0.302869 1.066615 -0.017614 0.342992 -0.373941 -0.559091 0.611748 0.632504 0.416613
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.527985 1.666472 -1.243103 -1.203542 3.508604 -0.267611 -1.102661 -0.248612 0.628730 0.647961 0.411494
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.402694 -0.698337 -0.296452 1.267724 -0.652638 0.358341 0.091715 2.401750 0.636706 0.648324 0.403263
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 21.353882 26.239506 1.113371 12.994033 4.851063 11.925676 -0.080507 10.784862 0.353865 0.026932 0.256861
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.700965 -0.793636 0.153235 0.745989 -0.568963 1.286923 -0.375511 0.205837 0.637176 0.654563 0.388731
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.106228 -0.358121 -0.227594 0.059785 0.987809 1.401531 0.441643 -0.051521 0.642009 0.659838 0.388794
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 8.333221 -0.008495 0.588422 0.861327 0.614116 -0.401124 0.013828 0.345377 0.656368 0.656746 0.381651
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.320138 12.968373 9.605067 10.192015 10.020117 11.624653 0.718160 1.147642 0.026614 0.025076 0.001611
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.608247 0.855705 -1.301246 -0.942698 0.860291 1.612524 -0.511147 -0.468588 0.646010 0.658549 0.384927
74 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.726116 0.715460 0.440808 -0.588637 0.145504 1.778490 -0.109868 5.687857 0.642476 0.652115 0.380632
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 57.439540 1.059723 0.734770 0.314299 8.097721 -0.810475 10.542012 -0.733710 0.310824 0.608646 0.436198
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 34.582043 0.141300 -0.193551 1.563142 2.003338 0.271806 -0.681434 1.363905 0.415541 0.623834 0.390407
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.511314 12.517482 -1.083496 4.260112 -1.224232 11.747578 2.581272 -0.657155 0.587782 0.037328 0.462295
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -1.031983 13.351739 0.385431 4.164633 1.185863 11.795164 15.409664 0.978585 0.587399 0.040783 0.464203
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.187651 12.663579 0.000341 8.487624 -0.576022 11.422210 -0.686112 1.303904 0.586809 0.034894 0.458579
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.695997 -0.075635 0.293892 1.985401 -0.776606 -1.126293 -0.842055 0.108755 0.606864 0.614612 0.395081
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.632264 -0.153905 0.093085 0.348550 0.536244 -0.707690 -1.052518 0.083762 0.618113 0.639108 0.399925
84 N08 RF_maintenance 100.00% 76.82% 100.00% 0.00% 20.417178 23.316505 12.003385 12.557127 8.670480 11.791284 4.111004 4.641088 0.185131 0.033024 0.119650
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.616156 0.522773 -0.039118 0.652683 -0.820362 -0.690763 -0.392314 -0.852599 0.639464 0.652493 0.391783
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.715296 -0.130680 0.547187 0.856730 4.603407 -0.996958 0.357798 21.490642 0.625485 0.640159 0.369757
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.260866 7.551355 -0.583749 -0.275524 4.079398 1.456790 0.015735 1.071238 0.649590 0.672467 0.380954
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.662917 0.722521 0.335942 0.661210 -0.516239 0.047623 -0.604976 -0.490640 0.644267 0.660950 0.374329
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.113881 0.443195 -0.063542 0.755718 -0.449229 -1.053662 -0.517519 -0.091226 0.649714 0.662031 0.377683
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.019885 -0.502763 0.848262 1.225086 -0.984356 -0.901158 -0.252876 2.628317 0.642519 0.655391 0.380222
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.377105 -0.464785 0.278271 0.189833 -1.271763 -1.036945 0.791245 -0.049670 0.638940 0.662620 0.391557
92 N10 RF_maintenance 100.00% 0.54% 38.90% 0.00% 35.483004 41.373301 0.492244 1.155418 5.174128 5.398630 -0.174194 8.810204 0.269958 0.227937 0.088778
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 2.172351 0.255967 2.075840 -1.118952 2.356994 0.165057 3.109173 -0.674646 0.619943 0.647836 0.397386
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.195106 12.217583 9.395615 9.700581 10.246364 11.853542 0.756650 0.474971 0.028747 0.025564 0.001716
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.719067 -0.041113 -0.409401 1.323486 -0.757004 0.506609 -1.174677 0.681118 0.599138 0.634191 0.404290
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.469628 12.963229 3.746793 4.360127 10.002584 11.639326 0.463866 0.553153 0.032679 0.036641 0.001962
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.870834 5.399913 -0.837130 0.980582 -1.245048 2.904616 9.341642 9.279451 0.581527 0.544854 0.387812
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.916625 8.893974 -0.495504 1.136802 -0.138167 1.287420 0.078444 -0.264569 0.640038 0.652632 0.392445
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.611052 1.190858 -0.405430 -1.222659 0.229154 0.009076 -0.944146 13.008174 0.648600 0.662532 0.391191
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.015643 5.648191 4.380476 -1.119705 0.650983 0.593607 12.724671 12.401634 0.616078 0.666473 0.392915
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.204218 60.387567 -1.039865 6.713602 1.599405 0.397391 0.832648 4.315084 0.655389 0.632655 0.379732
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.372099 -0.257361 0.137541 0.739705 0.437077 -0.713974 -0.862126 -0.625923 0.651453 0.661418 0.371680
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.626778 1.489699 1.742823 -0.593017 1.245714 -0.323235 0.154850 -0.034598 0.630493 0.666109 0.377198
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 3.731193 1.074636 -0.867578 -0.997773 0.533679 -0.304362 3.294264 3.699955 0.651894 0.671867 0.379609
108 N09 RF_maintenance 100.00% 100.00% 0.38% 0.00% 10.287291 39.336522 9.184576 0.665377 10.243074 5.689396 1.508765 2.344289 0.032473 0.269365 0.149027
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.095908 11.783728 9.216779 9.566099 10.373235 11.963249 0.029304 1.729201 0.026356 0.025952 0.001336
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.436163 24.811358 12.406265 12.757903 10.218606 11.736952 4.252322 4.695757 0.023096 0.024436 0.000846
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.092104 11.679308 0.373182 9.662935 -0.894691 11.988668 0.672901 1.858831 0.632764 0.032057 0.448831
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.863991 -0.518895 0.182632 0.263239 0.172618 2.829211 -0.310060 -0.725555 0.624920 0.640601 0.402406
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.194686 13.081221 3.533509 4.253807 10.052116 11.714183 1.097890 0.306991 0.033223 0.030626 0.001577
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.002309 0.791221 -0.536342 0.295438 1.400075 -0.757495 1.022307 0.063264 0.580270 0.619741 0.399548
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.051463 -0.711880 -0.401087 -0.016923 -0.358804 -1.040645 -1.043774 -0.366727 0.573529 0.603783 0.405328
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.135561 13.222333 9.310860 10.148980 10.048161 11.829473 0.816155 4.005808 0.027382 0.029447 0.001746
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 1.349006 1.387043 -0.321117 0.494677 -0.617606 -0.497087 0.263984 1.654999 0.605596 0.635797 0.403659
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.464891 1.470231 2.502060 -0.953460 0.592681 1.306319 11.297881 4.434811 0.623427 0.659491 0.389777
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.532065 3.603890 -1.212153 5.483388 0.475646 -0.238888 9.855543 17.437753 0.649882 0.638080 0.375535
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.435325 7.023492 0.086183 0.850573 1.890038 1.254359 -0.760371 -0.898431 0.655994 0.667899 0.381974
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.273082 9.345194 0.639453 0.916900 -0.104526 -0.456921 -0.845863 -0.434356 0.661542 0.674738 0.384850
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.378963 0.228229 -0.130059 0.589091 -0.493024 -0.361471 0.254405 -0.030712 0.661346 0.669117 0.378906
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.974732 -0.690112 -0.379650 0.670649 0.153625 -0.557228 0.458644 -0.423885 0.654065 0.667334 0.379859
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.801675 6.853874 -1.205328 1.422166 3.339309 0.930858 1.224498 0.951927 0.656736 0.660305 0.384204
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.034861 -0.018350 0.471143 0.395053 1.434474 0.904099 -0.271203 0.723725 0.642331 0.661965 0.393355
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.629442 11.350416 9.305195 9.804401 10.092673 11.749085 -0.195899 0.457211 0.027903 0.026652 0.000977
131 N11 not_connected 100.00% 0.00% 2.86% 0.00% -0.682629 11.619156 0.457627 4.084297 -0.849656 10.448714 -1.456785 -0.198851 0.617566 0.300358 0.442008
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.227292 1.808056 -0.431736 -1.060474 -1.304881 -0.690469 2.874256 0.030712 0.590554 0.606649 0.387507
133 N11 not_connected 100.00% 100.00% 0.00% 0.00% 11.776525 -0.142982 3.505860 -1.220383 10.209296 -0.128247 1.266886 -0.846550 0.063679 0.601355 0.478741
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.703529 -0.659864 -0.237157 -1.087492 4.382173 0.547005 7.633818 1.189418 0.584522 0.619356 0.422039
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.404836 0.577386 8.822364 0.309952 10.311598 9.434154 1.097509 0.210618 0.035364 0.614670 0.460543
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.494789 -0.573736 0.112666 -1.094499 2.037212 -0.645676 0.867503 0.296885 0.589967 0.631539 0.412039
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.734289 -0.383632 2.017265 -0.415125 0.667005 -0.346633 -2.109288 -0.798298 0.625203 0.633181 0.387092
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.229351 -0.103767 -1.050271 0.271038 -0.673933 0.025500 6.961509 5.714540 0.640008 0.666072 0.388928
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.280190 -0.618529 -0.313714 1.140715 1.659329 -0.516029 0.658712 -0.591658 0.643884 0.669267 0.384678
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.986534 11.666516 -0.657863 9.834471 4.299769 11.950328 37.544367 2.557208 0.649115 0.040940 0.526721
143 N14 digital_ok 100.00% 0.00% 100.00% 0.00% -1.071611 12.163688 0.818910 9.904135 1.165385 11.589102 -0.204669 2.410249 0.649107 0.036357 0.534133
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.114479 0.180629 -1.119403 0.290843 -0.160829 0.200257 -1.169140 -0.850414 0.660940 0.671216 0.380299
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.238918 1.310708 -1.057866 4.162888 -0.074479 9.204092 -0.315222 1.372695 0.657587 0.637979 0.387739
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.593109 -1.102207 3.517114 0.269488 10.172283 -0.997212 -0.257784 -0.789329 0.036744 0.656149 0.515552
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.765259 -1.550413 1.047040 2.160365 -0.937401 -1.135720 -0.513042 1.248154 0.629454 0.642511 0.384835
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.375719 0.105991 -0.598311 -0.530227 1.852601 1.323136 -0.045722 -0.213119 0.634673 0.653946 0.396086
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.371576 -1.128943 -1.183564 -0.933723 -0.603382 1.281145 2.845383 3.011758 0.627914 0.649086 0.400152
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.013761 -0.752388 -0.627357 -0.818996 -1.184077 0.304830 -0.421086 0.242189 0.620555 0.637665 0.399745
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 27.276652 1.116176 0.385218 0.357040 4.015806 -0.197768 0.725485 -0.460678 0.479855 0.583548 0.356469
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.786972 -0.173313 8.972715 -1.289386 10.349708 0.292296 1.881249 5.967315 0.037252 0.615901 0.479360
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 6.226876 11.538802 8.328730 9.579445 7.193401 11.932916 1.196951 1.783739 0.328419 0.035391 0.248006
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.402172 -0.174792 -0.110961 0.702856 -0.681977 0.651027 -0.674336 0.280666 0.604517 0.629504 0.407802
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.541497 0.098459 -0.194285 -0.341452 2.567421 1.680262 5.609860 24.466652 0.619694 0.646015 0.409772
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.203610 18.556387 -0.940096 -0.752995 -0.507120 7.252971 -0.615259 23.972725 0.591546 0.556014 0.371593
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.730164 -1.144247 -0.342509 -0.604873 -0.897368 1.452475 1.519198 1.349157 0.633725 0.654875 0.393465
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.955516 28.122957 -0.105135 -0.461722 -0.246602 1.704704 -0.499186 0.243295 0.639640 0.526811 0.347091
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.497023 -1.153388 -0.358823 -0.803605 2.040186 1.303278 2.677786 0.567321 0.654793 0.670810 0.387317
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.585260 1.296491 -0.259314 0.427347 -0.467739 0.710152 0.064340 1.782179 0.657155 0.668463 0.389838
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.987055 0.596706 0.633670 -0.028037 5.529208 2.500798 2.056816 2.133286 0.650157 0.669472 0.383108
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 33.489406 0.054947 -0.301534 -0.993995 5.558637 -0.137012 2.299722 -0.208906 0.515579 0.668933 0.381948
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.336947 1.915182 -0.999911 0.559216 0.087198 1.173396 9.532155 13.076642 0.655207 0.665444 0.389376
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.845492 -1.064253 -1.293040 -0.098776 1.648123 0.334538 1.025266 7.573373 0.636047 0.649541 0.388229
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.931146 -1.245193 0.189899 -0.344678 1.494577 0.040606 -0.082222 2.877000 0.631858 0.651274 0.396864
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.484064 -0.799812 -0.921404 -1.020484 0.375302 0.426250 -0.892059 -0.947347 0.633961 0.652707 0.397732
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 11.026275 -0.803799 9.507603 -1.271991 10.054883 -0.609772 2.509588 1.451788 0.035489 0.648083 0.507814
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.724599 2.661761 -1.240265 0.573703 -1.275639 2.557934 -0.845209 0.439383 0.582785 0.567011 0.374930
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 12.311538 12.624298 3.260081 3.876605 10.399377 11.983325 3.129428 6.097130 0.037763 0.040815 0.003201
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.257809 -0.490545 -0.284592 0.981867 -1.128273 2.193630 -0.237709 43.940067 0.613784 0.633833 0.400305
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.434984 12.425963 -1.062186 9.969302 2.014912 11.792581 27.653246 2.362819 0.635509 0.046454 0.527968
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.588641 -0.358380 -0.032373 0.308263 -0.495062 -0.201035 -0.636213 5.758295 0.641724 0.654227 0.395619
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.287996 11.458549 -1.076075 9.545796 -0.775723 11.971497 20.440070 1.954936 0.650347 0.041966 0.500872
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.233588 0.519748 -0.938443 0.016923 1.301478 -0.458599 1.428621 0.079938 0.643262 0.657330 0.382762
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.055085 -0.693750 -0.780911 -0.401419 -0.312091 0.017614 1.312059 0.296234 0.650787 0.668549 0.381076
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 38.807925 -0.136217 -0.141799 -1.272397 11.049412 0.203681 2.562560 0.424315 0.514478 0.666126 0.384515
186 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.615949 -1.189636 -1.153345 -0.060240 1.747918 -0.063803 0.636459 5.174477 0.657937 0.676499 0.398487
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.107660 1.627284 -0.948077 1.958113 -0.073279 0.124724 3.024147 19.362181 0.653233 0.670639 0.390922
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 8.848371 11.355130 8.765225 9.675887 10.189360 12.028645 14.731388 2.839171 0.027240 0.028875 0.000950
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.319523 -1.228372 -0.716719 0.880148 -0.803419 0.374102 -0.620117 -1.567458 0.627344 0.652841 0.406294
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.508695 0.533069 1.179278 -0.357027 -0.000189 0.438736 11.874692 1.916621 0.612780 0.636956 0.402601
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 7.004802 7.759836 5.487840 5.352858 7.855407 9.452622 -4.701598 -4.529866 0.578557 0.600365 0.395263
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 7.586619 0.673781 5.565457 2.125544 8.022530 2.779532 -4.626355 -0.178334 0.567584 0.612465 0.423766
200 N18 RF_maintenance 100.00% 100.00% 61.26% 0.00% 11.983172 35.900494 3.660360 1.162949 10.367307 7.214875 1.154819 0.176724 0.037827 0.210609 0.143516
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.746468 5.653562 3.512306 4.676045 3.028438 7.648462 -0.101927 -2.967938 0.626491 0.627287 0.392956
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.747438 2.007404 2.178720 -1.166626 0.988358 -0.000777 -1.094952 31.172500 0.635185 0.622031 0.387028
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.660757 2.723308 1.109751 -0.936576 -1.045713 -0.450100 -1.284255 7.259219 0.627828 0.617625 0.381586
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.519660 1.647158 2.523098 -0.328610 16.449356 -0.165777 -1.569611 4.913473 0.631265 0.629045 0.383421
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.956554 3.482423 1.882695 -0.119876 0.458027 -0.206856 -1.447614 -1.388837 0.613322 0.615657 0.362570
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 8.068627 12.403506 8.418839 11.210916 10.298862 9.903866 13.098338 93.575705 0.033734 0.032427 0.002148
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 7.299193 8.452730 8.496646 8.694354 9.245003 12.152657 19.750140 21.802066 0.039912 0.038405 0.001523
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 13.389810 12.284032 -0.854832 -0.862123 -0.910860 -0.407200 -1.143947 2.625224 0.628472 0.641992 0.397921
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.914867 -0.748030 -0.590810 0.513392 -0.956503 -0.528608 3.988808 0.109010 0.579629 0.615737 0.398831
220 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.247494 -0.570034 0.961407 0.062634 -0.486754 -0.408329 4.890134 -1.350099 0.619426 0.629330 0.391768
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.663127 -0.112854 -0.618308 -0.173935 0.215028 -0.281269 5.310497 -0.758387 0.603982 0.634362 0.396236
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.783891 1.080657 0.250228 -0.537215 -0.159740 20.521980 3.094827 0.583998 0.612543 0.606499 0.388300
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.964943 1.207064 -0.821335 -0.906705 -0.162466 -1.013803 -0.125254 14.126880 0.605415 0.630537 0.388499
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.633039 7.280025 5.676719 5.328901 8.113617 9.392357 -4.699802 -4.398013 0.601561 0.622741 0.388859
225 N19 RF_ok 100.00% 0.00% 87.36% 0.00% 1.522112 11.957446 1.340678 4.046751 -1.037275 11.628252 -1.493454 1.238622 0.627042 0.133877 0.529650
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.306273 8.283098 0.650427 1.868597 -1.284352 3.846813 -1.008847 10.762263 0.619764 0.598923 0.381503
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.825335 0.562524 -0.949927 0.573715 0.255491 -0.372509 17.067620 1.203617 0.585994 0.627727 0.391679
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.460786 18.031516 -0.933044 0.321367 1.240359 3.660123 21.216721 31.802847 0.544203 0.529681 0.336813
229 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.635943 0.310486 1.830923 1.848105 -0.401491 1.412422 8.056626 -2.207176 0.603509 0.623969 0.403168
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.458531 0.064728 -0.204888 -1.015199 0.134514 -0.657046 -1.060604 -1.132560 0.550225 0.609387 0.413928
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.250034 -0.404272 1.898656 1.301728 -0.068994 -0.067563 -2.131488 -2.138967 0.615193 0.630582 0.403835
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.563589 -0.662309 0.927724 1.104674 0.082890 -0.321895 0.529694 2.935512 0.612454 0.632173 0.399373
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 34.206749 55.883639 -0.011544 1.150585 2.785436 6.834921 29.172480 14.136618 0.460178 0.392966 0.242165
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.145482 4.039568 -0.262128 0.405654 -0.922770 0.784429 7.497859 23.989132 0.602600 0.584240 0.393079
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 50.198392 2.130611 0.774520 2.205001 8.067154 1.925742 20.230071 -0.915756 0.362107 0.635832 0.473368
243 N19 RF_ok 100.00% 26.47% 0.00% 0.00% 60.781888 2.619823 1.229250 -0.958988 7.062235 -0.708495 -1.886927 0.307704 0.260087 0.611842 0.497116
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.887040 2.151909 1.153981 -0.812291 3.314490 2.619317 3.359893 9.536256 0.483988 0.588365 0.396907
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.684998 2.559770 0.184315 -1.009352 -1.278683 -0.848171 -1.618994 0.160144 0.595452 0.602483 0.393845
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.663110 8.183003 -0.674317 0.088893 4.894421 5.742053 5.646157 -0.149863 0.309787 0.319889 0.162521
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.523273 1.548562 1.191534 0.052650 -0.424227 -0.819880 -0.483654 15.418897 0.594338 0.603728 0.397011
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.937511 8.495628 8.616866 9.363314 10.102192 10.835565 20.692638 36.319797 0.029702 0.026309 0.002984
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 6.285996 12.425175 2.281085 6.289360 1.325484 11.979049 30.130251 2.964188 0.441972 0.041966 0.354160
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.413473 2.632012 1.641543 2.004665 0.408545 1.762474 1.171762 -0.184777 0.495667 0.518551 0.388451
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.708015 -0.729455 1.766241 -0.746868 0.937942 -0.453448 -1.476799 0.227990 0.524286 0.529519 0.398772
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 4.949019 -0.796994 1.064517 -0.440510 2.276456 -0.405753 1.540453 -0.329402 0.410179 0.527723 0.397833
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.222524 2.914829 -0.690806 -1.052783 -0.254562 -0.701637 1.244681 0.243452 0.456703 0.501850 0.381164
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 5, 7, 8, 9, 10, 15, 16, 18, 27, 28, 29, 32, 34, 36, 37, 38, 40, 42, 45, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 64, 68, 71, 72, 74, 77, 78, 79, 80, 81, 84, 86, 87, 92, 94, 96, 97, 101, 102, 103, 104, 108, 109, 110, 111, 113, 117, 120, 121, 122, 123, 126, 128, 131, 133, 135, 136, 140, 142, 143, 145, 146, 151, 155, 156, 158, 159, 161, 164, 165, 166, 167, 170, 173, 179, 180, 181, 182, 185, 186, 187, 189, 191, 192, 193, 200, 201, 202, 205, 206, 208, 209, 210, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 240, 241, 242, 243, 244, 246, 261, 262, 320, 329]

unflagged_ants: [17, 19, 20, 21, 22, 30, 31, 35, 41, 43, 44, 46, 48, 61, 62, 65, 66, 67, 69, 70, 73, 82, 83, 85, 88, 89, 90, 91, 93, 95, 105, 106, 107, 112, 114, 115, 118, 124, 125, 127, 132, 137, 139, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 168, 169, 171, 183, 184, 190, 207, 211, 237, 238, 239, 245, 324, 325, 333]

golden_ants: [17, 19, 20, 21, 30, 31, 41, 44, 65, 66, 67, 69, 70, 83, 85, 88, 91, 93, 105, 106, 107, 112, 118, 124, 127, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 168, 169, 171, 183, 184, 190]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459954.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.0.5.dev13+gd6c757c
3.2
In [ ]: