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 = "2459889"
data_path = "/mnt/sn1/2459889"
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-5-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/2459889/zen.2459889.25281.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 1849 ant_metrics files matching glob /mnt/sn1/2459889/zen.2459889.?????.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/2459889/zen.2459889.?????.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 2459889
Date 11-5-2022
LST Range 22.491 -- 8.442 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1849
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 7
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 96
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 201 (0.0%)
Antennas in Commanded State (observed) 0 / 201 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 18
Nodes Registering 0s N20
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 64 / 201 (31.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 138 / 201 (68.7%)
Redcal Done? ❌
Never Flagged Antennas 63 / 201 (31.3%)
A Priori Good Antennas Flagged 59 / 96 total a priori good antennas:
3, 7, 19, 29, 30, 31, 37, 38, 44, 45, 51, 53,
54, 55, 56, 59, 68, 71, 81, 84, 86, 93, 94,
98, 99, 101, 103, 107, 108, 109, 111, 117,
121, 122, 123, 130, 136, 140, 142, 143, 144,
158, 161, 162, 164, 165, 167, 169, 170, 181,
183, 184, 185, 186, 187, 189, 190, 191, 202
A Priori Bad Antennas Not Flagged 26 / 105 total a priori bad antennas:
4, 35, 43, 46, 48, 49, 62, 64, 79, 82, 89,
95, 115, 120, 125, 132, 137, 139, 148, 149,
168, 207, 221, 238, 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_2459889.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% 12.040116 -0.715681 9.874398 0.182277 11.027024 0.917848 1.798411 3.452680 0.034921 0.671868 0.546163
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.993932 2.960411 0.133876 0.033447 0.177742 -0.115571 2.500503 0.035644 0.681806 0.664920 0.393644
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.672068 -0.159687 -0.723731 -0.528514 -0.347840 0.698441 0.310918 0.172328 0.686060 0.673747 0.390881
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.006061 -1.144105 -0.294401 -0.171297 0.444540 1.405885 17.931193 19.525977 0.679690 0.674654 0.387978
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.242672 -1.630210 -1.013145 -0.216457 -0.592919 -0.182831 5.814225 0.829423 0.671655 0.667300 0.379646
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.206076 -0.217752 -0.326419 0.347850 -0.123656 0.565614 -0.389149 0.912450 0.672309 0.665839 0.390236
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.834703 -0.889106 -1.427144 -1.478827 -1.231727 2.617889 -0.686690 -0.199873 0.667055 0.664631 0.396010
15 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.071722 -0.347503 0.510625 0.676088 -0.462095 0.520797 0.675034 1.848773 0.683231 0.678632 0.391238
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.150412 -1.491302 -0.973978 0.089284 0.230026 0.687677 2.611761 3.041044 0.685312 0.678685 0.386063
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.538609 0.908237 -0.427136 -0.216294 0.348540 0.319405 0.848944 0.342675 0.687509 0.682612 0.387046
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.762990 16.878127 -1.012978 -0.105453 2.711420 5.401451 24.150221 37.381233 0.663656 0.460959 0.463699
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.431561 -1.034644 0.090794 1.067580 2.593756 83.931602 4.654608 16.227962 0.677197 0.669496 0.383365
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.895238 -1.199351 -0.758199 -0.864427 0.780658 -1.515117 0.700521 -1.689490 0.682756 0.688980 0.387529
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.145580 0.211114 -0.665739 0.083552 0.413151 0.433936 0.688256 0.058674 0.666146 0.665030 0.386244
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% 35.374093 11.360390 -0.913761 -0.780061 9.227552 6.162446 10.148223 6.668996 0.462497 0.605534 0.314152
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.065351 13.600295 9.905650 10.661620 11.145932 12.977859 4.499778 3.410342 0.033970 0.038837 0.004934
28 N01 RF_maintenance 100.00% 0.00% 84.37% 0.00% 14.781690 31.644397 0.909439 0.692178 7.133510 15.485063 8.827090 28.318967 0.367769 0.161695 0.259588
29 N01 digital_ok 100.00% 0.00% 100.00% 0.00% -1.186867 14.128181 -0.689314 10.242025 -0.555630 12.933623 -0.512022 0.894270 0.692127 0.037979 0.580381
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -1.229606 -0.568344 -1.910423 0.087438 0.862037 0.644626 6.167949 -0.011778 0.692974 0.688369 0.376690
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.059232 -1.139061 -0.748051 0.322184 0.327687 4.178055 3.939272 5.271100 0.701064 0.689219 0.382470
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.864194 27.770514 0.295323 -0.218881 17.884751 7.360887 3.301696 1.612140 0.634853 0.593892 0.313493
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 14.053279 1.630012 3.986661 -0.367310 11.109663 9.914543 2.454750 2.381797 0.045288 0.657004 0.490373
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.350549 0.541135 1.408195 -1.683884 0.248916 -2.120624 -1.329643 0.033973 0.649344 0.637570 0.389137
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.467927 9.032714 -0.411705 0.003751 1.276981 2.171282 1.058046 3.294444 0.677298 0.676546 0.390663
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.340306 0.235737 -1.071530 0.336725 -0.102545 0.494949 -1.316080 12.389730 0.689286 0.687565 0.395897
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.112912 0.123531 -0.491782 0.125197 0.697056 1.867319 8.682857 3.059508 0.690938 0.691816 0.395297
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.006853 0.416953 -0.585517 0.116394 -0.160067 0.043853 0.538093 0.804024 0.687412 0.685125 0.382945
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.056912 -0.121116 -1.159322 -0.366308 0.632233 0.065253 0.266379 0.494519 0.693914 0.690062 0.376940
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.268720 0.754737 -0.490317 0.576265 0.817553 0.151504 0.473535 0.540830 0.702641 0.690495 0.386282
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.465428 0.203642 0.146413 0.151528 0.641693 0.054187 -1.779952 0.829520 0.707338 0.694840 0.381001
44 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.786236 1.956591 -1.040874 -0.836719 0.333830 -0.182872 10.065690 8.630993 0.688127 0.689457 0.369812
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -0.611403 0.969119 -0.484383 -0.023478 -0.120977 0.872707 0.783970 6.584352 0.691698 0.683461 0.375138
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.332050 1.673982 0.849219 2.069765 0.345119 0.394990 0.202401 -2.897963 0.679100 0.697857 0.389552
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 13.078255 2.377437 3.791846 -1.581895 11.086077 -0.186905 2.668936 4.293250 0.040024 0.652802 0.475524
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.092333 1.273071 1.238273 1.445860 -0.902777 -0.159232 -0.737328 -2.926603 0.653046 0.668807 0.394934
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.192331 0.350062 -1.734372 0.742634 -1.334974 -1.510033 -0.189791 -1.262954 0.621700 0.653982 0.392131
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.078898 19.609088 -0.561817 0.736288 2.087178 13.010042 3.819976 36.556512 0.668257 0.613511 0.366352
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 28.130937 0.920473 12.842116 -0.194012 11.268065 2.247671 15.898717 7.941861 0.043303 0.691116 0.547844
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.337007 7.701807 -0.955096 0.079851 1.276924 1.294356 1.739539 1.947924 0.692354 0.697458 0.383943
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.469640 3.147058 -0.764986 -0.317706 0.828769 1.074126 4.312814 10.460755 0.698166 0.701707 0.386217
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 12.105479 14.456348 9.913861 10.915088 11.205858 13.018173 5.727280 4.000002 0.047735 0.047012 0.001076
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.526700 15.296717 -0.071385 10.818379 6.278966 12.928260 1.992927 5.554635 0.690684 0.036905 0.518055
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.040388 15.410712 -0.215736 11.032651 -0.039935 12.997935 2.503144 4.440392 0.696858 0.040241 0.531016
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 34.664671 -0.125459 5.194138 0.099271 5.826296 2.611097 6.125290 5.990811 0.510481 0.700203 0.379149
58 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.056770 14.043965 -1.181974 10.780655 0.373947 13.049432 3.576193 4.347165 0.702797 0.039313 0.502336
59 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 5.909399 5.538661 -1.700649 0.170169 8.764738 0.945584 15.085967 11.409717 0.676994 0.682169 0.365071
60 N05 RF_maintenance 100.00% 0.00% 97.89% 0.00% -1.297872 13.987958 0.167737 10.821420 -2.167446 12.923137 -0.912053 5.691185 0.700570 0.083437 0.534286
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 2.807803 3.088145 -1.622617 -0.138619 1.515541 -2.088797 -0.160910 4.396362 0.637755 0.633972 0.371150
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.349862 1.486073 0.377378 1.151032 -1.033493 -0.336338 -0.573032 -2.319569 0.647535 0.673379 0.383696
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.059073 14.453883 0.329051 4.669196 -1.675115 12.947326 -0.819472 5.147270 0.636137 0.047258 0.470620
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.058492 0.183865 -0.975758 0.308693 -1.821170 -2.232666 -0.323678 -1.870821 0.609015 0.637441 0.387768
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.267272 1.336925 -0.211491 0.614968 1.430945 0.977253 -0.419485 -0.038999 0.670652 0.686821 0.397309
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.042338 1.558777 1.773207 1.697976 2.743448 1.393551 0.364600 2.655462 0.675892 0.689452 0.388241
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.239809 -0.885742 0.853054 0.879171 -0.109589 0.181918 1.068316 3.655993 0.684494 0.694837 0.380470
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.092917 31.782587 -0.109535 14.377652 0.082917 12.611226 1.333346 15.931505 0.693325 0.034216 0.547455
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.148697 -0.760708 -0.312697 0.266269 0.343595 2.076406 0.566989 1.003624 0.693276 0.702330 0.374968
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.529260 -0.593975 -1.091082 -0.586226 0.784749 0.352238 -0.170546 0.052932 0.700750 0.706487 0.373645
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 8.554735 -0.676635 -0.000920 0.695913 1.006571 2.327322 2.236615 2.544573 0.709884 0.705061 0.371815
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.951772 -0.073815 0.041816 0.593027 0.663525 1.065964 1.396815 0.673948 0.691535 0.698655 0.363449
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.155500 0.796275 -0.835752 1.240573 -0.317036 6.167218 0.841564 1.310957 0.711390 0.701238 0.374939
74 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.165782 0.564336 0.291967 -1.252420 -1.288373 2.854041 -1.276414 4.117401 0.709351 0.704599 0.374094
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 24.998525 31.135864 0.614757 -1.048982 6.957885 5.315239 30.573382 4.172202 0.556462 0.502743 0.221972
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 37.629983 -0.698350 -0.260220 -0.212354 4.206195 -2.996214 0.096247 0.118168 0.471672 0.653861 0.365580
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.189549 -0.334828 -0.605636 -1.055580 -1.208098 -2.218922 -0.765392 -1.264878 0.640346 0.658243 0.388658
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 10.378957 15.774718 2.901145 4.545068 8.613765 12.874528 18.784430 2.032091 0.308850 0.041868 0.204497
81 N07 digital_ok 100.00% 0.00% 0.00% 0.00% -0.576747 -0.604541 -0.857407 3.195883 -0.588058 49.131589 0.617945 2.345322 0.649040 0.637155 0.383397
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.493785 -0.426261 -0.426383 1.737996 -0.576711 -1.786733 -0.339057 -0.012701 0.664823 0.672058 0.380938
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.676913 -0.530490 -0.672893 -0.156579 -0.740348 -0.494819 -0.762245 0.712561 0.677154 0.688979 0.376949
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 2.436841 27.909071 4.101392 13.917438 2.485416 12.544713 0.346964 8.492558 0.665458 0.039456 0.449772
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.447311 0.083146 -0.957316 0.173796 -1.584562 -1.080500 -0.829837 -0.466776 0.693104 0.698080 0.374518
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.001392 -0.507366 0.491642 0.515108 5.663917 -0.618859 0.704889 25.786622 0.683284 0.694669 0.366104
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.355657 8.209057 0.097201 -0.197720 24.929403 -0.596981 2.606997 1.309441 0.658299 0.713722 0.357102
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.389455 0.233218 -0.324572 0.389387 -1.850717 1.871710 0.428427 -0.347134 0.695242 0.701400 0.360920
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.429856 0.075948 -0.616523 0.363625 -0.428813 -0.932858 -0.836141 -0.453384 0.697679 0.700689 0.367716
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.444774 -0.547722 -1.191359 0.681739 -1.851164 -0.894934 -1.004281 7.743434 0.705628 0.695448 0.369425
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.585968 -0.266229 -0.385856 -0.130859 -0.689562 0.187492 -0.365544 -0.518572 0.690459 0.702426 0.379536
92 N10 RF_maintenance 100.00% 0.00% 15.25% 0.00% 44.507708 53.111412 0.016688 0.707041 7.966116 10.389525 2.142655 17.362870 0.300018 0.245989 0.097268
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 2.587213 0.228833 1.508567 -0.148818 3.389084 0.209134 5.771944 -0.533154 0.676083 0.693458 0.387674
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 13.335484 -1.152817 10.045641 -0.231368 10.904805 2.923664 1.954032 3.201302 0.034264 0.687804 0.458804
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.612306 -0.338221 -0.535396 1.003182 -0.286008 -1.638721 0.126476 1.215980 0.643574 0.673955 0.396051
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.428615 15.343470 3.787374 4.731767 10.951766 12.870452 2.245391 1.449873 0.033932 0.038696 0.002724
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.210753 4.757162 0.635572 -0.086605 -1.840160 -2.825671 -1.901119 13.530249 0.635478 0.607455 0.394448
98 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 1.144794 3.726608 -0.682022 -0.238216 -0.438992 1.488715 0.988529 4.875522 0.645678 0.658218 0.383518
99 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 1.303208 -0.868117 0.484558 0.188239 -1.258682 4.567022 7.452496 -0.459754 0.650158 0.675547 0.386438
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -1.364558 -1.026932 -0.454114 0.688339 -0.061575 -0.441951 0.840704 1.729246 0.666909 0.680972 0.378090
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.963320 7.811454 -1.202904 0.585007 0.214620 0.475527 -0.591199 -0.470976 0.692872 0.697453 0.374514
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.387244 0.420472 -0.567047 1.900415 -0.723872 -0.537552 -1.266767 7.044732 0.699259 0.693015 0.371786
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.143809 5.753788 3.870236 -0.782729 57.707202 5.053699 11.362122 8.666616 0.667670 0.705864 0.374482
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.121004 70.240260 6.548215 7.084184 0.886923 4.909696 0.221355 2.613917 0.642074 0.678416 0.370917
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.516306 -0.589042 -1.815409 0.453929 -0.639629 -0.021637 -1.152152 -0.489079 0.706671 0.702522 0.362911
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.512594 0.279219 0.319450 0.640271 1.811481 0.814948 -0.023622 -0.508078 0.689089 0.699627 0.363879
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 2.354495 0.108528 -0.954427 -0.246834 -0.341713 -1.004051 2.960939 5.109435 0.693564 0.700704 0.366325
108 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 12.227307 3.679285 9.844414 -0.709072 11.107592 0.287936 3.585631 0.238592 0.043757 0.704687 0.480155
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -1.397114 14.120582 -0.020521 10.541833 -0.566329 12.964416 1.303454 3.470934 0.691585 0.038050 0.474464
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.289565 29.955134 -0.751802 14.079303 0.810299 12.490714 -0.488422 7.694318 0.698405 0.035217 0.478268
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.093533 13.943822 -0.208592 10.652118 -0.442931 12.958490 -0.332798 4.148946 0.681859 0.038511 0.465943
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.991792 1.557194 -0.570931 -0.429341 0.194391 0.113753 -0.087272 -0.491380 0.669581 0.677034 0.392139
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 14.375223 15.368499 3.558296 4.620022 10.966863 12.881762 3.052664 1.297265 0.036418 0.031016 0.003281
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 6.588265 0.604294 0.514425 -0.433540 4.866827 -2.778196 0.957388 -0.874844 0.541597 0.648671 0.415472
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.332960 0.936433 2.892423 1.868460 2.084394 0.646184 -4.041621 -2.011952 0.630691 0.649747 0.407477
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.609051 0.432240 -1.450375 -0.533129 1.191113 -0.839379 -0.245287 -0.473577 0.641307 0.658125 0.384193
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 13.233126 15.894825 9.955863 11.182377 11.026231 12.962639 3.300221 6.837957 0.027662 0.032710 0.002876
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.999541 0.933353 -0.819772 0.337763 1.898289 1.340231 0.026023 1.290548 0.669417 0.686975 0.383253
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.686714 1.500926 -1.505188 3.094555 -0.244893 9.240479 0.539807 2.853226 0.681786 0.665516 0.376884
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.787948 2.396333 2.157436 2.316813 -0.065234 1.028493 1.386157 -3.568344 0.676788 0.700172 0.367029
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.959371 5.610084 -1.366365 0.613604 2.761653 0.608885 18.075314 25.866201 0.701441 0.707114 0.372524
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 10.131937 7.990465 -1.297531 0.324398 2.068692 0.930066 -0.069247 -0.496793 0.709104 0.710702 0.372442
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.217114 9.866756 -0.144317 0.597993 0.187818 2.076729 -0.233122 0.662794 0.707184 0.712772 0.370845
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -1.008827 -0.397725 -0.716602 0.206250 -0.154832 1.200546 0.835499 0.510572 0.706096 0.712907 0.372625
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.477150 -0.121503 -1.384978 0.411361 0.102420 1.965340 -0.934081 0.193180 0.700708 0.700338 0.371905
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.717786 3.353823 -1.627012 0.843851 5.642306 -0.187795 6.400796 -0.282441 0.698614 0.693859 0.375891
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.035848 -0.394745 -0.501008 -0.061641 1.780000 0.219865 0.475877 1.203557 0.695744 0.705439 0.385117
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -1.109190 -0.532469 1.213018 0.677051 -0.276161 0.803463 -0.558529 -0.358872 0.684067 0.698959 0.386863
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.097098 -1.987691 0.175852 0.581873 -0.376431 0.662670 -0.757460 -0.556233 0.682596 0.694755 0.393368
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% -0.280020 0.241191 -0.634921 -0.160181 -0.240643 -0.139686 1.979965 5.962013 0.665553 0.684017 0.388732
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.265485 15.498490 3.828482 4.870294 11.087920 12.893610 5.263872 0.092945 0.035174 0.040699 0.001856
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.124057 0.847217 0.474960 -1.527232 -0.812462 -1.149087 -1.637340 -0.175929 0.634573 0.637820 0.395950
133 N11 not_connected 100.00% 100.00% 82.26% 0.00% 13.817289 19.621662 3.564620 3.286608 11.076765 11.552605 3.068115 1.547070 0.042941 0.180670 0.100689
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -1.389161 14.059579 -0.410701 10.892336 0.461716 12.921294 0.027889 2.432267 0.640447 0.041967 0.476380
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 2.311993 -0.132364 3.243969 2.666567 22.142887 24.824673 0.349289 0.644521 0.611377 0.644989 0.381479
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.063519 -0.879012 -0.816841 -0.219969 1.370001 3.105132 1.422257 2.141125 0.649052 0.669150 0.386511
138 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.874470 -0.694539 0.378181 1.312428 -0.278963 0.328679 8.994763 0.759859 0.669807 0.682952 0.387578
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.666827 -0.832117 1.818127 -1.111595 -0.301857 -0.115792 -2.386127 0.705434 0.675960 0.677076 0.375811
140 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.193189 14.793388 0.385796 10.751041 -1.184715 12.990832 2.272790 4.989743 0.691232 0.048239 0.550782
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.565663 -0.967564 -1.331884 0.643063 1.630823 -2.941060 0.317876 -2.183918 0.690483 0.705603 0.371320
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.549195 13.980330 -1.023378 10.826483 3.585554 12.937785 0.538215 3.338904 0.693258 0.048170 0.549854
143 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 12.330525 -0.800477 10.022319 -0.028290 10.953522 1.129432 1.290170 -0.284639 0.040216 0.709105 0.561739
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.766469 -1.291890 -0.893213 5.249199 1.133860 1.964415 -0.540085 -0.287652 0.701130 0.667654 0.390560
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.423460 2.166612 -0.807554 6.447338 2.099596 15.445106 0.170920 1.717242 0.695626 0.641269 0.399963
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.208538 1.151233 -1.911166 1.104184 -0.509165 -1.281256 -0.057743 -2.706080 0.658877 0.698606 0.391909
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.160084 -1.691307 0.576266 1.886154 1.640096 -0.710103 0.135985 0.323946 0.684603 0.691038 0.379486
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -2.235738 -0.723418 2.788812 1.389688 -1.688110 0.433069 0.377433 0.500961 0.668387 0.693980 0.394609
149 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.384000 0.942434 -1.127073 1.944335 -1.234406 -0.041995 -1.284249 -2.774174 0.682277 0.692784 0.394518
150 N15 RF_maintenance 100.00% 100.00% 0.11% 0.00% 12.953970 -0.203852 9.898554 0.285399 11.110906 1.323866 4.038749 -0.885644 0.047966 0.294697 0.158473
155 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.892327 -1.131595 -0.674022 2.296093 0.744028 33.940209 2.508102 2.945943 0.640973 0.644809 0.397647
156 N12 RF_maintenance 100.00% 99.68% 0.00% 0.00% 11.376943 -0.466875 9.868341 1.755239 11.085004 0.094550 2.801986 0.209055 0.075905 0.653124 0.532133
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.006853 -0.409564 -0.367900 0.169431 -1.082731 -0.215622 0.047435 0.493745 0.654153 0.669687 0.392080
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.047872 -0.828007 -1.158470 -1.592454 1.157086 -0.652191 6.416055 25.029011 0.670978 0.683040 0.395837
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.017660 20.002378 -1.460974 -1.380889 -1.883275 10.977406 -0.014486 8.629977 0.643689 0.593546 0.375152
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.604327 -1.326236 -1.067537 -1.133011 -0.648987 0.021637 0.519215 1.916690 0.683166 0.691938 0.376239
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.144847 33.428959 -1.409532 -0.968349 -1.303110 0.411695 -0.545663 1.664873 0.688267 0.570302 0.348355
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 4.984391 5.597295 6.952321 8.467178 65.831361 11.295911 2.667760 0.597114 0.544811 0.562832 0.344318
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.192862 1.036398 -0.957063 0.031452 -0.674438 -0.106797 0.323027 2.681920 0.700394 0.701829 0.380906
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.989702 -0.100691 0.783261 -0.690304 8.793789 1.677464 1.443073 2.111421 0.690842 0.703021 0.378412
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 34.684698 -0.282882 1.877407 0.141001 6.027836 0.268099 3.161043 0.073814 0.534280 0.695882 0.377989
166 N14 RF_maintenance 100.00% 0.00% 100.00% 0.00% 25.291291 13.168587 -0.670804 10.363918 15.859267 12.929532 42.613040 2.514257 0.599306 0.037129 0.421566
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.583572 -1.349727 -0.820995 0.750563 0.409107 1.215792 -1.088134 4.376158 0.699780 0.697419 0.389605
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.976666 -1.150551 -0.636839 -0.964710 0.674543 0.062101 -0.619059 0.012701 0.687936 0.699881 0.392555
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 3.445390 14.751634 -1.672898 -1.527005 6.820352 -1.158409 -0.297864 -0.110967 0.662492 0.657855 0.382271
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 12.928490 -1.194096 10.079508 -1.428974 10.970985 25.729149 2.013959 6.798981 0.040414 0.689246 0.562390
179 N12 RF_maintenance 100.00% 100.00% 93.24% 0.00% 13.125976 15.118496 10.082501 11.304908 10.927325 12.561999 1.833232 2.555545 0.065759 0.110457 0.044900
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.428946 14.804445 9.991369 10.962217 10.985151 12.937421 1.608412 4.478572 0.049757 0.053608 0.003920
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.298938 -0.518263 -0.945916 -0.006916 0.621980 0.694406 -0.380162 9.855117 0.690073 0.688968 0.381971
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.035599 4.151442 0.821990 3.474103 13.512208 4.984463 0.385287 -2.360176 0.697813 0.685710 0.385033
183 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 12.365115 -0.991347 9.179067 -0.958699 11.155958 0.689656 0.876233 0.438199 0.042444 0.690246 0.512722
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 12.282114 14.416638 9.976404 10.833516 11.038997 12.856667 1.544339 1.950234 0.079158 0.049035 0.026458
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 9.543456 1.218669 9.198755 7.304586 9.881943 0.845620 1.320236 0.894887 0.327632 0.602088 0.421595
186 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.825432 1.521449 10.003821 2.305675 11.083401 1.303284 3.952674 -3.346541 0.049957 0.697431 0.537555
187 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 12.382157 1.708879 9.724397 1.925911 11.165866 -0.143762 4.147955 -0.483597 0.051151 0.695948 0.547194
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 10.517043 11.338624 1.237157 -0.366209 6.107942 13.206194 2.852521 4.012267 0.354684 0.375725 0.171403
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 49.052447 14.213284 -0.497413 10.926446 4.563704 12.976271 18.988067 5.105467 0.494942 0.037929 0.382306
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.187312 -0.001075 3.369187 -0.351906 -0.645071 0.597888 19.399303 0.735137 0.637094 0.670096 0.418767
200 N18 RF_maintenance 100.00% 100.00% 57.38% 0.00% 14.024892 41.986468 3.764558 0.623783 11.181951 11.632906 3.414524 0.399657 0.048574 0.215367 0.149216
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.857708 6.340785 5.544466 4.512548 8.816282 8.757974 -5.585842 -5.000890 0.642048 0.647404 0.380408
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.701495 2.638759 0.977292 -0.549455 -1.386695 -0.731652 0.379901 6.705218 0.673325 0.633890 0.393042
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 234.112408 234.046851 inf inf 6956.224754 6994.697167 10906.951674 10816.249757 nan nan nan
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.255472 3.426199 0.884595 -0.342364 -1.639740 -1.143422 -1.053978 10.534192 0.666886 0.625359 0.400459
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.501595 1.498696 0.208045 -1.005032 26.849576 -2.557180 -1.130123 4.928159 0.656586 0.649537 0.383429
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.656062 2.151761 1.713428 -0.031452 0.193967 0.795238 -2.056449 -2.196479 0.647902 0.649908 0.372898
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 297.090227 297.223410 inf inf 7311.391138 7439.380929 10067.831789 10595.995911 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% 204.854544 196.085848 inf inf 6311.139740 6599.435460 10267.361574 10228.559204 nan nan nan
219 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 226.099671 225.584790 inf inf 7315.546562 7425.699865 12432.998487 12139.450435 nan nan nan
220 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.272535 -1.077063 0.219804 -0.309829 -2.484013 -2.543920 5.968700 -1.754744 0.664894 0.655765 0.391189
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.237255 0.051363 -1.228572 -0.556222 0.142665 -2.304062 3.824803 -0.514542 0.630661 0.659650 0.394013
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 1.004583 0.820565 0.894965 -0.225811 -1.263161 18.718983 6.309556 0.451490 0.665581 0.661075 0.396070
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.726702 2.571129 -1.510862 0.794730 -0.966667 16.679558 0.095636 13.885092 0.647023 0.591240 0.404069
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.080230 6.992784 5.762159 5.060470 8.943822 10.718584 -5.695774 -5.868950 0.642469 0.639191 0.391362
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 289.873396 289.542981 inf inf 7307.756500 7722.157578 15342.434846 15874.663116 nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 224.790006 225.707883 inf inf 8236.742166 8163.039317 12001.510178 11753.259900 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% 7.138263 1.791399 1.192519 -1.337142 1.379049 -1.531079 1.040961 -0.879586 0.529776 0.632978 0.430923
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.184646 -0.656916 1.481099 0.718658 -0.776129 -0.815133 -2.094615 -2.171698 0.664620 0.654182 0.402363
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.749543 -0.765396 0.121015 -1.543431 -0.722077 25.117258 -0.689818 10.426855 0.659010 0.641219 0.395985
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% 272.392668 273.609008 inf inf 7482.062702 7352.785218 10757.603711 10310.713788 nan nan nan
241 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 270.357679 270.053980 inf inf 9649.137601 9772.013245 16287.208635 16598.253636 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% 225.078230 225.684463 inf inf 7664.772609 7630.195952 11146.099394 11005.915161 nan nan nan
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 208.028596 205.553878 inf inf 7392.550011 7209.755920 10740.779886 10121.951465 nan nan nan
245 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 232.628446 231.902959 inf inf 7595.569012 7609.206562 10866.097187 10917.931265 nan nan nan
246 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 268.489508 265.956829 inf inf 7334.653624 7419.005350 10172.468767 10385.778841 nan nan nan
261 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 275.516560 274.306176 inf inf 8798.340856 8242.192974 14113.602919 12679.680871 nan nan nan
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 275.631120 274.467152 inf inf 7275.931072 7321.561462 9872.114870 10026.892529 nan nan nan
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.332738 14.919877 -1.055016 6.937873 -1.173238 13.012291 25.039919 6.182354 0.661147 0.051988 0.551536
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 0.878721 1.933294 1.431271 1.364285 0.166543 10.167410 -0.781605 -1.710245 0.562665 0.558177 0.384862
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.104755 -1.225689 1.573731 -1.442789 -0.063599 -0.300881 -2.439347 -0.203747 0.597961 0.573542 0.397558
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 0.994399 -1.533948 -0.826242 -0.375077 11.217537 -2.169196 1.977788 -0.858396 0.545916 0.570414 0.393598
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.808877 0.999475 -1.595635 -1.566609 -1.791290 -1.179028 1.607995 -0.098987 0.526742 0.554428 0.386857
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, 7, 8, 18, 19, 22, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 44, 45, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 63, 68, 71, 73, 74, 77, 78, 80, 81, 84, 86, 87, 90, 92, 93, 94, 96, 97, 98, 99, 101, 102, 103, 104, 107, 108, 109, 110, 111, 113, 114, 117, 119, 121, 122, 123, 126, 130, 131, 133, 135, 136, 138, 140, 142, 143, 144, 145, 150, 155, 156, 158, 159, 161, 162, 164, 165, 166, 167, 169, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 202, 203, 205, 206, 208, 209, 210, 211, 219, 220, 222, 223, 224, 225, 226, 227, 228, 229, 237, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 324, 329]

unflagged_ants: [4, 5, 9, 10, 15, 16, 17, 20, 21, 35, 40, 41, 42, 43, 46, 48, 49, 62, 64, 65, 66, 67, 69, 70, 72, 79, 82, 83, 85, 88, 89, 91, 95, 100, 105, 106, 112, 115, 116, 118, 120, 124, 125, 127, 128, 129, 132, 137, 139, 141, 146, 147, 148, 149, 157, 160, 163, 168, 207, 221, 238, 325, 333]

golden_ants: [5, 9, 10, 15, 16, 17, 20, 21, 40, 41, 42, 65, 66, 67, 69, 70, 72, 83, 85, 88, 91, 100, 105, 106, 112, 116, 118, 124, 127, 128, 129, 141, 146, 147, 157, 160, 163]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459889.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.0.4.dev44+g3962204
3.1.5.dev171+gc8e6162
In [ ]: