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 = "2459929"
data_path = "/mnt/sn1/2459929"
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: 12-15-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/2459929/zen.2459929.21822.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 1827 ant_metrics files matching glob /mnt/sn1/2459929/zen.2459929.?????.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/2459929/zen.2459929.?????.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 2459929
Date 12-15-2022
LST Range 0.287 -- 10.120 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1827
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 94
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
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 62 / 201 (30.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 102 / 201 (50.7%)
Redcal Done? ❌
Never Flagged Antennas 98 / 201 (48.8%)
A Priori Good Antennas Flagged 43 / 94 total a priori good antennas:
3, 5, 7, 9, 10, 15, 16, 21, 29, 40, 42, 54,
55, 56, 67, 71, 72, 81, 94, 100, 101, 109,
111, 112, 118, 121, 122, 123, 127, 128, 136,
140, 143, 146, 147, 148, 149, 161, 162, 165,
170, 185, 189
A Priori Bad Antennas Not Flagged 47 / 107 total a priori bad antennas:
4, 8, 22, 35, 43, 46, 48, 49, 61, 64, 73, 74,
77, 79, 82, 89, 90, 95, 102, 114, 115, 120,
125, 132, 135, 137, 139, 179, 201, 205, 206,
207, 211, 220, 221, 222, 223, 229, 237, 238,
239, 244, 245, 261, 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_2459929.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% 5.538969 24.097268 11.063496 1.657094 1.572283 0.425864 1.762901 0.961649 0.035727 0.552101 0.461640
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.766998 -0.190457 -1.120627 0.084969 0.224198 -0.399370 -0.981016 -0.362719 0.774488 0.767026 0.226044
5 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 1.287789 4.663426 0.058568 0.227105 0.428750 0.827675 0.392544 0.435772 0.776233 0.759094 0.213604
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.195757 -0.208647 0.884426 1.968339 0.898367 5.033211 1.289850 2.267811 0.768559 0.763059 0.210147
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.451861 1.807965 2.545644 2.617189 0.688533 0.661882 1.047744 0.765852 0.740445 0.730879 0.247434
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.035615 -0.162424 7.950231 0.257543 7.903420 0.631157 8.266361 0.677980 0.671609 0.754218 0.267207
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.174774 -1.058479 0.686876 -0.843704 5.796835 -0.254136 0.888948 -0.112209 0.748148 0.745509 0.230123
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 5.683830 25.614309 11.020326 4.016843 1.568258 1.727381 1.762386 2.406065 0.032550 0.552489 0.449339
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 5.665899 -0.675380 11.030952 0.425747 1.571377 0.288303 1.761775 0.516911 0.036256 0.779571 0.654657
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.331754 0.633206 0.329157 0.296598 0.382144 0.267872 0.503036 0.279301 0.779487 0.772314 0.209537
18 N01 RF_maintenance 100.00% 100.00% 23.04% 0.00% 6.901556 76.302741 11.070584 0.604722 1.557799 3.617226 1.761512 1.275278 0.030561 0.418890 0.342376
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.281388 -0.998550 -0.794527 -0.980595 -0.086655 -0.456255 -0.374395 -0.566924 0.777994 0.772199 0.213516
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.859231 -0.569970 1.852216 -1.467057 1.924924 -0.977573 2.543312 -1.189391 0.770034 0.765489 0.219533
21 N02 digital_ok 100.00% 0.00% 0.11% 0.00% 0.226839 0.128624 -0.083667 4.227779 2.803060 5.113178 0.425704 4.609222 0.758215 0.730694 0.229261
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.565776 0.604915 -0.764933 -0.689080 -1.065174 -1.079746 -0.901023 -0.801865 0.729879 0.725255 0.239075
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.245837 10.511472 11.061601 11.336327 1.568766 1.770135 1.774945 1.328295 0.038409 0.042471 0.005348
28 N01 RF_maintenance 100.00% 0.00% 30.54% 0.00% 25.143611 75.018584 -0.288526 1.099810 0.237230 4.198493 0.787908 1.527877 0.569879 0.337124 0.343539
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 5.100609 9.262384 10.701432 10.990189 1.565756 1.754085 1.765844 1.311415 0.031514 0.039910 0.008604
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.301926 -0.259763 -1.027394 0.389812 -0.668208 0.111101 -0.722825 0.365672 0.782015 0.779993 0.208384
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.290387 -0.417507 0.168225 1.201238 0.195936 1.080772 0.573144 1.281723 0.786760 0.780038 0.204957
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 33.094830 7.437929 1.568481 1.960098 2.405768 3.856876 1.467880 2.791785 0.728206 0.750553 0.164645
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 7.046462 11.946531 5.686326 5.861931 1.563313 1.752901 1.763287 1.296696 0.037924 0.054031 0.011362
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.749480 0.975956 0.201875 -1.348389 -0.525041 -0.954838 -0.393004 -0.554795 0.732995 0.729308 0.243797
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.578936 5.008551 0.011625 -0.074490 0.487924 0.658682 0.491011 0.202348 0.768545 0.768046 0.225933
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.350458 0.723989 -1.713030 0.549954 -0.864447 0.676193 -1.146725 0.673904 0.777737 0.776898 0.224685
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.454555 -0.132279 0.243092 0.533524 0.499116 0.716860 0.717770 0.639330 0.783743 0.783132 0.214526
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 4.875090 -0.552961 10.692265 0.385728 1.570008 0.295476 1.789696 0.469838 0.043853 0.783182 0.603133
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.737227 0.095174 -0.457978 -0.057087 -0.400947 -0.105355 -0.199526 -0.024452 0.789319 0.788510 0.202177
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 7.086375 12.372943 11.333610 11.847327 1.594310 1.793426 1.783066 1.340139 0.033968 0.030640 0.003165
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.852037 0.258007 -0.779471 0.481693 0.748672 0.331845 -1.062794 0.510634 0.787616 0.786680 0.207598
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.990495 -0.291451 -1.706151 0.003079 -0.767319 0.132682 -1.202562 0.183652 0.785994 0.788265 0.205374
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.344135 -0.308278 0.166212 0.300882 0.205910 0.187276 0.507546 0.481911 0.781428 0.779819 0.202201
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.589486 1.420916 1.438512 1.307149 1.491241 -0.088192 1.981616 0.157181 0.774814 0.764963 0.226022
47 N06 not_connected 100.00% 100.00% 99.73% 0.00% 6.877220 10.309774 5.491162 5.470145 1.578574 1.750106 1.785149 1.300924 0.029928 0.071557 0.029195
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.172233 0.263561 -0.158717 0.804512 -0.641512 -0.450753 -0.654428 -0.161910 0.738721 0.726877 0.236278
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.384018 0.596890 0.026590 -0.921776 0.837533 -1.268772 0.183187 -0.886007 0.715519 0.730304 0.243652
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.011759 6.561565 0.404482 1.103754 0.993788 1.712895 1.105386 1.775302 0.758287 0.745427 0.219137
51 N03 dish_maintenance 100.00% 99.12% 0.00% 0.00% 18.420664 4.062328 14.066653 -0.501213 1.531491 -0.026926 1.805781 -0.307863 0.055507 0.693893 0.544287
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.246631 5.401089 -0.656883 0.116443 -0.208542 0.209593 -0.255144 0.244571 0.783186 0.782853 0.217700
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.352536 1.781370 -0.086726 -0.284024 0.145590 1.385213 0.383136 -0.006719 0.791114 0.789632 0.212581
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 5.654486 10.846607 11.080881 11.600607 1.581188 1.770824 1.794638 1.329881 0.032355 0.030850 0.001380
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 5.968090 11.364850 11.115096 11.525343 1.570786 1.755448 1.782548 1.334443 0.028257 0.034074 0.004933
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 1.913893 12.245975 0.501827 11.742673 0.491776 1.767341 0.860972 1.324327 0.792310 0.045160 0.623510
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.796304 1.174927 4.106207 0.664034 6.212704 1.024314 4.398771 0.704749 0.703287 0.788214 0.185103
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.134907 10.359743 10.955876 11.478035 1.596437 1.785172 1.801221 1.344496 0.041488 0.040706 0.000364
59 N05 RF_maintenance 100.00% 89.16% 0.00% 0.00% 6.448808 -0.556911 11.031288 0.769077 1.573092 0.339485 1.762261 0.878452 0.100923 0.787431 0.585164
60 N05 RF_maintenance 100.00% 0.00% 56.10% 0.00% 0.819559 10.667413 -0.993206 11.465358 -0.567877 1.582905 -0.537298 1.132622 0.780406 0.229994 0.511571
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.023958 0.338946 -0.066438 -1.105795 -0.173158 -0.983345 -0.047731 -0.813963 0.743379 0.751936 0.220726
62 N06 not_connected 100.00% 0.00% 0.00% 0.00% -1.001937 -0.906338 -0.108927 0.507671 6.406331 -0.509803 -0.092807 -0.303746 0.725192 0.745406 0.234271
63 N06 not_connected 100.00% 0.00% 99.95% 0.00% -0.482436 10.567673 -1.126610 5.852215 -1.077837 1.748779 -1.220305 1.313077 0.738068 0.052025 0.516198
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.142133 0.758085 -1.409462 -0.812136 -1.032153 -0.707208 -1.152714 -0.241758 0.725263 0.722825 0.243480
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.401869 0.219756 0.527955 0.123261 1.063132 0.874247 1.107813 0.379917 0.762394 0.767819 0.235502
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.021010 0.275548 2.001963 1.880642 2.271232 2.048578 2.699585 1.898888 0.771291 0.773834 0.224079
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.912650 8.074600 2.132836 2.154073 2.771372 3.046804 2.930324 2.182371 0.778536 0.766599 0.211765
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 34.597786 23.788779 2.520115 15.175623 0.559338 1.732274 1.849771 1.306477 0.571316 0.036448 0.446101
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.458912 -0.976074 0.434668 0.550937 0.488192 0.522851 0.795059 0.681025 0.790529 0.790930 0.201700
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.149780 0.096144 -0.157399 -0.139164 0.010817 -0.157748 0.027179 0.015949 0.788779 0.796003 0.202849
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.316196 -0.296070 0.260584 0.947765 0.361661 0.852110 0.711360 1.043095 0.800681 0.798202 0.193182
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 4.653538 12.066187 0.897848 11.890475 0.898891 1.783091 1.302532 1.339758 0.797670 0.041169 0.624196
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.285138 0.263363 -1.484074 1.762478 -0.917251 1.799246 -1.357579 1.737066 0.795870 0.794497 0.198529
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.320541 1.119223 -0.587746 -0.714970 -0.672788 -0.335662 -0.868980 -0.401648 0.789165 0.793098 0.205126
77 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.777587 -0.703220 -0.241068 -0.685748 -0.676805 -1.122834 -0.667123 -0.902005 0.758053 0.754230 0.229827
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 9.926690 -1.161012 0.339373 0.761330 -0.069000 -0.420582 0.363393 -0.176725 0.625512 0.748054 0.233460
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.113226 0.010197 -1.468925 -0.378737 -1.155679 -0.951484 -1.164620 -0.753598 0.692597 0.692519 0.212697
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.639950 11.083382 1.941913 5.780421 0.484686 1.757826 0.719020 1.303502 0.673773 0.057127 0.450292
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% 0.209216 11.548819 -0.030054 10.103502 0.252662 1.764520 0.371771 1.308523 0.749088 0.044040 0.539530
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.462514 0.834050 0.250772 2.324408 0.290165 2.124326 0.598933 2.291451 0.763741 0.758961 0.225689
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.646114 -0.296713 0.151973 0.377769 0.162357 0.334801 0.410802 0.565151 0.774473 0.776725 0.219061
84 N08 RF_maintenance 100.00% 15.22% 100.00% 0.00% 1.676933 8.068062 13.326401 14.486502 4.918288 1.747169 5.717506 1.341898 0.514772 0.041790 0.307440
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.683773 0.588367 0.482944 1.111730 0.365437 0.883300 0.810712 1.183644 0.792569 0.789862 0.203410
86 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.582973 -0.920245 1.881799 1.553818 2.005666 1.177973 2.273135 1.462945 0.789772 0.780865 0.192308
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.610233 8.449854 -0.494720 -0.245851 -0.168173 -0.085132 -0.090795 -0.073669 0.804087 0.802791 0.191858
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.813113 0.203063 0.403322 0.766758 0.269562 0.664085 0.653443 0.776085 0.797784 0.798965 0.188560
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.925587 -0.290526 0.208612 0.764236 0.225608 0.413832 0.557044 0.706388 0.801191 0.798594 0.188784
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.370592 -0.908494 -1.723970 1.184634 -1.029667 0.646055 -1.262202 1.174660 0.797110 0.795098 0.192534
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.788909 -0.899209 0.413853 0.329444 0.353588 0.180252 0.739221 0.403219 0.789895 0.794079 0.197306
92 N10 RF_maintenance 100.00% 0.00% 0.55% 0.00% 47.685443 48.292416 1.988860 1.293770 0.476156 0.809515 1.444374 0.799300 0.494563 0.468343 0.077178
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.697219 0.089664 2.062650 0.263667 1.811020 0.070392 2.648866 0.327499 0.773467 0.778676 0.213575
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.758251 11.146885 11.260820 11.394249 1.589239 1.758120 1.769385 1.309008 0.034884 0.027676 0.003268
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.073770 -1.120725 -1.475763 0.044562 -1.101470 -0.783077 -1.293826 -0.511591 0.700907 0.707490 0.217584
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 6.699680 10.893565 5.493707 5.947693 1.583231 1.769345 1.771823 1.309531 0.034332 0.040681 0.003181
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.512300 42.154102 -1.311255 1.466349 -1.102566 21.264019 -1.118443 0.751447 0.685438 0.593840 0.246534
98 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.610098 2.001012 -0.582685 -1.676178 0.729135 1.478288 0.148840 -0.688973 0.741761 0.746296 0.243655
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.988553 0.306372 1.078918 0.582226 1.289297 0.850987 1.365515 0.763189 0.744391 0.760392 0.235746
100 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 207.341044 203.843397 inf inf 1090.893039 1247.900830 99.053932 127.876709 nan nan nan
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.328322 6.989107 -0.529822 0.546650 -0.310953 0.449833 -0.077801 0.750855 0.781329 0.781674 0.214910
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.243544 -0.685111 -1.069644 1.141262 -0.892151 1.341426 -1.222309 1.135971 0.788205 0.785498 0.211216
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.264128 3.582368 2.478178 -0.586297 1.581772 -0.442380 0.944193 -0.326474 0.767081 0.793210 0.224864
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.488968 12.645033 6.440044 7.689613 7.281229 8.614042 8.054921 8.911240 0.768464 0.787341 0.196224
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -1.056573 -0.029587 -0.376679 0.796498 1.189667 0.484923 0.144676 0.815150 0.804271 0.799213 0.187178
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 2.073711 0.657990 1.777880 0.958941 1.949351 0.694703 2.124329 0.879881 0.797849 0.799873 0.185472
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.405093 -0.549345 -0.077443 -0.245676 -0.150957 -0.261246 0.222323 -0.114351 0.801262 0.799696 0.187646
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.933966 60.467093 11.026750 1.876516 1.570055 1.581048 1.767605 0.731737 0.041365 0.527461 0.265543
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 5.295366 10.616573 11.065113 11.242706 1.566689 1.763512 1.774216 1.332253 0.026369 0.027150 0.001316
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 21.501602 24.133771 14.699671 14.859767 1.536095 1.747384 1.748709 1.278087 0.025964 0.029376 0.001530
111 N10 digital_ok 100.00% 0.00% 99.84% 0.00% -0.053700 9.523410 0.548321 11.334276 0.462630 1.758162 0.940403 1.346152 0.774368 0.046526 0.457490
112 N10 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 7.760975 10.862394 5.303990 5.847840 1.577222 1.771782 1.784890 1.314714 0.037235 0.029462 0.003906
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.968995 -0.504350 -1.571290 -0.706599 -0.973223 -1.031722 -1.217481 -0.986888 0.682836 0.697286 0.228144
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.102001 -0.491427 0.593986 1.420882 -0.270017 0.013712 -0.118418 0.115750 0.678096 0.685681 0.247808
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.003223 0.488839 -0.172381 0.641460 0.554240 1.404822 0.628374 1.175758 0.734830 0.741010 0.243246
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.001984 12.776741 11.158548 11.893029 1.578035 1.759363 1.765327 1.315609 0.026631 0.025103 0.001589
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 7.955552 12.943140 11.156037 11.888655 1.584400 1.768109 1.769797 1.300875 0.027070 0.033515 0.003819
119 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.157780 0.993572 2.490490 1.459850 2.495998 -0.010817 3.214084 0.232745 0.776793 0.763756 0.217167
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.313598 7.932938 -1.220257 1.385240 -0.856731 1.119660 -0.748525 1.555843 0.792932 0.791909 0.201976
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.965650 6.394041 0.242473 0.482413 0.066754 0.403692 0.741329 0.699345 0.800730 0.798261 0.189933
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.951161 7.008943 0.409494 0.623628 0.395761 0.651210 0.919145 0.782933 0.806520 0.802110 0.186784
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.709782 -0.372653 0.125447 0.634672 0.178466 0.442026 0.541798 0.716262 0.807655 0.804670 0.185469
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.447453 -0.537356 -0.367298 0.896904 -0.224722 0.600990 -0.062116 0.924579 0.805094 0.803583 0.185326
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.288054 1.303426 0.562155 0.762979 0.790636 0.231777 0.566742 0.835189 0.726026 0.798195 0.177553
127 N10 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.305613 -0.619254 0.737719 0.872538 0.771055 0.720275 1.128225 0.948259 0.777988 0.785116 0.214324
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.785116 0.077872 0.159603 0.247879 0.145804 0.029523 0.530686 0.498119 0.768301 0.777051 0.221918
131 N11 not_connected 100.00% 0.00% 13.68% 0.00% -0.818608 8.368069 -0.671850 5.626817 0.635821 0.915707 -0.872423 1.373250 0.705050 0.453973 0.299148
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.341806 0.604062 -1.257840 -1.442334 -1.046573 -1.041380 -1.243452 -0.853038 0.693150 0.701520 0.222320
133 N11 not_connected 100.00% 99.40% 0.00% 0.00% 7.717154 -0.592749 5.290992 -1.152377 1.567408 -0.749028 1.754828 -0.641432 0.065017 0.693293 0.439017
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.279246 -1.435291 -0.347591 -1.497750 0.658408 -0.921939 0.641263 -0.845829 0.727796 0.735519 0.259103
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 2.447047 0.214072 6.743831 3.879849 9.168073 7.001182 7.930985 4.211054 0.663467 0.719587 0.246083
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.369461 -0.517301 -0.063994 -1.138996 -0.029147 -0.823934 0.435343 -0.640415 0.747894 0.753680 0.237430
138 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.179573 1.395430 0.672897 -1.327764 -0.297084 -1.398180 -0.108478 -1.179654 0.762234 0.762585 0.229969
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.101722 -0.854573 -0.378258 -0.802890 4.814883 -1.150370 -0.042560 -0.942295 0.784170 0.782657 0.209224
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.867985 -1.051448 -0.438136 -0.015499 -0.320232 0.212394 0.019041 -0.579249 0.793791 0.785733 0.202277
142 N13 RF_maintenance 100.00% 0.00% 98.58% 0.00% -0.830808 10.469607 -0.910176 11.505604 -0.702809 1.749330 -0.371146 1.299099 0.798549 0.074719 0.527794
143 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 1.016235 0.653962 5.834368 0.090890 6.519899 0.029253 7.138278 0.409511 0.773770 0.795225 0.192954
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.003223 -0.101021 -0.323886 1.176578 -0.429114 1.732824 0.167664 1.315184 0.805397 0.803789 0.186693
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.894507 2.821216 -0.124801 5.461159 -0.027942 5.247637 0.351172 5.697337 0.804163 0.778227 0.191880
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 6.703277 0.258525 5.292424 -0.604175 1.565453 -1.158978 1.757033 -0.978068 0.042353 0.790875 0.581599
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
149 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 2.418087 -0.897894 0.663607 0.179634 -0.220283 -0.704941 -0.049603 -0.469718 0.760737 0.768785 0.247240
155 N12 RF_maintenance 100.00% 99.84% 0.00% 0.00% 4.604920 -0.708707 10.744265 -1.721696 1.569547 0.717432 1.770118 -0.488510 0.042736 0.730915 0.471375
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.890275 9.050328 5.563172 11.237291 3.684344 1.748489 7.107675 1.346798 0.696801 0.045132 0.464814
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.228393 0.091155 -0.112454 0.397983 0.140823 0.506565 0.491958 0.841279 0.745253 0.748926 0.238496
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.088357 -0.976424 -0.536708 -1.019964 -0.331533 -0.534826 -0.028331 -0.438937 0.758444 0.759269 0.231976
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.741596 12.756980 -1.363641 -0.802659 -1.114947 -0.727851 -1.047484 -0.433678 0.751200 0.670819 0.209824
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.311526 -1.007635 -0.225591 -0.903742 -0.016013 -0.712299 0.299704 -0.401298 0.780615 0.777861 0.208440
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.496929 30.912231 -0.052468 0.120093 -0.001485 -0.360049 0.392239 -0.171487 0.788706 0.712349 0.184598
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.732508 -0.638443 1.768257 0.113034 0.461624 6.994919 0.645495 -0.184186 0.777970 0.783902 0.212636
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.348077 -0.163112 -0.245545 0.258372 -0.224305 0.186445 0.157115 0.444016 0.802959 0.799431 0.191679
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.097206 0.320927 1.601635 -0.241105 1.761490 -0.182380 2.210537 -0.007494 0.799936 0.800073 0.186199
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 6.817177 -0.246091 2.647087 0.423439 2.692833 1.142989 2.802111 0.708404 0.715125 0.803345 0.182865
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.141346 6.133783 -0.320822 0.117563 0.068682 -0.443208 0.097499 -0.301026 0.797067 0.778944 0.196320
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.622351 -0.304626 -1.389831 2.967207 -0.956677 2.432654 -1.309220 3.204067 0.795799 0.792633 0.203716
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.735546 -0.691919 0.118315 -0.449927 -0.043431 -0.188836 0.539740 -0.039024 0.790080 0.792701 0.207471
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.352127 -1.001116 -0.916107 -1.725941 -0.644033 -1.042343 -0.476357 -1.146072 0.783520 0.786094 0.217336
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 6.667951 -0.687234 11.270476 -1.108440 1.573729 -0.865469 1.758872 -0.613347 0.048600 0.781991 0.592967
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.732767 -0.600328 1.050263 2.030691 1.245628 1.858887 1.682859 2.441468 0.758242 0.755648 0.221172
180 N13 RF_maintenance 100.00% 0.00% 98.41% 0.00% 0.339713 11.461556 -0.627418 11.640512 -0.470853 1.763197 -0.200196 1.323160 0.770006 0.076771 0.527129
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.309368 -0.281105 -0.006894 0.602293 0.195950 3.353102 0.433554 0.758223 0.782827 0.779572 0.206975
182 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.508872 1.842161 -0.220806 2.420562 0.204259 0.578112 -0.674306 0.674675 0.788312 0.762639 0.218597
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.857960 0.665208 1.029524 2.462181 0.858722 1.806251 1.548612 2.502960 0.782907 0.780998 0.183515
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.766969 0.031473 -0.567225 3.158975 -0.359677 3.157994 0.096240 3.598724 0.799780 0.795005 0.186197
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 6.200644 1.129282 8.248547 3.972707 6.597937 3.773962 7.764226 4.417627 0.640339 0.784344 0.223543
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.686991 -1.234876 -1.707766 -0.812061 -0.985796 -1.081284 -1.158290 -1.001419 0.800411 0.796764 0.200725
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.184585 -0.600642 -1.516512 -0.361948 -1.134885 2.188897 -1.234109 0.321614 0.797797 0.800578 0.201018
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 3.897565 9.122763 10.572643 11.278451 1.564193 1.753173 1.767204 1.324855 0.029079 0.034446 0.002340
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.570654 -1.234021 -0.527758 -0.357920 -0.366855 -1.012425 -0.086127 -0.807084 0.776858 0.780170 0.225514
191 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.501653 -0.520964 1.186370 -0.501719 1.044150 -0.376097 1.761562 -0.062501 0.768655 0.776127 0.227393
200 N18 RF_maintenance 100.00% 100.00% 19.32% 0.00% 7.053291 51.366236 5.469186 -0.856965 1.556449 1.274576 1.775467 0.248323 0.042197 0.406782 0.288832
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.615634 1.804245 1.908863 3.151623 0.331371 1.074805 0.690767 0.936468 0.717949 0.697988 0.205753
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% 0.128527 -0.409095 0.676085 -1.704018 -0.255016 -1.141724 -0.043903 -0.664034 0.730682 0.724110 0.188000
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.092600 12.649191 5.249251 5.635588 1.569620 1.771621 1.778668 1.318314 0.033710 0.044181 0.003326
205 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.442947 2.150223 -0.713062 -0.020952 -0.680449 -0.247127 -0.759958 0.037123 0.732345 0.723584 0.178925
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.790957 0.948072 0.257096 -0.619977 -0.384543 -0.981539 -0.226257 -0.860947 0.734234 0.731250 0.186081
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.929410 2.378667 0.462503 -0.506614 -0.250129 -0.882173 -0.138410 -0.768213 0.722993 0.725327 0.182486
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 1.688334 7.144864 10.083578 10.879535 1.562213 1.884534 1.823343 1.622842 0.032271 0.034826 0.001035
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 1.256888 3.455572 9.948740 9.970656 1.568453 1.844896 1.832047 1.402481 0.040229 0.039269 0.001231
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 9.179132 10.658886 1.912275 3.110354 2.252211 3.093431 2.412302 3.353174 0.722818 0.723719 0.194367
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.929455 -0.514494 -1.536226 0.089638 1.019677 -0.081931 -1.179619 -0.505468 0.702152 0.710842 0.215220
219 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.291586 2.044808 3.674159 2.585991 1.359709 0.705011 1.486944 0.695336 0.684475 0.696021 0.229754
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.764822 -0.647359 -0.353750 -1.080250 -0.795998 -1.212694 -0.670499 -1.083846 0.723921 0.716118 0.191049
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.074166 -0.776665 -0.643674 -1.413953 -0.781906 -1.323142 -0.905385 -1.173177 0.728302 0.722900 0.186613
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.258875 -1.133645 -0.772299 -0.522840 -0.895917 -1.034195 -0.996209 -0.898359 0.731486 0.728959 0.185651
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.937146 1.120462 -1.252125 0.410345 -0.866688 -0.575161 -0.990482 -0.328573 0.724631 0.726573 0.186044
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.493833 2.186801 3.938141 3.691166 1.372401 1.351395 1.608457 1.139896 0.690213 0.691408 0.213947
225 N19 RF_ok 100.00% 0.00% 29.78% 0.00% 1.953722 10.441200 0.237399 5.536702 0.227951 1.292688 -0.202473 0.934534 0.730500 0.330499 0.464947
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.015064 7.164175 -0.637344 0.002346 1.943983 0.048284 -0.742781 -0.164094 0.730423 0.670222 0.194344
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 4.465704 0.855223 -1.139838 -0.539007 3.703088 0.327906 -0.641706 -0.783475 0.715210 0.721211 0.193827
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.546974 5.777287 -0.009739 -1.529275 2.335367 4.690641 0.376182 -0.126786 0.673668 0.656346 0.154839
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.701717 -0.530667 0.797198 0.646048 0.110415 -0.258592 0.006719 -0.237145 0.708482 0.716287 0.218467
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.358249 -0.140571 -0.003079 -1.603724 0.147767 -1.145024 0.076220 -0.897581 0.699143 0.702709 0.194514
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.009559 -0.077588 0.180441 -0.126401 -0.527320 -0.892718 -0.376936 -0.709963 0.720019 0.712788 0.196069
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.842440 -0.565336 -0.839905 -0.351761 -1.011511 -0.937192 -1.063526 -0.804356 0.725312 0.717747 0.190384
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.809891 30.370683 1.954163 0.269671 0.554430 4.738932 0.878671 0.600784 0.639652 0.578438 0.123207
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.208415 5.023923 -1.354212 0.995606 -0.905755 0.405177 -1.091806 0.733458 0.721629 0.692133 0.186188
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.396152 0.768757 -1.146419 0.699124 0.406217 -0.436409 -0.531220 -0.216962 0.662324 0.721283 0.182124
243 N19 RF_ok 100.00% 0.11% 0.00% 0.00% 72.516887 1.933612 0.320302 -1.592689 0.897934 -1.177310 0.488720 -0.854706 0.530456 0.715996 0.294789
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.241309 1.579864 1.693595 -0.506154 1.884655 1.169970 1.261722 -0.156994 0.683543 0.712520 0.193066
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 2.236312 0.589589 2.014466 0.548704 0.439532 -0.360565 0.750723 -0.269014 0.709055 0.715245 0.218050
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.135506 17.982192 -1.391066 -1.170183 1.224455 1.225391 0.631680 -0.001446 0.517870 0.514753 0.135863
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 2.092304 1.746988 0.017108 -0.928516 0.351732 0.548888 -0.363933 -0.823627 0.715504 0.711408 0.200682
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 1.132561 2.782955 9.991501 10.313993 1.570972 1.730124 1.831759 1.446790 0.035449 0.028754 0.006079
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 3.902934 8.522870 5.833319 7.964054 2.207246 1.750199 3.424540 1.328738 0.582669 0.052601 0.470229
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 2.238669 0.564468 0.366033 0.785123 -0.521445 -0.692745 -0.484516 -0.349363 0.642166 0.638604 0.285713
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% -1.067456 0.576221 0.511424 -1.703574 -0.482616 -0.623220 -0.462459 -0.310560 0.687970 0.675958 0.259236
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.399192 0.247771 -1.663831 -1.066055 2.362333 -0.525748 -0.047272 -0.553522 0.633637 0.655629 0.287718
333 N12 dish_maintenance 0.00% 0.00% 0.27% 0.00% 1.320636 2.894189 -0.640613 -1.297030 0.392193 0.889582 0.776304 -0.410070 0.586127 0.630921 0.323598
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, 5, 7, 9, 10, 15, 16, 18, 21, 27, 28, 29, 32, 34, 36, 40, 42, 47, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 62, 63, 67, 68, 71, 72, 78, 80, 81, 84, 87, 92, 94, 96, 97, 100, 101, 104, 108, 109, 110, 111, 112, 113, 117, 118, 119, 121, 122, 123, 126, 127, 128, 131, 133, 136, 138, 140, 142, 143, 145, 146, 147, 148, 149, 155, 156, 159, 161, 162, 165, 166, 170, 180, 185, 189, 200, 203, 208, 209, 210, 219, 224, 225, 226, 227, 228, 240, 241, 242, 243, 246, 262, 320, 333]

unflagged_ants: [4, 8, 17, 19, 20, 22, 30, 31, 35, 37, 38, 41, 43, 44, 45, 46, 48, 49, 53, 61, 64, 65, 66, 69, 70, 73, 74, 77, 79, 82, 83, 85, 86, 88, 89, 90, 91, 93, 95, 98, 99, 102, 103, 105, 106, 107, 114, 115, 116, 120, 124, 125, 129, 130, 132, 135, 137, 139, 141, 144, 150, 157, 158, 160, 163, 164, 167, 168, 169, 179, 181, 182, 183, 184, 186, 187, 190, 191, 201, 202, 205, 206, 207, 211, 220, 221, 222, 223, 229, 237, 238, 239, 244, 245, 261, 324, 325, 329]

golden_ants: [17, 19, 20, 30, 31, 37, 38, 41, 44, 45, 53, 65, 66, 69, 70, 83, 85, 86, 88, 91, 93, 98, 99, 103, 105, 106, 107, 116, 124, 129, 130, 141, 144, 150, 157, 158, 160, 163, 164, 167, 168, 169, 181, 182, 183, 184, 186, 187, 190, 191, 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_2459929.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.dev11+g87299d5
3.1.5.dev197+g9b7c3f4
In [ ]: