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 = "2460020"
data_path = "/mnt/sn1/2460020"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 3-16-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/2460020/zen.2460020.21289.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

# get a list of all ant_metrics files
glob_str = os.path.join(data_path, f'zen.{JD}.?????.sum{ant_metrics_ext}')
ant_metrics_files = sorted(glob.glob(glob_str))

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1851 ant_metrics files matching glob /mnt/sn1/2460020/zen.2460020.?????.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/2460020/zen.2460020.?????.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 2460020
Date 3-16-2023
LST Range 6.138 -- 16.100 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas 40, 42, 70, 72, 112
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 68 / 198 (34.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 124 / 198 (62.6%)
Redcal Done? ❌
Never Flagged Antennas 72 / 198 (36.4%)
A Priori Good Antennas Flagged 61 / 93 total a priori good antennas:
3, 5, 7, 15, 16, 17, 30, 31, 37, 38, 40, 42,
45, 53, 54, 55, 65, 66, 70, 71, 72, 81, 83,
86, 93, 94, 101, 103, 109, 111, 112, 118, 121,
122, 123, 124, 127, 136, 140, 147, 148, 149,
150, 151, 158, 161, 165, 167, 168, 169, 170,
173, 182, 184, 187, 189, 190, 191, 192, 193,
202
A Priori Bad Antennas Not Flagged 40 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 50, 57, 61, 62,
64, 73, 74, 89, 90, 95, 115, 120, 132, 133,
139, 179, 185, 207, 220, 221, 222, 228, 229,
237, 238, 239, 241, 244, 245, 320, 324, 325,
329
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2460020.csv

Build DataFrame¶

In [20]:
# build dataframe
to_show = {'Ant': [f'<a href="{ant_to_report_url(ant)}" target="_blank">{ant}</a>' for ant in ants],
           'Node': [f'N{nodes[ant]:02}' for ant in ants], 
           'A Priori Status': [a_priori_statuses[ant] for ant in ants]}
           #'Worst Metric': worst_metrics, 'Worst Modified Z-Score': worst_zs}
df = pd.DataFrame(to_show)

# create bar chart columns for flagging percentages:
bar_cols = {}
if use_auto_metrics:
    bar_cols['Auto Metrics Flags'] = [float(ant in auto_ex_ants) for ant in ants]
if use_ant_metrics:
    if np.sum(list(a_priori_flag_frac.values())) > 0:  # only include this col if there are any a priori flags
        bar_cols['A Priori Flag Fraction in Ant Metrics'] = [a_priori_flag_frac[ant] for ant in ants]
    for ap in antpols:
        bar_cols[f'Dead Fraction in Ant Metrics ({ap})'] = [dead_ant_frac[ap][ant] for ant in ants]
    bar_cols['Crossed Fraction in Ant Metrics'] = [crossed_ant_frac[ant] for ant in ants]
if use_redcal:
    bar_cols['Flag Fraction Before Redcal'] = [redcal_prior_flag_frac[ant] for ant in ants]
    bar_cols['Flagged By Redcal chi^2 Fraction'] = [redcal_flagged_frac[ant] for ant in ants]  
for col in bar_cols:
    df[col] = bar_cols[col]

# add auto_metrics
if use_auto_metrics:
    for label, modz in all_modzs.items():
        df[label] = modz
z_score_cols = [col for col in df.columns if 'Modified Z-Score' in col]        
        
# add ant_metrics
ant_metrics_cols = {}
if use_ant_metrics:
    for ap in antpols:
        ant_metrics_cols[f'Average Dead Ant Metric ({ap})'] = [average_dead_metrics[ap][ant] for ant in ants]
    ant_metrics_cols['Average Crossed Ant Metric'] = [average_crossed_metrics[ant] for ant in ants]
    for col in ant_metrics_cols:
        df[col] = ant_metrics_cols[col]   

# add redcal chisq
redcal_cols = []
if use_redcal:
    for ap in antpols:
        col_title = f'Median chi^2 Per Antenna ({ap})'
        df[col_title] = [cspa[ant, ap] for ant in ants]
        redcal_cols.append(col_title)

# sort by node number and then by antenna number within nodes
df.sort_values(['Node', 'Ant'], ascending=True)

# style dataframe
table = df.style.hide_index()\
          .applymap(lambda val: f'background-color: {status_colors[val]}' if val in status_colors else '', subset=['A Priori Status']) \
          .background_gradient(cmap='viridis', vmax=mean_round_modz_cut * 3, vmin=0, axis=None, subset=z_score_cols) \
          .background_gradient(cmap='bwr_r', vmin=dead_cut-.25, vmax=dead_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .background_gradient(cmap='bwr_r', vmin=crossed_cut-.25, vmax=crossed_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .background_gradient(cmap='plasma', vmax=4, vmin=1, axis=None, subset=redcal_cols) \
          .applymap(lambda val: 'font-weight: bold' if val < dead_cut else '', subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val < crossed_cut else '', subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .applymap(lambda val: 'color: red' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .bar(subset=list(bar_cols.keys()), vmin=0, vmax=1) \
          .format({col: '{:,.4f}'.format for col in z_score_cols}) \
          .format({col: '{:,.4f}'.format for col in ant_metrics_cols}) \
          .format({col: '{:,.2%}'.format for col in bar_cols}) \
          .applymap(lambda val: 'font-weight: bold', subset=['Ant']) \
          .set_table_styles([dict(selector="th",props=[('max-width', f'70pt')])])

Table 2: RTP Per-Antenna Metrics Summary Table¶

This admittedly very busy table incorporates summary information about all antennas in the array. Its columns depend on what information is available when the notebook is run (i.e. whether auto_metrics, ant_metrics, and/or redcal is done). These can be divided into 5 sections:

Basic Antenna Info: antenna number, node, and its a priori status.

Flag Fractions: Fraction of the night that an antenna was flagged for various reasons. Note that auto_metrics flags antennas for the whole night, so it'll be 0% or 100%.

auto_metrics Details: If auto_metrics is included, this section shows the modified Z-score signifying how much of an outlier each antenna and polarization is in each of four categories: bandpass shape, overall power, temporal variability, and temporal discontinuities. Bold red text indicates that this is a reason for flagging the antenna. It is reproduced from the auto_metrics_inspect.ipynb nightly notebook, so check that out for more details on the precise metrics.

ant_metrics Details: If ant_metrics is included, this section shows the average correlation-based metrics for antennas over the whole night. Low "dead ant" metrics (nominally below 0.4) indicate antennas not correlating with the rest of the array. Negative "crossed ant" metrics indicate antennas that show stronger correlations in their cross-pols than their same-pols, indicating that the two polarizations are probably swapped. Bold text indicates that the average is below the threshold for flagging.

redcal chi^2 Details: If redcal is included, this shows the median chi^2 per antenna. This would be 1 in an ideal array. Antennas are thrown out when they they are outliers in their median chi^2, usually greater than 4-sigma outliers in modified Z-score.

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.637028 15.596376 0.414258 12.500180 0.428537 7.652913 -0.516045 0.781640 0.539946 0.036032 0.475247
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.521644 26.782602 -0.500252 -0.163341 -0.993512 3.657891 -0.890555 7.259734 0.553563 0.432938 0.354732
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 12.048698 15.339144 11.706301 12.188585 6.837505 7.726041 0.176636 0.111862 0.034108 0.029931 0.001503
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.097646 0.070017 -0.647758 0.196106 0.030837 0.793767 3.835771 9.021193 0.565260 0.572599 0.349633
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.280721 -1.465613 0.120288 0.612195 0.146192 0.657714 1.160527 0.986099 0.564437 0.569630 0.343259
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.663117 -0.555781 3.928112 -0.660893 0.476926 -0.259999 1.283783 -0.545771 0.542825 0.567263 0.347862
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.786806 -1.099989 0.338012 -0.881453 -0.865906 -0.069337 -0.921853 -0.213495 0.561297 0.561804 0.345985
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 29.836319 -0.047183 -0.133044 -0.276911 2.500415 0.380336 -0.385296 2.146702 0.425328 0.565147 0.357663
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.521312 16.008446 -0.256243 12.503824 0.983393 7.635271 1.748627 1.554576 0.569614 0.034481 0.485236
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.681296 7.473425 1.202623 10.993455 1.002469 3.707361 -0.055964 2.448497 0.569904 0.365097 0.418729
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 12.259902 8.047139 11.739638 1.218898 6.807576 3.762169 0.277414 30.322275 0.033731 0.378630 0.305357
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.215117 -0.838277 -0.494378 -0.220965 0.009807 -0.139231 -0.601548 2.430478 0.578973 0.589141 0.347882
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.744153 -1.119146 2.577861 -0.662377 1.181250 0.634319 0.850069 -0.576807 0.565355 0.584689 0.344207
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.911213 -0.081104 0.011687 0.616904 0.318154 0.535323 0.117638 0.258638 0.557089 0.562697 0.335997
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.722630 0.055548 0.277948 0.169145 0.670685 0.936776 -0.122205 -0.471461 0.534345 0.543202 0.339410
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.863180 14.577864 11.803627 12.289953 6.805601 7.719640 1.459121 1.127561 0.028306 0.029087 0.000805
28 N01 RF_maintenance 100.00% 100.00% 13.56% 0.00% 11.460350 21.735976 11.621221 4.840678 6.831840 4.250810 1.032440 18.873619 0.028330 0.246258 0.186895
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.745202 -0.730709 -0.775544 -0.547759 0.194752 0.398361 3.398511 1.702181 0.586465 0.589795 0.351478
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.468441 -1.198951 1.240703 -1.052384 1.130398 0.119042 5.712736 -0.229901 0.577632 0.594691 0.349227
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.009914 -1.048439 1.762228 2.018329 1.522686 -0.203480 0.104145 5.939325 0.590123 0.589245 0.344059
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 22.064037 26.192521 -0.336374 -0.021936 2.538534 0.075737 1.882562 4.392906 0.482706 0.493654 0.209789
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 13.290686 16.344947 5.957321 6.309107 6.788665 7.690474 1.517198 2.671478 0.032933 0.045334 0.008166
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.627187 -0.566739 0.429875 -1.145914 -0.265617 -0.984250 1.583062 0.126431 0.540515 0.534227 0.334820
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.352640 8.848027 1.638910 1.407870 1.668275 2.038589 0.222599 0.721698 0.541508 0.541991 0.364986
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 1.751689 26.876203 -0.749695 15.360973 -0.363107 7.734681 -0.556327 2.507491 0.540989 0.028144 0.427129
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.528980 3.522978 -0.364365 0.073728 0.685892 -0.288678 1.192105 5.948843 0.567094 0.542361 0.364284
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.942933 1.487917 -0.034067 -0.654234 1.790308 0.492115 7.856523 0.708264 0.229868 0.222657 -0.275340
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.989593 1.143128 2.139087 1.614138 1.855981 0.365145 1.082238 1.128697 0.577702 0.587264 0.351789
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.624187 3.334653 -0.470334 -0.429155 1.628906 0.786061 0.447548 2.379079 0.250236 0.240617 -0.273919
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.082631 0.051718 -0.072229 1.245324 -0.963275 0.840149 -0.766067 0.590852 0.593012 0.595437 0.343249
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.110412 0.001056 -0.470393 0.005742 -0.919909 0.440901 -0.683791 -0.197619 0.594247 0.606338 0.345727
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.245886 4.417982 0.940144 1.396996 0.145868 1.638901 3.078936 12.853009 0.579628 0.587334 0.337762
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.736334 -0.085841 -0.178339 -0.868505 0.150835 -0.413747 1.110225 0.958249 0.582010 0.600160 0.352846
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 12.211737 15.967728 5.855795 5.917403 6.778751 7.639016 2.345262 0.939567 0.031445 0.049462 0.011872
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.054316 1.435618 -0.489073 1.866547 -0.835815 1.817698 0.757371 -1.635931 0.541994 0.560321 0.343130
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.456888 0.353602 0.521412 -0.939781 -0.175590 -1.003408 0.807923 2.327655 0.505612 0.531742 0.336775
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.900157 1.194716 0.352141 2.358729 0.320573 1.234512 1.288599 1.459573 0.541698 0.539477 0.361669
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 4.910615 2.224502 0.400800 -0.174302 1.985102 1.166316 38.757205 1.446474 0.552349 0.557720 0.360421
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.195226 6.618694 0.947416 0.609547 1.891479 1.315348 3.185309 1.923233 0.567276 0.571501 0.360712
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.700757 2.135439 0.333410 -0.328406 2.058888 0.028669 7.394878 1.721247 0.575667 0.586704 0.361966
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 11.285271 4.928740 3.002980 0.490587 3.665322 2.197126 -0.549992 0.663830 0.292566 0.346989 0.149846
55 N04 digital_ok 100.00% 11.72% 100.00% 0.00% 0.887148 57.737952 1.180249 7.911469 0.269615 7.651188 1.505485 0.589015 0.249476 0.036154 0.102870
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.498261 0.248255 -0.568381 2.874705 -0.678296 2.187147 -0.874913 0.124927 0.592825 0.592710 0.339085
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.292808 -0.430404 -0.212764 -0.526304 0.031855 0.842317 1.394774 2.829630 0.600315 0.598693 0.337135
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.917885 14.963768 11.699046 12.418835 6.754756 7.676190 1.979416 1.784240 0.033249 0.033337 0.002173
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.820970 0.777769 11.216313 1.411138 6.618663 1.861267 0.854567 8.470729 0.043066 0.592823 0.455436
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.286854 14.904701 0.127552 12.449047 0.263823 7.670898 1.700342 2.634947 0.582746 0.063828 0.467455
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.275261 -0.446705 0.507068 -0.831012 0.840752 -0.986950 -0.273565 0.326202 0.522281 0.559310 0.339834
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.800122 1.283126 -0.269430 1.233115 -0.845698 0.057237 0.886620 -0.774322 0.520049 0.560896 0.344870
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.147787 15.446027 -0.282835 6.352242 -0.455874 7.741882 -0.348040 1.936188 0.546554 0.042110 0.430460
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.175124 -0.082465 -0.942963 -0.248514 -0.787357 -1.032580 3.909984 0.915206 0.530831 0.518796 0.332502
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 25.446439 24.310583 14.988786 15.060766 6.909624 7.811306 3.402521 4.452432 0.023628 0.028014 0.005091
66 N03 digital_ok 100.00% 34.41% 100.00% 0.00% 3.659779 25.075690 3.019047 15.264105 2.220443 7.725210 -1.190813 5.303156 0.207111 0.039968 0.108921
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.234022 -0.696463 -1.130453 1.468724 -0.452406 1.587503 3.845431 0.803533 0.571427 0.571887 0.358428
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 27.514191 0.854011 15.131756 1.078615 6.732697 -0.001915 3.624869 -0.865045 0.030474 0.587449 0.446486
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.856481 0.262333 1.580049 -0.558667 0.181442 1.133699 2.291273 0.247651 0.584610 0.598160 0.350138
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.361934 1.754834 1.742798 3.925248 2.653185 1.027056 3.519935 1.639886 0.253635 0.237824 -0.272082
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 6.168759 -0.463028 -0.334896 0.360182 0.737300 0.232297 0.609147 0.936078 0.596592 0.609917 0.341086
72 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.417631 0.975023 3.213422 1.428196 1.520663 1.179507 9.749715 3.354057 0.260928 0.255093 -0.273041
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.431743 1.031881 -0.755348 -0.423300 0.873089 0.836962 0.441567 0.326640 0.603896 0.613956 0.344126
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.973915 0.042130 -0.019486 -0.092196 -0.170623 1.065630 -0.853340 2.850037 0.601137 0.610225 0.346031
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 58.210640 15.978017 0.968128 -0.385075 3.928857 4.641647 8.475222 0.042101 0.296256 0.486739 0.300513
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 30.432253 1.096962 -0.121281 1.578353 1.757672 0.864380 -0.590819 -0.189618 0.384279 0.563749 0.338879
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.069615 15.742131 -0.825773 6.364422 -0.712450 7.587477 0.466224 -0.270896 0.532661 0.037218 0.429983
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.063059 16.691692 0.314637 6.262860 -0.663715 7.613426 -0.625078 0.708935 0.539345 0.048955 0.433483
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 68.905844 52.168248 30.622456 28.248700 31.453135 11.781632 503.656290 301.254262 0.018960 0.016472 0.001989
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 32.717448 43.867398 27.359245 29.034419 10.894680 15.323078 285.010293 417.816630 0.019842 0.018482 0.001669
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 28.333964 42.369459 24.346275 26.519750 10.488040 12.400232 213.007413 318.690683 0.019163 0.017985 0.001477
84 N08 RF_maintenance 100.00% 80.33% 100.00% 0.00% 20.508187 26.885839 14.707459 15.446135 5.298370 7.623269 2.459162 3.061794 0.175794 0.032923 0.113808
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.943725 -0.143085 -1.067685 -1.026992 -0.311615 -0.507306 -0.189371 -0.427918 0.589784 0.587578 0.342514
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.201761 1.643149 -0.086849 0.319078 0.562231 0.593116 -0.099849 15.689601 0.593223 0.601023 0.336613
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.056113 7.873927 0.030094 0.325313 0.299546 0.092928 25.785385 7.878159 0.603126 0.618318 0.340504
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.734128 -0.044750 1.062047 1.403245 0.435928 -0.724967 -0.329657 -0.156431 0.594234 0.601861 0.329410
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.898772 0.595930 0.767930 1.469223 -0.445202 0.279285 -0.540419 -0.275072 0.592657 0.607258 0.336798
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.385073 -0.278391 -0.519832 -0.286924 -0.543306 -1.202597 -0.105584 1.566225 0.581193 0.612567 0.343424
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.315944 0.006286 1.126865 0.867455 0.188783 -0.187899 -0.292433 -0.149034 0.574886 0.599864 0.345444
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.452665 0.157502 11.683506 0.875330 6.832201 1.393626 -0.004467 0.220763 0.032984 0.596209 0.395928
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.719194 15.150389 11.833022 12.525419 6.690883 7.606709 1.605725 1.201909 0.028711 0.025027 0.002058
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 12.504173 15.445889 11.946093 12.309259 6.735359 7.655475 0.488705 0.317870 0.025469 0.025354 0.001021
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.407261 1.854069 -0.758399 1.036180 2.824541 1.937239 -0.760366 -0.346141 0.411917 0.409339 0.182166
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.571379 29.383484 1.407159 -0.186118 -0.011320 1.193654 -1.056553 -0.493366 0.549579 0.437253 0.337612
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.402642 2.893553 -0.799587 -0.090170 -0.902566 -0.437747 2.550314 10.967770 0.529026 0.514323 0.339493
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.133535 8.960569 0.237007 1.783076 0.649422 1.503327 -0.165925 -0.304102 0.575389 0.579845 0.349341
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.602120 1.008594 -0.802099 -0.982145 0.023657 0.209827 -0.924547 4.551183 0.591258 0.597512 0.345131
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.737082 5.419238 2.520345 -0.975886 1.303704 0.342204 0.791995 3.733978 0.589838 0.605938 0.338470
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.497591 61.793456 -0.451276 8.071568 0.656797 -0.740358 -0.182356 0.074001 0.603548 0.581231 0.339812
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.097004 0.270357 0.861136 1.539249 0.938159 0.071722 -0.465760 -0.280868 0.598228 0.607517 0.332877
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.508280 1.672250 -0.475695 -0.005742 -0.495212 -0.571972 -0.300119 -0.439198 0.600606 0.613173 0.335667
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.827653 0.352434 0.564306 -0.021478 0.579128 0.312897 -0.008937 0.929830 0.594487 0.612228 0.338285
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.483433 43.372007 11.739288 1.602825 6.763589 2.781715 0.920881 1.242489 0.032223 0.290079 0.148848
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.246587 14.935664 11.775984 12.165834 6.807839 7.729913 0.314613 1.300308 0.054891 0.034634 0.014878
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.117531 0.189958 -0.055035 0.011775 5.572564 1.835217 1.048151 -0.544230 0.568886 0.594027 0.356535
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 26.957460 14.893859 1.619531 12.284501 4.441991 7.708522 12.426145 1.244760 0.471637 0.052162 0.333448
112 N10 digital_ok 100.00% 6.05% 7.73% 92.27% -0.041828 8.578540 2.401114 11.107230 2.692010 4.699038 0.320351 0.323566 0.227507 0.130671 -0.217254
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.521937 16.403001 5.569841 6.358283 6.656171 7.571238 1.074846 0.428151 0.032709 0.030974 0.001181
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.113148 11.917969 13.901717 12.867033 6.614870 9.081069 92.063286 91.609970 0.023668 0.025470 0.001433
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.925506 -0.675209 -1.033748 0.293678 -0.853995 -0.456779 -0.671922 -0.916066 0.509308 0.527159 0.345869
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 36.155385 47.622182 26.950343 28.366112 12.308781 25.583379 230.971599 415.726189 0.017540 0.016326 0.001216
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 30.047222 42.122938 25.873279 30.617355 13.648548 12.723976 241.410768 461.908658 0.020031 0.018932 0.001363
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.765648 2.146091 3.569902 -0.535265 0.026438 0.667559 0.400835 0.007518 0.572172 0.594856 0.346196
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.550758 3.304187 -1.051200 7.056762 -0.216300 -0.428030 3.153776 15.318024 0.593560 0.575696 0.331949
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.096501 6.892261 -0.730953 -0.855608 0.217006 0.372824 -0.679016 -0.737859 0.608025 0.613111 0.337304
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.644181 9.291234 1.467786 1.631822 1.020838 0.466718 -0.333692 -0.091717 0.607098 0.616929 0.338467
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 11.577812 0.321261 12.029401 1.211884 6.638040 0.958738 0.198413 0.060537 0.038006 0.617803 0.420343
125 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.808181 4.332698 1.223852 1.418202 -0.362458 1.119947 2.711064 3.542765 0.595662 0.603526 0.334407
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.574933 5.871267 -0.190992 1.900299 1.940342 2.193462 1.857692 0.968341 0.537275 0.601372 0.336496
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 11.088676 0.388380 11.678267 0.771700 6.826182 -0.207863 -0.023972 -0.242481 0.031508 0.601907 0.392869
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.292005 -0.576747 -0.841888 -0.207333 -0.180978 -0.382218 -0.188215 3.164566 0.584937 0.594320 0.360111
131 N11 not_connected 100.00% 0.00% 49.32% 0.00% -1.064882 14.677157 -0.037638 6.207529 -0.611599 6.711866 -0.882466 -0.072957 0.545224 0.220397 0.391855
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.902206 0.572135 -0.051118 -0.996247 -0.609652 -0.825680 -0.726174 0.046344 0.535440 0.528103 0.341028
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.272595 -1.060513 -1.027965 -0.302713 -0.776052 -1.181230 -0.291507 1.190987 0.517914 0.533436 0.350597
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.865331 16.340143 5.732737 6.336192 6.650986 7.587171 0.204240 0.575557 0.037459 0.033276 0.002641
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.053197 -1.247711 -0.691161 -1.179985 2.689199 0.474126 0.554714 -0.313609 0.517976 0.538784 0.363919
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 10.608239 -0.545408 11.348094 -0.190739 6.813954 0.268170 0.978692 -0.304393 0.035575 0.541185 0.392157
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 31.525650 64.721985 26.958128 27.683860 11.949538 22.759959 394.826514 275.289318 0.016502 0.016360 0.000746
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.200039 -0.043025 1.535767 -0.893260 0.683410 -0.843766 -1.339994 -0.776661 0.564204 0.565676 0.335903
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 14.825078 0.016408 -0.688314 0.049780 18.590119 1.629127 152.232565 23.067402 0.544000 0.595989 0.327578
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.750107 -0.473671 0.386138 0.741955 1.655694 -0.473161 -0.223676 -0.989752 0.592508 0.605706 0.336519
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.276608 14.968386 -0.056983 12.457397 2.122128 7.681693 14.793047 1.099085 0.597914 0.041737 0.494314
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.141780 14.876567 11.610965 12.415792 6.260077 7.658136 -0.006045 0.863337 0.093664 0.028511 0.052537
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.217217 0.830643 -0.581932 3.578636 0.400906 -0.370444 -0.773016 -0.250879 0.606253 0.602596 0.341747
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.304031 0.177086 -0.109111 -1.157524 -0.001910 0.754839 0.006957 -0.332095 0.602150 0.605668 0.342523
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.239746 -0.503167 -0.924597 -0.681571 -0.694539 -1.245486 -0.341958 -0.545238 0.565913 0.584440 0.340231
147 N15 digital_ok 100.00% 98.43% 98.54% 0.00% nan nan inf inf nan nan nan nan 0.259394 0.231160 0.215528
148 N15 digital_ok 100.00% 98.38% 98.87% 0.00% nan nan inf inf nan nan nan nan 0.297447 0.243557 0.255710
149 N15 digital_ok 100.00% 98.60% 98.76% 0.00% nan nan inf inf nan nan nan nan 0.267187 0.207648 0.223917
150 N15 digital_ok 100.00% 98.22% 98.22% 0.00% nan nan inf inf nan nan nan nan 0.324128 0.336113 0.329880
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 23.706855 0.244411 -0.307868 1.457272 1.875108 -0.813339 2.011230 10.805754 0.414550 0.502028 0.301873
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.035381 -1.036809 11.514104 -0.798949 6.835522 -0.322248 1.395149 1.034516 0.037110 0.543819 0.409318
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.348271 14.735725 9.541375 12.210602 2.108442 7.720152 1.075502 1.341752 0.380484 0.035538 0.294449
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.690819 -0.367903 0.722075 1.337010 0.288268 0.936915 -0.197656 0.130799 0.540538 0.556952 0.351759
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.039686 0.684695 -1.085247 -1.124648 1.099141 0.056288 2.386249 13.993567 0.560232 0.568523 0.347173
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.637756 21.245325 -0.774202 -0.496900 -0.025860 3.250626 -0.392189 2.646140 0.533043 0.477985 0.316910
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.312968 -0.987345 0.129428 -0.110832 0.201615 1.079876 -0.471729 1.128806 0.579509 0.589662 0.341303
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.120836 31.568502 0.708384 0.249916 0.742952 0.383203 0.027795 1.251084 0.588132 0.477277 0.315653
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.777296 -1.067079 0.031713 -0.991223 -0.290602 0.208890 -0.006957 -0.034750 0.600560 0.610207 0.342462
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.763990 1.699593 0.492141 1.031590 0.551691 1.125326 0.022441 1.222056 0.601358 0.610667 0.345047
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.380385 1.034653 0.222292 2.000606 -0.174548 2.127171 2.130052 0.944703 0.597677 0.602159 0.334957
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 24.854426 0.131148 -0.197729 -0.364369 3.210508 0.177019 4.403353 -0.525927 0.497357 0.605991 0.340669
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.673773 0.137356 1.360166 0.938003 0.515448 -0.464951 0.501312 -1.144712 0.587833 0.601096 0.338835
167 N15 digital_ok 100.00% 98.38% 98.70% 0.00% nan nan inf inf nan nan nan nan 0.318420 0.253397 0.287429
168 N15 digital_ok 100.00% 98.38% 98.43% 0.00% nan nan inf inf nan nan nan nan 0.293230 0.279922 0.264504
169 N15 digital_ok 100.00% 98.38% 98.70% 0.00% nan nan inf inf nan nan nan nan 0.299399 0.285541 0.251551
170 N15 digital_ok 100.00% 98.11% 98.60% 0.00% nan nan inf inf nan nan nan nan 0.254161 0.249786 0.226252
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.008332 -0.914528 0.506437 -0.048545 -0.597955 -0.541073 -0.171900 0.070996 0.490564 0.536922 0.354991
173 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.970092 6.791990 4.653709 4.569192 5.387141 6.172668 -2.627346 -1.266015 0.499546 0.493456 0.339177
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.486379 -0.454456 0.258332 1.036460 0.372635 1.677002 -0.400784 0.115837 0.558329 0.570153 0.348695
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.009440 15.661171 -0.920537 12.599233 0.608001 7.610820 13.312070 1.432850 0.577929 0.047875 0.483540
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.291314 0.191192 1.565337 1.078371 0.344523 0.428816 -0.198928 3.141620 0.583941 0.591716 0.347284
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.137425 14.660019 -0.231412 12.149201 -0.935448 7.734698 7.819695 1.293259 0.596960 0.043522 0.455233
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.032711 0.617829 0.264514 0.667410 1.129900 0.043154 0.584832 -0.156804 0.587769 0.597649 0.336260
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 20.655436 -0.415500 7.455111 -0.634785 6.839340 0.454442 8.746938 -0.158247 0.437588 0.604701 0.357427
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.788021 -0.231506 -0.985115 -0.018414 -0.021394 -0.027055 0.094293 0.927193 0.599039 0.601668 0.343770
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.972769 -0.913780 0.488711 -0.073578 -0.722320 -0.842754 -0.575913 -0.677059 0.595284 0.602284 0.346618
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.396597 -0.953150 -0.716303 -0.194251 0.644416 0.522188 5.884611 0.094482 0.581659 0.590592 0.347840
189 N15 digital_ok 100.00% 97.95% 98.00% 0.00% nan nan inf inf nan nan nan nan 0.317348 0.316092 0.288491
190 N15 digital_ok 100.00% 98.33% 98.70% 0.00% 238.321734 237.700893 inf inf 2728.056470 2720.994146 4895.941364 5018.343497 0.308873 0.273612 0.274213
191 N15 digital_ok 100.00% 98.06% 98.22% 0.00% 239.875938 239.668064 inf inf 2747.293388 2788.684749 5187.745295 5390.948740 0.338381 0.308556 0.281293
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 2.527400 7.200585 2.836720 4.749462 2.268502 6.318953 0.524764 -2.627748 0.528362 0.503397 0.346824
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 7.534270 6.321438 4.944894 4.455589 5.538365 5.956581 -2.666258 -2.605945 0.494884 0.499389 0.340562
200 N18 RF_maintenance 100.00% 100.00% 45.65% 0.00% 13.268452 39.680025 5.728001 0.238233 6.832610 2.743318 0.908429 4.770216 0.038043 0.215529 0.142272
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.091673 5.264146 3.093864 4.094681 2.344509 5.259466 -0.804556 -2.150234 0.560902 0.556848 0.338606
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.876291 1.569635 1.640601 -0.344878 0.681858 -0.086066 -1.120712 30.086407 0.576183 0.561957 0.338371
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.191703 15.216541 1.763246 -0.694127 0.356717 0.098102 9.658861 0.932180 0.585594 0.597159 0.346507
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.990340 -0.241101 3.772069 -0.599324 2.216283 -0.093222 12.214807 5.199616 0.437084 0.571766 0.377476
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.504444 5.676335 -0.383921 3.420052 6.870235 1.609245 -0.616361 -0.057221 0.537849 0.461568 0.342946
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.702912 2.464264 -0.695958 -0.391270 -1.006056 -0.682841 3.946438 -0.527951 0.552406 0.542969 0.336115
208 N20 dish_maintenance 100.00% 98.11% 98.06% 0.00% nan nan inf inf nan nan nan nan 0.387333 0.387721 0.363307
209 N20 dish_maintenance 100.00% 98.76% 98.49% 0.00% nan nan inf inf nan nan nan nan 0.217543 0.299604 0.234667
210 N20 dish_maintenance 100.00% 98.27% 97.95% 0.05% nan nan inf inf nan nan nan nan 0.450059 0.490225 0.252044
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.316648 15.463931 -1.058981 6.389636 -0.680956 7.598591 -0.134880 0.687813 0.513518 0.036425 0.436054
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.062547 -0.723737 0.484584 -0.279162 -0.706681 -0.734108 1.840611 -1.056375 0.564220 0.563027 0.340422
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.180788 -0.184549 -1.137015 -0.604567 -0.300354 -1.262461 2.592913 -0.451742 0.550044 0.568761 0.340183
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.122320 0.012857 -0.237602 0.263575 -0.765039 -0.873146 0.971466 -1.238799 0.557521 0.574791 0.341809
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.657469 -0.753005 -0.828563 -0.181683 -1.077674 -1.222034 0.627517 4.879198 0.550756 0.571937 0.343161
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.866951 6.513836 5.117620 4.606507 5.798172 6.017760 -2.451714 -2.255732 0.517147 0.544204 0.336738
225 N19 RF_ok 100.00% 0.00% 93.14% 0.00% -0.553052 14.944828 0.723535 6.114227 -0.880503 7.420584 -1.026859 0.854364 0.562548 0.128609 0.459011
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.534119 21.988626 -0.517712 0.662704 -1.078024 3.003374 -0.868485 -0.656944 0.549283 0.451763 0.331103
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 4.279788 0.229808 2.956812 -0.408388 0.729176 -1.009293 3.807462 2.729210 0.436943 0.531434 0.365214
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.532836 -0.001056 1.004059 -1.069724 0.075623 -0.960946 0.242316 1.032058 0.534610 0.522119 0.339605
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.512130 0.966586 0.924189 1.524494 0.001910 1.017257 -1.294011 -1.626558 0.529701 0.534023 0.354675
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.042194 -0.359656 0.829530 -1.072976 -0.772867 -0.787180 -0.535890 -0.757605 0.497818 0.540711 0.350885
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.152601 -0.169745 0.918210 0.483168 -0.514866 -1.178115 -1.232752 -1.261064 0.556310 0.559365 0.349024
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.974516 -0.975319 -0.024747 -0.221078 -0.476342 -1.188938 0.249961 0.626975 0.554717 0.557689 0.345356
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.128562 0.165251 0.968498 -0.819371 -0.789740 -1.372707 6.237736 4.097507 0.509979 0.558139 0.358568
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.407177 -0.957616 -0.342963 0.289421 -1.108768 -0.806768 0.663192 -0.396314 0.552756 0.562463 0.355791
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 22.311785 1.531267 0.294249 1.805294 2.078954 1.376991 -1.201207 -0.377512 0.416023 0.553200 0.346641
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 21.501000 -0.866919 1.084697 -0.989217 2.255984 -0.699838 0.137376 -0.063271 0.433612 0.538862 0.343431
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.242754 -0.697820 -0.253929 -1.082448 -1.026390 -0.230470 1.633758 3.845874 0.508617 0.541122 0.348155
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.262242 0.953164 1.158264 -0.454499 0.109503 -1.010042 -1.503298 -0.164508 0.538257 0.530815 0.346459
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.383546 16.120138 -0.814698 5.838126 -0.731099 7.704711 -0.915651 -0.004251 0.516254 0.035636 0.436381
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% -0.613866 -0.060288 -0.107743 -0.195747 -0.814964 -1.062399 7.423970 3.576864 0.522290 0.524138 0.343361
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 13.037932 16.317077 0.540114 0.426171 0.842533 0.251008 -0.137135 2.068245 0.538613 0.537479 0.365548
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.745572 1.479822 2.547733 1.411351 1.602459 0.702895 -1.124314 0.842691 0.447813 0.452536 0.340317
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 2.440884 3.271713 1.293178 1.676944 0.545866 1.591273 -0.486804 -0.813660 0.431273 0.435241 0.323024
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.285663 -0.718347 1.173671 -1.134240 0.642762 -1.155602 -1.345143 0.089089 0.456311 0.451839 0.337720
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.221979 0.023359 -0.431634 -0.363653 -0.275629 -0.720351 0.369364 -0.591800 0.406733 0.439141 0.321384
333 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.346168 4.399604 -0.293369 -0.881949 -0.858960 -0.795019 0.298702 -0.274547 0.406555 0.415628 0.303691
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 5, 7, 15, 16, 17, 18, 27, 28, 30, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 51, 52, 53, 54, 55, 58, 59, 60, 63, 65, 66, 68, 70, 71, 72, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 101, 102, 103, 104, 108, 109, 110, 111, 112, 113, 114, 117, 118, 121, 122, 123, 124, 125, 126, 127, 131, 134, 135, 136, 137, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 161, 165, 167, 168, 169, 170, 173, 180, 182, 184, 187, 189, 190, 191, 192, 193, 200, 201, 202, 204, 205, 206, 208, 209, 210, 211, 223, 224, 225, 226, 227, 240, 242, 243, 246, 261, 262, 333]

unflagged_ants: [8, 9, 10, 19, 20, 21, 22, 29, 35, 41, 43, 44, 46, 48, 49, 50, 56, 57, 61, 62, 64, 67, 69, 73, 74, 85, 88, 89, 90, 91, 95, 105, 106, 107, 115, 120, 128, 132, 133, 139, 141, 144, 145, 146, 157, 160, 162, 163, 164, 166, 171, 179, 181, 183, 185, 186, 207, 220, 221, 222, 228, 229, 237, 238, 239, 241, 244, 245, 320, 324, 325, 329]

golden_ants: [9, 10, 19, 20, 21, 29, 41, 44, 56, 67, 69, 85, 88, 91, 105, 106, 107, 128, 141, 144, 145, 146, 157, 160, 162, 163, 164, 166, 171, 181, 183, 186]
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_2460020.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

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