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 = "2460026"
data_path = "/mnt/sn1/2460026"
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: 3-22-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/2460026/zen.2460026.21278.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/2460026/zen.2460026.?????.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/2460026/zen.2460026.?????.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 2460026
Date 3-22-2023
LST Range 6.530 -- 16.492 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 68 / 198 (34.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 97 / 198 (49.0%)
Redcal Done? ❌
Never Flagged Antennas 98 / 198 (49.5%)
A Priori Good Antennas Flagged 48 / 93 total a priori good antennas:
3, 5, 9, 15, 16, 17, 31, 37, 40, 42, 54, 55,
65, 66, 70, 72, 81, 83, 93, 94, 101, 109, 111,
112, 118, 121, 122, 124, 127, 136, 144, 147,
148, 149, 150, 151, 161, 165, 167, 168, 169,
170, 182, 184, 187, 189, 190, 191
A Priori Bad Antennas Not Flagged 53 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 50, 51, 57, 61,
62, 64, 73, 74, 89, 95, 97, 102, 110, 115,
120, 125, 132, 133, 135, 139, 179, 185, 201,
205, 206, 207, 220, 221, 222, 223, 224, 227,
228, 229, 237, 238, 239, 240, 241, 244, 245,
261, 320, 324, 325, 329
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_2460026.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% 0.00% 100.00% 0.00% -0.108770 13.467374 0.485643 10.867247 0.348745 2.197901 0.998305 1.393061 0.725105 0.046634 0.638943
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.815131 17.133412 -1.124831 -0.643171 -0.866540 -0.191192 -0.902507 -0.151553 0.724704 0.596272 0.272743
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.763186 13.076457 10.325493 10.620885 1.704672 2.218706 1.547578 1.390384 0.039208 0.033401 0.002253
7 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.654048 -0.487968 -0.457821 0.097967 -0.363510 1.737149 0.101864 0.539450 0.724397 0.697466 0.263341
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.365142 -0.863079 0.259262 0.504663 0.219446 0.497158 0.750710 0.984687 0.721467 0.692431 0.262332
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.417335 -0.630237 3.175121 -0.375407 3.025438 -0.167899 5.102690 0.056978 0.707145 0.682631 0.260598
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.790550 -0.598977 -0.822437 -0.646461 -0.700359 -0.095888 -0.915493 -0.049038 0.699519 0.673882 0.271542
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 17.769278 0.674700 0.287915 -0.148653 0.740259 0.066360 0.368842 0.060996 0.641734 0.702780 0.230745
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.241798 14.109932 -0.126455 10.867630 -0.003229 2.185598 0.088570 1.393345 0.737595 0.048215 0.633883
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.048742 1.407700 0.975813 8.667479 0.564167 6.955114 1.484707 10.480718 0.738607 0.586987 0.338762
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.875139 19.281741 10.353910 1.177913 1.700403 1.673778 1.540287 1.569464 0.038282 0.529464 0.441561
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.571934 -0.676106 -0.107927 0.168944 2.087917 -0.665459 1.176748 -0.344405 0.732005 0.695698 0.270914
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.448363 -0.225680 1.363805 -0.412761 2.442624 -0.210345 1.966468 -0.104929 0.724159 0.698721 0.257947
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.043543 -0.242364 0.230182 0.510191 2.850019 0.411966 0.528994 0.857426 0.707788 0.683363 0.259615
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.286722 -0.698137 -0.627663 -0.664791 -1.057584 -0.886982 -0.898479 -0.625919 0.679946 0.653168 0.269920
27 N01 RF_maintenance 100.00% 64.51% 64.07% 9.29% 7.073126 39.959619 9.587160 5.678321 2.805861 3.357368 4.720895 4.882891 0.205491 0.194175 -0.058130
28 N01 RF_maintenance 100.00% 100.00% 5.19% 0.00% 10.049314 21.499732 10.234690 4.052288 1.706008 2.392412 1.564409 3.189876 0.032016 0.427802 0.344442
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.065340 -0.967667 -0.222625 -0.355633 0.496826 -0.234443 -0.188279 -0.142380 0.745006 0.714368 0.258436
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.671092 -0.190008 0.684223 -0.725350 2.898544 -0.167754 1.040381 -0.477704 0.740025 0.716704 0.256351
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.641234 -0.515351 1.372408 1.518650 4.050060 0.810107 3.486777 1.750529 0.741581 0.714470 0.254842
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 24.022311 24.040145 0.039770 0.549769 0.649488 1.432456 -0.106719 0.749324 0.667122 0.658721 0.160661
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.774837 14.275296 5.705611 5.905405 1.685219 2.189577 1.538889 1.399203 0.036153 0.062804 0.018093
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.494957 -0.378163 0.200183 -0.944133 -0.107266 -0.671100 -0.678727 -0.322048 0.679857 0.654224 0.272710
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.523709 6.296459 1.152455 0.900300 0.907626 0.898492 1.747090 1.173618 0.709789 0.678890 0.265601
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 1.614379 22.761175 -1.101887 13.320661 -0.833744 2.209637 -1.039696 1.335092 0.705603 0.035170 0.557999
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.672875 1.843078 -0.097274 0.193438 0.043468 -0.199815 0.034657 0.393264 0.730693 0.682460 0.268163
40 N04 digital_ok 0.00% 0.00% 0.00% 74.55% 1.210296 0.551793 0.197974 -0.450893 0.231941 0.114448 0.360778 0.854015 0.494633 0.488485 -0.191574
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.144752 1.573526 1.562542 1.521275 0.938687 0.942455 2.105032 1.623168 0.748416 0.721363 0.249678
42 N04 digital_ok 0.00% 0.00% 0.00% 72.29% 0.446842 0.418460 -0.133127 -0.581084 0.225571 0.016267 0.098437 0.670254 0.505970 0.495873 -0.189454
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.082211 -0.176735 -0.858398 1.028296 -1.032180 0.540527 -1.175409 1.151787 0.741256 0.722678 0.251249
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.305641 -0.272813 -1.151492 0.098550 -0.811865 0.063951 -1.191591 0.219286 0.740507 0.725564 0.255131
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.450693 3.348755 0.904233 1.015036 0.345389 0.626651 1.093832 1.293175 0.733905 0.709531 0.248323
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.497474 -1.105448 0.086054 -1.177660 -0.031940 -0.641950 0.229116 -0.808886 0.728819 0.709887 0.257256
47 N06 not_connected 100.00% 100.00% 94.44% 0.00% 11.247089 13.034141 5.604388 5.578721 1.686581 2.164425 1.582736 1.344671 0.031496 0.078803 0.032358
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.338597 -0.063416 -1.063404 0.611148 -0.728365 -0.434334 -1.068714 -0.075914 0.686708 0.661843 0.268320
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.965654 -0.044827 0.657321 -0.960275 0.111267 -0.404067 1.067219 -0.632774 0.665967 0.649864 0.262823
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.972183 1.548935 0.486984 1.788262 0.434103 1.250129 0.889907 2.205282 0.701506 0.674290 0.267291
51 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.861760 1.481130 0.387818 -0.278178 0.499990 0.425905 2.014174 -0.058321 0.714824 0.687206 0.263681
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.475204 4.410058 0.657547 0.377816 0.489518 0.406000 0.922224 0.455702 0.730831 0.700571 0.259181
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.539265 1.106375 0.231384 -0.753401 0.569755 -0.278022 0.519760 -0.834210 0.737462 0.708352 0.258242
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 9.078616 4.814586 1.182817 -0.321725 0.877269 1.011782 0.796212 0.000092 0.447421 0.503179 0.150207
55 N04 digital_ok 100.00% 7.19% 100.00% 0.00% -0.661003 49.535804 0.127485 7.774218 -0.430324 2.365691 -0.035720 1.198583 0.485305 0.049145 0.306925
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.628297 0.417073 -1.157781 2.550069 -0.954736 2.279431 -1.147224 2.848028 0.746496 0.726038 0.245890
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.271195 0.003320 -0.911663 -0.269185 -0.735858 -0.111206 -1.173774 -0.065498 0.747930 0.727985 0.250051
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.381452 12.830319 10.285232 10.784434 1.672634 2.179151 1.559152 1.393725 0.038857 0.038622 0.001360
59 N05 RF_maintenance 100.00% 94.00% 0.00% 0.00% 10.398894 0.210318 9.906968 0.910165 1.641179 0.782107 1.512745 1.028745 0.080892 0.720393 0.507017
60 N05 RF_maintenance 100.00% 0.27% 75.80% 0.00% 0.267664 12.847926 0.312565 10.782262 2.897387 2.098516 0.744761 1.258859 0.727509 0.169068 0.494152
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.605954 -1.093657 0.684781 -0.272190 0.246769 2.650261 0.597903 0.006075 0.692863 0.684197 0.255233
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.108752 -0.255477 0.517194 0.249416 0.830804 -0.796489 0.324442 -0.297242 0.675633 0.671058 0.259648
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.901092 13.473046 -1.057143 5.926761 -0.979355 2.214447 -1.103532 1.395178 0.688952 0.050274 0.479796
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.207256 -0.936477 -1.092944 -0.051204 -0.992283 -0.330896 -0.633526 0.404926 0.674069 0.646194 0.268655
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 21.870799 20.454484 13.117610 13.031264 1.733202 2.248234 1.531005 1.443756 0.023565 0.033660 0.010044
66 N03 digital_ok 100.00% 9.94% 84.93% 0.00% 1.080662 20.506385 1.456078 13.198208 -0.039879 2.137959 0.688625 1.249204 0.416920 0.099601 0.246299
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.257297 0.477333 -0.287255 1.601798 -0.347287 1.072255 -0.113873 1.874444 0.723844 0.700577 0.258116
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 23.892073 -0.384084 13.237981 0.252299 1.654360 -0.581116 1.454752 -0.258071 0.044133 0.698542 0.533023
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.207606 0.242219 1.399248 -0.449815 0.837163 0.317885 1.796716 -0.316579 0.745654 0.720875 0.246903
70 N04 digital_ok 100.00% 0.00% 0.00% 72.50% 0.332340 0.404389 1.466801 2.915686 1.091269 2.193484 1.479247 5.064633 0.517141 0.505694 -0.187653
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.101389 -0.431511 -0.282982 0.378402 -0.314830 0.127496 -0.278045 0.497067 0.751419 0.732656 0.241968
72 N04 digital_ok 0.00% 0.00% 0.00% 70.45% 0.004621 0.253690 2.600776 1.166402 1.527285 1.224682 2.875084 2.636916 0.522911 0.514111 -0.186967
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.431475 1.613209 -0.444044 -0.022098 -0.411522 0.218195 -0.406822 -0.006075 0.752849 0.734190 0.247235
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.195192 -0.375923 -0.767574 0.083829 -1.209967 -0.001039 -1.147741 0.245198 0.743102 0.728586 0.251114
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 35.206942 14.509826 -0.045015 -0.747214 3.177220 -0.520710 0.340987 -0.271385 0.581240 0.604700 0.160354
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 18.796444 -0.240543 0.024371 0.448334 -0.317374 -0.651036 0.297504 -0.142799 0.575113 0.672492 0.245930
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.853912 13.495091 -0.345082 5.934338 -0.751101 2.173872 -0.210948 1.369365 0.680868 0.041251 0.493749
80 N11 not_connected 100.00% 0.00% 87.25% 0.00% -0.040852 14.053940 -0.520831 5.854420 -1.435354 2.157871 -0.947741 1.337236 0.673124 0.096063 0.480884
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 33.606473 32.322443 22.833876 22.486082 3.200117 5.194490 8.794396 9.814410 0.018873 0.016598 0.001770
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 18.336796 44.204976 25.111602 21.831407 7.495091 4.620972 19.410961 10.409084 0.016486 0.016564 0.000773
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 14.832980 30.274867 19.485054 19.607193 2.314077 2.621953 6.465981 7.838774 0.017152 0.016955 0.000804
84 N08 RF_maintenance 100.00% 0.00% 97.57% 0.00% 6.745616 15.782657 8.680630 13.332723 8.601748 2.188466 14.312501 1.407303 0.658044 0.072248 0.397414
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.897160 2.817954 -0.373051 -0.640013 -1.212791 -0.268154 -0.913815 -0.451569 0.737184 0.705610 0.248082
86 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.767760 1.393082 -0.114848 -0.286236 0.784465 -0.110376 -0.218660 0.206741 0.746764 0.725363 0.240117
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.521338 6.779795 0.222325 0.068124 0.190402 0.136837 0.460163 0.212305 0.754782 0.738498 0.236489
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.479836 1.055423 0.897943 1.275894 0.237380 0.462335 1.215073 1.354292 0.754566 0.732918 0.233750
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.039907 1.051657 0.825129 1.243821 0.369087 0.441841 0.991699 1.306780 0.750756 0.733528 0.237379
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.024682 -0.286854 0.179261 -1.069732 5.439923 1.037578 0.287955 -0.712590 0.738333 0.729626 0.240033
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.468980 -0.505330 1.042100 0.800983 0.489998 0.167658 1.277405 0.827036 0.738304 0.725589 0.245952
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.919498 0.043341 10.296240 0.646464 1.703329 0.584990 1.545766 0.758707 0.038564 0.718131 0.414473
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.537914 13.150829 10.402155 10.879389 1.666999 2.177389 1.550567 1.398037 0.032007 0.025033 0.003552
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.155566 13.455917 10.511992 10.710675 1.680503 2.190075 1.541664 1.383810 0.025375 0.025477 0.001073
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.329037 1.383111 -1.092794 0.065373 0.625597 0.044298 -0.451012 0.136889 0.584752 0.553519 0.181091
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.282600 19.329809 0.314604 -0.599637 -0.969396 -0.289452 -0.538169 -0.270313 0.680073 0.584193 0.264913
97 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.634939 1.503546 -1.174476 0.779552 -0.970219 2.165862 -0.633037 1.304382 0.669500 0.636087 0.273237
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.885774 6.690382 0.222786 1.220881 0.051803 0.807639 0.361725 1.374913 0.722354 0.701078 0.255351
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.193171 -0.160782 -1.187099 -0.670862 -0.610575 0.001039 -1.117924 -0.419770 0.733416 0.711208 0.248769
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.010769 3.888760 1.595542 -0.985971 3.770235 0.013934 -0.035598 -0.576825 0.715626 0.723056 0.248304
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.476817 38.270191 0.080557 6.709507 1.024301 5.268320 0.019626 8.168442 0.753442 0.720256 0.241371
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.165727 0.592474 0.690204 1.302616 0.289535 0.490924 0.956119 1.346573 0.757739 0.736237 0.234439
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 2.271496 2.181897 0.839626 0.189609 3.737172 -0.232404 1.192635 0.229999 0.752835 0.736254 0.233685
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.715408 -0.052343 0.090412 -0.387446 0.766490 -0.165548 0.204125 -0.218810 0.747028 0.731656 0.235309
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.159886 35.210516 10.322721 1.884613 1.684544 1.205884 1.552029 0.999100 0.035898 0.457757 0.217497
109 N10 digital_ok 100.00% 66.18% 100.00% 0.00% 9.565747 12.882954 10.350411 10.584707 1.613408 2.205674 1.355746 1.404527 0.176442 0.040048 0.100182
110 N10 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.629052 0.250586 -0.329546 0.046430 0.824160 0.242314 0.022141 0.138887 0.730311 0.715409 0.260169
111 N10 digital_ok 100.00% 0.00% 81.47% 0.00% 19.641720 11.904055 1.742573 10.665355 1.138090 2.158864 1.908681 1.297721 0.636767 0.131500 0.370665
112 N10 digital_ok 100.00% 1.24% 1.57% 71.10% 0.459397 1.869009 1.955999 8.932774 1.232346 6.724724 2.089443 11.400404 0.460672 0.354969 -0.161579
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.828940 13.825758 5.395651 5.931878 1.664394 2.169362 1.545323 1.376570 0.035061 0.030987 0.002427
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 12.927827 0.201586 5.550942 -0.686802 1.655472 -0.955923 1.509911 -0.820907 0.048208 0.655017 0.449162
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.847141 -1.195892 -0.847793 -0.490558 -0.765360 -1.123512 -0.417776 -0.695869 0.661982 0.644434 0.275389
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 17.550506 24.892738 22.184571 26.190580 3.737291 6.532412 9.074560 19.156034 0.017678 0.016269 0.001343
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 17.616667 15.178145 20.169439 22.166818 2.496095 2.802672 8.344004 9.955280 0.026812 0.029065 0.004984
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.155265 1.382672 2.755104 -0.424501 2.045787 -0.107581 3.910013 -0.194970 0.723282 0.705027 0.247858
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.430147 5.700370 1.631343 5.992127 0.008173 8.550355 0.560973 7.989116 0.710173 0.692813 0.247983
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.439058 5.285808 -0.515546 -0.839538 -0.453530 -0.218850 -0.450491 -0.584938 0.753659 0.729846 0.238350
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.021696 3.074538 2.315732 0.897475 0.719134 -0.232096 1.058657 0.198498 0.717263 0.722962 0.246337
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 10.557091 0.058668 10.558078 1.006188 1.657846 0.460577 1.532386 1.108122 0.045620 0.742404 0.412788
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.561551 1.637823 1.297752 1.325553 1.327912 0.781316 1.591343 1.361605 0.757645 0.733557 0.238113
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.046394 1.806771 0.664297 1.274374 2.886890 0.928247 0.924390 1.430871 0.698079 0.735150 0.225750
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 9.666879 0.883773 10.284545 2.903554 1.692982 2.832847 1.555780 3.348504 0.034720 0.721460 0.412979
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.022768 -0.662829 -0.425853 -0.723066 -0.428324 -0.475982 -0.388555 -0.809081 0.733879 0.712007 0.261134
131 N11 not_connected 100.00% 0.00% 13.13% 0.00% -1.045887 10.064696 -0.774571 5.634508 -1.206642 2.371067 -1.217809 2.340328 0.694374 0.402244 0.354909
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.097636 0.490593 -1.030823 -0.614065 -0.605485 -0.625913 -1.149552 -0.302755 0.681133 0.658496 0.268086
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.072165 -0.816347 -0.632797 -0.915972 -0.677881 -1.167217 -0.437658 -0.828012 0.669695 0.652740 0.273853
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.902744 14.902232 5.014722 5.409695 1.650359 2.166139 1.517897 1.375109 0.041498 0.035958 0.002998
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.441497 -0.964835 -0.532496 -0.678120 0.191405 2.496059 0.060803 0.331874 0.647636 0.633042 0.292190
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 8.892742 0.622804 10.007336 0.055000 1.693070 -0.021789 1.562817 0.324874 0.043937 0.631054 0.403090
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 18.237957 49.709502 25.197270 23.791486 6.533137 4.844244 14.919422 11.628674 0.016302 0.016357 0.000712
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.257706 0.478016 0.349848 -0.913829 -0.962183 3.059580 -0.343207 -0.727690 0.695143 0.672493 0.262079
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.260163 -1.232689 -0.093609 -0.747376 1.852688 -0.526562 0.732920 -0.469516 0.726646 0.704394 0.248623
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.653254 -1.049557 0.330251 -0.127588 0.027962 -1.007075 0.531992 -0.453247 0.741412 0.710426 0.245666
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.529233 13.291008 0.003850 10.805286 0.081410 2.189485 0.408988 1.393707 0.748263 0.063616 0.535061
143 N14 RF_maintenance 100.00% 69.64% 100.00% 0.00% 9.525637 12.836747 10.162299 10.788383 1.776069 2.211411 2.896013 1.404444 0.208155 0.031622 0.135133
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.376474 1.116113 -0.330905 3.226443 -0.218189 4.994795 -0.234201 3.369847 0.758723 0.731963 0.239675
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.577772 0.826137 0.054750 -0.202647 -0.130144 0.506972 0.235725 -0.091640 0.757027 0.730444 0.239779
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.752950 -0.546163 -0.950190 -1.144557 -0.979837 -1.055812 -0.829138 -0.875300 0.736424 0.718302 0.245392
147 N15 digital_ok 100.00% 99.78% 99.78% 0.00% nan nan inf inf nan nan nan nan 0.759267 0.699134 0.295212
148 N15 digital_ok 100.00% 100.00% 99.84% 0.00% nan nan inf inf nan nan nan nan 0.088819 0.495982 0.395840
149 N15 digital_ok 100.00% 99.89% 99.84% 0.00% nan nan inf inf nan nan nan nan 0.648865 0.887684 0.288776
150 N15 digital_ok 100.00% 99.89% 99.84% 0.00% nan nan inf inf nan nan nan nan 0.635802 0.886301 0.348988
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 14.194206 -0.451883 -0.725602 1.253052 -0.592276 0.206770 -0.512235 1.328294 0.601313 0.653331 0.226313
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.566303 -0.267275 10.136062 -0.432558 1.701702 0.832291 1.567490 0.091042 0.044692 0.634568 0.422482
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.381261 11.880563 7.680992 10.615396 6.682456 2.221466 10.771601 1.429405 0.558888 0.040086 0.395517
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.283631 0.357225 0.711242 1.116248 0.333173 0.627940 1.018352 1.366620 0.673943 0.659663 0.276716
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.553745 0.431972 -0.785610 -0.846248 -0.449824 -0.299956 -0.577428 -0.253116 0.689413 0.668876 0.273875
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.344207 17.769404 -0.295525 0.028845 -0.428143 0.008134 -0.400412 0.224471 0.681249 0.571225 0.255053
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.590260 -0.502731 0.238594 -0.097503 0.040743 0.135959 0.450901 0.143039 0.721366 0.701097 0.253216
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.558060 31.983252 0.681702 0.678922 0.304269 -0.156340 0.950852 0.436161 0.735245 0.628792 0.237860
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.925480 -1.028351 -0.621003 -1.125328 -0.753853 -0.252626 -1.032466 -0.774194 0.740266 0.722760 0.246862
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.759860 1.260892 0.486807 0.813402 0.137777 0.448386 0.663727 0.942515 0.754411 0.734154 0.242788
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.400426 0.128552 0.788409 1.528052 1.543090 1.143920 0.965749 1.703651 0.756460 0.734180 0.236559
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 16.033747 0.422201 0.583348 -0.192305 0.414397 -0.148815 0.543431 0.038552 0.668804 0.735750 0.213035
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.260798 -0.960572 1.168147 0.003030 0.701676 -0.903081 1.689557 -0.456441 0.753744 0.721420 0.242007
167 N15 digital_ok 100.00% 99.73% 99.73% 0.00% nan nan inf inf nan nan nan nan 0.585956 0.608136 0.380083
168 N15 digital_ok 100.00% 99.73% 99.73% 0.00% nan nan inf inf nan nan nan nan 0.729408 0.517744 0.462152
169 N15 digital_ok 100.00% 99.84% 99.78% 0.00% nan nan inf inf nan nan nan nan 0.430520 0.540899 0.240960
170 N15 digital_ok 100.00% 99.89% 99.78% 0.00% nan nan inf inf nan nan nan nan 0.512711 0.749735 0.291770
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.381146 -1.213242 1.153554 -1.191354 0.106496 -1.182523 1.107770 -0.859972 0.675503 0.670408 0.259644
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.350726 3.634725 2.640172 2.687365 1.055619 1.537792 1.194403 1.135709 0.631842 0.600925 0.285205
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.205272 -0.721664 0.274789 -0.503645 0.051399 0.505761 0.449055 -0.185396 0.693556 0.675579 0.272074
180 N13 RF_maintenance 100.00% 0.00% 99.95% 0.00% 0.610921 13.760282 -0.557521 10.921196 -0.509619 2.175564 -0.399286 1.400267 0.707573 0.065765 0.524270
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.043903 0.187903 1.272784 1.250746 1.077117 3.587589 1.599934 1.993042 0.727585 0.704861 0.256944
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.977558 12.142669 -0.280877 10.566852 2.390975 2.208125 -0.904725 1.393776 0.730427 0.063742 0.495647
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.102741 2.180482 0.265720 0.627354 0.020150 0.173514 0.356641 0.668372 0.733746 0.718683 0.233155
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 11.496222 0.129386 6.610477 -0.465903 6.067438 -0.161731 8.368874 -0.231210 0.626431 0.727585 0.234081
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.401932 -0.292460 -1.034620 0.076631 -0.584417 -0.024265 -0.946360 0.188007 0.751582 0.728822 0.244366
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.350677 -1.026848 -0.314833 -0.802905 -1.145878 -1.134438 -0.864807 -0.816484 0.746076 0.724783 0.246398
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.458981 -1.121661 0.666285 -0.661144 4.859072 -0.108533 0.750185 -0.763172 0.743102 0.716704 0.244523
189 N15 digital_ok 100.00% 99.84% 99.78% 0.00% nan nan inf inf nan nan nan nan 0.696659 0.884654 0.367025
190 N15 digital_ok 100.00% 99.73% 99.73% 0.00% nan nan inf inf nan nan nan nan 0.752856 0.674237 0.387411
191 N15 digital_ok 100.00% 99.68% 99.62% 0.00% nan nan inf inf nan nan nan nan 0.699566 0.692323 0.349622
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.475750 3.730846 1.856198 2.770907 1.575620 1.568916 0.207631 1.166443 0.666281 0.617700 0.287560
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.570462 3.121056 2.793025 2.508161 1.138512 1.398082 1.260714 1.030852 0.633863 0.614114 0.279923
200 N18 RF_maintenance 100.00% 100.00% 0.38% 0.00% 11.547872 32.502808 5.527276 0.288893 1.704222 0.837328 1.554608 0.608571 0.042873 0.361886 0.250266
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.913163 2.611912 1.521950 2.336375 -0.152247 1.141771 0.414687 0.958401 0.694876 0.657870 0.271831
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% -0.003320 0.491276 0.405443 -0.219624 -0.850836 -0.144004 -0.357619 0.881820 0.719222 0.692916 0.255325
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.902750 11.336329 1.509229 -0.787737 1.026752 -0.203452 2.339520 -0.574700 0.743240 0.716318 0.245883
205 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.753117 -0.206310 3.825011 -0.488674 1.960753 -0.343290 3.051080 -0.193856 0.642164 0.714548 0.274435
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.155407 2.267201 0.445384 2.984790 0.859239 1.298520 0.377403 2.423381 0.720671 0.649596 0.258898
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.341710 1.636687 -1.135204 0.200843 -1.196403 -0.179704 -0.959889 0.244819 0.726925 0.695072 0.246444
208 N20 dish_maintenance 100.00% 99.78% 99.73% 0.00% nan nan inf inf nan nan nan nan 0.583496 0.617783 0.361559
209 N20 dish_maintenance 100.00% 99.89% 99.84% 0.00% nan nan inf inf nan nan nan nan 0.588559 0.772253 0.416742
210 N20 dish_maintenance 100.00% 99.89% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.722178 0.743752 0.255806
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.804431 13.190839 -0.577339 5.953685 -0.900849 2.177483 -0.459655 1.394097 0.691819 0.040559 0.589033
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.640962 -0.933165 -0.421892 -0.900645 -1.276681 -1.038813 -0.990674 -0.925696 0.712444 0.683398 0.261480
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.130698 -0.333593 -1.051015 -1.176406 0.779313 -1.052508 -0.897690 -0.864431 0.720469 0.693688 0.253868
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.074505 -0.976334 -0.890954 -0.509452 -1.034948 -1.195070 -1.191530 -0.792606 0.725664 0.699174 0.249587
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.149664 -1.521116 -0.366258 -1.178377 -0.656989 1.486294 -0.393422 -0.413936 0.727996 0.701861 0.246316
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.922419 3.576627 2.993757 2.720243 1.285592 1.487818 1.384066 1.140093 0.674119 0.664112 0.263631
225 N19 RF_ok 100.00% 0.00% 41.55% 0.00% -0.928597 12.176756 -0.144069 5.638327 -1.151609 1.984435 -0.880441 1.254512 0.732479 0.309324 0.483004
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.503603 14.586218 -1.135598 -0.371669 -1.200191 -0.245679 -1.133406 -0.313769 0.726108 0.624347 0.250618
227 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.978980 0.024360 2.578153 -0.477722 0.944435 1.736573 2.377104 -0.100368 0.669584 0.686791 0.258145
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.026953 -0.519128 -0.060060 -0.690411 -1.129610 -0.654928 -0.746739 -0.412107 0.701723 0.676907 0.258246
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.641161 0.008478 -0.071768 0.446292 -1.179167 -0.656359 -0.811488 -0.234062 0.697958 0.667590 0.269085
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.447707 -0.313628 0.828503 -0.766958 -0.137155 -0.395493 0.796378 -0.427269 0.681705 0.667811 0.261039
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.386262 0.220648 0.268815 0.096556 -1.020014 -0.719378 -0.509677 -0.456742 0.707063 0.677207 0.267803
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.577196 -0.617027 -0.441343 -0.149039 -1.285627 -0.498828 -0.980023 -0.546487 0.717276 0.685575 0.262293
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.134644 0.444198 0.304834 -1.122389 0.073700 -0.984391 0.392222 -0.651788 0.716071 0.693097 0.250532
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.562401 -0.660619 -0.960365 -0.465045 -1.258618 -1.192181 -1.191409 -0.766307 0.728574 0.695378 0.259807
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 13.142431 -0.175437 -0.653543 0.620696 -0.680720 -0.498180 -0.664857 -0.086049 0.638888 0.690506 0.225282
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 10.243988 -0.633511 0.033631 -0.659318 1.458094 -0.731567 -0.203432 -0.336907 0.648399 0.692499 0.235141
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.329186 -0.622572 0.078758 -0.923941 -0.528394 -0.825976 0.085124 -0.526853 0.704272 0.689206 0.244799
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.998871 1.876041 0.099561 -1.078473 -1.096103 -1.201506 -0.680654 -0.856506 0.710854 0.675086 0.262176
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -1.230824 13.382342 -1.119445 5.527042 -1.145230 2.209817 -0.960550 1.383319 0.701133 0.039835 0.599777
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -1.084972 -0.215833 -0.537785 -0.789241 -1.050111 -1.032888 -1.072663 -0.807312 0.711091 0.677717 0.256545
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 10.431509 12.061176 0.436992 0.330756 0.222330 0.301600 0.768224 0.552319 0.717360 0.683474 0.262395
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.182387 0.309826 1.188309 0.500690 -0.377816 -0.694951 -0.008970 -0.181239 0.609847 0.570777 0.275800
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.378544 1.561940 0.273499 0.612537 -0.749992 -0.371564 -0.394407 -0.145195 0.590463 0.565662 0.266320
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% -0.118724 -1.071455 0.136123 -0.680407 -0.823540 3.629945 -0.511348 0.683060 0.658037 0.611834 0.263881
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.846211 0.971656 -0.003030 -1.109384 2.540670 -0.851919 -0.495768 0.034225 0.537671 0.523586 0.288507
333 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.045688 4.643531 -0.074409 -0.524152 0.032392 -0.555887 1.046624 0.408234 0.495508 0.478404 0.288920
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, 9, 15, 16, 17, 18, 27, 28, 31, 32, 34, 36, 37, 40, 42, 47, 52, 54, 55, 58, 59, 60, 63, 65, 66, 68, 70, 72, 77, 78, 79, 80, 81, 82, 83, 84, 87, 90, 92, 93, 94, 96, 101, 104, 108, 109, 111, 112, 113, 114, 117, 118, 121, 122, 124, 126, 127, 131, 134, 136, 137, 142, 143, 144, 147, 148, 149, 150, 151, 155, 156, 159, 161, 165, 167, 168, 169, 170, 180, 182, 184, 187, 189, 190, 191, 200, 204, 208, 209, 210, 211, 225, 226, 242, 243, 246, 262, 333]

unflagged_ants: [7, 8, 10, 19, 20, 21, 22, 29, 30, 35, 38, 41, 43, 44, 45, 46, 48, 49, 50, 51, 53, 56, 57, 61, 62, 64, 67, 69, 71, 73, 74, 85, 86, 88, 89, 91, 95, 97, 102, 103, 105, 106, 107, 110, 115, 120, 123, 125, 128, 132, 133, 135, 139, 140, 141, 145, 146, 157, 158, 160, 162, 163, 164, 166, 171, 173, 179, 181, 183, 185, 186, 192, 193, 201, 202, 205, 206, 207, 220, 221, 222, 223, 224, 227, 228, 229, 237, 238, 239, 240, 241, 244, 245, 261, 320, 324, 325, 329]

golden_ants: [7, 10, 19, 20, 21, 29, 30, 38, 41, 44, 45, 53, 56, 67, 69, 71, 85, 86, 88, 91, 103, 105, 106, 107, 123, 128, 140, 141, 145, 146, 157, 158, 160, 162, 163, 164, 166, 171, 173, 181, 183, 186, 192, 193, 202]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2460026.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.3.dev133+g7c00d5f
In [ ]: