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 = "2460030"
data_path = "/mnt/sn1/2460030"
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-26-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/2460030/zen.2460030.21279.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1851 ant_metrics files matching glob /mnt/sn1/2460030/zen.2460030.?????.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/2460030/zen.2460030.?????.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 2460030
Date 3-26-2023
LST Range 6.793 -- 16.755 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
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 N15
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 68 / 199 (34.2%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 128 / 199 (64.3%)
Redcal Done? ❌
Never Flagged Antennas 71 / 199 (35.7%)
A Priori Good Antennas Flagged 66 / 94 total a priori good antennas:
3, 5, 7, 15, 16, 17, 19, 30, 31, 37, 38, 40,
42, 45, 53, 54, 55, 65, 66, 67, 69, 70, 71,
72, 81, 83, 86, 88, 93, 94, 101, 103, 107,
109, 111, 112, 118, 121, 122, 123, 124, 127,
136, 140, 147, 148, 149, 150, 151, 158, 161,
162, 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, 73, 74, 89, 90, 95, 115, 120, 125, 132,
133, 139, 185, 201, 206, 220, 221, 222, 228,
229, 237, 238, 239, 240, 241, 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_2460030.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.411103 12.009081 0.268713 10.713430 0.886777 3.460892 -0.399841 1.311727 0.542821 0.046886 0.473464
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.181430 20.502423 -0.961937 -0.426569 -0.558074 0.557764 -0.847719 1.900959 0.555913 0.424751 0.353147
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 9.591347 11.854672 10.128299 10.480645 3.247825 3.494253 0.493695 0.361140 0.038502 0.032784 0.001990
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.991556 0.157991 -0.642121 0.226225 0.057728 0.650789 16.048361 9.438888 0.566930 0.575125 0.349096
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.996795 2.899553 2.025846 2.019354 1.487408 1.685284 -2.139267 -2.065209 0.541262 0.550156 0.332577
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.531279 -0.337534 3.263802 -0.436805 0.672760 0.302030 1.751361 -0.460652 0.548102 0.569963 0.347758
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.234311 -1.315302 -0.357439 -0.718895 -0.960787 0.185178 -0.663757 -0.539595 0.560327 0.561312 0.344827
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 21.305241 0.000804 0.474881 -0.174874 0.792975 0.567333 0.818141 1.690406 0.432496 0.567256 0.354559
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.184073 12.397119 -0.291055 10.714364 0.726896 3.438450 1.110597 2.207293 0.570918 0.040232 0.482906
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.269512 3.860484 0.985270 8.995658 1.108938 0.156893 -0.021831 3.350541 0.573376 0.414339 0.403652
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.773960 6.237485 10.149693 1.074800 3.232372 1.651784 0.714238 36.199039 0.037141 0.363213 0.288958
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.159727 -0.945460 -0.307782 -0.339309 0.108306 5.305731 -0.519396 5.742162 0.581880 0.590783 0.348447
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.522962 -0.915786 2.077324 -0.345073 2.083767 0.336266 1.252734 -0.531267 0.569344 0.587049 0.345891
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.321580 0.413336 -0.003406 0.393339 0.489453 0.717608 -0.249280 0.005951 0.563348 0.564198 0.336068
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.090472 -0.973753 -0.506596 -0.783702 -0.818604 0.345889 -0.566040 -0.100743 0.539081 0.546709 0.340345
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.045736 27.270758 9.662101 5.861962 2.649839 2.177198 12.279032 56.361560 0.081296 0.077580 -0.029844
28 N01 RF_maintenance 100.00% 100.00% 0.49% 0.00% 9.091481 15.774674 10.056746 3.876751 3.244069 0.831601 1.674888 25.917064 0.031841 0.259781 0.194464
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.198759 -0.502754 -0.635694 -0.362914 0.104784 0.524300 0.540809 0.482360 0.588287 0.592427 0.351261
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.052798 -0.692799 0.444298 -0.765035 2.468961 -0.152149 6.706280 0.098169 0.583753 0.599905 0.351115
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.586752 -0.413193 1.274447 2.574206 1.380730 0.269214 0.356166 19.434996 0.592153 0.590126 0.342182
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.776875 18.458506 -0.220011 -0.094284 -0.305319 -0.165122 5.743916 6.299866 0.483862 0.509123 0.210209
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.499459 12.560657 5.486058 5.738260 3.201066 3.456975 1.011397 2.425275 0.035172 0.052444 0.010665
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.398984 -1.179208 0.078851 -0.632687 -0.571993 -0.287620 -0.278954 -0.197623 0.548963 0.545301 0.337926
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.995037 6.347785 1.214465 0.962557 1.344430 1.577172 1.646950 0.409932 0.544661 0.544519 0.363556
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.500921 19.775566 -0.550784 12.440872 -0.772474 3.464981 -0.797288 2.886151 0.540862 0.033391 0.427712
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.572962 1.366535 -0.150962 0.169531 0.553862 -0.169747 2.482401 11.464037 0.568235 0.547799 0.360269
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.001331 1.334655 0.114724 -0.380538 0.598856 0.535283 11.638589 1.621910 0.233780 0.227956 -0.274090
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.682079 1.371355 1.405751 2.000616 1.774221 0.118498 -0.142227 -0.103780 0.583639 0.589684 0.352021
42 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.053703 2.339282 -0.223150 0.593852 0.868657 12.142782 -0.320866 1.712320 0.257073 0.242005 -0.273125
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.621727 0.108905 -0.809326 0.948473 -0.860455 1.074935 -0.683904 0.778642 0.595344 0.601735 0.343950
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.120068 0.344806 -1.083040 0.073957 -0.744958 0.405195 -0.997275 -0.472295 0.596306 0.609187 0.346472
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.067319 3.006993 0.947070 0.894598 0.453938 1.431168 0.309499 7.968086 0.583169 0.590668 0.337680
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.462359 -0.383794 0.065328 -1.098373 0.217939 -0.119002 -0.199656 -0.684365 0.586331 0.603469 0.353499
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 9.726125 12.252061 5.398714 5.415914 3.200271 3.432530 2.430400 0.494491 0.031870 0.055472 0.015120
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.337203 0.446994 -0.771020 0.685183 -0.731881 0.508869 -0.567279 -2.051416 0.547345 0.562073 0.341065
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.545683 -0.378831 0.594936 -0.641700 -0.586972 -0.885589 0.893072 -0.079964 0.516733 0.542976 0.339938
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.643115 0.874732 0.525652 1.808346 0.380463 1.569416 -0.005951 0.115134 0.543809 0.542224 0.360070
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.443196 1.327676 0.241467 -0.347254 1.049218 0.866710 82.054897 4.475798 0.554456 0.560011 0.359115
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.515792 4.682240 0.667446 0.434904 1.373243 1.280324 3.693784 0.671768 0.570781 0.573581 0.359156
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.069236 1.069502 -0.013385 -0.555190 1.493594 -0.182392 9.443592 4.157476 0.575038 0.586045 0.359065
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 5.504457 3.059783 1.714619 -0.503202 1.446642 1.250789 -1.356273 -0.100150 0.313317 0.354047 0.148157
55 N04 digital_ok 100.00% 8.21% 100.00% 0.00% 0.363827 43.804937 0.367340 7.222293 -0.193717 3.715595 1.811144 0.112488 0.251998 0.042274 0.101560
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.899268 1.111918 -1.050385 2.335502 -0.564956 2.766634 -0.988729 1.413680 0.596569 0.598138 0.339350
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.201503 2.132713 -1.076350 0.003406 0.058393 0.762360 0.019541 2.245309 0.603413 0.601714 0.337113
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.525646 11.469595 10.089712 10.638833 3.184733 3.440049 1.248284 0.952839 0.037896 0.037218 0.001778
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.363372 0.483069 9.682794 0.671737 3.127060 1.973572 0.378918 4.644948 0.050306 0.600653 0.453241
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.574713 11.429253 0.177663 10.668036 0.453550 3.426496 0.349038 2.315142 0.582306 0.076714 0.457529
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.339857 -1.029693 0.889698 -0.607524 -0.061172 -0.282680 -0.291940 0.456839 0.531039 0.568852 0.343569
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.403879 0.546021 0.127387 0.432132 -0.620971 -0.474552 0.095556 -1.270053 0.530564 0.563424 0.341573
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.346608 11.816765 -0.964167 5.780427 -0.884793 3.492222 0.481418 2.354089 0.548271 0.046666 0.419947
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.558189 -0.726327 -1.116806 -0.134078 -0.370234 -0.433995 1.260343 -0.008568 0.537162 0.532738 0.334580
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 20.805211 19.574220 12.808558 12.829755 3.246871 3.508908 4.271138 5.514610 0.023452 0.032936 0.009438
66 N03 digital_ok 100.00% 33.12% 100.00% 0.00% 2.383422 20.239439 1.622337 12.980219 0.947052 3.443010 -1.952126 6.062850 0.210269 0.050563 0.101050
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.781659 -0.331653 -0.542387 0.959103 0.935447 1.326717 5.144817 1.748205 0.571477 0.573790 0.355927
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 22.232161 0.915181 12.889676 0.787559 3.162350 0.062542 4.847408 -1.355633 0.035980 0.582986 0.447288
69 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.803873 3.999558 1.497682 -0.640611 0.497778 0.743279 2.650836 0.120218 0.589380 0.596998 0.346290
70 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.083935 2.122298 1.271644 2.874825 1.677315 1.621360 5.393878 0.995967 0.258498 0.242870 -0.271164
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 3.955464 -0.259379 -0.333702 0.430367 0.253971 0.365253 -0.527691 1.121690 0.600443 0.613499 0.342838
72 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.375900 1.348681 2.506316 1.231782 1.587852 0.991899 12.314086 1.835765 0.265554 0.257696 -0.272446
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.684778 1.516111 -0.663799 1.321746 0.616690 1.325640 -0.181088 0.221681 0.607742 0.613788 0.343738
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.882638 0.113000 -0.515953 -0.101743 -0.643893 0.789063 -1.355537 0.596174 0.602947 0.615160 0.347031
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 33.873084 10.433433 0.117392 -0.691671 2.098512 0.004768 19.386514 1.218989 0.354875 0.494158 0.267275
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 22.314044 0.330594 -0.107928 0.599772 0.320243 -0.041632 4.455287 -1.128703 0.403943 0.570353 0.335806
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.364579 12.080860 -0.533102 5.763262 -0.536074 3.411919 0.296771 -0.156781 0.542293 0.041417 0.427816
80 N11 not_connected 100.00% 0.00% 70.72% 0.00% -0.045277 11.832085 -0.260089 5.493003 -0.889007 1.575003 -1.428497 1.140511 0.542746 0.133137 0.414252
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 56.797135 32.008812 31.289123 20.865290 15.253533 5.513300 898.049315 282.967160 0.016532 0.016640 0.000693
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 23.479292 61.005913 20.888095 26.593530 5.241500 9.268338 314.413886 552.672095 0.016799 0.016218 0.000809
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 28.460975 46.033587 22.911991 23.475943 8.960333 8.517415 465.295641 461.634566 0.016454 0.016342 0.000719
84 N08 RF_maintenance 100.00% 62.24% 100.00% 0.00% 15.318632 21.377201 12.409407 13.120924 1.998606 3.418838 3.204799 4.314927 0.205262 0.036507 0.132564
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.387895 2.916778 -1.021998 -0.829445 2.570312 0.471050 -0.384316 0.548194 0.596711 0.596527 0.343698
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.661497 1.001814 0.758256 0.302663 0.245785 1.021087 1.129505 16.614231 0.595943 0.605896 0.338074
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.667926 5.350176 1.519177 0.313381 4.838260 1.291745 38.237909 3.073393 0.518539 0.621453 0.325872
88 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.406004 0.789000 0.867546 1.454946 0.453308 0.030597 6.819773 2.057158 0.599250 0.608572 0.332488
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.371137 0.466818 0.885627 1.274035 0.284801 0.785802 0.153272 0.078449 0.596896 0.613517 0.338761
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.253175 -0.581609 -0.315773 -0.750158 -0.636433 -0.767569 0.381359 1.636106 0.586370 0.616055 0.343194
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.059268 0.336062 1.027784 0.829593 0.715625 0.669763 0.584620 0.080381 0.586589 0.606987 0.348058
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.045702 0.199730 10.105692 0.547091 3.243554 1.028993 0.282159 1.705158 0.037235 0.600628 0.401516
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.336240 11.657343 10.194630 10.722035 3.166594 3.423080 2.217233 1.636707 0.031372 0.025086 0.003273
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.981966 11.912242 10.300541 10.557836 3.194510 3.447577 0.819500 0.597060 0.025466 0.025314 0.001049
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.178598 1.144882 -0.974913 0.162506 1.059270 0.512820 -0.522899 -0.779009 0.416160 0.410062 0.178254
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.393832 19.561403 0.603906 -0.462315 -0.375263 0.244097 -1.462245 3.447920 0.553726 0.455157 0.333305
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.362121 2.225462 -1.144820 0.855312 0.045520 -0.575314 0.006042 7.704627 0.536202 0.518233 0.338916
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.310475 6.557871 0.321749 1.312187 0.719660 1.499014 0.286909 1.549811 0.579538 0.584085 0.349593
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.857127 0.532065 -0.968411 -0.746660 0.022040 0.396930 -1.053582 5.235581 0.594731 0.599529 0.344260
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.362850 3.698455 2.098926 -0.933598 1.385115 0.977396 -2.097386 6.935088 0.578719 0.608623 0.342428
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.088076 47.351742 0.846703 6.809126 0.856106 0.250754 1.480190 1.946628 0.601770 0.586816 0.334403
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.225989 0.602848 0.551696 1.356429 0.939690 0.702699 -0.022612 0.180207 0.604944 0.612028 0.334143
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.552143 0.871839 0.385412 0.312455 1.459497 0.079600 0.744774 1.310197 0.603052 0.616556 0.336264
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 4.834401 1.384647 -0.101427 -0.492735 0.984499 0.253561 18.067764 8.203618 0.592283 0.615304 0.329610
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.120265 33.229926 10.133836 1.421218 3.200388 1.374887 1.621858 2.669257 0.035943 0.302705 0.154820
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 8.840116 11.526317 10.173748 10.455355 3.222408 3.488455 0.417371 1.572341 0.069217 0.037093 0.022468
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 21.035142 -0.163584 0.585743 0.023535 2.337915 0.590730 40.743773 -0.511152 0.496720 0.597142 0.335302
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 9.157013 11.448095 0.846169 10.533194 2.289488 3.466786 62.897536 2.029527 0.519349 0.063193 0.383845
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% 0.352281 5.828929 1.777013 9.397572 1.814041 1.353598 0.552851 0.525661 0.234481 0.142899 -0.221528
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.702825 12.602854 5.153602 5.756037 3.149538 3.404721 1.368678 0.645350 0.034425 0.031227 0.001994
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 11.416466 0.448861 5.294767 -0.449886 3.138520 -0.778457 0.214105 1.033323 0.046896 0.548044 0.415652
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.344445 -1.137469 -0.913086 -0.327319 -0.762374 -0.848733 -0.019564 -0.836115 0.523042 0.537920 0.346621
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 27.034492 43.341469 22.185740 27.213873 6.324776 14.056706 305.280264 759.865352 0.017218 0.016177 0.001146
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 22.110399 30.875289 19.913153 23.942072 4.033059 7.783162 270.577070 389.769007 0.024936 0.022596 0.002512
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.128867 1.094356 2.939139 -0.537783 0.993253 0.744089 0.919165 -0.315862 0.576747 0.597350 0.345977
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.245993 2.677079 1.777843 5.851518 1.108270 0.380206 -1.263557 16.997098 0.586659 0.584067 0.328564
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.910064 4.305702 -0.407462 -0.830283 0.395665 0.316458 -0.411428 -0.789051 0.611148 0.616168 0.338662
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.157202 6.545908 1.147467 1.346099 1.062933 0.927612 0.245319 0.728399 0.611906 0.618820 0.338690
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 9.166869 0.351985 10.344876 0.980016 3.149636 1.092364 0.501817 1.200381 0.043182 0.621682 0.417124
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.629221 0.478175 1.960130 1.454981 0.942571 0.139163 0.835673 0.717629 0.598966 0.608842 0.339133
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.509011 0.739013 0.334582 1.211707 0.109967 2.680436 5.022982 2.853433 0.599408 0.612608 0.344642
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 8.720779 0.960962 10.097613 2.177239 3.230018 0.910989 0.227145 1.473702 0.034186 0.601276 0.392871
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.129518 -0.918057 -0.516178 -0.424871 0.087265 -0.385572 1.150072 2.847054 0.588068 0.596781 0.359305
131 N11 not_connected 100.00% 0.00% 50.14% 0.00% -1.292204 11.341820 -0.523748 5.683842 -0.768475 2.835637 -0.923536 0.351582 0.551183 0.220714 0.394115
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.125053 -0.030819 -0.706616 -0.724658 -0.719165 -0.201248 1.515553 0.040821 0.543118 0.538902 0.340988
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.601238 -1.340460 -0.780511 -0.825768 -0.436661 -1.055009 -0.604839 -0.088106 0.529457 0.543071 0.348360
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.322861 13.112000 4.765142 5.237162 3.140772 3.425908 0.365610 0.752894 0.042033 0.035618 0.003589
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.442483 -1.204542 -0.689248 -1.009046 0.821589 0.440084 12.640284 0.256531 0.521837 0.538858 0.361920
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 8.260254 -0.418455 9.838451 -0.230307 3.241819 0.500435 1.298828 2.615011 0.041460 0.544517 0.397447
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 31.215287 57.543195 25.502905 27.534008 10.491364 9.056597 730.866993 557.517787 0.016252 0.016184 0.000714
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.814464 -0.384595 0.550988 -1.129610 -0.146447 -0.794319 -1.034672 1.903069 0.567030 0.571021 0.337149
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 5.733362 -1.184610 -0.417451 -0.716923 3.888392 -0.599487 73.480127 13.130775 0.564111 0.600427 0.338005
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.408461 -0.787186 0.179845 -0.043300 0.881410 -0.676222 0.648380 -1.346877 0.597714 0.606215 0.336808
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.014211 11.516381 -0.246950 10.676776 1.200538 3.451971 19.255733 1.519646 0.602963 0.048593 0.488377
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.714951 11.214648 9.997825 10.651597 2.854029 3.462706 0.251053 1.354121 0.106670 0.032292 0.060528
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.030819 -0.115603 -0.444378 -1.096743 0.536752 0.575177 -0.469778 -0.470106 0.610259 0.622429 0.344932
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.031722 0.504553 0.129150 0.470218 0.212912 1.736773 -0.292806 0.770629 0.605736 0.611953 0.343595
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.653651 -1.016609 -1.016800 -0.974067 -0.844926 -0.996183 -0.344872 -0.983597 0.573694 0.593317 0.343655
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
149 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
150 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 15.890121 -0.737303 -0.576141 1.195624 0.171284 0.281476 0.931835 9.277925 0.428959 0.522157 0.306810
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 8.710821 -0.992802 9.976012 -0.474717 3.247883 0.178692 1.827142 0.083612 0.043020 0.543469 0.408214
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.451011 11.357510 8.823304 10.500122 1.430516 3.499349 1.716020 1.903208 0.344422 0.040022 0.258499
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.666903 0.132875 0.629510 0.976445 0.541607 1.207448 0.098405 0.007740 0.543385 0.560397 0.351852
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.442793 -0.284799 -1.074231 -1.088378 0.482843 0.387666 2.157344 9.475448 0.561897 0.570695 0.347094
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.210870 17.192791 -0.244557 -0.373915 -0.698823 1.017801 -0.137567 30.002696 0.539008 0.461177 0.312848
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.133556 -0.875771 0.236601 -0.296442 0.564407 1.155815 -0.364647 0.130471 0.582373 0.593992 0.343196
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.182645 24.694909 0.568859 0.332935 0.938486 -0.270430 -0.285026 0.488123 0.591898 0.486822 0.314716
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.843941 -1.162285 -0.411023 -1.101287 0.165627 0.270654 6.790335 -0.342428 0.601858 0.612233 0.344326
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.441248 1.426881 0.466629 0.773921 0.643192 1.528035 -0.293737 0.448245 0.605817 0.615045 0.346861
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.307498 1.158167 1.269054 1.418446 1.333596 1.999773 0.071687 1.383954 0.599745 0.609513 0.338600
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 19.498107 0.159375 0.582285 -0.223918 0.595164 0.539247 3.265297 -0.139297 0.474347 0.611519 0.331676
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.519406 -0.427340 1.188197 0.104713 0.806988 -0.778670 0.181287 -1.249527 0.591533 0.602771 0.338459
167 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 194.418574 194.477201 inf inf 1800.192147 1800.294804 8976.271394 8977.499036 nan nan nan
168 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 179.322564 178.264759 inf inf 1474.850958 1448.394861 6629.210714 6348.487113 nan nan nan
169 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 180.980251 180.433874 inf inf 1482.940051 1484.357302 6766.073013 6808.864854 nan nan nan
170 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.516889 -1.314917 0.523788 -0.862086 -0.563824 -0.792230 -0.223375 1.315012 0.509849 0.544343 0.349638
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.148876 0.273562 2.036348 0.562269 1.476532 -0.518740 -2.716881 -0.522731 0.535908 0.546067 0.353201
173 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.605279 4.397341 2.749904 2.740595 2.498890 2.758503 -3.276996 -2.314838 0.504044 0.502947 0.337015
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.924813 -0.545195 0.277993 0.689290 -0.321147 9.370178 -0.074543 2.198694 0.547030 0.572785 0.349262
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.270724 12.095266 -0.769167 10.782460 0.697457 3.423916 10.919058 2.417008 0.577403 0.055317 0.473733
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.394504 0.627355 1.480128 1.083069 0.657875 0.920500 -0.068610 3.774716 0.585490 0.594549 0.349549
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.428391 11.313827 -0.695090 10.444646 0.323125 3.489854 3.095521 1.966213 0.598517 0.050265 0.447681
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.290256 1.273644 0.658252 1.181105 1.188175 1.109429 0.665078 1.115889 0.587630 0.598446 0.333594
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 12.389854 -0.332701 7.341662 -0.390712 1.308452 0.057949 6.638579 -0.011034 0.432079 0.607738 0.364942
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.433471 -0.045948 -1.127690 0.077415 -0.219640 0.272782 0.618598 0.375678 0.599490 0.606705 0.344411
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.994844 -1.163847 -0.109036 -0.719320 -0.863739 -0.749957 -1.124729 -0.951944 0.596329 0.604048 0.345234
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.444635 -0.733479 0.203583 -0.316702 1.698579 -0.055147 3.593217 -0.612196 0.585224 0.593715 0.348476
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
190 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
191 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 2.559538 4.771147 1.879077 2.905826 1.627831 2.827380 -2.278500 -3.399382 0.528919 0.507247 0.340458
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.083054 4.192065 2.980246 2.645635 2.569282 2.663615 -3.380986 -3.188666 0.499568 0.489541 0.330493
200 N18 RF_maintenance 100.00% 100.00% 38.68% 0.00% 10.503847 30.071431 5.320064 0.160908 3.239075 0.832860 1.450390 3.153825 0.040774 0.222485 0.142454
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.206639 3.460400 1.744457 2.426584 1.181563 2.270648 -1.580779 -3.077345 0.560877 0.556399 0.338919
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.320169 0.534550 0.597138 -0.474947 0.018780 0.555161 -1.612565 48.699512 0.578846 0.570968 0.337255
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.926521 10.883786 1.806026 -0.673781 0.509047 0.291208 17.514592 1.247487 0.587130 0.598530 0.345345
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.508385 -1.236141 3.366687 -1.071472 0.617667 0.013827 2.079851 3.098434 0.422494 0.583790 0.390887
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.179788 3.390890 0.821854 3.092698 -0.284418 -0.276541 0.684464 0.973327 0.530508 0.481151 0.327816
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.157397 0.312223 -1.078295 0.147132 -0.678127 1.224691 5.158609 -0.281348 0.561266 0.553954 0.339045
208 N20 dish_maintenance 100.00% 99.95% 99.95% 0.05% nan nan inf inf nan nan nan nan 0.230380 0.198413 -0.187876
209 N20 dish_maintenance 100.00% 99.95% 99.95% 0.05% nan nan inf inf nan nan nan nan 0.087908 0.103448 -0.299684
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.187339 0.076839 0.089323
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.265989 11.875892 -0.727755 5.787180 -0.368088 3.419242 0.061336 0.969058 0.524570 0.040390 0.436112
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.006272 -1.183660 -0.184234 -0.902986 -0.986585 -0.588729 1.724302 -1.114757 0.566826 0.566733 0.342356
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.079635 -0.879575 -1.105154 -1.103924 0.581514 -0.787418 3.329859 -0.921089 0.561276 0.573659 0.342195
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.706254 -0.589232 -0.540704 -0.383085 -0.749288 -0.936953 3.092599 -1.069581 0.567509 0.579129 0.343502
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.286551 -0.948252 -0.437100 0.435504 -0.593394 0.990190 0.815245 4.241907 0.556449 0.556023 0.334337
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.379973 4.325441 3.150158 2.803286 2.740181 2.695217 -3.527821 -3.050233 0.521316 0.543768 0.334075
225 N19 RF_ok 100.00% 0.00% 89.74% 0.00% -0.419513 11.493479 0.151522 5.563820 -0.823643 3.277221 -1.551852 1.409100 0.566707 0.144008 0.455595
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.924930 15.006589 -0.895071 -0.195651 -0.873680 0.961930 -0.785640 1.093046 0.556264 0.471975 0.331870
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 2.376372 -1.306829 2.484761 -1.055922 -0.659086 -0.954445 11.256233 0.609166 0.464477 0.551582 0.372347
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.278567 -0.570857 0.164643 -0.840839 -0.541711 -0.166510 0.262538 0.236157 0.537024 0.533816 0.337803
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.145069 0.302720 0.146502 0.566525 -0.451101 -0.115266 -1.642729 -1.693700 0.535994 0.537720 0.353269
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.702844 -0.915563 0.589129 -0.885679 0.055147 -0.220620 1.011137 -0.771154 0.512932 0.547717 0.351615
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.153172 -0.700179 0.197599 0.049869 -0.683794 -0.741297 -1.482859 -1.453901 0.558512 0.561662 0.351098
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.087209 -1.025408 -0.688390 -0.330756 -0.914525 -0.935171 -0.438203 2.034673 0.558873 0.565766 0.350143
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.704031 -0.480825 -0.362974 -1.135714 -0.942833 -0.669698 -0.196505 0.769526 0.555274 0.562918 0.347885
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.353837 -1.150383 -0.725276 -0.364614 -0.882672 -0.910174 0.125578 -1.325885 0.558708 0.565535 0.356407
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 14.063634 0.520676 -0.327210 0.671946 0.300268 0.272837 -0.735643 -1.516201 0.424782 0.556925 0.345602
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 13.982031 -1.456054 0.250654 -0.833108 0.656480 -0.247527 4.999673 -0.421378 0.440801 0.548217 0.346022
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.017357 -1.023225 -0.135021 -0.655780 -0.526741 -0.632812 1.556113 4.204260 0.519254 0.546440 0.346751
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.041160 1.678663 0.333267 -0.890424 -0.414918 -0.859063 -1.816697 0.397595 0.543705 0.530536 0.345094
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.713139 12.378499 -1.063498 5.366388 -0.438043 3.473769 -0.535102 0.182191 0.526585 0.039572 0.436540
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.490413 -0.492565 -0.263091 -0.636481 -0.850047 -0.872348 0.461862 -0.696152 0.531862 0.531305 0.345777
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 9.416998 12.083289 0.409834 0.521641 1.055018 0.584049 0.184896 1.371935 0.542154 0.540779 0.364342
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.640793 0.687659 1.399793 0.552320 0.589296 -0.157069 -1.643571 -0.610548 0.448404 0.452843 0.335523
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.654436 1.983662 0.470457 0.706003 -0.216152 0.273519 2.087049 0.738476 0.432021 0.434171 0.317512
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.698617 -1.136631 0.320792 -0.739042 -0.427384 -0.525263 1.237875 1.228653 0.465079 0.459663 0.339239
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.531173 -0.342571 -0.571854 -1.135474 1.297324 -0.520702 0.796765 2.058196 0.441482 0.443872 0.327064
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.840204 2.590671 -0.164390 -0.644688 -0.647957 -0.724633 1.130021 3.356937 0.420958 0.420018 0.307536
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, 19, 27, 28, 30, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 51, 52, 53, 54, 55, 58, 59, 60, 63, 65, 66, 67, 68, 69, 70, 71, 72, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 88, 92, 93, 94, 96, 97, 101, 102, 103, 104, 107, 108, 109, 110, 111, 112, 113, 114, 117, 118, 121, 122, 123, 124, 126, 127, 131, 134, 135, 136, 137, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 161, 162, 165, 167, 168, 169, 170, 173, 179, 180, 182, 184, 189, 190, 191, 192, 193, 200, 202, 204, 205, 207, 208, 209, 210, 211, 223, 224, 225, 226, 227, 242, 243, 244, 246, 262]

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

golden_ants: [9, 10, 20, 21, 29, 41, 44, 56, 85, 91, 105, 106, 128, 141, 144, 145, 146, 157, 160, 163, 164, 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_2460030.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 [ ]: