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 = "2459878"
data_path = "/mnt/sn1/2459878"
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: 10-25-2022
In [5]:
# Per-season options
def ant_to_report_url(ant):
    return f'https://htmlpreview.github.io/?https://github.com/HERA-Team/H6C_Notebooks/blob/main/antenna_report/antenna_{ant}_report.html'

Load Auto Metrics¶

In [6]:
use_auto_metrics = False

# find the auto_metrics file
glob_str = os.path.join(data_path, f'zen.{JD}*.auto_metrics.h5')
auto_metrics_file = sorted(glob.glob(glob_str))

# if it exists, load and extract relevant information
if len(auto_metrics_file) > 0:
    auto_metrics_file = auto_metrics_file[0]
    print(f'Found auto_metrics results file at {auto_metrics_file}.')
    
    auto_metrics = load_metric_file(auto_metrics_file)
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
    auto_ex_ants = auto_metrics['ex_ants']['r2_ex_ants']
    
    use_auto_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping auto_metrics.')
Found auto_metrics results file at /mnt/sn1/2459878/zen.2459878.29936.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 1676 ant_metrics files matching glob /mnt/sn1/2459878/zen.2459878.?????.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/2459878/zen.2459878.?????.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 2459878
Date 10-25-2022
LST Range 22.889 -- 7.908 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1675
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 7
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 96
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 201 (0.0%)
Antennas in Commanded State (observed) 0 / 201 (0.0%)
Cross-Polarized Antennas 95, 146
Total Number of Nodes 18
Nodes Registering 0s N20
Nodes Not Correlating N09
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 89 / 201 (44.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 181 / 201 (90.0%)
Redcal Done? ❌
Never Flagged Antennas 14 / 201 (7.0%)
A Priori Good Antennas Flagged 83 / 96 total a priori good antennas:
5, 7, 10, 15, 16, 17, 19, 20, 21, 29, 30, 31,
37, 38, 44, 45, 51, 53, 54, 55, 56, 59, 66,
67, 68, 71, 72, 81, 83, 84, 86, 88, 91, 93,
94, 98, 99, 100, 101, 103, 105, 106, 107, 108,
109, 111, 116, 117, 118, 121, 122, 123, 124,
127, 128, 130, 136, 140, 141, 142, 143, 144,
146, 147, 158, 160, 161, 162, 164, 165, 167,
169, 170, 181, 183, 184, 185, 186, 187, 189,
190, 191, 202
A Priori Bad Antennas Not Flagged 1 / 105 total a priori bad antennas:
168
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_2459878.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 0.00% 0.00% 0.00% 0.00% -1.256004 -0.736658 -0.776030 -0.523234 -0.394047 -0.314105 0.064415 3.637869 0.671597 0.676410 0.412776
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.245733 5.279007 4.098594 0.206019 0.250910 0.093523 19.415860 1.994229 0.670159 0.672705 0.400751
5 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.341878 0.523557 -0.586893 3.230048 -0.789064 0.672833 5.794146 0.005775 0.675523 0.680115 0.398857
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.629602 -1.421903 0.651223 0.887032 -0.788288 0.588789 12.137222 26.112155 0.667751 0.680423 0.400580
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.292726 -0.960476 0.839873 0.796323 -0.756622 -0.600277 10.617795 2.638457 0.659589 0.671652 0.393274
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.071179 -1.164343 0.977906 0.404471 0.854151 -0.100648 -0.106129 0.646581 0.662719 0.673138 0.408558
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 13.876267 -0.795829 9.940258 8.546710 10.773130 3.624437 5.877228 0.734298 0.653977 0.671723 0.410236
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 1.492913 0.663642 2.415390 -0.471616 0.106534 -0.425947 17.128395 6.417015 0.672567 0.684862 0.400897
16 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.225083 0.696612 0.255639 -0.762561 0.262911 1.696801 7.749863 14.265095 0.674596 0.683775 0.393398
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.184319 1.246340 0.330297 0.903039 -0.221218 0.419203 11.590472 5.684314 0.675700 0.689918 0.394113
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.636807 20.811773 1.922694 2.301663 3.673055 11.632551 82.946424 83.250768 0.652080 0.465454 0.469911
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.224039 -0.023948 0.094345 21.393244 0.019666 4.586349 12.559879 24.703501 0.669076 0.671880 0.399164
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.120273 4.359513 0.386561 21.713678 1.047302 2.591836 10.857482 -0.675254 0.673370 0.678618 0.401156
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.565753 0.835450 -0.249122 9.372960 1.026752 2.188667 2.370898 69.312812 0.660526 0.665739 0.405358
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% 40.803493 13.985407 6.799727 21.155402 11.049751 7.990669 35.221783 36.226906 0.455496 0.609074 0.330775
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 15.066285 16.248589 71.583207 71.739208 11.608195 15.703872 10.648204 7.667773 0.034591 0.039353 0.004913
28 N01 RF_maintenance 100.00% 0.00% 84.13% 0.00% 18.182646 35.434182 9.058168 5.866460 9.844647 21.323430 11.361524 53.612134 0.361949 0.165678 0.259955
29 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -1.507639 -0.066724 -1.005175 0.664210 -0.935288 -0.748314 0.398074 11.550319 0.679138 0.687645 0.387703
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.013794 -0.981877 3.722678 -0.978551 0.208194 0.086693 19.576773 0.353900 0.677686 0.693271 0.391387
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.212015 2.199926 1.784112 0.616941 0.209822 5.178747 8.309268 10.775174 0.686412 0.688581 0.400756
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 28.856769 27.328342 11.204876 5.217870 5.755074 9.655592 39.040944 56.633525 0.548459 0.594506 0.232376
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 17.234631 3.779778 30.733730 23.069247 11.571296 6.181667 5.236013 -1.566235 0.045367 0.665775 0.440563
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 7.057360 1.736800 51.899277 15.574498 7.570968 2.915305 -6.677535 1.906079 0.643641 0.648242 0.399930
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.326776 10.704856 1.293529 0.985549 0.863958 1.477756 3.035640 14.053376 0.669663 0.681367 0.408532
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.297471 1.260952 4.435224 5.207358 0.817787 -0.120160 0.655808 24.414234 0.676852 0.689659 0.413614
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.703688 0.442303 -0.048606 -0.574084 1.315432 1.424656 18.896572 5.003157 0.681651 0.695509 0.411181
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.354665 0.340848 -0.533266 -0.680059 0.414377 -0.598290 -0.240913 -0.843775 0.676835 0.689114 0.396704
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.026890 1.102512 2.967048 1.706785 1.637395 -0.817035 -0.281430 1.247645 0.681827 0.688739 0.384049
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.123691 1.320180 -0.356375 2.353635 -0.353711 -0.466769 0.523734 -0.837529 0.689930 0.701398 0.395115
43 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 14.140128 4.705110 70.815783 0.240406 11.590145 0.725540 7.192667 8.017464 0.043613 0.694405 0.426651
44 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 11.921330 3.248943 1.586870 5.147721 8.047189 0.948243 285.635525 44.953063 0.653156 0.692587 0.384028
45 N05 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
46 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 245.271614 245.104078 inf inf 5424.393446 5373.130172 21193.315628 21137.477351 nan nan nan
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 16.154828 3.307874 29.389151 16.451869 11.581424 2.633788 6.148447 16.591591 0.040038 0.663728 0.431032
48 N06 not_connected 100.00% 0.00% 0.00% 0.00% 2.990406 3.711852 30.863987 36.746209 2.331864 4.421558 0.842493 -3.809184 0.651596 0.675936 0.406333
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 2.075106 3.357544 15.076094 35.824102 1.645149 4.893103 1.925674 -1.309667 0.622317 0.662088 0.400409
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.832660 33.517403 -0.054100 6.487056 3.300947 5.094582 17.016118 60.434993 0.661049 0.603131 0.371558
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 32.669968 1.793225 91.758939 1.564434 11.884435 3.476132 36.045513 20.207455 0.042721 0.691909 0.476202
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.949697 8.877959 0.940996 0.698648 2.616194 -0.572121 4.343483 4.085667 0.683998 0.698374 0.400104
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.861223 3.735909 0.008867 1.576001 0.038002 0.462204 9.946779 18.564834 0.688911 0.703067 0.401305
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 15.086490 17.127677 71.593746 73.417321 11.610003 15.702452 9.304275 5.288091 0.048329 0.047101 0.001516
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 3.359492 18.148480 2.401363 72.762580 7.708917 15.721027 16.980427 12.965192 0.673786 0.036357 0.428233
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 1.154974 1.383282 1.270123 0.468907 1.094505 1.853381 8.523219 40.584827 0.683475 0.698480 0.377171
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 44.668894 1.148718 26.855024 -0.366609 7.292916 0.967173 13.765154 6.233320 0.523494 0.700893 0.396212
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 14.548564 16.933614 71.241381 73.100688 11.601472 15.760831 11.786155 9.340822 0.039128 0.036226 0.001792
59 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 33.685584 7.193185 6.687899 0.371347 4.375752 1.420067 30.930360 64.322973 0.599208 0.684540 0.387269
60 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 15.715208 16.548659 71.459600 72.944698 11.641991 15.778968 10.090825 12.086165 0.028151 0.028314 0.001511
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 5.387388 4.791445 5.642418 0.707182 3.843500 3.659489 1.223544 8.349276 0.633077 0.641700 0.385426
62 N06 not_connected 100.00% 0.00% 0.00% 0.00% 2.093243 3.871825 24.852291 35.194051 1.941478 5.836992 3.285253 -2.738867 0.659358 0.681627 0.395421
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 13.429150 16.985255 24.484070 30.390897 3.643050 15.702630 0.776815 10.121295 0.598901 0.046110 0.383978
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 2.895307 2.419069 15.522097 29.141105 1.043680 3.363539 1.240898 -1.939047 0.612777 0.650866 0.401531
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.365889 1.656241 2.169336 2.137774 2.881049 1.725750 0.661282 0.965529 0.661547 0.686359 0.416645
66 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.181234 2.167194 14.344763 9.215904 2.499582 0.276250 0.804677 6.237688 0.665665 0.688122 0.407294
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.299058 0.063375 9.312353 4.366101 0.008004 -0.085054 2.579773 5.332297 0.672314 0.692404 0.399479
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 3.332287 35.975603 2.524081 97.307058 -0.338947 15.304596 7.767102 30.711168 0.676667 0.033322 0.465751
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.317684 -0.806394 1.045502 -0.451261 1.665196 2.043366 0.230154 0.119720 0.684371 0.701854 0.388805
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.931407 -0.077727 1.874379 3.088521 0.807865 0.483065 0.313578 0.397222 0.690079 0.705280 0.389060
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 9.525959 -0.448755 3.889010 3.117703 0.895163 1.379818 9.536783 3.016019 0.696840 0.704545 0.386119
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.927830 -0.202168 3.444527 2.615265 2.846825 0.391215 20.170315 4.690507 0.673459 0.692898 0.383507
73 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 309.204990 309.317833 inf inf 9078.857147 9082.375148 32623.829138 32646.850959 nan nan nan
74 N05 RF_maintenance 100.00% 100.00% 0.06% 0.00% 15.519562 13.726303 73.495084 70.203081 11.633352 13.897590 11.411019 75.199701 0.032645 0.337864 0.197979
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 31.174701 33.072213 25.632491 20.770034 5.695780 9.963183 14.543356 5.794500 0.534988 0.523271 0.179991
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 43.379357 1.268966 19.175837 25.459896 6.855537 2.395780 8.330593 2.658314 0.475589 0.664112 0.375856
79 N11 not_connected 100.00% 0.00% 0.00% 0.00% 4.547323 5.511610 44.915192 46.754884 5.254896 8.393276 -1.114281 -5.763563 0.648540 0.672833 0.402652
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 13.343291 18.599109 42.146749 29.522428 10.237715 15.692686 27.725556 4.919671 0.309838 0.041320 0.175544
81 N07 digital_ok 100.00% 51.31% 51.31% 0.00% 0.192057 0.891061 0.179259 25.156200 -0.390081 36.252231 0.394987 2.697603 0.357053 0.371358 0.187550
82 N07 RF_maintenance 100.00% 51.31% 51.25% 0.00% 2.895231 0.604071 0.272237 9.397342 -0.357743 -0.023820 0.420453 -0.547053 0.363963 0.373789 0.182361
83 N07 digital_ok 0.00% 51.31% 51.25% 0.00% -0.106483 0.026890 -0.461351 0.734301 -1.179058 0.939403 -0.599041 1.398122 0.373847 0.376990 0.178427
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 3.393889 32.003490 35.334165 94.059369 3.481214 15.277786 8.155274 17.234527 0.649332 0.039883 0.384358
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.694477 0.654505 0.069638 -0.599106 -0.920928 0.228770 -1.282476 -1.260331 0.680292 0.690512 0.385734
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.507336 7.626548 7.856549 3.497644 8.118692 1.884085 2.730281 57.962613 0.669864 0.668363 0.369292
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.678930 9.993671 6.464176 1.221496 26.901298 3.353868 17.538303 4.783476 0.623009 0.710358 0.363053
88 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 1.943761 0.563546 1.342796 1.624734 -0.680056 2.535547 22.537209 6.746108 0.066273 0.072218 0.010836
89 N09 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.341921 0.156316 -0.482344 0.599107 0.027586 -0.460116 -1.174649 -1.440492 0.060961 0.064826 0.007282
90 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% 0.898054 0.244049 0.358768 2.563912 -1.079123 0.212433 1.712199 12.161875 0.065912 0.072682 0.010116
91 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 0.995126 -0.214281 0.425215 0.563068 -0.503003 -0.695979 12.827530 3.424409 0.079946 0.078286 0.021298
92 N10 RF_maintenance 100.00% 0.00% 18.50% 0.00% 50.241008 57.296996 8.657456 10.406975 11.479675 15.780101 2.252003 13.746002 0.294412 0.243288 0.097544
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 3.516005 0.170737 8.916573 5.411520 2.282165 0.283179 11.513785 -0.597653 0.672645 0.695915 0.395873
94 N10 digital_ok 100.00% 0.00% 0.00% 0.00% -0.506830 0.353818 1.395582 0.216654 1.413277 2.738285 8.446825 6.429823 0.671755 0.684282 0.393325
95 N11 not_connected 100.00% 0.00% 0.00% 100.00% 6.621751 6.807458 51.766945 51.922227 7.178234 12.856198 -4.688550 -5.024469 0.244617 0.243115 -0.282240
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 16.524218 18.114469 29.353530 30.783257 11.505065 15.753377 5.413207 3.532721 0.035151 0.042909 0.004900
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.903511 5.583668 49.649719 3.749015 7.037772 3.249374 -6.201801 32.582414 0.625860 0.622009 0.396906
98 N07 digital_ok 100.00% 51.31% 51.25% 0.00% 1.898696 9.821313 -0.377121 1.172242 1.983103 2.738676 2.869546 8.922893 0.355679 0.364425 0.180067
99 N07 digital_ok 100.00% 51.31% 51.25% 0.00% 2.576834 -0.487513 1.476693 1.226171 -0.914619 5.638833 6.766747 0.061273 0.359023 0.368963 0.180094
100 N07 digital_ok 0.00% 51.31% 51.25% 0.00% -0.125081 -0.707892 -0.636491 2.867648 0.934309 -1.009484 -0.259337 -0.064415 0.367695 0.372872 0.177787
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.940052 11.871652 2.949022 2.407275 -0.885787 0.331996 2.859613 1.680901 0.684890 0.696503 0.389452
102 N08 RF_maintenance 100.00% 86.10% 100.00% 0.00% 16.880508 16.956943 64.686782 69.096225 12.667523 15.778981 3.864704 14.443635 0.156156 0.041836 0.065949
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 31.491597 32.769511 81.986285 83.170218 11.625505 15.651435 30.437982 27.158606 0.027446 0.029505 0.002459
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.310648 77.940117 46.341751 48.147330 4.367767 7.648570 0.797881 0.018434 0.642029 0.672673 0.378889
105 N09 digital_ok 0.00% 100.00% 100.00% 0.00% 0.484414 0.073394 -0.668922 1.015232 -0.375073 0.028916 0.454618 -1.249386 0.067794 0.072700 0.011587
106 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 0.653378 1.076781 6.908075 2.818811 3.976227 1.296036 1.179811 0.500871 0.059560 0.061613 0.006980
107 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 3.370264 0.689357 1.426579 6.355737 0.700685 -0.021747 7.069329 10.517175 0.049442 0.057343 0.004175
108 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 14.495403 3.878960 70.168306 1.247963 11.070697 0.867759 7.682341 4.472919 0.051835 0.067031 0.043118
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.136705 16.760173 2.914564 70.879868 -0.258644 15.687952 0.894290 7.339588 0.684031 0.037153 0.401583
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.904013 34.047276 -0.007500 95.228769 -0.540707 15.238778 2.954118 15.391068 0.693281 0.035211 0.404868
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.082683 16.546466 2.368090 71.634306 0.677568 15.683089 11.667316 8.945039 0.679140 0.037041 0.400132
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.267122 -0.448485 -0.624771 2.552722 -0.027586 2.272120 2.251333 -1.094327 0.666811 0.691412 0.403889
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 17.598598 18.123279 27.750766 30.009272 11.515930 15.737673 7.264667 3.807254 0.040500 0.032055 0.004972
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 11.691610 7.096530 15.610369 49.431211 7.507741 10.103976 3.966605 -5.059550 0.474682 0.657297 0.445561
115 N11 not_connected 100.00% 0.00% 0.00% 0.00% 4.056408 10.436130 41.923866 39.890094 4.428135 7.342421 -4.941709 -1.776676 0.627862 0.608435 0.401755
116 N07 digital_ok 100.00% 51.31% 51.25% 0.00% -0.151120 1.680229 6.411371 3.101042 2.763631 1.303330 1.965534 1.787768 0.362296 0.366210 0.183636
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 16.320045 18.608886 71.849944 75.230192 11.554745 15.778171 7.005179 13.433663 0.027046 0.028725 0.001480
118 N07 digital_ok 100.00% 51.31% 51.25% 0.00% -0.057194 1.526203 -0.247247 1.388460 0.999114 3.171058 9.163850 11.543063 0.366968 0.373701 0.180090
119 N07 RF_maintenance 100.00% 51.31% 51.25% 0.00% 1.409900 4.214213 4.746774 27.429995 -1.150491 11.983332 1.064392 4.886192 0.379834 0.372425 0.184192
120 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 21.786088 32.043701 34.340152 93.513565 8.701553 15.450941 -3.406273 29.353223 0.350406 0.040175 0.190160
121 N08 digital_ok 100.00% 0.06% 0.00% 0.00% 4.101095 7.014537 0.257720 1.334904 0.703350 0.039264 84.861848 56.517715 0.689514 0.705997 0.386114
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 10.166427 9.356592 9.048368 1.313773 7.924683 -0.657436 1.861855 -0.846232 0.696563 0.707266 0.384887
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.096270 11.650101 2.105506 2.444555 -1.044101 0.036068 1.947418 4.110725 0.696602 0.707167 0.385965
124 N09 digital_ok 0.00% 100.00% 100.00% 0.00% -0.320935 3.566501 -0.069638 -0.167084 -0.171644 -0.373074 2.217312 1.265099 0.064164 0.070581 0.008718
125 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.316679 3.973891 -0.259890 0.734894 -0.308775 2.361181 1.060163 6.158899 0.061997 0.067991 0.007397
126 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.945432 -0.323196 4.636629 1.038082 12.032299 0.541286 16.528463 -0.311440 0.072425 0.070882 0.015003
127 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.526937 -0.128576 -0.730888 0.509008 2.018734 1.448540 3.792202 10.566947 0.685816 0.702470 0.401059
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% -0.150769 0.296547 8.313950 2.524239 0.127943 2.133841 2.519793 0.905103 0.679338 0.697134 0.392178
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.749728 -1.388489 -0.599126 -0.160755 -0.482631 -0.750691 -0.786760 -0.687700 0.679278 0.697552 0.399558
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 3.551140 0.633125 -0.172693 0.533319 -0.240809 0.962068 6.191279 10.889054 0.656587 0.687853 0.397614
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 16.390581 18.238118 29.637816 31.752821 11.569532 15.666116 10.613693 1.096390 0.035057 0.041385 0.002676
132 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.577812 1.516634 48.982082 37.426870 7.068482 5.649704 -5.214017 -3.547585 0.633439 0.668372 0.419114
133 N11 not_connected 100.00% 100.00% 76.49% 0.00% 16.963087 23.272158 27.803272 20.651418 11.582621 15.584438 7.208179 3.571945 0.043405 0.181496 0.087431
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -1.258176 16.730101 -0.192381 73.313698 0.227899 15.754225 1.539414 5.649330 0.631245 0.041921 0.402784
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 5.634783 1.160154 1.095211 2.806271 0.641448 6.903180 1.144968 1.228801 0.621865 0.659251 0.404265
137 N07 RF_maintenance 0.00% 51.31% 51.25% 0.00% 1.079305 -0.822646 0.587791 -0.960602 2.386699 2.276232 2.705084 1.083049 0.355740 0.368187 0.185322
138 N07 RF_maintenance 100.00% 51.31% 51.25% 0.00% 1.747220 -0.078617 4.650416 7.294295 0.230167 -0.563957 17.204208 0.595646 0.372558 0.377043 0.186305
139 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.292762 4.719113 53.277870 46.488681 7.796675 8.108885 -6.382245 -4.151321 0.661617 0.688195 0.397307
140 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 6.002289 17.700742 49.507663 72.304329 6.447701 15.621391 -1.897034 10.209062 0.670629 0.055718 0.471132
141 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.918654 7.719845 2.763926 54.970550 0.566075 11.337635 2.688543 -7.520578 0.687020 0.688009 0.378886
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 1.934577 16.552728 1.431409 72.871698 2.686932 15.707493 2.189088 7.141223 0.683200 0.049554 0.470249
143 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 15.327513 -1.132379 72.292040 -0.067989 11.539921 1.208945 4.612453 0.482139 0.040402 0.707162 0.481456
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.557772 -1.071943 0.005498 18.546849 0.659812 1.264879 0.527889 4.781387 0.686677 0.690458 0.396029
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.556693 4.271769 0.210743 46.843816 9.137697 31.433387 0.712548 4.461783 0.681588 0.615552 0.419394
146 N14 digital_ok 100.00% 0.00% 0.00% 100.00% 4.384917 7.399156 41.581275 51.565712 4.611827 12.850746 -3.632006 -6.882099 0.269396 0.265218 -0.279111
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.397872 -0.343650 7.893871 11.211096 5.898049 -0.917635 0.842667 0.280184 0.677454 0.691355 0.388006
148 N15 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.118125 -0.331689 21.750313 8.036170 0.115878 1.366413 0.501580 -0.125532 0.663562 0.695156 0.399725
149 N15 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.853211 2.884156 14.687116 40.420895 -0.536559 5.634004 1.075224 -3.555217 0.677080 0.694920 0.400045
150 N15 RF_maintenance 100.00% 100.00% 0.00% 0.00% 15.999521 5.012816 71.515558 46.986521 11.581788 9.363508 9.500149 -5.031830 0.052453 0.281065 0.106017
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 14.647946 -0.336238 69.100838 0.992745 11.570202 9.633384 4.785299 6.186788 0.065347 0.663260 0.467188
156 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.057267 -0.214236 64.947190 3.111805 8.733376 -0.009860 5.364990 1.440552 0.372815 0.670768 0.490994
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.085726 -0.393262 0.597958 -0.241423 -0.974198 -0.181337 -0.197929 -0.402541 0.647513 0.674757 0.411361
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.558220 -0.379440 2.412764 6.141491 1.032522 1.414477 10.155698 49.155895 0.665048 0.688622 0.414573
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.068536 29.717045 37.865309 34.161660 3.635748 10.365673 -1.950188 37.857320 0.663738 0.552577 0.379956
160 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.603893 -0.591700 1.524615 7.288466 -0.860875 0.644869 1.776234 2.368646 0.677024 0.695566 0.389110
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.203201 37.429106 -0.294447 9.826741 -0.567378 5.463467 0.238768 4.631557 0.680626 0.576590 0.350888
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.951038 1.279670 11.845538 9.739522 5.754673 8.034114 2.351296 4.907622 0.693273 0.708010 0.389745
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.418900 -0.935668 0.940175 -0.730734 -1.151998 0.937989 0.126701 1.546773 0.691283 0.702306 0.395003
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.096827 -0.181741 9.542798 4.443194 16.145098 1.522276 2.581392 3.438814 0.678855 0.706842 0.395738
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 26.110183 0.019411 52.845412 4.552118 8.424457 -0.986224 5.409856 -0.616475 0.405658 0.703171 0.439371
166 N14 RF_maintenance 100.00% 0.00% 96.54% 0.00% 39.121548 15.519212 10.890238 69.565780 7.240237 15.608478 99.119319 5.116454 0.550916 0.098732 0.363477
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.576717 -1.125646 16.812653 3.093540 0.537452 0.270421 -0.657297 7.464210 0.692756 0.699093 0.398548
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.052341 -1.083827 -0.973740 2.835708 0.340210 0.053901 -0.340706 -0.148272 0.681722 0.700261 0.399479
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 2.836937 13.471314 36.508974 44.729938 2.444939 15.357886 -4.035904 4.553322 0.679714 0.611854 0.400253
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 15.993348 -0.274647 72.761518 11.835449 11.515417 24.798181 5.403144 2.674130 0.044312 0.693140 0.499135
179 N12 RF_maintenance 100.00% 100.00% 100.00% 0.00% 16.243544 18.193218 72.761008 76.451401 11.505442 15.752098 4.612502 5.784085 0.055393 0.052134 0.005701
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 15.475254 17.522644 72.153503 73.780523 11.539964 15.777202 5.179204 9.758153 0.049635 0.053779 0.004113
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.196315 -0.829029 0.886121 -0.628024 -0.505624 2.532311 0.459903 13.813728 0.686686 0.697891 0.392404
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.560856 6.608230 40.624908 50.933208 1.372895 9.737878 10.098370 -3.623487 0.632704 0.694182 0.404525
183 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 15.641471 0.191417 70.538886 1.132356 11.597671 -0.334217 3.158444 0.591982 0.046762 0.697823 0.438345
184 N14 digital_ok 100.00% 99.76% 100.00% 0.00% 15.076433 17.122632 71.868877 72.956594 11.531417 15.711876 7.886355 7.966279 0.111260 0.047046 0.046425
185 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 14.396556 -0.791788 71.759864 21.143120 11.556908 -0.361245 4.195896 -0.166817 0.039355 0.687346 0.442632
186 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 1.423124 1.993480 21.651782 15.095841 17.054291 -0.153528 4.429863 1.442772 0.669488 0.707013 0.397898
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 4.397695 2.755615 7.318210 36.463806 44.799548 5.701739 4.213365 8.069921 0.676172 0.702238 0.394250
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 1.889944 2.534098 8.104677 3.982694 0.768778 2.140822 3.253202 14.223688 0.659672 0.687366 0.404359
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 60.535209 16.858856 10.188562 73.519359 8.692084 15.814992 115.239140 10.855000 0.489754 0.038168 0.326641
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 0.501476 1.036120 26.119304 1.317485 0.791652 -0.277424 46.408374 1.848257 0.631456 0.676186 0.433682
200 N18 RF_maintenance 100.00% 100.00% 41.05% 0.00% 17.198813 46.244502 29.183458 29.061179 11.636722 15.863349 8.033181 -1.889902 0.049840 0.224582 0.131299
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.860903 9.201149 60.081765 58.138655 9.848100 12.904376 -8.745979 -8.274826 0.639193 0.660916 0.388489
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 2.670896 4.266276 28.888146 3.539730 2.289396 4.205322 1.460618 8.934627 0.668057 0.647203 0.393194
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 17.913223 19.111599 27.468762 28.443221 11.611552 15.674981 10.982947 11.898158 0.034835 0.044170 0.003170
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.860787 6.686428 24.064347 8.512720 1.066217 4.864332 0.595606 13.208531 0.664632 0.609144 0.412536
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.478550 3.325770 22.726455 19.716556 29.791583 2.206781 1.652219 9.116249 0.654983 0.661740 0.384554
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.661015 4.139527 33.931589 27.778583 3.308668 4.994457 -1.888663 -2.613922 0.647307 0.658427 0.375541
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 294.731084 294.750591 inf inf 5613.950041 5510.049171 20632.904172 20425.246382 nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 260.930222 260.514999 inf inf 6923.129466 6929.862530 21823.640714 21746.882527 nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 308.841538 308.325418 inf inf 6576.896419 6602.783561 19121.830186 19383.304253 nan nan nan
211 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 333.510317 333.798611 inf inf 9081.828415 9080.723421 32693.269897 32679.861772 nan nan nan
219 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.343816 6.886469 60.111254 51.976630 10.089003 10.431366 -8.424544 -6.325178 0.610195 0.666016 0.412723
220 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.741510 7.254900 50.122289 51.798001 6.965182 10.355041 -1.450704 -7.259558 0.662706 0.671260 0.401963
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 4.262732 2.063438 3.268988 23.415496 2.916283 2.329088 8.348395 0.334465 0.627579 0.671710 0.403983
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 6.997050 7.956986 52.393421 52.442456 7.666615 10.224287 -1.055523 -6.784823 0.655755 0.672195 0.397925
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.475470 2.900921 12.392118 8.392529 1.704979 55.440779 2.441647 9.483590 0.636464 0.645739 0.384999
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 9.946904 9.830615 61.426052 61.732422 10.138846 14.231191 -8.504643 -9.393874 0.643422 0.654166 0.390590
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
227 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 308.872892 308.421573 inf inf 7127.248067 7080.779754 22275.952601 21785.894258 nan nan nan
228 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 317.699967 317.384758 inf inf 9081.552629 9080.449945 32617.833697 32605.169511 nan nan nan
229 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 317.693527 317.550046 inf inf 7742.412048 7776.734697 25598.566901 25618.351368 nan nan nan
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 4.727136 3.275030 1.784901 17.886440 2.786007 3.266729 1.200421 -0.931850 0.607348 0.645696 0.411063
238 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 1.756941 0.816255 32.369278 32.421715 2.635284 5.360153 -2.110097 -3.341329 0.658800 0.665292 0.409587
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 1.220516 3.850672 21.715574 41.179088 3.623632 6.725907 3.679966 19.898818 0.652531 0.667962 0.403768
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% 320.757607 320.784458 inf inf 9059.280887 9061.876703 32165.447181 32214.269544 nan nan nan
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.437071 6.072047 18.454192 0.179340 0.768783 3.315567 18.862210 59.668322 0.646647 0.615251 0.407451
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 42.587900 3.558153 22.167177 36.171786 20.169345 4.082525 32.737912 -2.773926 0.485072 0.667520 0.421619
243 N19 RF_ok 100.00% 4.24% 0.00% 0.00% 77.108175 4.331406 23.116697 16.634475 10.612386 2.829804 -2.158089 2.229761 0.300707 0.646290 0.515924
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 333.718458 333.872431 inf inf 6834.819389 7098.100312 15678.921386 17425.879317 nan nan nan
245 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 274.424762 275.501143 inf inf 7795.703384 7699.885103 19264.796510 19736.950596 nan nan nan
246 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 317.747465 317.786564 inf inf 7928.324204 7983.857410 18440.644790 18928.518739 nan nan nan
261 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 256.058035 254.993786 inf inf 6752.823356 6704.118394 20241.056947 19986.126171 nan nan nan
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 1.194109 17.629138 1.390455 46.022531 0.249839 15.806011 43.942671 16.080876 0.651093 0.050716 0.470432
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 2.569242 4.602533 32.302302 38.243729 3.191652 4.905450 3.192582 -1.387024 0.552599 0.558984 0.399313
325 N09 dish_ok 100.00% 100.00% 100.00% 0.00% 1.345400 0.088965 33.008329 17.251581 3.010873 2.018007 -2.360822 0.429295 0.078726 0.081729 0.032301
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.173395 -0.037068 0.315536 20.552128 1.297271 1.537758 17.246513 2.213423 0.507348 0.573528 0.415049
333 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 4.798697 2.218068 5.161746 16.438871 1.351049 2.091436 4.613082 3.960304 0.520499 0.562553 0.405300
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, 5, 7, 8, 10, 15, 16, 17, 18, 19, 20, 21, 22, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 71, 72, 73, 74, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 132, 133, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 155, 156, 158, 159, 160, 161, 162, 164, 165, 166, 167, 169, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 202, 203, 205, 206, 207, 208, 209, 210, 211, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 324, 325, 329, 333]

unflagged_ants: [3, 9, 40, 41, 42, 65, 69, 70, 85, 112, 129, 157, 163, 168]

golden_ants: [3, 9, 40, 41, 42, 65, 69, 70, 85, 112, 129, 157, 163]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459878.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

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