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 = "2460049"
data_path = "/mnt/sn1/2460049"
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: 4-14-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/2460049/zen.2460049.42104.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 362 ant_metrics files matching glob /mnt/sn1/2460049/zen.2460049.?????.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/2460049/zen.2460049.?????.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 'startTime' 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 2460049
Date 4-14-2023
LST Range 13.053 -- 14.999 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 362
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 40, 42, 70, 112
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 63 / 198 (31.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 106 / 198 (53.5%)
Redcal Done? ❌
Never Flagged Antennas 90 / 198 (45.5%)
A Priori Good Antennas Flagged 51 / 93 total a priori good antennas:
7, 15, 17, 19, 31, 37, 38, 40, 42, 54, 55,
65, 66, 70, 72, 81, 83, 86, 93, 94, 101, 103,
109, 111, 112, 118, 121, 124, 127, 136, 140,
147, 148, 149, 150, 151, 158, 160, 161, 164,
165, 167, 168, 169, 170, 182, 184, 189, 190,
191, 202
A Priori Bad Antennas Not Flagged 48 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 57, 61, 62, 64, 73,
74, 79, 80, 89, 90, 95, 108, 113, 114, 115,
120, 126, 132, 133, 139, 185, 201, 206, 207,
220, 221, 222, 224, 228, 229, 237, 238, 239,
240, 241, 244, 245, 261, 320, 324, 325, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2460049.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
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.986463 13.568849 -1.023398 -0.460303 -0.538462 1.519019 -0.694804 1.604869 0.621897 0.495228 0.429010
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.279839 0.316109 0.387677 2.855675 0.751606 0.618797 -0.073495 0.446107 0.627312 0.612212 0.433657
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.560807 -0.125321 -0.401835 0.184998 0.180773 0.656148 4.206567 7.966136 0.634583 0.621727 0.424006
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.682398 1.456661 1.073819 1.070435 0.096115 0.157320 -1.544735 -1.747933 0.608812 0.601713 0.410141
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.769258 -0.382859 3.001647 -0.302727 -0.245648 -0.168461 1.118187 -0.285236 0.613789 0.622056 0.416103
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.630904 -0.481275 -0.327895 -0.499123 -0.759583 -0.177121 0.837170 1.074584 0.622963 0.608467 0.421440
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 10.857853 -0.462711 -0.536639 -0.475829 -0.182294 0.172325 -0.394620 0.926204 0.515844 0.632269 0.414448
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.125766 1.081443 0.214247 0.834978 -1.106060 -0.285448 -1.500547 -1.937505 0.632307 0.622175 0.425940
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.017496 2.451936 0.939362 7.539428 2.189268 -0.191053 1.640797 4.340175 0.628615 0.491058 0.457273
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.309159 5.462369 0.866010 1.363865 1.302264 1.557532 6.938875 16.696791 0.613831 0.419644 0.470616
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.086303 -0.015202 -0.137034 2.810748 0.832302 4.811297 0.327722 8.278064 0.645409 0.629342 0.420078
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.717349 -0.979590 1.801278 -0.291942 2.189388 -0.213630 1.026667 0.146347 0.634301 0.638199 0.405583
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.390082 0.369422 0.112465 0.314840 0.752419 2.505722 0.316906 0.234773 0.631030 0.623332 0.410991
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.133701 -0.941904 -0.830737 -0.916045 -0.477966 0.200593 -0.339467 -0.534704 0.605037 0.606683 0.414428
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.478931 19.924910 8.482522 5.391028 1.427005 3.293588 4.041301 63.441506 0.072135 0.069311 -0.044084
28 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.101198 10.989710 8.646007 3.578014 1.628395 1.893586 1.542957 16.943456 0.030855 0.324110 0.257431
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.769360 -0.340722 -0.048428 0.078932 0.060290 0.487076 -0.027414 1.410905 0.657207 0.643561 0.420567
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.254514 -0.784710 0.389159 -0.600580 1.070343 0.207584 0.416842 -0.295972 0.653515 0.650476 0.414392
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.483178 -0.264094 1.132933 2.828040 2.058453 0.177797 0.197631 19.400412 0.661639 0.637151 0.421122
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.634111 12.722460 0.009460 -0.056235 -0.250767 1.017924 0.650778 1.074629 0.556490 0.570342 0.222764
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.033629 -0.596824 4.919873 -0.714099 1.566302 -0.971520 1.052335 -0.216509 0.046563 0.618008 0.462810
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.539693 -0.799570 -0.329041 -0.459448 -1.136090 -0.061415 -0.974718 0.098090 0.617012 0.605705 0.416699
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 117.921101 118.455750 inf inf 2378.987137 2365.700198 4735.167725 4667.240745 0.109480 0.087470 0.047839
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.574211 15.409430 -1.032679 11.130317 0.935967 2.207760 3.120381 7.468187 0.627477 0.032988 0.514227
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.228905 -0.100744 0.045522 0.503459 2.013772 0.836158 3.077334 7.649360 0.638916 0.625458 0.436173
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.316815 1.714119 0.193721 -0.167753 0.812295 1.190023 29.380289 1.748990 0.222364 0.218873 -0.325340
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.470534 0.583008 1.178254 2.012815 1.716757 0.382205 0.888241 1.172085 0.651095 0.646152 0.418693
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.006417 2.119683 -0.187669 -0.450468 0.561846 1.397983 0.789078 2.215208 0.245526 0.227745 -0.322156
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.901560 0.010712 -1.026518 0.791635 -0.998047 0.673702 -0.748575 0.615318 0.652863 0.653373 0.415997
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.476214 0.376367 -0.524485 0.525486 0.197722 -0.217195 -0.397827 0.124789 0.666666 0.663953 0.419291
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.761487 0.976795 0.886619 0.668386 0.577427 1.156977 0.321852 1.964136 0.653507 0.646753 0.409939
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.077763 -0.667457 0.217185 -0.943090 1.092934 0.676956 0.093068 -0.341597 0.645266 0.652995 0.414540
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 6.699456 8.464687 4.853246 4.866035 1.965979 1.590038 3.622826 2.122277 0.031401 0.056868 0.017727
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.422094 -0.155264 -1.009264 -0.000033 -0.718090 -0.468259 -0.218467 -1.256595 0.624593 0.622606 0.406979
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.306662 -0.901762 0.648629 -1.056427 0.566023 -0.430472 0.719980 6.819862 0.592422 0.601889 0.400895
50 N03 RF_maintenance 100.00% 99.45% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.322649 0.202981 0.284121
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.112597 0.533762 0.068905 -0.223244 3.052984 0.791353 57.975917 0.685377 0.614099 0.618179 0.423957
52 N03 RF_maintenance 100.00% 100.00% 99.72% 0.00% 102.584929 103.329905 inf inf 2134.479155 2117.244416 4814.320615 4829.118597 0.130656 0.355783 0.269250
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.047053 0.274841 0.013178 -0.798472 -0.015316 0.377013 3.849250 2.379230 0.648549 0.642240 0.427503
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 3.306329 1.263234 0.764640 -0.669959 0.228637 4.145716 1.098929 -0.405011 0.373256 0.417840 0.190102
55 N04 digital_ok 100.00% 1.66% 100.00% 0.00% 0.559080 30.012746 -0.087210 6.411852 0.328253 2.110003 3.526328 2.641356 0.245841 0.042449 0.090560
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.210680 1.442837 -0.943854 1.623276 0.280304 3.048847 1.509799 2.919122 0.652121 0.641372 0.406020
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.261174 1.803901 -0.941262 0.063405 0.985971 0.761277 -0.223612 0.995616 0.663862 0.649660 0.408797
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.746501 7.983987 8.661179 9.118009 1.915250 1.573357 2.471842 2.424938 0.038919 0.038118 0.002029
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.407779 0.568260 8.678130 0.913956 1.504879 1.058268 0.695030 4.349308 0.049162 0.654734 0.503611
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.457078 7.956704 0.276785 9.143352 0.234890 1.205740 -0.066141 2.178013 0.644805 0.089649 0.523257
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.212001 -0.789799 1.346563 -0.386430 0.521833 -0.454658 0.540977 0.544067 0.598942 0.627411 0.404902
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.312939 0.127674 0.530243 -0.049145 -0.823737 -0.882452 0.231738 -1.072541 0.613511 0.630134 0.403174
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.595073 8.246456 -0.996708 5.175452 -0.502734 1.281324 -0.512849 2.337772 0.627400 0.047828 0.497823
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.710573 -0.507631 -0.787173 -0.002593 -0.688243 -0.558168 -0.521297 -0.023183 0.607461 0.602077 0.408465
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 14.555378 14.181276 10.921421 10.941141 1.782875 1.587541 4.766041 5.831675 0.023950 0.033086 0.009499
66 N03 digital_ok 100.00% 36.19% 100.00% 0.00% 1.739758 14.541117 0.809501 11.061600 0.440477 1.351699 -1.633283 5.212014 0.207967 0.049373 0.084401
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.605939 -0.212277 -0.453835 0.863928 0.103837 0.340114 1.758038 1.735534 0.626377 0.620062 0.418576
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 15.441178 -0.293139 10.969690 -0.280753 2.662077 1.031071 9.429223 4.351684 0.035497 0.638607 0.514979
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.955434 2.631952 1.369340 -0.503966 1.412391 2.132587 3.482353 1.573519 0.650739 0.651530 0.416505
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.055665 2.299132 1.050256 2.478242 0.721002 2.745962 3.467365 2.018749 0.248733 0.223147 -0.308211
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.820762 -0.169863 -0.173625 0.400777 0.813165 0.488908 0.693584 1.413785 0.668038 0.658427 0.409344
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.374005 8.061949 2.157006 9.221388 0.483248 1.011260 10.633685 1.220051 0.270636 0.090618 -0.013344
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.460135 1.068942 -0.447734 1.232178 -0.277226 1.902674 0.466217 1.991017 0.674150 0.661705 0.419314
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.928898 -0.432223 -0.524649 -0.421694 0.603484 0.526984 -0.933874 0.175443 0.669191 0.661300 0.415523
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 26.894476 8.125421 0.241887 -0.702397 0.777619 0.223879 1.469863 1.342130 0.406443 0.549355 0.297718
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 13.973537 -0.105882 0.064692 0.048801 -0.397609 -0.876975 -0.044853 -0.864123 0.492359 0.632109 0.368761
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.091488 -0.784400 0.807023 -0.758091 1.348890 -0.227118 0.407594 -0.507191 0.598651 0.617021 0.405304
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.789688 1.083212 -0.715058 0.885253 -0.913092 0.112447 -0.612007 -1.612329 0.620355 0.605561 0.418891
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 49.005760 32.406651 21.751671 21.481675 26.496910 21.256405 386.128115 358.315019 0.017559 0.016242 0.001273
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 16.814709 35.100750 16.287860 20.791662 9.896975 32.878123 174.624246 385.642261 0.017114 0.016288 0.001071
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 16.605692 28.154396 16.140893 18.164914 14.642663 19.773349 237.963454 328.647001 0.016984 0.016513 0.000947
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.506027 15.597853 0.471062 11.124615 -0.574001 1.158696 -1.653429 4.185370 0.631733 0.052462 0.494205
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.629189 0.031711 -0.970703 -0.255692 -0.748996 0.579429 -0.758766 -0.053080 0.651492 0.645397 0.411441
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.431054 0.414061 0.932006 0.158940 -0.146573 0.062579 0.219895 16.242510 0.657775 0.646183 0.400769
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 18.295219 2.239935 2.987257 -0.781058 3.197657 -0.081487 30.392014 1.082794 0.544847 0.665137 0.360743
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.251977 0.847361 0.819932 1.291416 1.003081 0.328182 0.684537 0.370081 0.664905 0.656255 0.397295
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.601559 0.305639 0.816347 1.041015 0.550665 0.990515 0.012041 0.163291 0.662268 0.654620 0.402273
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.454294 -0.744756 -0.040544 -0.944262 -0.760446 -0.957832 -0.105779 0.164165 0.655784 0.662184 0.404671
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.000602 0.204393 0.920955 0.677847 0.431042 0.286266 0.178717 0.129961 0.649732 0.657329 0.407887
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.098489 -0.008586 8.684732 0.422627 1.625458 0.172352 0.644440 1.100943 0.037245 0.657151 0.472355
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.309407 8.101609 8.740706 9.179767 1.549925 1.183307 2.112915 1.891171 0.031415 0.025211 0.003186
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.668827 2.796223 8.835202 7.495037 1.568331 1.743099 0.996427 0.732352 0.028671 0.505991 0.355129
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.573367 -0.577018 0.015496 -0.484812 0.352053 -1.088279 -0.170536 -0.835431 0.611461 0.635118 0.414791
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.019063 11.360158 0.051649 -0.590237 -1.128162 0.141336 -1.390736 1.109866 0.626065 0.547835 0.398704
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.009104 1.119368 -0.686306 0.463690 -0.790927 0.017525 -0.087432 4.892591 0.605104 0.591517 0.409652
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.862664 4.096146 0.319339 1.041734 0.499814 1.219211 -0.077124 0.395133 0.642645 0.637603 0.414497
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.709602 0.346072 -0.730682 -0.222948 -0.525199 1.528521 -0.477363 4.764978 0.654229 0.647015 0.407375
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.568629 2.220697 0.850040 -0.656466 -0.139994 0.529603 -1.624872 6.982288 0.643130 0.653261 0.398329
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.705271 32.227603 1.473462 5.566131 1.105966 -0.179576 1.132043 2.988222 0.655396 0.639849 0.403695
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.040673 0.446345 0.530437 1.103416 1.050063 0.214540 0.309284 0.189654 0.671177 0.665004 0.403986
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.299461 0.729883 0.450880 0.355075 -0.207468 0.204687 0.491466 0.245771 0.659156 0.659750 0.397399
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.897585 -0.019267 0.363306 -0.157534 1.147477 0.304722 0.675636 1.783135 0.653185 0.659904 0.398139
108 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.154695 1.382763 1.223208 2.061936 1.218583 0.347099 2.543200 0.559339 0.649816 0.658011 0.406310
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 5.926605 8.031844 8.741534 8.979547 1.933815 1.651438 1.898154 3.047708 0.076760 0.037822 0.029452
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.581308 -0.135011 0.336120 0.087799 0.270343 -0.137315 0.951988 0.933721 0.556555 0.661982 0.351437
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 6.474934 7.978261 0.960410 9.041643 9.009305 1.234175 22.252079 2.103779 0.605251 0.072858 0.453306
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% -0.406872 3.757604 1.279525 7.854413 1.188849 -0.182445 1.979342 1.737810 0.227490 0.148230 -0.270981
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.781715 2.188866 1.571456 1.533208 0.688342 0.603586 -2.491673 -2.382545 0.611749 0.596108 0.411496
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.181269 3.053038 1.277300 3.362572 0.272414 1.086214 -2.234567 0.762263 0.589688 0.521399 0.400293
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.033218 -1.019917 -0.572566 -0.655418 -0.369565 -0.995053 -0.431930 -0.908112 0.603814 0.601980 0.411045
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 24.172211 31.920171 19.240498 20.465849 17.653553 28.690672 313.167519 400.092536 0.017256 0.016276 0.001111
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 20.468099 28.196838 18.379942 20.240017 21.320659 22.018807 362.247877 332.540038 0.016566 0.016289 0.000859
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.794097 0.660142 2.505492 -0.458101 1.579121 0.754354 1.857795 0.824592 0.643723 0.646655 0.404828
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.212020 1.762889 0.852217 4.762751 -0.191685 0.603880 -1.034762 9.055976 0.644190 0.636591 0.399454
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.070620 2.545149 -0.199103 -0.719304 -0.355103 0.292766 -0.115627 -0.432084 0.672588 0.664252 0.408388
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.491784 1.539932 1.378448 0.270930 0.722331 -0.717653 -1.565716 -1.465628 0.637108 0.658205 0.402273
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 6.133586 0.385271 8.853404 0.734176 1.521133 0.855428 0.762598 0.756584 0.044269 0.668058 0.468185
125 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.005655 1.331731 2.272413 1.195149 1.417617 -0.019704 0.746887 0.366470 0.659053 0.660791 0.402777
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.348575 0.484668 0.598803 0.999161 0.039883 1.461020 1.228742 0.160016 0.661089 0.660798 0.409266
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 5.973210 -0.990719 8.682331 -0.951301 1.595039 -0.345927 0.558708 -0.396798 0.037896 0.659308 0.471708
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.261430 -0.799696 -0.279024 -0.661410 0.465157 -0.697326 0.067837 0.977996 0.648922 0.648547 0.421464
131 N11 not_connected 100.00% 0.00% 9.39% 0.00% -1.033647 7.699063 -0.813189 5.038778 -0.801927 0.690901 -0.885002 0.523713 0.642259 0.306811 0.478650
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.099455 -0.554905 -0.908278 -0.572026 -0.547570 -0.670107 -0.286409 -0.209592 0.616561 0.608680 0.411756
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.251764 -1.210820 -0.498618 -1.018815 -0.945856 -0.877013 -0.358949 -0.447500 0.608373 0.610152 0.412763
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 6.940435 8.721096 4.740593 5.124951 1.518933 1.161682 0.615451 0.964167 0.030768 0.035810 0.002434
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.748003 -1.110729 -0.447655 -0.812558 5.809738 0.132902 0.587735 0.294436 0.590928 0.593820 0.413240
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 5.537117 -0.614246 8.471683 -0.156824 1.615967 0.420391 1.348609 0.820612 0.041519 0.600277 0.449312
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 19.125125 37.997731 17.486135 23.555995 16.037113 28.737797 264.270045 479.873787 0.016546 0.016160 0.000755
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.278382 -0.342674 -0.027515 -0.849588 -1.028448 -0.250308 -1.093200 0.684532 0.633715 0.625772 0.404429
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.196941 -1.031634 0.101746 -0.994230 3.367450 -0.259317 19.340751 2.595411 0.637595 0.643746 0.393846
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.205201 -0.710484 0.209971 -0.438049 0.949401 -1.068904 0.099069 -1.069705 0.659254 0.648376 0.400510
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.251311 8.044325 -0.221366 9.151887 1.167187 1.208385 13.506960 1.690930 0.663471 0.048486 0.547024
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.490435 7.811662 8.550895 9.126520 1.263012 1.193869 0.577104 1.573771 0.134741 0.032713 0.086751
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.023931 -0.477204 -0.286672 -0.797789 -0.050468 -0.890890 -0.351120 -0.234538 0.664701 0.661951 0.405127
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.233741 0.206251 0.392436 0.897106 1.755611 -0.510958 -0.049878 0.442371 0.651156 0.648288 0.399522
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.443158 -0.982938 -0.629706 -1.027614 -0.900473 -0.825721 -0.464095 -0.479848 0.643678 0.649570 0.412731
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.090887 0.095616 0.018265
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.090595 0.057460 0.056151
149 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 132.224795 132.351964 inf inf 3202.790519 3201.863328 7499.003754 7489.383829 0.129733 0.073479 0.054481
150 N15 digital_ok 100.00% 99.72% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.193657 0.075173 0.056984
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 9.486901 -0.718286 -0.613317 0.969110 0.084647 0.216477 -0.395022 4.811319 0.522293 0.598811 0.354115
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.871449 -0.786418 8.588051 -0.235112 1.639962 1.378919 1.940985 0.054824 0.042973 0.600404 0.457377
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.282147 7.882390 6.170672 9.017524 0.078250 1.235303 1.542481 1.968588 0.533715 0.040761 0.420314
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.576792 0.048605 0.636419 0.819028 0.904256 1.654144 0.111146 0.163779 0.610110 0.618342 0.418268
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.694175 -0.987328 -0.871304 -0.932771 0.752588 0.310670 -0.025692 6.822602 0.618406 0.627845 0.418374
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.140436 11.071713 0.066361 -0.024594 -0.100166 0.099613 -0.012953 0.014912 0.604348 0.516248 0.384647
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 6.444722 -0.650218 8.662361 -0.241217 1.571341 0.836609 0.789473 -0.157373 0.048598 0.640166 0.509575
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.255477 17.705585 0.531228 0.473121 1.723537 -0.155403 -0.021475 0.014499 0.644164 0.539013 0.377204
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.863024 -1.216557 -0.620683 -1.035596 -0.517883 -0.181501 0.193950 -0.574735 0.663537 0.660774 0.402842
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.157420 0.635896 0.468446 0.570152 0.459585 0.911146 1.154403 0.219826 0.656833 0.665413 0.411444
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.487992 0.593326 1.670321 1.094073 -0.399982 3.670734 0.358182 1.206716 0.658676 0.665789 0.406177
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 12.951081 -0.258543 0.641371 -0.170757 -0.197941 0.997194 0.903424 -0.094960 0.560018 0.660636 0.377907
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.208041 -0.533048 1.063131 -0.291580 1.549596 -0.959142 0.119704 -1.134826 0.658574 0.653090 0.402983
167 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.168652 0.136843 -0.054326
168 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.044663 0.015385 -0.023396
169 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.174641 0.189106 0.128191
170 N15 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.203550 0.182092 0.152319
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.227642 -1.277992 1.024265 -0.739928 -0.201534 -0.589357 0.189465 -0.221496 0.595411 0.608199 0.412247
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.890584 0.260385 1.088665 0.082970 0.015316 -0.997270 -2.020889 -0.984789 0.608564 0.604027 0.421565
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.790168 2.299718 1.586565 1.578457 1.050262 0.722396 -2.499585 -2.261880 0.577428 0.564921 0.407736
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.043538 -0.071374 0.356456 0.854589 -0.317525 1.587356 -0.078032 5.397964 0.622499 0.623014 0.415080
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.270992 8.400004 -0.595517 9.227181 0.262943 1.178313 2.606493 1.918173 0.644663 0.055760 0.534086
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.157638 0.348831 1.453444 1.055196 -0.079810 0.661802 0.487187 3.562816 0.650894 0.649480 0.413387
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.508649 7.860578 -0.847747 8.963400 -0.630696 1.231149 -0.569938 2.093703 0.648518 0.050614 0.501573
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.784282 -0.136793 0.636784 0.984615 1.498515 0.641169 2.362900 2.063718 0.652831 0.652093 0.397929
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 7.470390 -0.281873 7.145970 -0.143477 3.290177 0.060927 1.778449 -0.157435 0.442965 0.658026 0.430731
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.340220 -0.154169 -0.822640 0.118297 -0.297151 -0.203778 -0.578142 0.098574 0.659742 0.656986 0.410182
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.014347 -1.022216 -0.556347 -1.001179 -0.991892 -0.811351 -1.024268 -0.654348 0.662615 0.665853 0.413319
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.000602 -0.681524 -0.244450 -0.554765 0.749386 -0.241186 0.673345 -0.727573 0.651492 0.645491 0.415117
189 N15 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.251770 0.196951 0.190725
190 N15 digital_ok 100.00% 99.72% 99.72% 0.00% 127.479968 127.600397 inf inf 2374.751662 2443.093253 4629.281140 4923.037135 0.248219 0.261729 0.197251
191 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 110.275980 109.916657 inf inf 2395.126706 2369.699148 4781.539220 4668.074478 0.095677 0.121024 0.108176
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.470879 2.536332 1.474278 1.718809 0.689306 0.755200 -2.359866 -2.623558 0.577832 0.563708 0.404212
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.125677 2.127169 1.775058 1.518389 1.069102 0.663241 -2.662823 -2.463255 0.569668 0.559204 0.405249
200 N18 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.021917 19.451674 4.796274 0.245195 1.607396 1.144483 1.371139 2.337568 0.042594 0.283541 0.197778
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.110389 1.802031 0.760464 1.373513 0.906552 0.380075 -1.678314 -2.337569 0.625894 0.603072 0.414425
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% -0.114722 -0.164390 -0.013674 -0.359010 -0.770374 1.200571 -1.300510 32.502523 0.633855 0.626938 0.400606
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.969347 6.599662 1.626772 -0.537366 1.438960 -0.149367 13.921230 0.770897 0.650130 0.651953 0.404012
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.187358 -0.662441 3.835089 -0.509207 -0.150480 -0.109024 0.783491 2.973543 0.464046 0.642239 0.461279
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.621275 2.052748 1.393577 2.756176 -0.384435 -0.740996 0.236953 0.690792 0.577269 0.549619 0.378298
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.084988 -1.114271 -0.873407 -1.027312 -0.494037 -0.163150 1.430161 -0.564573 0.612884 0.628605 0.403969
208 N20 dish_maintenance 100.00% 99.45% 99.45% 0.00% nan nan inf inf nan nan nan nan 0.458692 0.404231 0.360587
209 N20 dish_maintenance 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.252793 0.345335 0.209687
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.258565 8.224161 -0.437786 5.165055 -0.721269 1.168659 -0.217905 1.255757 0.597330 0.041166 0.506816
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.892480 -0.955285 -0.602549 -0.929700 -1.112106 -0.694967 0.327157 -0.553834 0.631672 0.612525 0.414691
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.919134 -0.907498 -0.849172 -0.977246 -0.230237 -0.821102 1.064866 -0.568027 0.628886 0.627399 0.408455
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.748806 -0.667276 -0.809814 -0.677714 -0.593965 -0.804790 0.309425 -0.782778 0.629678 0.628927 0.404682
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.805408 -0.091000 -0.165736 1.648140 -0.447694 -0.210328 0.103584 9.320875 0.631467 0.595094 0.413771
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.315197 2.310023 1.904436 1.638861 1.244455 0.675279 -2.767972 -2.498117 0.598940 0.600639 0.397530
225 N19 RF_ok 100.00% 0.00% 54.14% 0.00% -0.424360 7.846617 -0.280735 4.982839 -1.104988 1.090790 -1.173508 1.548742 0.634080 0.195194 0.521964
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.882926 8.961143 -1.008812 -0.606822 -0.512859 0.091021 -0.624288 -0.605722 0.629636 0.541620 0.408873
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.036384 -0.784159 2.166313 -0.920363 -0.403956 -0.204019 6.506820 0.912933 0.559764 0.614855 0.430015
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.283094 -0.465751 -0.337608 -0.587101 -0.932221 -0.426733 -0.732309 -0.012041 0.606644 0.607685 0.413811
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.268773 -0.032108 -0.373319 0.032728 -0.474060 -0.977489 -0.725327 -1.318769 0.599841 0.596157 0.417534
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.134742 -0.906748 0.606423 -0.689126 -0.351119 -0.647089 0.233047 -0.446761 0.587412 0.606555 0.420285
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.348616 -0.709429 -0.263555 -0.301474 -1.256426 -0.659974 -1.188781 -1.161078 0.622609 0.611792 0.423483
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.962116 -0.584005 -0.766071 -0.456112 -1.099161 -0.553691 -0.896135 0.169502 0.624824 0.615086 0.416619
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.754923 -0.635461 0.585275 -0.961421 -0.305644 -0.137801 0.707499 -0.026897 0.590501 0.613114 0.412524
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.327010 -1.061988 -0.991956 -0.695260 -0.960889 -1.035727 -0.089045 -0.919789 0.622308 0.617523 0.419075
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.796403 -0.237631 -0.661860 -0.135573 -0.354676 -1.037047 0.107807 -1.104526 0.508857 0.618978 0.400686
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.097173 -1.006865 -0.206047 -0.637049 0.059044 0.122132 -0.172371 -0.302380 0.555240 0.612661 0.404289
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.149838 -0.544717 0.209384 0.109896 -0.572733 1.103718 0.366272 1.734974 0.592492 0.607652 0.409696
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.642747 -0.463213 -0.457798 -0.799438 -0.905629 -0.497375 -1.125000 0.149061 0.612204 0.605824 0.420296
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.571093 8.562874 -0.967848 4.835070 -0.378141 1.215033 -0.390470 0.578154 0.596959 0.040602 0.503682
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.553593 -0.686548 -0.565032 -0.891286 -0.465379 -0.756333 -0.603988 -0.670860 0.593744 0.589237 0.413777
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.706371 7.691771 0.367672 0.533130 1.339753 1.832606 0.003722 0.953227 0.610490 0.603982 0.428811
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.522736 0.081181 0.671267 0.017366 -0.564751 -0.729398 -1.592577 -0.423842 0.490717 0.492022 0.392882
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.832681 0.927891 -0.094699 0.080795 -0.891111 -0.466506 -1.102419 -1.366810 0.474200 0.477616 0.373188
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.190378 -0.898144 -0.186621 -0.546252 -1.058528 -0.394997 -1.202353 -0.232084 0.519992 0.520383 0.409109
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 0.184046 -0.421679 -0.894036 -1.044088 -0.543234 -0.714288 4.042419 -0.134219 0.474481 0.483338 0.374930
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.002149 0.119882 0.000033 -0.474674 0.049115 0.686592 1.133311 0.124474 0.476043 0.491352 0.375402
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: [4, 7, 15, 17, 18, 19, 27, 28, 31, 32, 34, 36, 37, 38, 40, 42, 47, 49, 50, 51, 52, 54, 55, 58, 59, 60, 63, 65, 66, 68, 70, 72, 77, 78, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 101, 102, 103, 104, 109, 110, 111, 112, 117, 118, 121, 124, 125, 127, 131, 134, 135, 136, 137, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 164, 165, 167, 168, 169, 170, 179, 180, 182, 184, 189, 190, 191, 200, 202, 204, 205, 208, 209, 210, 211, 223, 225, 226, 227, 242, 243, 246, 262, 329]

unflagged_ants: [5, 8, 9, 10, 16, 20, 21, 22, 29, 30, 35, 41, 43, 44, 45, 46, 48, 53, 56, 57, 61, 62, 64, 67, 69, 71, 73, 74, 79, 80, 85, 88, 89, 90, 91, 95, 105, 106, 107, 108, 113, 114, 115, 120, 122, 123, 126, 128, 132, 133, 139, 141, 144, 145, 146, 157, 162, 163, 166, 171, 172, 173, 181, 183, 185, 186, 187, 192, 193, 201, 206, 207, 220, 221, 222, 224, 228, 229, 237, 238, 239, 240, 241, 244, 245, 261, 320, 324, 325, 333]

golden_ants: [5, 9, 10, 16, 20, 21, 29, 30, 41, 44, 45, 53, 56, 67, 69, 71, 85, 88, 91, 105, 106, 107, 122, 123, 128, 141, 144, 145, 146, 157, 162, 163, 166, 171, 172, 173, 181, 183, 186, 187, 192, 193]
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_2460049.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.1.1.dev3+gb291d34
3.2.3.dev158+gd5cadd5
In [ ]: