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 = "2459847"
data_path = "/mnt/sn1/2459847"
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-24-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/2459847/zen.2459847.27893.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 1862 ant_metrics files matching glob /mnt/sn1/2459847/zen.2459847.?????.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 187 ant_metrics files matching glob /mnt/sn1/2459847/zen.2459847.?????.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
max() arg is an empty sequence

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 2459847
Date 9-24-2022
LST Range 20.360 -- 6.381 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1862
Total Number of Antennas 180
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 3
dish_ok: 1
RF_maintenance: 36
RF_ok: 9
digital_maintenance: 11
digital_ok: 97
not_connected: 23
Commanded Signal Source None
Antennas in Commanded State 0 / 180 (0.0%)
Cross-Polarized Antennas 104, 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 / 180 (35.6%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 138 / 180 (76.7%)
Redcal Done? ✅
Redcal Flagged Antennas 12 / 180 (6.7%)
Never Flagged Antennas 30 / 180 (16.7%)
A Priori Good Antennas Flagged 73 / 97 total a priori good antennas:
3, 5, 7, 9, 19, 30, 37, 38, 40, 41, 42, 45,
46, 51, 53, 54, 55, 56, 65, 66, 67, 68, 69,
71, 72, 73, 83, 84, 85, 86, 88, 91, 93, 94,
98, 99, 101, 103, 105, 106, 107, 108, 109,
111, 116, 117, 121, 122, 123, 124, 128, 140,
141, 142, 144, 147, 156, 158, 160, 161, 163,
165, 167, 169, 170, 177, 179, 181, 183, 187,
189, 190, 191
A Priori Bad Antennas Not Flagged 6 / 83 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_2459847.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.810873 -0.705592 -0.098687 -0.484856 0.744949 -0.899290 -0.626227 1.783275 0.711026 0.677963 0.436052 4.615735 4.098238
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.755657 3.627963 0.013203 -0.668914 1.048399 -0.112019 0.232166 -0.744421 0.731927 0.675836 0.439221 5.342415 4.347278
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 4.28% 0.541871 0.942815 0.062555 3.189486 0.367401 1.734641 1.128545 -0.757890 0.727810 0.684087 0.434085 1.752856 1.494667
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.791541 -1.176165 -0.774806 0.551802 -0.179128 0.090923 0.283549 11.383624 0.721536 0.676787 0.434202 3.058823 2.859703
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.005746 5.676375 30.159327 29.664362 12.872557 17.622197 -0.128328 -2.873241 0.722202 0.663274 0.434464 3.117464 2.741076
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 4.28% -0.194549 -1.354157 -0.946480 0.472442 0.050141 -1.246188 -0.771749 0.000923 0.720107 0.676740 0.441116 1.799700 1.537430
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% 0.462342 -1.000419 0.105055 0.757076 0.889975 1.148240 0.449540 -0.364151 0.706260 0.661684 0.447077 1.659918 1.459742
15 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% 0.796773 0.361114 -0.897379 -0.909224 -0.165903 -0.750383 0.734678 3.064574 0.729844 0.684272 0.431687 1.643963 1.541884
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% -1.006954 -0.019275 -0.518975 -0.724536 0.704831 -0.000383 0.770236 1.505952 0.735549 0.683510 0.434257 1.719178 1.507868
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% -0.545680 0.353440 0.799748 0.674786 -0.179104 -0.366703 1.967297 0.669361 0.724649 0.685777 0.427164 1.749007 1.583311
18 N01 RF_maintenance 100.00% 0.00% 35.45% 0.00% 100.00% 0.00% 7.028938 13.336821 -0.628163 1.223427 0.415979 6.772338 5.896121 10.489391 0.693743 0.456944 0.469838 2.737389 1.671378
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.154798 -1.260608 -0.607744 0.084221 -0.307431 1.676278 9.596429 10.965791 0.725120 0.688944 0.431934 2.781505 2.708620
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% -1.501747 3.780843 -0.521832 -0.682229 0.435266 -0.496160 2.037724 -0.220830 0.729621 0.669564 0.437955 1.687645 1.564682
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% -0.195399 1.324112 -0.026317 -0.847630 0.973124 0.461435 0.538873 3.202050 0.714549 0.670546 0.433889 1.545042 1.517348
22 N06 not_connected 100.00% 21.48% 0.00% 0.00% 100.00% 0.00% 42.058755 14.765383 8.000516 14.842420 15.105106 12.948363 11.394116 14.656633 0.500329 0.622374 0.352424 2.423666 3.075100
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.335704 17.095889 27.950564 29.952887 21.944350 28.349798 1.963570 1.107990 0.031026 0.035292 0.002740 1.173531 1.173221
28 N01 RF_maintenance 100.00% 67.67% 100.00% 0.00% 100.00% 0.00% 19.916169 38.588692 0.600217 4.008873 12.155712 15.446754 4.904954 9.379475 0.359497 0.148891 0.237755 3.927310 1.728235
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% -0.972473 -0.697674 0.403197 0.497172 -1.041920 -1.083069 -0.670803 0.686894 0.733178 0.688563 0.422770 1.608943 1.521978
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.170020 -0.964175 1.522203 -0.902884 0.103091 -0.613997 12.266691 -0.192116 0.717949 0.691239 0.425125 2.763787 2.756808
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% 1.184248 -1.333144 -0.853136 -0.911326 -0.095541 1.802504 -0.659381 0.247019 0.744077 0.693448 0.436637 1.450191 1.364061
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 27.758870 28.871353 3.304444 3.017204 6.559398 16.311734 26.357800 32.949931 0.618264 0.609435 0.289457 3.649710 3.495081
33 N02 RF_maintenance 100.00% 0.00% 12.35% 0.00% 100.00% 0.00% -0.081235 14.070382 0.072034 0.087293 -0.538116 6.469044 2.105206 10.978764 0.718794 0.496455 0.507422 4.569437 2.254876
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 17.713985 3.075747 7.683540 12.145552 21.779563 6.416233 0.036489 -0.836231 0.037649 0.660092 0.531250 1.156511 3.019124
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.781507 0.354487 2.897315 9.898209 5.008080 1.934918 3.546192 -0.768376 0.641703 0.651215 0.457039 4.516327 4.617385
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 12.301129 10.313657 -0.014436 0.021567 1.656222 1.915806 1.287043 0.849508 0.734537 0.688278 0.434411 5.376004 3.914676
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.671990 1.299116 -0.893218 0.511590 -0.546218 0.459446 -0.409046 9.172283 0.739188 0.702014 0.432984 3.147894 2.830108
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.379226 1.269572 0.930400 -0.007562 0.550849 0.659661 5.753758 1.332855 0.742565 0.704235 0.431206 2.959447 2.752966
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 22.99% 0.176854 -0.497268 -0.179831 -0.848612 0.746480 0.294541 -0.770820 -0.264502 0.734475 0.689568 0.422648 1.717993 1.551386
41 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.973731 -0.077314 4.585824 0.392215 2.448700 -0.488337 -0.489246 0.482506 0.741460 0.686664 0.416180 3.799726 3.128576
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.53% -0.003775 2.734448 2.326079 0.662841 0.681680 -0.004588 0.137745 -0.795644 0.747205 0.687823 0.432091 1.574099 1.444072
43 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.218671 0.539913 27.296114 15.247434 21.934135 0.519055 0.353193 2.927262 0.026121 0.044110 0.021913 1.172899 1.197111
44 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 23.941679 1.864717 1.490442 -0.615777 13.094046 0.072344 81.454135 7.608559 0.046598 0.044637 0.004130 1.201114 1.200793
45 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% -0.135340 -0.229342 -0.441984 -0.617048 -0.495054 1.035548 -0.463991 18.621617 0.040977 0.046636 0.002042 1.204234 1.206652
46 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% -1.129775 17.659107 2.545284 29.996529 0.295472 28.460301 0.041629 1.790526 0.046880 0.025835 0.016782 1.211197 1.181267
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 17.027408 2.930604 7.266702 12.254557 21.749256 5.954768 -0.239258 2.280860 0.034051 0.663230 0.528810 0.848513 2.078727
48 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.259168 2.967894 21.219578 22.555682 3.552427 9.952180 -1.091694 -2.153773 0.710665 0.677676 0.446561 2.294399 2.126464
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.928769 1.776781 11.255806 20.095209 1.401578 5.897909 0.093699 -0.635570 0.682608 0.663942 0.449852 5.121497 5.281492
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.024317 27.543386 -0.563835 2.548938 0.543530 14.160657 1.702958 11.045535 0.731372 0.609880 0.403015 3.524011 3.295440
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 35.358711 3.439402 37.986957 0.847267 21.770567 2.885305 8.057886 4.368840 0.036071 0.700963 0.488790 1.147040 2.942186
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.614490 9.843744 -0.140176 0.049349 2.227190 -0.308617 0.335741 -0.625581 0.745435 0.707264 0.419861 3.001608 2.739376
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.477780 3.943161 -0.019436 0.972665 0.652251 1.265417 1.880583 4.630186 0.747841 0.711443 0.424768 2.961640 2.739189
54 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 15.366130 -0.442216 27.761044 -0.414620 21.827506 1.858237 0.797086 1.449361 0.042318 0.699089 0.530342 1.404662 2.581382
55 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.244633 3.919662 0.023378 -0.142573 4.802614 -0.815830 0.645463 -0.668343 0.737718 0.691226 0.406285 3.319354 2.742363
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 59.89% -0.419499 0.750033 1.899812 3.394111 -0.033806 1.233604 0.316419 3.370112 0.742134 0.709855 0.409185 3.202890 2.592904
57 N04 RF_maintenance 100.00% 3.76% 0.00% 0.00% 100.00% 0.00% 43.812050 0.678705 7.731519 -0.715950 7.331711 0.716317 9.682553 0.118626 0.580339 0.699060 0.401219 3.775459 2.833082
58 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.715068 17.761102 27.743006 30.596106 21.903283 28.272135 2.135129 1.548366 0.027502 0.025976 0.001617 1.171138 1.166386
59 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 34.772840 3.457578 2.228304 1.715500 4.486032 1.567689 5.637892 4.807589 0.040835 0.049183 0.001470 1.159278 1.157740
60 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.771136 17.469636 27.583753 30.279560 21.865006 28.305564 0.424208 0.883354 0.026427 0.025579 0.000987 1.169570 1.167373
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.555080 5.026878 9.245020 7.136333 8.490270 4.206512 0.092355 1.985801 0.694468 0.646761 0.426097 5.533443 5.205221
62 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.918800 3.460774 18.384147 21.656261 1.700908 6.478646 -0.000765 -1.778174 0.715600 0.679807 0.437901 7.559867 5.976017
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.997130 18.130748 18.372684 9.496849 4.549702 28.317101 -0.164467 0.771038 0.679347 0.040108 0.591108 2.567674 1.179820
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.395412 1.814033 13.440400 18.735011 1.856655 5.014116 2.799411 -1.465690 0.666330 0.643290 0.452930 2.678218 2.520196
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.53% 1.419579 1.134864 -0.768063 1.039339 -0.398543 0.951053 -0.265275 -0.653996 0.729478 0.690918 0.438311 1.553196 1.375275
66 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.170577 2.451512 -0.250378 1.434724 4.455473 -0.719775 -0.637685 0.088817 0.737615 0.702942 0.428983 3.514081 3.299473
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 1.60% 0.077115 -0.275857 -0.293662 -0.913342 -0.498537 -0.312548 0.290537 1.107854 0.737690 0.706723 0.420148 1.477543 1.386799
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.383766 39.120639 -0.475948 42.642775 -0.142898 27.770263 -0.077236 8.122488 0.736692 0.028169 0.495835 3.165730 1.139023
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 86.63% -0.084416 -1.099331 2.084690 -0.408828 0.682791 1.667709 -0.692581 -0.242520 0.741592 0.708863 0.413494 2.897905 2.592640
70 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.038729 -0.532019 0.607088 -0.801615 0.913102 0.664998 -0.478782 -0.218355 0.754370 0.712119 0.413532 13.817565 10.477509
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 96.79% -0.191938 -0.726527 -0.967583 -0.013203 -0.059615 -0.758538 -0.515935 -0.711666 0.739777 0.714287 0.416671 11.063132 11.073210
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.385550 0.242377 -0.482259 2.359695 1.600871 0.254344 1.446241 -0.772847 0.731892 0.707411 0.409561 3.538916 2.939863
73 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.402971 1.115625 27.380734 -0.702825 22.114394 -0.563236 1.881498 0.618428 0.026225 0.054885 0.019071 1.168797 1.195299
74 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.956999 17.602812 28.475801 30.463784 21.503433 27.090146 0.731953 1.761983 0.025525 0.035868 0.006450 1.150996 1.151384
75 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
77 N06 not_connected 100.00% 0.00% 6.44% 0.00% 100.00% 0.00% 28.014516 33.511655 19.403641 15.257380 12.893596 13.686189 33.369907 3.165302 0.617345 0.523789 0.296373 3.273035 2.324259
78 N06 not_connected 100.00% 16.11% 0.00% 0.00% 100.00% 0.00% 43.057561 0.506269 15.517921 17.283599 8.207806 3.877039 0.658783 -0.955846 0.515616 0.657496 0.394884 2.748276 2.478284
81 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 3.74% 0.00% -0.264971 0.119901 -0.915366 -0.149287 0.468265 0.824682 -0.702938 -0.773791 0.697424 0.666421 0.432357 1.608320 1.504605
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.095059 0.482255 5.393217 4.819183 2.142693 0.879160 -0.328683 1.143639 0.721801 0.669521 0.431045 3.639246 2.924093
83 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.809122 0.782127 6.422891 2.373292 -0.594362 -0.531833 -0.691933 0.086103 0.736086 0.700571 0.421886 3.012130 2.795108
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 10.667243 34.542751 0.446831 40.968647 -0.302902 27.684758 -0.834645 3.988725 0.741490 0.036115 0.602525 3.550781 1.148016
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.74% 4.28% -0.026342 0.239445 0.231062 -0.883854 0.045731 -0.686078 -1.029109 -1.102897 0.729148 0.698901 0.422427 1.449283 1.375968
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.706431 7.987075 1.942216 0.832702 8.483748 4.488805 1.068011 12.732428 0.736170 0.662268 0.424061 2.919743 2.508639
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.291591 10.610928 7.468173 5.824401 10.591646 1.101894 0.802069 1.355433 0.745990 0.711465 0.416429 5.386762 4.050514
88 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.948907 3.333602 19.074205 11.130167 1.446090 1.579764 -0.747561 -0.878309 0.753489 0.718100 0.411384 7.182611 5.322765
89 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.917258 0.268804 8.600807 1.963661 -0.333483 1.522328 -0.838572 -1.006085 0.750279 0.690141 0.425116 6.639032 4.269575
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.003775 0.004982 0.295079 -0.018345 -0.758423 1.040431 -0.248053 1.094466 0.724783 0.690073 0.417338 6.249636 4.906801
91 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
92 N10 RF_maintenance 100.00% 89.15% 98.82% 0.00% 100.00% 0.00% 54.158603 65.727280 5.758114 6.721901 8.613509 10.932998 -0.057883 5.133430 0.293218 0.239279 0.122245 2.202031 1.740083
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.516951 1.342262 9.109467 1.090908 3.763374 -0.089631 3.772786 -0.906385 0.700465 0.686511 0.433870 3.169889 2.900511
94 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.997426 -1.553724 -0.827547 -0.133346 0.236094 2.740126 4.809473 4.692335 0.726566 0.681671 0.436932 3.623646 2.917579
98 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 3.74% 1.07% -0.347889 2.917812 -0.747828 -0.763131 1.352999 2.749090 0.081743 1.262448 0.688729 0.660438 0.433335 1.684460 1.593088
99 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.113582 0.152924 9.383731 0.338270 4.909722 5.884892 0.390582 -0.974775 0.650255 0.674210 0.444054 2.890457 3.182204
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 3.74% 0.00% 0.453451 -0.506996 0.076616 0.674196 -0.155139 0.165643 0.208138 0.075461 0.718452 0.680418 0.420935 1.511350 1.454512
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.493164 13.223313 8.006835 2.602412 -0.282637 0.424987 -0.150031 -0.589058 0.748359 0.708106 0.417790 3.621318 3.323014
102 N08 RF_maintenance 100.00% 30.08% 100.00% 0.00% 100.00% 0.00% 11.655845 17.988328 23.212938 28.639885 22.822611 28.186233 0.731158 3.216185 0.487619 0.039110 0.405794 1.662078 1.253109
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 33.411178 35.106485 32.877352 35.315655 21.096908 27.024584 7.418094 6.924147 0.026815 0.027134 0.001382 1.172147 1.168326
104 N08 RF_maintenance 100.00% 0.00% 0.00% 100.00% 100.00% 0.00% 8.285309 76.461511 -0.328079 23.627284 6.418820 4.687826 -0.039231 -0.200601 0.339830 0.291101 -0.298890 2.483797 2.186751
105 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.756639 3.484165 -0.230631 15.281069 4.019471 2.680862 0.067364 -1.243901 0.733307 0.715270 0.420051 7.667704 5.908809
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.873053 4.579963 -0.443546 -0.605840 1.286468 2.885915 4.064588 4.024621 0.730987 0.692724 0.406489 6.221792 4.743914
108 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -0.315277 17.610948 0.915393 29.354200 -0.381545 28.393747 -0.139985 0.471237 0.736001 0.033935 0.506219 3.845858 1.268205
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 38.160811 17.753202 4.343148 2.049183 4.034463 15.144989 4.504109 47.490873 0.626292 0.665139 0.332687 3.952072 3.308796
111 N10 digital_ok 100.00% 0.00% 98.82% 0.00% 100.00% 0.00% -0.155665 16.605345 -0.992161 29.225046 -0.593710 27.451057 0.676282 1.028596 0.730600 0.157697 0.540311 4.061091 1.306553
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% -0.154199 -0.651307 3.248347 0.162686 -0.260816 0.589102 0.678178 -0.739292 0.710070 0.686773 0.443945 1.497051 1.302365
116 N07 digital_ok 100.00% 0.00% 0.00% 100.00% 100.00% 0.00% 2.943350 0.150999 4.505323 -0.304060 7.014029 6.870696 0.155116 0.568469 0.290170 0.274512 -0.317314 3.189728 3.775159
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 16.597362 19.668292 27.972391 31.414819 21.629479 28.071034 0.120008 1.624866 0.027404 0.029067 0.001600 1.210893 1.204691
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 3.74% 0.00% -0.701354 1.431909 3.541393 1.819618 1.609875 -1.068103 -0.730300 -0.875663 0.714016 0.689803 0.428274 1.479911 1.380415
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.822793 1.435124 11.258408 2.723743 -0.512191 12.993204 -0.086906 0.716942 0.737633 0.668690 0.428678 5.050141 4.302329
120 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 4.317263 34.276353 0.191086 40.713595 0.546709 27.743330 -0.567006 7.251466 0.740960 0.033543 0.617142 7.583357 1.186168
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.692716 8.026126 -0.579989 0.779163 1.095456 -0.288105 36.633613 10.831309 0.745475 0.708300 0.420037 8.771549 6.533775
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.619106 10.806757 0.452259 0.557925 1.938960 -0.092889 -0.656396 -1.103296 0.747490 0.709513 0.419003 10.996789 8.289428
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.277414 13.052864 4.402094 0.994788 0.076965 -0.062763 -0.844740 -0.709943 0.755415 0.712481 0.422269 14.392902 8.951409
124 N09 digital_ok 100.00% 0.00% 0.00% 100.00% 100.00% 0.00% 1.298429 0.593716 5.188558 17.472707 7.973532 7.716917 1.308114 -1.144715 0.341275 0.339823 -0.315038 3.960347 4.639492
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.332094 1.281079 0.657775 3.576445 1.350727 1.970140 0.441220 -0.970581 0.726888 0.704491 0.415130 9.011881 7.051752
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.553615 1.005417 6.535267 0.266684 20.493554 -0.210055 51.265121 -0.457011 0.701219 0.698491 0.420630 6.920811 6.537318
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% -0.206399 -0.510588 0.287558 0.807403 0.996721 -0.137774 -0.308145 -0.275478 0.732253 0.700938 0.428117 1.568869 1.344727
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.265027 4.594297 -0.878831 2.030754 -0.234649 0.166597 -0.557695 -0.626904 0.734363 0.694205 0.428019 3.585725 3.259001
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% 0.998462 -1.531095 0.019160 0.621920 -0.443803 -0.800695 -0.514950 -0.276034 0.731056 0.692921 0.436297 1.556673 1.344843
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% 2.027960 -0.196046 -0.111854 1.216453 0.000383 -0.118924 0.044262 1.545662 0.712011 0.681703 0.433269 1.531293 1.337155
135 N12 digital_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.199933 -0.109145 -0.494378 -0.091815 0.121114 0.124797 0.691008 -0.023156 0.691994 0.662366 0.447631 7.777441 5.662847
136 N12 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.046301 12.749246 -0.568168 0.088545 -0.395212 0.999685 0.028595 1.801243 0.700370 0.639942 0.424886 9.547359 6.438291
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.095255 -0.732582 1.987194 -0.802873 0.436050 2.087179 -0.000923 -0.664326 0.706451 0.669939 0.433860 6.979491 5.331820
138 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.276993 0.947304 -0.586038 -0.677592 -0.792209 -0.861488 3.763229 -0.954780 0.723338 0.687573 0.436156 10.011796 7.427369
140 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.241340 18.211096 26.962525 30.039384 22.068197 28.475884 0.672324 0.985750 0.034990 0.034610 0.001515 1.168365 1.165280
141 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.188537 5.966313 1.137092 9.287319 1.264573 2.694482 3.166647 20.782080 0.719936 0.655665 0.412405 8.625949 6.969488
142 N13 digital_ok 100.00% 84.32% 100.00% 0.00% 100.00% 0.00% 47.113566 17.506357 2.884760 30.457729 10.179447 28.320303 7.636380 1.116473 0.322405 0.033241 0.188800 3.089177 1.306738
143 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% 0.149188 -0.792107 -0.885101 -0.208023 -0.182009 0.701773 -0.518926 -0.864589 0.738095 0.706105 0.416009 1.066379 1.049521
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.201326 -0.064058 -0.159313 1.032735 0.526750 0.659986 1.547311 27.434802 0.734200 0.696116 0.419279 10.017898 7.226012
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 16.063976 18.236603 28.173262 30.644869 21.839717 28.289154 1.248805 2.319988 0.030596 0.026136 0.002948 1.428119 1.397187
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
148 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
149 N15 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
150 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 16.306153 17.680078 27.914802 30.421172 21.887698 28.291102 1.690015 1.793964 0.026534 0.027675 0.000348 1.221028 1.217725
151 N16 not_connected 100.00% 8.06% 0.00% 0.00% 100.00% 0.00% 11.055431 2.709805 4.360295 -0.561543 209.966914 294.430328 4639.813864 4572.016903 0.573919 0.642197 0.418216 732.352203 205.038872
152 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.480525 4.622079 25.789540 26.603637 8.074581 13.226368 8.305427 -2.457465 0.707808 0.670068 0.462343 5.392986 5.045886
153 N16 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 16.217300 1.069951 6.749833 12.039903 21.727753 2.934335 -0.041189 -0.966612 0.040123 0.650020 0.547136 1.254217 2.722858
154 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.201366 0.254030 19.397008 17.518444 3.198482 4.358538 -1.244072 -1.259048 0.682403 0.652583 0.466712 5.550271 5.163706
155 N12 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.219210 16.324443 27.072571 29.736018 22.061103 28.447451 1.698891 2.692107 0.033330 0.026141 0.003437 1.279905 1.276876
156 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.373213 4.653731 -0.665843 0.526340 -0.332066 14.326004 1.829062 12.230358 0.702169 0.633566 0.426713 4.670349 4.046485
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% -1.232502 -0.021655 -1.068623 1.513002 -0.318743 -0.239071 0.361219 1.457929 0.712530 0.672198 0.438097 1.605278 1.379362
158 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 15.692071 -1.123806 28.245858 0.362884 21.675448 0.665060 0.655518 7.685976 0.037139 0.681661 0.475541 1.254369 4.928722
160 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 16.686356 18.889426 27.698818 30.163325 21.930425 28.381648 1.530605 2.251718 0.037237 0.038113 0.002576 1.223717 1.220928
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.463081 37.322374 0.113747 3.667211 -0.741732 6.201463 0.619913 1.273528 0.733256 0.561989 0.402204 3.262066 3.478640
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% 1.495224 0.343459 0.244641 0.849959 1.295328 0.391982 2.791191 2.891908 0.733942 0.699499 0.425549 1.555612 1.446871
163 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.477475 0.354283 -0.027877 -0.797848 0.134910 0.962994 5.277629 4.373523 0.737589 0.697582 0.423696 3.270274 3.119052
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% -0.068314 -0.767898 0.206428 0.383086 -0.866392 1.095546 0.578898 2.895887 0.731961 0.694707 0.424342 1.767666 1.605198
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.182989 1.340405 8.379391 0.364054 0.748967 -0.980868 1.381308 -0.497200 0.744118 0.692065 0.429890 3.712826 3.185896
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 19.474508 21.253446 2.029751 2.064237 9.219197 12.623608 47.089348 69.938740 0.683869 0.633708 0.378699 3.814036 3.559837
167 N15 digital_ok 100.00% 0.54% 3.22% 0.00% 100.00% 0.00% 63.479766 55.669730 7.354781 5.526075 11.698482 12.345940 33.841213 39.630749 0.564218 0.545516 0.250020 3.673458 3.275031
168 N15 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.989204 2.459872 0.923457 6.296933 2.234416 1.224019 0.365926 -0.197596 0.731694 0.698669 0.439912 4.017534 3.351575
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.649270 4.706553 1.822369 1.349901 0.208155 0.116538 0.706500 2.541651 0.733484 0.678346 0.444403 3.918534 2.971250
170 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.690948 1.615124 7.802833 -0.836330 0.193161 0.786692 9.894611 13.338281 0.726595 0.686452 0.445586 3.854205 2.949470
171 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.339975 5.012668 10.452231 0.904618 0.518877 9.736389 -0.517150 -0.508381 0.686341 0.595669 0.449598 3.338619 2.427621
173 N16 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 18.374702 18.834115 5.778500 8.413164 22.048162 28.392086 2.605414 6.346705 0.037078 0.038865 0.002887 1.275058 1.282987
176 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% 0.112506 -0.813003 -0.295650 1.269340 -0.460462 0.376908 -0.252259 0.473354 0.693005 0.655119 0.448260 1.452204 1.319766
177 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.768524 1.475438 0.957942 0.696469 -0.362073 0.569946 1.785580 6.897841 0.707545 0.655351 0.445475 4.042142 3.392321
178 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% 0.175673 -0.433681 -0.971889 0.019347 -0.241350 -1.003663 -0.534489 -0.667729 0.713030 0.675329 0.446775 1.509085 1.345976
179 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.154031 -0.462135 -0.143904 -1.010063 4.430675 -0.756276 3.556510 -0.596169 0.718661 0.681467 0.446793 3.160185 2.989721
180 N13 RF_maintenance 100.00% 0.00% 88.61% 0.00% 100.00% 0.00% 0.905287 15.432055 1.278658 29.334218 1.945267 24.505966 -0.238808 1.675383 0.736534 0.286906 0.540707 10.394799 2.158828
181 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 16.284678 58.917504 28.368176 8.223404 21.836539 11.873660 1.446482 12.660461 0.041460 0.219703 0.129426 1.202176 1.611653
182 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.286780 17.393825 26.151865 29.496350 7.778157 28.421879 -1.048543 1.446354 0.745317 0.042976 0.563191 3.405763 1.343730
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.688093 -1.264695 -0.402692 0.177079 -0.478065 0.899601 0.358630 4.603385 0.734560 0.686943 0.427251 6.265080 4.879996
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% 0.024531 -0.616676 0.270078 -0.441900 -0.667302 -0.900804 -0.039037 -0.884971 0.733882 0.689188 0.426925 1.738946 1.567705
185 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% 1.127335 -0.312815 1.359488 -0.672538 0.555282 -1.023784 0.133898 -0.261080 0.740513 0.691135 0.428867 1.660603 1.467075
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.21% 0.00% 2.045697 0.280536 -0.828940 0.379327 1.868761 -0.883598 1.872618 -0.518624 0.731504 0.687266 0.431267 1.541467 1.440631
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.74% 1.07% 0.826565 0.740494 -0.328296 -0.537064 -0.619650 -0.114381 2.943955 3.024400 0.720893 0.692018 0.431246 1.649014 1.358014
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.044696 2.818280 -0.324004 1.345976 0.419481 1.754986 4.549991 10.907873 0.716086 0.679999 0.439946 4.054631 3.885466
190 N15 digital_ok 100.00% 17.19% 100.00% 0.00% 100.00% 0.00% 66.100709 17.702584 5.677392 30.769677 19.482188 28.104794 64.914867 1.985259 0.511132 0.031817 0.374673 3.448068 1.151336
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.979083 -0.479714 -0.838860 0.174917 0.112940 -0.741655 5.406123 2.103061 0.719615 0.680971 0.454190 3.604512 3.243611
192 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.711493 9.390274 7.035569 34.515702 9.028267 24.579830 5.320072 -3.904852 0.649977 0.641736 0.457184 5.720518 5.434684
193 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.222930 1.541895 35.589089 23.138087 18.792445 10.512697 -3.709778 -0.824812 0.677348 0.662138 0.472123 6.085298 5.653795
200 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 17.692049 46.477765 6.941161 18.217546 21.969969 16.764847 0.405474 -0.581668 0.045979 0.192449 0.123602 1.208910 1.564897
201 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.434266 8.134419 35.462341 32.731173 18.597362 22.318819 -3.633063 -3.365522 0.700124 0.650529 0.435829 4.353824 3.677229
202 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.377013 5.083803 20.348885 2.003994 2.766750 4.946734 0.091037 1.933531 0.727724 0.614459 0.451114 5.953536 3.553925
203 N18 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
219 N18 RF_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
220 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.218147 0.701804 15.796867 16.830349 1.870372 3.047703 3.323853 -1.341253 0.715647 0.669248 0.436578 2.762289 2.505406
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.915672 1.248949 7.830853 16.248842 2.324997 3.759912 1.465858 0.171925 0.685042 0.666350 0.443896 5.366335 4.669579
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.892617 2.454486 17.831675 19.782425 2.106728 6.327843 5.162729 -1.609649 0.719125 0.673471 0.440275 6.695434 4.804660
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.780555 2.603812 7.185865 13.299118 1.721912 1.105892 0.209000 -0.853115 0.673473 0.644904 0.451731 5.429945 4.158871
238 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.223058 5.690637 22.154786 30.302998 4.097057 17.382281 -1.287089 -3.297666 0.723458 0.656462 0.452096 6.773002 4.760554
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.292205 3.690983 16.166634 1.874437 2.821825 4.041507 5.000867 15.904220 0.717825 0.603238 0.466248 7.443405 3.756785
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 0.622512 18.925617 18.222051 17.394076 0.209801 28.334560 2.210448 1.898931 0.740030 0.045449 0.547025 0.000000 0.000000
321 N02 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.699311 1.612115 16.462256 16.560395 2.476489 3.020069 2.048999 1.109195 0.647563 0.587196 0.457782 0.000000 0.000000
322 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
323 N02 not_connected 100.00% 60.79% 0.00% 0.00% 100.00% 0.00% 29.226532 2.502781 3.711475 23.151004 26.098543 10.360669 78.905053 5.712798 0.391328 0.568067 0.390286 0.000000 0.000000
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.998904 3.950134 21.980064 23.222977 6.069948 9.488170 1.171514 -1.306332 0.635711 0.581451 0.440432 0.000000 0.000000
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.189154 -0.093436 22.233851 13.148985 5.932151 3.758880 -1.570392 -0.389220 0.673345 0.597129 0.463737 0.000000 0.000000
329 N12 dish_maintenance 100.00% 12.89% 0.00% 0.00% 100.00% 0.00% 6.532085 -1.126234 1.613122 14.699536 7.202294 3.910386 1.638720 -0.602987 0.554196 0.588958 0.450315 0.000000 0.000000
333 N12 dish_maintenance 100.00% 22.56% 1.07% 0.00% 100.00% 0.00% 7.953905 1.302094 0.286582 12.736333 8.591623 3.464245 0.509908 -0.106221 0.528371 0.574783 0.442605 0.000000 0.000000
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 5, 7, 8, 9, 10, 15, 16, 17, 18, 19, 20, 21, 22, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 135, 136, 137, 138, 140, 141, 142, 143, 144, 145, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 173, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 192, 193, 200, 201, 202, 203, 219, 220, 221, 222, 237, 238, 239, 320, 321, 322, 323, 324, 325, 329, 333]

unflagged_ants: []

golden_ants: []
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459847.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 [ ]: