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 = "2459856"
data_path = "/mnt/sn1/2459856"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 10-3-2022
In [5]:
# Per-season options
def ant_to_report_url(ant):
    return f'https://htmlpreview.github.io/?https://github.com/HERA-Team/H6C_Notebooks/blob/main/antenna_report/antenna_{ant}_report.html'

Load Auto Metrics¶

In [6]:
use_auto_metrics = False

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

# if it exists, load and extract relevant information
if len(auto_metrics_file) > 0:
    auto_metrics_file = auto_metrics_file[0]
    print(f'Found auto_metrics results file at {auto_metrics_file}.')
    
    auto_metrics = load_metric_file(auto_metrics_file)
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
    auto_ex_ants = auto_metrics['ex_ants']['r2_ex_ants']
    
    use_auto_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping auto_metrics.')
Found auto_metrics results file at /mnt/sn1/2459856/zen.2459856.29338.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 1750 ant_metrics files matching glob /mnt/sn1/2459856/zen.2459856.?????.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.')
Found 175 ant_metrics files matching glob /mnt/sn1/2459856/zen.2459856.?????.sum.known_good.omni.calfits

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:
        inital_source = "Unknown"
    elif len(command_res) == 1
        inital_source = initial_command_res[0].source
    else:
        # multiple commands
        times = []
        sources = []
        for obj in command_res:
            times.append(obj.time)
            sources.append(obj.source)
        inital_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 = [inital_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 = []
  Cell In [14], line 19
    elif len(command_res) == 1
                              ^
SyntaxError: expected ':'

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 '
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In [15], line 1
----> 1 read_inds = [1, len(HHautos)//2, -2]
      2 x_status = [1,1,1,1,1,1,1,1]
      3 s = UVData()

NameError: name 'HHautos' is not defined

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(commanded_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)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In [17], line 7
      4 to_show['LST Range'] = f'{hd.lsts[0] * 12 / np.pi:.3f} -- {hd_last.lsts[-1] * 12 / np.pi:.3f} hours'
      6 # X-engine status
----> 7 to_show['X-Engine Status'] = x_status_str
      9 # Files
     10 to_show['Number of Files'] = len(data_files)

NameError: name 'x_status_str' is not defined

Table 1: Overall Array Health¶

In [18]:
HTML(table.render())
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In [18], line 1
----> 1 HTML(table.render())

NameError: name 'table' is not defined
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_2459856.csv
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In [19], line 4
      2 outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
      3 print(f'Now saving Table 2 to a csv at {outpath}')
----> 4 df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)

NameError: name 'df' is not defined

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 Flag Fraction Before Redcal Flagged By Redcal chi^2 Fraction 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 Median chi^2 Per Antenna (Jee) Median chi^2 Per Antenna (Jnn)
3 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.798066 -1.094265 -0.408065 -1.166277 -0.107066 -0.511802 -0.000454 0.809177 0.703130 0.695749 0.411296 3.332482 2.750183
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.319604 4.904282 1.655981 0.661278 0.039284 0.014638 4.324715 0.228391 0.718296 0.689550 0.412240 3.743789 2.918068
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 19.43% 0.007010 0.114237 -0.475148 0.973226 -0.307560 0.109214 1.700995 -0.505430 0.725314 0.698008 0.408150 2.008990 1.605035
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.305652 -1.487090 0.349102 -0.502249 -0.325822 0.113022 0.588087 6.276518 0.719292 0.694199 0.408522 2.881931 2.720441
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.339817 5.429608 19.659808 19.833933 3.724727 8.380347 0.635339 -3.064843 0.710985 0.675439 0.404256 3.021464 2.730250
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% 0.134310 -1.665610 0.990061 -0.773565 0.773206 0.496348 -0.148082 1.872470 0.711217 0.691296 0.411388 1.541369 1.419800
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.167335 2.739213 17.113305 16.597254 2.260160 8.449722 -0.003449 -2.252530 0.710196 0.688087 0.420026 3.316993 2.987689
15 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 1.14% -0.011090 0.575504 0.404145 -0.830187 -0.252347 -0.644856 -0.004725 2.079714 0.729345 0.702571 0.408045 1.860343 1.551115
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% -1.270167 0.642305 0.799817 0.071514 0.536678 0.927209 1.831957 2.025990 0.729110 0.699054 0.407595 1.914500 1.528863
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% -0.659663 0.922317 -0.021580 -0.671678 -0.646943 -0.633759 0.843325 -0.037463 0.721131 0.703876 0.399673 1.842938 1.567939
18 N01 RF_maintenance 100.00% 0.00% 33.71% 0.00% 100.00% 0.00% 12.869317 28.045663 -0.797628 0.185471 2.445449 13.218331 23.104804 51.942130 0.697414 0.453576 0.457398 2.654823 1.623325
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.229936 -1.586936 0.153492 -0.486294 -0.530886 4.144073 6.407110 7.884110 0.719875 0.707120 0.404412 2.680694 2.697837
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.739306 4.663896 6.801430 18.843386 0.626062 7.971784 1.212001 -3.219102 0.733018 0.685524 0.414326 3.405540 2.891658
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% 0.127079 -1.061090 0.245251 1.489678 -0.469225 -0.810838 0.436703 1.803423 0.714846 0.696823 0.411454 1.500369 1.405668
22 N06 not_connected 100.00% 42.29% 0.00% 0.00% 100.00% 0.00% 34.803023 12.259046 0.930157 7.111052 9.460882 10.556107 10.297882 37.423203 0.450386 0.634535 0.357874 1.985052 2.584188
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.058156 17.292991 23.239946 24.197006 6.625330 12.213832 4.307278 3.073892 0.034185 0.037312 0.002244 1.182401 1.180770
28 N01 RF_maintenance 100.00% 74.86% 100.00% 0.00% 100.00% 0.00% 19.622437 38.904737 0.147571 2.082781 6.447833 11.951295 3.391284 35.145984 0.363750 0.151054 0.235092 3.937432 1.632859
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.00% -1.516409 -1.255007 -0.677304 -1.148598 -1.093077 -0.974277 -0.663317 0.864591 0.727754 0.704326 0.395000 1.753760 1.588228
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.00% -1.430670 -1.722743 0.615474 0.460274 -0.544766 0.420839 3.011847 -0.453489 0.725864 0.707840 0.395112 1.648414 1.470342
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.686788 -1.083990 -1.108507 -0.884987 0.695572 6.020148 1.010330 1.560805 0.741783 0.712504 0.405212 2.814277 2.502271
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 31.059501 27.944837 0.892812 2.518300 2.801899 10.990049 5.198876 19.335556 0.599571 0.629048 0.231710 2.669142 2.654476
33 N02 RF_maintenance 100.00% 0.00% 10.29% 0.00% 100.00% 0.00% -0.166743 28.651119 -0.211925 1.021526 -0.917567 9.857257 0.855883 42.919758 0.717734 0.511067 0.484620 3.084526 1.752843
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 17.278313 3.031357 8.287908 6.437786 6.652525 2.840174 2.034517 -0.859082 0.044020 0.673539 0.568909 1.244955 2.562242
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.607974 0.652797 -0.958440 5.630443 4.263983 1.030568 1.791026 -0.586575 0.627429 0.669061 0.433822 2.423846 2.653085
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 12.547688 9.438150 0.268474 -0.575805 1.124383 0.840911 -0.075005 0.243882 0.725830 0.704746 0.404998 3.088899 2.553626
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.613749 0.600489 -0.413270 0.610979 -0.229479 0.109418 0.018459 9.988535 0.729907 0.715023 0.408317 2.746208 2.436463
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.380053 0.396624 0.506908 0.949259 1.169529 1.856976 7.173232 2.285928 0.734469 0.717203 0.407830 2.869409 2.676720
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 14.29% 0.047711 -0.370949 0.305596 0.536961 0.029978 -0.175787 -0.514659 -0.621561 0.724489 0.706121 0.397763 1.813008 1.618956
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 42.86% -0.381534 -0.519332 1.937770 0.151098 0.114334 -1.087553 -0.664374 -0.368622 0.735875 0.710696 0.392797 2.423741 2.095167
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.00% -0.066340 3.270315 -0.230002 -0.475790 -0.459867 -0.464665 0.185056 -0.964444 0.740843 0.704367 0.404976 1.835258 1.515874
43 N05 digital_maintenance 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 14.044759 4.289200 22.941011 -0.591668 6.656079 0.132799 3.417527 1.642090 0.042405 0.712222 0.525455 1.172875 2.736776
44 N05 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.861267 3.485401 0.954213 -0.211165 -0.043671 -0.118644 5.356153 4.170625 0.715123 0.707332 0.384829 2.833981 2.627502
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.459267 0.889520 0.477684 0.065809 -0.156639 1.201909 -0.112754 20.013957 0.728662 0.701630 0.393913 2.993454 2.515065
46 N05 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -1.202236 18.072974 -0.655102 24.345223 -0.911342 12.072762 0.164048 4.173755 0.725070 0.038212 0.557022 3.123524 1.201149
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 16.596658 2.566005 7.788292 5.743346 6.684792 7.911041 1.520446 3.844413 0.040140 0.674259 0.569054 1.238560 2.717881
48 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.456241 6.571342 20.579751 20.140595 4.427210 7.416480 -3.855797 -4.192125 0.692922 0.681590 0.419495 2.539507 2.367029
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.799298 7.026899 20.190914 20.757360 4.429966 9.187591 -3.578908 -4.318327 0.686196 0.666864 0.412590 2.814637 2.539324
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.385535 33.932945 1.036265 0.918772 2.028659 4.186862 4.545999 17.486902 0.718818 0.624291 0.368444 3.804946 3.747434
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 35.685134 2.521428 30.802022 0.777321 6.263550 1.706945 13.950199 2.891980 0.040609 0.713548 0.515808 1.173163 2.632452
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.030505 9.427733 -0.448468 -0.550197 9.228893 -0.778723 0.936028 0.070504 0.736951 0.723844 0.396332 2.754861 2.665320
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.192158 3.605297 0.348472 0.380410 -1.230394 -0.861965 2.146768 6.376614 0.742738 0.727850 0.399513 2.724433 2.513975
54 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 14.988981 10.350368 23.233178 -0.405715 6.652394 0.302758 3.152482 7.210478 0.047491 0.694072 0.540382 1.354439 2.394156
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 1.285490 19.062997 1.623826 24.593322 6.318959 12.108821 3.990727 1.802930 0.723201 0.033638 0.523403 2.821467 1.149772
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 31.43% -0.839579 1.306890 -1.175962 -0.069386 0.035553 1.145240 0.184634 1.595883 0.736429 0.723207 0.381633 2.401667 2.000874
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 43.119702 0.758320 7.756465 -1.093653 2.334576 -0.314211 2.512846 0.897478 0.569914 0.719312 0.378566 4.664119 2.556381
58 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.422373 17.963582 23.073412 24.662207 6.747806 12.367409 4.236059 3.963897 0.037054 0.033634 0.002073 1.153819 1.149349
59 N05 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 36.872522 4.123114 1.390223 1.187818 2.715057 0.874903 4.353870 6.058571 0.645622 0.704932 0.387602 2.617801 2.510649
60 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.735192 17.599416 23.176217 24.631786 6.654030 12.240390 2.841963 4.379236 0.027965 0.028372 0.001023 1.185756 1.178537
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.862774 4.436167 1.603233 1.781822 6.894646 1.456078 -0.257261 3.185041 0.669987 0.661077 0.394105 2.551509 2.398184
62 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.846127 7.543441 20.323940 20.743450 4.237866 9.519693 -3.926204 -4.388749 0.706663 0.686169 0.409002 2.935196 2.409416
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.973812 18.085571 10.810435 9.110206 0.056378 12.132930 -1.057457 3.898102 0.667822 0.044750 0.594402 2.524260 1.204703
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.904201 1.657829 7.794695 11.959414 0.744554 2.654880 -0.596101 -1.951415 0.658593 0.661412 0.423046 2.701208 2.568136
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.00% 0.735662 0.519174 0.244515 -0.072132 2.273272 1.023456 -0.610265 0.758315 0.721883 0.709433 0.412667 1.558700 1.459254
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% 0.680562 1.667983 0.327800 0.118056 0.173344 -0.184740 -0.684607 2.223085 0.726754 0.714401 0.403863 1.633942 1.488764
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% -0.668419 -0.269135 1.318892 0.096600 -0.640488 -0.308081 0.423781 2.069589 0.727712 0.718935 0.395352 1.527541 1.488175
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 2.126202 39.884516 1.391590 33.693849 -0.139428 11.580152 0.448483 14.292057 0.727136 0.032091 0.493449 2.653602 1.144830
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 77.14% 0.002138 -0.920375 -1.124153 0.504841 1.585139 1.169950 -0.505717 -0.168371 0.732200 0.723682 0.389890 2.709805 2.569369
70 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.118253 -0.918118 -0.219507 0.231140 5.662091 0.435494 0.041706 0.237570 0.748055 0.727232 0.386132 20.110270 16.854315
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 96.57% -0.223759 -0.824560 0.251967 -1.076198 -0.206480 -1.153102 -0.770481 -0.519833 0.734285 0.728405 0.389906 14.715837 12.623089
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 34.86% 3.546647 -0.415391 -0.739495 -0.693615 0.659850 0.636337 2.874079 -0.592173 0.729516 0.720456 0.377115 2.045410 1.572927
73 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.929489 17.031987 22.838314 23.928424 6.592675 12.070855 5.656922 3.217993 0.026959 0.027000 0.000531 1.144061 1.141007
74 N05 digital_maintenance 100.00% 100.00% 78.29% 0.00% 100.00% 0.00% 15.431682 13.987407 23.804441 23.381906 7.023582 11.530265 4.031002 21.988033 0.032615 0.358342 0.235733 1.165436 1.337967
75 N05 digital_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 8.816939 18.507416 9.976172 24.836309 4.293590 12.466155 19.315108 5.274052 0.680878 0.044651 0.513926 2.582176 1.194919
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 28.492104 29.798028 12.122770 9.833387 3.052085 6.969325 3.097286 1.483104 0.592587 0.555209 0.245063 3.534344 2.705734
78 N06 not_connected 100.00% 11.43% 0.00% 0.00% 100.00% 0.00% 42.756287 0.203658 9.163743 10.617774 3.519773 0.944081 -0.822421 0.221419 0.512429 0.675850 0.386479 3.635088 2.586450
81 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.753342 0.423516 0.710626 2.609263 -0.014299 9.768152 0.149761 0.274349 0.687675 0.670256 0.400270 2.805216 2.580494
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.925242 1.108072 1.820171 -0.029979 1.472553 0.760190 0.547440 -1.064630 0.714328 0.702359 0.405004 3.148033 2.501539
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.00% 0.425074 -0.207735 2.417696 -0.343438 -1.258478 0.276585 -1.159878 -0.752760 0.725031 0.712192 0.397200 1.492996 1.473460
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 10.598259 35.670307 -0.325769 32.461292 -1.162060 11.572470 -0.680063 8.067794 0.729235 0.040965 0.613345 2.739763 1.150857
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 1.71% 0.856466 0.251050 -0.655606 -0.836422 -0.845209 -0.508681 -0.863042 -0.690535 0.728936 0.715839 0.396658 1.494407 1.502550
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.188349 9.563070 0.582894 0.689096 6.085419 1.268984 0.021201 23.584939 0.722389 0.679318 0.389246 2.576696 2.238244
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 44.928959 10.125909 2.301481 0.355470 5.613377 1.850081 87.820269 1.981720 0.644408 0.734604 0.378439 3.623478 2.618253
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 28.00% 1.568049 1.859238 0.314218 -0.787214 -0.676227 2.113177 0.650414 -0.141858 0.732858 0.722743 0.377968 1.935234 1.583937
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.956824 0.870180 1.385366 0.398200 -0.015492 -0.700002 -1.139359 -1.124578 0.740238 0.724541 0.382864 3.504468 2.722138
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.578356 0.376315 -0.245572 1.389927 -0.900923 -0.664793 -0.194129 1.098282 0.730055 0.707635 0.382947 2.812543 2.451609
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.00% 0.191986 -0.038045 1.139048 1.580144 -0.144718 -0.420819 1.769330 1.053817 0.732736 0.724079 0.396102 1.544081 1.439447
92 N10 RF_maintenance 100.00% 91.43% 98.29% 0.00% 100.00% 0.00% 53.806146 68.128402 3.083571 4.239567 5.838136 11.515870 0.791149 8.392674 0.304761 0.248887 0.115625 2.233805 1.737153
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.955779 0.464986 2.543888 -0.327343 2.009958 -0.581472 5.670784 -0.888447 0.719056 0.709989 0.402364 3.135458 2.788829
94 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% -1.147957 -1.028670 -0.313479 0.122431 0.191958 1.292467 1.737927 2.315492 0.719034 0.699850 0.407238 1.602470 1.399195
98 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.067584 6.114701 -0.480884 -0.198762 -0.154626 3.000313 0.494991 1.973199 0.681394 0.675568 0.403662 3.065224 2.812554
99 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.654433 -0.486262 -0.736326 -1.158153 0.781245 4.959465 2.261677 -0.884267 0.696904 0.697667 0.405949 2.752631 2.545172
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.00% -1.005112 -1.071315 -0.855704 1.683726 0.786974 -0.620786 -0.461372 -0.158080 0.709420 0.696511 0.397488 1.544441 1.436261
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.302567 10.557699 3.308180 0.277666 -0.545984 -0.441135 -0.643783 -0.772202 0.735932 0.718810 0.390736 2.936038 2.654728
102 N08 RF_maintenance 100.00% 50.86% 100.00% 0.00% 100.00% 0.00% 12.022762 18.359470 20.245392 23.189149 5.158189 12.357567 0.748390 6.118767 0.431766 0.041986 0.358315 1.514979 1.231325
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 33.386148 35.974078 26.883735 28.178470 7.097738 12.622175 11.959749 12.308258 0.027829 0.028831 0.001901 1.155152 1.152728
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.043925 79.020527 -0.495007 21.430897 2.061373 5.687045 -0.259199 0.437030 0.740371 0.667385 0.420204 2.718437 2.217504
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 20.00% 1.357226 0.031998 -0.195493 0.172446 0.187840 -0.439430 0.661776 -0.517367 0.738217 0.725025 0.381314 2.079109 1.712050
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% 0.719102 1.036083 -0.566113 -1.079378 3.177419 0.860348 0.023666 -0.515844 0.729319 0.718274 0.380808 1.779394 1.545055
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 1.14% 2.575936 -0.310365 2.185449 1.849617 0.131523 -0.056097 0.738517 2.725844 0.716364 0.713064 0.380120 1.796975 1.633698
108 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.383163 4.424299 17.019414 0.234886 5.074223 0.197933 1.727120 2.197452 0.606897 0.722818 0.448684 2.138299 3.077017
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -0.324992 17.854180 -0.661931 23.899914 -1.282992 12.075213 -0.460945 2.767390 0.734000 0.037716 0.509757 3.129940 1.217149
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 34.290086 41.741849 1.122833 1.542410 6.354988 6.758462 35.087797 21.294014 0.634791 0.611847 0.255131 3.701058 2.884498
111 N10 digital_ok 100.00% 0.00% 90.29% 0.00% 100.00% 0.00% -0.100933 16.204532 0.950631 23.490035 -0.937399 11.205826 -0.529057 4.193162 0.724464 0.250827 0.500195 3.290623 1.333223
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% -0.615495 -0.123653 -0.242018 -1.121556 -0.906841 0.415849 1.296516 -1.002387 0.712990 0.703282 0.413689 1.522500 1.365569
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.00% -1.018313 0.600467 -1.042507 1.303825 0.275292 0.836708 2.209168 -0.961127 0.686711 0.688504 0.412372 1.767016 1.548409
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 16.483566 20.113091 23.225246 25.417648 6.840771 12.322249 2.767899 5.423829 0.027977 0.031749 0.003276 1.220251 1.212565
118 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.357662 0.499363 -1.088938 0.190400 -0.252118 7.586935 -0.025645 0.361909 0.713448 0.706153 0.402575 2.953466 2.698995
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.253056 4.318088 4.399122 6.422413 -0.811160 26.326845 -0.862209 2.186192 0.727361 0.670809 0.407251 3.090610 2.293994
120 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.837299 35.037827 -0.807688 32.238549 0.466456 11.968010 1.970887 14.093442 0.728588 0.036986 0.622159 3.034227 1.157607
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.124627 7.607219 0.643863 -0.022425 -0.522250 0.465102 24.634428 21.583160 0.740099 0.724790 0.394069 2.855777 2.618990
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.810748 10.198358 0.538464 1.065700 1.346119 -1.065851 0.020092 -0.656980 0.740410 0.725549 0.389097 2.857976 2.584962
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.451875 12.993538 1.039295 0.000499 -1.162905 -0.108910 -0.870204 -0.513154 0.749408 0.734795 0.386298 3.466577 2.898505
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.00% -0.878193 1.373387 0.182193 -1.049791 0.071181 -1.108517 0.004725 0.620455 0.745263 0.726694 0.388035 1.887864 1.535289
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.002138 -0.315280 -0.596842 0.028714 -0.794496 0.672754 -0.800551 -1.001915 0.722313 0.722773 0.386946 3.196706 2.856057
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 40.573232 0.777834 1.266805 -1.046756 6.768148 1.828824 6.631015 -0.228210 0.603863 0.717612 0.382246 3.982420 2.749756
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% -0.790561 -0.152740 1.093237 -0.569226 0.779989 0.125497 -0.337343 1.420708 0.730861 0.724311 0.394742 1.505719 1.444269
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.765837 6.446757 -0.877317 0.164136 -0.354560 1.835275 -0.457550 -0.542553 0.733561 0.710400 0.395913 2.978098 2.822701
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% 0.924166 -1.587079 -0.731790 -0.480338 -0.152081 -0.897265 0.076599 -0.644615 0.721585 0.715688 0.406194 1.769076 1.429066
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% 2.113584 0.464730 -0.463292 -0.153467 0.123505 0.142273 -0.453745 3.816175 0.708335 0.703327 0.406514 1.618928 1.398906
135 N12 digital_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -0.909137 17.949814 -0.498472 24.714763 0.280519 12.459034 0.475593 2.962216 0.690671 0.040509 0.492677 3.837483 1.286180
136 N12 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.333810 1.518111 -0.628312 -0.042581 -0.448988 5.814094 -0.288018 0.822462 0.683449 0.684176 0.405254 3.737310 3.176669
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.775276 -1.010051 -0.213588 -0.001374 0.983693 3.114849 -0.506742 -0.120107 0.697417 0.684779 0.404042 3.428765 2.745669
138 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.549700 0.137049 2.164794 1.876584 -1.261350 -0.303317 2.529934 -0.756741 0.711995 0.701111 0.408157 3.494616 2.776697
140 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.061907 18.731267 22.717393 24.467114 6.587816 12.059502 4.420880 5.646922 0.037216 0.036716 0.002131 1.171296 1.170894
141 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.165282 3.773983 -0.061720 6.382134 1.760148 3.983073 2.090105 17.496414 0.718581 0.677061 0.374148 3.362377 3.064032
142 N13 digital_ok 100.00% 90.29% 100.00% 0.00% 100.00% 0.00% 45.079165 17.786237 1.673555 24.570674 7.732000 12.326135 6.439847 4.600461 0.319083 0.036793 0.184262 2.893907 1.214073
143 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.00% 1.625894 -1.431624 -0.070925 -1.156089 0.409327 -0.286573 -0.794665 -0.993538 0.725072 0.723170 0.382019 1.911439 1.497914
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.926731 -0.531912 -0.969811 4.499192 2.667985 16.365873 1.969147 2.486724 0.727716 0.723159 0.383280 4.380687 3.460238
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.717493 18.435981 23.391618 24.703677 6.754173 12.379639 2.752020 5.159782 0.035463 0.029547 0.003833 1.245077 1.229050
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.076388 -0.147776 0.529628 -1.047617 5.762592 -1.041393 40.524521 -0.766237 0.708784 0.717402 0.395239 3.304905 2.902005
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.170781 0.533410 -0.929779 0.140759 0.879593 -0.807032 1.731307 0.020021 0.727682 0.716678 0.401415 3.261980 2.801836
149 N15 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 2.748027 18.744486 1.393919 24.606922 1.451706 12.265063 0.173585 3.691267 0.715668 0.034871 0.548332 4.202576 1.204687
150 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 16.101788 18.009975 23.214186 24.539051 6.627700 12.273758 3.544972 3.886714 0.027032 0.029063 0.001118 1.217898 1.211888
151 N16 not_connected 100.00% 1.14% 0.00% 0.00% 100.00% 0.00% 34.595779 1.036030 9.555476 1.722802 3.767937 3.131353 0.905283 -0.623953 0.576103 0.657579 0.409331 2.258954 2.267444
152 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.046929 1.228790 5.578687 7.764427 -0.331100 0.878411 7.054303 -1.024339 0.669759 0.676538 0.435003 2.560749 2.602560
153 N16 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 15.610285 0.496174 7.607398 5.752468 6.777402 9.874079 1.779605 -0.987555 0.042430 0.663334 0.574653 1.233204 2.396796
154 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.392525 0.335415 12.178367 10.967909 1.095693 1.346901 -1.866551 -1.571701 0.671087 0.668851 0.441212 2.430961 2.418392
155 N12 digital_maintenance 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 14.998845 0.343218 22.389622 -1.041986 6.567752 7.521732 2.782741 2.449656 0.055527 0.684743 0.500613 1.296905 3.034016
156 N12 digital_ok 100.00% 70.86% 0.00% 0.00% 100.00% 0.00% 11.696258 -0.087191 22.057910 0.899681 5.861854 -0.368380 2.612195 0.853506 0.320205 0.692845 0.473918 1.592174 3.062442
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% 0.610785 -0.404078 1.131036 0.595042 -0.984068 -0.557692 -0.185367 -0.871352 0.709574 0.699003 0.407554 1.678116 1.485516
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.034370 -1.188884 7.823782 1.375086 1.137805 0.489622 1.890165 19.816786 0.725090 0.706557 0.411396 3.243864 2.868157
160 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.249502 2.883998 19.789948 17.186308 3.593246 7.144911 0.044270 -0.858531 0.718043 0.706582 0.395486 2.777283 2.734011
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.444162 41.303977 0.599368 3.196638 -0.636913 5.854469 1.580963 1.992218 0.729414 0.589586 0.355823 2.984818 3.545198
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.00% 2.048935 -0.157721 -0.927343 -0.863085 1.559319 0.643155 0.633231 -0.172667 0.730677 0.717607 0.386749 1.886757 1.624621
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 2.29% -0.631160 -1.210741 -0.679964 0.433922 -1.368224 0.015492 -0.315683 0.887606 0.727747 0.709565 0.385231 1.870808 1.598993
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 9.71% 0.858688 -0.524297 -0.175811 0.562690 -0.679370 0.823307 0.232275 3.080400 0.724234 0.712760 0.389403 2.076043 1.603981
165 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% -0.263539 -0.422176 3.186943 -0.959518 1.349261 -0.812459 -0.060012 -0.522766 0.730691 0.710082 0.395859 1.852830 1.608848
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 32.149880 38.733835 0.864873 1.205443 3.782291 3.686472 26.787662 12.914007 0.644357 0.604949 0.299770 3.404006 3.434874
167 N15 digital_ok 100.00% 7.43% 0.00% 0.00% 100.00% 0.00% 67.152928 57.198306 4.364085 2.397298 7.488978 7.863170 24.243180 70.483647 0.521872 0.549890 0.193945 3.341461 2.886276
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.526063 1.926534 0.617050 -0.999053 0.739750 0.417549 0.012256 -0.503281 0.722773 0.707803 0.405183 3.702618 3.149859
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.163434 5.834948 0.421182 0.494698 -1.183761 0.645655 -0.329880 1.249293 0.722942 0.689275 0.411978 3.657399 2.922145
170 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.933470 1.974771 0.299626 -0.824819 0.219724 0.213082 9.171490 2.419900 0.715265 0.704447 0.420635 3.144971 2.647397
171 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.893962 5.024504 7.146122 -0.148006 -0.309535 1.642503 -0.607468 -0.371254 0.680393 0.616062 0.421872 2.763073 2.195293
173 N16 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 18.181028 19.080273 6.728889 8.144201 6.423664 12.026065 4.440006 11.483479 0.037572 0.040474 0.003502 1.235788 1.238320
176 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.533027 0.387499 0.137347 -0.457126 -0.301851 0.949113 0.189988 5.100789 0.693086 0.681599 0.418885 3.324141 3.036270
177 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% -1.180886 -0.747399 0.871834 0.985877 -0.595043 1.034789 -0.406587 0.420684 0.699766 0.683716 0.417725 1.704220 1.455678
178 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% 3.103551 -0.571552 2.902284 -0.613436 -1.003292 2.167178 2.223384 2.055668 0.691861 0.692267 0.419512 1.657883 1.382184
179 N12 digital_ok 100.00% 100.00% 98.86% 0.00% 100.00% 0.00% 16.279530 18.929018 23.525783 25.646513 6.980032 12.488888 1.580866 2.232272 0.038562 0.118081 0.063153 1.217829 1.239327
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 1.038063 18.985491 1.838854 24.878202 0.369400 12.486892 2.424239 5.938325 0.721110 0.060908 0.526969 2.776559 1.211511
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.934004 -0.682091 18.754474 12.742371 3.294148 1.365252 -2.211175 2.419066 0.727824 0.714829 0.402721 2.907019 2.831865
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.049192 4.300429 13.455576 18.044524 1.617073 6.434689 5.870317 12.260780 0.669299 0.709837 0.409854 2.692346 3.259168
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.424039 -0.523729 0.896956 -0.723490 -0.220396 -0.385233 1.612879 8.019586 0.722779 0.702143 0.389474 3.311232 2.655266
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% -0.497105 0.222824 -0.870983 0.651487 0.876123 -0.761655 0.757776 -0.401505 0.724800 0.697515 0.395981 2.059583 1.713807
185 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% 0.611277 -0.780636 -1.107457 0.690874 1.657046 -0.924794 -0.384993 -0.228293 0.733265 0.706265 0.401929 1.748148 1.532563
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% 0.281018 -0.627658 -0.101022 -0.924637 0.953462 -0.294016 2.324179 0.085301 0.727095 0.709514 0.405501 1.702953 1.531208
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 0.57% -0.033520 -0.313230 1.038078 -0.647439 -0.735773 -0.942821 1.756956 1.173951 0.715220 0.706361 0.404389 1.590824 1.530156
189 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 3.43% 4.00% 1.830103 2.498315 0.001374 1.559555 -0.502842 1.245633 0.024042 2.113967 0.716833 0.706033 0.411811 1.904078 1.569311
190 N15 digital_ok 100.00% 10.29% 100.00% 0.00% 100.00% 0.00% 59.664669 17.967691 3.801551 24.771529 7.599216 12.516560 28.755924 4.591534 0.516409 0.036659 0.382263 2.634108 1.265271
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.217636 -0.461161 1.004573 -0.988408 1.208632 -0.823076 8.961653 3.883841 0.714980 0.700731 0.429292 3.334440 3.154187
192 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.152433 8.993220 19.152791 23.264027 4.035908 11.653857 -3.193760 -5.057657 0.691429 0.656481 0.433259 2.555090 2.281743
193 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.096414 1.296521 23.465337 14.759859 6.000535 3.616836 -4.665199 -1.652871 0.660399 0.678962 0.448368 2.619419 2.797725
200 N18 RF_maintenance 100.00% 100.00% 99.43% 0.00% 100.00% 0.00% 17.307219 49.628673 7.796184 11.550974 6.446090 11.190583 2.620625 -1.809000 0.047956 0.200558 0.133934 1.212078 1.583630
201 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.338850 7.662063 23.404121 21.940339 5.663989 10.241914 -4.915240 -4.679412 0.688153 0.666632 0.396642 2.854223 2.608168
202 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.731893 4.554758 12.731844 -0.086617 0.228390 4.075366 -1.110792 2.849848 0.717006 0.636774 0.416880 2.753766 2.113220
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 18.233108 20.494589 7.139985 8.422128 6.572334 12.087162 4.171268 4.553670 0.035100 0.043541 0.002528 1.206841 1.213527
219 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.966129 5.507774 23.734969 19.602924 5.960178 6.711065 -5.021549 -3.955191 0.661377 0.681659 0.422868 2.409026 2.540575
220 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.761285 0.552071 9.038581 10.359196 -0.754550 1.241441 3.279281 -1.208159 0.709638 0.684577 0.406127 2.575318 2.356497
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.346269 1.068251 3.848984 9.878875 2.127733 0.769440 1.781024 -1.494229 0.681598 0.683150 0.412066 2.443666 2.399103
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.348478 1.983416 11.153057 10.820645 1.797997 0.732428 4.485260 -1.277356 0.710708 0.686192 0.410749 3.221105 2.574506
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.865133 2.134213 3.107943 8.161401 1.193103 1.377603 -0.003448 -1.496432 0.669178 0.661403 0.416368 2.689488 2.582426
238 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.678512 0.057587 14.074090 13.624615 1.550514 4.842894 -2.256953 -2.600673 0.712080 0.681473 0.417559 2.715906 2.414311
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.399370 4.580614 11.458536 -0.073242 2.706017 1.527093 -0.119387 18.632682 0.707421 0.615429 0.440992 2.976145 2.117089
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -0.009103 19.471644 2.003806 14.837315 -0.530646 12.094133 6.604165 4.180240 0.712353 0.049602 0.533725 0.000000 0.000000
321 N02 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.564392 1.176509 10.078252 10.552703 1.684411 2.716103 3.792194 1.937054 0.636183 0.608641 0.427453 0.000000 0.000000
322 N05 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.861367 3.618534 11.535022 16.613816 0.473403 6.173482 0.596859 -2.355948 0.623067 0.598390 0.418099 0.000000 0.000000
323 N02 not_connected 100.00% 59.43% 0.00% 0.00% 100.00% 0.00% 32.489126 2.551314 1.360202 15.289731 2.754936 4.857815 18.054346 -1.179009 0.401216 0.590005 0.378561 0.000000 0.000000
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.950649 3.708441 13.692029 15.203808 0.739319 4.225377 2.224949 -0.627464 0.622196 0.592403 0.408302 0.000000 0.000000
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.482458 -0.199262 14.059312 7.708743 1.171394 1.133950 -1.853098 -0.806361 0.659597 0.615498 0.432280 0.000000 0.000000
329 N12 dish_maintenance 100.00% 4.57% 0.00% 0.00% 100.00% 0.00% 4.605141 -1.240099 -0.160496 9.122492 1.641251 1.937247 4.531357 0.723621 0.562196 0.606281 0.418922 0.000000 0.000000
333 N12 dish_maintenance 100.00% 6.86% 0.00% 0.00% 100.00% 0.00% 5.201647 1.108567 0.119594 7.534231 1.413406 1.362055 2.076974 0.171593 0.560205 0.594820 0.411786 0.000000 0.000000
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, 8, 9, 10, 15, 16, 17, 18, 19, 20, 21, 22, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 135, 136, 137, 138, 140, 141, 142, 143, 144, 145, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 173, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 192, 193, 200, 201, 202, 203, 219, 220, 221, 222, 237, 238, 239, 320, 321, 322, 323, 324, 325, 329, 333]

unflagged_ants: []

golden_ants: []
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_2459856.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.0.4.dev12+g1dfcaf5
3.1.5.dev87+gc99f378
In [ ]: