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 = "2459855"
data_path = "/mnt/sn1/2459855"
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: 10-2-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/2459855/zen.2459855.39338.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 1305 ant_metrics files matching glob /mnt/sn1/2459855/zen.2459855.?????.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 131 ant_metrics files matching glob /mnt/sn1/2459855/zen.2459855.?????.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 2459855
Date 10-2-2022
LST Range 23.640 -- 6.770 hours
X-Engine Status ✅ ✅ ❌ ✅ ✅ ✅ ✅ ❌
Number of Files 1305
Total Number of Antennas 180
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 3
dish_ok: 1
RF_maintenance: 36
RF_ok: 9
digital_maintenance: 11
digital_ok: 97
not_connected: 23
Commanded Signal Source None
Antennas in Commanded State 0 / 180 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 16
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 66 / 180 (36.7%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 133 / 180 (73.9%)
Redcal Done? ✅
Redcal Flagged Antennas 7 / 180 (3.9%)
Never Flagged Antennas 40 / 180 (22.2%)
A Priori Good Antennas Flagged 63 / 97 total a priori good antennas:
3, 7, 10, 15, 19, 20, 21, 29, 30, 31, 37, 41,
42, 45, 46, 51, 53, 54, 55, 56, 68, 69, 71,
72, 73, 84, 86, 88, 93, 94, 101, 103, 105,
106, 108, 109, 111, 117, 118, 121, 122, 123,
124, 128, 140, 141, 142, 144, 147, 156, 158,
160, 161, 167, 169, 170, 176, 178, 179, 181,
189, 190, 191
A Priori Bad Antennas Not Flagged 6 / 83 total a priori bad antennas:
82, 89, 90, 125, 138, 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_2459855.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.367148 -1.260323 -0.339412 0.840626 -0.920421 -0.492947 -0.036955 1.191944 0.686290 0.707123 0.443787 3.070426 2.692669
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.424692 4.693253 1.583441 0.374453 -0.282419 0.240701 1.154216 -0.467210 0.700014 0.704716 0.443188 3.889506 3.049283
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 0.546569 0.440069 -0.586697 0.726166 0.469498 1.710235 0.990844 0.614184 0.703832 0.708822 0.442040 1.525596 1.372193
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.617118 -1.863536 0.214979 -0.753442 -0.749963 0.185076 0.048331 7.140344 0.695932 0.703742 0.449632 3.005392 2.891065
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 7.537943 7.054096 22.243652 22.673367 1.007442 2.329922 -0.472624 -2.631775 0.689917 0.689445 0.444281 3.319798 3.020409
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 0.396776 -1.888112 0.614526 -1.163385 1.118888 0.112072 -0.677665 0.043524 0.683871 0.699270 0.453078 1.266084 1.185627
10 N02 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 75.733829 75.438506 inf inf 4363.406592 4363.252393 4164.445122 4163.350360 0.011286 0.008779 0.003269 0.000000 0.000000
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.797667 1.044301 0.360628 -0.852029 0.017356 -0.217107 0.248060 4.153629 0.713529 0.719182 0.439913 3.482522 2.951153
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -1.332394 1.599553 0.923619 0.157321 0.565512 1.178235 0.620610 1.125406 0.709082 0.708705 0.438917 1.540139 1.365097
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -0.632494 1.189841 0.019470 -0.789877 -0.585809 0.001354 1.671127 0.262751 0.701312 0.712898 0.434487 1.554549 1.403151
18 N01 RF_maintenance 100.00% 0.00% 39.85% 0.00% 100.00% 0.00% 8.868832 22.764021 -1.192611 -0.231958 0.610645 5.074558 12.297952 22.680657 0.683038 0.479765 0.484828 2.540158 1.633600
19 N02 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 75.632891 75.141994 inf inf 4363.329307 4363.348985 4164.218454 4163.675434 0.008758 0.007765 0.000623 0.000000 0.000000
20 N02 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 75.319441 75.780895 inf inf 4363.556047 4363.235386 4164.958120 4163.302762 0.009556 0.010855 0.000808 0.000000 0.000000
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.194479 -2.060594 -0.085531 8.427121 -0.468026 -0.135851 0.823565 1.690809 0.685676 0.708922 0.455870 3.555133 3.124160
22 N06 not_connected 100.00% 44.44% 0.00% 0.00% 100.00% 0.00% 46.979973 14.108478 2.118194 9.772476 11.603151 8.933089 7.423507 12.660289 0.440074 0.636235 0.393263 2.386760 3.116543
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.705515 16.930971 24.263714 25.006081 2.830816 4.301543 2.198011 1.275511 0.033255 0.038328 0.002656 1.188368 1.189827
28 N01 RF_maintenance 100.00% 56.70% 100.00% 0.00% 100.00% 0.00% 22.500463 42.773144 -0.110925 2.207119 5.305294 7.656990 4.504369 14.869488 0.377474 0.166909 0.252306 3.061032 1.509469
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 75.477730 75.505842 inf inf 4363.441442 4363.249219 4164.560632 4163.338990 0.007818 0.006785 0.000648 0.000000 0.000000
30 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 75.534623 75.091620 inf inf 4363.457479 4363.366637 4164.625561 4163.721597 0.006854 0.009869 0.000386 0.000000 0.000000
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.399964 -0.837371 0.975251 1.296489 -0.384756 5.863928 1.151103 3.586728 0.721081 0.723729 0.444544 3.242229 2.718957
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 20.220934 28.981214 7.608984 11.431200 10.086162 4.207450 2.857118 0.779364 0.626914 0.616059 0.292228 2.911894 2.601982
33 N02 RF_maintenance 100.00% 0.00% 16.86% 0.00% 100.00% 0.00% -0.080671 25.171359 -0.447729 0.494540 -0.512161 3.894784 0.824542 21.498752 0.689605 0.526431 0.502528 3.164626 1.730892
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 18.202161 3.546594 7.784330 8.139510 2.684589 8.430062 0.507626 -0.923274 0.043571 0.685276 0.582911 1.220033 3.047257
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.148261 0.502823 0.209023 6.139351 0.086040 0.583900 2.857717 -0.711028 0.604333 0.675157 0.471079 2.719352 2.920611
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 14.518046 11.361278 0.232853 -0.748641 0.679636 0.495966 0.447578 0.465646 0.709771 0.724207 0.433417 3.474946 3.028325
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.502196 0.575206 -0.000453 0.641882 -0.893411 -0.542642 0.404982 9.715972 0.715677 0.733964 0.437446 3.073281 2.771609
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -0.190745 -0.091708 0.261319 0.536957 0.632734 1.149291 3.717545 0.923205 0.721184 0.734503 0.434019 1.350626 1.251041
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 0.452632 -0.072065 -0.007791 0.363525 0.222895 -0.923253 -0.635185 -0.733061 0.709864 0.722777 0.423968 1.486081 1.369723
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 33.59% -0.087961 -0.517278 1.449642 0.007791 1.968092 -1.185647 -0.757450 -0.870818 0.719951 0.726711 0.419685 1.685609 1.593765
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.187997 4.525428 -0.736248 -0.655686 0.106807 -0.827968 -0.283890 -0.919537 0.725845 0.718776 0.437573 3.559543 2.697667
43 N05 digital_maintenance 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 14.562656 5.286206 23.944214 -0.863357 2.764662 0.130601 1.384612 1.120531 0.042336 0.723195 0.529898 1.178665 2.747707
44 N05 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 25.699256 3.365544 1.078009 -0.320132 7.578385 -0.083177 11.327214 6.241234 0.650241 0.715378 0.411015 2.779523 2.763180
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.667857 0.882859 0.230845 0.028688 1.094007 1.134436 -0.408647 13.553773 0.704159 0.709833 0.427993 3.261765 2.695675
46 N05 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -1.138634 17.636350 -1.019219 25.145012 -0.271961 4.266429 -0.111170 1.652898 0.699469 0.037932 0.530426 3.333062 1.202419
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 17.553398 3.970514 7.246546 7.168967 2.664620 8.425401 0.382628 4.219366 0.039828 0.682314 0.575270 1.179651 3.043180
48 N06 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 75.881435 75.479274 inf inf 4363.644384 4363.637796 4165.170593 4164.518655 0.007778 0.007398 0.000793 0.000000 0.000000
49 N06 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 75.746542 75.562949 inf inf 4363.565067 4363.601590 4164.923005 4164.398309 0.008653 0.008363 0.000440 0.000000 0.000000
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.200154 37.662770 0.648289 0.804563 2.968141 1.400693 2.671481 9.409654 0.701415 0.654100 0.393563 3.713420 4.039410
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 38.484088 2.682382 32.490026 1.216078 3.035994 2.659634 7.611310 3.671857 0.040310 0.730889 0.552550 1.140068 2.506430
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 12.240572 11.116375 -0.725862 -0.768168 6.197483 -0.888216 0.951352 -0.275364 0.723799 0.741621 0.421795 2.872876 2.615010
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.122175 3.885811 0.016922 -0.001098 -0.964545 -0.081202 1.758698 3.926196 0.727806 0.745109 0.426317 2.737999 2.468274
54 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 15.738103 10.855745 24.260945 -0.732968 2.753088 3.584607 1.518160 1.289553 0.048396 0.712087 0.557963 1.161356 2.319123
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 1.547528 18.854113 0.746822 25.428371 6.583516 4.263939 0.962063 0.441454 0.713373 0.034147 0.506270 3.080109 1.150280
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 74.81% -1.054210 1.087260 -1.443297 0.012814 -0.325217 1.737880 -0.126151 1.104700 0.722659 0.736514 0.412894 3.607681 2.654859
57 N04 RF_maintenance 100.00% 2.30% 0.00% 0.00% 100.00% 0.00% 49.794826 0.116584 9.837840 0.335016 1.024752 -0.793545 2.151155 -0.198966 0.538373 0.733373 0.410370 3.042334 2.784432
58 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.020490 17.600597 24.100542 25.536734 2.743211 4.327797 1.901462 1.334143 0.036895 0.033895 0.001731 1.149653 1.146712
59 N05 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 36.769955 5.263141 1.362815 0.624491 1.049044 1.398526 2.532185 3.828587 0.636326 0.716542 0.421298 2.664733 2.585901
60 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 16.487810 17.162335 24.203167 25.488042 2.746189 4.338307 1.392116 1.913045 0.027320 0.027095 0.000845 1.187427 1.182376
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.553506 5.078359 3.171309 2.191720 6.036599 0.646494 -0.285103 1.710563 0.646223 0.665575 0.428812 2.815549 2.590845
62 N06 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 75.594207 75.379119 inf inf 4363.694470 4363.645964 4165.340837 4164.545046 0.006756 0.006383 0.000372 0.000000 0.000000
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 4.738774 17.663220 12.240754 8.357938 0.066905 4.302629 -0.307381 1.610901 0.633658 0.045004 0.559809 2.836772 1.172334
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.675317 1.789507 8.503320 13.456783 -0.498627 0.322453 0.372462 -1.518531 0.624391 0.669898 0.463474 3.050438 2.915113
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 0.702623 0.522479 0.391122 -0.292966 2.385389 0.658346 -0.086479 0.148617 0.704531 0.728736 0.443919 1.568104 1.415315
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 0.426879 1.726831 0.764003 -0.159714 1.883220 -0.260250 -0.474965 0.581087 0.709642 0.731243 0.434252 1.671364 1.454142
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -0.527473 -0.586259 -0.679798 -1.357201 0.361369 -0.789826 0.186811 1.558568 0.711998 0.736210 0.423942 1.465404 1.377842
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.157678 42.027670 1.475353 35.411280 -0.046894 4.263309 0.311795 7.792318 0.710172 0.030777 0.492498 2.450447 1.120869
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 89.31% 0.069310 -0.914824 -1.356690 0.669183 1.106048 0.919210 -0.302904 0.759937 0.718613 0.738553 0.415931 2.840637 2.529067
70 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.996477 -0.744628 -0.592462 -0.082979 5.253586 1.345532 0.982316 0.764655 0.736529 0.744029 0.414776 16.788382 13.185385
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 95.42% -0.096351 -0.321615 0.342914 -1.146165 0.509348 -0.818353 -0.227832 0.936904 0.720542 0.742104 0.418514 13.738406 14.296276
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.025679 0.099769 -0.932121 -0.762083 -0.224503 0.447990 2.050980 -0.868444 0.711924 0.735428 0.405948 3.137446 2.743305
73 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.586180 16.717742 23.806969 24.695582 2.844513 4.249554 1.883896 0.148590 0.026645 0.026936 0.000502 1.138548 1.134553
74 N05 digital_maintenance 100.00% 100.00% 70.50% 0.00% 100.00% 0.00% 16.183254 14.213468 24.939947 24.439409 2.682386 4.127708 2.109402 13.280473 0.031570 0.368235 0.241320 1.150077 1.306589
75 N05 digital_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 9.916255 17.977874 10.243546 25.740906 2.627492 4.349958 11.496590 1.884996 0.658194 0.046169 0.493080 2.592180 1.220981
77 N06 not_connected 100.00% 0.77% 0.00% 0.00% 100.00% 0.00% 35.533569 34.843190 13.321055 11.261713 1.146479 2.941226 6.470647 14.007814 0.559088 0.574268 0.268526 2.961751 2.334002
78 N06 not_connected 100.00% 28.35% 0.00% 0.00% 100.00% 0.00% 50.691512 0.312469 10.401613 11.967162 1.388470 0.184292 -0.517856 -0.486014 0.479841 0.684467 0.445973 2.585927 2.551360
81 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -1.352784 0.857664 0.661320 1.594202 -0.777107 3.617941 -0.724559 -0.624106 0.665163 0.693901 0.428610 1.737778 1.590264
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.292341 1.243712 1.680495 -0.156604 0.048379 -0.471971 -0.465061 -1.124180 0.696970 0.718115 0.435260 2.796815 2.312967
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -0.053121 -0.145843 2.502452 -0.312378 -0.764800 0.416921 -0.894721 -0.781961 0.709794 0.728432 0.424881 1.432737 1.393088
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 11.235653 37.310551 -0.474298 34.021081 -1.046192 4.116158 -0.745156 3.553426 0.711906 0.041211 0.591749 2.653930 1.128398
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 0.460274 -0.290164 -0.783488 -1.079697 -0.288674 -0.759031 -0.834272 -1.059071 0.713515 0.731454 0.426244 1.383324 1.376457
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.809581 12.067807 -0.481427 -0.760274 8.385891 -0.205661 0.521396 11.644181 0.710728 0.696179 0.409955 2.667774 2.288174
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 18.431261 11.713230 3.266622 0.287581 15.564497 0.837121 9.476690 1.999112 0.660645 0.749437 0.407653 3.241838 2.637409
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 30.53% 1.088781 1.884898 0.223582 -0.532654 -0.821598 2.944592 0.973255 -0.159955 0.718862 0.737598 0.406302 1.652610 1.434380
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.953431 0.852020 1.573087 0.281696 0.364390 -0.971284 -0.956366 -1.118232 0.723942 0.737782 0.411462 3.105707 2.579076
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.065568 1.165876 -0.456339 1.104713 -0.722550 -0.659504 -0.153781 0.525996 0.712675 0.718827 0.412669 2.458185 2.253640
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -0.160564 -0.072540 1.248426 1.834843 -0.463151 -0.602082 0.682541 -0.038765 0.714389 0.737203 0.432405 1.381587 1.298593
92 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 107.703403 121.550655 inf inf 4345.441290 4338.970895 4163.558909 4164.793723 0.010713 0.010102 0.000887 0.000000 0.000000
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 75.200737 75.375280 inf inf 4347.863424 4353.794572 4168.874277 4166.418551 0.009362 0.009629 0.001149 0.000000 0.000000
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 75.333640 75.362434 inf inf 4363.440967 4363.275470 4164.583632 4163.430438 0.010134 0.008939 0.001482 0.000000 0.000000
98 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -1.456268 2.755517 -0.917311 -0.110672 1.049615 -0.063801 -0.339150 0.724146 0.657860 0.695124 0.436763 1.703942 1.631269
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 0.769444 -0.696349 0.879792 -0.747173 -1.059659 3.633878 0.671317 -1.059372 0.682966 0.714365 0.436116 1.684331 1.490604
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -0.733781 -1.121649 -0.341068 -0.407539 1.254669 -0.815973 -0.578177 -0.623493 0.689871 0.712408 0.424645 1.543985 1.442133
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 13.304586 12.058025 3.546372 -0.027525 -0.478743 0.015062 -0.300300 -0.573617 0.722551 0.737092 0.420248 2.754931 2.538177
102 N08 RF_maintenance 100.00% 63.60% 100.00% 0.00% 100.00% 0.00% 13.097723 17.834391 21.310487 23.899473 3.027536 4.350993 0.102664 2.667408 0.388381 0.042362 0.317434 1.458885 1.227432
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 36.337366 37.788458 28.292905 29.430343 2.616277 4.395388 6.824254 6.147301 0.027118 0.027804 0.001278 1.146578 1.144573
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 12.315441 90.032379 -0.733349 23.000005 1.612512 3.391288 -0.566680 -0.312246 0.729398 0.680550 0.450864 2.721993 2.171328
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 29.77% 0.577575 -0.228427 -0.611554 0.188975 -0.206108 -0.352875 -0.456812 -1.004235 0.724088 0.740263 0.409927 1.908417 1.545772
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.362446 0.859514 0.718173 -1.292318 3.929367 1.302491 0.354042 -0.639696 0.709016 0.732780 0.410828 2.696211 2.529686
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 3.679035 -0.157093 0.332789 -0.069158 -0.282998 -0.576805 0.833984 0.945881 0.700362 0.728071 0.410083 1.575148 1.422843
108 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.634514 5.362652 15.039054 -0.222276 21.804574 -0.162065 0.906790 0.535745 0.618786 0.736486 0.471900 2.137468 2.851613
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -0.445163 17.539160 -0.961060 24.665408 -0.081378 4.323905 0.301224 1.544333 0.709458 0.036540 0.494897 2.953377 1.232354
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 39.238582 23.809119 1.110745 0.106442 5.495454 9.503315 26.022016 53.945722 0.607398 0.682156 0.366360 3.218666 2.662705
111 N10 digital_ok 100.00% 0.00% 85.82% 0.00% 100.00% 0.00% 0.285825 15.955833 0.755351 24.333101 -0.701297 3.931230 -0.272285 2.174448 0.696506 0.255480 0.509836 3.420001 1.325519
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -0.480702 -0.329179 -0.235140 -1.373451 -0.527496 1.248802 0.416970 -0.416834 0.681282 0.712901 0.458058 1.286754 1.212132
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -1.297373 0.761353 -1.120041 1.227679 2.034017 -0.233964 0.141332 -1.087991 0.661739 0.700235 0.445271 1.662712 1.510508
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 17.301739 19.833631 24.279330 26.354313 2.616631 4.289259 0.910225 2.210288 0.027945 0.032261 0.003490 1.191535 1.186320
118 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.223878 0.592836 -0.938846 -0.492737 1.441695 6.007782 0.290277 0.449830 0.694513 0.721841 0.432354 3.152595 2.562513
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.204699 3.700667 6.488531 6.245367 -0.895734 18.700435 -0.693620 0.870685 0.710935 0.677585 0.436029 3.211493 2.248915
120 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 4.361623 36.382719 -1.032733 33.808955 0.162277 4.221401 1.839757 6.452136 0.712058 0.036149 0.594318 3.112652 1.147375
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.754896 8.805926 0.314534 -0.185239 -0.319763 -0.478936 26.822769 9.215542 0.723538 0.741511 0.421974 2.852837 2.626793
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 13.452831 11.131423 0.148371 1.140930 1.508800 -0.311589 -0.472272 -1.103611 0.727018 0.739615 0.419141 2.778502 2.481233
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.697784 14.861576 0.822616 -0.133902 -0.395788 -0.309701 -0.800898 -0.704598 0.737088 0.749177 0.417952 3.645196 2.791473
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 8.40% -1.211728 1.608484 0.145927 -1.315217 -0.330233 -0.800515 -0.386425 -0.351288 0.733444 0.742852 0.414880 1.808280 1.461813
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.088809 0.053121 -1.032269 0.344894 -0.689478 0.405739 -0.660533 -0.973032 0.710986 0.736049 0.416306 3.327009 2.919571
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.600853 0.544777 1.084613 -1.359861 11.760214 -0.140487 10.100453 -0.858366 0.685503 0.731666 0.422599 3.362463 2.674964
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -0.689888 0.401634 1.390830 -0.709482 1.501861 0.194954 -0.319170 1.779216 0.709268 0.736105 0.438260 1.335716 1.284734
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.652440 7.326727 0.246197 2.114526 -0.367545 2.165835 -0.299333 -0.785649 0.711599 0.723752 0.436718 2.783640 2.589906
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 1.158494 -1.822897 -0.336361 -0.578965 0.218737 -0.495575 0.988204 -0.575457 0.692232 0.725733 0.451536 1.390527 1.273456
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 3.049082 0.410702 -0.559682 -0.222133 -0.589098 -0.144363 -0.249868 1.393255 0.676436 0.714744 0.447186 1.399116 1.268784
135 N12 digital_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -1.396827 17.503519 -0.813827 25.605149 -0.214272 4.356138 0.291414 1.070958 0.662171 0.040443 0.485492 3.474327 1.225589
136 N12 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.162793 2.013903 -0.814801 0.082295 -0.703894 3.157753 0.011204 0.270022 0.661189 0.702808 0.434478 3.628490 2.845263
137 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.566128 -1.248434 -0.660290 -0.966775 1.847030 5.809206 -0.413083 -0.387502 0.676030 0.703548 0.433842 3.301134 2.669697
138 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.277799 0.074848 0.100029 -0.214892 -1.096745 -0.451399 2.071141 -0.831979 0.696166 0.721519 0.437443 3.899303 2.954073
140 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.677302 18.406191 23.674207 25.280292 2.923850 4.304011 1.795371 2.206128 0.037338 0.037395 0.001971 1.167837 1.167738
141 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.975584 5.857752 -0.713258 7.124383 2.499749 4.364898 2.390350 12.315455 0.704552 0.693196 0.397126 3.363372 2.808851
142 N13 digital_ok 100.00% 81.99% 100.00% 0.00% 100.00% 0.00% 55.301034 17.299356 1.858469 25.431580 6.072764 4.304259 2.165338 1.286860 0.334964 0.036762 0.196080 2.938883 1.217992
143 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 2.492032 -1.588841 -0.200289 -1.063975 0.460740 0.754641 -0.648933 -1.077251 0.715400 0.738415 0.410834 1.746687 1.373740
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.721914 0.713326 -1.208575 1.311217 0.153723 0.225833 0.181829 16.127197 0.719117 0.741471 0.414316 4.715058 3.684030
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 16.513840 18.131662 24.447338 25.574905 2.694104 4.308249 1.200057 2.022831 0.034866 0.027561 0.004889 1.253692 1.254401
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 75.539106 75.395130 inf inf 4363.302211 4363.318181 4164.130250 4163.550150 0.010181 0.012676 0.003084 0.000000 0.000000
148 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 75.459938 75.060141 inf inf 4363.007952 4362.107851 4165.266388 4165.273726 0.010980 0.011691 0.003548 0.000000 0.000000
149 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 75.703221 77.451846 inf inf 4362.906607 4361.769564 4164.883072 4164.445811 0.009196 0.005369 0.007841 0.000000 0.000000
150 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 16.832641 17.557127 24.238585 25.389837 2.752306 4.301116 1.643268 1.558579 0.026400 0.029046 0.000937 1.218165 1.216370
151 N16 not_connected 100.00% 11.49% 0.00% 0.00% 100.00% 0.00% 44.113015 1.512859 10.244926 1.852762 0.823100 0.921064 1.455084 -0.634441 0.518583 0.666624 0.439773 2.308530 2.202401
152 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.730984 1.789143 6.572650 8.731480 -0.149684 0.207591 10.222152 -0.017010 0.638925 0.688494 0.472440 2.479097 2.489249
153 N16 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 16.355420 0.786453 7.057124 7.551839 2.662368 8.992588 0.477344 -0.820623 0.041444 0.676832 0.577557 1.191799 2.232598
154 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.032122 -0.163611 13.489433 12.363130 0.083537 -0.428348 -1.180220 -1.249497 0.636697 0.680842 0.476510 2.325623 2.384815
155 N12 digital_maintenance 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 15.701132 0.179147 23.310725 -0.596478 2.850742 0.644190 1.304259 2.483270 0.057046 0.699174 0.545735 1.220436 2.658963
156 N12 digital_ok 100.00% 88.12% 0.00% 0.00% 100.00% 0.00% 12.616867 0.345256 23.150111 0.704827 2.369915 -0.293816 1.696056 0.463973 0.277647 0.706037 0.520810 1.500030 2.917490
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 0.476825 -0.127194 1.064486 0.464197 -0.823757 -0.317686 -0.260839 -0.801407 0.688270 0.713777 0.438892 1.590740 1.354494
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.791413 -1.467260 8.213154 1.207005 1.461859 0.697338 3.935730 21.697932 0.706240 0.721077 0.446032 2.921548 2.661232
160 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 17.292165 18.915045 24.065318 25.182186 2.841949 4.339980 2.144118 2.777658 0.039291 0.040969 0.002527 1.185451 1.183504
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.714605 41.081202 -0.568684 1.742671 -0.839403 0.568840 0.616846 0.422985 0.700458 0.604498 0.376567 2.758890 3.054311
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 1.508547 1.030435 -0.870264 -1.256378 1.367087 1.025052 0.151602 -0.240438 0.717791 0.734335 0.419534 1.823049 1.590879
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 0.180134 -1.044977 -0.842020 0.376014 -1.230433 -0.346623 0.254932 1.782955 0.720578 0.729867 0.421715 1.703944 1.482785
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -0.652504 -0.320021 -0.420157 0.246220 -0.956210 1.409421 0.070803 2.947358 0.717243 0.734182 0.422996 1.812631 1.532244
165 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -0.421491 1.230630 3.692049 0.066464 1.762786 -0.600176 0.328142 -0.141802 0.721735 0.732655 0.429804 1.602051 1.503500
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 25.206816 17.014300 0.186640 0.044860 3.937317 6.707722 29.188223 15.512697 0.650956 0.693795 0.388072 3.369707 3.281774
167 N15 digital_ok 100.00% 7.66% 0.77% 0.00% 100.00% 0.00% 70.501301 64.958564 4.241183 2.614702 5.278508 4.351557 34.964724 33.955851 0.528302 0.579035 0.245664 3.123301 2.762399
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.471523 2.866990 0.772728 -1.233857 1.500202 0.610070 0.127081 -0.456423 0.699339 0.723135 0.445554 3.261873 2.844791
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.636545 7.081043 0.375959 -0.027081 -1.077789 -0.329027 -0.529276 0.402522 0.697425 0.705917 0.447236 2.874313 2.385607
170 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.995234 2.648959 0.030292 -1.163855 0.552871 -0.561387 7.203703 1.648901 0.689171 0.716437 0.458285 3.538127 2.776068
171 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.651843 5.539403 7.928781 0.385077 -0.521077 1.326300 -0.660695 -0.579060 0.651739 0.629515 0.443193 2.749630 2.150417
173 N16 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 18.955849 18.769545 6.018296 7.278260 2.880775 4.277992 2.176559 5.661800 0.036236 0.041409 0.005314 1.169616 1.170123
176 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.077171 0.739321 -0.091206 -0.657413 -0.252589 -0.174690 -0.122063 5.380692 0.665555 0.693361 0.456920 3.133653 2.776734
177 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -1.833760 -0.760555 0.700276 0.719524 -0.202236 0.624760 -0.657083 0.835018 0.672712 0.694685 0.451217 1.600100 1.385034
178 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.236451 -0.663171 2.949621 -0.943659 -0.127837 0.890142 3.289407 1.622531 0.668587 0.705792 0.453166 2.657618 2.507987
179 N12 digital_ok 100.00% 100.00% 98.08% 0.00% 100.00% 0.00% 17.202877 18.967519 24.638946 26.742097 2.629952 4.336699 1.036946 1.236465 0.039887 0.101292 0.049491 1.191303 1.205392
180 N13 RF_maintenance 100.00% 0.00% 78.16% 0.00% 100.00% 0.00% 1.350007 15.708372 -1.317301 24.635947 -0.513129 3.765720 -0.031798 1.631937 0.711359 0.325473 0.507196 11.391516 2.128755
181 N13 digital_ok 100.00% 100.00% 98.08% 0.00% 100.00% 0.00% 16.786825 63.561314 24.606318 6.123187 2.767411 8.312054 2.329897 5.563559 0.044777 0.190496 0.094123 1.200527 1.554759
182 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.756421 17.143506 18.759370 24.610183 0.280101 4.320395 -1.094064 2.093033 0.724634 0.051569 0.553833 3.354665 1.297964
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -2.218351 -0.550187 1.030607 -0.894413 0.089293 0.181099 0.114154 3.012090 0.715038 0.721251 0.422540 1.719230 1.456196
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% -0.270194 1.224234 -0.825314 0.562808 0.403847 -0.820979 1.391049 0.855655 0.710777 0.711818 0.423557 1.893356 1.613624
185 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 0.497888 -1.116175 -1.174279 0.440526 -0.717492 -0.820009 0.038765 0.736731 0.716108 0.721829 0.429510 1.537461 1.454115
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 0.659094 -0.544158 0.129693 -0.977276 2.123656 0.584244 2.900826 0.607590 0.710544 0.726878 0.435520 1.520381 1.411734
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 4.58% 0.00% 0.368254 -0.178740 1.160397 -0.820906 -1.105981 -0.001354 1.542428 0.957456 0.696624 0.723992 0.439636 1.466139 1.296796
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.456844 3.508830 9.020453 5.958308 -0.729254 2.809958 -0.307615 2.051152 0.704166 0.726130 0.448421 3.669078 3.459395
190 N15 digital_ok 100.00% 10.73% 100.00% 0.00% 100.00% 0.00% 59.336732 17.677869 10.863997 25.662466 1.541960 4.358429 12.827694 1.615085 0.524858 0.039114 0.388971 2.586354 1.220948
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.243527 0.158752 8.080265 5.830446 0.070197 -0.466513 4.558924 4.306678 0.694060 0.723700 0.470702 3.321717 3.003136
192 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.156400 12.037743 21.482126 26.734089 0.588275 3.925148 -1.517042 -3.574981 0.665262 0.677613 0.459732 2.592605 2.337533
193 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.208719 1.657070 26.684271 16.842437 2.151837 0.787544 -3.183822 -0.985429 0.632801 0.694689 0.486972 2.537012 2.711368
200 N18 RF_maintenance 100.00% 100.00% 97.32% 0.00% 100.00% 0.00% 18.219379 55.090675 7.209504 13.434380 2.809717 6.060465 1.064928 -1.114998 0.048532 0.215981 0.148225 1.189857 1.511832
201 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.534206 10.352155 26.632797 25.185957 2.170257 3.371772 -3.240362 -3.083511 0.675240 0.691880 0.428213 2.747502 2.558359
202 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.244650 5.586998 14.245567 -0.209822 -0.646162 2.163576 -0.596105 1.287259 0.703851 0.652121 0.441855 3.060249 2.223333
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 19.104372 20.385860 6.499971 7.588707 2.741513 4.300435 1.891451 2.009025 0.034983 0.043549 0.002000 1.192413 1.194626
219 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.843353 7.783980 27.028035 22.532406 2.339865 2.529316 -3.334054 -2.674448 0.643096 0.701670 0.456002 2.198351 2.319963
220 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.206969 0.323589 10.101552 11.749115 -0.415075 0.442509 1.895916 -0.446586 0.688720 0.699637 0.434036 2.371580 2.179321
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.139897 1.254581 4.135551 11.225566 1.342534 -0.140893 1.228896 -0.538467 0.662051 0.703293 0.447653 2.514596 2.366919
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.222904 2.052402 12.164727 11.909066 0.679443 1.942109 4.487672 -0.756957 0.697332 0.706844 0.442367 3.528354 2.678967
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.511279 3.058827 3.407170 9.060482 0.508962 0.685470 0.764252 -0.377673 0.645826 0.682683 0.448684 2.482551 2.486815
238 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.466359 -0.242733 15.689943 15.096037 -0.125476 2.624229 -1.509379 -1.887304 0.695490 0.700382 0.451071 2.733926 2.493361
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.065060 3.189259 10.098221 0.265903 0.583160 1.263693 6.029941 13.374335 0.688909 0.648551 0.459540 2.993768 2.242183
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 0.098504 19.006519 2.004322 14.663878 -0.419896 4.287066 2.331877 1.832288 0.692958 0.049323 0.545094 0.000000 0.000000
321 N02 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.678636 2.002606 10.985473 11.657338 0.141662 0.187520 2.315561 1.457933 0.598358 0.618732 0.462053 0.000000 0.000000
322 N05 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.064902 4.445657 12.713477 18.726737 -0.357791 1.283891 0.028508 -1.618631 0.584119 0.609411 0.454455 0.000000 0.000000
323 N02 not_connected 100.00% 73.56% 0.00% 0.00% 100.00% 0.00% 38.281326 3.276280 1.836464 17.207383 1.317333 0.463954 6.740216 -0.851105 0.357702 0.600713 0.439963 0.000000 0.000000
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.574371 4.534527 15.427823 17.139059 0.539897 0.206508 -1.053136 -1.941041 0.585429 0.605322 0.442452 0.000000 0.000000
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.685121 -0.643258 15.705481 8.642606 -0.422494 -0.061807 -1.506092 -0.596047 0.630340 0.630832 0.466836 0.000000 0.000000
329 N12 dish_maintenance 100.00% 10.73% 0.00% 0.00% 100.00% 0.00% 5.805289 -1.646116 -0.330932 10.048705 -0.026653 0.051431 2.703458 0.055121 0.509610 0.616953 0.460229 0.000000 0.000000
333 N12 dish_maintenance 100.00% 15.33% 0.00% 0.00% 100.00% 0.00% 6.277307 1.083114 0.165407 8.280333 -0.197268 -0.147976 1.753339 0.605727 0.509857 0.598853 0.451622 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_2459855.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

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