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 = "2460039"
data_path = "/mnt/sn1/2460039"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 4-4-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/2460039/zen.2460039.21298.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 1850 ant_metrics files matching glob /mnt/sn1/2460039/zen.2460039.?????.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/2460039/zen.2460039.?????.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 2460039
Date 4-4-2023
LST Range 7.389 -- 17.346 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
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 69 / 198 (34.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 127 / 198 (64.1%)
Redcal Done? ❌
Never Flagged Antennas 70 / 198 (35.4%)
A Priori Good Antennas Flagged 65 / 93 total a priori good antennas:
5, 7, 15, 16, 17, 20, 31, 37, 38, 40, 42, 45,
53, 54, 55, 65, 66, 67, 69, 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, 160, 161, 165, 167, 168,
169, 170, 172, 173, 181, 182, 184, 187, 189,
190, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 42 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 50, 57, 61, 62, 64,
73, 74, 89, 90, 95, 115, 125, 126, 132, 133,
135, 139, 179, 185, 206, 220, 221, 222, 228,
229, 237, 238, 239, 241, 244, 245, 320, 324,
325, 329, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2460039.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.425310 14.546675 -0.660048 -0.504303 -0.990414 1.264083 -1.242663 11.629224 0.553118 0.464648 0.353309
5 N01 digital_ok 100.00% 100.00% 83.68% 0.00% 10.556518 12.013701 10.082810 10.199601 4.322228 3.970443 1.191944 0.993809 0.058489 0.159295 0.098512
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.011891 0.039075 -0.689627 0.015855 -0.167754 0.427375 11.893070 13.185791 0.570548 0.567321 0.342879
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.792849 3.869891 2.150488 2.199332 2.284400 2.467553 -3.114631 -2.433104 0.550784 0.553461 0.333613
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.449087 -0.572054 3.001078 -0.673202 1.894431 0.228215 1.672851 -0.659609 0.550721 0.573641 0.346405
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.521319 -0.786842 0.156591 -0.884473 -0.549078 -0.074766 -1.611995 -0.373054 0.560860 0.559579 0.339828
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 20.644768 0.083615 -0.342418 -0.322259 0.376628 0.573803 0.038235 2.082129 0.438309 0.571709 0.350762
16 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.224761 13.728593 10.098176 10.597291 4.288263 4.409355 1.238106 4.056498 0.032239 0.034351 0.001681
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.262030 4.119372 0.812548 8.780596 1.220165 0.594730 0.424391 4.556068 0.575357 0.423005 0.402043
18 N01 RF_maintenance 100.00% 0.00% 53.08% 0.00% 28.801934 20.527481 1.815771 1.822489 1.804701 1.681200 11.028751 21.953545 0.287078 0.209423 0.154458
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.412341 -0.138811 -0.441466 0.605322 -0.096923 1.291790 -0.590236 3.283013 0.583309 0.590421 0.343795
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.695245 -1.188929 1.939407 -0.611691 2.104732 0.248544 2.425007 -0.378185 0.570157 0.590076 0.340930
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.355796 0.288862 -0.157070 0.170049 0.671044 1.013608 -0.042602 0.056917 0.569959 0.573889 0.337374
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.168303 -0.582261 -0.749885 -0.640738 -0.978678 -0.330983 -0.474915 -1.130781 0.537601 0.550496 0.338017
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.465393 28.008854 9.689883 5.814716 3.859130 2.797301 13.664372 61.517010 0.079120 0.078010 -0.037988
28 N01 RF_maintenance 100.00% 100.00% 3.68% 0.00% 10.070466 16.663220 10.013456 3.742897 4.331347 0.793670 2.595109 29.733356 0.030880 0.267604 0.205961
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.140856 -0.653355 -0.713016 -0.620341 0.447219 0.220115 1.014377 1.477112 0.591528 0.596503 0.350383
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.000697 -0.663486 0.832656 -0.957454 1.915274 -0.343785 3.386385 -0.563289 0.586748 0.601692 0.349984
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.371320 0.177965 1.138730 2.823023 1.582420 1.361667 1.382630 18.875288 0.598508 0.590221 0.341446
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 18.785707 20.206360 -0.290529 -0.256889 -0.405157 -0.390805 0.669724 3.332415 0.488068 0.514599 0.200869
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 11.542725 0.499618 5.461748 -0.085614 4.297492 -0.532507 1.885613 0.321970 0.045009 0.567819 0.411730
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.836734 -0.812805 0.635140 -1.049979 0.062895 -0.971246 -0.779689 0.067549 0.550270 0.550580 0.335860
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.519628 6.579909 1.092681 0.748892 1.309084 1.485372 0.679325 1.474884 0.545871 0.546896 0.358591
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.335235 21.828409 -0.301824 12.324532 -0.932458 4.418324 -1.475073 4.392990 0.560202 0.033773 0.445749
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.422506 0.002925 -0.296172 0.198394 0.543760 0.396846 2.864034 10.012356 0.572074 0.572746 0.361695
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 1.242117 1.432471 -0.023433 -0.602616 0.588696 0.565462 24.827037 0.546510 0.238741 0.234580 -0.276099
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.009921 1.738443 1.269179 1.989981 1.888033 0.822572 0.349059 0.691224 0.583408 0.594086 0.350077
42 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.040971 3.166420 -0.414381 0.596904 0.515170 11.323056 -0.181228 3.566599 0.260798 0.247672 -0.274208
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.735551 0.036842 -0.548061 0.712511 -0.880134 1.185081 -1.095637 1.421211 0.600844 0.607400 0.343981
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.746154 0.685496 -1.004695 0.347999 -0.610171 0.705831 -0.657491 0.060523 0.602167 0.614289 0.344878
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 1.187594 3.667875 0.719071 0.681453 0.986130 1.478703 0.946079 11.098331 0.594168 0.599122 0.339323
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.382965 -0.507169 -0.094575 -0.869514 0.435807 -0.638664 -0.247917 -0.583685 0.591878 0.609376 0.352114
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.737177 13.610715 5.376496 5.321601 4.302477 4.402996 4.026399 1.389555 0.031437 0.055136 0.015829
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.264388 1.213373 -0.713573 0.867049 0.220213 0.846192 -0.265380 -2.277086 0.553159 0.567202 0.339172
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.646711 -0.675035 0.428514 -0.896831 -0.243443 -0.931040 0.325673 11.770640 0.521971 0.548901 0.339573
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.591085 1.503679 0.322879 1.537473 0.845587 1.853182 -0.051633 0.200802 0.546080 0.545901 0.355970
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.861947 1.246796 0.081970 -0.495236 1.024327 0.637871 103.512790 0.368247 0.551978 0.563729 0.355039
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.094669 4.799972 0.535769 0.206305 1.497454 1.223411 2.710509 1.084906 0.574823 0.576970 0.355790
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.386124 1.252938 -0.137755 -0.315253 1.606492 -0.592974 12.273839 6.381539 0.584667 0.591164 0.357277
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.552911 3.643910 1.733566 -0.227100 2.713164 1.377144 -1.380709 -0.001263 0.304744 0.359578 0.154943
55 N04 digital_ok 100.00% 11.08% 100.00% 0.00% 1.033340 47.637350 0.540967 7.076281 0.143200 4.511191 2.313534 0.740877 0.258318 0.041786 0.101704
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.721045 2.291664 -0.802917 1.914532 -0.762301 2.768068 -0.796173 1.790370 0.600955 0.596801 0.336512
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.969804 -0.561581 -0.454947 -0.741844 -0.798050 0.342962 -0.013717 1.050397 0.606135 0.615843 0.340603
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.510537 12.770609 10.045784 10.523899 4.291953 4.410273 2.288622 2.001554 0.037342 0.037247 0.001916
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.512857 1.116994 10.076025 1.025055 4.253758 1.850995 1.235832 10.677799 0.048544 0.609561 0.450911
60 N05 RF_maintenance 100.00% 0.00% 99.95% 0.00% 2.591350 12.718390 0.027560 10.554133 0.222877 4.379384 1.156259 4.003607 0.580927 0.079593 0.454160
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.564890 -0.419006 0.960773 -0.788061 -0.292288 -0.618549 0.340412 1.438434 0.532908 0.573713 0.342015
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.585283 1.416377 -0.009239 0.667216 -0.675677 0.083440 0.567175 -1.749747 0.539135 0.572289 0.342404
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.178768 13.180757 -0.696938 5.689500 -0.966308 4.442179 -0.935075 3.851381 0.558019 0.045739 0.419019
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.442420 -0.439056 -1.074775 -0.302878 -0.920142 -0.494087 2.321132 0.108615 0.541416 0.537751 0.335253
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 22.694775 21.687422 12.760323 12.712274 4.319193 4.453335 6.456732 8.184953 0.023522 0.032390 0.009230
66 N03 digital_ok 100.00% 19.89% 100.00% 0.00% 3.208781 22.303904 1.750435 12.860983 1.783051 4.383326 -2.604610 8.893071 0.215903 0.049784 0.104881
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.480464 0.034481 -0.457794 1.343395 -0.127741 1.361101 5.172374 1.969478 0.575406 0.575837 0.352545
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 24.205235 1.159187 12.833698 0.624953 4.254938 0.026752 7.274302 -1.003956 0.034819 0.589591 0.460393
69 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 1.166665 -0.430741 1.293931 -0.787604 0.963671 0.486261 5.178113 0.368064 0.592908 0.604860 0.347627
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% 0.223420 2.488288 1.136282 2.672753 1.471778 1.940196 3.317579 1.042288 0.264291 0.246631 -0.269619
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 5.435192 0.226261 -0.432231 0.235907 0.303900 0.750523 -0.056139 1.465388 0.610056 0.619934 0.341516
72 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.817867 2.093877 2.348236 2.564439 1.763200 5.218456 24.729370 1.459552 0.271006 0.262019 -0.271904
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.582810 1.747348 -0.806412 0.879587 0.276648 0.886380 -0.293319 0.762892 0.614104 0.621773 0.342948
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.716089 -0.039113 -0.331574 -0.290194 -0.765294 0.670350 -1.393441 1.121699 0.609373 0.621390 0.345496
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 40.361532 12.953550 0.319565 -0.528534 2.214827 0.225966 3.489560 -0.551389 0.363536 0.492502 0.251862
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 22.441641 1.098609 -0.175857 0.828492 0.667815 0.431676 -0.350891 -0.847400 0.410585 0.575179 0.332082
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.113886 13.424471 -0.653930 5.667266 -0.636021 4.391425 0.215062 0.634626 0.546759 0.040435 0.422343
80 N11 not_connected 100.00% 0.00% 29.41% 0.00% -0.343343 12.117862 -0.071769 5.175417 -0.839560 2.717851 -1.561065 1.964415 0.551410 0.224779 0.404676
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 94.820482 43.207484 27.237576 22.157732 10.648291 5.861288 767.203525 508.255128 0.017428 0.016478 0.000990
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 27.089040 55.259271 20.672718 24.241645 5.286927 9.671449 373.049908 672.703025 0.016913 0.016301 0.000947
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 25.121714 42.925657 19.435040 22.013896 4.331413 8.329818 386.585488 514.813510 0.016890 0.016425 0.000838
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.517624 24.541124 1.284458 12.964256 0.863444 4.253993 -2.707272 6.725111 0.577346 0.054053 0.432647
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.319586 0.482433 -1.090808 -1.022274 -0.799930 -0.243583 0.049032 -0.040306 0.594999 0.603410 0.344113
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.722821 0.951710 -0.059835 -0.482797 -0.010852 0.465784 -0.162622 19.569971 0.602860 0.609098 0.335444
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 23.921058 4.551927 3.068200 -0.431817 1.684563 -0.664409 1.043760 -1.139034 0.496838 0.627776 0.319549
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.054675 1.227273 0.681810 1.168339 0.789418 0.442979 0.522088 0.228228 0.606907 0.618178 0.333691
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.299918 0.497275 0.631712 0.990712 0.867282 1.212984 -0.341964 0.042257 0.609735 0.620307 0.338060
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.278999 -0.356128 -0.516824 -0.465119 -0.055902 -1.070314 -0.372934 1.623750 0.605461 0.623183 0.343262
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.150248 0.662571 0.808018 0.552741 1.145855 0.915363 0.677555 0.109971 0.594469 0.612117 0.345246
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.042297 0.148526 10.066439 0.319604 4.334603 1.375318 0.971957 1.133321 0.035676 0.606086 0.412310
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.273260 12.967584 10.146845 10.604626 4.278039 4.400171 3.481759 3.000601 0.030805 0.024971 0.003004
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.986048 13.236341 10.253405 10.443572 4.297672 4.418114 1.531360 1.533661 0.025301 0.025357 0.001061
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 3.051834 1.463508 -0.809303 0.450370 0.648971 0.935864 -0.850941 -0.456948 0.413176 0.417161 0.180950
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.016435 20.684870 0.751245 -0.394455 0.104210 0.468042 -2.073874 0.082673 0.556351 0.461365 0.331696
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.330863 2.157377 -0.918492 0.277296 -1.115536 -0.559960 -0.955732 10.568626 0.539374 0.528886 0.338732
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.734417 6.766743 0.082078 1.070253 1.039239 1.757897 -0.144099 0.200216 0.583621 0.588626 0.346599
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.740140 0.556309 -0.747087 -0.948338 -0.423282 -0.006520 -1.254214 4.935153 0.599771 0.605375 0.343658
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.372457 3.879452 2.260389 -0.954078 2.411420 0.004772 -3.482655 5.446487 0.583695 0.614499 0.340394
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.538470 50.680847 0.873300 6.426207 0.353303 1.118692 0.643051 0.745840 0.604500 0.597493 0.333405
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.299061 0.592409 0.423107 1.078376 0.895257 0.716625 0.098844 0.166881 0.609912 0.618711 0.333055
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.759826 1.159025 0.689168 0.064245 3.824355 0.142987 1.284108 -0.093627 0.607157 0.623989 0.336526
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.236675 2.106608 -0.195508 -0.845648 0.434620 -0.346885 0.645177 2.331918 0.606628 0.619778 0.332881
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.310829 3.024056 1.186961 2.271771 1.061020 1.759534 33.008665 0.625874 0.596013 0.613193 0.340423
109 N10 digital_ok 100.00% 99.89% 100.00% 0.00% 9.800151 12.820816 10.132788 10.345003 4.288416 4.452207 1.116193 2.811871 0.074490 0.036644 0.027051
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 27.057179 -0.108178 0.645586 -0.229153 0.882211 0.486612 1.099520 -0.436387 0.487019 0.602241 0.327786
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 6.519367 12.778034 0.713761 10.423855 1.358090 4.422038 26.144415 3.562498 0.547008 0.064327 0.408988
112 N10 digital_ok 100.00% 0.76% 0.76% 99.24% 0.099286 6.283709 1.547718 9.204311 1.500331 1.540356 1.311416 1.262137 0.237108 0.147844 -0.221241
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.739271 13.963544 5.127354 5.659193 4.263588 4.382449 2.408583 1.633020 0.033598 0.030904 0.001618
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 12.488193 1.052110 5.267945 -0.185649 4.255461 -0.708532 0.815877 -0.996419 0.046096 0.551355 0.416869
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.278855 -0.516065 -1.081237 -0.066358 -0.898223 -0.833218 -0.893123 -1.581882 0.524023 0.539307 0.342776
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.972101 46.715697 19.849232 25.401551 8.196530 9.224176 403.139187 661.822779 0.017761 0.016223 0.001403
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 33.156960 30.298958 24.022252 21.232779 13.720453 4.225914 892.072183 292.776679 0.016336 0.016454 0.000736
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.287630 0.966669 2.630819 -0.783559 2.083750 0.447702 7.343445 5.993961 0.580851 0.602314 0.343955
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.980354 3.007169 1.877108 5.546431 1.842191 1.408460 0.112929 18.393860 0.589785 0.591047 0.328311
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.599644 4.629458 -0.565603 -0.902895 0.230191 -0.067388 -0.609688 -0.846428 0.611048 0.621409 0.338288
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.017704 3.817285 2.558116 1.143633 2.890573 0.917720 -3.655461 -2.141578 0.591090 0.621354 0.341030
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 10.102933 0.605529 10.293508 0.691102 4.266637 1.354734 1.193037 0.870563 0.042315 0.628648 0.418842
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.138085 -0.533154 2.001587 1.177112 1.031335 0.462921 0.715592 0.081022 0.604399 0.618617 0.340516
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.944455 1.020571 0.081655 0.941072 0.142368 1.361919 2.688721 0.054716 0.607576 0.616554 0.342259
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 9.699872 -0.990055 10.059234 -0.870633 4.331259 -0.316739 0.856559 -0.631228 0.036507 0.613758 0.414462
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.167457 -0.424968 -0.675780 -0.197653 -0.078466 -0.653384 1.076531 3.590828 0.592523 0.602131 0.357886
131 N11 not_connected 100.00% 0.00% 44.22% 0.00% -0.883160 12.465687 -0.338379 5.571755 -0.762024 3.610531 -1.381926 0.750369 0.555133 0.227808 0.395402
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.731787 -0.356406 -0.461583 -0.927363 -0.410290 -0.505823 -0.211544 -0.318265 0.546163 0.546550 0.340846
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.379274 -0.887996 -0.889019 -0.553122 -0.683519 -1.037989 -0.614621 0.423190 0.528660 0.544823 0.344805
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.055158 13.931196 5.252837 5.644566 4.262448 4.387057 1.010414 1.660512 0.041649 0.034490 0.004037
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.878635 -1.304920 -0.733970 -1.077200 0.573019 0.086677 -0.114472 -0.240983 0.520983 0.539094 0.357144
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.270012 -0.385284 9.797799 -0.383468 4.329018 0.216982 2.281224 0.307111 0.040843 0.547157 0.399835
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 35.277263 62.958530 24.369823 26.327091 8.459830 9.567641 777.187609 767.334623 0.016305 0.016210 0.000747
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.508940 -0.051180 0.724835 -0.950371 0.354800 -0.994327 -1.839172 0.593266 0.568380 0.574027 0.334453
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 6.025227 -0.741849 -0.635511 -0.435358 10.970157 0.220070 146.375385 15.886762 0.567159 0.604784 0.334123
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.418600 -0.129035 0.033380 0.196882 0.665580 -0.222336 -0.311437 -1.804598 0.600391 0.610571 0.336127
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.373448 12.793059 -0.396731 10.561776 0.992682 4.414650 21.016724 2.824906 0.606457 0.048613 0.492216
143 N14 RF_maintenance 100.00% 99.78% 100.00% 0.00% 10.633108 12.593989 9.944437 10.530707 3.979943 4.434791 1.106032 2.733358 0.113702 0.032266 0.067348
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.191353 -0.495301 -0.569700 -0.596662 0.479126 0.074886 -0.552648 -0.635541 0.616052 0.627051 0.343591
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.687787 0.309067 0.443338 0.104180 0.396567 1.326974 1.094779 0.440925 0.610405 0.619815 0.341784
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.622690 -0.775580 -1.086081 -0.699934 -0.897078 -1.046237 -0.656724 -0.900751 0.579601 0.598668 0.342446
147 N15 digital_ok 100.00% 99.68% 99.62% 0.00% 184.213980 183.253538 inf inf 1338.997049 1336.451718 8190.453938 8276.640647 0.194937 0.196920 0.136064
148 N15 digital_ok 100.00% 99.46% 99.46% 0.00% 214.423840 214.061420 inf inf 1390.023731 1370.413731 7917.058973 7670.225307 0.357934 0.377423 0.220913
149 N15 digital_ok 100.00% 99.41% 99.24% 0.00% nan nan inf inf nan nan nan nan 0.322075 0.435486 0.317728
150 N15 digital_ok 100.00% 99.41% 99.30% 0.00% nan nan inf inf nan nan nan nan 0.372225 0.352204 0.263249
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 16.205415 -0.583515 -0.528793 0.973661 0.543656 0.108328 -1.049683 12.459180 0.437463 0.527861 0.304884
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.715053 -0.900054 9.935997 -0.687962 4.334153 0.304030 3.194033 0.287876 0.042243 0.542912 0.407493
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.592437 12.649670 7.235611 10.386549 -0.134868 4.451458 2.550095 3.239374 0.440796 0.039903 0.333921
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.984827 0.259552 0.462540 0.763656 0.768849 1.437965 0.013717 0.069032 0.544694 0.562677 0.348769
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.363251 -1.090445 -1.068105 -0.995669 0.116818 0.056837 3.838306 13.813854 0.563770 0.580013 0.349765
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.372153 18.949254 -0.349361 -0.429967 -0.637315 0.734652 0.382126 1.112307 0.540751 0.463162 0.312397
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 10.552678 -0.930233 10.042308 -0.484916 4.302295 0.889116 1.199659 0.207729 0.045673 0.600831 0.468727
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.455411 26.909850 0.399631 0.154147 1.191677 -0.269152 -0.140621 0.744004 0.593413 0.491271 0.313470
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.008581 -0.845359 -0.100568 -0.819848 -0.819524 -0.078919 1.810678 -0.799625 0.604682 0.617120 0.342985
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.883331 1.518810 0.274312 0.551702 1.014380 1.665398 0.099979 0.982725 0.609418 0.619688 0.345167
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.619192 1.415660 0.985077 1.179945 0.711540 1.772715 0.410194 1.504994 0.603983 0.613735 0.336905
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 19.301282 0.097685 0.189761 -0.443849 0.402743 0.334910 1.763687 -0.307529 0.502028 0.614403 0.333986
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.369105 0.027826 1.006070 0.354474 1.060042 -0.324054 0.280909 -1.936654 0.594729 0.606666 0.339453
167 N15 digital_ok 100.00% 99.46% 99.30% 0.00% nan nan inf inf nan nan nan nan 0.258244 0.312404 0.198036
168 N15 digital_ok 100.00% 99.57% 99.57% 0.00% nan nan inf inf nan nan nan nan 0.279404 0.225372 0.244697
169 N15 digital_ok 100.00% 99.46% 99.24% 0.00% nan nan inf inf nan nan nan nan 0.306157 0.336747 0.274946
170 N15 digital_ok 100.00% 99.41% 99.51% 0.00% 189.526241 190.347995 inf inf 1492.051651 1479.071845 8917.974217 8807.384439 0.312108 0.254989 0.239910
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.626403 -0.873421 0.383048 -0.583344 -0.682314 -0.710425 0.235909 0.332014 0.514375 0.548433 0.347961
172 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.053000 1.475939 2.158780 0.770392 2.358280 0.202104 -2.975220 0.047057 0.537104 0.542707 0.345653
173 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.614113 5.483590 2.851821 2.898635 3.397106 3.580268 -4.045897 -2.825669 0.505403 0.505315 0.333643
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.470253 -1.006604 0.009239 -0.772454 0.989383 0.602849 -0.351113 3.215344 0.561376 0.579446 0.351307
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.118224 13.408354 -0.895852 10.662283 0.234709 4.393709 16.152214 3.495944 0.579184 0.054660 0.473633
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.894519 0.911236 1.358098 0.975233 1.179924 1.087567 0.018035 5.782151 0.586056 0.598506 0.349118
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.464333 12.610832 -0.180950 10.331036 -0.898869 4.439749 2.031909 3.271779 0.599209 0.050643 0.447288
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.480758 0.291297 0.513275 0.883763 1.518814 1.241731 0.413388 0.195622 0.592541 0.603787 0.336178
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 15.743340 -0.329264 7.820796 -0.396197 2.441368 0.340259 3.621414 -0.336678 0.388203 0.611256 0.369791
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.184183 -0.052721 -1.033441 -0.114186 -0.392095 0.271123 -0.564626 0.469811 0.603221 0.609164 0.343043
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.695730 -1.025224 0.033094 -0.446104 -0.605783 -0.767620 -1.504134 -0.914361 0.597069 0.606263 0.345544
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.167356 -0.213643 -0.328996 -0.081814 0.342804 -0.495649 4.361823 -0.544859 0.586890 0.596053 0.347975
189 N15 digital_ok 100.00% 99.51% 99.41% 0.00% nan nan inf inf nan nan nan nan 0.355880 0.350028 0.275705
190 N15 digital_ok 100.00% 99.41% 99.41% 0.00% 210.815167 210.907916 inf inf 1872.880001 1873.277097 12539.738957 12550.233299 0.268983 0.273291 0.251205
191 N15 digital_ok 100.00% 99.41% 99.41% 0.00% 195.443661 195.225960 inf inf 1712.284403 1699.388026 10993.556180 10920.346212 0.234033 0.290243 0.223437
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.889013 5.890289 2.627597 3.066400 3.087258 3.758581 -3.577850 -4.069348 0.519158 0.509477 0.331942
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.124374 5.183684 3.075297 2.823377 3.600045 3.519344 -4.159083 -3.809211 0.501248 0.503431 0.331583
200 N18 RF_maintenance 100.00% 100.00% 33.35% 0.00% 11.536337 32.346704 5.301155 0.094305 4.323191 1.972316 2.544677 2.677499 0.040071 0.225457 0.147336
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.068848 4.488384 1.820118 2.602760 1.711405 3.100636 -2.010690 -3.516227 0.566784 0.558935 0.340792
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.974447 0.253247 0.755914 -0.643341 0.337681 0.366231 -1.925463 51.128388 0.580527 0.576839 0.336509
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.229758 11.122782 1.580537 -0.738957 1.314242 0.048195 24.368449 1.164095 0.587409 0.598546 0.341762
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.451509 -0.997774 3.481463 -1.009876 1.177622 -0.282625 3.581475 4.725021 0.407907 0.586151 0.396317
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.134827 3.691262 0.815593 2.923376 -0.420789 -0.167078 0.125968 0.823295 0.526921 0.482615 0.325518
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.590452 -0.729881 -0.935274 -0.621428 -0.891936 -0.900475 6.736154 -1.159543 0.541021 0.570883 0.345529
208 N20 dish_maintenance 100.00% 99.57% 99.57% 0.00% 201.983546 202.102403 inf inf 1486.121519 1474.794393 7968.235212 8038.626995 0.276022 0.256915 0.232240
209 N20 dish_maintenance 100.00% 99.41% 99.51% 0.00% nan nan inf inf nan nan nan nan 0.264370 0.261682 0.176895
210 N20 dish_maintenance 100.00% 99.08% 99.08% 0.00% nan nan inf inf nan nan nan nan 0.553451 0.509297 0.245902
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.322040 13.205281 -0.828691 5.691354 -0.534079 4.395777 -0.248409 2.023909 0.527134 0.039246 0.428211
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.638333 -0.541602 0.010578 -0.590334 -0.851108 -0.834827 2.281869 -1.270806 0.568968 0.568183 0.340335
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.877858 -0.505805 -1.034420 -0.788072 -0.567213 -1.070965 2.851527 -0.671426 0.562817 0.575131 0.340280
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.355320 0.070283 -0.391756 -0.108180 -0.897411 -0.579918 2.780222 -1.088014 0.564867 0.578754 0.341554
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.332870 0.847207 -0.588729 1.811304 -0.637815 -0.450201 0.075171 12.242098 0.558127 0.525662 0.343561
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.440792 5.437597 3.244487 2.968317 3.776004 3.592917 -4.369930 -3.731876 0.532870 0.542398 0.335660
225 N19 RF_ok 100.00% 99.68% 99.41% 0.00% nan nan inf inf nan nan nan nan 0.285741 0.376763 0.325940
226 N19 RF_ok 100.00% 99.73% 99.78% 0.00% nan nan inf inf nan nan nan nan 0.248604 0.242911 0.224337
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.914583 -0.031093 2.335889 -0.749622 -0.441322 -1.022904 11.418047 1.314398 0.469126 0.545821 0.361201
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.693596 -0.341985 0.333436 -0.990108 -0.331317 -0.415389 -0.248697 0.321815 0.541080 0.535340 0.336785
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.617137 1.078016 0.269802 0.790917 -0.118392 0.446731 -0.774579 -2.268288 0.535332 0.537818 0.348615
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.949026 -0.795825 0.481753 -1.056498 0.023553 -0.420126 0.831606 -0.888161 0.510093 0.549187 0.349205
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.345506 -0.133181 0.374883 0.277374 -0.276740 -0.482628 -1.744229 -1.715395 0.558709 0.562876 0.348424
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.475185 -0.109020 -0.104551 0.061825 -0.350009 -0.566027 -0.925541 0.088617 0.558099 0.563264 0.347410
240 N19 RF_maintenance 100.00% 99.62% 99.62% 0.05% 193.296882 192.531990 inf inf 1419.213921 1416.335634 7467.358442 7431.647886 0.253757 0.390611 0.324562
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.062035 -0.750420 -0.534095 -0.112312 -1.138748 -0.673305 0.781349 -1.391502 0.556095 0.564806 0.355436
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 15.846155 0.756773 -0.475927 0.602694 0.509192 0.268238 -0.748611 -1.115755 0.429757 0.557824 0.343026
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 14.144958 -1.055324 0.434246 -1.008582 1.507176 -0.508070 1.131386 -0.198505 0.444510 0.547205 0.341537
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.446641 -0.812856 -0.226780 -0.692373 -0.363655 -0.883579 1.628481 3.894083 0.525002 0.544041 0.341107
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.588659 0.030781 0.488203 -0.593695 -0.023553 -0.996659 -2.250410 -0.071625 0.542151 0.540122 0.343793
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.094548 13.746729 -0.877345 5.275706 -0.791272 4.434921 -0.749158 0.928419 0.523348 0.039156 0.424294
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% -0.039407 0.084306 -0.108377 -0.405169 -0.582899 -0.879237 5.606185 -0.458201 0.531019 0.531169 0.341912
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 10.050464 12.567056 0.222529 0.324994 1.323185 0.876879 -0.012957 1.561616 0.540639 0.539491 0.358664
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.364545 1.447311 1.570388 0.787620 1.322978 0.629116 -2.783294 -0.385230 0.445873 0.436379 0.321859
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 2.286309 2.861355 0.625383 0.915751 0.078197 0.745544 -1.850685 -2.255460 0.434034 0.429972 0.310838
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.316604 -0.988693 0.501191 -0.949404 -0.102877 -0.708083 -2.143684 -0.139063 0.466849 0.457304 0.334480
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.665000 -0.008581 0.347446 -0.572023 -0.418608 -0.943362 -0.382050 -1.121969 0.441127 0.439964 0.318162
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.986317 0.798956 -0.290690 -0.813312 -0.513150 -0.645548 0.565138 -0.175583 0.417964 0.429945 0.304605
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, 15, 16, 17, 18, 20, 27, 28, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 49, 51, 52, 53, 54, 55, 58, 59, 60, 63, 65, 66, 67, 68, 69, 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, 120, 121, 122, 123, 124, 127, 131, 134, 136, 137, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 165, 167, 168, 169, 170, 172, 173, 180, 181, 182, 184, 187, 189, 190, 191, 192, 193, 200, 201, 202, 204, 205, 207, 208, 209, 210, 211, 223, 224, 225, 226, 227, 240, 242, 243, 246, 261, 262]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.1.1.dev3+gb291d34
3.2.3.dev158+gd5cadd5
In [ ]: