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 = "2459850"
data_path = "/mnt/sn1/2459850"
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-27-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/2459850/zen.2459850.36710.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 1712 ant_metrics files matching glob /mnt/sn1/2459850/zen.2459850.?????.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 172 ant_metrics files matching glob /mnt/sn1/2459850/zen.2459850.?????.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 2459850
Date 9-27-2022
LST Range 22.679 -- 7.893 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1712
Total Number of Antennas 177
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 3
dish_ok: 1
RF_maintenance: 35
RF_ok: 9
digital_maintenance: 11
digital_ok: 95
not_connected: 23
Commanded Signal Source None
Antennas in Commanded State 0 / 177 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 16
Nodes Registering 0s
Nodes Not Correlating N05
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 64 / 177 (36.2%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 132 / 177 (74.6%)
Redcal Done? ✅
Redcal Flagged Antennas 11 / 177 (6.2%)
Never Flagged Antennas 28 / 177 (15.8%)
A Priori Good Antennas Flagged 74 / 95 total a priori good antennas:
3, 5, 7, 10, 15, 19, 21, 29, 30, 31, 37, 38,
40, 41, 42, 45, 46, 51, 53, 54, 55, 56, 68,
69, 71, 72, 73, 84, 85, 86, 88, 91, 93, 94,
98, 101, 103, 105, 106, 108, 109, 111, 117,
121, 122, 123, 124, 128, 130, 140, 141, 142,
144, 147, 156, 158, 160, 161, 164, 165, 167,
169, 170, 176, 177, 178, 179, 181, 183, 186,
187, 189, 190, 191
A Priori Bad Antennas Not Flagged 7 / 82 total a priori bad antennas:
4, 89, 90, 125, 136, 137, 148
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_2459850.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% 4.701449 -1.156305 -0.511974 0.436454 -0.604114 0.011263 -0.437143 3.539540 0.729551 0.747667 0.362017 3.018421 2.610904
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.626095 3.721986 1.008097 -0.002736 -0.536515 -0.069040 -0.262116 -0.317954 0.748044 0.745445 0.360699 3.889289 2.797354
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 3.49% 0.152083 0.014990 -0.772948 1.902879 -0.404126 0.258290 0.152634 -0.599132 0.749076 0.751519 0.358999 1.847963 1.463927
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.058043 -1.442580 -0.370594 -0.921027 -0.500640 0.845478 0.380851 17.339803 0.738408 0.747238 0.358113 3.086562 2.982905
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.740937 5.118935 22.369433 22.080416 5.767631 14.124098 2.942601 8.888193 0.737087 0.733185 0.357461 3.200537 2.690806
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% 0.069953 -1.160602 0.059612 -0.583732 1.235136 1.137995 -0.029068 2.805595 0.734497 0.743109 0.365039 1.433622 1.386039
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.285726 -1.455795 -0.805971 -0.169680 1.779394 4.844649 2.720462 8.484891 0.725494 0.734105 0.368102 2.932261 2.751693
15 N01 digital_ok 0.00% 0.00% 0.00% 0.58% 18.02% 0.00% 0.035891 0.328525 2.147653 1.280351 -0.658200 -0.375441 1.465579 1.218152 0.746564 0.753869 0.355430 1.809808 1.528575
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% -0.938541 0.623896 0.304167 -0.208133 -0.859837 0.483950 1.255379 3.009023 0.752799 0.750759 0.354474 1.780249 1.473226
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% -0.801503 0.565983 -0.686831 -0.798383 -0.605295 -0.446962 2.136847 0.740784 0.747778 0.755054 0.351006 1.668997 1.530926
18 N01 RF_maintenance 100.00% 0.00% 28.04% 0.00% 100.00% 0.00% 10.361661 15.911168 0.172573 0.353681 2.196939 7.023161 24.833086 54.994483 0.715029 0.553945 0.384660 2.509181 1.645717
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.264924 -1.521207 -0.482229 -0.650528 -0.028950 1.888107 17.025509 19.656204 0.741992 0.755339 0.356682 2.771573 2.759909
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% -1.629213 3.704205 0.671900 -0.329340 0.945082 0.909268 0.388496 -0.289748 0.745714 0.739275 0.361163 1.407381 1.401961
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.810319 3.651239 5.905192 20.152360 1.026246 11.768526 3.378881 11.089341 0.740963 0.742853 0.367079 2.951714 2.742877
22 N06 not_connected 100.00% 34.46% 0.00% 0.00% 100.00% 0.00% 33.913151 13.650581 2.536741 9.476696 10.061008 8.386575 6.380513 6.512300 0.531295 0.691576 0.318944 2.116672 2.713851
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 12.546537 18.097178 23.132160 24.646587 10.286407 19.889373 8.066273 16.321466 0.032313 0.039482 0.004650 1.153546 1.153224
28 N01 RF_maintenance 100.00% 52.57% 84.11% 0.00% 100.00% 0.00% 17.050511 36.917424 0.482366 2.743991 10.317113 20.492361 12.342531 46.207328 0.457215 0.276207 0.223522 4.069913 1.610770
29 N01 digital_ok 0.00% 0.00% 0.00% 0.58% 18.02% 0.00% -1.472619 -1.166606 -0.828184 -0.469056 -1.172327 -0.859490 -0.448487 1.213943 0.750991 0.755533 0.343854 1.839424 1.577690
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.048214 -1.380375 -0.093056 -0.091468 -0.114980 -0.335554 21.172282 0.247266 0.744858 0.756831 0.346317 2.686679 2.513970
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.157225 1.307497 11.417235 13.850563 -0.800983 3.689172 0.468164 7.865023 0.764970 0.768114 0.357650 3.083687 2.771716
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.507505 10.027207 20.484899 21.214118 6.243060 13.295420 -0.507776 9.556920 0.641368 0.663160 0.189048 3.133566 2.674038
33 N02 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 14.495922 3.153455 7.424956 7.830817 10.308146 4.237785 5.394209 2.879895 0.048394 0.730107 0.571932 1.265949 3.091004
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.478256 1.414996 1.179211 6.940693 1.753993 5.309765 8.766453 5.439674 0.666741 0.723949 0.377396 2.581878 2.837892
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.791388 9.161427 0.043880 -0.211546 0.597875 1.282477 0.901861 0.854432 0.748243 0.760180 0.357096 3.147711 2.624873
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.843044 0.365770 0.451554 -0.535204 -0.499165 -0.599047 0.091154 20.706827 0.756400 0.770854 0.360393 2.889766 2.523750
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.113929 0.644856 -0.290731 0.718695 0.944055 -0.602315 11.344130 3.933986 0.760694 0.771347 0.355772 2.758042 2.535063
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 3.49% 0.359617 -0.566985 -0.540910 0.139138 -0.221433 -0.949293 -0.412513 -0.944154 0.751773 0.760600 0.343313 1.755755 1.535360
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 17.44% -0.111406 -0.223854 2.855065 -0.815179 1.057921 -1.147184 -0.585945 -1.291415 0.760789 0.762658 0.338319 1.940665 1.655864
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.58% -0.266070 1.888864 0.873495 -0.709893 -1.091268 -0.940735 -0.537863 -1.349396 0.765442 0.759730 0.349249 1.816754 1.563282
43 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 11.629747 2.029115 22.819260 0.420388 10.305514 0.088132 6.787655 0.970968 0.027401 0.050625 0.020409 1.157408 1.183744
44 N05 digital_maintenance 0.00% 100.00% 100.00% 0.00% 100.00% 0.00% 2.653715 1.763657 0.002736 -0.594706 0.038439 -0.661014 -0.470547 -0.837631 0.055725 0.048014 0.003824 1.189620 1.190050
45 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% -0.822520 -0.770676 -0.337865 -0.158418 0.308886 1.459648 0.111245 36.235589 0.048778 0.049507 0.002202 1.198563 1.198054
46 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% -1.225110 18.734903 0.711988 24.792202 0.471514 19.809234 1.880198 17.586417 0.054791 0.026605 0.027103 1.192065 1.162291
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 13.980500 3.342715 6.904860 7.568421 10.321477 6.386138 4.838039 7.224711 0.037005 0.731292 0.583589 1.194079 2.714417
48 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.756966 2.875865 15.622652 16.339374 2.289820 5.817607 -0.162938 5.688537 0.726403 0.746230 0.367607 3.055441 2.934204
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.609405 2.777736 9.664891 16.188615 1.193808 8.520428 1.457614 6.879650 0.702468 0.734451 0.369099 2.877838 2.929925
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.121750 26.778219 -0.052271 1.222971 2.791719 11.577287 1.680637 41.140505 0.742815 0.697005 0.339427 3.475828 2.913995
51 N03 digital_ok 100.00% 97.66% 0.00% 0.00% 100.00% 0.00% 30.952027 2.737685 31.038196 0.822729 10.134753 1.564473 18.610144 3.482470 0.071723 0.768148 0.469160 1.124559 2.514897
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.923400 8.348063 2.886105 2.421972 6.168597 -0.997932 1.235952 0.027002 0.757446 0.772564 0.349152 2.753331 2.492724
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.422549 3.144145 0.759097 1.240929 -0.925289 -0.295356 3.685115 9.812616 0.762676 0.777207 0.349178 2.785358 2.505752
54 N04 digital_ok 100.00% 97.66% 0.00% 0.00% 100.00% 0.00% 12.517605 5.490366 23.129395 -0.455239 10.337531 1.064916 7.208210 1.506505 0.076552 0.757035 0.511281 1.382981 2.546884
55 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.694830 3.479261 0.056654 0.564463 6.569703 0.010035 1.067303 -0.498570 0.755860 0.759457 0.327934 2.956047 2.435250
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 8.72% -0.258899 0.577212 0.202351 1.453469 -0.024983 0.762861 -0.003202 -0.059800 0.761809 0.774968 0.331227 2.124606 1.565327
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 38.129192 0.591203 7.156057 -0.122113 6.283682 0.200816 7.609892 1.123278 0.609326 0.771338 0.336120 3.754929 2.423360
58 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 11.978275 18.592303 22.950170 25.130504 10.363400 19.961295 8.241577 17.094340 0.027860 0.026293 0.001649 1.147802 1.143827
59 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 26.038955 3.197912 2.226979 0.241278 3.710470 0.146991 2.885598 2.037742 0.045671 0.048775 0.001403 1.182413 1.178893
60 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.136291 18.230219 23.061879 25.096854 10.327660 19.918281 6.597873 17.947985 0.026540 0.025228 0.001194 1.147297 1.139243
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.238006 5.765650 3.432056 3.005442 3.995943 4.160238 0.349184 6.259522 0.698381 0.714010 0.344016 2.767619 2.544806
62 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.449856 2.934137 13.397903 16.100141 1.847220 8.443309 0.022336 5.776343 0.731196 0.751788 0.358853 3.166085 2.969473
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 2.990743 18.686444 13.083727 8.802930 0.798459 19.870980 0.964773 17.251647 0.701802 0.054433 0.605320 2.792661 1.233780
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.550201 2.207758 9.489298 13.694601 0.959260 6.434910 4.026488 5.257387 0.690634 0.723186 0.373830 2.980327 2.941667
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% 0.535993 0.141372 0.625979 -0.715267 2.882253 1.060632 -0.641435 0.292744 0.740708 0.761154 0.371258 1.530816 1.388508
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% 0.423727 1.903279 0.310877 -0.340983 0.384609 -0.867530 -0.499859 1.416286 0.748542 0.768713 0.362839 1.662230 1.396480
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% -0.909061 -0.324489 -0.817641 0.204198 0.380674 -0.187969 1.225899 2.730931 0.753670 0.772838 0.351269 1.451728 1.344717
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 2.685909 38.359822 0.668001 34.626214 0.076368 18.772786 0.176315 26.134501 0.750926 0.041890 0.466570 2.664471 1.119932
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 72.67% -0.103311 -1.082340 0.147378 0.255993 1.070015 1.427352 0.105916 1.570887 0.759606 0.775701 0.339168 2.688504 2.469902
70 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.374646 -0.838765 -0.166148 -0.264930 3.684279 0.195774 -0.248845 1.041498 0.774371 0.780291 0.333035 20.183388 14.304430
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 81.98% -0.320662 -0.702292 -0.228998 -0.779567 0.374860 -1.231858 -0.445826 -0.542040 0.761075 0.780314 0.340101 12.476041 12.957250
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.934380 0.005180 -0.369330 0.660503 1.300181 0.462962 2.632888 -0.493894 0.755204 0.774892 0.327151 3.385252 2.580750
73 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 11.672926 1.414638 22.703634 -0.132104 10.277233 1.269566 8.277679 0.055245 0.027330 0.055030 0.023886 1.144955 1.170888
74 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 12.927092 15.210736 23.717976 23.919806 10.503541 17.624964 7.873714 44.648017 0.025692 0.052993 0.016857 1.148662 1.150278
75 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 6.459026 19.017984 6.245003 25.317887 5.511748 19.969526 6.496170 17.519660 0.043181 0.030448 0.021805 1.183670 1.155179
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 25.352745 31.082167 14.244626 11.176956 7.059678 13.033647 7.999199 7.354579 0.624665 0.620054 0.190183 2.913957 2.260792
78 N06 not_connected 100.00% 12.85% 0.00% 0.00% 100.00% 0.00% 37.566240 0.607696 11.135638 12.455829 5.900964 3.279892 -0.295260 5.914976 0.570468 0.735910 0.356466 2.543148 2.654551
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 8.662920 34.102687 -0.232493 33.284430 -0.923094 18.924066 -0.508955 20.243970 0.752575 0.068376 0.595841 2.950553 1.126699
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.58% -0.890068 1.598740 -0.886705 -0.666928 -0.877803 0.808029 -1.014824 -0.711479 0.750224 0.767057 0.346230 1.421070 1.366331
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.185901 7.489847 -0.582169 0.021217 6.388906 1.138010 3.839976 26.445041 0.752065 0.741734 0.334659 2.477021 2.239337
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 17.732176 9.660790 4.179209 0.755531 27.169955 1.655239 12.798048 1.836811 0.699633 0.785622 0.329904 3.134971 2.594371
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 20.93% 0.956550 0.753345 1.397510 -0.752482 -1.043865 1.379018 -0.637989 -1.403113 0.762038 0.773191 0.329151 1.873154 1.457081
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.498224 -0.014990 3.178181 0.285169 0.552394 -0.467302 -0.824107 -1.010232 0.766307 0.768513 0.334559 3.918418 2.874043
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.047887 -0.227366 -0.814494 0.751670 -0.687968 -0.298511 0.485219 1.920131 0.754289 0.763517 0.335414 3.043751 2.636627
91 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.228303 1.007674 11.365476 11.490728 0.478203 1.982136 0.496267 3.575765 0.767245 0.783390 0.346890 3.097008 2.872484
92 N10 RF_maintenance 100.00% 74.18% 82.94% 0.00% 100.00% 0.00% 48.156290 63.921323 3.964210 5.015883 11.294438 20.378653 2.739193 15.245295 0.394062 0.355420 0.107456 2.206646 1.753786
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.392626 0.325963 0.859979 -0.697097 1.539285 -0.358142 11.011520 -0.389818 0.745975 0.762585 0.353409 3.295855 2.969490
94 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.487723 -1.234243 -0.286644 0.761658 0.712114 2.763637 2.899059 6.527852 0.746154 0.753142 0.358865 3.521399 2.953408
98 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.395414 4.483375 -0.519542 -0.359627 0.819951 2.163871 0.429064 2.642514 0.710273 0.732556 0.360495 2.974614 2.773775
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% 1.349560 -0.467276 1.623854 -0.429730 -0.349945 -0.282919 1.362344 -1.375934 0.708020 0.747993 0.367876 1.724381 1.412965
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% -0.300097 -0.819577 -0.717653 1.210351 1.012685 -0.467410 0.439395 -0.660936 0.730592 0.747777 0.353726 1.531554 1.383981
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.077610 11.388837 5.033655 1.305443 0.055565 -0.382850 0.146820 -0.622793 0.759334 0.772888 0.351745 2.931643 2.573762
102 N08 RF_maintenance 100.00% 50.23% 100.00% 0.00% 100.00% 0.00% 10.176026 19.676127 21.595703 25.191215 10.247811 19.899664 4.252760 20.434245 0.477970 0.051320 0.391118 1.463721 1.214819
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 28.917969 34.332772 26.897980 28.765064 10.562265 19.497128 17.590634 24.823180 0.027355 0.031804 0.004366 1.146393 1.146753
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.220590 70.726355 5.274625 20.297858 1.521453 -0.487481 -0.458367 -0.658091 0.772272 0.735228 0.366368 3.091175 2.325791
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 18.02% 0.671909 0.057766 -0.795920 3.410853 -0.022608 -0.765776 0.136702 -0.883569 0.753967 0.777674 0.336058 1.820935 1.521282
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.58% -0.033359 1.555819 -0.061285 0.210880 2.938626 0.436761 1.084881 -1.023524 0.752184 0.773033 0.333403 1.666770 1.457727
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% 3.596029 -0.190887 -0.411578 -0.255093 0.174012 -0.133023 1.088411 3.023970 0.747369 0.767582 0.331306 1.527117 1.491458
108 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.075226 3.391758 16.394289 -0.594066 7.282605 2.461436 2.316156 3.470557 0.651728 0.773596 0.390932 2.016247 3.003831
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -0.878108 18.596881 -0.646098 24.333174 -0.146163 19.831648 0.258370 15.954495 0.755109 0.045200 0.478690 3.779687 1.276341
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 34.444798 5.772837 2.048233 -0.475078 3.815921 10.626340 2.793563 14.479881 0.668726 0.760317 0.309416 3.666848 3.258201
111 N10 digital_ok 100.00% 0.00% 74.18% 0.00% 100.00% 0.00% -0.112211 16.870799 0.245157 23.903397 0.034363 18.379842 0.021238 17.808017 0.749425 0.371108 0.433528 3.586127 1.372174
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% -0.809475 -0.432397 -0.704167 -0.461876 -0.767904 0.613999 1.446212 -0.595269 0.736545 0.758474 0.365145 1.264556 1.241295
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% -0.671100 1.036349 0.821592 2.459509 0.618768 0.985017 2.439499 0.835958 0.702121 0.742850 0.371059 1.811993 1.562995
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.761424 20.403151 23.114965 25.920001 10.408912 19.874972 6.283832 18.831946 0.027533 0.030506 0.002618 1.199144 1.190040
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% -0.929096 1.077214 -0.265043 0.669959 0.472296 2.798275 0.926094 2.127605 0.733199 0.756868 0.360878 1.658360 1.400683
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.255297 5.871438 5.949553 11.426859 -1.001597 23.035317 -0.256219 3.471315 0.749165 0.691681 0.373434 2.865771 1.945346
120 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 2.610497 33.600059 10.785364 33.062864 -0.089249 19.193283 3.945000 26.045921 0.729451 0.040300 0.598721 2.556387 1.142220
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.250928 6.721975 0.600931 1.321032 -0.216288 -0.324656 66.540367 17.732055 0.758074 0.773208 0.346986 2.789715 2.540334
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.377395 9.023497 0.010880 0.801176 2.990391 -0.672624 0.510384 -0.771840 0.765688 0.775770 0.342834 3.220553 2.770202
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.193433 11.233578 2.520330 -0.036369 -0.320685 -0.351297 -0.222183 -0.241609 0.772973 0.781004 0.339782 4.041282 2.986680
124 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.643261 0.885730 6.164129 8.817545 -0.899184 0.312415 -0.161455 0.204895 0.775315 0.759080 0.344056 3.784830 2.692302
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.677073 0.577180 -0.715382 1.711859 -0.848911 0.320166 -0.336226 -0.486145 0.750942 0.774354 0.336141 3.405346 2.965737
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 27.135859 -0.279882 2.919664 -0.462878 8.163622 2.023820 9.855966 1.911314 0.689369 0.773148 0.346775 2.758738 2.558982
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% -0.697257 -0.064617 0.758559 -0.774089 0.613734 0.519146 -0.147179 0.748351 0.755615 0.776604 0.348431 1.345953 1.259510
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.345295 4.530076 0.413448 1.118601 -0.015458 1.545640 -0.141937 -0.685363 0.754499 0.767614 0.344897 3.057644 3.132693
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% 1.082566 -0.981742 0.626352 0.677081 -0.325620 -0.726206 -0.953269 -1.027499 0.749917 0.769857 0.356306 1.283325 1.235062
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.286269 0.163502 -0.613672 -0.575805 0.140258 0.563658 2.005789 5.589375 0.731840 0.758070 0.358366 3.194684 3.070227
135 N12 digital_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -1.525529 18.698659 5.587029 25.193428 0.514666 19.971260 0.720318 14.354501 0.696521 0.040282 0.459848 3.148474 1.201837
136 N12 digital_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.658041 0.976136 1.456436 1.026368 0.360843 1.945968 0.897306 1.618528 0.700462 0.733571 0.358355 3.568910 2.785385
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.277249 -1.257491 0.824736 -0.093002 1.558528 0.967613 1.260065 0.640718 0.718686 0.738037 0.360187 3.322321 2.679308
138 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.449190 -0.300371 1.398647 1.420355 -0.480258 0.559259 5.735296 0.807283 0.735185 0.754887 0.363357 3.778305 2.763885
140 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 12.531701 19.311910 22.571257 24.915821 10.226511 19.720237 6.846658 17.488235 0.035743 0.038076 0.003806 1.160506 1.157012
141 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.684994 4.312794 -0.597106 6.940594 1.299271 4.533738 2.579298 33.539998 0.742331 0.737196 0.331399 3.205350 2.720492
142 N13 digital_ok 100.00% 72.43% 100.00% 0.00% 100.00% 0.00% 43.775001 18.424403 2.263283 25.031495 12.522678 19.885654 6.352215 16.361152 0.416983 0.041916 0.237064 2.891298 1.211545
143 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% -0.295301 -1.187585 -0.500365 -0.723547 0.968557 0.404598 0.373484 -0.514015 0.758700 0.773875 0.336818 1.694259 1.383967
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.375549 -0.667023 -0.865473 2.546625 -0.179834 1.188941 0.926237 108.411349 0.758353 0.766002 0.338334 4.415341 3.205795
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.173878 19.038820 23.284110 25.171929 10.331014 19.879524 6.810414 18.552326 0.032289 0.026183 0.002931 1.254739 1.248092
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.948393 -0.135869 1.736475 -0.050407 9.285384 -0.748651 73.397652 -0.342642 0.732800 0.771966 0.341917 3.483188 3.181432
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.213928 0.733764 -0.703624 -0.136304 0.358472 0.062255 -0.646461 -0.672278 0.755903 0.772060 0.353159 3.697153 3.370142
149 N15 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 2.913290 19.308401 0.008705 25.074991 -0.271731 19.868941 1.427899 17.057270 0.743625 0.038222 0.538921 4.382319 1.246417
150 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.398638 18.573970 23.096132 25.003018 10.314246 19.909083 7.608556 17.209145 0.026474 0.027862 0.000477 1.239981 1.237610
151 N16 not_connected 100.00% 8.18% 0.00% 0.00% 100.00% 0.00% 9.592991 2.954686 1.261755 1.526338 200.899389 232.353602 4751.510411 4938.256575 0.593588 0.713847 0.353826 375.475075 113.321886
152 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.918878 1.643865 7.755468 9.339179 0.187475 2.521600 26.178414 4.225161 0.698212 0.734998 0.384006 2.509154 2.528587
153 N16 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 12.983697 1.386091 6.717505 7.207484 10.383200 9.585652 5.548127 2.232256 0.047517 0.723185 0.590245 1.152546 2.248777
154 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.044114 1.088907 14.180354 12.731014 2.188209 5.500962 0.007435 5.401714 0.696202 0.727798 0.388320 2.435664 2.514329
155 N12 digital_maintenance 100.00% 91.12% 0.00% 0.00% 100.00% 0.00% 12.488789 -0.009307 22.229379 0.853266 10.181433 2.095482 5.095914 5.190623 0.112077 0.743600 0.475134 1.250125 3.210253
156 N12 digital_ok 100.00% 86.45% 0.00% 0.00% 100.00% 0.00% 11.831859 0.327457 22.936815 1.853038 10.197243 -0.267308 4.457513 0.566588 0.171641 0.745227 0.462662 1.330186 3.434423
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% -0.377626 -0.757495 0.518910 2.616243 -0.754447 -0.117472 0.015504 0.003202 0.728946 0.740859 0.357974 1.593982 1.398453
158 N12 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 12.837239 19.269933 23.321016 25.554390 10.406474 19.969278 5.613863 14.750072 0.030133 0.025882 0.000867 1.218763 1.206549
160 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.768041 19.673395 22.933358 24.819979 10.300114 19.782311 7.098413 18.110896 0.037782 0.042251 0.004954 1.208619 1.208213
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.271508 36.465140 -0.859567 2.485532 -0.452181 6.257115 0.762054 5.029419 0.748034 0.654436 0.322503 2.987410 3.009646
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% 0.698622 0.386672 -0.694885 -0.017714 0.865597 0.250836 1.043221 0.372590 0.757790 0.769811 0.345105 1.783689 1.499673
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% 0.396922 -0.527392 -0.791723 0.264578 -1.095466 -0.012005 0.062480 2.146959 0.760931 0.765968 0.345096 1.640267 1.436344
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.139924 -1.071220 -0.879687 0.763694 -0.733884 1.190358 0.970430 6.737230 0.756585 0.764623 0.344099 3.612928 2.920413
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.336687 0.186238 5.076329 -0.813694 1.718820 -0.041617 2.514356 0.807264 0.762146 0.766875 0.347538 3.444393 3.059679
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.147264 15.727208 1.199048 0.968127 2.095449 9.467556 6.592502 24.074068 0.725359 0.728975 0.314300 2.920965 2.629599
167 N15 digital_ok 100.00% 9.35% 0.00% 0.00% 100.00% 0.00% 64.676400 50.449634 5.571919 2.886928 8.719643 8.629153 9.210359 14.911533 0.573879 0.629702 0.172275 2.310498 2.131791
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.58% 100.00% 0.00% 1.478382 2.094663 0.205210 -0.225372 0.501435 0.268022 -0.094797 0.041398 0.748882 0.765719 0.353891 3.375103 2.817905
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.140314 4.887188 -0.281391 -0.009499 -0.993067 0.102576 -0.439481 1.379823 0.749875 0.750703 0.359003 3.436091 2.727182
170 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.424004 1.161042 -0.608262 -0.462656 -0.296434 -0.931245 2.407285 4.768628 0.737204 0.757768 0.368499 3.090480 2.688169
171 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.817908 6.878561 8.879559 -0.043857 0.828945 5.875766 -0.200465 3.071102 0.708609 0.670741 0.370243 2.803273 2.092635
173 N16 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.170927 19.604565 5.786790 7.792140 10.234207 19.737596 9.022780 25.056631 0.038024 0.042191 0.005124 1.178912 1.181671
176 N12 digital_ok 0.00% 0.00% 0.00% 0.58% 18.02% 0.00% 0.112142 -0.793950 -0.531877 -0.550425 -0.744141 0.012005 -0.231538 1.177992 0.715630 0.736420 0.373342 1.571310 1.337187
177 N12 digital_ok 100.00% 0.00% 0.00% 0.58% 100.00% 0.00% -0.676668 1.027304 -0.375047 -0.721095 -0.078512 1.370626 0.892141 8.071742 0.721133 0.730548 0.368417 3.231090 2.847895
178 N12 digital_ok 0.00% 0.00% 0.00% 0.58% 18.02% 0.00% -0.275252 -0.973175 0.061220 0.850386 -1.223556 -0.541030 -0.365643 -0.493422 0.725166 0.743100 0.372034 1.520904 1.305673
179 N12 digital_ok 100.00% 0.00% 0.00% 1.75% 100.00% 0.00% -0.323427 -0.848098 -0.715674 -0.442977 4.112232 -0.518741 11.177892 1.475261 0.734735 0.749286 0.370084 2.845469 2.718975
180 N13 RF_maintenance 100.00% 0.00% 70.68% 0.00% 100.00% 0.00% 0.702011 16.391488 0.083443 24.158585 -0.138962 17.478128 -0.321608 14.493327 0.752566 0.417245 0.438316 10.622893 2.194920
181 N13 digital_ok 100.00% 100.00% 83.53% 0.00% 100.00% 0.00% 13.381121 56.337236 23.435760 5.938853 10.339963 20.939777 6.848332 21.511108 0.049167 0.322882 0.178723 1.194352 1.563630
182 N13 RF_maintenance 100.00% 0.00% 91.12% 0.00% 100.00% 0.00% 3.098243 18.365603 19.249602 24.293974 3.149010 19.785089 -1.305563 16.906771 0.762067 0.101894 0.523194 3.745674 1.340618
183 N13 digital_ok 100.00% 0.00% 0.00% 1.17% 100.00% 0.00% -1.915295 -1.545327 0.485322 -0.936581 -0.428376 -0.694806 -0.352728 7.614927 0.754823 0.759994 0.347268 3.514836 2.848218
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% -0.267704 -0.772293 -0.757634 0.343768 0.702153 -0.728327 0.676704 -0.541878 0.753991 0.755197 0.347138 1.537766 1.374505
185 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 18.02% 0.00% 0.438175 -0.850264 0.208731 0.198708 -1.172027 -0.956717 0.114538 -1.031267 0.758624 0.760582 0.348815 1.454861 1.329418
186 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.974412 -0.106046 -0.302900 -0.808461 1.664936 0.484711 4.756664 0.458335 0.751991 0.764172 0.352131 3.008473 2.990268
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.665180 0.121405 0.651691 -0.776529 -0.800672 0.100756 2.991364 5.207422 0.742075 0.764040 0.349797 3.229130 2.887013
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.954490 4.771147 20.925416 20.154602 4.374034 12.511616 -0.983625 15.719194 0.747113 0.760630 0.360624 3.865017 3.018524
190 N15 digital_ok 100.00% 10.51% 92.99% 0.00% 100.00% 0.00% 29.817859 19.709886 19.825788 25.281849 10.897984 19.955874 25.609169 17.451147 0.570446 0.086189 0.387362 2.258415 1.148949
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.804071 2.501996 20.542029 18.433074 3.713233 9.103288 0.990974 8.589305 0.743927 0.762495 0.379700 3.119035 2.741245
192 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.398279 8.110856 11.278921 25.765647 3.566529 18.832005 8.110167 8.625358 0.710305 0.722854 0.371146 2.630484 2.418238
193 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.640245 1.883720 26.494214 16.815634 8.958836 7.053869 -2.074525 7.310098 0.695058 0.739036 0.394392 2.273389 2.396277
200 N18 RF_maintenance 100.00% 100.00% 82.94% 0.00% 100.00% 0.00% 14.468261 46.833015 6.900012 13.096907 10.212518 20.154058 6.489883 7.813720 0.048864 0.320351 0.220837 1.213461 1.558048
201 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.781194 7.104624 26.381320 24.371677 8.844012 16.896217 -1.907981 8.678789 0.719051 0.729036 0.352046 3.053344 2.773163
202 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.702104 6.299247 14.752203 -0.361309 1.223387 5.799795 0.773181 6.372439 0.745104 0.686846 0.370506 3.183152 2.198433
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.239926 20.918789 6.221137 8.075911 10.272032 19.740205 8.816269 18.206772 0.034063 0.054371 0.012150 1.232833 1.236596
219 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.457666 4.922959 26.813624 21.953886 9.350214 13.143319 -2.092035 8.224328 0.691796 0.739114 0.373011 2.401472 2.622412
220 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.378487 0.264737 10.952317 12.200043 0.178872 3.300955 3.973550 3.647598 0.735708 0.741036 0.357806 2.717817 2.429012
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.503094 1.699468 5.298433 11.633825 2.643729 2.963760 3.478778 4.705125 0.709420 0.741078 0.364865 2.412554 2.346393
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.257047 2.126435 13.041270 12.688084 2.365350 3.607128 10.426082 4.657627 0.739473 0.745388 0.362682 3.451149 2.701029
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.865844 2.768592 4.646030 9.535119 1.766854 3.739859 1.168086 3.479271 0.696569 0.722382 0.368451 2.626961 2.600104
238 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.337256 0.963328 16.271830 15.221391 2.392063 7.254904 -0.929867 4.931012 0.738721 0.738469 0.368325 3.009231 2.646022
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.000650 4.327780 11.567608 0.442721 0.449807 4.660875 4.823282 36.153010 0.734293 0.689205 0.381594 3.081907 2.258198
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -0.041715 19.937676 3.237290 14.832817 0.259306 19.800160 8.108668 17.476740 0.735692 0.061347 0.494580 0.000000 0.000000
321 N02 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
322 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 1.612882 3.864819 13.513194 18.531775 1.947333 10.505558 1.635177 6.963674 0.057081 0.059042 0.009562 0.000000 0.000000
323 N02 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.011290 3.993492 16.033160 17.191470 1.958310 8.462671 -0.152094 6.213321 0.654593 0.660249 0.361609 0.000000 0.000000
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.308903 0.638356 16.318770 9.354334 2.151012 5.121323 -0.341147 6.366301 0.691287 0.680855 0.381376 0.000000 0.000000
329 N12 dish_maintenance 100.00% 12.27% 0.00% 0.58% 100.00% 0.00% 4.755437 -0.103502 0.040687 10.728443 2.948699 5.147411 3.040695 5.460149 0.580874 0.671619 0.374726 0.000000 0.000000
333 N12 dish_maintenance 100.00% 14.02% 0.00% 1.75% 100.00% 0.00% 5.128054 1.883238 0.343275 9.165113 2.548827 5.424563 4.030790 5.961941 0.579164 0.657370 0.370532 0.000000 0.000000
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 5, 7, 8, 9, 10, 15, 16, 17, 18, 19, 20, 21, 22, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 135, 136, 137, 138, 140, 141, 142, 143, 144, 145, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 173, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 192, 193, 200, 201, 202, 203, 219, 220, 221, 222, 237, 238, 239, 320, 321, 322, 323, 324, 325, 329, 333]

unflagged_ants: []

golden_ants: []
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459850.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

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