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 = "2460043"
data_path = "/mnt/sn1/2460043"
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-8-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/2460043/zen.2460043.42158.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 918 ant_metrics files matching glob /mnt/sn1/2460043/zen.2460043.?????.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/2460043/zen.2460043.?????.sum.known_good.omni.calfits. Skipping redcal chisq.

Figure out some general properties¶

In [9]:
# Parse some general array properties, taking into account the fact that we might be missing some of the metrics
ants = []
pols = []
antpol_pairs = []

if use_auto_metrics:
    ants = sorted(set(bl[0] for bl in auto_metrics['modzs']['r2_shape_modzs']))
    pols = sorted(set(bl[2] for bl in auto_metrics['modzs']['r2_shape_modzs']))
if use_ant_metrics:
    antpol_pairs = sorted(set([antpol for dms in ant_metrics_dead_metrics.values() for antpol in dms.keys()]))
    antpols = sorted(set(antpol[1] for antpol in antpol_pairs))
    ants = sorted(set(antpol[0] for antpol in antpol_pairs) | set(ants))
    pols = sorted(set(utils.join_pol(ap, ap) for ap in antpols) | set(pols))
if use_redcal:
    antpol_pairs = sorted(set([ant for cspa in cspa_med_dict.values() for ant in cspa.keys()]) | set(antpol_pairs))
    antpols = sorted(set(antpol[1] for antpol in antpol_pairs))
    ants = sorted(set(antpol[0] for antpol in antpol_pairs) | set(ants))
    pols = sorted(set(utils.join_pol(ap, ap) for ap in antpols) | set(pols))

# Figure out remaining antennas not in data and also LST range
data_files = sorted(glob.glob(os.path.join(data_path, 'zen.*.sum.uvh5')))
hd = io.HERAData(data_files[0])
unused_ants = [ant for ant in hd.antpos if ant not in ants]    
hd_last = io.HERAData(data_files[-1])

Load a priori antenna statuses and node numbers¶

In [10]:
# try to load a priori antenna statusesm but fail gracefully if this doesn't work.
a_priori_statuses = {ant: 'Not Found' for ant in ants}
nodes = {ant: np.nan for ant in ants + unused_ants}
try:
    from hera_mc import cm_hookup

    # get node numbers
    hookup = cm_hookup.get_hookup('default')
    for ant_name in hookup:
        ant = int("".join(filter(str.isdigit, ant_name)))
        if ant in nodes:
            if hookup[ant_name].get_part_from_type('node')['E<ground'] is not None:
                nodes[ant] = int(hookup[ant_name].get_part_from_type('node')['E<ground'][1:])
    
    # get apriori antenna status
    for ant_name, data in hookup.items():
        ant = int("".join(filter(str.isdigit, ant_name)))
        if ant in a_priori_statuses:
            a_priori_statuses[ant] = data.apriori

except Exception as err:
    print(f'Could not load node numbers and a priori antenna statuses.\nEncountered {type(err)} with message: {err}')

Summarize auto metrics¶

In [11]:
if use_auto_metrics:
    # Parse modzs
    modzs_to_check = {'Shape': 'r2_shape_modzs', 'Power': 'r2_power_modzs', 
                      'Temporal Variability': 'r2_temp_var_modzs', 'Temporal Discontinuties': 'r2_temp_diff_modzs'}
    worst_metrics = []
    worst_zs = []
    all_modzs = {}
    binary_flags = {rationale: [] for rationale in modzs_to_check}

    for ant in ants:
        # parse modzs and figure out flag counts
        modzs = {f'{pol} {rationale}': auto_metrics['modzs'][dict_name][(ant, ant, pol)] 
                 for rationale, dict_name in modzs_to_check.items() for pol in pols}
        for pol in pols:
            for rationale, dict_name in modzs_to_check.items():
                binary_flags[rationale].append(auto_metrics['modzs'][dict_name][(ant, ant, pol)] > mean_round_modz_cut)

        # parse out all metrics for dataframe
        for k in modzs:
            col_label = k + ' Modified Z-Score'
            if col_label in all_modzs:
                all_modzs[col_label].append(modzs[k])
            else:
                all_modzs[col_label] = [modzs[k]]
                
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
else:
    mean_round_modz_cut = 0

Summarize ant metrics¶

In [12]:
if use_ant_metrics:
    a_priori_flag_frac = {ant: np.mean([ant in apxa for apxa in ant_metrics_apriori_exants.values()]) for ant in ants}
    dead_ant_frac = {ap: {ant: np.mean([(ant, ap) in das for das in ant_metrics_dead_ants_dict.values()])
                                 for ant in ants} for ap in antpols}
    crossed_ant_frac = {ant: np.mean([np.any([(ant, ap) in cas for ap in antpols])
                                      for cas in ant_metrics_crossed_ants_dict.values()]) for ant in ants}
    ant_metrics_xants_frac_by_antpol = {antpol: np.mean([antpol in amx for amx in ant_metrics_xants_dict.values()]) for antpol in antpol_pairs}
    ant_metrics_xants_frac_by_ant = {ant: np.mean([np.any([(ant, ap) in amx for ap in antpols])
                                     for amx in ant_metrics_xants_dict.values()]) for ant in ants}
    average_dead_metrics = {ap: {ant: np.nanmean([dm.get((ant, ap), np.nan) for dm in ant_metrics_dead_metrics.values()]) 
                                 for ant in ants} for ap in antpols}
    average_crossed_metrics = {ant: np.nanmean([cm.get((ant, ap), np.nan) for ap in antpols 
                                                for cm in ant_metrics_crossed_metrics.values()]) for ant in ants}
else:
    dead_cut = 0.4
    crossed_cut = 0.0

Summarize redcal chi^2 metrics¶

In [13]:
if use_redcal:
    cspa = {ant: np.nanmedian(np.hstack([cspa_med_dict[cal][ant] for cal in redcal_files])) for ant in antpol_pairs}
    redcal_prior_flag_frac = {ant: np.mean([np.any([afd[ant, ap] and not ant in flagged_by_redcal_dict[cal] for ap in antpols])
                                            for cal, afd in post_redcal_ant_flags_dict.items()]) for ant in ants}
    redcal_flagged_frac = {ant: np.mean([ant in fbr for fbr in flagged_by_redcal_dict.values()]) for ant in ants}

Get FEM switch states¶

In [14]:
HHautos = sorted(glob.glob(f"{data_path}/zen.{JD}.*.sum.autos.uvh5"))
diffautos = sorted(glob.glob(f"{data_path}/zen.{JD}.*.diff.autos.uvh5"))

try:
    db = mc.connect_to_mc_db(None)
    session = db.sessionmaker()
    startJD = float(HHautos[0].split('zen.')[1].split('.sum')[0])
    stopJD = float(HHautos[-1].split('zen.')[1].split('.sum')[0])
    start_time = Time(startJD,format='jd')
    stop_time = Time(stopJD,format='jd')

    # get initial state by looking for commands up to 3 hours before the starttime
    # this logic can be improved after an upcoming hera_mc PR
    # which will return the most recent command before a particular time.
    search_start_time = start_time - TimeDelta(3*3600, format="sec")
    initial_command_res = session.get_array_signal_source(starttime=search_start_time, stoptime=start_time)
    if len(initial_command_res) == 0:
        initial_source = "Unknown"
    elif len(command_res) == 1:
        initial_source = initial_command_res[0].source
    else:
        # multiple commands
        times = []
        sources = []
        for obj in command_res:
            times.append(obj.time)
            sources.append(obj.source)
        initial_source = sources[np.argmax(times)]
    
    # check for any changes during observing
    command_res = session.get_array_signal_source(starttime=start_time, stoptime=stop_time)
    if len(command_res) == 0:
        # still nothing, set it to None
        obs_source = None
    else:
        obs_source_times = []
        obs_source = []
        for obj in command_res:
            obs_source_times.append(obj.time)
            obs_source.append(obj.source)

    if obs_source is not None:
        command_source = [initial_source] + obs_source
    else:
        command_source = initial_source
    
    res = session.get_antenna_status(starttime=startTime, stoptime=stopTime)
    fem_switches = {}
    right_rep_ant = []
    if len(res) > 0:
        for obj in res:
            if obj.antenna_number not in fem_switches.keys():
                fem_switches[obj.antenna_number] = {}
            fem_switches[obj.antenna_number][obj.antenna_feed_pol] = obj.fem_switch
        for ant, pol_dict in fem_switches.items():
            if pol_dict['e'] == initial_source and pol_dict['n'] == initial_source:
                right_rep_ant.append(ant)
except Exception as e:
    print(e)
    initial_source = None
    command_source = None
    right_rep_ant = []
name 'startTime' is not defined

Find X-engine Failures¶

In [15]:
read_inds = [1, len(HHautos)//2, -2]
x_status = [1,1,1,1,1,1,1,1]
s = UVData()
s.read(HHautos[1])

nants = len(s.get_ants())
freqs = s.freq_array[0]*1e-6
nfreqs = len(freqs)

antCon = {a: None for a in ants}
rightAnts = []
for i in read_inds:
    s = UVData()
    d = UVData()
    s.read(HHautos[i])
    d.read(diffautos[i])
    for pol in [0,1]:
        sm = np.abs(s.data_array[:,0,:,pol])
        df = np.abs(d.data_array[:,0,:,pol])
        sm = np.r_[sm, np.nan + np.zeros((-len(sm) % nants,len(freqs)))]
        sm = np.nanmean(sm.reshape(-1,nants,nfreqs),axis=1)
        df = np.r_[df, np.nan + np.zeros((-len(df) % nants,len(freqs)))]
        df = np.nanmean(df.reshape(-1,nants,nfreqs),axis=1)

        evens = (sm + df)/2
        odds = (sm - df)/2
        rat = np.divide(evens,odds)
        rat = np.nan_to_num(rat)
        for xbox in range(0,8):
            xavg = np.nanmean(rat[:,xbox*192:(xbox+1)*192],axis=1)
            if np.nanmax(xavg)>1.5 or np.nanmin(xavg)<0.5:
                x_status[xbox] = 0
    for ant in ants:
        for pol in ["xx", "yy"]:
            if antCon[ant] is False:
                continue
            spectrum = s.get_data(ant, ant, pol)
            stdev = np.std(spectrum)
            med = np.median(np.abs(spectrum))
            if (initial_source == 'digital_noise_same' or initial_source == 'digital_noise_different') and med < 10:
                antCon[ant] = True
            elif (initial_source == "load" or initial_source == 'noise') and 80000 < stdev <= 4000000 and antCon[ant] is not False:
                antCon[ant] = True
            elif initial_source == "antenna" and stdev > 500000 and med > 950000 and antCon[ant] is not False:
                antCon[ant] = True
            else:
                antCon[ant] = False
            if np.min(np.abs(spectrum)) < 100000:
                antCon[ant] = False
for ant in ants:
    if antCon[ant] is True:
        rightAnts.append(ant)
            
x_status_str = ''
for i,x in enumerate(x_status):
    if x==0:
        x_status_str += '\u274C '
    else:
        x_status_str += '\u2705 '

Build Overall Health DataFrame¶

In [16]:
def comma_sep_paragraph(vals, chars_per_line=40):
    outstrs = []
    for val in vals:
        if (len(outstrs) == 0) or (len(outstrs[-1]) > chars_per_line):
            outstrs.append(str(val))
        else:
            outstrs[-1] += ', ' + str(val)
    return ',<br>'.join(outstrs)
In [17]:
# Time data
to_show = {'JD': [JD]}
to_show['Date'] = f'{utc.month}-{utc.day}-{utc.year}'
to_show['LST Range'] = f'{hd.lsts[0] * 12 / np.pi:.3f} -- {hd_last.lsts[-1] * 12 / np.pi:.3f} hours'

# X-engine status
to_show['X-Engine Status'] = x_status_str

# Files
to_show['Number of Files'] = len(data_files)

# Antenna Calculations
to_show['Total Number of Antennas'] = len(ants)

to_show[' '] = ''
to_show['OPERATIONAL STATUS SUMMARY'] = ''

status_count = {status: 0 for status in status_colors}
for ant, status in a_priori_statuses.items():
    if status in status_count:
        status_count[status] = status_count[status] + 1
    else:
        status_count[status] = 1
to_show['Antenna A Priori Status Count'] = '<br>'.join([f'{status}: {status_count[status]}' for status in status_colors if status in status_count and status_count[status] > 0])

to_show['Commanded Signal Source'] = ', '.join(command_source if hasattr(command_source, '__iter__') else [str(command_source)])
to_show['Antennas in Commanded State (reported)'] = f'{len(right_rep_ant)} / {len(ants)} ({len(right_rep_ant) / len(ants):.1%})'
to_show['Antennas in Commanded State (observed)'] = f'{len(rightAnts)} / {len(ants)} ({len(rightAnts) / len(ants):.1%})'

if use_ant_metrics:
    to_show['Cross-Polarized Antennas'] = ', '.join([str(ant) for ant in ants if (np.max([dead_ant_frac[ap][ant] for ap in antpols]) + crossed_ant_frac[ant] == 1) 
                                                                                 and (crossed_ant_frac[ant] > .5)])

# Node calculations
nodes_used = set([nodes[ant] for ant in ants if np.isfinite(nodes[ant])])
to_show['Total Number of Nodes'] = len(nodes_used)
if use_ant_metrics:
    node_off = {node: True for node in nodes_used}
    not_correlating = {node: True for node in nodes_used}
    for ant in ants:
        for ap in antpols:
            if np.isfinite(nodes[ant]):
                if np.isfinite(average_dead_metrics[ap][ant]):
                    node_off[nodes[ant]] = False
                if dead_ant_frac[ap][ant] < 1:
                    not_correlating[nodes[ant]] = False
    to_show['Nodes Registering 0s'] = ', '.join([f'N{n:02}' for n in sorted([node for node in node_off if node_off[node]])])
    to_show['Nodes Not Correlating'] = ', '.join([f'N{n:02}' for n in sorted([node for node in not_correlating if not_correlating[node] and not node_off[node]])])

# Pipeline calculations    
to_show['  '] = ''
to_show['NIGHTLY ANALYSIS SUMMARY'] = ''
    
all_flagged_ants = []
if use_ant_metrics:
    to_show['Ant Metrics Done?'] = '\u2705'
    ant_metrics_flagged_ants = [ant for ant in ants if ant_metrics_xants_frac_by_ant[ant] > 0]
    all_flagged_ants.extend(ant_metrics_flagged_ants)
    to_show['Ant Metrics Flagged Antennas'] = f'{len(ant_metrics_flagged_ants)} / {len(ants)} ({len(ant_metrics_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Ant Metrics Done?'] = '\u274C'
if use_auto_metrics:
    to_show['Auto Metrics Done?'] = '\u2705'
    auto_metrics_flagged_ants = [ant for ant in ants if ant in auto_ex_ants]
    all_flagged_ants.extend(auto_metrics_flagged_ants)    
    to_show['Auto Metrics Flagged Antennas'] = f'{len(auto_metrics_flagged_ants)} / {len(ants)} ({len(auto_metrics_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Auto Metrics Done?'] = '\u274C'
if use_redcal:
    to_show['Redcal Done?'] = '\u2705'    
    redcal_flagged_ants = [ant for ant in ants if redcal_flagged_frac[ant] > 0]
    all_flagged_ants.extend(redcal_flagged_ants)    
    to_show['Redcal Flagged Antennas'] = f'{len(redcal_flagged_ants)} / {len(ants)} ({len(redcal_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Redcal Done?'] = '\u274C' 
to_show['Never Flagged Antennas'] = f'{len(ants) - len(set(all_flagged_ants))} / {len(ants)} ({(len(ants) - len(set(all_flagged_ants))) / len(ants):.1%})'

# Count bad antennas with good statuses and vice versa
n_apriori_good = len([ant for ant in ants if a_priori_statuses[ant] in good_statuses.split(',')])
apriori_good_flagged = []
aprior_bad_unflagged = []
for ant in ants:
    if ant in set(all_flagged_ants) and a_priori_statuses[ant] in good_statuses.split(','):
        apriori_good_flagged.append(ant)
    elif ant not in set(all_flagged_ants) and a_priori_statuses[ant] not in good_statuses.split(','):
        aprior_bad_unflagged.append(ant)
to_show['A Priori Good Antennas Flagged'] = f'{len(apriori_good_flagged)} / {n_apriori_good} total a priori good antennas:<br>' + \
                                            comma_sep_paragraph(apriori_good_flagged)
to_show['A Priori Bad Antennas Not Flagged'] = f'{len(aprior_bad_unflagged)} / {len(ants) - n_apriori_good} total a priori bad antennas:<br>' + \
                                            comma_sep_paragraph(aprior_bad_unflagged)

# Apply Styling
df = pd.DataFrame(to_show)
divider_cols = [df.columns.get_loc(col) for col in ['NIGHTLY ANALYSIS SUMMARY', 'OPERATIONAL STATUS SUMMARY']]
try:
    to_red_columns = [df.columns.get_loc(col) for col in ['Cross-Polarized Antennas', 'Nodes Registering 0s', 
                                                          'Nodes Not Correlating', 'A Priori Good Antennas Flagged']]
except:
    to_red_columns = []
def red_specific_cells(x):
    df1 = pd.DataFrame('', index=x.index, columns=x.columns)
    for col in to_red_columns:
        df1.iloc[col] = 'color: red'
    return df1

df = df.T
table = df.style.hide_columns().apply(red_specific_cells, axis=None)
for col in divider_cols:
    table = table.set_table_styles([{"selector":f"tr:nth-child({col+1})", "props": [("background-color", "black"), ("color", "white")]}], overwrite=False)

Table 1: Overall Array Health¶

In [18]:
HTML(table.render())
Out[18]:
JD 2460043
Date 4-8-2023
LST Range 12.672 -- 17.611 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 918
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas 40, 42, 70, 112
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 64 / 198 (32.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 99 / 198 (50.0%)
Redcal Done? ❌
Never Flagged Antennas 98 / 198 (49.5%)
A Priori Good Antennas Flagged 47 / 93 total a priori good antennas:
7, 15, 17, 19, 31, 37, 38, 40, 42, 45, 55,
65, 66, 70, 72, 81, 83, 86, 93, 94, 109, 111,
112, 118, 121, 124, 127, 136, 140, 147, 148,
149, 150, 151, 160, 161, 165, 167, 168, 169,
170, 182, 184, 189, 190, 191, 202
A Priori Bad Antennas Not Flagged 52 / 105 total a priori bad antennas:
8, 22, 35, 36, 43, 46, 48, 49, 50, 52, 57,
61, 62, 64, 73, 74, 89, 90, 95, 97, 102, 115,
125, 126, 132, 133, 139, 179, 185, 201, 206,
207, 220, 221, 222, 223, 224, 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_2460043.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.282559 7.675504 -0.934065 -0.586905 -0.650067 -0.126922 -0.762035 1.299869 0.573264 0.474453 0.366505
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.035600 1.353872 0.267826 3.032388 0.763007 2.256015 0.045913 1.081154 0.582707 0.566339 0.371640
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.939405 -0.207332 -0.481980 0.162031 -0.061829 0.190720 3.348343 4.727654 0.586541 0.574738 0.362300
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.830596 1.966399 1.344863 1.453812 0.588904 0.689570 -1.414558 -1.765907 0.558903 0.550167 0.348686
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.660553 -0.672877 3.190890 -0.490756 1.906690 0.205860 2.071106 -0.263783 0.573145 0.575823 0.360052
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.590466 -0.856326 -0.271057 -0.658626 -1.008825 -0.124350 -0.850686 0.048003 0.572104 0.557385 0.361600
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 7.509173 -0.768376 -0.484055 -0.615442 -0.379882 0.174731 -0.051839 0.313223 0.484650 0.581893 0.355227
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.293528 1.668353 0.460596 1.203680 -0.362412 0.425566 -1.414221 -1.827991 0.582200 0.570155 0.365774
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.167447 1.975154 0.901159 9.231224 1.182837 0.032684 0.488115 2.854830 0.594988 0.481693 0.403153
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.913920 5.949751 0.844482 1.632963 1.000418 0.272763 5.248091 20.950911 0.584462 0.390018 0.431532
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.457135 0.131924 -0.242790 0.823923 0.220934 2.418404 -0.193952 9.008826 0.601481 0.596565 0.362173
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.789207 -1.028038 1.455866 -0.359565 3.373610 0.124793 1.208603 -0.125570 0.593972 0.591925 0.358660
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.107024 0.211401 -0.057131 0.143117 0.540626 0.998831 0.413624 0.315744 0.586715 0.580773 0.357242
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.196118 -1.022856 -0.933034 -0.783955 -0.870003 -0.104331 -0.139175 -0.345650 0.558519 0.553315 0.356098
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.270147 15.621071 11.025115 6.828568 1.320819 0.669737 7.256350 60.076893 0.082166 0.078230 -0.043393
28 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.906540 10.288002 11.319139 4.273619 1.686200 0.463787 2.024962 26.383912 0.035607 0.308263 0.237863
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.792144 -0.413578 -0.167787 -0.073458 0.414935 0.523777 0.148305 0.895728 0.614230 0.605539 0.369404
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.096777 -1.035142 0.655159 -0.777563 1.461469 -0.273181 1.236662 -0.336080 0.610006 0.608444 0.361317
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.568121 0.972451 1.070317 3.098738 1.586393 1.430009 0.523600 7.472326 0.616867 0.600333 0.364274
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.461867 10.943505 0.101719 -0.040462 -0.766926 -0.186573 1.229680 1.401552 0.518420 0.536559 0.195196
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 6.730767 -0.221735 6.725055 -0.452098 1.661042 -0.868671 1.524007 -0.505555 0.052928 0.568293 0.407591
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.250560 -0.951871 -0.112507 -0.616326 -0.805340 -0.237880 -1.192521 -0.233760 0.566872 0.557282 0.355299
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.810486 2.599666 1.140492 0.668486 1.245032 1.069683 0.509492 0.781305 0.564804 0.551741 0.361588
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.742837 12.675997 -0.572287 13.599101 -0.865095 1.678903 -0.986548 3.045743 0.575832 0.041421 0.464465
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.283451 -0.454662 -0.060794 0.398944 0.477506 0.504643 1.399007 6.433746 0.590905 0.578808 0.370084
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.097463 0.419946 0.187634 -0.370870 -0.031194 0.603276 15.529327 0.182271 0.240737 0.235087 -0.285582
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.538489 1.463739 1.092170 2.348334 1.584252 0.965510 0.333607 0.866587 0.610628 0.606304 0.366890
42 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.551687 0.798781 -0.229372 0.023694 -0.152615 6.402788 0.003573 1.658388 0.259769 0.243972 -0.283863
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.088467 -0.014707 -0.893006 0.691952 -0.953307 0.918721 -0.640854 1.025864 0.617541 0.617335 0.365686
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.825124 0.388110 -0.611739 0.477698 -0.382033 0.596131 -0.400839 0.138491 0.621162 0.621736 0.365604
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.725233 1.363185 0.930032 0.569522 0.914240 0.949981 0.714299 4.592637 0.615209 0.607070 0.361904
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.254706 -1.065435 0.161742 -1.005260 0.470519 -0.444235 0.441774 -0.258670 0.606993 0.609677 0.366323
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 6.246927 7.709668 6.638169 6.521763 1.664812 1.627692 2.699826 1.062999 0.031501 0.064818 0.022377
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.663182 0.344414 -0.789246 0.279535 -0.889041 -0.301499 -0.832525 -1.269988 0.576999 0.566371 0.351631
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.624625 -0.446717 0.186179 -0.669213 -0.001910 -0.697718 0.067106 1.763852 0.552092 0.549743 0.347709
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.003701 0.547521 0.599584 1.461873 0.805156 1.587162 0.303375 0.508364 0.561291 0.547203 0.358812
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 0.804856 -0.187831 0.037685 -0.398144 0.715570 0.157949 53.602816 -0.106122 0.572103 0.566867 0.357101
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.103171 1.331388 0.055355 -0.232734 0.710077 0.343678 0.983922 0.205191 0.593584 0.582229 0.361736
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.397495 -0.176765 -0.152832 -0.476177 0.817769 -0.653924 3.881510 2.291129 0.605574 0.595687 0.368129
54 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.532788 1.146378 0.827586 -0.564734 0.925520 0.761416 -0.822793 -0.596172 0.341632 0.396385 0.174249
55 N04 digital_ok 100.00% 7.63% 100.00% 0.00% 0.428617 26.475952 0.099288 8.451887 -0.386598 1.977007 0.728263 1.133984 0.253357 0.050309 0.084295
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -1.106791 1.481304 -1.031046 2.215009 -0.682972 1.695747 -0.795182 1.197694 0.618367 0.608866 0.361010
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.047985 0.325265 -0.745156 -0.485040 -0.773970 0.200745 -0.301968 0.768846 0.626169 0.619046 0.365678
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.575429 7.227843 11.336051 11.759660 1.655158 1.631406 1.789698 1.641863 0.045729 0.044691 0.002527
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.163568 0.693205 11.354951 0.819246 1.629987 1.499869 1.450909 5.697288 0.060523 0.619043 0.460671
60 N05 RF_maintenance 100.00% 0.00% 93.90% 0.00% 0.511956 7.136738 0.223067 11.783351 0.350071 1.596255 0.767732 3.156158 0.603404 0.108489 0.467465
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.876013 -0.935313 1.454892 -0.551078 -0.037428 -0.171696 1.203487 0.632263 0.565444 0.583224 0.355969
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.320928 0.513122 0.555892 0.271884 -0.089728 -0.362921 0.690366 -1.203284 0.568262 0.573759 0.349621
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.762970 7.431055 -1.035118 6.904172 -0.851868 1.652770 -0.298988 2.850360 0.578164 0.053443 0.430287
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.805242 -0.565300 -0.949021 -0.087344 -0.175444 0.097412 -0.233952 0.187764 0.562379 0.548944 0.355571
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 13.365219 12.646342 14.106793 13.997424 1.712854 1.703501 4.338474 5.548870 0.024209 0.039471 0.014667
66 N03 digital_ok 100.00% 36.06% 100.00% 0.00% 1.596770 13.006769 1.038565 14.135014 0.396523 1.629152 -1.523303 5.881232 0.217296 0.062225 0.086598
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.955375 -0.120737 -0.519798 0.812460 -0.325126 0.904115 2.215003 1.506969 0.588680 0.576740 0.358329
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 14.169716 0.216106 14.160969 -0.008846 1.670302 -0.574446 4.771499 -0.820747 0.042534 0.589845 0.460929
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.178100 -0.341433 1.499812 -0.712430 1.248476 0.100471 1.909537 -0.223685 0.612140 0.609301 0.359496
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% 0.119188 2.024158 1.134506 2.501742 0.680979 2.507862 2.166446 1.107613 0.267072 0.246021 -0.280063
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.954178 0.127858 -0.271592 0.456906 0.239301 0.565753 0.147831 1.093860 0.630735 0.625782 0.362861
72 N04 digital_ok 100.00% 0.00% 54.36% 45.64% 0.789439 4.217591 2.353916 10.604038 1.471501 1.769195 9.794958 2.123686 0.276938 0.171833 -0.166069
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.855996 1.263812 -0.644677 1.333728 -0.015394 1.047407 0.067837 1.084717 0.635873 0.629387 0.370883
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.788375 -0.796673 -0.337206 -0.617031 -0.894135 0.012981 -0.950780 0.143181 0.624303 0.623782 0.368133
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 23.111611 4.772066 0.546315 -0.703780 0.343352 -0.377698 0.052550 -0.469868 0.392541 0.516434 0.264312
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 10.035021 0.416723 0.234603 0.334881 -0.398065 -0.274369 0.198873 -0.876432 0.455835 0.575134 0.324813
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.377249 7.596077 -0.358995 6.863307 -0.262300 1.618454 0.000433 0.653639 0.568842 0.047584 0.449501
80 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.559948 5.052685 -0.455084 5.543575 -1.055324 -0.015079 -1.011658 1.492983 0.568551 0.361141 0.403504
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 38.147493 26.218144 28.093250 24.368653 5.478259 2.888359 541.602008 283.632425 0.017267 0.016444 0.001065
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 33.092991 34.396749 29.983582 25.963820 29.229530 3.858130 788.765528 472.618180 0.016204 0.016252 0.000725
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 13.880765 22.045812 20.403266 23.258661 2.510950 3.190927 193.402312 309.994418 0.016866 0.016453 0.000830
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.230779 13.562787 2.783798 14.251399 2.320445 1.641870 0.925941 4.554889 0.601046 0.057421 0.454546
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.984695 -0.222681 -0.397558 -0.378284 0.142449 0.049917 0.009809 -0.088058 0.615191 0.607946 0.360487
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.353865 -0.147342 1.217070 0.083998 0.654677 0.576675 0.549702 9.903098 0.623368 0.616806 0.353993
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.848169 1.316391 3.701589 -0.687047 1.052474 -0.730758 1.637279 -0.717762 0.541929 0.629765 0.322150
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.308678 0.672800 0.859946 1.524363 0.882254 0.844935 0.593128 0.556671 0.632534 0.625755 0.355726
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.505837 0.297171 0.858139 1.052216 1.036580 1.133443 0.186648 0.335420 0.633288 0.629085 0.363726
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.659398 -0.827855 -0.140983 -0.711044 -0.217257 -0.839218 -0.048183 -0.399444 0.626979 0.629451 0.363635
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.214307 0.322816 0.979519 0.694440 1.122367 0.866622 0.321927 0.135666 0.619864 0.621853 0.369384
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.880569 -0.124046 11.370521 0.310975 1.683234 0.688369 1.020270 0.656255 0.043763 0.612037 0.426290
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.050319 7.321801 11.432443 11.835970 1.645161 1.623243 2.551755 2.317390 0.036959 0.025119 0.006563
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.431857 7.512982 11.548532 11.680819 1.650839 1.635238 1.477182 1.322240 0.025431 0.025600 0.001122
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.673475 0.340962 -0.984909 -0.032510 -0.031765 0.079044 -0.581632 -0.760854 0.495952 0.478795 0.212037
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.446903 8.997866 0.291915 -0.529826 -0.572677 -0.322680 -1.080089 0.736811 0.570860 0.486109 0.343521
97 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.244384 0.682533 -1.018412 0.605406 -0.563087 0.205861 -0.570014 3.431764 0.558693 0.538888 0.357088
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.499129 2.734241 0.242491 0.992478 0.802735 1.312907 0.018975 0.489719 0.600036 0.591811 0.360690
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.040356 -0.019318 -0.941549 -0.392342 -0.181156 0.167655 -0.711480 3.103615 0.616128 0.607321 0.358786
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.164039 1.219681 1.433347 -0.938084 0.686861 -0.174541 -1.760928 0.979904 0.598072 0.615404 0.352793
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.609532 28.361332 2.117733 6.975906 0.835416 1.431476 1.980031 1.637856 0.622147 0.606326 0.356209
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.217714 0.291758 0.498915 1.221720 0.747420 0.846745 0.377569 0.370009 0.632257 0.626425 0.355316
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.082292 0.041521 0.666840 0.343408 -0.404481 0.329095 1.011217 0.159152 0.629533 0.629990 0.357380
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.164945 1.023190 -0.005216 -0.617732 0.356257 -0.156983 0.399821 1.201296 0.626829 0.622595 0.352390
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.594900 1.920976 1.404283 2.230457 0.988465 1.558910 4.550969 0.784889 0.620356 0.624519 0.364224
109 N10 digital_ok 100.00% 95.42% 100.00% 0.00% 5.730723 7.268697 11.434675 11.590594 1.661716 1.655879 1.163630 2.168174 0.092702 0.042731 0.038873
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.648128 -0.421440 0.874551 -0.049620 -0.433944 0.530708 0.598310 -0.155755 0.520889 0.611098 0.326373
111 N10 digital_ok 100.00% 0.00% 96.51% 0.00% 8.713834 7.243097 1.544242 11.664297 0.325272 1.622152 6.893387 2.565662 0.539430 0.084341 0.391355
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% 0.272237 2.690692 1.407455 9.806947 0.919578 -0.394528 1.260095 1.332064 0.234688 0.162073 -0.241056
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 6.835581 7.906491 6.375665 6.853187 1.639145 1.615204 2.013419 1.417530 0.038829 0.031066 0.005176
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 7.273796 0.280911 6.515397 -0.433274 1.635211 -0.688241 0.945173 -0.845112 0.054541 0.552169 0.416729
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.032789 -0.592679 -0.696701 -0.390822 -0.441344 -0.826567 -0.312680 -1.049982 0.548206 0.543881 0.352434
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 21.370599 18.960710 24.899261 22.422540 4.516561 4.048382 342.429592 285.918675 0.017041 0.016552 0.000955
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 16.274295 26.595191 23.024370 28.260443 4.386931 4.868979 364.322353 531.713148 0.016498 0.016176 0.000780
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.184004 -0.297629 2.578267 -0.724166 2.443073 0.135838 6.236904 3.291975 0.601898 0.599383 0.353769
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.593299 1.914776 1.158335 5.672395 0.301173 1.933429 -1.091853 9.278758 0.601431 0.598991 0.349553
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.938399 1.460327 -0.253945 -0.849837 -0.288061 -0.221351 -0.258662 -0.658616 0.630741 0.622719 0.358686
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.336117 1.049244 1.666219 0.575977 0.942057 0.001910 -1.585293 -1.488723 0.602257 0.620062 0.356457
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 5.912369 -0.119333 11.574715 0.707917 1.638728 0.932513 1.191728 1.130260 0.050985 0.633661 0.428138
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.913976 -0.072648 2.837215 1.462633 0.735581 0.839335 1.114852 0.465439 0.626738 0.628359 0.363424
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.307944 0.168584 0.799461 0.964712 0.324150 1.073264 2.346243 0.346701 0.629564 0.628732 0.369326
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 5.694175 -1.178664 11.361878 -0.847928 1.678312 -0.474454 0.989605 -0.484382 0.045001 0.616907 0.427264
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.201421 -0.485161 -0.397557 -0.378722 0.056576 -0.732268 0.312418 1.059887 0.610822 0.604870 0.376331
131 N11 not_connected 100.00% 0.00% 27.56% 0.00% -0.880599 6.670889 -0.686740 6.642039 -0.962914 0.970190 -0.936650 0.926886 0.578812 0.281862 0.413903
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.980176 -0.804821 -0.836256 -0.728230 -0.977769 -0.198239 -0.429831 -0.316770 0.565592 0.554932 0.355168
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.528793 -0.935789 -0.564851 -0.879911 -0.404447 -0.851104 -0.210510 -0.614691 0.553555 0.548077 0.352917
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 6.666712 8.091895 5.982310 6.329361 1.637999 1.618475 1.108706 1.406270 0.048765 0.039016 0.005828
135 N12 RF_maintenance 100.00% 99.35% 99.46% 0.00% nan nan inf inf nan nan nan nan 0.940904 0.655959 0.763656
136 N12 digital_ok 100.00% 99.35% 99.56% 0.00% nan nan inf inf nan nan nan nan 0.903775 0.623082 0.785798
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 22.415859 35.619562 27.235087 25.372249 6.002438 3.673472 662.399832 320.261834 0.016256 0.016296 0.000750
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.420330 -0.486472 0.177729 -0.983073 -0.547695 -0.647609 -1.300284 0.364490 0.584136 0.574752 0.350861
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.338255 -1.135082 0.237751 -0.826177 0.205424 -0.908723 4.660436 0.417741 0.607687 0.600194 0.350268
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.337754 -0.383552 0.149496 -0.251657 0.485768 -0.615310 -0.046417 -1.167592 0.618940 0.607827 0.353830
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.408043 7.272409 -0.371047 11.801931 0.324406 1.635686 8.761633 2.176960 0.625520 0.056839 0.499589
143 N14 RF_maintenance 100.00% 92.81% 100.00% 0.00% 6.187420 7.193824 11.165648 11.772805 1.486009 1.636234 0.951566 1.921217 0.147475 0.037893 0.093078
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.640776 -0.644958 -0.351813 -0.790942 0.239352 -0.451947 -0.354761 -0.396948 0.634249 0.629822 0.365420
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.176632 0.850857 0.329998 1.308511 0.680823 0.978672 0.142461 0.996754 0.628849 0.623164 0.360586
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.756694 -0.942161 -0.707445 -1.000369 -0.637195 -0.810978 -0.440080 -0.576658 0.606791 0.609885 0.365114
147 N15 digital_ok 100.00% 99.56% 99.56% 0.00% nan nan inf inf nan nan nan nan 0.806761 0.806810 0.548901
148 N15 digital_ok 100.00% 99.89% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.988132 0.999501 0.372906
149 N15 digital_ok 100.00% 99.67% 99.67% 0.11% nan nan inf inf nan nan nan nan 0.338255 0.299703 0.158618
150 N15 digital_ok 100.00% 99.46% 99.46% 0.11% nan nan inf inf nan nan nan nan 0.680038 0.623955 0.279130
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.580095 -0.336334 -0.579383 1.051914 -0.513053 0.697787 -0.442500 2.628373 0.483426 0.548582 0.312226
155 N12 RF_maintenance 100.00% 99.35% 99.46% 0.00% nan nan inf inf nan nan nan nan 0.769938 0.456148 0.661027
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.787484 7.185911 7.565537 11.636853 0.988017 1.657000 2.875312 2.403883 0.487978 0.047879 0.372267
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.499906 0.301735 0.611621 0.805389 0.655317 0.883767 0.343206 0.324101 0.557063 0.556060 0.355436
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -1.010056 -1.217920 -1.022246 -1.006502 -0.290217 -0.354528 0.240561 2.910554 0.571519 0.569780 0.358608
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.072431 6.452611 0.012160 -0.192653 -0.092762 0.080462 -0.007287 0.709184 0.564646 0.491263 0.336464
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 6.175747 -0.884378 11.337102 -0.484454 1.667572 0.346275 1.190133 -0.310639 0.055416 0.599302 0.463930
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.377644 15.329373 0.489889 0.538085 0.802138 -0.404583 0.100612 -0.012097 0.610673 0.509220 0.327509
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.376404 -0.991929 -0.308541 -0.876335 -0.807599 -0.281355 -0.474884 -0.784095 0.620867 0.619408 0.359318
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.045231 0.551669 0.380559 0.519349 0.883054 0.975146 0.031557 0.317971 0.626536 0.627779 0.364689
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 1.120919 0.818272 3.434030 1.021037 3.116303 1.349956 2.044552 0.867510 0.617932 0.624742 0.356892
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 7.458267 -0.440435 0.697097 -0.278767 -0.155906 0.129469 2.134699 -0.138291 0.548799 0.623336 0.341294
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.027684 -0.249396 1.164385 -0.033261 0.882950 -0.490628 0.428805 -1.188765 0.618767 0.608210 0.356870
167 N15 digital_ok 100.00% 99.78% 99.56% 0.00% nan nan inf inf nan nan nan nan 0.429286 0.440607 0.367666
168 N15 digital_ok 100.00% 99.67% 99.67% 0.00% nan nan inf inf nan nan nan nan 0.733250 0.749607 0.621596
169 N15 digital_ok 100.00% 99.67% 99.67% 0.00% nan nan inf inf nan nan nan nan 0.926661 0.891053 0.574861
170 N15 digital_ok 100.00% 99.89% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.114268 0.801599 0.787689
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.361975 -1.024318 0.679769 -0.978530 0.170232 -0.922653 0.373933 -0.407986 0.552414 0.558127 0.354648
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.957234 0.797015 1.356708 0.407024 0.555310 -0.260680 -1.738342 -1.107267 0.548771 0.542943 0.352789
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.665640 2.707363 1.857194 1.979690 1.132734 1.182796 -2.104416 -2.033961 0.520293 0.503993 0.340398
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.120401 -1.005238 0.563639 -0.554309 0.052784 -0.352842 0.157991 -0.384361 0.577122 0.572532 0.361477
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.588812 7.602025 -0.730841 11.895133 -0.178081 1.621149 3.545745 2.429213 0.593425 0.063888 0.476733
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.445411 0.736140 1.599873 1.158171 1.192855 0.823655 0.530860 2.429800 0.604994 0.600280 0.365001
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.679732 7.175138 -0.539817 11.577025 -1.011862 1.652853 0.000086 2.620867 0.611817 0.058980 0.453599
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.405365 0.652246 0.535663 0.982655 1.100698 0.884387 0.265914 0.429738 0.616167 0.613319 0.353201
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 7.693907 -0.693457 8.900334 -0.321146 -0.300923 0.298415 1.423411 -0.292799 0.437664 0.618673 0.364408
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.646518 -0.221471 -0.956201 0.088317 -0.453918 0.226583 -0.560832 0.052004 0.623445 0.619050 0.359970
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.680199 -1.096582 -0.330979 -0.841512 -0.986457 -0.873865 -1.112160 -0.845834 0.617372 0.616477 0.358017
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.287852 -0.172545 0.490226 -0.223254 0.210649 -0.668159 1.057089 -1.067087 0.610638 0.602553 0.363473
189 N15 digital_ok 100.00% 99.56% 99.56% 0.00% nan nan inf inf nan nan nan nan 0.712993 0.587531 0.311633
190 N15 digital_ok 100.00% 99.67% 99.67% 0.00% nan nan inf inf nan nan nan nan 0.633326 0.575258 0.478503
191 N15 digital_ok 100.00% 99.67% 99.67% 0.00% nan nan inf inf nan nan nan nan 0.594824 0.501915 0.435806
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.450034 2.960282 1.721857 2.147222 0.967112 1.276190 -1.981426 -2.214489 0.531030 0.510349 0.342414
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.020040 2.579155 2.095397 1.919549 1.242117 1.166077 -2.112412 -2.034149 0.516475 0.503971 0.338220
200 N18 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.711330 16.634993 6.573393 0.539387 1.682018 0.965903 2.012616 0.921959 0.047753 0.270540 0.178442
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.478630 2.293784 1.083689 1.772381 0.305245 0.969768 -1.638396 -2.064369 0.579017 0.556861 0.360418
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.218771 -0.501296 0.188391 -0.593477 -0.616926 0.160486 -1.300987 24.404915 0.594904 0.589018 0.354346
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.742445 4.581452 1.735970 -0.701954 1.395532 -0.087718 11.893762 0.003840 0.609912 0.606774 0.353857
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.087308 -0.800056 4.841918 -0.671752 -0.517133 0.322720 1.658758 8.488710 0.465708 0.601951 0.397227
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.247561 1.423047 1.591060 3.391618 -0.175251 0.105522 0.561233 0.958911 0.557863 0.522318 0.337990
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.209372 -1.061255 -0.977874 -0.913660 -0.694551 -0.690832 2.205098 -0.754459 0.576330 0.587494 0.356107
208 N20 dish_maintenance 100.00% 99.78% 99.78% 0.11% nan nan inf inf nan nan nan nan 0.133026 0.130292 -0.308369
209 N20 dish_maintenance 100.00% 99.89% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.480879 0.435534 0.376088
210 N20 dish_maintenance 100.00% 99.78% 99.78% 0.00% nan nan inf inf nan nan nan nan 0.654161 0.120906 0.566029
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.642373 7.486354 -0.575499 6.889003 -0.228243 1.623110 -0.134951 1.584437 0.554862 0.046307 0.458098
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.675506 -1.055724 -0.402597 -1.055844 -1.058002 -0.635339 -0.009809 -0.648810 0.587800 0.573509 0.360686
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.995976 -0.770260 -1.047892 -1.030137 -0.069987 -0.628126 1.408047 -0.742208 0.588417 0.584273 0.356650
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.609409 -0.424578 -0.624945 -0.509381 -0.870378 -0.783548 0.626715 -0.730525 0.588671 0.585977 0.352789
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.814290 0.539779 -0.228018 2.505997 -0.225568 0.361340 -0.246975 3.096709 0.590704 0.548280 0.364121
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.192216 2.775170 2.241309 2.065336 1.365859 1.221308 -2.248764 -2.155309 0.556359 0.551791 0.344510
225 N19 RF_ok 100.00% 0.00% 61.55% 0.00% 0.029988 6.969474 -0.039941 6.622664 -0.871388 1.377752 -1.096466 2.046308 0.589097 0.201448 0.462702
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.121539 6.585096 -1.042658 -0.489006 -0.713721 -0.215389 -0.628635 -0.463068 0.583731 0.511409 0.350507
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.163494 -0.875017 2.540529 -1.048101 0.465653 -0.889496 10.598996 0.263013 0.526755 0.562258 0.361632
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.003701 -0.618428 -0.130058 -0.762597 -0.886751 -0.234756 -0.366679 0.087093 0.562595 0.556850 0.351496
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.133232 0.413413 -0.196174 0.304786 -0.816055 -0.223616 -0.195116 -1.441553 0.554932 0.541866 0.355933
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.375500 -0.949375 0.617831 -0.881800 0.595947 -0.226593 1.204133 -0.593746 0.548035 0.556882 0.359442
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.089831 -0.173966 -0.052223 0.005216 -0.865307 -0.631555 -1.215527 -1.304206 0.576774 0.565656 0.366057
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.721998 -0.107008 -0.583630 -0.239576 -1.117826 -0.721809 -1.017758 -0.780981 0.579962 0.568862 0.362222
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.150766 -0.473628 0.262926 -0.775347 -0.037348 -0.881355 0.879792 -0.365075 0.563512 0.571422 0.357558
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.082282 -0.755579 -0.820521 -0.471692 -0.854279 -0.876324 -0.301426 -1.058930 0.582115 0.574217 0.365402
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.052882 0.186355 -0.662113 0.099733 -0.485370 -0.407059 -0.236539 -1.230215 0.484070 0.569414 0.343158
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.744403 -0.967526 -0.203380 -0.801919 -0.323747 -0.222822 -0.932843 -0.444479 0.491240 0.563409 0.343860
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.209081 -0.788985 0.127271 -0.197595 -0.063962 -0.501758 0.790086 1.291929 0.555953 0.559023 0.350326
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.029461 -0.611399 0.013781 -0.885321 -0.745790 -0.857061 -1.249692 0.053187 0.563674 0.551950 0.355286
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.676295 7.779559 -1.050915 6.483530 -0.595750 1.648731 -0.062869 1.055504 0.550429 0.046594 0.452089
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.334312 -0.389860 -0.434446 -0.680651 -0.986703 -0.875582 0.480333 -0.828997 0.552162 0.539906 0.351407
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 4.166781 5.571545 0.263939 0.423316 0.777864 0.628438 0.095158 0.386951 0.559745 0.545584 0.363733
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.581925 0.589095 0.934854 0.312401 0.075906 -0.222118 -1.560741 -0.893282 0.443958 0.417151 0.304552
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.909525 1.223242 0.141036 0.399967 -0.666405 -0.158980 -1.019875 -1.310687 0.435781 0.412074 0.297190
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.321096 -1.055487 0.032165 -0.663544 -0.803658 -0.291383 -1.195160 -0.342920 0.477455 0.454913 0.329206
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.822263 -0.260272 0.030517 -0.840338 -0.787183 -0.796459 -0.592080 -0.625321 0.439848 0.423361 0.302169
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.443358 -0.129873 -0.106635 -0.648606 -0.048747 -0.165995 0.760059 -0.054805 0.432417 0.416753 0.293642
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [4, 7, 15, 17, 18, 19, 27, 28, 31, 32, 34, 37, 38, 40, 42, 45, 47, 51, 55, 58, 59, 60, 63, 65, 66, 68, 70, 72, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 104, 108, 109, 110, 111, 112, 113, 114, 117, 118, 120, 121, 124, 127, 131, 134, 135, 136, 137, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 159, 160, 161, 165, 167, 168, 169, 170, 180, 182, 184, 189, 190, 191, 200, 202, 204, 205, 208, 209, 210, 211, 225, 226, 227, 242, 243, 246, 262]

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

golden_ants: [5, 9, 10, 16, 20, 21, 29, 30, 41, 44, 53, 54, 56, 67, 69, 71, 85, 88, 91, 101, 103, 105, 106, 107, 122, 123, 128, 141, 144, 145, 146, 157, 158, 162, 163, 164, 166, 171, 172, 173, 181, 183, 186, 187, 192, 193]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2460043.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 [ ]: