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 = "2459849"
data_path = "/mnt/sn1/2459849"
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-26-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/2459849/zen.2459849.33525.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 1854 ant_metrics files matching glob /mnt/sn1/2459849/zen.2459849.?????.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 186 ant_metrics files matching glob /mnt/sn1/2459849/zen.2459849.?????.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 2459849
Date 9-26-2022
LST Range 21.847 -- 7.825 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1854
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 64 / 177 (36.2%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 141 / 177 (79.7%)
Redcal Done? ✅
Redcal Flagged Antennas 3 / 177 (1.7%)
Never Flagged Antennas 33 / 177 (18.6%)
A Priori Good Antennas Flagged 67 / 95 total a priori good antennas:
3, 5, 7, 19, 20, 21, 30, 31, 37, 38, 41, 45,
46, 51, 53, 54, 55, 56, 68, 69, 71, 72, 73,
84, 86, 88, 91, 93, 94, 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, 165, 167, 169, 176, 177,
179, 181, 183, 189, 190, 191
A Priori Bad Antennas Not Flagged 5 / 82 total a priori bad antennas:
4, 90, 138, 148, 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_2459849.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.645850 -1.525966 -0.152368 0.837848 -0.796057 0.144916 0.267423 2.262998 0.727030 0.739830 0.368048 3.780100 3.002110
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.366451 3.492826 2.453395 0.474035 0.985130 1.473322 0.508022 -0.382739 0.747008 0.737926 0.368477 4.740274 3.666911
5 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.476763 -0.103614 -0.187938 6.042744 -0.557411 0.401992 1.437684 -0.505235 0.747454 0.743972 0.363810 5.908732 4.050743
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.018378 -1.337139 -0.187669 -0.525338 0.348663 0.166604 0.638095 16.299940 0.736211 0.740037 0.364334 3.861710 3.510532
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.925204 6.500158 43.716389 44.050117 3.647702 8.523749 -0.360812 -1.981013 0.731891 0.722976 0.365187 3.459421 2.986137
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% 0.152333 -1.428069 1.295542 -0.029955 1.085553 0.673519 -0.414739 0.492451 0.731660 0.736054 0.372195 1.410395 1.293481
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% -0.216231 -1.450859 -0.427428 -0.934531 -0.233781 2.255605 -0.179287 1.420497 0.726345 0.728245 0.375940 1.419392 1.317231
15 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% -0.029166 0.308022 1.289964 -0.477224 -0.330557 0.058090 -0.065595 3.849836 0.745708 0.746155 0.361112 1.648891 1.497831
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% -1.543382 0.404163 0.203114 -0.685559 0.179755 0.973825 2.230743 2.560020 0.752059 0.745788 0.362238 1.653710 1.452708
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% -0.306393 0.561964 -0.841239 -0.017404 -0.894470 -0.949266 1.669089 -0.231007 0.747110 0.748826 0.357960 1.621482 1.464488
18 N01 RF_maintenance 100.00% 0.00% 34.52% 0.00% 100.00% 0.00% 15.425204 21.408308 0.449450 1.469773 15.831294 13.209777 72.062356 66.434886 0.698201 0.518349 0.402143 3.011358 1.783013
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.555459 -1.480087 -0.612827 0.116802 -0.407096 1.617825 12.338945 17.221126 0.739407 0.748088 0.365454 3.354774 3.091186
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.496284 4.550058 1.659321 -0.103439 0.369787 0.135254 2.362864 0.148265 0.741261 0.730354 0.367070 4.952056 3.986199
21 N02 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
22 N06 not_connected 100.00% 33.44% 0.00% 0.00% 100.00% 0.00% 36.414071 13.629662 3.701924 16.238358 10.808385 13.904020 6.145397 5.723340 0.506909 0.686830 0.324067 2.478555 3.584708
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.671984 16.478365 46.733403 48.761275 7.089812 12.941313 5.273014 5.611307 0.033525 0.038202 0.003142 1.161681 1.162895
28 N01 RF_maintenance 100.00% 50.70% 87.38% 0.00% 100.00% 0.00% 20.210483 39.514471 2.404895 5.997447 9.619758 13.914830 6.357866 46.345807 0.440261 0.228904 0.249234 4.561909 1.738406
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% -1.412521 -1.382738 -0.248886 0.595399 -0.874043 -1.130891 -0.439635 0.410427 0.750959 0.748488 0.351512 1.536675 1.461955
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.230180 -1.525932 -0.221486 0.065710 -0.371565 0.232060 8.204039 0.089091 0.747101 0.750299 0.355416 3.395252 2.963083
31 N02 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
32 N02 RF_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
33 N02 RF_maintenance 100.00% 0.00% 8.09% 0.00% 100.00% 0.00% -0.026323 19.749016 -0.663294 1.531768 -0.007086 5.494905 4.389879 38.338043 0.738689 0.574382 0.438298 3.556072 1.772807
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 16.757320 2.806751 16.268505 15.011370 7.128088 4.315881 2.966135 -0.358714 0.042796 0.720600 0.574441 1.270871 3.494749
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.329576 -0.030601 1.640870 15.299833 2.364222 1.328892 4.849425 -0.039725 0.663484 0.719278 0.386477 2.999991 3.193454
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 12.743174 10.222059 0.900298 0.397094 1.554920 1.265789 2.280433 1.134409 0.746787 0.752089 0.363180 3.972976 3.242505
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.266172 0.984436 -0.438858 0.574260 -0.643034 -0.106244 1.106698 21.710717 0.754090 0.761772 0.363550 3.941524 3.152835
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.799373 0.702284 0.443676 2.059142 1.861285 3.961868 8.675206 2.898639 0.758208 0.763378 0.359525 3.479952 3.009874
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% 0.169138 -0.738607 -0.124196 0.352878 0.088225 -0.296450 -0.517192 -1.257076 0.750954 0.753138 0.348435 1.560223 1.389908
41 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.131971 0.006148 8.108161 -0.168598 1.746183 -1.542442 -0.443776 -0.588901 0.760450 0.754693 0.343774 4.095073 3.454590
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% -0.108400 2.194029 3.894761 -0.422884 -0.521941 -0.847880 -0.188107 -1.216085 0.764854 0.752480 0.356377 1.428733 1.372223
43 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.541427 2.295437 46.104418 2.728420 7.112880 0.378082 4.270823 2.056854 0.027143 0.052775 0.022747 1.182474 1.213026
44 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 9.785305 2.683291 1.343646 -0.509069 8.956043 -0.210257 19.584104 3.628425 0.058550 0.051122 0.004115 1.212571 1.211234
45 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% -0.524230 -0.510927 0.245006 -0.793629 1.664474 1.060329 -0.169578 24.484781 0.049876 0.052319 0.002045 1.204022 1.205015
46 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% -1.262661 17.190111 2.304733 49.067601 1.390340 12.847575 0.733731 7.506802 0.056862 0.026762 0.029386 1.232177 1.194819
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 16.201161 2.753189 15.244422 14.007147 7.116578 11.302994 1.994716 7.348898 0.036942 0.718487 0.569628 1.112705 2.787633
48 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.462089 3.252888 31.426852 32.725173 1.455625 1.917992 -1.101786 -1.991814 0.725689 0.737747 0.372437 2.666661 2.601147
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.904918 3.170571 20.022631 32.947536 0.800970 4.082217 -0.480697 -1.614160 0.704543 0.727032 0.372359 3.519328 3.482058
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.927756 33.416754 1.176034 3.637733 2.692564 4.338062 3.200097 18.499276 0.740496 0.682183 0.339370 4.127034 4.212208
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 36.038072 3.260774 62.145424 0.490749 7.015431 2.062584 16.681998 5.529135 0.045686 0.761438 0.484982 1.160655 3.356023
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.145615 9.183918 3.752743 1.097697 7.980807 -1.145375 2.455919 -0.143462 0.756136 0.765777 0.353235 3.902878 3.470523
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.923546 3.446471 1.446647 2.016574 -0.566883 -0.827026 4.249346 8.979108 0.762063 0.768909 0.353353 3.929017 3.311860
54 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 14.563401 -0.864946 46.669696 -0.880439 7.104008 0.971529 4.410092 4.772839 0.054203 0.763313 0.540648 1.536543 3.438237
55 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.877400 3.924277 3.564063 1.113874 6.982426 -0.389912 2.601044 -0.027272 0.752907 0.753820 0.333482 4.078063 3.054654
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.660751 0.407816 1.323028 3.405342 -0.028123 2.170854 0.505913 6.145067 0.761102 0.768199 0.337173 4.910814 3.325715
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 41.974862 0.759886 17.876924 -0.040405 3.791754 0.256729 6.645697 2.224956 0.607474 0.764129 0.342573 4.121926 2.895757
58 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.943287 16.937911 46.330830 49.646543 7.152335 13.042382 5.139051 6.615631 0.028160 0.026412 0.001861 1.178669 1.174447
59 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 38.165788 3.916434 5.994384 1.500904 3.409707 1.421007 6.934457 9.013549 0.046931 0.054378 0.001369 1.173547 1.169185
60 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.260327 16.613896 46.561346 49.620940 7.168593 13.003060 4.855984 8.362363 0.026655 0.025365 0.001196 1.147237 1.142030
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.105155 5.176152 5.752532 7.186482 8.353061 2.201440 -0.100183 6.148903 0.691483 0.709071 0.357140 3.037167 2.931871
62 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.803269 4.390775 27.160216 32.949189 0.780759 4.613003 -1.084105 -2.433344 0.729484 0.743284 0.365898 3.949588 3.203119
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.519473 17.126283 25.690419 18.085654 0.201204 12.910653 -0.479721 6.363609 0.697027 0.047445 0.600248 3.276197 1.236173
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.946251 2.238876 19.732951 28.064502 0.250815 2.293036 -0.281476 -1.597627 0.688766 0.714146 0.380074 2.800730 2.656569
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% 1.107768 0.431630 2.528287 -0.709898 3.438399 0.842090 -0.585734 0.418329 0.737355 0.751838 0.376926 1.524704 1.393801
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% 0.719815 2.659970 -0.409305 -0.164041 1.600886 0.745678 -0.364080 2.372809 0.747591 0.760402 0.366731 1.508056 1.406733
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% -0.515905 0.070270 1.799414 -0.652381 0.726742 -0.054151 0.761089 3.326551 0.751901 0.764502 0.354961 1.519917 1.427576
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 2.988331 39.885743 1.866102 68.115569 -0.019720 12.357729 1.063025 17.645779 0.750743 0.035932 0.462065 3.395402 1.156508
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 43.55% -0.214203 -0.952791 0.691504 0.156716 1.974813 1.119692 -0.013531 3.375486 0.758256 0.768648 0.343841 1.568925 1.399421
70 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.893644 -0.951941 0.874587 -0.114225 8.906623 0.423014 0.846833 0.187647 0.772138 0.772259 0.339086 21.550960 14.253741
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 83.33% -0.408103 -1.136536 -0.601404 -0.004101 -0.399490 -0.110185 -0.351169 -0.212781 0.760825 0.773313 0.343523 14.131954 13.556106
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.120988 -0.047779 0.231616 2.276854 0.729421 0.847685 4.224641 -0.919807 0.753810 0.767266 0.334510 3.954871 3.264341
73 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.582027 1.437009 45.919340 -0.473176 7.049837 1.297637 5.646286 0.152892 0.027299 0.059262 0.025408 1.150353 1.180298
74 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.034278 13.551462 47.750293 47.269067 7.316506 11.110048 4.998137 24.727682 0.025780 0.056205 0.018211 1.157985 1.166484
75 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 8.006732 17.504476 12.091952 49.975579 3.667885 13.130384 20.193274 6.913560 0.053710 0.029566 0.023031 1.209753 1.178484
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 25.549933 30.106786 29.009186 23.771947 5.758002 8.348602 5.513717 2.670629 0.624514 0.611622 0.209047 3.435027 2.606431
78 N06 not_connected 100.00% 8.09% 0.00% 0.00% 100.00% 0.00% 41.600329 0.774444 22.600330 25.301992 4.621247 0.498143 -1.037413 0.041499 0.564516 0.726292 0.357115 3.230015 3.258285
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 10.678095 35.441107 0.607314 65.557136 -1.176766 12.391025 -0.315954 11.415686 0.753350 0.050615 0.599370 4.089584 1.184771
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% -0.527105 1.253875 -0.862175 -0.663422 0.131540 -0.304004 -0.868292 -0.705580 0.749732 0.757699 0.350176 1.498865 1.471471
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.381693 8.271309 0.647493 0.141151 10.530693 0.666718 1.146073 29.349510 0.747472 0.735198 0.343003 3.418329 2.901935
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 25.616169 9.763613 8.357274 1.452981 26.316429 3.749485 49.417801 12.201735 0.695797 0.776193 0.334407 3.480611 3.388990
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 18.82% 1.537744 1.000175 3.685352 -0.219673 0.112279 3.819503 0.759599 -0.288249 0.759306 0.763916 0.336327 1.566526 1.383791
89 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.119796 0.278147 6.848617 1.018258 1.261525 -0.085367 -0.704294 -1.026167 0.764089 0.761288 0.342484 4.349356 3.371089
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.690840 0.651047 -0.687365 1.975606 -0.844569 -0.281012 0.307978 1.325272 0.752800 0.755317 0.342472 3.810432 3.198111
91 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.719315 1.230180 22.794464 23.424002 -0.642890 -0.282038 0.652538 -0.220519 0.763701 0.774889 0.351949 4.032861 3.756658
92 N10 RF_maintenance 100.00% 76.05% 83.06% 0.00% 100.00% 0.00% 55.348635 68.565720 8.832005 10.897144 7.701715 15.159517 0.954473 9.533919 0.375460 0.339287 0.113812 2.225584 1.741428
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.097658 0.322528 2.953570 -0.614623 4.043603 -0.445715 8.681984 -0.711724 0.742777 0.756038 0.358535 3.874935 3.420981
94 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.380960 0.630859 0.226418 2.317872 0.728519 1.600933 5.109285 5.667750 0.740363 0.740234 0.359751 4.128892 3.207339
98 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.044690 7.414675 -0.511353 0.022267 1.429797 1.868050 0.873618 2.783644 0.706396 0.722096 0.369553 3.695928 3.293523
99 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.014102 -0.545650 2.855129 1.231765 -0.852487 8.808129 1.675312 -0.902038 0.708323 0.733435 0.369245 3.491358 3.149726
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% -0.454172 -0.672746 0.787450 2.563727 0.997732 -0.551407 -0.220688 -0.560099 0.732564 0.740211 0.358739 1.561426 1.416744
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.446199 12.600818 10.708823 4.507852 0.715709 -0.667862 0.071871 -0.313610 0.757659 0.763322 0.354160 4.298576 3.689603
102 N08 RF_maintenance 100.00% 35.06% 100.00% 0.00% 100.00% 0.00% 11.173566 18.371188 42.730354 49.798024 6.888805 13.015190 1.649993 9.935413 0.498874 0.041932 0.404561 1.770573 1.275997
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 33.524969 35.292490 53.856041 56.548899 7.401009 13.193967 14.874410 16.062931 0.027459 0.028627 0.001786 1.149205 1.152082
104 N08 RF_maintenance 100.00% 0.00% 0.00% 86.30% 100.00% 0.00% 7.380788 78.755935 2.361388 37.138298 14.602210 5.379961 3.546029 1.836618 0.434960 0.390591 -0.249480 2.790959 2.405557
105 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.640451 0.766104 -0.175234 7.912287 0.251913 -0.097264 0.924034 -0.719620 0.753046 0.767740 0.341178 4.543089 3.759399
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.122151 1.909479 2.205273 0.803672 5.470118 2.096916 1.587292 -0.690271 0.748699 0.764120 0.341954 3.919024 3.603522
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% 2.748912 -0.083144 -0.337422 -0.282598 0.005451 -0.252269 2.265259 3.066903 0.746563 0.760638 0.338356 1.513017 1.309778
108 N09 digital_ok 100.00% 14.56% 0.00% 0.00% 100.00% 0.00% 9.380152 4.475551 40.658429 0.263149 6.046519 -0.268293 2.244994 1.868352 0.533664 0.765966 0.448288 1.950773 3.699272
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -0.452333 17.009455 -0.181863 48.161446 -0.610753 12.842130 0.133070 5.281036 0.754683 0.041194 0.470995 4.150101 1.212112
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 36.849263 12.306627 6.499917 3.089093 9.777059 14.581416 3.707593 33.649200 0.660627 0.739869 0.293646 4.396035 3.880605
111 N10 digital_ok 100.00% 0.00% 74.97% 0.00% 100.00% 0.00% -0.150918 15.339011 1.560169 47.223101 -0.134665 11.847083 0.812382 8.760814 0.746222 0.357651 0.445172 4.489471 1.441001
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% -0.406595 -0.479778 -0.850927 1.473082 -0.005451 2.320370 1.707555 -1.220685 0.733978 0.752187 0.370975 1.386531 1.258701
116 N07 digital_ok 100.00% 0.00% 0.00% 100.00% 100.00% 0.00% 2.288457 -0.000139 6.601739 1.663317 3.724439 4.354597 2.461634 2.361646 0.379724 0.360577 -0.271098 2.283035 2.169732
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.987014 19.165618 46.609552 51.187326 7.196508 13.040229 3.643194 8.303026 0.027357 0.031559 0.003334 1.207937 1.199031
118 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.720989 1.354432 0.636067 2.909823 1.865158 9.993312 2.426247 3.035850 0.731692 0.746168 0.362120 3.815404 3.345382
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.722674 6.289881 16.767217 21.579162 -0.979751 13.974939 -0.596804 2.622807 0.749164 0.671744 0.384467 3.971291 2.216534
120 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.665195 34.638950 -0.290433 65.058796 0.898057 12.711897 2.537085 17.574420 0.751836 0.043369 0.613591 4.122822 1.178232
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.781843 7.685912 1.211971 2.942907 -0.602478 1.031947 46.602755 17.437274 0.759899 0.763891 0.351036 4.100989 3.434547
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.901040 10.260435 0.829683 1.613400 2.676992 -0.979205 0.434400 -0.916686 0.764630 0.767733 0.348633 4.370323 3.671344
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.988155 12.934854 6.508980 0.735988 -0.891003 0.747560 -0.209737 -0.064169 0.772548 0.773719 0.345533 4.872887 3.639140
124 N09 digital_ok 100.00% 0.00% 0.00% 100.00% 100.00% 0.00% 0.700750 -0.080154 -0.473353 1.174974 6.331235 2.905898 5.651353 1.416677 0.435450 0.429967 -0.266093 4.858603 5.015745
125 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.532290 2.396622 -0.129351 4.141930 0.059673 1.820114 -0.413326 0.136046 0.752427 0.764592 0.339695 4.562048 3.933123
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 39.628688 0.593271 4.043096 1.416432 9.353437 0.288833 6.572769 -0.481680 0.639212 0.765838 0.338025 4.441478 3.506730
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% -0.454978 -0.452043 1.226268 -0.339176 0.101058 0.066717 -0.079741 1.056278 0.754374 0.770263 0.351901 1.420612 1.268059
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.626142 5.288157 1.551859 4.694125 -0.032695 1.900931 0.222559 -0.719382 0.752101 0.761216 0.350973 3.779542 3.496353
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% 0.509746 -1.574818 -0.581329 -0.928269 0.271047 -0.450036 -0.600816 -1.098153 0.746907 0.761834 0.362641 1.383763 1.235197
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.269288 0.278096 -0.367416 -0.664388 0.469355 0.038201 1.511994 5.480978 0.729698 0.751277 0.363417 3.978630 3.428738
135 N12 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
136 N12 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 298.942282 298.443287 inf inf 5897.802468 5912.497878 12706.593294 12812.207598 nan nan nan 0.000000 0.000000
137 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.194105 -0.452699 3.853562 1.803470 1.593413 12.747100 0.164666 1.132565 0.719504 0.727069 0.365215 4.136937 3.045147
138 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.776430 0.676235 -0.401895 -0.431281 -1.017611 0.457712 2.699823 -0.902909 0.735735 0.746130 0.366213 4.511725 3.461256
140 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.577476 17.891695 45.666189 49.318645 7.058481 12.784560 4.240140 7.155466 0.038048 0.036844 0.002075 1.162633 1.155352
141 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.854971 3.600406 -0.349885 13.770495 1.315994 4.465277 2.893396 32.023280 0.743212 0.727300 0.338563 4.422671 3.882419
142 N13 digital_ok 100.00% 74.97% 100.00% 0.00% 100.00% 0.00% 48.294073 16.790758 5.301501 49.477937 11.477557 12.969499 12.755775 5.608745 0.388691 0.040159 0.211826 3.482478 1.341048
143 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% 0.226716 -1.380097 -0.798961 1.038195 -0.256892 0.301216 -0.241884 -0.854054 0.756653 0.766296 0.342632 1.274128 1.143853
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.584261 -0.918990 0.304972 1.999725 0.498380 7.873512 0.472617 95.781715 0.756477 0.759267 0.344371 6.422361 4.970208
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.269858 17.545133 46.992663 49.779175 7.143886 13.020862 3.932110 7.943867 0.033223 0.026902 0.003969 1.306239 1.311177
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 22.112315 -0.190208 4.098014 1.636021 7.103889 -1.225891 30.042047 -1.044205 0.713685 0.764172 0.346551 4.399492 3.527615
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.079098 0.878959 0.776502 -0.431353 0.954283 -0.826373 0.253906 -0.244422 0.750528 0.764334 0.358507 4.257563 3.873634
149 N15 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 2.982533 17.875835 0.488432 49.566001 -0.132116 12.954750 1.170371 6.522118 0.738663 0.036864 0.538133 5.249936 1.236538
150 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.602812 17.037657 46.632345 49.421275 7.082790 12.974258 4.802174 6.633164 0.026086 0.029238 0.001143 1.227843 1.225617
151 N16 not_connected 100.00% 5.39% 0.00% 0.00% 100.00% 0.00% 11.235656 2.350879 3.121760 3.763541 177.451138 209.324551 4713.125472 5054.200427 0.590761 0.709093 0.365616 417.110115 127.454418
152 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.755177 1.125843 15.570119 19.649885 -0.351495 1.214793 17.491096 -0.756825 0.697085 0.728323 0.392502 2.831048 2.915919
153 N16 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 15.077840 1.078566 14.861041 13.346355 7.170837 7.887010 2.567409 -0.170595 0.044858 0.713434 0.588903 1.214892 2.771814
154 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.818398 0.751215 28.990613 26.145939 1.439490 1.062652 -1.478852 -0.885607 0.697172 0.720870 0.395022 3.170543 3.218449
155 N12 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
156 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.393639 -0.494823 -0.599632 0.945937 -0.921198 1.099628 0.529703 20.063882 0.712498 0.726210 0.365956 3.749069 3.516192
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% -1.450637 -0.952059 0.968969 2.283028 0.147307 -0.592901 2.052706 2.208600 0.722470 0.735497 0.368618 1.437578 1.256117
158 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 14.898029 -1.541313 46.998393 0.663151 7.209141 0.690557 2.683841 5.522233 0.044290 0.744319 0.479018 1.244713 3.692962
160 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.909912 18.389001 46.340313 49.113288 7.090405 12.858343 4.413481 7.576745 0.038985 0.039534 0.002602 1.187109 1.184648
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.144742 39.396410 -0.790779 5.780321 -0.890169 3.123300 0.250560 1.303461 0.747817 0.642140 0.331457 3.154924 3.351186
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% 1.273516 -0.012815 0.806084 2.430266 0.849377 -0.290368 0.082850 -0.645145 0.757130 0.762081 0.348200 1.688406 1.553044
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% 0.515232 -0.447375 -0.230918 0.242921 -1.435706 -0.156896 -0.516780 0.712714 0.760516 0.758906 0.349538 1.629703 1.471241
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% -1.049307 -1.267599 -0.482184 0.845358 -1.072931 0.914635 0.499699 3.840039 0.754808 0.757713 0.348614 1.670690 1.523556
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.896013 0.305608 10.182930 0.064151 2.350555 -1.018720 1.862163 0.406670 0.760768 0.758159 0.352850 4.314131 3.636838
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 39.454422 36.859576 4.058308 3.869230 5.595992 7.471874 24.179567 11.796414 0.647989 0.660291 0.228603 3.884567 3.645872
167 N15 digital_ok 100.00% 3.24% 0.00% 0.00% 100.00% 0.00% 64.004473 59.570889 11.166600 6.515132 12.713226 7.540263 69.185278 58.620709 0.591154 0.618579 0.191148 3.644880 2.854032
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.767493 2.060712 0.004101 1.662762 0.563941 0.305327 0.643569 -0.146320 0.745516 0.756914 0.363242 4.063072 3.529827
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.232639 5.299760 -0.071572 -0.080556 -1.030489 -0.088740 -0.045865 4.011089 0.744061 0.741914 0.369741 4.504729 3.673393
170 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% 0.723298 1.741178 -0.729669 -0.575334 -0.716451 -1.063471 2.737204 1.282110 0.732629 0.749462 0.377688 1.434277 1.292784
171 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.042386 6.070842 18.169478 0.526725 0.515386 2.644560 -0.222885 0.331244 0.705408 0.660001 0.387711 3.569105 2.762000
173 N16 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 17.557801 18.186316 13.198110 16.171441 7.067503 12.842642 5.778588 16.741868 0.039182 0.042718 0.004601 1.206110 1.205220
176 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.311076 -1.333282 0.903225 -0.940802 -1.057707 0.412929 0.932892 6.047691 0.711334 0.727877 0.377000 4.112619 4.125902
177 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.472536 1.086652 0.099331 0.429149 0.274380 0.382903 2.031563 9.174023 0.718645 0.726010 0.372656 3.752850 3.286578
178 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% 0.012815 -0.911761 0.812725 1.833656 -0.456241 0.230328 -0.663812 -0.970389 0.724354 0.736758 0.374836 1.429231 1.327357
179 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.928855 -0.831521 -0.549419 -0.810875 3.634052 -1.353656 7.867405 -0.976494 0.732125 0.742227 0.373625 3.259957 3.091728
180 N13 RF_maintenance 100.00% 0.00% 73.35% 0.00% 100.00% 0.00% 0.963389 14.995138 1.979400 47.768433 -0.823038 11.100182 0.283643 5.809025 0.751242 0.397205 0.456805 11.340893 2.290104
181 N13 digital_ok 100.00% 100.00% 85.22% 0.00% 100.00% 0.00% 15.576977 61.428683 47.277744 13.103098 7.106746 16.262246 3.991316 10.828909 0.044522 0.299267 0.168757 1.172317 1.576128
182 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.855383 16.829936 37.831189 48.129627 1.498572 12.803980 -2.711034 6.522558 0.760127 0.067989 0.530299 4.322743 1.365803
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.805811 -1.644671 0.981046 -0.271836 -1.173458 0.273355 -0.137454 10.909495 0.753394 0.752203 0.352548 4.133484 3.574541
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% -0.550154 -1.356899 0.518582 0.810997 0.294948 -1.077492 0.608087 -0.494739 0.755312 0.749524 0.352739 1.689975 1.572520
185 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% 0.546675 -0.875016 2.137093 0.522666 -1.235328 -1.216863 0.013531 -0.994943 0.758192 0.753006 0.354123 1.529687 1.417095
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% 0.940447 0.088229 -0.651402 0.393593 1.567304 -0.675462 3.816959 -0.685170 0.752438 0.755649 0.357793 1.493395 1.389591
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 16.67% 0.00% 0.375848 -0.355098 1.384342 -0.270494 -0.786248 -0.436191 3.885663 2.584472 0.740591 0.754278 0.356475 1.484158 1.270533
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 340.652215 341.251374 inf inf 6216.001939 6279.843945 10987.184822 11345.877515 nan nan nan 0.000000 0.000000
190 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 311.523524 311.578255 inf inf 6230.077988 6214.275250 11026.132695 11004.593586 nan nan nan 0.000000 0.000000
191 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
192 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.639635 10.362159 24.049219 50.898457 2.409018 12.182282 5.817298 -3.660728 0.708957 0.709630 0.383582 3.446372 3.137154
193 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.024896 1.820623 51.366547 33.408243 6.141154 3.355473 -4.578856 -0.780441 0.688713 0.728846 0.403117 3.050651 3.197142
200 N18 RF_maintenance 100.00% 100.00% 84.68% 0.00% 100.00% 0.00% 16.792554 48.454147 15.330846 26.898059 7.011023 13.551986 3.477155 0.870312 0.048839 0.297972 0.203192 1.226015 1.592434
201 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.190173 9.020607 51.111985 48.194950 5.993022 10.576120 -5.035267 -3.173109 0.714485 0.717802 0.358732 3.474026 3.091271
202 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.172374 5.421484 29.430758 0.556598 0.288192 4.523032 0.150675 3.742782 0.742609 0.683905 0.373667 4.128752 2.628653
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 17.706171 19.650086 13.968186 16.673985 7.058955 12.895007 6.045155 7.696004 0.034183 0.042916 0.001987 1.187444 1.194947
219 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.697961 6.697847 51.926400 43.216208 6.286845 6.556490 -5.211581 -2.989075 0.689473 0.731196 0.379538 2.869672 3.054605
220 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.781103 0.872681 22.333607 24.471861 -0.352569 2.416906 3.668145 -1.234707 0.735856 0.734082 0.363304 3.596990 2.959240
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.639292 1.224137 11.996399 23.637576 2.104800 0.094560 2.652933 -1.072882 0.711016 0.732481 0.367256 3.366287 3.119943
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.721286 2.282252 26.664216 25.562527 0.730639 0.798970 6.762965 -1.236821 0.737233 0.736749 0.367219 4.277896 3.281260
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.927141 2.123867 10.532598 20.513865 0.564011 1.649285 1.061828 -1.296032 0.698693 0.715980 0.374238 3.469490 3.159442
238 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.093992 0.527048 32.539834 31.673429 0.965543 5.094948 -2.302572 -2.388721 0.737023 0.731520 0.370816 3.944183 3.231384
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.163488 3.284825 23.609012 1.732046 0.743245 2.044335 0.028457 29.232846 0.733317 0.682446 0.386929 4.011924 2.664707
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 0.254541 18.862471 7.900454 29.756772 -0.538199 12.841394 8.728442 7.041331 0.736076 0.051461 0.496080 0.000000 0.000000
321 N02 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.639283 1.751873 24.777295 25.609894 2.168196 2.842405 4.045883 2.568506 0.663101 0.664976 0.385363 0.000000 0.000000
322 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 2.124685 4.454711 27.407454 37.593280 0.887474 6.646210 1.200494 -0.681045 0.063040 0.063112 0.009337 0.000000 0.000000
323 N02 not_connected 100.00% 52.32% 0.00% 0.00% 100.00% 0.00% 32.213546 3.403181 3.771301 34.882004 3.059985 4.769767 2.044905 -0.459963 0.445482 0.647346 0.354379 0.000000 0.000000
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.307814 4.508927 31.685722 34.628407 0.813919 4.000439 0.735268 -1.119094 0.650198 0.653583 0.369739 0.000000 0.000000
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.012343 0.132563 32.531367 19.454546 0.890642 0.765050 -2.131412 0.231052 0.684246 0.674242 0.389819 0.000000 0.000000
329 N12 dish_maintenance 100.00% 7.55% 0.00% 0.00% 100.00% 0.00% 5.307317 -1.212952 0.866974 22.403491 1.076733 0.954591 2.710362 -0.066691 0.581076 0.666402 0.382444 0.000000 0.000000
333 N12 dish_maintenance 100.00% 9.71% 0.00% 0.00% 100.00% 0.00% 5.769517 0.710119 1.693858 19.363697 1.540195 1.392605 4.022727 2.295937 0.580515 0.653006 0.377487 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_2459849.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.dev83+g5d33d87
In [ ]: