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 = "2460032"
data_path = "/mnt/sn1/2460032"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 3-28-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/2460032/zen.2460032.21268.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 1852 ant_metrics files matching glob /mnt/sn1/2460032/zen.2460032.?????.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/2460032/zen.2460032.?????.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 2460032
Date 3-28-2023
LST Range 6.922 -- 16.889 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1852
Total Number of Antennas 199
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 94
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 199 (0.0%)
Antennas in Commanded State (observed) 0 / 199 (0.0%)
Cross-Polarized Antennas 40, 42, 70, 72, 112
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 68 / 199 (34.2%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 125 / 199 (62.8%)
Redcal Done? ❌
Never Flagged Antennas 73 / 199 (36.7%)
A Priori Good Antennas Flagged 64 / 94 total a priori good antennas:
3, 5, 7, 15, 16, 17, 30, 31, 37, 38, 40, 42,
45, 53, 54, 55, 56, 65, 66, 69, 70, 71, 72,
81, 83, 86, 93, 94, 101, 103, 109, 111, 112,
118, 121, 122, 123, 124, 127, 136, 140, 145,
147, 148, 149, 150, 151, 158, 161, 164, 165,
167, 168, 169, 170, 173, 182, 184, 189, 190,
191, 192, 193, 202
A Priori Bad Antennas Not Flagged 43 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 50, 57, 61, 62,
64, 74, 89, 90, 95, 115, 125, 132, 133, 139,
185, 206, 207, 220, 221, 222, 223, 228, 229,
237, 238, 239, 240, 241, 244, 245, 261, 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_2460032.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.629956 12.507525 0.368847 12.794925 1.195300 5.565527 -0.787907 0.893303 0.539787 0.044689 0.473434
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.978392 18.733057 -0.815653 -0.368041 -0.833256 2.339060 -1.143983 12.835285 0.552179 0.434125 0.356792
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.042844 12.339554 12.141471 12.506182 5.328701 5.646293 0.115477 0.152841 0.037933 0.032437 0.001840
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.765822 0.416622 -0.753570 0.173572 0.246182 0.889720 8.827005 10.085844 0.561301 0.568274 0.351840
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.032785 -0.686648 0.218934 0.493060 0.737663 1.346914 0.224067 1.294262 0.555672 0.564718 0.344960
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.851891 -0.116274 3.892790 -0.604823 1.125306 0.106980 1.394654 -0.644814 0.541800 0.562916 0.349446
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.752151 -1.087668 0.150272 -0.908030 -0.852758 0.211146 1.001125 -0.360860 0.552484 0.554189 0.345506
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 21.937702 0.718581 0.885701 0.300151 2.771366 0.904518 -0.043722 1.567325 0.429531 0.563012 0.355207
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.510383 12.889153 -0.355706 12.797790 1.252822 5.547606 0.343774 1.655185 0.567933 0.039258 0.479955
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.026422 4.672691 1.182938 10.795883 1.229092 1.231652 -0.492841 2.855756 0.569383 0.402614 0.409109
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.222826 5.829220 12.165578 1.144637 5.299087 2.352044 0.269453 32.003150 0.036700 0.365843 0.289277
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.160212 -0.860925 -0.381012 -0.984565 0.424939 0.948005 -0.644526 1.893739 0.576843 0.583776 0.349193
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.212793 -0.593629 2.620245 -0.508382 1.869335 -0.552737 0.856950 -0.472261 0.562443 0.580312 0.345722
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.600144 0.492639 0.006806 0.458881 1.065342 1.636930 0.216947 0.335854 0.556508 0.558762 0.338293
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.765641 -0.442476 -0.282162 -0.448571 -0.008965 2.031857 -0.623202 -0.457380 0.531574 0.538858 0.341508
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.242756 26.336216 11.627775 6.961404 4.232466 3.494254 9.345736 34.968884 0.073985 0.073869 -0.030710
28 N01 RF_maintenance 100.00% 100.00% 2.86% 0.00% 9.547412 15.816665 12.055739 4.631245 5.319891 2.159218 0.982347 29.308795 0.031574 0.250498 0.186022
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.849499 -0.249821 -0.741076 -0.502436 0.375241 0.477707 0.308999 0.133104 0.584311 0.587043 0.352602
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.762070 -0.452116 0.950964 -0.994055 2.446759 0.069817 4.758175 -0.532498 0.577213 0.594542 0.353094
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.050622 -0.265745 1.547478 2.680823 2.364628 -0.057250 -0.161900 16.097559 0.588034 0.586310 0.345528
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.954672 19.120695 -0.208987 -0.176153 -0.004390 0.009181 7.394167 5.313381 0.476137 0.502026 0.211589
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.936074 13.048128 6.540960 6.784305 5.248786 5.584524 1.643245 2.937171 0.035076 0.050321 0.009695
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.279796 -0.873142 0.269870 -0.800321 -0.661834 -0.105137 1.160958 0.115592 0.542083 0.536391 0.339358
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.491977 6.744633 1.482036 1.116460 1.766587 1.884697 -0.101965 0.509317 0.544252 0.541534 0.363912
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.743317 20.152052 -0.337635 14.870669 -0.904841 5.637867 -0.853694 2.376588 0.540231 0.033196 0.429394
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.190146 1.687574 -0.201440 0.156660 0.424107 -0.533435 2.168063 8.620062 0.568113 0.545308 0.361951
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.142364 1.303550 0.118594 -0.537803 0.598688 0.555554 6.976729 1.708574 0.231465 0.224268 -0.277062
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.835451 1.599232 1.788599 2.095184 3.067774 0.482785 0.038834 0.343817 0.579490 0.587095 0.354492
42 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.273144 4.116532 -0.300614 2.243279 0.885143 2.806262 -0.265466 1.309891 0.252947 0.236599 -0.275828
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.337968 0.176791 -0.574187 1.062398 -0.811424 1.348651 -1.101842 0.165533 0.591354 0.596188 0.346426
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.416817 0.886994 -1.078747 0.621377 -0.595630 0.713985 -0.634952 -0.114066 0.592641 0.604159 0.348566
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.468518 2.151468 1.112099 1.078514 0.277771 2.107494 0.200930 6.599686 0.578520 0.588883 0.342716
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.236610 -0.067712 0.055663 -0.996615 0.173726 -0.487680 -0.295429 -0.513919 0.581126 0.597509 0.355512
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.099303 12.780571 6.436832 6.396132 5.232488 5.534235 2.129483 0.785784 0.031683 0.053449 0.014401
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.232350 0.890520 -0.585748 1.281858 -0.995300 1.556248 -1.040431 -1.635874 0.542502 0.554758 0.342810
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.504050 -0.002672 0.662294 -0.516542 -0.497469 -0.952815 -0.008145 1.771894 0.509499 0.533538 0.340786
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.821600 1.419567 0.564887 2.102106 0.241739 2.041447 0.424780 0.677414 0.545167 0.540785 0.359705
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.853451 1.727465 0.149407 -0.429689 1.864022 0.761879 62.632068 1.035194 0.555880 0.558731 0.358114
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.022852 5.132722 0.787799 0.440622 1.500225 1.302778 1.547660 0.023386 0.571091 0.572437 0.357375
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.426861 1.538794 0.043886 -0.295691 1.960824 -0.432161 6.893357 4.962490 0.576189 0.585429 0.359613
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 6.036841 3.512581 2.434083 -0.182339 2.650625 1.275575 -1.347337 0.087422 0.309408 0.352259 0.149592
55 N04 digital_ok 100.00% 15.60% 100.00% 0.00% 0.703727 44.717578 0.791757 8.497972 0.137592 6.191786 1.575381 0.660517 0.247269 0.041583 0.100317
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.657870 1.657495 -0.871874 2.618414 -0.768990 2.871827 -0.901958 5.998946 0.593081 0.590479 0.340054
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.240098 0.343765 -0.461390 -0.591691 -0.457050 0.422492 0.257401 1.479633 0.598381 0.602797 0.342866
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.016951 11.981318 12.107163 12.709328 5.218133 5.558084 1.250839 1.210530 0.037821 0.036874 0.001944
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.007600 0.923349 12.157300 1.511296 5.124370 2.803330 1.110426 3.191048 0.046524 0.595144 0.446475
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.419674 11.938776 0.168436 12.743099 0.898572 5.551496 0.915868 2.744309 0.582247 0.071886 0.463749
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.694121 -0.688321 0.921961 -0.805966 1.173943 -0.338961 1.065624 0.997412 0.525059 0.561214 0.343382
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.353992 1.019551 -0.048756 0.935704 -0.690920 -0.112446 0.809502 -0.545232 0.526294 0.557071 0.343470
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.055703 12.392889 -0.711581 6.833612 -0.667755 5.626011 -0.687018 1.767540 0.542975 0.045798 0.421346
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.397027 -0.400631 -1.150621 -0.190575 -0.892379 -0.710737 0.872969 2.073550 0.530590 0.522291 0.335982
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 21.093815 20.005467 15.363766 15.330422 5.370848 5.713935 2.977735 4.101464 0.023578 0.032500 0.009126
66 N03 digital_ok 100.00% 29.70% 100.00% 0.00% 2.787245 20.579648 2.363776 15.519015 2.093797 5.611484 -1.655419 4.679686 0.213987 0.047348 0.109994
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.519820 -0.110317 -1.020924 1.168294 -0.654739 1.246829 3.911554 1.503637 0.572967 0.573899 0.352750
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 22.604188 0.769317 15.477045 0.827288 5.216671 0.258137 3.703122 -1.026334 0.034792 0.585104 0.445716
69 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 1.137043 4.869566 1.754876 -0.774754 0.236572 0.959831 1.364132 0.705646 0.587033 0.595048 0.346664
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% 0.226729 2.304950 1.540642 3.456414 2.203485 2.418054 3.447886 1.026811 0.256433 0.239436 -0.273872
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.251235 0.162937 -0.368994 0.450901 0.386003 0.102510 -0.440829 0.773570 0.597068 0.609760 0.344561
72 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.709403 1.465949 3.043439 1.388087 1.313224 1.265827 10.603545 1.274435 0.261064 0.252762 -0.274922
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.378501 1.653333 -0.758567 0.898572 1.003498 4.286508 0.074599 1.114070 0.603065 0.610899 0.347114
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.796599 0.258782 -0.295851 -0.144765 -0.661922 1.051802 -0.430765 1.724345 0.598307 0.609788 0.349397
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 40.003302 12.727616 0.609842 -0.503457 3.004810 0.548393 7.967886 2.173205 0.328861 0.475390 0.261390
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 22.125244 0.705438 -0.097694 1.087556 0.756590 0.449222 3.061102 -0.632647 0.393631 0.562955 0.336650
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.411605 12.599740 -0.657308 6.820513 -0.304054 5.501341 -0.289357 -0.156015 0.534313 0.040723 0.423845
80 N11 not_connected 100.00% 0.00% 81.70% 0.00% -0.056558 12.477226 0.042632 6.533357 -0.825188 3.611403 -1.202878 0.730044 0.537749 0.107527 0.420739
81 N07 digital_ok 100.00% 23.92% 100.00% 0.00% 3.477731 13.215727 1.600748 12.386017 19.741537 20.158984 -1.587504 5.198874 0.400624 0.043218 0.309123
82 N07 RF_maintenance 100.00% 23.92% 23.92% 0.00% 3.961316 3.788330 2.365466 1.888268 20.109097 19.840170 -1.913752 -2.026207 0.413043 0.414643 0.261802
83 N07 digital_ok 100.00% 23.92% 23.92% 0.00% 4.725626 3.922589 2.437481 2.137338 20.146737 19.963921 -1.993820 -2.238058 0.422002 0.424275 0.261286
84 N08 RF_maintenance 100.00% 67.33% 100.00% 0.00% 16.036096 21.800067 14.904846 15.675603 3.564819 5.563125 2.598581 3.226088 0.198475 0.037742 0.131751
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.687477 1.708648 -1.089205 -1.059252 -0.862965 0.659036 -1.049798 1.042538 0.595149 0.596404 0.345254
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.433312 1.374744 0.718303 0.240070 1.434718 1.076367 0.141568 10.487293 0.592812 0.603534 0.338932
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.245724 5.864659 1.285896 0.294548 6.746670 1.182119 8.254825 2.107423 0.557978 0.618408 0.328467
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.911828 1.351674 1.060501 1.644908 0.741375 -0.532013 0.795780 0.262413 0.596407 0.605480 0.335399
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.760756 0.778146 0.996864 1.467100 0.204703 0.764288 -0.649556 -0.379494 0.593402 0.608483 0.341786
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.157049 -0.236865 -0.534599 -0.483593 -0.411676 -1.105781 -0.509995 0.726605 0.583820 0.611640 0.346396
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.356821 0.540944 1.233629 0.888920 0.772982 0.630823 -0.018022 -0.247496 0.581724 0.602029 0.351193
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.510185 0.485439 12.112976 0.615701 5.323868 1.796995 -0.033788 0.131664 0.036783 0.594778 0.398225
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.769761 12.146400 12.235927 12.811588 5.170661 5.519424 1.498901 1.187804 0.031286 0.024969 0.003372
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.416295 12.415263 12.366198 12.609812 5.234198 5.567244 0.402419 0.371250 0.025333 0.025385 0.001032
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.518613 1.595122 -0.891163 0.646669 1.555949 0.934634 -0.843638 -0.791653 0.408624 0.403561 0.178249
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.716528 20.055303 1.051781 -0.335297 -0.108297 0.512137 -1.346239 2.301535 0.547237 0.446253 0.336014
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.120498 2.375875 -1.197641 0.674946 -0.858128 -0.755627 0.882007 7.747786 0.528815 0.513394 0.340526
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.804864 6.957934 0.344682 1.564462 0.849905 1.674692 -0.367677 0.384186 0.580871 0.585595 0.346500
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.581359 0.787669 -0.841175 -0.964688 0.335730 0.578056 -1.022638 4.317024 0.592523 0.598090 0.343190
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.895193 4.214615 2.986732 -0.739443 2.859188 1.176435 -1.795889 11.231921 0.575788 0.606436 0.343270
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.004134 47.699388 0.660794 8.103091 3.262406 -0.006927 1.005478 1.345822 0.600740 0.584048 0.338030
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.397837 0.969092 0.740451 1.538434 1.592874 0.518846 -0.506136 -0.282121 0.600592 0.608934 0.336819
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.983245 1.263640 0.043627 0.217527 -0.170671 -0.470247 -0.119809 0.036739 0.600279 0.612432 0.339593
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.456868 1.118648 0.546440 -0.020830 1.304604 0.580694 2.655485 3.224659 0.594697 0.608972 0.340513
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.559706 33.384688 12.153761 1.709433 5.238761 1.912464 0.935713 0.908914 0.035766 0.297606 0.151574
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.300065 12.011463 12.198326 12.479726 5.280352 5.638357 0.074404 1.128952 0.063679 0.036675 0.019566
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 21.525087 0.101582 0.706428 -0.106529 3.548299 0.244163 20.232428 -0.540628 0.487675 0.592127 0.336411
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 9.768416 11.950948 1.380805 12.574242 3.195374 5.620360 22.774205 1.426484 0.525893 0.059350 0.390092
112 N10 digital_ok 100.00% 1.08% 1.08% 98.92% 0.649875 6.470217 2.126494 11.238451 2.668592 2.699755 0.447793 0.350331 0.227330 0.134620 -0.220633
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.151309 13.122974 6.143684 6.812557 5.145701 5.484576 0.982960 0.464849 0.034276 0.030965 0.002057
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 11.871239 0.816396 6.317315 -0.167273 5.126194 -0.938356 -0.051589 -0.253102 0.045795 0.540384 0.412069
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.209000 -0.856913 -1.150806 -0.321836 -1.002097 -1.143094 -0.780326 0.007955 0.514934 0.528365 0.345264
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.176538 13.264261 13.294304 14.068982 19.311812 20.012910 6.142528 5.657730 0.027142 0.032040 0.003601
118 N07 digital_ok 100.00% 23.92% 23.92% 0.00% 0.415834 2.986732 -0.743403 1.507463 19.288440 19.722759 -1.169552 -1.980350 0.435244 0.426371 0.267393
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.575162 1.190190 3.468292 -0.726828 1.476772 0.748346 4.849344 2.137869 0.575562 0.595906 0.343809
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.501490 2.989267 -1.087349 6.920311 -0.238137 0.457341 1.974322 11.558314 0.598129 0.581828 0.336154
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.384933 4.961170 -0.515999 -0.929922 0.511475 0.485091 -0.633139 -0.763235 0.607675 0.613498 0.339979
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.669161 7.109242 1.376046 1.557659 1.777935 1.142348 -0.564849 -0.033777 0.608011 0.614509 0.340830
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 9.621863 0.518264 12.416237 1.082774 5.141191 1.415971 0.238648 0.736629 0.042267 0.616938 0.411530
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.788657 0.138119 1.947631 1.588405 1.378920 -0.148642 -0.101112 0.428687 0.597458 0.605908 0.342999
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.149144 4.882447 0.326020 1.758831 1.933184 1.157503 3.890738 0.721020 0.587579 0.603678 0.345840
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 9.187000 0.968768 12.108308 1.089003 5.313032 4.029657 -0.068196 1.941729 0.034815 0.598875 0.394248
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.402305 -0.491045 -0.661342 -0.177034 -0.287736 -0.476107 0.173881 2.530654 0.583012 0.591658 0.361012
131 N11 not_connected 100.00% 0.00% 48.16% 0.00% -0.866492 11.721550 -0.302111 6.691839 -0.938502 4.857190 -1.138925 -0.000294 0.544999 0.220425 0.394446
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.859010 -0.057739 -0.372818 -0.947018 -0.740133 -0.301503 -0.150187 -0.212936 0.537172 0.531856 0.341260
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.256055 -0.971978 -0.899720 -0.583622 -0.615451 -0.876943 -0.780189 0.317084 0.521511 0.535212 0.348235
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.771577 13.181773 6.293549 6.782400 5.136772 5.520779 -0.007648 0.448471 0.041506 0.034940 0.003666
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.170559 -0.956359 -0.830728 -1.218807 1.191641 0.569881 5.023692 -0.391807 0.519659 0.537365 0.360219
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 8.760018 5.957590 11.795342 0.058308 5.312582 0.501083 0.892137 0.755721 0.040263 0.530299 0.380154
137 N07 RF_maintenance 100.00% 23.92% 23.92% 0.00% 4.215866 3.775753 2.150749 1.900090 19.938196 19.898916 -1.813435 -1.743330 0.408913 0.417812 0.260940
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.117955 -0.034985 1.034349 -1.044783 0.421384 -0.981390 -0.291398 1.132416 0.565018 0.568861 0.335475
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.150796 -0.669557 -0.136843 -0.440384 1.468480 -0.542234 17.751562 3.765995 0.582035 0.599950 0.339791
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.204321 -0.351023 0.279337 0.382486 1.408858 -0.212422 -0.232731 -1.296302 0.594101 0.603782 0.337818
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.576469 12.003326 -0.273224 12.754495 2.160022 5.599728 13.493057 1.757044 0.598244 0.046748 0.488875
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.146765 11.895801 11.998682 12.721909 4.739882 5.578108 0.164179 1.086549 0.100516 0.032351 0.056057
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.266327 -0.069737 -0.486628 -0.726810 0.481694 1.572446 -0.710789 -0.714034 0.605659 0.617448 0.347042
145 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.243769 0.501292 0.056349 0.026121 -0.290980 6.059799 -0.374854 0.404341 0.601834 0.607752 0.346335
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.355451 -0.645070 -1.182317 -0.811015 -0.921764 -0.916007 -0.478975 -0.846784 0.568581 0.586649 0.345074
147 N15 digital_ok 100.00% 98.33% 98.33% 0.11% 185.500765 185.693876 inf inf 2250.626979 2250.663015 3521.666094 3521.733318 0.490549 0.505352 0.412197
148 N15 digital_ok 100.00% 98.38% 98.38% 0.05% 148.279513 149.224050 inf inf 1545.198798 1542.869945 4949.747385 4978.012461 0.496316 0.507084 0.377894
149 N15 digital_ok 100.00% 98.60% 98.65% 0.05% 174.646284 174.749359 inf inf 1864.528086 1838.628465 5368.071658 5244.875118 0.450729 0.484275 0.397684
150 N15 digital_ok 100.00% 98.97% 98.92% 0.05% nan nan inf inf nan nan nan nan 0.416629 0.365842 0.337380
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 16.219330 -0.523565 -0.493914 1.379864 0.767248 0.455494 -0.057273 8.138854 0.422605 0.513450 0.305020
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.112385 -0.767230 11.961377 -0.645842 5.330152 -0.334913 1.353117 0.502752 0.042046 0.541640 0.405664
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.779970 11.848091 10.570563 12.534403 1.880050 5.654932 2.541016 1.768331 0.341117 0.040148 0.258533
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.919583 0.365428 0.745625 1.198588 0.778128 1.423906 -0.414416 -0.094725 0.542700 0.558510 0.351336
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.105893 0.043115 -1.183522 -1.166782 1.272743 0.451281 2.186624 10.897688 0.561075 0.568756 0.347547
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.383774 18.535440 -0.437201 -0.368296 -0.640850 0.782939 -0.304940 8.291352 0.536761 0.445832 0.312964
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.175974 -0.666133 0.239171 -0.356773 0.849375 1.538348 -0.671568 0.042650 0.579239 0.589859 0.343676
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.428362 24.844940 0.675591 0.328995 1.360560 -0.234875 -0.537566 0.229416 0.587371 0.480688 0.316737
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.589501 -0.814525 -0.132164 -0.976471 0.068245 0.529313 3.016280 -0.371760 0.598055 0.607943 0.345141
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.849448 1.723476 0.536381 0.846473 1.002800 2.220986 -0.106028 0.856425 0.601762 0.610254 0.349047
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.425327 1.401028 1.560831 1.679844 5.766043 2.933394 0.806341 1.162754 0.594524 0.603218 0.340281
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 20.423487 0.400037 0.547160 -0.339192 0.724712 0.420588 1.492226 -0.324202 0.471409 0.605662 0.334687
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.198179 -0.012568 1.380744 0.552658 1.104705 -0.363083 -0.009475 -1.174158 0.586907 0.597090 0.340724
167 N15 digital_ok 100.00% 98.87% 98.81% 0.00% 123.822737 124.704002 inf inf 1679.759097 1700.373340 4327.360793 4375.521098 0.449122 0.426305 0.428484
168 N15 digital_ok 100.00% 98.27% 98.11% 0.00% 148.889340 149.073932 inf inf 1562.869906 1510.619015 4693.769802 4905.486262 0.426555 0.465388 0.359487
169 N15 digital_ok 100.00% 98.81% 98.81% 0.05% 130.702243 131.334308 inf inf 1644.243195 1662.968628 4730.980954 4839.338342 0.345371 0.392944 0.285524
170 N15 digital_ok 100.00% 98.49% 98.38% 0.00% nan nan inf inf nan nan nan nan 0.348985 0.389792 0.341888
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.245568 -0.907559 0.617536 -0.559519 -0.675634 -0.523561 -0.470684 1.303248 0.501939 0.538243 0.351004
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.508488 0.637583 2.852607 1.060147 2.757020 -0.314314 -2.215453 0.089521 0.530335 0.539490 0.352668
173 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.044740 4.906521 3.744111 3.781923 4.349398 4.561463 -2.728924 -1.780365 0.498024 0.496464 0.337172
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.118632 0.157655 0.351770 1.568319 -0.348687 4.761886 -0.525509 5.502001 0.544578 0.567937 0.349295
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.100055 12.567874 -0.931646 12.882404 0.781682 5.527825 11.025379 1.910547 0.574650 0.053191 0.475643
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.660354 0.742021 1.688002 1.154309 0.264719 0.413003 0.030848 3.072457 0.582404 0.589761 0.350816
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.071488 11.802816 -0.532638 12.463295 -0.850718 5.654819 4.248734 1.659157 0.593200 0.048758 0.449233
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.172952 1.373592 0.213535 0.686688 1.612714 0.393367 0.070770 0.524808 0.584973 0.594239 0.336314
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 15.308215 -0.096692 8.943452 -0.527327 5.132882 -0.325015 4.989876 -0.197122 0.403281 0.602817 0.365864
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.072988 0.164077 -1.164331 -0.008003 -0.295344 -0.181977 -0.449433 0.432051 0.597017 0.601063 0.346760
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.682849 -0.851616 0.228204 -0.387840 -0.678202 -0.397244 -1.095000 -1.052798 0.591928 0.598491 0.346965
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.485491 -0.445448 0.137047 -0.088911 1.278273 0.151462 3.399158 -0.638635 0.580402 0.588198 0.350052
189 N15 digital_ok 100.00% 98.87% 98.65% 0.00% nan nan inf inf nan nan nan nan 0.442504 0.501187 0.413408
190 N15 digital_ok 100.00% 98.97% 98.92% 0.00% 180.551826 180.071718 inf inf 1731.118081 1758.585893 4682.833226 4899.827064 0.325012 0.405536 0.346315
191 N15 digital_ok 100.00% 98.97% 99.03% 0.11% 160.314047 160.919928 inf inf 1694.934499 1701.480211 4618.090761 4683.556016 0.401126 0.376174 0.344164
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.029678 5.269290 2.710580 3.972586 2.608029 4.618944 -1.876308 -2.595639 0.522748 0.500964 0.340838
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.493537 4.708290 4.005211 3.667372 4.301259 4.467651 -2.791333 -2.507353 0.493950 0.484251 0.330956
200 N18 RF_maintenance 100.00% 100.00% 38.71% 0.00% 10.955638 30.310729 6.331841 0.231122 5.322618 1.542042 1.042309 5.896455 0.042595 0.219262 0.141011
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.541758 3.932894 2.462561 3.393248 2.299499 3.889907 -1.524033 -2.297996 0.556632 0.550832 0.340357
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.761098 0.802831 1.123409 -0.580221 0.694704 0.644770 -1.072753 39.174499 0.573973 0.563817 0.339562
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.628736 11.241531 2.022270 -0.748998 0.270660 0.095812 11.454877 1.442776 0.582924 0.592637 0.346136
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.126622 -0.798373 4.082396 -1.139986 1.722468 -0.175448 2.109898 11.555214 0.410131 0.575874 0.392537
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.425889 3.848624 0.791147 3.663233 0.477149 0.514110 -0.148415 0.310943 0.528859 0.471544 0.334001
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.773430 0.944793 -0.934498 0.327088 -0.894931 0.516887 3.943470 -0.370056 0.555975 0.543551 0.341773
208 N20 dish_maintenance 100.00% 98.38% 98.33% 0.00% 184.777066 184.935996 inf inf 2212.777911 2207.691934 5511.772330 4966.409571 0.410473 0.439721 0.402081
209 N20 dish_maintenance 100.00% 98.81% 98.70% 0.05% 176.376308 176.794929 inf inf 1533.684818 1531.846540 4450.437815 4443.574011 0.408289 0.417397 0.375317
210 N20 dish_maintenance 100.00% 98.54% 98.76% 0.11% 163.784518 164.019827 inf inf 1682.625833 1670.502659 4169.943977 4108.858466 0.517316 0.442676 0.340777
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.047764 12.388421 -0.905310 6.847332 -0.567601 5.511844 -0.055003 0.760561 0.519690 0.039895 0.432386
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.804369 -0.803438 0.136257 -0.622916 -0.776515 0.008965 0.763118 -1.010205 0.562709 0.561167 0.343688
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.721870 -0.496851 -1.219463 -0.844832 0.294055 -0.985700 3.405090 -0.725468 0.555390 0.567587 0.343104
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.396086 -0.130038 -0.343293 -0.020979 -0.675460 -0.479246 3.642089 -0.845039 0.560994 0.572281 0.343658
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.093846 -0.818373 -0.610186 -0.084002 -0.839801 -0.840929 -0.007955 2.771841 0.553908 0.554871 0.337227
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.803320 4.822132 4.214158 3.845962 4.549577 4.451523 -2.822626 -2.389485 0.516715 0.538047 0.335164
225 N19 RF_ok 100.00% 0.00% 91.52% 0.00% -0.095602 11.976289 0.474078 6.578951 -0.839113 5.346155 -1.297436 1.068815 0.562020 0.137054 0.457042
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.746654 15.230026 -0.775005 0.208189 -1.055446 2.005189 -1.112679 0.025133 0.551251 0.461685 0.334090
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 2.312929 -1.130001 2.949046 -0.809915 -0.534382 -0.994960 8.996332 0.151938 0.457447 0.544436 0.371562
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.468417 -0.211731 0.550668 -1.042366 -0.123833 -0.451783 0.242765 0.637440 0.531214 0.525776 0.337829
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.460350 0.759725 0.491514 1.129008 -0.186991 0.669517 0.747530 -1.707511 0.531531 0.531470 0.353215
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.954379 -0.706743 0.720903 -1.128927 0.091693 -0.237696 0.307878 -0.692606 0.506652 0.540887 0.351915
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.694338 0.002672 0.984077 0.826428 0.072623 -0.557418 -1.686765 -1.611609 0.552533 0.554571 0.350641
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.444886 0.130502 0.002212 0.397429 -0.362080 -0.647311 -0.363291 0.746429 0.552262 0.556417 0.348275
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.395954 -0.086930 -0.110810 -1.013790 -0.777122 -1.239503 -0.721809 1.628904 0.551207 0.557053 0.348606
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.984204 -0.692665 -0.516920 -0.001030 -1.030915 -0.454471 -0.208986 -1.089437 0.554155 0.559395 0.357069
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 16.209487 0.497578 -0.399556 0.898921 0.779622 0.736114 1.012420 -0.429599 0.423298 0.552370 0.346442
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 13.416950 -1.119859 0.684796 -1.033140 2.621134 -0.381737 7.076504 -0.444298 0.453968 0.540990 0.345877
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.320946 -0.741983 -0.115591 -1.023850 -0.719790 0.344832 1.454321 3.633686 0.512746 0.540493 0.347723
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.126966 2.180357 0.326900 -1.113454 -0.483628 -0.990085 -1.646028 0.264298 0.540154 0.524241 0.346847
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.479171 12.914624 -0.965940 6.329512 -0.388778 5.614070 -0.863156 0.074252 0.520553 0.039448 0.431935
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.101175 -0.032790 0.001030 -0.331470 -0.673522 -1.009486 0.775855 -0.486111 0.527245 0.524658 0.345322
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 9.693962 12.482288 0.425717 0.495113 1.715527 0.365611 -0.413807 1.112013 0.537575 0.534780 0.363785
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.932476 1.015164 2.020605 1.070894 1.305647 0.458500 -1.576202 -0.187055 0.443369 0.445725 0.334767
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.954702 2.479357 0.884873 1.278895 0.234309 1.047850 -0.160794 -1.000278 0.428165 0.430367 0.320526
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.045314 -0.869380 0.755850 -0.949046 0.012469 -0.894473 -1.601500 -0.454483 0.463804 0.452490 0.341450
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.297615 0.176634 -0.293978 -0.559584 -0.788555 -0.925182 2.288837 0.143294 0.431566 0.436040 0.324908
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.062156 2.820347 -0.210287 -0.817368 -0.447507 -0.712481 1.356670 0.829138 0.410990 0.413060 0.305032
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 5, 7, 15, 16, 17, 18, 27, 28, 30, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 51, 52, 53, 54, 55, 56, 58, 59, 60, 63, 65, 66, 68, 69, 70, 71, 72, 73, 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, 126, 127, 131, 134, 135, 136, 137, 140, 142, 143, 145, 147, 148, 149, 150, 151, 155, 156, 158, 159, 161, 164, 165, 167, 168, 169, 170, 173, 179, 180, 182, 184, 189, 190, 191, 192, 193, 200, 201, 202, 204, 205, 208, 209, 210, 211, 224, 225, 226, 227, 242, 243, 246, 262]

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

golden_ants: [9, 10, 19, 20, 21, 29, 41, 44, 67, 85, 88, 91, 105, 106, 107, 128, 141, 144, 146, 157, 160, 162, 163, 166, 171, 172, 181, 183, 186, 187]
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_2460032.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.dev149+g96d0dd5
In [ ]: