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 = "2459853"
data_path = "/mnt/sn1/2459853"
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
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 9-30-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/2459853/zen.2459853.25518.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 1779 ant_metrics files matching glob /mnt/sn1/2459853/zen.2459853.?????.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 178 ant_metrics files matching glob /mnt/sn1/2459853/zen.2459853.?????.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])
    startTime = Time(startJD,format='jd')
    stopTime = Time(stopJD,format='jd')
    res = session.get_antenna_status(starttime=startTime, stoptime=stopTime)
    fem_switches = {}
    if len(res) == 0:
        femState = None
    else:
        for antpol in res:
            fem_switches[(antpol.antenna_number, antpol.antenna_feed_pol)] = antpol.fem_switch
    femState = (max(set(list(fem_switches.values())), key = list(fem_switches.values()).count)) 
except Exception as e:
    print(e)
    femState = None

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 (femState == "load" or femState == 'noise') and 80000 < stdev <= 4000000 and antCon[ant] is not False:
                antCon[ant] = True
            elif femState == "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'] = femState
to_show['Antennas in Commanded State'] = 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 2459853
Date 9-30-2022
LST Range 20.183 -- 5.860 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1779
Total Number of Antennas 180
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 3
dish_ok: 1
RF_maintenance: 36
RF_ok: 9
digital_maintenance: 11
digital_ok: 97
not_connected: 23
Commanded Signal Source None
Antennas in Commanded State 0 / 180 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 16
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 61 / 180 (33.9%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 136 / 180 (75.6%)
Redcal Done? ✅
Redcal Flagged Antennas 20 / 180 (11.1%)
Never Flagged Antennas 24 / 180 (13.3%)
A Priori Good Antennas Flagged 80 / 97 total a priori good antennas:
5, 7, 15, 17, 19, 21, 29, 30, 31, 37, 38, 40,
41, 45, 46, 51, 53, 54, 55, 56, 65, 68, 69,
71, 72, 73, 81, 83, 84, 86, 88, 91, 93, 94,
98, 101, 103, 105, 106, 107, 108, 109, 111,
112, 117, 118, 121, 122, 123, 124, 127, 128,
129, 130, 140, 141, 142, 144, 147, 156, 157,
158, 160, 161, 162, 164, 165, 167, 169, 170,
176, 177, 178, 179, 181, 183, 186, 189, 190,
191
A Priori Bad Antennas Not Flagged 7 / 83 total a priori bad antennas:
82, 89, 90, 125, 136, 137, 168
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_2459853.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 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 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 2.950398 -1.160457 -0.630322 0.406985 -0.147540 -0.750886 -0.344824 2.484618 0.731103 0.683627 0.433658 1.816492 1.450471
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.103608 4.223570 1.154236 0.000027 0.036941 -0.187846 1.432022 -0.274363 0.743396 0.679173 0.434343 3.750705 3.059273
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 6.18% -0.517816 -0.369688 -0.944867 2.105262 -0.288430 0.387839 0.806184 -0.610549 0.749310 0.690841 0.430863 1.758835 1.537370
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.485003 -1.162996 -0.193636 -0.975480 -0.591569 0.089701 1.512155 15.191707 0.741979 0.685376 0.430612 2.922575 2.856343
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.176780 4.758776 23.626931 23.671368 4.243966 7.491110 -0.356607 -4.085254 0.736938 0.665876 0.428278 3.096597 2.750481
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% -0.238539 -1.544723 0.167450 -0.601354 0.682069 -0.030102 -0.257676 1.802794 0.734218 0.681580 0.434397 1.672847 1.465173
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.354939 -1.398691 -0.480768 2.179571 -0.024237 1.270910 0.760993 0.567422 0.725457 0.665452 0.443584 1.571183 1.390008
15 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 1.12% 0.798370 -0.008149 0.321295 -0.336542 -0.179145 -0.610905 -0.031579 1.533646 0.745997 0.689866 0.427146 1.981354 1.613732
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% -1.016983 0.348363 0.420435 -0.190888 0.173201 0.464484 0.821602 2.334609 0.753910 0.688860 0.428965 1.844600 1.537672
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 1.12% -0.580652 0.670969 -0.762691 -0.821184 -0.713856 -0.305946 2.754773 0.613249 0.745026 0.697260 0.419618 1.807295 1.627422
18 N01 RF_maintenance 100.00% 0.00% 30.86% 0.00% 100.00% 0.00% 6.719894 14.956536 0.052819 0.502812 1.330838 6.282299 19.512962 33.692883 0.726278 0.456906 0.481690 2.630783 1.662490
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.124042 -1.619979 -0.334975 0.895492 -0.500444 0.549326 17.195410 15.639908 0.740493 0.697470 0.426999 2.706439 2.725638
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% -1.597817 3.335644 0.753678 -0.317087 0.943767 0.595614 1.459309 -0.299049 0.744584 0.674394 0.429542 1.571829 1.531436
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.707348 3.532966 6.280382 21.617245 -0.338996 5.940902 1.588140 -1.111317 0.741489 0.680266 0.435703 3.402832 2.962628
22 N06 not_connected 100.00% 31.98% 0.00% 0.00% 100.00% 0.00% 32.490669 12.137748 2.078711 10.185805 8.369442 7.472860 8.031803 9.858229 0.486149 0.623947 0.363560 2.268376 3.199849
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.212253 15.176127 25.248663 26.476085 6.952807 10.938813 4.808046 3.236273 0.034537 0.039259 0.002869 1.144976 1.146116
28 N01 RF_maintenance 100.00% 49.41% 100.00% 0.00% 100.00% 0.00% 17.334832 33.563228 0.883520 3.020828 6.468292 7.600262 11.283300 25.837793 0.382216 0.163621 0.245267 4.483657 1.685306
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.56% -1.331592 -1.027041 -0.951912 -0.371285 -0.579603 -0.868656 -0.362482 1.828752 0.750760 0.695393 0.415725 1.782099 1.572060
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.284029 -1.323361 0.174829 -0.050614 -0.236176 -0.729193 13.701699 0.078479 0.744044 0.698487 0.414417 2.789460 2.598811
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.248874 0.759446 12.073445 15.095072 0.092733 0.877015 0.421845 1.408046 0.766519 0.712082 0.423388 3.099427 2.719030
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.072398 8.397500 21.579305 22.664197 4.639148 8.792060 0.643812 -0.430664 0.621015 0.603309 0.241243 3.291033 2.830074
33 N02 RF_maintenance 100.00% 0.00% 13.49% 0.00% 100.00% 0.00% -0.421198 16.400503 -0.929424 0.419486 -0.327282 4.061961 1.683936 27.158872 0.738875 0.504139 0.508853 3.119458 1.699935
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 15.115139 2.708840 8.419716 8.423114 7.037320 4.055470 2.456752 0.055527 0.044664 0.660194 0.550658 1.242437 3.383687
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.538578 0.286348 3.280390 9.364082 1.348007 2.099451 7.156600 -0.081770 0.666741 0.655536 0.452645 2.817366 3.047641
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.214019 8.338323 0.042118 -0.191187 0.402541 0.594540 0.421164 0.934878 0.748401 0.691393 0.427774 3.116597 2.644382
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.540460 0.464540 0.423311 -0.427434 -0.907360 -0.315733 0.203476 18.323428 0.752502 0.704148 0.429100 2.977421 2.519719
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.302569 0.457271 -0.318519 0.433876 1.689048 2.884907 9.976622 3.206779 0.756618 0.707172 0.428668 3.041582 2.631236
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 12.92% 0.100919 -0.513365 -0.590229 -0.003646 0.808784 -0.629415 -0.573340 -0.770342 0.748405 0.693964 0.420666 1.846995 1.605631
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 17.98% 0.209785 -0.101343 3.046019 -0.865603 0.450495 -1.163421 -0.600250 -0.868526 0.757403 0.696476 0.415355 1.958842 1.675346
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.027486 2.585584 0.889812 -0.714043 -0.886527 -0.761142 0.351409 -0.766632 0.762818 0.695116 0.426403 1.797738 1.565882
43 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
44 N05 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.106429 2.265629 0.304628 -0.677355 7.546225 -0.274065 32.937583 12.933379 0.715368 0.696623 0.397979 2.828087 2.707054
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.322411 0.147994 -0.388426 -0.251757 1.281082 1.614826 0.605533 27.101867 0.750022 0.690246 0.418661 2.990637 2.579208
46 N05 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -1.266896 15.771808 0.793469 26.629936 0.229348 10.824928 0.279276 4.474593 0.745122 0.039588 0.579378 3.054161 1.198064
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 291.668882 291.397730 inf inf 4733.846888 4718.073706 12150.459954 12037.910699 nan nan nan 0.000000 0.000000
48 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.573063 2.390249 16.518311 17.670874 1.761878 2.120566 -1.943922 -3.095155 0.724072 0.678885 0.445313 3.467913 3.190201
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.335861 1.937143 10.173473 17.412258 1.279316 3.833866 0.076025 -1.634996 0.699224 0.665292 0.444774 3.269629 3.218740
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.545801 28.824201 -0.089809 1.437969 2.427991 3.786894 6.028703 20.288520 0.744093 0.611288 0.392076 3.969801 3.555099
51 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.945802 7.805099 2.633265 2.411362 6.707154 -0.997001 1.575837 -0.074574 0.754568 0.707437 0.415678 2.957104 2.623897
53 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 294.227658 293.971239 inf inf 4412.988886 4389.329760 10759.033869 10672.421002 nan nan nan 0.000000 0.000000
54 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 13.178242 6.237780 25.244431 -0.445930 7.006733 1.174340 3.597999 2.643794 0.050036 0.688703 0.535797 1.382289 2.608710
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 0.386904 16.636244 -0.221165 26.918892 6.659146 10.891833 4.040445 1.935329 0.749888 0.035167 0.548290 3.129552 1.135533
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.773461 0.393032 0.149725 1.632661 0.457820 1.419034 0.716039 4.414120 0.757636 0.711276 0.400870 4.421037 2.812339
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 37.624586 0.633306 7.857053 -0.011644 3.335563 -0.286635 5.689099 0.534105 0.602130 0.707114 0.386035 4.458444 2.685874
58 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 12.630936 15.700276 25.074350 27.012031 7.119570 11.121337 5.017723 4.347638 0.038921 0.035233 0.002063 1.158040 1.152649
59 N05 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 30.645108 3.140462 2.434389 0.250182 2.991383 0.566680 4.194870 5.984501 0.674058 0.695290 0.399533 2.703891 2.743787
60 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 294.578223 294.003975 inf inf 4411.442915 4229.465736 10804.572349 9469.467256 nan nan nan 0.000000 0.000000
61 N06 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 290.535673 290.838314 inf inf 3971.304384 3900.022268 12485.943686 12542.449101 nan nan nan 0.000000 0.000000
62 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.038282 2.789881 14.150397 17.316849 0.824885 4.137747 -1.025665 -2.886980 0.728319 0.680426 0.434447 3.939765 3.160674
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.172954 15.802372 13.794099 9.484296 0.098827 10.942241 0.103072 4.566450 0.692839 0.046790 0.613678 3.148280 1.236806
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.656190 1.358440 9.978579 14.767341 0.392481 2.231898 2.370507 -2.016493 0.682950 0.645941 0.449381 3.169238 2.957750
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.56% 0.672932 -0.055290 0.637187 -0.861816 1.462488 0.868705 0.939821 0.266464 0.742009 0.698685 0.432175 1.720238 1.525303
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.411780 1.319160 0.339961 -0.541229 0.584651 0.046763 -0.415615 2.045726 0.749711 0.706105 0.423905 1.757247 1.500345
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% -0.744702 -0.625932 -0.865062 0.216369 0.696434 -0.626360 1.089981 3.058336 0.751942 0.712975 0.417178 1.598375 1.493868
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 1.653387 34.583930 0.791714 37.141266 0.339233 10.283312 -0.047142 16.170125 0.749578 0.032407 0.522304 2.957061 1.121148
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 64.61% -0.122043 -1.060339 0.118799 0.206679 1.551696 1.117934 -0.022844 1.539862 0.752969 0.712189 0.410567 2.887215 2.608254
70 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.794756 -0.835055 -0.223138 -0.563062 5.738211 1.090376 0.337543 0.586479 0.768243 0.715607 0.408544 20.060263 15.296420
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 99.44% -0.172393 -0.902205 -0.121582 -0.727415 -0.063215 -0.969351 -0.373525 -0.056032 0.755031 0.718537 0.412582 14.638602 12.996487
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 30.90% 3.158922 -0.164275 -0.499045 0.805604 0.782115 0.998524 3.192798 -0.706583 0.752839 0.711120 0.400166 1.901057 1.582480
73 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 12.304192 14.953970 24.789659 26.169757 6.826879 10.792674 4.896368 1.925465 0.026891 0.026734 0.000417 1.146220 1.141166
74 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 270.681642 270.232393 inf inf 5167.971131 5127.988269 13905.006873 13691.873706 nan nan nan 0.000000 0.000000
75 N05 digital_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 7.169239 16.060238 9.573397 27.216504 2.656685 11.220745 19.539174 4.879669 0.705666 0.047201 0.539775 2.569465 1.154282
77 N06 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 292.259756 292.608523 inf inf 4728.737953 4631.840688 12068.621199 11528.598379 nan nan nan 0.000000 0.000000
78 N06 not_connected 100.00% 11.80% 0.00% 0.00% 100.00% 0.00% 36.821053 0.124927 11.672415 13.421777 4.182604 0.823653 -0.114445 -0.143664 0.534969 0.659195 0.388593 2.904253 2.830357
81 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 1.12% -0.810099 0.111861 0.201859 1.104945 0.659403 1.890814 -0.389318 -0.420957 0.714212 0.669073 0.425534 1.797371 1.641607
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.600576 0.961513 3.224588 -0.412969 0.007609 -0.211583 -0.252220 -0.924330 0.738314 0.693835 0.425007 3.585473 2.911092
83 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.290959 0.001044 4.153513 1.075058 -0.997299 -0.419048 -0.716269 -0.279600 0.747919 0.705631 0.418449 2.973632 2.808683
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 9.265092 30.746781 -0.202615 35.725930 -0.923370 10.407340 -0.578637 8.488363 0.753146 0.044331 0.634098 3.165093 1.134478
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.607776 -0.165884 -0.854373 -0.656213 -0.360652 -0.429668 -0.726564 -0.872203 0.750210 0.708434 0.416925 1.482184 1.437245
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.625484 8.162828 -0.703260 0.122300 6.501774 1.612834 1.930105 24.464781 0.747820 0.669971 0.414603 2.988494 2.499322
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 20.613923 8.971109 4.512688 0.171808 17.158992 1.538802 23.624379 1.618642 0.683351 0.724336 0.399747 3.011100 2.814653
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 23.03% 1.088870 0.842317 1.789686 -0.835125 -0.726803 1.629154 -0.007887 -0.580652 0.753128 0.708039 0.404058 1.847911 1.493004
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.656020 0.055637 3.273180 0.384694 0.585449 -0.921524 -0.977071 -0.950941 0.761382 0.703934 0.410805 4.082809 3.014726
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.312065 0.335235 -0.819990 0.778801 -0.461580 -0.633784 0.142006 2.579813 0.749279 0.694651 0.409140 3.402631 2.828641
91 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
92 N10 RF_maintenance 100.00% 85.95% 100.00% 0.00% 100.00% 0.00% 46.026970 58.720136 4.260242 5.574549 5.732477 9.716265 0.825479 9.004296 0.318028 0.252425 0.124295 2.271003 1.800481
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.211674 0.038487 1.343669 -0.830007 2.272249 -0.465223 8.083988 -0.499965 0.739754 0.695108 0.424903 3.395199 3.029207
94 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.296624 -1.729511 -0.467066 -0.576897 0.368822 1.823597 2.542937 6.273088 0.741879 0.687311 0.431400 3.439177 2.919377
98 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.021342 4.070709 -0.782453 -0.333311 0.054953 1.316795 1.041460 3.113092 0.707491 0.666746 0.426427 3.495829 3.294839
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 1.655525 -0.237821 2.030483 0.492830 0.992806 3.549435 2.135357 -1.010351 0.712156 0.690432 0.428322 1.799596 1.508870
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% -0.774034 -1.075899 -0.896104 1.262789 0.696375 -0.356035 0.007887 -0.490671 0.732712 0.688815 0.419474 1.639544 1.497614
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.971055 9.677292 5.254523 1.395460 -0.113573 -0.755236 0.104507 -0.561689 0.758688 0.711394 0.412941 3.077584 2.757125
102 N08 RF_maintenance 100.00% 44.91% 100.00% 0.00% 100.00% 0.00% 10.470701 16.758944 23.453450 27.072171 3.927427 11.120296 1.528956 7.682660 0.453760 0.042390 0.377607 1.504909 1.217557
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 28.860478 30.962862 29.366081 30.998286 7.496437 11.469320 13.568278 13.494013 0.028125 0.028197 0.001362 1.137584 1.136146
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.570183 68.967464 5.465755 22.309589 1.319886 1.365576 -0.276142 0.177718 0.766699 0.665650 0.444794 3.314769 2.476410
105 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 4.49% 0.101835 1.255730 0.003646 0.185362 2.689140 0.925552 0.570452 -0.452498 0.747470 0.707742 0.406095 1.728765 1.450095
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 3.93% 3.574522 -0.179422 -0.290321 -0.336760 -0.007609 -0.052771 1.732251 3.712501 0.738382 0.702582 0.405676 1.667088 1.476169
108 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -0.759131 15.603088 -0.701080 26.141594 0.028657 10.852371 0.763184 3.080718 0.752009 0.038656 0.534898 4.016515 1.243241
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 32.771297 12.738302 2.016288 0.042453 4.810441 9.782669 7.604390 39.766337 0.642928 0.675937 0.343826 4.201306 3.299448
111 N10 digital_ok 100.00% 0.00% 92.13% 0.00% 100.00% 0.00% -0.111516 14.141088 0.305615 25.692828 -0.743551 10.058180 0.732217 5.134917 0.743997 0.237567 0.527922 3.880660 1.407193
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.56% -1.020192 -0.572203 -0.796563 -0.367961 -0.397118 0.692787 1.664653 -0.953616 0.734502 0.688833 0.437242 1.395544 1.303880
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% -0.941794 0.699048 1.587861 2.607923 0.666912 0.759426 2.059296 -0.974926 0.702928 0.680220 0.437303 1.791414 1.610986
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.403660 17.543541 25.259488 27.863669 7.252044 11.133811 3.065071 5.836944 0.027606 0.032704 0.004167 1.210436 1.201127
118 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.589617 0.539667 -0.498811 0.952565 1.473397 5.868204 0.342256 1.031942 0.734117 0.695447 0.421853 3.344553 2.770118
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.854235 5.852601 8.266695 12.255947 -0.710682 10.377077 -0.803099 1.701217 0.749737 0.589596 0.461860 2.900100 1.920112
120 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 2.158347 30.141997 11.225886 35.505668 0.703537 10.804758 6.628351 14.682194 0.729446 0.034463 0.613908 2.817219 1.146323
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.894634 6.345265 0.703975 1.407090 -0.390078 -0.165713 55.944330 20.685097 0.757814 0.714167 0.416500 3.146613 2.690759
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.495028 8.915978 0.047823 0.783234 2.712134 -0.811498 0.140086 -0.869521 0.762703 0.718183 0.412038 3.516971 2.914458
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.461234 11.100985 2.529739 -0.045194 -0.941873 0.066857 -0.242151 0.026592 0.768804 0.723880 0.410791 3.875547 3.006906
124 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.456600 1.537032 6.627300 9.294882 0.086622 0.452347 0.505088 0.137944 0.770914 0.691604 0.423382 4.089962 2.826913
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.204759 -0.393062 -0.403807 1.811594 -0.786184 -0.161715 -0.549410 -0.943405 0.745327 0.711876 0.406805 3.951640 3.365387
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 22.439438 1.218834 2.721195 -0.702963 9.520009 0.484344 11.037544 -0.665214 0.683505 0.704564 0.412798 3.462355 3.047368
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.56% -0.569669 -0.100039 0.974694 -0.902389 0.733179 -0.121037 0.296013 1.140251 0.747753 0.710655 0.421578 1.632833 1.362696
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.234238 5.017066 0.489391 1.251652 -0.047595 1.597028 -0.049157 -0.383072 0.748761 0.698130 0.420971 3.426667 3.355952
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.56% 1.292306 -1.038312 -0.730817 -0.969778 0.495001 -0.432432 -0.460524 -0.642398 0.745659 0.702748 0.430187 1.487513 1.325331
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.605488 0.188195 -0.728332 -0.740087 0.275230 -0.363573 3.566213 5.419430 0.726950 0.691245 0.426379 3.441579 3.179739
135 N12 digital_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -1.315125 15.784046 6.263655 27.086274 0.487261 11.194975 0.446692 1.545283 0.698003 0.039927 0.505655 3.496835 1.196255
136 N12 digital_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.237291 0.676050 1.783440 0.849337 -0.410167 2.042087 -0.182366 0.637151 0.701498 0.669224 0.427322 3.541321 2.901571
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.454181 -1.046597 0.652915 -0.936917 1.757817 3.188313 0.374755 0.367577 0.721070 0.676826 0.428248 3.445697 2.797845
138 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.274340 0.445834 -0.484529 -0.621581 -1.049872 -0.443618 5.307876 -0.747477 0.737389 0.693986 0.431908 3.371363 2.773665
140 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.207145 16.323460 24.646633 26.761505 6.821126 10.747339 3.634891 4.816624 0.038528 0.038870 0.002075 1.142767 1.142614
141 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.689347 4.333025 -0.595114 7.172965 0.902327 4.449920 2.003782 35.899568 0.738295 0.667088 0.400617 3.662871 3.189004
142 N13 digital_ok 100.00% 77.52% 100.00% 0.00% 100.00% 0.00% 39.314170 15.532230 2.147044 26.907483 7.062172 11.002068 3.608707 3.274847 0.346203 0.037926 0.205531 3.424098 1.230204
143 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 1.157481 -1.248067 -0.471601 -0.699690 0.808546 0.036883 -0.461115 -0.960915 0.747734 0.713798 0.403765 1.657525 1.387694
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.539132 -0.263310 -0.713636 5.233308 -0.613321 0.212187 0.543507 32.140498 0.754372 0.716369 0.410479 4.643008 3.943921
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.797400 16.141653 25.440133 27.072548 7.129205 11.101348 3.615199 5.600732 0.036991 0.028079 0.005772 1.272970 1.262842
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
148 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 257.056455 255.587081 inf inf 4628.718886 4950.294919 11262.209361 12864.011238 nan nan nan 0.000000 0.000000
149 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 272.408871 272.786077 inf inf 4393.034677 4275.498535 10570.190198 9865.150937 nan nan nan 0.000000 0.000000
150 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.052641 15.629237 25.216981 26.869425 6.976906 11.016164 4.451049 4.592447 0.026514 0.029512 0.001180 1.230970 1.227278
151 N16 not_connected 100.00% 7.31% 0.00% 0.00% 100.00% 0.00% 31.688165 0.817660 11.249701 3.037308 2.479379 2.029976 2.549074 -0.198550 0.591964 0.645171 0.416299 2.614475 2.465047
152 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.799259 0.978516 8.182242 10.099620 -0.253361 0.818707 20.816762 -0.933598 0.698378 0.665435 0.456001 2.767134 2.621880
153 N16 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 13.682671 0.303434 7.669268 8.574990 7.170864 9.015494 2.082718 -0.515099 0.042853 0.654020 0.555271 1.207114 2.523630
154 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.151591 -0.122604 15.018212 13.658491 1.937662 1.159429 -1.429812 -1.228228 0.697882 0.657532 0.463008 2.914872 2.738614
155 N12 digital_maintenance 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 13.181963 -0.366980 24.280859 0.931982 6.831727 1.229111 1.968624 3.775003 0.061259 0.676085 0.495051 1.267768 3.048713
156 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 12.397913 0.105511 25.004403 2.109798 6.761598 -0.555602 0.988657 0.136421 0.108535 0.683340 0.487080 1.376976 3.466842
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.56% 0.123590 -1.026975 0.396843 2.714990 -0.532213 -0.519885 -0.442063 -0.593007 0.731323 0.675990 0.428656 1.676761 1.469140
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.122350 -1.084705 21.720409 2.208989 4.229689 0.498467 0.922278 33.083776 0.743045 0.686751 0.433418 3.710240 3.243636
160 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.386974 16.804374 25.042664 26.662553 6.948105 10.862596 4.008434 5.386148 0.040606 0.042932 0.003041 1.210251 1.207691
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.110955 33.855299 -0.889591 2.616594 -0.812570 2.617360 0.971309 0.995616 0.742656 0.572380 0.389310 3.258959 3.806512
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.56% 1.373166 0.008149 -0.764397 0.161772 1.058167 0.536865 0.425720 -0.076700 0.752453 0.706711 0.412562 1.855139 1.571200
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.189152 -0.634157 -0.813759 0.062871 -1.102587 0.363817 0.292869 2.159505 0.756517 0.703951 0.415186 1.769252 1.614316
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.757432 -0.730886 -0.952982 0.763406 -0.917130 0.631378 0.600373 7.313578 0.751633 0.702244 0.417148 3.699188 3.291651
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.305579 0.358700 5.411677 -0.790454 1.802816 -0.948021 1.267482 -0.142786 0.759268 0.705007 0.421904 3.953636 3.505537
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 13.404899 14.974747 0.789713 1.167648 1.757914 7.718874 20.601202 38.605290 0.716055 0.653517 0.383073 4.238378 3.862068
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 46.676812 50.106730 5.726009 3.255623 7.175600 5.963599 25.240706 70.592825 0.630718 0.553446 0.297934 3.451000 2.737914
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.455857 1.709183 0.243803 -0.190257 0.699698 0.251935 0.368750 -0.021886 0.743209 0.698363 0.430726 3.714075 3.095725
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.053905 4.308804 -0.225515 -0.154956 -0.961827 -0.352462 -0.223534 1.986117 0.744711 0.680754 0.435908 3.629035 2.736501
170 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.956676 1.439320 0.883911 -0.042041 -0.427972 -0.589497 11.181394 4.606093 0.731822 0.693109 0.440865 3.326111 2.915951
171 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.818240 5.441394 9.358166 -0.049308 -0.064410 1.785154 -0.364690 -0.317444 0.705142 0.590822 0.453017 3.352257 2.266019
173 N16 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.764870 16.625512 6.637464 8.394032 6.789884 10.844642 5.479900 12.512843 0.036626 0.042524 0.006211 1.226591 1.228333
176 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.272202 -0.346315 1.014359 1.770538 -0.187058 -0.014225 -0.099336 11.720701 0.710617 0.663482 0.445476 4.173223 3.623369
177 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.56% -1.230367 -1.088548 0.143781 2.104268 -0.083023 1.174188 -0.492335 2.519503 0.723813 0.675078 0.442155 1.575008 1.407322
178 N12 digital_ok 100.00% 2.25% 0.00% 0.00% 100.00% 0.00% 6.547955 -1.433441 18.200895 5.556661 2.311278 0.363364 1.809435 2.762254 0.607420 0.668756 0.447986 2.236840 2.808964
179 N12 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.261613 16.935125 25.612936 28.307057 7.383490 11.436296 2.040684 2.683283 0.038792 0.057803 0.012476 1.220271 1.220026
180 N13 RF_maintenance 100.00% 0.00% 85.95% 0.00% 100.00% 0.00% 0.639601 13.694874 -0.023292 25.912013 -0.160252 9.948857 -0.086500 3.893170 0.750162 0.302968 0.531700 11.220061 2.235381
181 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.024416 52.404962 25.592433 7.054299 7.043945 11.964166 3.708083 17.402218 0.046912 0.201598 0.102197 1.218603 1.707826
182 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 2.524487 15.406385 20.289518 26.091707 1.975285 10.856147 -3.109609 4.122838 0.758837 0.052988 0.579104 3.714564 1.376880
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.935023 -1.000174 -0.873257 1.316501 -0.268385 -0.253502 -0.242973 6.552273 0.751233 0.696112 0.417660 3.493496 3.161960
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.045812 0.105735 -0.692769 0.156656 -0.383727 -0.684931 2.310248 1.326567 0.751967 0.689383 0.420299 1.749053 1.539076
185 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.629485 -0.969839 -0.463335 0.029605 -1.204060 -1.152468 0.327696 -0.814227 0.755520 0.698845 0.422131 1.607619 1.462610
186 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.767818 -0.393977 -0.239548 -0.709160 0.969631 -0.083110 4.151116 -0.160704 0.748654 0.699301 0.424665 3.487993 3.387835
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.194833 -0.538085 0.638490 -0.923812 -0.950113 -0.700595 3.382978 3.587845 0.737981 0.698866 0.427678 1.674471 1.389969
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.629147 3.978707 22.172002 20.234462 2.776562 6.192361 -3.468330 -0.291341 0.741721 0.697233 0.436598 4.162925 3.374107
190 N15 digital_ok 100.00% 6.75% 100.00% 0.00% 100.00% 0.00% 22.433535 15.992272 21.574853 27.125637 6.224771 11.248663 25.688654 4.386708 0.551384 0.046635 0.423888 2.638283 1.152874
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.478975 1.405275 21.714443 18.935077 2.353347 4.001820 0.482445 3.397753 0.736097 0.697479 0.451982 3.757535 3.163712
192 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.527361 7.903747 23.021216 27.571293 4.262232 10.516313 -2.809199 -6.128857 0.720064 0.647575 0.457397 3.236093 2.670735
193 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 7.949639 1.140003 27.982061 18.076573 6.357228 2.711129 -5.757760 -1.361464 0.689740 0.668874 0.468040 2.882133 2.916085
200 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.121084 41.119658 7.838391 14.531188 6.832286 9.295279 3.147642 -1.398086 0.050356 0.207916 0.134896 1.224642 1.640459
201 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.165279 6.850294 27.873535 26.098065 6.051594 9.199484 -5.618139 -5.323790 0.715156 0.656926 0.425280 3.197629 2.834052
202 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.760386 5.235682 15.713652 -0.463797 0.219037 4.281642 -0.277596 4.053221 0.742764 0.614508 0.449352 3.237151 2.262248
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.849040 17.867579 7.115040 8.699817 6.951099 10.915042 5.086129 5.579741 0.034377 0.046308 0.004418 1.223498 1.228277
219 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 7.853262 4.961231 28.290271 23.585569 6.430560 6.121566 -5.802598 -4.362911 0.689354 0.670843 0.444584 2.520580 2.583066
220 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.457203 0.149894 11.635622 13.203258 -0.366908 1.258801 3.109802 -0.983899 0.731215 0.675604 0.428512 2.965167 2.656290
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.063570 0.786990 5.445654 12.595520 2.654121 0.641888 3.050857 -0.731189 0.707974 0.675671 0.436562 2.761129 2.622149
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.386389 1.734551 13.822660 13.722306 1.937519 0.713666 12.068977 -0.131485 0.734241 0.677138 0.432664 3.586321 2.868459
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.601765 1.919405 4.749562 10.394968 1.625084 1.676209 1.062679 -1.007863 0.695619 0.654242 0.443273 2.898507 2.709752
238 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.156052 -0.122920 17.226802 16.413602 1.793556 4.600765 -2.037081 -2.623310 0.739037 0.674559 0.441197 3.159949 2.712515
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.269403 3.689128 11.710852 -0.405177 0.182677 2.844571 11.869176 26.674775 0.733310 0.607708 0.464288 3.459396 2.406802
320 N03 dish_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
321 N02 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.030013 0.858194 12.649094 13.117359 2.364084 3.191826 4.362209 2.616290 0.668742 0.598703 0.457411 0.000000 0.000000
322 N05 digital_maintenance 100.00% 0.00% 0.56% 0.00% 100.00% 0.00% 1.541159 3.045685 14.288658 19.903204 1.682540 5.662853 -0.129659 -2.979499 0.654754 0.589371 0.448439 0.000000 0.000000
323 N02 not_connected 100.00% 48.29% 0.56% 0.00% 100.00% 0.00% 27.154660 2.059354 1.571503 18.450859 3.561175 4.415951 12.851636 -1.117388 0.424074 0.579907 0.388435 0.000000 0.000000
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.429913 3.168733 16.873814 18.333728 1.645442 3.789892 0.529702 -1.944533 0.657194 0.587554 0.436945 0.000000 0.000000
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.991528 -0.482315 17.218636 9.909758 2.085918 0.867170 -1.882944 -0.135623 0.692963 0.607922 0.462206 0.000000 0.000000
329 N12 dish_maintenance 100.00% 10.68% 0.56% 0.00% 100.00% 0.00% 5.230109 -1.305967 -0.397429 11.259654 2.314974 2.305145 5.181575 0.514983 0.576617 0.597380 0.444307 0.000000 0.000000
333 N12 dish_maintenance 100.00% 12.37% 1.12% 0.00% 100.00% 0.00% 5.559429 0.860111 -0.080028 9.736486 2.931453 2.483952 2.779092 1.825083 0.572217 0.580841 0.435945 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: [4, 5, 7, 8, 15, 17, 18, 19, 21, 22, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 81, 82, 83, 84, 86, 87, 88, 89, 90, 91, 92, 93, 94, 98, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 135, 136, 137, 138, 140, 141, 142, 144, 145, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 160, 161, 162, 164, 165, 166, 167, 168, 169, 170, 171, 173, 176, 177, 178, 179, 180, 181, 182, 183, 186, 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: [3, 9, 10, 16, 20, 42, 66, 67, 85, 99, 100, 116, 143, 163, 184, 185, 187]

golden_ants: [3, 9, 10, 16, 20, 42, 66, 67, 85, 99, 100, 116, 143, 163, 184, 185, 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_2459853.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.dev83+g5d33d87
In [ ]: