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 = "2459848"
data_path = "/mnt/sn1/2459848"
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-25-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/2459848/zen.2459848.38149.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 1647 ant_metrics files matching glob /mnt/sn1/2459848/zen.2459848.?????.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 199 ant_metrics files matching glob /mnt/sn1/2459848/zen.2459848.?????.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 2459848
Date 9-25-2022
LST Range 22.894 -- 7.758 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1647
Total Number of Antennas 177
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 3
dish_ok: 1
RF_maintenance: 35
RF_ok: 9
digital_maintenance: 11
digital_ok: 95
not_connected: 23
Commanded Signal Source None
Antennas in Commanded State 0 / 177 (0.0%)
Cross-Polarized Antennas 116, 124
Total Number of Nodes 16
Nodes Registering 0s
Nodes Not Correlating N05
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 61 / 177 (34.5%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 137 / 177 (77.4%)
Redcal Done? ✅
Redcal Flagged Antennas 10 / 177 (5.6%)
Never Flagged Antennas 30 / 177 (16.9%)
A Priori Good Antennas Flagged 71 / 95 total a priori good antennas:
3, 5, 7, 19, 20, 21, 29, 30, 31, 37, 38, 41,
42, 45, 46, 51, 53, 54, 55, 56, 65, 68, 69,
71, 72, 73, 84, 85, 86, 88, 91, 93, 98, 99,
101, 103, 105, 106, 108, 109, 111, 116, 117,
118, 121, 122, 123, 124, 128, 130, 140, 141,
142, 144, 147, 156, 158, 160, 161, 162, 165,
167, 169, 170, 177, 179, 181, 184, 189, 190,
191
A Priori Bad Antennas Not Flagged 6 / 82 total a priori bad antennas:
4, 90, 125, 135, 137, 138
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_2459848.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 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.530927 -0.895665 -0.196171 -0.387607 -0.161438 0.333238 -0.256509 0.922373 0.704537 0.742402 0.388736 2.941791 2.627077
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.443747 3.209006 0.191154 -0.820712 0.221092 0.538059 1.028258 -0.719954 0.725105 0.742035 0.385811 3.844022 3.107437
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 1.51% -0.113770 0.417449 -0.098431 3.787088 -0.267868 -0.040656 0.119570 -1.126505 0.723723 0.747537 0.382330 1.629929 1.411334
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.871105 -1.164794 -0.800371 0.429635 -0.177500 1.462356 0.868358 12.176497 0.717742 0.740490 0.380486 2.999462 2.900424
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.836279 6.433545 31.684036 31.466301 8.042037 14.510878 -0.742541 -2.556065 0.714968 0.729877 0.379124 3.122789 2.904264
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 0.053157 -1.216584 -0.975065 0.317796 1.889736 0.443716 -0.465362 0.108566 0.712671 0.739663 0.388294 1.481551 1.363597
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 0.097102 -0.720190 0.022576 0.770318 -0.235388 2.583331 0.620401 0.626967 0.701916 0.728152 0.389709 1.579200 1.411103
15 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 0.911910 0.463746 -0.858642 -1.044901 0.725486 -0.811354 0.046631 0.965703 0.724425 0.749239 0.380788 1.561299 1.449661
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% -0.945367 0.485743 -0.973455 -1.067534 -1.008136 0.116463 0.524271 1.440540 0.730647 0.747735 0.380717 1.551403 1.427490
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% -0.350849 0.557700 0.477883 0.322547 -0.282686 -0.343938 2.060111 0.645556 0.724210 0.748412 0.374108 1.623968 1.494649
18 N01 RF_maintenance 100.00% 0.00% 27.32% 0.00% 100.00% 0.00% 18.366203 23.737385 -0.432655 1.540243 5.323227 13.908879 22.518693 43.756747 0.685527 0.542160 0.406236 2.622171 1.676451
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.103188 -1.226918 -0.632999 0.021573 -0.111833 3.307731 11.140166 13.373628 0.721787 0.752305 0.379209 2.720666 2.736048
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.787627 4.740143 -0.395807 -0.710027 2.373102 0.906611 1.555907 -0.136817 0.724218 0.734561 0.382346 3.573342 3.121769
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.50% -0.098223 0.819820 -0.308072 -1.023432 -0.148369 0.523145 0.315708 3.452395 0.709991 0.734440 0.384361 1.444340 1.405716
22 N06 not_connected 100.00% 23.07% 0.00% 0.00% 100.00% 0.00% 38.057983 14.271144 6.182558 14.173827 16.822895 10.309345 3.660629 4.495119 0.514485 0.681812 0.334455 2.266568 2.775096
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.306326 14.717083 29.978778 31.764530 14.383942 21.828349 3.947988 3.564457 0.034305 0.039219 0.003086 1.173852 1.172035
28 N01 RF_maintenance 100.00% 57.07% 86.82% 0.00% 100.00% 0.00% 17.697343 35.274496 0.616326 4.241720 12.499386 24.250048 5.186125 32.270133 0.424268 0.226609 0.245166 3.371299 1.593534
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.50% -1.341214 -0.686680 0.366947 0.438232 -0.483273 -0.887610 -0.458959 1.464079 0.732245 0.751785 0.369186 1.543125 1.416276
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.539499 -1.219033 1.162600 -1.173416 -0.602165 -1.068705 8.380763 -0.473136 0.721098 0.754408 0.371040 2.824408 2.663309
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.511571 -0.700487 -1.066206 0.039216 0.989295 4.508427 1.332590 2.695458 0.740267 0.752688 0.383483 3.130285 2.709563
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 27.986665 27.608595 2.800212 3.246449 4.014877 8.971015 2.434188 3.735577 0.615434 0.661134 0.212804 2.937848 2.610756
33 N02 RF_maintenance 100.00% 0.00% 9.71% 0.00% 100.00% 0.00% -0.080890 26.656354 0.162202 0.483734 -0.236459 11.857709 2.236272 33.470215 0.717316 0.581616 0.442561 3.593917 1.819218
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 15.496630 2.959010 8.518637 11.830365 14.319080 3.782307 1.121389 -0.811380 0.043032 0.727096 0.583572 1.253355 3.210068
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.616151 0.288918 2.028607 10.778105 7.786274 2.677473 2.767300 -0.391282 0.634887 0.721358 0.406310 2.568509 2.890394
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 12.193845 10.007033 -0.023591 -0.011192 2.849987 2.876716 0.213482 1.234972 0.726835 0.753098 0.387466 3.546039 2.888568
37 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
38 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
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 32.16% 0.00% 0.141179 -0.357444 -0.760877 -0.695167 -0.079228 -1.258720 -0.620463 -0.949361 0.729889 0.756477 0.369974 1.498221 1.329692
41 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.630858 -0.705737 5.404693 0.468055 1.090882 -1.082617 -0.413325 -0.433014 0.740532 0.753363 0.363267 3.660617 2.973417
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 9.05% -0.105224 2.895065 2.852055 0.596659 -0.579146 -0.547142 -0.428143 -1.068067 0.746208 0.752313 0.376194 1.398944 1.345444
43 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 12.310868 1.420030 29.268021 16.351728 14.296933 1.626501 1.627937 0.090905 0.026830 0.050112 0.022839 1.180361 1.204757
44 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 3.425168 2.808217 1.449197 -0.681661 1.890105 -0.112313 11.302603 4.970805 0.059182 0.050433 0.002844 1.224744 1.217713
45 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% -0.383336 -0.498630 -0.900849 -1.131271 1.541674 1.585424 -0.077816 23.432069 0.052418 0.052086 0.002487 1.188256 1.187993
46 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% -1.236915 15.210787 2.204795 31.820874 1.162715 21.791425 -0.151994 4.610982 0.058798 0.026497 0.029228 1.218008 1.184295
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 14.858054 2.812112 8.068598 11.983405 14.321781 5.055543 0.742712 2.793425 0.037473 0.729759 0.579586 1.072453 2.468552
48 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.249655 3.252682 22.563517 23.646458 2.939821 5.694635 -1.884104 -2.397765 0.706332 0.743906 0.389968 3.020885 2.916021
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.042428 2.946582 14.465077 23.329144 1.125132 7.796038 -0.333974 -1.421068 0.681077 0.731213 0.391895 2.583149 2.665940
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.062143 29.983109 -0.900117 2.705901 4.458155 8.280931 3.702679 12.748733 0.719036 0.683039 0.360942 3.650254 3.092050
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 32.700189 3.310303 40.656614 0.015642 14.281149 1.247090 13.300799 2.398766 0.045275 0.760409 0.507616 1.190545 2.951385
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.937407 8.996734 2.385784 2.299420 5.206761 -1.050432 0.592566 -0.197225 0.733291 0.765365 0.379889 3.319557 3.035785
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.253899 3.390257 -0.319367 0.671986 -0.615487 -0.450965 3.305232 6.357847 0.739119 0.769667 0.380477 3.222207 2.852897
54 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 13.290354 0.505495 29.735184 -0.618168 14.331254 2.109279 2.330787 3.996132 0.051165 0.760282 0.557442 1.473381 3.075815
55 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.215527 3.961324 -0.282555 -0.376686 11.245017 0.249683 -0.055625 -0.349392 0.734288 0.753926 0.354886 3.556990 2.812484
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.369653 1.064871 1.588111 2.972102 0.578368 1.404529 -0.317284 4.669023 0.742239 0.770242 0.358243 4.069408 3.049936
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 40.375309 1.080397 10.605565 1.854619 7.160995 0.252455 3.108833 0.622519 0.574266 0.763617 0.367248 3.227020 2.760799
58 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 12.698532 15.199694 29.727901 32.414797 14.360842 21.903535 4.079544 4.328012 0.027972 0.026420 0.001689 1.169238 1.165286
59 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 24.505006 3.267827 1.917040 2.352809 3.438660 -0.004557 4.790111 4.921548 0.050766 0.054291 0.001803 1.201411 1.201962
60 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.679524 15.035785 29.561586 32.088618 14.304249 21.843181 1.724090 3.354350 0.026633 0.025709 0.001060 1.154293 1.149149
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.414566 4.561601 7.831275 7.589794 8.336093 4.181156 -0.266730 5.743907 0.687074 0.719088 0.372856 2.132307 2.093209
62 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.769959 4.010204 19.462971 23.233181 2.279615 8.241565 -0.686365 -2.162525 0.712463 0.748590 0.382611 3.938115 3.124982
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.619530 15.638332 18.974518 10.126722 2.211897 21.819983 -0.539740 2.916867 0.677227 0.046477 0.582661 3.169453 1.216720
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.027190 2.103022 14.379447 19.910079 1.633364 5.229478 -0.184127 -1.534046 0.666246 0.718593 0.399223 2.672926 2.734142
65 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.405419 1.099091 -0.429053 0.851609 4.916090 1.442057 -0.093509 0.517547 0.717555 0.751688 0.400421 3.273630 3.147474
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 1.123736 2.206189 -0.985534 1.709172 0.178443 -0.196639 -0.536614 1.721658 0.725260 0.759311 0.392268 1.354773 1.291827
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% -0.021180 -0.378978 2.558241 1.391252 0.347403 1.077816 0.634209 1.186419 0.726576 0.763030 0.379644 1.354466 1.262552
68 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
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 32.16% 53.77% -0.025236 -1.103520 1.481235 -0.739533 2.277909 2.062161 -0.085535 -0.218557 0.737542 0.768723 0.367960 2.944524 2.736030
70 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.323621 -0.672141 0.086023 -1.143933 2.696610 0.632249 -0.314586 0.214673 0.754405 0.773873 0.359621 15.384548 10.906954
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 69.85% -0.331539 -0.705934 -0.972796 0.145032 1.115676 -1.245366 -0.631327 -0.696916 0.739692 0.773332 0.367952 11.687007 12.164893
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.455758 0.315058 -0.332744 1.953983 2.868572 0.512514 1.355371 -0.698851 0.730658 0.768360 0.356221 3.432040 2.903607
73 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 12.398446 1.693036 29.385857 -0.946842 14.319395 0.864711 4.105120 -0.631002 0.027117 0.060014 0.025227 1.159145 1.186780
74 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.821355 15.110901 30.460449 32.221922 14.403968 21.495444 2.166395 4.198953 0.025848 0.043318 0.010728 1.173376 1.173945
75 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 7.654769 15.564891 7.901019 32.669232 7.987541 21.929326 3.377312 4.864104 0.045242 0.029778 0.023143 1.213057 1.180830
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 23.479580 25.509194 20.777376 16.839054 10.933478 16.138107 5.967269 0.755046 0.611889 0.627631 0.209114 4.205692 3.083327
78 N06 not_connected 100.00% 12.75% 0.00% 0.00% 100.00% 0.00% 40.681405 0.819699 16.472061 18.159127 8.590059 3.189961 -0.937162 -0.255294 0.543235 0.731530 0.382840 3.799077 3.132232
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 9.821175 31.837263 0.490429 43.457779 -0.603990 21.245589 -0.573392 7.830393 0.730182 0.046729 0.589427 3.503843 1.191158
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 32.16% 1.51% -0.019938 1.030623 -0.056115 0.860891 -0.538207 0.491844 -0.784858 -0.769416 0.721184 0.752311 0.373428 1.435397 1.354512
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.186375 8.140414 0.150197 0.940665 7.298437 2.580800 1.351471 22.221843 0.728941 0.730717 0.362868 3.114802 2.586992
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 13.249287 9.550069 4.429909 5.795352 39.874177 2.998155 0.800627 0.240926 0.679596 0.771311 0.361363 3.224629 2.912160
88 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.078378 2.860110 20.004571 10.890592 0.843239 3.625693 -0.525120 -0.498692 0.753589 0.778245 0.356711 4.208373 3.429246
89 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.613723 0.315615 8.506839 2.210089 1.054987 0.202478 -0.692558 -0.892803 0.750227 0.756203 0.366071 4.473089 3.030214
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.041112 0.395820 0.353892 0.165775 -0.273451 -0.272188 -0.046631 1.771155 0.729114 0.757102 0.361165 3.462802 2.959656
91 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.836007 1.611904 16.556664 16.599670 -0.197545 0.266245 0.994145 0.168279 0.749078 0.776962 0.370726 3.579988 3.373339
92 N10 RF_maintenance 100.00% 74.68% 83.18% 0.00% 100.00% 0.00% 52.731319 63.765292 6.034684 7.040645 13.368474 23.083895 0.658474 7.130323 0.362885 0.331376 0.125495 2.089636 1.771538
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.222049 1.245096 10.391813 0.982380 1.794016 -0.296483 4.159945 -0.830649 0.700784 0.754216 0.385012 3.034265 3.061444
94 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% -1.516718 -0.424208 -0.633843 0.105210 -0.123642 3.088966 2.304237 0.746073 0.721349 0.745983 0.381296 1.380106 1.308336
98 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.366925 6.167244 -0.527001 -0.473440 2.378587 4.805318 0.845698 2.061888 0.678750 0.725456 0.388911 2.887459 2.803626
99 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.979570 0.060150 9.755684 1.094960 3.480754 0.124560 0.422474 -0.877284 0.642234 0.732632 0.405670 2.651414 2.934194
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 0.115773 -0.353247 0.319760 0.768803 0.893946 -0.932081 -0.426353 -0.815452 0.708553 0.741366 0.380081 1.386633 1.326619
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.067736 11.998082 8.097467 2.879547 0.575889 -0.572850 -0.273118 -0.798003 0.738289 0.767032 0.376529 3.686145 3.241547
102 N08 RF_maintenance 100.00% 37.64% 100.00% 0.00% 100.00% 0.00% 9.964076 16.391088 27.257740 32.517252 10.076663 21.909348 1.175418 7.144831 0.470608 0.042726 0.381645 1.651110 1.269689
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 30.507159 32.293688 35.098658 37.338896 14.687305 21.748252 12.305276 12.100898 0.027985 0.028766 0.001408 1.194014 1.197488
104 N08 RF_maintenance 100.00% 0.00% 0.00% 92.11% 100.00% 0.00% 6.484604 72.808503 -0.257568 25.082461 12.109402 6.168878 1.283935 0.718245 0.400309 0.355181 -0.265516 2.263880 2.072199
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 24.62% 0.857949 0.837383 0.122710 3.155960 0.246347 0.849867 0.071413 -1.098705 0.737970 0.768383 0.359838 1.552361 1.338486
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.448357 3.332557 -0.960771 15.607373 4.442841 1.355907 0.237477 -1.401249 0.732015 0.777055 0.369625 3.520978 3.466572
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 3.781824 1.145603 -0.567386 -0.963972 2.533506 1.775814 1.718686 3.426003 0.733477 0.764252 0.354448 1.464808 1.304090
108 N09 digital_ok 100.00% 61.93% 0.00% 0.00% 100.00% 0.00% 10.713816 4.217196 27.532794 0.599446 11.896257 0.902527 1.302464 0.877495 0.401809 0.763331 0.514346 1.547303 3.361030
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 0.203058 15.217537 0.593498 31.137511 0.133160 21.772941 -0.303940 2.481119 0.739067 0.040611 0.476500 3.841559 1.244498
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 35.900669 14.224760 4.690257 2.716259 5.216715 20.150230 2.300506 28.422787 0.649666 0.742300 0.319029 3.794538 2.852219
111 N10 digital_ok 100.00% 0.00% 78.93% 0.00% 100.00% 0.00% -0.125075 14.340236 -0.678622 30.986409 -0.671765 20.907435 2.082528 3.083096 0.729931 0.287081 0.470513 3.659136 1.307860
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 0.393021 -0.579941 3.421377 0.530274 -0.306116 0.554521 1.772287 -1.052871 0.705112 0.753744 0.393322 1.422471 1.235979
116 N07 digital_ok 100.00% 0.00% 0.00% 100.00% 100.00% 0.00% 2.015707 0.486633 4.650702 -0.551000 8.036462 6.610495 1.163621 0.993662 0.346198 0.327492 -0.292925 1.949175 1.850067
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.426500 17.077771 29.951169 33.287775 14.355314 21.888279 1.242887 4.205067 0.027540 0.032199 0.003882 1.203630 1.198845
118 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.736557 1.413054 4.485279 2.476656 0.273094 1.382166 -0.478183 -0.506722 0.701983 0.748999 0.387423 3.928265 3.362783
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.860752 3.028428 12.029960 8.501448 -1.097015 20.312455 -0.568451 -0.022487 0.728365 0.713128 0.385542 3.663328 2.405415
120 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 4.120849 31.118193 -0.113274 43.150238 0.518603 21.570070 -0.360852 12.654890 0.731088 0.041347 0.607532 3.570273 1.166819
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.169114 7.133103 -0.607764 0.856723 0.471907 0.217775 40.200937 19.387568 0.737538 0.767157 0.372272 3.436316 3.070997
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.669553 9.513934 0.957312 0.431995 8.653594 -0.813739 -0.220422 -0.970924 0.742272 0.768717 0.371660 4.149993 3.494438
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.235065 11.627961 4.727008 1.140925 -0.159774 -0.736889 -0.579437 -0.535307 0.753890 0.771241 0.368022 5.773231 3.672452
124 N09 digital_ok 100.00% 0.00% 0.00% 100.00% 100.00% 0.00% 0.441717 1.589383 5.047894 18.678089 9.606273 10.103059 3.563682 -0.575132 0.409091 0.403416 -0.289546 4.212265 4.450253
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.895876 3.018739 0.603369 3.274619 -0.118058 0.848504 -0.591155 -1.064366 0.730258 0.766495 0.360542 4.540074 3.707261
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 39.394081 1.556970 3.377120 0.173510 11.157048 6.615746 5.520922 -0.047709 0.611510 0.766235 0.361984 4.164728 3.167204
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% -0.109701 -0.538104 -0.294789 0.553834 0.695389 1.269539 -0.234867 0.169541 0.737104 0.768455 0.372621 1.426130 1.253858
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.262008 5.066744 -0.610714 2.683244 0.668659 1.883323 -0.146917 -0.349098 0.735221 0.761700 0.370615 3.460692 3.218575
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 0.821368 -1.279075 -0.430088 0.845774 0.340456 -0.683020 -0.679052 0.539852 0.729685 0.758030 0.379817 1.479552 1.322039
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.895324 0.197955 -0.013763 1.193147 0.427863 1.750262 0.235866 4.770465 0.707979 0.748878 0.382881 3.391767 2.993117
135 N12 digital_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.872784 0.046593 -0.653302 -0.367069 0.326129 0.040656 0.214865 -0.144853 0.681859 0.730509 0.401685 3.310738 3.067636
136 N12 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.092177 11.317536 -0.757099 0.048058 0.520903 1.739140 0.405137 3.453133 0.688327 0.717835 0.370794 4.462580 4.026484
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.148579 -0.620151 2.665939 -1.153067 1.746483 0.158238 0.097623 -0.320024 0.697612 0.735114 0.385132 3.976803 3.186351
138 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.270550 0.856619 -0.787081 -0.943554 -0.695391 -0.924531 3.520121 -0.883742 0.714755 0.751570 0.387025 3.795305 3.148140
140 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.223408 15.801272 28.949642 31.878264 14.278391 21.703260 2.039892 3.262989 0.038336 0.037916 0.001661 1.136798 1.136746
141 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.137598 4.071901 0.601490 8.985149 1.080515 4.597780 0.404120 26.959665 0.722000 0.730679 0.357697 3.827483 3.419790
142 N13 digital_ok 100.00% 74.07% 100.00% 0.00% 100.00% 0.00% 46.380307 14.974721 3.410724 32.286571 20.650756 21.834519 12.204735 3.509015 0.358333 0.039068 0.198678 2.861952 1.291060
143 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 0.226052 -0.906180 -0.640794 0.187368 1.085317 -0.401820 -0.587754 -1.095706 0.738347 0.767719 0.364411 1.293969 1.224692
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.124549 -0.818205 -0.161280 11.292053 -0.354372 23.133728 -0.121190 48.173161 0.734734 0.737104 0.367265 5.735127 3.913483
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.950043 15.716444 30.190289 32.483180 14.349885 21.910181 3.021592 5.438007 0.033199 0.027333 0.003521 1.287024 1.286307
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 19.377303 0.114141 6.665477 4.055627 10.841126 -1.113127 46.401902 -0.511929 0.701546 0.768225 0.369463 3.453428 2.958108
148 N15 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.802096 1.538408 9.535124 4.524227 1.307349 0.017436 0.108716 -0.442184 0.740908 0.771047 0.378776 4.103840 3.552655
149 N15 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.837462 15.982097 4.219805 32.342452 0.086509 21.819631 0.500126 4.229758 0.728408 0.038074 0.523761 4.168240 1.224123
150 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.181469 15.213435 29.925537 32.245569 14.318920 21.852401 3.682567 4.428741 0.025812 0.030491 0.001926 1.242601 1.242122
151 N16 not_connected 100.00% 8.50% 0.00% 0.00% 100.00% 0.00% 11.519703 2.273521 2.903326 3.027914 273.772357 319.502752 3909.600997 4170.537226 0.552632 0.713951 0.390851 2.680344 10.391122
152 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.042241 5.200746 26.859032 28.125928 5.063591 10.601865 6.108585 -2.483018 0.695146 0.737296 0.415866 3.257518 3.290833
153 N16 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 14.073788 1.110185 7.509394 11.514874 14.349069 6.098934 1.002256 -0.762662 0.044644 0.716670 0.602283 1.167801 2.508015
154 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.278349 0.509555 20.605677 18.524138 2.830219 3.166863 -1.352534 -0.700580 0.670417 0.721278 0.417130 2.542850 2.662705
155 N12 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.222414 14.021456 29.075734 31.556904 14.292324 21.796097 3.611034 5.268549 0.037169 0.028244 0.003349 1.303124 1.296482
156 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.017544 11.603832 -0.831632 0.173621 -0.438293 20.144089 -0.000942 31.026051 0.689546 0.697735 0.376488 3.627748 3.415829
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% -1.090368 -0.849883 -1.114524 1.625207 0.147334 0.212762 0.110630 0.669929 0.701257 0.740334 0.389163 1.380024 1.292558
158 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 13.583646 -0.844412 30.231630 -0.181077 14.352594 1.292101 2.026216 3.701382 0.044463 0.746449 0.501687 1.211451 3.191841
160 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.544176 16.348441 29.716320 32.001242 14.318278 21.786876 3.154317 5.213471 0.039600 0.041226 0.002883 1.186082 1.185780
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.102518 35.101765 -0.049729 3.973588 -0.862796 6.239710 -0.143521 0.866898 0.726161 0.649955 0.346872 3.038977 3.132287
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 3.02% 1.177739 0.537897 -0.334870 1.197141 1.407299 0.797449 0.051973 -0.514214 0.732954 0.764023 0.372801 1.624813 1.512053
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 0.500240 -0.141019 -0.004908 -0.692029 -1.547914 0.439501 -0.498763 0.824869 0.735658 0.760743 0.370167 1.625691 1.490290
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% -0.558899 -1.029893 0.157236 -0.019422 -1.052052 1.096566 0.090247 2.008883 0.731478 0.759314 0.370161 1.677120 1.511079
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.073520 0.860722 8.155811 0.307189 1.959595 -0.742795 0.018659 -0.578637 0.742827 0.757075 0.374713 3.277256 2.919987
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 16.693124 34.602936 2.741712 2.288262 5.913942 12.142283 20.703731 15.008820 0.692833 0.677298 0.305173 3.930882 3.276270
167 N15 digital_ok 100.00% 3.64% 1.82% 0.00% 100.00% 0.00% 60.490662 56.478667 8.472146 5.359416 12.527207 11.770754 21.247664 21.419307 0.581515 0.610310 0.208065 3.429190 3.083056
168 N15 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.061295 2.517948 1.328715 6.952587 1.482289 0.324796 0.477724 -0.304011 0.731915 0.763912 0.383081 3.754155 3.178166
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.740645 5.201540 1.834688 1.312182 -0.464256 0.051710 -0.235810 1.016197 0.732364 0.746788 0.387382 3.503979 2.770244
170 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.859644 1.752321 8.422402 -0.927166 -0.066174 -0.456299 2.061267 2.637604 0.723653 0.750321 0.398161 3.567075 2.737296
171 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.254984 4.412662 11.036468 0.562507 1.436585 6.080866 -0.204221 -0.394177 0.682868 0.675570 0.394826 2.794286 2.288513
173 N16 not_connected 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
176 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 0.019938 -0.927477 -0.667225 1.062761 -0.980853 0.721898 -0.191841 0.774745 0.684930 0.725107 0.399092 1.353896 1.276229
177 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.981248 1.768846 0.659851 0.391030 0.443726 3.667255 0.546374 5.254077 0.696095 0.722156 0.393911 3.253288 2.999798
178 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 0.193623 -0.662302 -1.074562 0.004908 -0.827848 -0.522704 -0.644011 -0.925430 0.700669 0.738722 0.397649 1.369893 1.270902
179 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.290974 -0.551668 -0.425889 -1.079705 7.620157 -1.087640 4.721847 -0.888460 0.710775 0.744802 0.395553 2.673357 2.526260
180 N13 RF_maintenance 100.00% 0.00% 69.82% 0.00% 100.00% 0.00% 0.896082 13.384574 1.585824 31.137147 0.303165 19.242483 -0.477687 3.344519 0.729608 0.403888 0.463835 9.838633 2.083691
181 N13 digital_ok 100.00% 100.00% 84.40% 0.00% 100.00% 0.00% 14.164193 55.048873 30.395939 8.693937 14.331606 22.916508 3.239066 8.759806 0.045177 0.288708 0.169079 1.192583 1.532454
182 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.889377 14.998078 27.484441 31.305886 4.939860 21.737770 -2.529562 4.193983 0.740164 0.061169 0.530538 3.258824 1.306613
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% -0.812881 -1.155285 -0.681756 0.343624 -0.728591 -1.298921 -0.233488 3.119481 0.729977 0.751564 0.373732 1.581624 1.417991
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.50% -0.059707 -0.971000 -0.064717 -0.515830 0.617059 -1.148509 -0.153974 -1.059628 0.729255 0.751696 0.371920 1.623455 1.520691
185 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 0.807713 -0.482397 1.820739 -0.705173 -1.121419 -1.153705 -0.150808 -1.133030 0.736530 0.754186 0.374081 1.433439 1.378349
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 0.960293 -0.113603 -0.705835 0.091926 1.702197 -0.282797 1.645462 -0.860194 0.731734 0.754495 0.376969 1.400502 1.341431
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 30.15% 0.00% 0.714023 0.335943 -0.433443 -0.454420 -0.665961 -0.305508 3.413614 2.764934 0.721706 0.758563 0.374920 1.478628 1.265674
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.105716 2.872827 -0.146041 0.869342 -0.369141 2.143010 0.124684 8.689921 0.714555 0.747256 0.385718 3.765350 3.606285
190 N15 digital_ok 100.00% 10.93% 100.00% 0.00% 100.00% 0.00% 60.779947 16.156170 5.897100 32.639792 9.904404 21.877341 19.175810 4.667739 0.532365 0.038802 0.369003 2.061180 1.064345
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.858863 -0.297458 -1.131336 0.030668 1.858833 -1.054441 5.057013 0.887494 0.713435 0.746358 0.404956 3.156382 2.990531
192 N16 not_connected 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
193 N16 not_connected 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
200 N18 RF_maintenance 100.00% 100.00% 83.79% 0.00% 100.00% 0.00% 15.467711 44.575018 7.769536 19.075644 14.294638 22.875158 1.632348 0.204478 0.048698 0.293369 0.202245 1.199897 1.497481
201 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.913717 9.005501 37.110401 34.562030 12.041668 17.593468 -4.371703 -3.693312 0.693314 0.724170 0.379308 2.975226 2.894926
202 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.379029 4.534911 21.431150 2.450968 1.943494 5.614629 -0.597324 3.359279 0.722704 0.693521 0.387291 3.506185 2.555141
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 16.192230 17.653118 7.132648 9.381233 14.323995 21.792859 4.581737 5.205311 0.036222 0.044037 0.001658 1.215688 1.222688
219 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.429376 6.866709 37.715608 31.289200 12.876949 13.432728 -4.596992 -3.237396 0.663806 0.733250 0.402453 2.486271 2.731576
220 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.566527 0.782294 16.262095 17.815234 0.800412 4.014770 1.711194 -1.722521 0.713518 0.736210 0.384485 3.072396 2.800505
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.946506 1.410797 8.642996 16.963550 3.610954 2.380383 2.842512 -0.692135 0.683565 0.734674 0.390906 2.948757 2.916298
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.814000 2.659627 19.100946 20.694678 3.137941 4.173023 5.519213 -1.447280 0.715847 0.740862 0.388587 4.156598 3.137235
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.345642 2.515883 7.785510 14.251567 1.918947 4.203937 0.153203 -1.193097 0.670272 0.716607 0.394703 2.884272 2.920087
238 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.748961 6.615151 23.433958 32.256846 3.537542 16.025262 -1.896098 -3.421437 0.713706 0.723366 0.396811 3.403027 2.831838
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.610767 3.603866 17.543627 1.071907 3.379556 8.720231 0.174199 20.410200 0.709259 0.676505 0.407036 3.402722 2.307022
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 0.910720 16.781081 19.439071 18.491440 2.164987 21.731909 4.972151 4.672660 0.727389 0.057373 0.499197 0.000000 0.000000
321 N02 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.954103 2.128544 17.595440 17.821874 2.898586 4.056885 3.428511 2.540734 0.629476 0.656663 0.398129 0.000000 0.000000
322 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 2.002818 4.248146 19.757721 26.592974 2.319882 9.508033 0.048130 -1.937607 0.062298 0.062337 0.010019 0.000000 0.000000
323 N02 not_connected 100.00% 59.50% 0.00% 0.00% 100.00% 0.00% 30.822900 3.346036 3.313106 24.750367 8.232795 8.551819 1.755087 -0.515732 0.404449 0.640754 0.380192 0.000000 0.000000
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.382170 4.339795 23.246825 24.691738 2.946681 7.368925 -0.517335 -2.007833 0.616696 0.648714 0.386909 0.000000 0.000000
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.132443 -0.028258 23.494998 13.965438 3.364926 2.055531 -1.691716 -0.118544 0.653764 0.669372 0.407234 0.000000 0.000000
329 N12 dish_maintenance 100.00% 10.93% 0.00% 0.00% 100.00% 0.00% 5.215834 -0.945835 1.732242 15.902588 3.941141 2.789660 1.582714 -0.497731 0.545795 0.666188 0.408438 0.000000 0.000000
333 N12 dish_maintenance 100.00% 17.61% 0.00% 0.00% 100.00% 0.00% 6.531659 0.853095 0.315463 13.810246 5.261527 2.924691 0.936320 0.222162 0.526108 0.652040 0.405782 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, 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_2459848.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.dev9+gdffdef6
3.1.5.dev78+gda49a16
In [ ]: