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 = "2459854"
data_path = "/mnt/sn1/2459854"
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-1-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/2459854/zen.2459854.44952.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 1117 ant_metrics files matching glob /mnt/sn1/2459854/zen.2459854.?????.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 112 ant_metrics files matching glob /mnt/sn1/2459854/zen.2459854.?????.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 2459854
Date 10-1-2022
LST Range 0.925 -- 6.936 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1117
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 56 / 180 (31.1%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 137 / 180 (76.1%)
Redcal Done? ✅
Redcal Flagged Antennas 0 / 180 (0.0%)
Never Flagged Antennas 43 / 180 (23.9%)
A Priori Good Antennas Flagged 62 / 97 total a priori good antennas:
3, 7, 19, 20, 21, 30, 31, 37, 38, 42, 45, 46,
51, 53, 54, 55, 68, 71, 72, 73, 84, 86, 91,
93, 94, 98, 101, 103, 106, 107, 108, 109, 111,
117, 118, 121, 122, 123, 124, 128, 140, 141,
142, 144, 147, 156, 158, 160, 161, 164, 165,
167, 169, 170, 176, 178, 179, 181, 183, 189,
190, 191
A Priori Bad Antennas Not Flagged 8 / 83 total a priori bad antennas:
82, 89, 90, 125, 137, 138, 148, 168
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459854.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.518444 -1.280993 -0.599644 0.308252 -1.070952 -0.740035 -0.722838 2.442702 0.699000 0.737517 0.451972 2.971897 2.552137
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.453370 5.549207 0.785934 -0.120282 -0.456730 -0.284356 -0.488551 -0.987324 0.715156 0.735686 0.446573 3.841183 2.790316
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -0.259086 -0.272852 -0.873674 1.423018 -0.911734 0.405714 -0.373088 -0.915031 0.722439 0.743637 0.446009 1.926195 1.445440
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.604087 -1.386179 -0.243034 -0.901806 -0.895605 0.049504 0.276321 10.873425 0.720709 0.741032 0.442284 2.697843 2.544004
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 7.979903 7.411568 18.500729 18.895309 1.751165 2.242621 0.174937 -2.196586 0.718448 0.729992 0.435482 2.778265 2.525077
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 0.394268 -1.764844 0.118260 -0.774595 0.923697 -0.127007 -0.024534 1.014873 0.715739 0.739789 0.444852 1.417040 1.284246
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 1.332556 -1.834806 -0.419200 1.427545 1.817472 1.090790 0.992124 1.226959 0.708009 0.726910 0.447159 1.430003 1.313335
15 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 0.081308 0.413957 1.756344 1.183171 -0.007142 -0.990416 -0.042588 0.601451 0.718448 0.743874 0.443973 1.927805 1.525813
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -1.584033 1.751094 0.253747 -0.334832 0.366840 0.998526 0.866720 2.842071 0.725966 0.738412 0.441477 1.766856 1.461146
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -0.876015 0.951690 -0.780012 -0.789975 -0.630969 -0.062532 1.635849 0.521182 0.722001 0.745917 0.435791 1.585966 1.420802
18 N01 RF_maintenance 100.00% 0.00% 25.07% 0.00% 100.00% 0.00% 18.321301 25.308311 -0.074951 0.408461 1.571384 6.575292 19.776085 37.337049 0.697997 0.521342 0.475934 2.288947 1.535270
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.392027 -1.878749 -0.352344 0.544829 -0.288937 1.311666 10.400724 14.266456 0.721198 0.751394 0.440815 2.263468 2.173912
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -2.007433 5.799391 0.524689 -0.454259 1.134607 0.231636 1.435499 0.039840 0.728909 0.731696 0.441590 3.566591 2.743997
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.925885 5.674389 4.509758 17.162343 -0.279838 1.578496 1.890080 -0.560026 0.723086 0.740320 0.446240 3.466245 2.831119
22 N06 not_connected 100.00% 14.32% 0.00% 0.00% 100.00% 0.00% 47.662679 15.965677 2.859225 8.315588 6.344076 6.761042 5.592661 2.479716 0.502346 0.674978 0.381411 2.206818 2.608990
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.767442 15.233307 18.597212 19.076985 3.908590 4.230887 3.853944 3.059565 0.033390 0.038820 0.002784 1.152920 1.154569
28 N01 RF_maintenance 100.00% 43.87% 97.58% 0.00% 100.00% 0.00% 22.689869 42.704691 0.426604 2.433164 4.798544 6.710193 10.657720 29.272242 0.409977 0.193943 0.263034 3.949582 1.547512
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -1.664704 -1.252135 -0.923661 -0.508181 -0.809018 -0.870222 0.017210 1.085223 0.725739 0.743826 0.430647 1.709066 1.461941
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.205114 -1.842815 0.117423 -0.145891 -0.366893 0.326326 6.428296 0.395992 0.722185 0.748254 0.429312 2.527649 2.357077
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.727364 1.302818 8.974874 11.741486 -0.109760 3.431213 0.199500 1.611568 0.747530 0.763249 0.441666 2.588061 2.352843
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.632142 4.595312 17.235495 18.774919 5.877970 5.464044 0.173323 1.623325 0.634614 0.679451 0.316818 2.503126 2.199232
33 N02 RF_maintenance 100.00% 0.00% 10.74% 0.00% 100.00% 0.00% -0.150125 28.864036 -0.818753 0.120263 -0.392929 3.580347 2.408289 28.095039 0.719625 0.571291 0.501215 2.959154 1.673400
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 18.230710 3.150288 5.606733 6.605160 3.839472 3.606942 2.815106 0.432287 0.044192 0.720637 0.601475 1.231065 3.017055
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.226375 0.100135 0.983933 5.855953 0.455754 0.533359 5.025464 0.305822 0.644237 0.714381 0.458667 2.280927 2.360096
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 14.565054 10.662426 -0.016337 -0.404137 0.313249 -0.243482 0.157122 0.414295 0.721051 0.741439 0.443434 3.348374 2.622967
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.420052 0.599079 -0.452957 0.204937 -0.860198 -0.103930 0.833057 15.674606 0.727941 0.752425 0.448519 2.893354 2.431022
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.028800 0.582168 -0.171754 0.383852 0.509139 0.593477 7.508636 2.857346 0.732998 0.754486 0.447027 2.623759 2.338838
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 0.379568 -0.610486 -0.404891 -0.117029 0.101125 -0.750553 -0.149106 -0.371803 0.721708 0.742117 0.436687 1.775100 1.511832
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 0.008574 0.304430 2.017589 -0.842792 1.249860 -1.032898 -0.266309 -0.588033 0.732834 0.746814 0.429232 1.921194 1.490801
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.278374 4.557133 0.379240 -0.673260 -0.469197 -0.645812 0.362328 -0.431567 0.742284 0.745294 0.442374 3.555287 2.682393
43 N05 digital_maintenance 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 14.540315 6.997844 18.345058 0.324670 3.841574 0.599450 3.227382 4.516424 0.044990 0.749352 0.557961 1.157439 2.677109
44 N05 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 26.575135 3.821514 0.532629 -0.608468 8.865331 -0.271489 12.534808 2.181617 0.673202 0.744151 0.418807 2.554971 2.484062
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.742849 0.936724 -0.266831 -0.408865 1.058746 1.511798 1.720607 24.815364 0.729491 0.741100 0.426794 2.848527 2.456365
46 N05 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -1.365057 15.943695 0.148350 19.201966 -0.181286 4.290313 0.574660 4.508095 0.727321 0.039878 0.564704 3.186843 1.191723
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 17.610956 3.204670 5.173891 6.168478 3.763670 8.607128 1.502917 3.612005 0.037693 0.718150 0.590704 1.225991 2.856706
48 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.091192 2.905401 12.795624 13.774311 -0.109505 0.860952 -1.663388 -2.396952 0.707496 0.738900 0.449536 2.958963 2.546763
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.707992 2.470721 7.835664 13.726334 -0.411255 0.239009 -0.191939 -1.204149 0.680605 0.724225 0.447037 2.478527 2.280867
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.354308 38.778381 0.135488 1.022968 2.080212 5.654041 0.676598 7.868314 0.715641 0.667295 0.414674 3.580689 3.185116
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 39.558373 3.070744 25.112140 0.548252 4.113744 1.745831 12.194425 2.004085 0.042879 0.748926 0.552423 1.112758 2.379268
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.377160 10.667369 2.334572 1.927919 5.343279 -0.916908 2.242721 0.184628 0.731065 0.754550 0.434386 2.635590 2.381670
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.497838 3.551767 0.780707 0.839384 -0.656933 -0.266614 2.700991 6.754090 0.733970 0.758196 0.442241 2.567918 2.243885
54 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 15.741366 14.895895 18.593168 -0.247116 4.028285 0.236179 5.608081 4.114927 0.050994 0.726242 0.575199 1.143503 2.355308
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 357.718166 364.029862 inf inf 3978.195818 3565.863205 8736.918946 7773.116159 nan nan nan 0.000000 0.000000
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -0.162698 1.217996 -0.251821 0.914267 0.007568 1.313409 0.206741 0.786612 0.736395 0.757931 0.419472 1.959710 1.466581
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 51.256143 0.239176 6.836899 -0.224547 6.859598 -0.508877 17.369447 0.558575 0.569978 0.757383 0.426009 2.943390 2.453083
58 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.046196 15.902427 18.458065 19.489701 3.776567 4.251412 4.235618 3.761810 0.037542 0.034159 0.001569 1.148179 1.144144
59 N05 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 43.721341 4.703118 1.820185 0.095387 0.915799 0.913826 1.051646 1.714877 0.648049 0.745010 0.426298 2.443960 2.630338
60 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 16.537272 15.473482 18.546580 19.461940 3.869312 4.317459 4.308719 5.437847 0.026961 0.027044 0.000817 1.138912 1.136617
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.651783 5.987536 3.017570 2.698383 4.041630 0.423704 -0.212315 3.097679 0.676915 0.696061 0.423545 2.808245 2.469144
62 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.319463 4.255018 10.911993 13.673867 -0.172363 0.953329 -1.025255 -2.130159 0.714557 0.743272 0.440962 3.298856 2.880933
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 4.548296 15.960371 10.621140 5.964194 0.472967 4.242848 0.246977 3.773440 0.675730 0.047917 0.597056 2.588809 1.182377
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.440717 1.524322 7.680768 11.577793 -0.412267 -0.043206 1.605110 -0.767931 0.664999 0.709576 0.455522 2.696333 2.490494
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 0.373717 -0.177030 0.589289 -0.653318 1.966202 0.407740 -0.319995 -0.017210 0.715331 0.743767 0.451988 1.525630 1.387867
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 0.229829 1.756626 0.253109 -0.388482 1.260359 -0.065324 -0.291711 1.339571 0.722823 0.747958 0.443031 1.656487 1.419558
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -0.906299 -0.858726 0.595891 -0.263698 0.161432 -0.289401 0.668653 3.272280 0.724882 0.752619 0.433747 1.423116 1.341427
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 2.984795 41.478495 0.712577 27.296471 0.274638 4.371337 0.916644 13.369009 0.721710 0.032236 0.489599 2.450596 1.116142
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 0.039893 -1.152796 -0.300090 0.107096 1.212293 1.114060 -0.155712 3.262557 0.729023 0.753699 0.430664 1.432885 1.330359
70 N04 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 304.534984 304.296512 inf inf 3590.901323 3618.109906 10956.463296 11059.849522 nan nan nan 0.000000 0.000000
71 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 360.700941 360.936098 inf inf 3780.149264 3646.388598 10121.228596 9680.451492 nan nan nan 0.000000 0.000000
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.216047 0.282806 -0.562569 0.270186 0.591667 0.197961 3.815808 -0.254326 0.728004 0.755127 0.412717 3.387023 2.758928
73 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.619708 15.030595 18.251178 18.843178 3.962978 4.268928 4.644766 2.592386 0.026716 0.026882 0.000463 1.143574 1.140450
74 N05 digital_maintenance 100.00% 100.00% 63.56% 0.00% 100.00% 0.00% 16.142045 12.710192 19.097812 18.644691 3.814791 3.763923 5.703590 22.165430 0.031973 0.396634 0.268812 1.161312 1.317379
75 N05 digital_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 9.922374 16.353781 6.826775 19.642591 2.174714 4.247551 12.453086 4.676018 0.690692 0.048651 0.529016 2.506775 1.167549
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 35.885481 38.274851 11.523629 9.544801 1.658963 1.922376 3.645412 -0.608629 0.595604 0.593691 0.239796 2.743506 2.279974
78 N06 not_connected 100.00% 11.64% 0.00% 0.00% 100.00% 0.00% 52.528935 0.132364 9.207117 10.440514 1.445285 0.028097 -0.584081 0.136106 0.528268 0.722143 0.436205 2.569241 2.325108
81 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -1.577568 0.845767 0.084951 0.820503 -0.694318 1.494009 0.303502 0.207043 0.682373 0.711562 0.433238 1.589343 1.494375
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.416145 1.119429 2.367738 -0.446160 0.586423 -0.664092 1.492625 -0.146962 0.713138 0.734842 0.441423 3.224100 2.586430
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -0.214619 -0.241551 2.939787 0.486277 -0.751163 -0.602595 -0.814418 -0.541099 0.724315 0.744474 0.432857 1.430388 1.392450
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 11.487937 36.725546 -0.367820 26.211749 -0.670841 4.222431 0.952958 8.191281 0.724388 0.044534 0.608517 2.583658 1.128660
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 0.523790 -0.133896 -0.782290 -0.695664 0.007142 -0.448586 -0.975969 -1.032328 0.723709 0.744245 0.439052 1.410958 1.374820
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.726774 12.146948 -0.860733 -0.232202 7.082262 0.121878 4.013424 22.029234 0.719653 0.710289 0.426740 2.580177 2.233231
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 39.647699 12.474067 2.296354 0.088497 6.071965 1.022389 13.359892 2.256098 0.632126 0.765469 0.422166 3.089945 2.614666
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 0.883715 0.378608 1.144146 -0.743700 -0.493113 2.487522 0.680943 -0.055011 0.730310 0.749649 0.416247 1.622963 1.361636
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.004598 0.011489 2.168421 0.174373 0.066138 -0.631073 -1.005391 -1.048633 0.740253 0.747191 0.421846 3.122129 2.628770
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.133630 0.831840 -0.776632 0.441712 -1.055216 -0.572650 0.126189 0.794084 0.732739 0.740876 0.420237 2.752064 2.456938
91 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.099253 1.085629 8.963644 9.439974 -0.249221 -0.143672 1.555220 1.147536 0.746871 0.767356 0.432812 3.007221 2.777978
92 N10 RF_maintenance 100.00% 79.68% 91.32% 0.00% 100.00% 0.00% 63.843534 77.111699 3.395580 4.196304 4.433016 7.361624 2.006771 8.901558 0.338334 0.286102 0.139308 2.092864 1.671501
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.357021 0.288317 1.300499 -0.737980 2.425534 0.071041 9.579551 0.784636 0.722813 0.748070 0.434323 3.163804 2.856925
94 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.193211 -0.977563 -0.646744 -0.484966 1.442229 1.610791 2.422423 6.533055 0.722573 0.739782 0.439720 3.031626 2.486903
98 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.447157 8.515201 -0.820563 -0.386061 1.179081 0.866542 -0.468554 2.127459 0.677926 0.709807 0.433355 3.154058 2.874582
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 0.099793 -0.702026 1.344406 0.145172 -0.736700 2.763550 1.989202 -0.149688 0.680991 0.733189 0.446438 1.723220 1.406093
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -0.650754 -1.459376 -0.866208 0.801205 0.425704 -0.648308 -0.415920 -0.835580 0.705028 0.729547 0.431595 1.539411 1.380339
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 13.624184 12.401532 3.732701 0.854002 -0.424029 -0.245907 -0.476103 -0.896168 0.737403 0.755244 0.430398 2.989704 2.652164
102 N08 RF_maintenance 100.00% 58.19% 100.00% 0.00% 100.00% 0.00% 13.171173 17.305348 17.442961 19.529727 4.306040 4.257841 1.041090 5.922967 0.401253 0.041061 0.326214 1.456778 1.216363
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 37.078951 37.013753 21.729964 22.516046 3.603908 4.149107 11.411341 11.251384 0.027660 0.028226 0.001372 1.140873 1.140138
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 13.503929 92.046093 3.802900 17.318770 1.512749 2.147943 0.158001 0.558793 0.744704 0.697434 0.465976 3.236539 2.375836
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -0.012395 -0.008574 0.794338 1.030826 -0.708756 -0.169709 0.136056 -0.694502 0.725653 0.756737 0.423353 1.628921 1.331553
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.319953 1.107608 0.028655 -0.216675 3.608221 0.645629 1.600599 -0.619523 0.723562 0.750326 0.419420 2.925271 2.636796
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.610815 -0.235383 -0.331781 -0.472314 -0.348308 -0.720985 0.708936 2.239713 0.717146 0.745535 0.416024 2.642438 2.543200
108 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.941663 5.088744 12.846304 -0.646450 9.116062 0.621557 1.432557 0.984761 0.623344 0.751185 0.480975 2.053458 2.641442
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -0.484334 15.803877 -0.818680 18.819167 -0.473916 4.291988 0.910914 4.084618 0.735065 0.037808 0.514340 3.181031 1.203674
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 43.734243 15.548927 1.403857 -0.224798 1.053406 9.372034 2.457660 41.662748 0.642456 0.729391 0.369290 3.176857 2.569850
111 N10 digital_ok 100.00% 0.00% 79.68% 0.00% 100.00% 0.00% 0.122393 14.394432 0.153927 18.557513 -0.729000 3.850361 -0.323756 5.245710 0.728495 0.296738 0.519093 3.570491 1.331365
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -0.762464 -0.491468 -0.619453 -0.480962 -0.326540 1.155378 0.998038 -0.445743 0.713237 0.740598 0.448803 1.310252 1.232647
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -0.797611 0.698228 1.234094 1.812608 1.684236 -0.650998 0.858394 -0.765766 0.669501 0.720956 0.451487 1.761212 1.545665
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 17.389780 18.310327 18.591335 20.135866 3.737423 4.255295 3.288178 5.949490 0.027827 0.031810 0.003305 1.216973 1.211584
118 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.563821 0.578192 -0.307866 1.129006 0.626720 4.667780 0.689147 1.619165 0.709549 0.738753 0.436958 3.021471 2.513772
119 N07 RF_maintenance 100.00% 0.00% 4.48% 0.00% 100.00% 0.00% 2.332772 9.330917 4.499745 11.804601 -0.902980 13.031090 0.561092 2.565003 0.726498 0.597837 0.484721 2.689821 1.662151
120 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 2.859309 35.451200 8.658702 26.028057 0.910513 4.275222 1.383542 11.520721 0.700995 0.034022 0.582165 2.711672 1.145731
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.540434 8.119584 0.555497 1.043224 -0.524432 -0.653301 37.580343 12.852039 0.730540 0.753531 0.432599 2.961031 2.671751
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 13.744683 11.526655 -0.015027 0.503117 1.932921 -0.464159 -0.090598 -1.024186 0.737899 0.755861 0.429489 3.217548 2.746195
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.766460 15.241089 1.600543 -0.153254 -0.709216 -0.598037 -0.811745 -0.430253 0.748584 0.765721 0.427374 4.018913 3.170114
124 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.031321 1.791340 4.728353 6.873543 -0.165600 -0.380617 1.503638 1.610202 0.750449 0.733524 0.433457 4.430657 2.860593
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.851843 0.015744 -0.732566 1.154435 -0.128900 0.445965 0.647854 0.260227 0.722473 0.751462 0.420292 3.539563 3.014653
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 23.262971 0.569741 1.271254 -0.525683 14.816476 0.464998 7.069181 -0.086879 0.655318 0.749552 0.429977 3.010273 2.766649
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -0.770481 0.194720 0.601942 -0.828951 0.771695 0.119763 -0.193254 0.680328 0.731905 0.756848 0.436118 1.409982 1.282236
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.856417 7.469398 0.391396 0.825643 -0.349936 1.408706 -0.119173 -0.622097 0.729020 0.744805 0.431618 2.884016 2.680916
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 1.079303 -1.822320 0.154491 0.366541 -0.110092 -0.729556 -1.015665 -1.081709 0.724208 0.750355 0.442642 1.389558 1.248757
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 3.327817 0.230981 -0.718499 -0.608594 -0.185277 0.108860 1.343627 3.513126 0.705270 0.738977 0.439750 1.396676 1.244235
135 N12 digital_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -1.798691 16.028496 4.667527 19.536440 -0.079576 4.273239 1.537733 2.750546 0.660675 0.039124 0.482596 3.063836 1.182636
136 N12 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.812657 1.817414 1.268206 0.655579 -0.539172 1.359375 0.380698 0.792855 0.672303 0.717573 0.432652 3.262458 2.581743
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.351084 -1.359549 0.368834 -0.601592 0.996138 2.252016 -0.296428 0.137429 0.695580 0.724528 0.437160 3.133910 2.478204
138 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.170586 0.062828 1.248176 1.000537 -1.161701 -0.354817 2.713617 -0.705234 0.712453 0.742058 0.445673 3.365830 2.738469
140 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.687981 16.700589 18.139637 19.302509 4.008707 4.326448 3.636263 5.019011 0.037224 0.037895 0.002001 1.132882 1.130873
141 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.508297 5.300506 -0.599181 5.124733 1.770747 3.150846 2.195717 25.660869 0.711991 0.712571 0.409286 3.458832 2.864514
142 N13 digital_ok 100.00% 76.10% 100.00% 0.00% 100.00% 0.00% 57.250227 15.556519 1.738250 19.407134 5.198167 4.190911 2.654887 2.631541 0.358040 0.037243 0.219851 3.084928 1.262603
143 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 2.233061 -1.684435 -0.538540 -0.751158 0.050187 0.310725 -0.575107 -1.099170 0.728284 0.756895 0.421036 1.758639 1.337027
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.946970 0.015794 -0.900598 3.754481 -0.168853 -0.372593 0.287643 23.391879 0.733164 0.762070 0.424228 4.818325 4.357762
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 16.527247 16.539790 18.729190 19.518094 3.820704 4.254613 3.666695 5.547847 0.035704 0.027591 0.004986 1.311821 1.310610
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 12.361240 -0.445007 1.254406 -0.177365 5.765577 -0.795371 35.793672 0.337905 0.709052 0.751178 0.430808 2.918141 2.528610
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.204586 1.248273 -0.757934 -0.324292 1.692955 0.159003 1.934643 0.060248 0.730076 0.753714 0.439883 3.061292 2.767086
149 N15 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.623949 16.793431 0.599755 19.430929 -0.327764 4.306763 2.444312 4.655079 0.716384 0.034956 0.541315 4.221095 1.218147
150 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 16.886219 15.892363 18.573882 19.379194 3.860459 4.284877 4.111537 4.307065 0.026084 0.028969 0.001203 1.210996 1.211433
151 N16 not_connected 100.00% 8.06% 0.00% 0.00% 100.00% 0.00% 45.542163 0.819379 8.910557 2.437037 1.638493 0.778870 0.380847 -0.424219 0.544055 0.693084 0.445313 2.279651 2.269622
152 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.356670 1.198991 6.162406 7.823851 -0.059544 -0.224518 13.268097 -0.243337 0.667777 0.715784 0.471604 2.412161 2.435934
153 N16 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 16.351673 0.853728 5.023875 6.089389 3.706482 6.900374 1.511581 -0.772071 0.041855 0.701425 0.599138 1.194799 2.311566
154 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.217194 -0.502452 11.570197 10.653920 -0.124197 -0.776901 -1.395561 -1.207548 0.666892 0.708209 0.473116 2.449061 2.485727
155 N12 digital_maintenance 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 15.734965 -0.433336 17.849611 0.357323 3.977707 1.440546 2.612000 5.591570 0.065441 0.724678 0.551916 1.265286 2.911036
156 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 14.748117 0.171812 18.414683 1.319634 3.970115 -0.092923 2.905263 2.242734 0.111699 0.731084 0.542587 1.419441 3.562175
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -0.182809 -1.181835 -0.016652 2.015259 -0.872869 -0.472194 -0.576413 -0.247147 0.704716 0.726833 0.438463 1.553382 1.379946
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.772656 -1.703584 16.939893 1.596936 0.787931 0.277125 1.081847 34.023175 0.718064 0.734732 0.450049 3.292246 2.914002
160 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 17.287933 17.329750 18.442662 19.222860 3.989877 4.387990 4.651081 6.278763 0.039225 0.040932 0.002895 1.193409 1.194014
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.896400 40.536170 -0.795362 1.911161 -0.346930 1.134115 2.652223 2.168795 0.710943 0.628219 0.387661 2.764692 2.816699
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 1.918500 0.504157 -0.733429 -0.035955 1.439599 1.079149 0.881260 0.568895 0.731130 0.755381 0.428572 1.578870 1.422741
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 0.215511 -1.054327 -0.857043 0.016652 -1.207178 -0.470932 -0.225603 1.737396 0.734315 0.751201 0.430919 1.511928 1.393813
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.931064 -1.027139 -0.847046 0.467648 -1.007763 1.014166 0.097277 5.960865 0.729227 0.748581 0.431659 3.401150 2.832879
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.664130 0.526618 3.786612 -0.793858 1.385490 -0.713829 1.617071 0.423778 0.738121 0.749698 0.439423 3.333957 2.978251
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 26.847950 43.522089 0.461727 1.200457 5.850299 2.657130 15.795689 3.618381 0.667600 0.659771 0.343671 3.098738 2.696869
167 N15 digital_ok 100.00% 4.48% 0.00% 0.00% 100.00% 0.00% 82.827874 65.980814 4.550570 2.345345 3.061860 3.604132 3.935959 8.321322 0.541447 0.593859 0.244731 2.835422 2.444124
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.190193 2.633178 0.063140 -0.308801 0.684890 0.218690 -0.246799 -0.369131 0.723627 0.745587 0.443445 3.233372 2.645800
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.397003 7.000256 -0.180789 -0.385423 -1.023512 -0.650092 -0.532658 0.775896 0.722302 0.728590 0.450130 3.145723 2.395290
170 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.576347 1.425031 0.433705 -0.249217 -0.284695 -0.572612 7.577436 3.001385 0.705148 0.734829 0.458875 3.104979 2.633435
171 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.361715 5.907096 5.728786 -0.565681 -0.663239 1.700806 -0.627484 -0.637082 0.676970 0.636045 0.460615 2.799796 2.118599
173 N16 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 19.211766 17.125114 4.239003 5.124291 3.956433 4.243120 4.412265 10.967887 0.036229 0.041644 0.005722 1.242503 1.243754
176 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.612961 -0.447383 0.847797 1.287229 -0.526010 -0.404802 0.332160 8.793452 0.679311 0.713023 0.454699 3.657472 3.215022
177 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -1.774212 -1.092657 0.172533 1.362141 0.118081 0.830187 -0.174981 2.709051 0.694407 0.722429 0.453459 1.658344 1.390653
178 N12 digital_ok 100.00% 5.37% 0.00% 0.00% 100.00% 0.00% 8.493327 -1.488636 13.569271 4.165485 1.627613 0.996411 2.351167 3.055159 0.566867 0.717040 0.479746 2.116434 2.667558
179 N12 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 17.215061 17.498135 18.861967 20.453264 3.677991 4.257858 2.789576 3.549918 0.036929 0.092729 0.041192 1.204005 1.212359
180 N13 RF_maintenance 100.00% 0.00% 72.52% 0.00% 100.00% 0.00% 1.060858 14.142112 -0.343330 18.794172 -0.139505 3.756812 2.877606 6.205619 0.725170 0.354037 0.520035 12.041243 2.064572
181 N13 digital_ok 100.00% 100.00% 94.90% 0.00% 100.00% 0.00% 16.808875 64.617053 18.858252 5.802556 3.952652 6.554047 4.804446 11.211004 0.045223 0.215837 0.114764 1.200963 1.583945
182 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.842223 15.496916 15.732925 18.779971 0.808386 4.338018 -0.807063 5.160636 0.739197 0.055913 0.565816 3.498587 1.343061
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -2.465584 -0.635808 0.319289 -0.870724 -0.833439 -0.299512 -0.094941 5.397998 0.729260 0.746229 0.432877 3.187202 2.710274
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -0.401705 0.605440 -0.840308 0.064577 -0.373286 -0.805565 0.622960 -0.399620 0.725942 0.736370 0.434919 1.494760 1.403959
185 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 0.598241 -1.319202 -0.633500 0.055106 -0.822897 -1.093094 -0.421817 -1.234775 0.731142 0.744983 0.438384 1.432100 1.319102
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% 0.314107 -0.457172 -0.333060 -0.774684 1.121920 0.123282 2.611990 -0.781565 0.725845 0.749580 0.443788 1.348516 1.293471
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 8.93% 0.00% -0.234736 -0.199531 0.470195 -0.868221 -0.835523 -0.486252 1.736963 1.809487 0.717176 0.745277 0.442791 1.519923 1.287436
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.219433 6.638525 17.259741 16.060135 1.135022 1.657026 -1.974062 0.552827 0.721042 0.746451 0.451454 3.578139 3.114049
190 N15 digital_ok 100.00% 12.53% 100.00% 0.00% 100.00% 0.00% 37.310019 16.358919 16.599217 19.566420 5.743502 4.269107 8.015039 4.567138 0.529005 0.049721 0.388787 2.299576 1.149952
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.488164 1.832802 16.917270 14.882269 1.399725 0.350920 -0.935263 2.832898 0.711076 0.746062 0.473016 3.291957 2.885391
192 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.694735 12.938395 17.407585 21.996371 1.353901 3.443689 -1.538797 -4.593641 0.690261 0.703949 0.464100 2.874754 2.518571
193 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.236197 0.533822 21.864580 13.141439 2.911457 0.842249 -4.548063 -1.046801 0.659635 0.719607 0.488379 2.637525 2.722886
200 N18 RF_maintenance 100.00% 100.00% 94.00% 0.00% 100.00% 0.00% 18.256309 55.377525 5.169951 11.727445 4.013889 5.598671 4.390431 0.949686 0.049850 0.236608 0.167328 1.204393 1.508662
201 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.733268 11.112986 21.974655 20.938376 3.093053 3.070272 -3.258165 -2.869146 0.690740 0.720369 0.439495 2.855186 2.453659
202 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.978161 5.834352 12.080987 -0.349467 -0.258225 1.104773 0.232669 3.467755 0.717990 0.667090 0.455178 3.253567 2.104910
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 19.168767 18.745671 4.601747 5.361514 3.932502 4.354346 5.967264 6.309187 0.034309 0.045834 0.004364 1.220605 1.223860
219 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 10.983504 8.656135 22.305545 18.769652 3.354589 2.815017 -3.691416 -2.422808 0.660608 0.732900 0.468119 2.311460 2.471425
220 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.000363 0.199741 8.837180 10.218110 0.106482 0.256666 3.286145 0.396949 0.702261 0.729083 0.440764 2.707646 2.327216
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.958928 0.875497 4.229175 9.739524 0.429351 -0.043068 2.303486 -0.251515 0.677712 0.732137 0.458566 2.748489 2.469566
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.864354 1.721775 10.565700 10.655063 -0.269068 0.070353 5.779774 -0.639719 0.711281 0.736021 0.450643 3.602761 2.719034
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.026828 2.507566 3.658221 8.046999 -0.117979 0.097675 1.306276 0.278340 0.665493 0.717099 0.462254 2.885786 2.645296
238 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.386123 -0.578671 13.326959 12.879301 -0.110148 1.213622 -0.942477 -1.258778 0.710869 0.732731 0.457582 3.152133 2.644854
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.016114 3.925583 10.205227 1.266668 0.861558 0.638395 8.052025 18.208190 0.702654 0.667093 0.467775 3.237263 2.215658
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -0.137964 17.684428 2.470513 10.938471 -0.584291 4.223881 3.757967 4.349277 0.706280 0.051317 0.538285 0.000000 0.000000
321 N02 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.093323 1.460216 9.622737 10.112955 0.554229 0.590600 4.700606 3.947649 0.624084 0.661968 0.461533 0.000000 0.000000
322 N05 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.779312 4.069907 10.881525 15.688910 0.459971 1.216369 0.426964 -1.220422 0.612393 0.652157 0.457014 0.000000 0.000000
323 N02 not_connected 100.00% 68.04% 0.00% 0.00% 100.00% 0.00% 38.888205 2.917860 1.272886 14.431092 2.250914 1.075658 2.501043 0.308560 0.373975 0.640739 0.444634 0.000000 0.000000
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.949667 4.166212 12.949048 14.362813 1.144617 0.701434 -1.222637 -2.172926 0.605959 0.641574 0.445749 0.000000 0.000000
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.417539 -0.960023 13.226727 7.571756 0.663740 0.376647 -0.260996 1.553769 0.647200 0.669532 0.464055 0.000000 0.000000
329 N12 dish_maintenance 100.00% 8.95% 0.00% 0.00% 100.00% 0.00% 7.216744 -1.954676 -0.409341 8.598372 1.557411 1.319145 2.670471 0.672711 0.514723 0.646900 0.462223 0.000000 0.000000
333 N12 dish_maintenance 100.00% 10.74% 0.00% 0.00% 100.00% 0.00% 7.536678 1.291746 -0.090174 7.274552 1.541608 0.755819 4.491229 1.794164 0.522788 0.637885 0.454694 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_2459854.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 [ ]: