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 = "2459852"
data_path = "/mnt/sn1/2459852"
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-29-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/2459852/zen.2459852.25278.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 1850 ant_metrics files matching glob /mnt/sn1/2459852/zen.2459852.?????.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 185 ant_metrics files matching glob /mnt/sn1/2459852/zen.2459852.?????.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 2459852
Date 9-29-2022
LST Range 20.059 -- 8.021 hours
X-Engine Status ✅ ✅ ❌ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
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 61 / 180 (33.9%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 114 / 180 (63.3%)
Redcal Done? ✅
Redcal Flagged Antennas 46 / 180 (25.6%)
Never Flagged Antennas 20 / 180 (11.1%)
A Priori Good Antennas Flagged 86 / 97 total a priori good antennas:
3, 5, 7, 9, 10, 15, 16, 17, 21, 29, 30, 31,
37, 38, 40, 41, 42, 46, 51, 53, 54, 55, 56,
65, 66, 68, 69, 71, 72, 73, 81, 83, 84, 85,
86, 88, 91, 98, 99, 100, 101, 103, 105, 106,
107, 108, 109, 111, 116, 117, 118, 121, 122,
123, 124, 127, 128, 129, 140, 141, 142, 143,
144, 156, 157, 158, 160, 161, 162, 163, 164,
165, 167, 169, 170, 176, 177, 178, 179, 181,
184, 186, 187, 189, 190, 191
A Priori Bad Antennas Not Flagged 9 / 83 total a priori bad antennas:
4, 82, 89, 90, 125, 136, 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_2459852.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 0.00% 0.00% 0.00% 0.00% 8.65% 7.03% 1.330922 -1.688056 -0.624984 -0.088587 -0.421556 0.749507 1.567465 2.216688 0.818493 0.828219 0.252837 3.193383 2.764815
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.768204 0.969152 0.632304 -0.576561 2.085471 1.269913 2.684333 2.123997 0.828449 0.827465 0.252848 4.577502 4.644673
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 10.27% -0.357252 -0.047928 -0.702336 1.679877 -0.174478 1.102238 1.350126 1.397887 0.830851 0.830039 0.250388 3.428473 2.972724
7 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 7.57% -0.458441 -1.288225 -0.226543 -0.906065 0.221433 0.475255 1.949705 2.017203 0.823297 0.827049 0.250814 2.782838 2.879193
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.008037 6.676340 23.926988 23.529426 11.243421 14.655352 14.836444 14.787845 0.799980 0.783126 0.295467 6.019140 5.141053
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 5.95% 0.172978 -0.931676 -0.763864 -0.260226 1.695697 0.437610 1.564463 1.802142 0.819575 0.824684 0.256079 2.813759 2.653279
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.679551 -0.413727 -0.529298 2.088841 0.444226 9.337319 2.430296 7.318459 0.810440 0.817238 0.260356 4.687730 5.195400
15 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 3.78% 1.000508 1.235929 -0.230078 -0.713249 -0.509226 -0.494582 -0.054941 -0.293101 0.834005 0.834253 0.245623 3.304994 3.053702
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 4.86% -1.215155 -0.270533 0.681199 0.289843 -0.685832 0.261936 0.677303 0.725340 0.836361 0.833625 0.243811 2.888955 2.689536
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 2.16% 0.311579 1.281594 -0.860362 -0.832669 -0.278660 -0.644004 -0.095928 -0.182103 0.833823 0.835417 0.241538 3.030111 2.926381
18 N01 RF_maintenance 100.00% 0.00% 0.54% 0.00% 100.00% 0.00% 9.831353 27.761009 0.351709 1.040571 6.676137 13.569214 3.294425 6.368744 0.827167 0.691694 0.327085 3.665553 2.019447
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.00% -0.708048 -0.942306 -0.462908 0.635473 -1.010565 1.076896 0.159989 0.367945 0.830692 0.835810 0.247238 2.587308 2.546401
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.00% -0.257379 1.044368 0.440236 0.121042 -0.103059 -0.196095 1.650879 0.833385 0.834201 0.825667 0.247590 2.668535 2.485835
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.095548 5.232556 5.903841 21.398583 2.033361 12.805782 3.858249 13.823950 0.825272 0.795159 0.302216 4.683381 5.319745
22 N06 not_connected 100.00% 0.54% 0.00% 0.00% 100.00% 0.00% 24.551891 16.327851 4.176345 12.018639 7.800569 6.698770 7.269220 9.999952 0.696851 0.782241 0.223476 5.680809 5.890797
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.021063 15.740823 26.019528 27.634721 15.599037 19.820341 16.795790 16.529423 0.031133 0.034315 0.002091 1.137551 1.136841
28 N01 RF_maintenance 100.00% 7.57% 67.03% 0.00% 100.00% 0.00% 26.193161 42.820996 1.102180 1.675181 9.367529 22.305562 9.181491 13.287481 0.593579 0.334175 0.302139 6.391595 1.809705
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 1.08% -0.907040 -0.915425 -0.599014 -0.300694 -1.634466 -1.106308 -1.248370 -0.484712 0.841157 0.839869 0.234187 2.857123 2.780193
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.54% -0.354273 -0.865691 0.508355 -0.338423 -0.416452 -1.196075 0.329028 -0.529674 0.835249 0.841817 0.233712 2.623216 2.568499
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.023714 2.508793 12.497740 16.313292 3.668704 4.474453 9.005893 12.337871 0.843067 0.833097 0.263405 5.099133 4.664132
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 7.967523 11.952485 22.429981 22.314322 14.828275 16.673028 15.649270 14.435019 0.772194 0.758599 0.198934 5.286055 4.455068
33 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.108163 43.220761 -0.687409 1.198525 -0.429776 14.079413 0.494040 5.671897 0.831473 0.720829 0.333009 5.019050 2.500611
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 13.817689 4.602917 9.199763 10.414589 15.603567 3.644895 16.692812 8.429692 0.041605 0.809306 0.665891 1.214775 5.442199
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.025331 1.470292 3.190974 8.691133 1.828017 5.352549 2.880341 5.710893 0.774338 0.808604 0.275953 4.830338 5.483250
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.201833 8.645750 -0.396085 -0.092569 0.155983 0.484518 -0.116255 0.322017 0.830090 0.833529 0.247913 4.767948 4.771387
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 1.62% 1.957973 2.068366 -0.526445 0.504581 -1.382469 -0.172250 -0.614946 0.990810 0.837438 0.841363 0.243717 3.031599 3.225787
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 2.70% 1.218058 0.604873 -0.876007 -0.119197 1.325888 0.417543 -0.736747 -0.243327 0.842531 0.844942 0.238537 2.689773 2.778010
40 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.192072 -1.079827 -0.503190 -0.302531 1.104672 8.388029 -0.713109 -0.145798 0.841356 0.842878 0.236382 4.173082 3.934805
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 40.00% 0.939945 -0.018123 2.605386 -0.759587 1.968397 -1.105531 1.432067 -0.637895 0.846985 0.844706 0.230945 3.968106 3.994114
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 1.08% -1.145031 0.519121 0.751773 -0.914073 -0.559752 -0.971190 -0.405213 -1.047078 0.850538 0.844359 0.234119 3.339932 3.088514
43 N05 digital_maintenance 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 12.846803 2.226267 25.617335 -0.110991 15.619158 0.168742 16.748950 -0.510269 0.047211 0.846993 0.536786 1.163610 4.316732
44 N05 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.928887 1.453166 -0.408174 -0.780586 4.908420 1.251400 2.117985 0.485887 0.833965 0.844691 0.228798 4.835719 4.516603
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.00% 0.312477 -0.310792 -0.864688 0.475681 0.635865 0.973892 -1.122943 1.703720 0.841801 0.839766 0.231398 2.743425 2.751240
46 N05 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -1.219745 15.761808 1.448143 27.747721 1.353071 20.008869 0.969797 16.551594 0.838101 0.040217 0.554480 5.034280 1.203312
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 14.258945 4.158662 8.621421 9.431998 15.638846 3.425084 16.688579 7.750272 0.034837 0.813845 0.661149 1.173626 4.943352
48 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.751524 4.600523 16.019201 17.930810 7.600349 7.748574 10.669393 12.286929 0.806776 0.811466 0.281028 5.061433 5.313942
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.070024 2.970319 9.807402 17.050556 4.825245 8.990476 6.522498 11.145603 0.793967 0.805178 0.277948 4.602421 4.824481
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.499096 20.658504 -0.785708 0.417504 2.534650 7.631979 0.419170 5.422864 0.825986 0.790221 0.223255 6.392248 7.983508
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 24.335003 5.314995 35.154569 2.247695 15.028492 2.857292 17.120810 3.137725 0.045118 0.840902 0.482979 1.148202 4.514513
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 7.635977 8.127596 0.723584 1.729026 3.263063 0.045207 -0.143855 1.314798 0.841072 0.844965 0.237018 4.087998 4.065087
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 17.30% 2.799043 2.404855 1.233357 1.558587 -0.514847 -0.344911 1.015839 1.612589 0.845971 0.850746 0.233010 3.044465 2.900667
54 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 13.231309 -0.217464 26.004177 -0.933908 15.672972 1.429151 16.735702 -0.925418 0.060000 0.843080 0.584743 1.294222 3.915523
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 0.503541 16.894284 0.086756 28.186270 7.496430 19.866846 0.043526 16.413323 0.846853 0.031893 0.557778 4.136400 1.134040
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 43.78% 0.583910 0.044958 0.614762 2.246198 0.048374 2.046547 -0.060429 1.693657 0.850723 0.854029 0.225984 5.114124 3.687642
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 13.538868 1.068060 10.654446 -0.724138 6.290180 0.359654 11.907650 -1.010783 0.738278 0.853858 0.228934 7.353240 4.130041
58 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 14.140699 16.799798 25.817632 28.228954 15.691258 20.076315 16.873923 16.542281 0.034477 0.031761 0.001631 1.144578 1.141759
59 N05 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 19.368184 3.246582 2.186928 0.127206 5.347286 0.468716 5.050586 0.591528 0.784179 0.846102 0.243223 5.201215 4.633717
60 N05 digital_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.526697 16.659967 25.954312 28.118259 15.613264 19.951122 16.783592 16.591370 0.027105 0.026785 0.000867 1.161849 1.154627
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.344621 5.062153 5.176110 2.571699 2.589578 4.452413 4.847119 2.846617 0.807893 0.804428 0.249155 4.300196 4.053990
62 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.731192 3.127974 13.761256 16.771258 5.836025 10.054203 9.655734 11.462341 0.814308 0.819350 0.268748 5.008961 4.838693
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 2.710473 16.361543 13.745266 10.544844 4.451790 19.892335 9.692541 16.498219 0.788602 0.044482 0.692129 3.866128 1.206833
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.805578 2.882369 9.754577 14.557554 4.229718 6.933955 6.811991 9.905146 0.782680 0.798350 0.282749 3.987499 4.114618
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 2.16% 2.804368 0.099511 -0.041217 -0.815922 2.232816 0.452264 0.572080 0.231909 0.823105 0.833667 0.253032 2.994308 3.169087
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.54% 1.425655 0.189018 1.297147 -0.635562 1.731441 -0.028741 1.068658 -0.849472 0.829285 0.840009 0.245489 2.911738 3.116370
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.00% -0.647135 0.612363 -0.379310 0.165268 0.080196 -0.675888 -1.060606 -0.455434 0.837332 0.846005 0.235957 2.752326 2.737841
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 0.280794 29.407291 0.544983 39.489012 0.062756 19.312562 0.010555 16.535128 0.837657 0.034785 0.465198 4.729099 1.131553
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 69.73% -0.878789 -1.611093 1.021096 0.338459 0.985204 0.865473 0.300045 -0.223748 0.845392 0.850992 0.229016 3.972794 4.004138
70 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.456627 -0.293421 0.865772 -0.843292 3.496131 1.178002 0.315218 -0.859387 0.857363 0.856992 0.220848 63.100137 53.514547
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 91.35% -0.293112 -0.975728 -0.004026 -0.926836 -0.231071 -0.734389 -0.646879 -0.878426 0.846957 0.855106 0.228971 56.236551 54.877217
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.687721 -1.282230 -0.569835 1.561132 0.275550 1.113965 0.112315 1.098416 0.848459 0.855313 0.218418 5.037918 4.496439
73 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 12.497565 15.328130 25.413281 27.269700 15.444994 19.798294 16.865067 16.448382 0.026780 0.026595 0.000416 1.138615 1.136615
74 N05 digital_maintenance 100.00% 100.00% 10.81% 0.00% 100.00% 0.00% 13.525888 11.401341 26.863803 26.509387 15.896262 14.877988 16.718374 12.272428 0.029351 0.629409 0.375710 1.149147 1.771651
75 N05 digital_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 3.955408 16.360006 9.180905 28.483119 5.540399 20.081930 9.652394 16.542264 0.821173 0.053430 0.534288 5.513551 1.178749
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 7.715114 11.382575 14.904098 11.205798 6.057982 9.532884 12.251533 10.478424 0.747854 0.737432 0.171869 7.983626 6.718125
78 N06 not_connected 100.00% 0.54% 0.00% 0.00% 100.00% 0.00% 21.127065 2.182967 10.547545 13.337223 8.089456 5.751043 8.489643 9.991319 0.688650 0.810124 0.261168 5.896164 3.872362
81 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 10.81% -1.054561 -0.675712 0.558130 1.015824 0.751049 0.671049 0.711351 1.449779 0.802542 0.817242 0.250447 3.473566 3.652128
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.270466 0.540731 3.261269 -0.238052 1.489008 -0.798905 1.954571 -0.671678 0.821095 0.829912 0.246310 3.938487 3.942913
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 1.62% 0.572050 0.533210 3.700927 0.780941 0.941216 0.219202 2.441535 0.510700 0.831246 0.838348 0.241021 2.816569 3.031596
84 N08 digital_ok 100.00% 29.19% 100.00% 0.00% 100.00% 0.00% 6.708118 21.962876 -0.351655 37.309660 -1.388262 19.284236 -1.024322 16.481224 0.619404 0.048819 0.504698 3.746401 1.140947
85 N08 digital_ok 0.00% 29.19% 29.19% 0.00% 29.19% 4.32% -0.664035 -0.182831 -0.801840 -0.470989 -1.716643 -0.438695 -1.317923 -0.793593 0.621536 0.612974 0.142232 2.312979 2.460690
86 N08 digital_ok 100.00% 29.19% 29.19% 0.00% 100.00% 0.00% 0.705855 0.940990 1.503639 0.793736 6.918881 1.000629 1.325837 1.262732 0.623691 0.600851 0.139484 4.036123 3.265200
87 N08 RF_maintenance 100.00% 29.19% 29.19% 0.00% 100.00% 0.00% 5.441636 10.462610 8.109301 -0.167723 11.663375 1.044517 8.040244 -0.543608 0.629576 0.620593 0.139579 3.788188 3.669092
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 14.59% -0.195365 0.711929 1.590264 -0.225997 -0.187586 1.622148 1.181235 -0.068435 0.848420 0.852712 0.219570 3.200798 2.998583
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.084589 0.424190 3.771635 0.338522 0.817938 -0.988367 2.767172 -0.373281 0.853282 0.850795 0.218214 5.905795 4.949331
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.085641 -0.951216 -0.676090 0.468998 -1.327856 -0.432363 -1.014781 -0.132812 0.849848 0.849439 0.216433 5.253192 4.929633
91 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.844129 0.533131 11.782360 12.094631 3.727206 3.850613 8.633963 9.513442 0.848501 0.849274 0.235495 5.638769 5.423671
92 N10 RF_maintenance 100.00% 22.16% 48.11% 0.00% 100.00% 0.00% 48.495496 45.531578 1.591816 1.799688 9.950936 15.995607 9.308606 10.392688 0.555456 0.494770 0.113225 4.040487 3.672252
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.00% 1.190657 1.976192 -0.228007 0.193004 1.473699 -0.350319 -0.205196 -0.348270 0.839024 0.844142 0.238861 3.008886 2.788400
94 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.00% -0.680963 -1.208406 0.473251 -0.951121 1.116798 1.432498 -0.001208 -0.440267 0.831736 0.837968 0.244432 2.690442 2.510824
98 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 8.11% -0.433671 0.279734 -0.363019 -0.672892 -0.306013 1.951584 -0.087140 0.318994 0.799988 0.812954 0.254381 3.435782 3.877200
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 3.78% 1.843942 1.143475 2.295762 1.756620 0.282749 2.999474 1.224373 1.749672 0.800904 0.826536 0.259176 3.015084 3.185515
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.54% 0.199067 -0.095328 0.208884 -0.315765 1.694293 -0.604584 -0.311591 -0.647378 0.818922 0.828337 0.247231 2.631909 2.683298
101 N08 digital_ok 100.00% 29.19% 29.19% 0.00% 100.00% 0.00% 7.362806 9.728278 5.945217 1.655777 1.270076 -0.275624 4.325378 0.837258 0.619019 0.610368 0.151215 3.683368 3.351302
102 N08 RF_maintenance 100.00% 29.19% 100.00% 0.00% 100.00% 0.00% 7.473371 17.612225 22.971149 28.323583 10.220983 20.032865 12.545442 16.655930 0.512927 0.037719 0.434094 1.793166 1.170019
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 20.992069 21.148251 30.987800 32.776831 16.096043 20.346564 17.186432 16.793870 0.026622 0.027677 0.001841 1.121619 1.117812
104 N08 RF_maintenance 100.00% 29.19% 29.19% 0.00% 100.00% 0.00% 8.692413 26.918077 6.543801 23.267666 1.738419 14.825847 5.077492 27.891069 0.626996 0.603243 0.142165 3.664911 3.801201
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 19.46% -0.003441 0.616130 1.521867 1.740468 -0.366245 0.028741 0.352534 1.413232 0.845162 0.851518 0.222352 3.755377 3.903885
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 1.62% 1.827600 1.034061 -0.684295 0.998969 2.800454 0.857216 -0.724541 0.938512 0.846908 0.851110 0.220058 2.640417 2.838679
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 5.41% 0.987731 -0.789862 1.941196 1.746003 0.477003 -0.478073 0.883948 0.970279 0.843142 0.849306 0.213374 2.975029 3.436103
108 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.857166 2.473961 8.657414 -0.743040 30.025347 -0.285812 9.054680 -0.056625 0.822443 0.852496 0.233502 4.997521 6.043971
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% -1.244722 16.204088 -0.145749 27.323651 -0.180435 19.806004 -0.658077 16.474151 0.847617 0.039569 0.495531 5.021556 1.181651
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 30.923847 13.675496 0.870483 1.966056 12.039313 11.764239 5.806499 7.928258 0.806002 0.816216 0.184714 8.193686 4.824846
111 N10 digital_ok 100.00% 0.00% 32.43% 0.00% 100.00% 0.00% -0.139876 12.271393 -0.564861 26.474660 0.101989 15.904759 -0.593956 10.687938 0.838361 0.542044 0.358690 4.884882 1.546229
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.00% -1.273004 -0.068864 -0.886911 -0.956186 -0.164216 0.790931 -0.908774 -0.645797 0.826869 0.837970 0.249225 2.523003 2.568380
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 13.51% -0.533660 0.883558 0.791601 1.932762 1.168668 1.287533 1.305724 1.711729 0.793679 0.815532 0.265965 4.021810 4.208239
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.816869 17.701358 26.216631 29.271484 15.779585 20.049873 16.674647 16.448426 0.027110 0.029044 0.001742 1.175586 1.172236
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 3.78% -0.378592 1.290453 -0.975735 0.229961 -0.612430 0.856098 -0.949203 0.001208 0.820263 0.831762 0.249683 3.130609 3.300057
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.971010 5.836029 7.598109 5.622531 2.743091 25.428324 5.739028 4.268218 0.828425 0.809560 0.251099 4.324768 4.322086
120 N08 RF_maintenance 100.00% 29.19% 100.00% 0.00% 100.00% 0.00% 1.432051 23.643689 10.778482 37.597911 6.482700 19.861217 12.337463 16.717067 0.609576 0.033210 0.511519 3.868378 1.145071
121 N08 digital_ok 100.00% 29.19% 29.19% 0.00% 100.00% 0.00% 3.526303 8.772791 1.192156 0.907525 -0.491916 -0.193870 3.101908 0.964705 0.625058 0.613377 0.142213 3.825681 4.068757
122 N08 digital_ok 100.00% 29.19% 29.19% 0.00% 100.00% 0.00% 7.493119 8.201914 -0.226681 1.000442 4.482274 -0.605108 -0.389488 0.560985 0.629022 0.616289 0.138304 4.393287 4.245818
123 N08 digital_ok 100.00% 29.19% 29.19% 0.00% 100.00% 0.00% 6.428830 8.809410 2.565430 -0.289284 -0.163004 0.287669 1.335182 -0.352611 0.630393 0.617495 0.137295 4.892338 4.327822
124 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.568704 -0.247563 6.532004 9.392688 1.233878 4.225068 4.759096 9.813927 0.853630 0.840869 0.223187 5.739842 5.024943
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.637427 0.518799 0.004026 2.095189 -1.381472 0.360182 -0.318754 1.805700 0.842532 0.849105 0.221160 5.087210 4.780693
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.184479 0.844044 4.906850 -0.775549 14.701780 -0.771687 6.087308 -0.145180 0.817704 0.846729 0.232137 6.200613 5.947612
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.54% -0.112402 1.065583 1.321921 -0.851356 0.540932 -0.093464 0.693096 -0.542187 0.845102 0.851416 0.228488 2.952830 2.822997
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.54% -0.604448 2.175376 -0.135936 0.133451 -0.069201 1.530861 -0.922025 -0.502256 0.842381 0.844358 0.229883 3.219672 3.230882
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.54% -0.472870 -0.886248 -0.676538 -0.801526 0.071885 -0.319670 -1.159373 -0.984789 0.836965 0.845798 0.238104 3.465041 2.827812
130 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.00% 1.206786 -0.393628 -0.735781 -0.653737 0.106584 -0.260778 -0.585819 -0.441480 0.825418 0.838701 0.240834 2.927249 2.614901
135 N12 digital_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 0.088031 16.608631 5.802777 28.351495 2.426509 20.034128 7.883218 16.376252 0.781608 0.033803 0.459551 8.132465 1.203491
136 N12 digital_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.006683 -0.492683 1.748934 0.256887 -0.425822 -0.673094 2.043941 0.663250 0.791728 0.814231 0.255084 6.598890 6.519612
137 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.541488 -0.358240 -0.399655 0.441582 2.050147 6.760720 -0.083949 0.971620 0.805267 0.819415 0.258320 5.555872 5.112324
138 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.229178 0.673269 -0.298632 -0.613349 -1.570399 -0.388866 -0.052671 -0.269324 0.819991 0.831383 0.253341 5.714066 5.569837
140 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 12.867898 16.492330 25.361214 27.929151 15.511961 19.790187 16.798479 16.533953 0.034952 0.033926 0.001593 1.152293 1.151836
141 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.656627 4.754660 -0.178519 7.632438 1.207203 3.868506 0.718092 8.883914 0.825782 0.819282 0.226417 6.412342 6.667709
142 N13 digital_ok 100.00% 18.92% 100.00% 0.00% 100.00% 0.00% 44.968842 16.640910 2.380843 28.067134 8.850754 19.884699 10.100684 16.458624 0.542062 0.034688 0.301702 5.334105 1.218410
143 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 4.86% -0.509051 -1.134290 0.123655 -0.792961 -0.539268 0.670384 0.043190 -0.429122 0.841375 0.848447 0.224737 3.764066 3.377604
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.803003 -0.625215 -0.063101 4.231166 3.299315 7.022523 0.135218 3.159291 0.843091 0.846793 0.229823 6.894543 6.461140
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.543759 17.335743 26.246330 28.235116 15.691383 19.884723 16.796230 16.625922 0.031585 0.027695 0.002687 1.254643 1.246249
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.00% 1.415259 0.472884 2.342257 0.121906 2.498557 -1.036183 3.528584 -0.131467 0.839380 0.845431 0.231489 3.373233 3.006757
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.305984 2.039771 -0.788936 -0.219649 1.110784 -1.110654 -0.717966 -0.365619 0.837723 0.843673 0.237349 4.888399 4.533217
149 N15 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 4.183151 16.259003 0.729953 28.204823 -0.921859 19.884265 0.311694 16.437369 0.827342 0.032869 0.589901 6.204523 1.180778
150 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.358926 16.096783 26.010512 28.062292 15.635094 19.883910 16.768849 16.523474 0.026515 0.027561 0.000448 1.175723 1.173140
151 N16 not_connected 100.00% 0.54% 0.00% 0.00% 100.00% 0.00% 6.074009 2.870741 2.417418 0.614273 140.391350 205.871546 399.061122 400.499977 0.701082 0.799003 0.258166 423.758858 113.973417
152 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.589412 2.371591 8.262696 9.757758 2.575561 4.821178 6.532314 7.231549 0.791155 0.808448 0.282427 3.835383 4.184208
153 N16 not_connected 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 13.327521 1.497490 8.353513 10.042711 15.744328 3.541920 16.682260 7.187241 0.042440 0.806038 0.689162 1.193351 4.419798
154 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.554414 0.743306 14.534553 13.302575 6.671012 6.062674 8.969036 8.542561 0.785124 0.802227 0.287146 4.254848 4.757037
155 N12 digital_maintenance 100.00% 100.00% 0.00% 0.00% 100.00% 0.00% 13.305843 0.308307 24.999736 1.344503 15.370847 1.941744 16.531116 1.918939 0.110814 0.808435 0.495022 1.308718 6.833553
156 N12 digital_ok 100.00% 83.78% 0.00% 0.00% 100.00% 0.00% 13.023164 -0.956063 25.650014 1.919727 14.866347 0.792503 15.380068 1.147578 0.244107 0.814447 0.460243 1.382631 6.536147
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 8.11% -1.210296 -0.572504 0.789902 2.404007 -1.073907 -0.102954 0.351769 2.573240 0.810380 0.816061 0.261089 3.887593 3.606006
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.635407 -1.180731 21.382546 2.918424 11.027363 0.694844 13.564304 5.373574 0.803881 0.823083 0.285220 6.775736 6.300726
160 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 13.873439 16.328506 25.845021 27.928134 15.488002 19.751092 16.799302 16.465160 0.036083 0.036893 0.001625 1.193322 1.191613
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.160995 33.009958 -0.915127 0.991707 -0.669427 8.865125 -0.279609 6.083698 0.827680 0.764855 0.221014 4.848048 6.689541
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 5.95% 2.066389 0.451312 -0.746002 -0.453817 0.956576 0.155773 -0.355557 -0.476835 0.835372 0.839340 0.242576 3.321353 3.255158
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.54% 0.003441 -0.276000 -0.549055 -0.073871 -1.747458 -0.213021 -0.752996 -0.245614 0.840165 0.839503 0.237895 2.740619 2.676885
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 1.62% -1.061475 -0.563492 -0.877824 1.109698 -0.981450 0.409352 -0.652271 0.786929 0.838021 0.837282 0.234924 3.420602 2.980500
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -1.911393 0.758814 6.379034 -0.540733 1.985897 -0.930017 5.011343 0.011770 0.841882 0.840175 0.237420 5.084888 5.414291
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 11.632512 1.923118 -0.124625 1.501763 5.696469 6.311365 4.594624 3.279114 0.800546 0.831354 0.218837 7.105015 6.782440
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 45.458710 43.172461 2.299288 2.219284 15.331346 10.717737 13.354979 12.594282 0.736511 0.747102 0.138665 8.265034 6.729743
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.435226 3.199925 0.663956 -0.463013 0.230485 0.274407 0.397332 0.177049 0.834516 0.835537 0.238537 5.237122 5.162609
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 5.95% 1.412464 3.072753 -0.459976 0.155001 -1.336962 0.276386 -0.762519 0.200421 0.832879 0.826681 0.244038 3.946109 3.861233
170 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 1.62% 0.402174 0.258055 0.983712 0.160043 0.083308 -1.094251 1.039478 0.072795 0.823790 0.832982 0.246499 3.307297 3.017993
171 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.002164 6.621582 9.256279 0.134002 4.078278 3.987862 7.074828 2.327156 0.799698 0.774972 0.264902 3.955265 3.532607
173 N16 not_connected 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% 15.289200 16.388646 7.232548 9.505554 15.391762 19.806916 16.992208 16.714445 0.039004 0.040525 0.003054 1.204221 1.201693
176 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 7.03% -0.086863 0.444695 0.838442 1.466492 0.239862 0.781921 3.817055 3.765744 0.792022 0.802290 0.272233 3.426526 3.082228
177 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 4.32% -1.173476 -1.276243 -0.400819 1.543254 -0.550323 1.369605 0.630856 1.549228 0.801722 0.806510 0.271286 3.165654 2.923402
178 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.514699 0.178190 17.209617 4.491031 7.960917 2.898455 15.731461 5.101299 0.726437 0.809940 0.294027 3.760388 4.864735
179 N12 digital_ok 100.00% 100.00% 99.46% 0.00% 100.00% 0.00% 14.401679 18.708947 26.577140 29.699293 15.896520 20.186459 16.620306 16.185634 0.034837 0.128120 0.066666 1.212550 1.236732
180 N13 RF_maintenance 100.00% 0.00% 21.62% 0.00% 100.00% 0.00% 1.337568 11.944438 0.045920 26.573518 -0.936383 14.336529 -0.317848 11.418353 0.825548 0.565637 0.363575 38.362638 5.467818
181 N13 digital_ok 100.00% 100.00% 54.05% 0.00% 100.00% 0.00% 13.370008 56.791628 26.419293 3.046397 15.651503 21.168395 16.781306 14.166232 0.042056 0.416178 0.222561 1.187544 2.549062
182 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 4.571969 15.488824 20.647749 27.277286 8.387869 19.758013 13.633882 16.400584 0.820205 0.069378 0.532038 5.600250 1.288196
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.00% -1.501468 -0.979703 0.744896 -0.225308 -0.891424 0.035625 0.118449 -0.315587 0.831269 0.831570 0.246103 2.952138 2.848516
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 2.70% -0.334774 -0.727243 -0.913677 0.151545 1.155239 -0.564478 -0.923440 -0.181416 0.833794 0.829739 0.242298 3.248642 2.960129
185 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 0.00% -0.415830 -0.486679 -0.384398 0.045185 -1.337651 -1.235103 -0.761690 -0.223944 0.837129 0.833850 0.240195 2.628100 2.712245
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 1.08% 0.846498 -0.557451 0.154525 -0.997161 1.294487 -0.270140 0.182971 -0.436727 0.834727 0.834924 0.238534 2.783704 2.931714
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 8.65% 8.11% -0.570610 0.407129 0.351554 -0.914421 -0.686703 -0.469227 0.266073 -0.158103 0.832836 0.837281 0.235223 3.752346 3.124104
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.733959 6.470249 22.602050 19.766221 9.651122 12.566184 14.593591 13.402148 0.809252 0.810197 0.281145 7.150454 6.658118
190 N15 digital_ok 100.00% 0.54% 100.00% 0.00% 100.00% 0.00% 10.496100 16.204838 20.853953 28.456654 13.282114 20.024808 16.975208 16.367897 0.693785 0.065702 0.508809 6.739603 1.239785
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.956696 3.432609 21.981270 18.659540 9.568455 9.822428 14.167032 12.948847 0.806489 0.812989 0.291085 6.319846 5.446386
192 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 4.378651 9.307011 22.375702 27.263089 11.794485 18.473966 13.750226 15.784233 0.795435 0.767936 0.323785 4.983573 4.654869
193 N16 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 8.640062 3.158326 28.070139 17.020841 14.166186 7.818951 16.070877 11.804487 0.758209 0.801361 0.341856 4.871685 5.367064
200 N18 RF_maintenance 100.00% 100.00% 55.68% 0.00% 100.00% 0.00% 13.721196 42.676192 8.503694 13.325663 15.481006 15.505904 16.811791 14.270269 0.045751 0.404449 0.316800 1.205998 2.001778
201 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 9.212631 9.162485 28.274228 26.088883 14.488049 17.083054 16.190289 15.585111 0.769151 0.770056 0.310886 5.375008 5.023046
202 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.464513 6.503931 15.389183 -0.395203 6.245688 6.932660 10.836789 1.884219 0.812290 0.774123 0.275293 4.900761 3.525049
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
219 N18 RF_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
220 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 1.564883 0.007795 11.454752 12.811012 3.943700 6.333936 8.300376 9.250815 0.803925 0.800679 0.279872 3.927745 3.773390
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 5.052324 2.289556 4.489506 12.352072 5.555709 5.239818 3.875284 9.424495 0.788102 0.799689 0.280109 3.606412 3.812747
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 3.808076 3.507458 13.291027 13.615608 6.504610 6.163140 9.638197 10.159341 0.808526 0.801636 0.279487 5.500626 4.508983
237 N18 RF_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
238 N18 RF_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
239 N18 RF_ok 100.00% 100.00% 100.00% 0.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan 0.000000 0.000000
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 100.00% 0.00% 0.641621 14.764050 3.112027 17.304725 1.051735 19.840546 1.857551 16.476570 0.821164 0.047917 0.502800 0.000000 0.000000
321 N02 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 0.129822 0.911500 12.214147 12.718444 5.659651 6.253724 7.433273 8.091919 0.713034 0.670052 0.345196 0.000000 0.000000
322 N05 digital_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.933158 4.414322 14.003640 19.506822 6.430570 11.514605 8.740744 11.947415 0.689853 0.645008 0.364646 0.000000 0.000000
323 N02 not_connected 100.00% 21.08% 0.00% 0.00% 100.00% 0.00% 11.476702 3.223065 1.021448 18.175388 5.731667 10.728076 7.663645 11.109472 0.517413 0.642841 0.309805 0.000000 0.000000
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 2.706002 4.597277 17.148296 18.372646 7.836033 10.196808 10.427513 11.261663 0.710234 0.698299 0.303489 0.000000 0.000000
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% -0.064749 0.560713 17.308264 10.007200 7.156184 3.554511 10.182152 6.431504 0.745472 0.724994 0.314621 0.000000 0.000000
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 100.00% 0.00% 6.065415 1.119414 -0.177672 11.263112 4.127869 4.873965 2.631232 7.170302 0.654155 0.736078 0.319642 0.000000 0.000000
333 N12 dish_maintenance 100.00% 0.54% 0.00% 0.00% 100.00% 0.00% 4.653546 3.124810 0.219011 9.403986 3.411827 4.709931 1.603246 5.981495 0.608632 0.688593 0.361220 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_2459852.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 [ ]: