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 = "2459956"
data_path = "/mnt/sn1/2459956"
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, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 1-11-2023
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/2459956/zen.2459956.21297.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/2459956/zen.2459956.?????.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.')
No files found matching glob /mnt/sn1/2459956/zen.2459956.?????.sum.known_good.omni.calfits. Skipping redcal chisq.

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])
    start_time = Time(startJD,format='jd')
    stop_time = Time(stopJD,format='jd')

    # get initial state by looking for commands up to 3 hours before the starttime
    # this logic can be improved after an upcoming hera_mc PR
    # which will return the most recent command before a particular time.
    search_start_time = start_time - TimeDelta(3*3600, format="sec")
    initial_command_res = session.get_array_signal_source(starttime=search_start_time, stoptime=start_time)
    if len(initial_command_res) == 0:
        initial_source = "Unknown"
    elif len(command_res) == 1:
        initial_source = initial_command_res[0].source
    else:
        # multiple commands
        times = []
        sources = []
        for obj in command_res:
            times.append(obj.time)
            sources.append(obj.source)
        initial_source = sources[np.argmax(times)]
    
    # check for any changes during observing
    command_res = session.get_array_signal_source(starttime=start_time, stoptime=stop_time)
    if len(command_res) == 0:
        # still nothing, set it to None
        obs_source = None
    else:
        obs_source_times = []
        obs_source = []
        for obj in command_res:
            obs_source_times.append(obj.time)
            obs_source.append(obj.source)

    if obs_source is not None:
        command_source = [initial_source] + obs_source
    else:
        command_source = initial_source
    
    res = session.get_antenna_status(starttime=startTime, stoptime=stopTime)
    fem_switches = {}
    right_rep_ant = []
    if len(res) > 0:
        for obj in res:
            if obj.antenna_number not in fem_switches.keys():
                fem_switches[obj.antenna_number] = {}
            fem_switches[obj.antenna_number][obj.antenna_feed_pol] = obj.fem_switch
        for ant, pol_dict in fem_switches.items():
            if pol_dict['e'] == initial_source and pol_dict['n'] == initial_source:
                right_rep_ant.append(ant)
except Exception as e:
    print(e)
    initial_source = None
    command_source = None
    right_rep_ant = []
name 'command_res' is not defined

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 (initial_source == 'digital_noise_same' or initial_source == 'digital_noise_different') and med < 10:
                antCon[ant] = True
            elif (initial_source == "load" or initial_source == 'noise') and 80000 < stdev <= 4000000 and antCon[ant] is not False:
                antCon[ant] = True
            elif initial_source == "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'] = ', '.join(command_source if hasattr(command_source, '__iter__') else [str(command_source)])
to_show['Antennas in Commanded State (reported)'] = f'{len(right_rep_ant)} / {len(ants)} ({len(right_rep_ant) / len(ants):.1%})'
to_show['Antennas in Commanded State (observed)'] = 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 2459956
Date 1-11-2023
LST Range 1.935 -- 11.892 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
Total Number of Antennas 196
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 196 (0.0%)
Antennas in Commanded State (observed) 0 / 196 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 59 / 196 (30.1%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 118 / 196 (60.2%)
Redcal Done? ❌
Never Flagged Antennas 78 / 196 (39.8%)
A Priori Good Antennas Flagged 48 / 93 total a priori good antennas:
3, 9, 10, 15, 16, 19, 29, 30, 31, 40, 42, 54,
55, 56, 71, 72, 81, 85, 86, 94, 101, 103, 106,
109, 111, 121, 122, 123, 128, 136, 143, 146,
151, 158, 161, 164, 165, 168, 170, 171, 173,
182, 185, 187, 189, 192, 193, 202
A Priori Bad Antennas Not Flagged 33 / 103 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 61, 62, 64, 73,
74, 82, 89, 90, 95, 102, 115, 125, 137, 139,
211, 220, 221, 227, 229, 237, 238, 239, 245,
261, 324, 325
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_2459956.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 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
3 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.647560 17.159847 9.739773 -0.849891 10.545800 4.236307 7.333451 4.377267 0.031692 0.394056 0.318874
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.643185 -0.114280 7.186292 3.412494 2.588404 22.468993 3.632386 2.650060 0.577816 0.645320 0.340846
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.187079 -0.122150 0.311223 0.314640 -0.590472 1.619032 0.903560 0.665280 0.671912 0.673067 0.324852
7 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.740660 -0.865793 -1.197765 -0.352682 -0.539411 1.898350 1.529812 2.549709 0.672502 0.674247 0.320640
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.343704 -0.977405 -0.654789 0.064562 -0.725951 0.049518 0.663529 0.537325 0.672363 0.671179 0.319891
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 5.031246 -1.436320 8.055606 -0.461771 7.291429 -0.409609 3.127185 -0.134052 0.521413 0.668747 0.388939
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.523611 -0.120570 -1.248751 -1.306433 4.221996 0.478022 -0.125293 0.776746 0.660326 0.666009 0.326915
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.554781 20.946407 9.143164 -0.207011 10.554723 4.163494 7.198432 3.070485 0.031672 0.398465 0.313031
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.574316 -0.152029 9.704136 0.892876 10.551256 1.674649 7.280081 0.945173 0.030665 0.678252 0.554380
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.440772 2.315328 0.329220 0.428695 0.422644 0.281277 0.249426 0.010041 0.679109 0.678517 0.323753
18 N01 RF_maintenance 100.00% 100.00% 37.51% 0.00% 11.322748 19.791002 9.687569 -0.760639 10.717509 7.366525 7.210211 8.406553 0.029660 0.271903 0.214826
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.705854 0.472946 -0.980745 -0.294396 10.224581 38.386499 2.982271 1.931300 0.673970 0.680547 0.320453
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.209568 -0.246541 2.382702 -1.014184 -0.286264 0.787111 2.977280 -1.286809 0.673810 0.679907 0.321454
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.191400 -1.151018 -0.683005 0.231117 0.267900 1.276266 0.075402 0.683702 0.665866 0.666985 0.319334
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.383505 0.433674 0.927714 0.671003 1.890501 1.162880 0.504869 -0.312780 0.627981 0.632543 0.326375
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.994456 12.097313 9.727386 10.219274 10.655941 10.940658 7.525398 6.893610 0.034161 0.037018 0.004785
28 N01 RF_maintenance 100.00% 0.00% 64.97% 0.00% 15.859583 27.918507 -0.867932 0.898657 4.589072 6.226824 4.196412 9.399492 0.407955 0.192390 0.294522
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.639309 12.127534 9.331319 9.829043 10.656468 10.939655 7.335353 6.475309 0.029474 0.034094 0.005032
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.210315 0.592085 -0.615146 0.539449 9.654498 -0.234670 -0.275868 -0.160942 0.685409 0.687295 0.315601
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 2.018317 -0.417231 0.823367 1.050846 9.373974 0.902433 2.498006 0.624963 0.693873 0.680942 0.313649
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.900767 19.939173 -0.197435 2.726989 -0.486245 7.519833 -0.003774 6.886638 0.682725 0.602977 0.304222
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.914187 13.507926 4.106920 4.480990 10.645796 10.899483 7.373477 6.559386 0.032246 0.041689 0.006967
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.380958 1.293286 1.243280 -1.310736 1.889297 -0.998259 0.231540 -0.805358 0.635922 0.622467 0.322291
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 18.768268 17.835068 13.035143 13.020462 10.810173 11.007487 7.695149 7.271750 0.030087 0.028222 0.001620
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.180268 1.652388 -0.994219 0.872524 3.121381 0.439758 -1.136331 2.057352 0.674755 0.671163 0.329939
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.965229 0.511048 0.091492 0.686723 -0.299481 -0.466262 1.867930 1.297278 0.681262 0.680482 0.326118
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 10.154653 -1.080901 9.350017 0.458173 10.618376 -0.728733 7.343474 -0.222630 0.035372 0.676323 0.523254
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.543986 -0.538465 -0.063117 0.003224 1.562091 -0.079658 -0.386835 -0.492950 0.686953 0.686465 0.310848
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.390403 13.192266 10.035088 10.752443 10.361745 10.631257 7.275523 6.683750 0.026503 0.025817 0.001278
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.168740 -0.014364 -0.308796 0.740313 -1.017528 0.216451 -0.772075 0.208122 0.684703 0.678629 0.308144
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.583739 -0.623837 -0.700371 0.085126 -0.130436 -0.057052 -1.554171 -0.353982 0.682010 0.685164 0.310639
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.638618 0.843117 0.069966 0.658415 -0.733686 1.478573 -0.206706 1.063407 0.680018 0.672738 0.304672
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.797740 0.633069 -0.984826 -0.695618 -0.173166 -0.111846 -0.813865 -1.504025 0.678438 0.684864 0.322207
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.591033 12.902431 3.928660 4.108373 10.578171 10.819203 7.384595 6.441389 0.029233 0.045001 0.011367
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.816996 0.403306 0.882460 2.364410 -0.974874 2.364058 -0.011519 1.319211 0.638793 0.646836 0.328592
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.966724 0.035436 -1.006601 0.158923 3.069103 1.452373 -0.507872 0.407910 0.592384 0.623003 0.324962
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.361257 13.487767 0.204538 1.396137 0.431578 5.304352 2.904943 12.025247 0.655815 0.599046 0.313242
51 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 20.354436 5.476486 12.527783 -0.271574 10.828283 4.321279 8.898398 0.332373 0.036868 0.563870 0.431988
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.469433 7.810241 -0.420622 0.452847 0.607728 -0.027869 -0.011270 0.524873 0.683604 0.680924 0.319843
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.656196 1.893008 0.247323 0.489816 0.572518 1.046502 1.068259 1.089802 0.691751 0.689707 0.318971
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.582046 12.382704 9.745164 10.466957 10.592074 10.836929 7.510575 6.548465 0.026475 0.025685 0.001175
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.618109 12.389353 9.192096 9.774213 10.597282 10.852292 7.298549 6.969386 0.027837 0.030472 0.002423
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.539865 13.481374 0.440244 10.601223 -0.609178 10.753623 0.310693 6.572899 0.694338 0.035203 0.558516
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.351691 -0.920679 7.299820 1.169441 6.814571 0.440888 5.928009 1.166170 0.501436 0.698614 0.344962
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.278017 12.315690 9.639206 10.353638 10.537489 10.827400 7.515340 6.715229 0.031580 0.031945 0.001764
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.117537 -0.769946 9.734243 2.589782 10.363222 1.144312 7.209677 4.408143 0.043421 0.671621 0.526243
60 N05 RF_maintenance 100.00% 0.00% 95.95% 0.00% 1.433420 12.187695 -0.332184 10.359476 -0.822725 10.946281 -0.304785 7.285760 0.679330 0.080354 0.536902
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.769034 -0.000995 -0.769494 -1.389892 2.000859 -0.735310 -1.156960 -1.532453 0.623513 0.640292 0.309933
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.369517 -0.350248 -0.617943 1.519958 2.737526 -0.410776 -0.258383 0.464830 0.610075 0.648106 0.326171
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.077166 12.566337 0.162317 4.494612 1.313581 10.982310 -0.325474 6.734791 0.635531 0.040758 0.488453
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.029074 0.469773 -0.418065 -0.962369 -0.569588 -0.784068 -0.238694 -0.343204 0.617976 0.605673 0.314068
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 2.126211 1.000921 0.388995 1.146320 0.109424 0.199134 2.743065 3.860040 0.659020 0.664615 0.332322
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.708760 0.446660 -1.173912 -1.194354 3.610836 -0.551442 -0.323685 -0.900144 0.673523 0.677707 0.330609
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.271537 -0.077407 -0.914931 0.687876 -0.794167 0.948066 -0.386283 1.674343 0.684237 0.682722 0.320369
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 26.831251 24.756834 1.818297 13.858695 4.191743 10.923185 3.646642 8.087558 0.414187 0.027889 0.301188
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.243371 -0.632425 0.103153 0.863635 0.095456 0.970957 0.045470 0.876516 0.688694 0.689741 0.305609
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.166700 -1.114196 -0.126308 0.170752 0.373753 1.285245 -0.553700 0.000744 0.693793 0.696032 0.304600
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.246313 -0.578374 0.626763 0.885640 0.042014 -0.593463 0.692540 0.205309 0.707318 0.693821 0.302384
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.210088 13.464405 10.146119 10.773425 10.343565 10.667586 7.205193 6.539760 0.026309 0.025135 0.001337
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.805285 2.297797 -1.362488 -1.301659 0.594489 3.075232 -1.350073 -1.692366 0.695725 0.695195 0.304358
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.377417 -0.645045 0.318977 -0.568412 -0.022113 0.938222 -0.442290 0.289647 0.690827 0.690109 0.305991
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 62.152022 -0.592423 0.589222 0.141225 7.957584 -0.855593 6.238642 -0.667107 0.394182 0.643059 0.375976
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 23.708863 0.273230 -0.631978 1.573203 1.130109 0.027237 0.821054 0.747679 0.478265 0.651617 0.322804
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 2.080654 13.013838 -1.328389 4.530302 -0.547268 10.808912 -0.574087 6.367836 0.634587 0.038346 0.462323
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.058274 13.495136 0.227240 4.430755 0.556084 10.845479 3.526554 6.702750 0.629449 0.043027 0.467812
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -1.037130 12.709191 0.207877 8.985732 -0.164474 10.530199 1.376115 6.706957 0.636085 0.036032 0.474944
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.209162 -0.817269 0.384052 2.235522 -0.942863 -0.320645 0.562920 2.381016 0.650157 0.650736 0.318128
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.605299 -0.124191 0.288635 0.485707 -0.595354 -0.762425 0.011015 0.610645 0.667166 0.674044 0.317591
84 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 19.267620 19.627326 49.835858 38.470799 92.400879 71.130470 600.096884 332.843234 0.018903 0.016087 0.002052
85 N08 digital_ok 100.00% 0.00% 0.00% 0.00% -0.259541 0.557389 1.025325 1.468656 10.347380 -0.475681 0.930859 1.371274 0.685448 0.687739 0.306599
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.039631 -0.789672 1.154616 1.662090 4.362350 -0.550680 0.617660 4.707552 0.682491 0.678805 0.289661
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.560801 8.258006 -0.702463 -0.312009 -0.280003 0.144027 -0.823346 -0.520464 0.705294 0.708702 0.297242
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.042389 -0.125398 0.494229 0.719421 -0.162328 0.008458 -0.249626 -0.014759 0.699132 0.700288 0.292794
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.925178 0.136238 -0.011491 0.869255 0.134878 -0.877994 -0.588908 -0.053951 0.703820 0.701028 0.296458
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.108884 -0.676979 1.129192 1.320444 3.684318 -0.572339 0.573760 0.900239 0.696440 0.695955 0.296281
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.340156 -0.278045 -0.219621 -0.363957 -1.065407 -1.100493 -0.654997 -0.940615 0.693755 0.700371 0.307420
92 N10 RF_maintenance 100.00% 2.65% 27.24% 0.00% 35.536323 36.355723 0.800464 1.664929 5.039570 5.006059 4.074889 4.492416 0.327490 0.282668 0.073398
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.192934 -0.367938 2.073004 -1.032213 1.506662 -0.134854 2.551069 -1.626001 0.674899 0.682539 0.315004
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.272275 12.659157 9.893282 10.253210 10.515334 10.869228 7.320007 6.514138 0.029475 0.025348 0.002076
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.237587 0.156547 -0.722443 1.294610 -0.625586 0.069868 -1.020760 0.504868 0.642342 0.663717 0.331913
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.802123 13.110957 3.970467 4.639160 10.430874 10.710082 7.354546 6.515534 0.032800 0.036746 0.002330
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.696219 5.383056 -0.924115 1.462487 16.423267 8.751567 0.186279 1.885679 0.610355 0.572048 0.315220
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.106131 8.845766 -0.563418 1.169071 -0.340618 0.834051 -0.155066 1.521649 0.686399 0.686377 0.312097
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.705451 0.000995 -1.273740 -0.849293 0.810698 1.435123 -1.557795 2.001317 0.694440 0.694586 0.310534
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.389846 5.056212 -0.265568 -1.126121 115.202383 4.743480 4.496657 -0.853504 0.676042 0.700323 0.305813
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.136910 44.678465 -1.094960 7.212759 1.312655 0.426971 -1.460013 5.272892 0.705339 0.681404 0.298880
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.303542 -0.383666 -0.356688 0.165672 -0.555293 -0.491253 -0.734850 -0.620290 0.703941 0.700422 0.292527
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 3.246576 0.882368 -0.726256 -0.640803 24.464247 0.043196 -0.331859 -1.467079 0.699691 0.701653 0.291377
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.421825 0.353597 -0.034032 -0.348447 0.029639 0.578430 0.220265 -0.355845 0.703624 0.706101 0.294905
108 N09 RF_maintenance 100.00% 100.00% 1.46% 0.00% 10.513312 38.245311 9.683050 1.048628 10.661937 5.154111 7.373773 3.183006 0.033474 0.338289 0.177217
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.436098 12.092088 9.712835 10.102329 10.709426 10.934279 7.268344 6.832341 0.026081 0.025982 0.001239
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 22.541072 23.569493 13.188267 13.615188 10.541324 10.767357 7.422201 6.842222 0.023220 0.025162 0.001115
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.221774 11.679439 0.372434 10.204340 -0.891338 10.947714 0.617715 6.898340 0.681457 0.033504 0.448578
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.711570 -1.081818 0.293406 0.389959 -0.468151 1.686599 0.053476 0.132618 0.672738 0.676146 0.322657
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.010294 13.318852 3.753372 4.529421 10.491669 10.793550 7.413233 6.507916 0.033934 0.030542 0.001919
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 6.648936 6.847841 14.735178 11.902315 12.664892 14.818831 87.190781 50.203346 0.020918 0.024960 0.002439
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.568384 -0.369820 -0.560826 -0.197542 0.443824 -0.663411 -0.724959 -0.856036 0.616300 0.632016 0.335587
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.330476 13.356318 9.833860 10.734903 10.475535 10.870342 7.256847 6.893199 0.027009 0.030517 0.002379
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.776486 0.672002 -0.232021 0.677979 -0.258974 -0.619274 -0.166996 1.105925 0.652430 0.667757 0.322847
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.445246 0.882263 2.659340 -0.827287 2.052247 1.291895 6.031275 1.510499 0.675048 0.691495 0.306682
121 N08 digital_ok 100.00% 0.00% 2.16% 0.00% 4.623519 5.985218 -1.041448 4.871524 4.691273 51.352394 1.703942 7.832981 0.697977 0.640917 0.307228
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.570094 5.943839 0.019229 1.039103 -0.429565 0.633424 0.233217 1.294303 0.706532 0.704403 0.296341
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.683944 7.901757 0.768489 0.925600 -0.319107 -0.477903 1.032771 1.240775 0.712208 0.712162 0.297550
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.175061 1.732977 -0.026771 0.759485 -0.983269 -0.510381 0.148809 0.468029 0.712702 0.706736 0.296153
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.022732 -0.682229 -0.509839 0.770636 -0.465310 -0.007560 -0.784272 0.224778 0.707388 0.705134 0.296375
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.248430 6.397194 -1.123415 1.569483 7.201156 -0.227368 2.405078 0.861154 0.668957 0.699959 0.296845
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.885073 0.319407 0.630299 0.492746 0.481607 -0.010610 0.310309 0.322797 0.694959 0.699923 0.309587
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.108219 11.509047 9.271134 9.796090 10.387833 10.735101 7.168100 6.545433 0.029000 0.027616 0.000952
131 N11 not_connected 100.00% 0.00% 2.05% 0.00% -0.048074 11.606515 0.271114 4.353752 -0.544597 9.820385 -0.797262 3.464539 0.660198 0.364926 0.388868
132 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.208590 1.962256 -0.146739 -1.311040 4.439262 -0.781975 -1.104437 -1.514953 0.639154 0.640020 0.321374
133 N11 not_connected 100.00% 97.95% 0.00% 0.00% 12.042996 0.089283 3.714420 -1.407781 10.685932 -0.648632 7.247165 -1.567215 0.073673 0.631700 0.455020
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.064791 -1.080169 -0.275165 -1.426005 2.424283 5.839617 4.394204 3.029948 0.635421 0.650315 0.340367
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.807340 0.049674 9.286636 0.098641 10.687491 5.181681 7.559212 1.889971 0.037418 0.648203 0.449758
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.267292 -0.148430 0.412649 -1.328002 1.348912 -0.628786 1.067807 -1.051555 0.638445 0.661877 0.329168
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.554097 0.665497 2.069287 -0.559040 1.414224 -0.861828 1.278107 -1.533504 0.665523 0.664936 0.314316
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.273281 0.148053 -1.014276 0.268612 -0.423819 -0.325479 0.431628 -0.694320 0.688630 0.695642 0.308486
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.040269 -0.997820 -0.181678 1.122108 1.363213 -0.767502 0.187246 -0.260953 0.694777 0.698021 0.305503
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.501912 12.375754 -0.505856 10.371631 4.401673 10.934277 11.410601 6.742336 0.699139 0.043514 0.531751
143 N14 digital_ok 100.00% 0.00% 100.00% 0.00% -1.052271 12.560713 1.055110 10.464501 0.723085 10.670649 1.198399 7.072494 0.702645 0.038063 0.551058
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.489218 -0.167623 -1.112814 0.640930 -0.427176 1.610538 -0.805681 0.594200 0.711736 0.706203 0.297151
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.042513 -0.466948 -1.054689 3.793993 0.257377 8.248422 -0.325390 4.399387 0.711025 0.689097 0.300480
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.641294 -0.228118 3.721118 0.079048 10.559380 -0.546003 7.157257 -1.416118 0.037924 0.691610 0.521477
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.846512 -0.788029 1.061930 2.264657 -0.890258 -0.852038 1.204833 2.218060 0.685079 0.681931 0.302790
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.906758 1.038236 -0.471023 -0.536030 1.514090 1.351269 -0.313235 -0.889390 0.683722 0.688612 0.314193
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.817946 -0.953164 -1.070722 -1.146862 2.792112 1.426537 -0.722673 -1.570035 0.677627 0.682268 0.320215
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 1.469351 -0.886382 -0.706714 -1.060196 -1.360939 0.325124 -1.239114 -1.513093 0.663886 0.667116 0.323666
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 22.387025 2.618308 0.176124 0.471131 3.916922 -0.126048 1.920400 -0.836439 0.526482 0.619573 0.286937
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.074721 0.067988 9.434104 -1.397475 10.737859 0.649128 7.704522 2.070258 0.039474 0.651534 0.469828
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 6.430993 11.513485 8.802601 10.106251 8.612569 10.937157 2.862694 7.025329 0.403099 0.036556 0.283308
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.144093 -0.097131 -0.066572 0.764217 -0.723539 -0.067701 1.316722 2.346776 0.653087 0.662126 0.326960
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.842093 -0.710572 0.032971 -0.568935 0.826716 5.715109 1.222319 4.522123 0.667953 0.677837 0.326322
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.258800 18.090975 -1.113669 -0.897842 0.710749 3.878474 -1.033740 6.092752 0.641489 0.590563 0.307201
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.068388 -0.954496 -0.349410 -0.575035 -1.078589 1.570989 0.437357 -0.059089 0.685932 0.688668 0.309022
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.207368 25.879731 -0.005856 -0.484748 -0.159006 2.945346 0.493507 1.051465 0.691727 0.575263 0.281198
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.162905 -1.186768 -0.574739 -1.027606 3.248647 1.144996 -0.971875 -1.649329 0.702233 0.703302 0.305401
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 1.016741 1.632384 -0.271785 0.454273 -0.574413 1.094429 -0.181684 0.907051 0.708108 0.704019 0.303741
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -1.328443 0.064963 0.924207 0.036810 6.441150 2.729111 1.319999 0.260985 0.703902 0.705594 0.298528
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 22.667679 1.307569 -0.637468 -1.040224 5.609956 0.163297 2.380227 -0.920117 0.585904 0.706331 0.295341
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.438514 3.032832 -0.966137 0.263855 -0.391752 44.065422 0.316125 10.902333 0.707463 0.703293 0.309638
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.159993 -0.488010 -1.350834 -0.208625 1.299785 0.007560 -0.877248 1.007723 0.687374 0.685746 0.306220
168 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.370532 -0.717747 0.375822 -0.219634 0.454019 8.646348 0.694856 0.928509 0.678433 0.676863 0.310643
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.342154 -0.696654 -0.891075 -1.220715 -0.132540 3.161168 -0.553720 -0.389051 0.677002 0.673378 0.316761
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 11.462941 -0.424910 10.021607 -1.008384 10.484115 1.666096 7.799589 -0.136718 0.036816 0.673075 0.513425
171 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 2.138420 4.208693 -1.022012 -0.054766 -0.252589 2.143722 -0.713436 -0.850198 0.631308 0.608644 0.310705
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 12.213414 12.858726 3.433025 4.127641 10.690703 10.922169 7.945880 7.420432 0.038123 0.040918 0.002678
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.451488 -0.508427 -0.872350 -0.429042 7.529242 21.757744 0.271347 3.364907 0.664637 0.671901 0.320956
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.330075 12.666586 -1.319983 10.513773 1.136953 10.827252 2.496063 7.054234 0.682110 0.049760 0.535829
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.595637 -0.782406 -0.003224 0.304615 -0.591403 -0.271995 0.583018 1.511776 0.691481 0.690249 0.313180
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.450544 11.876949 0.145603 10.081125 19.559919 10.982964 0.263275 6.896016 0.697149 0.044669 0.503332
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.064143 1.817769 -0.242863 0.623138 0.620722 0.152404 0.614484 0.547619 0.691116 0.693767 0.298358
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.067072 -0.696285 -0.763330 -0.412660 -0.714103 -0.329766 0.424386 0.237454 0.705035 0.705696 0.296947
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 30.061803 0.477041 -0.509055 -1.367200 9.538466 0.152557 1.452447 -1.383692 0.582085 0.701785 0.297365
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.122052 -0.358911 -1.351233 -0.114441 1.919530 1.132174 -1.125145 -0.763055 0.708198 0.708068 0.313887
187 N14 digital_ok 100.00% 0.16% 0.00% 0.00% 0.885942 1.686283 -1.224582 2.176032 6.033495 9.956367 0.073311 5.813593 0.701388 0.699243 0.315642
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 9.586943 11.490848 9.274690 10.205422 10.758787 10.937113 7.611066 7.258481 0.027040 0.029755 0.001254
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.596603 -1.616676 -0.695029 0.865408 -0.882156 0.790642 -0.256421 -0.537707 0.679373 0.683275 0.329539
191 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.446430 0.427535 1.277588 -0.315327 0.028048 0.750178 3.596739 -0.000744 0.665387 0.671350 0.322352
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.919956 4.519120 5.752567 5.603526 8.351247 8.598152 6.026069 5.396982 0.615166 0.623499 0.341119
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.283435 0.785414 5.838660 2.237457 8.540499 2.646256 6.132843 1.578809 0.600486 0.638408 0.362438
200 N18 RF_maintenance 100.00% 100.00% 40.38% 0.00% 11.869955 38.804731 3.866820 0.485882 10.759090 6.347803 7.440549 4.198613 0.039670 0.255870 0.176981
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.166148 3.040261 3.595587 4.893346 1.654884 6.934833 3.056843 4.587456 0.668861 0.654337 0.331107
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% -0.110869 1.812021 2.093013 -1.056982 1.418010 -0.457293 1.347717 5.072790 0.681153 0.660219 0.314835
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.135068 4.572614 1.085394 -0.999211 -0.388691 -0.650005 0.844527 -0.013515 0.675861 0.655184 0.308490
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.530939 1.771349 3.014996 0.174534 4.453417 5.962323 2.872374 0.287913 0.677977 0.672386 0.314320
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.706590 4.881755 1.890265 -0.135749 1.066734 6.319278 1.685874 -0.505622 0.661594 0.652333 0.293289
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.459668 8.495211 8.907651 11.499621 10.589751 11.136700 10.061443 24.858540 0.033040 0.032158 0.001655
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.373975 7.796492 8.925685 9.216872 10.148843 11.304356 10.553136 10.560063 0.040202 0.037638 0.002391
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 11.918233 12.699402 -1.040910 -0.982851 -0.916759 -0.099585 -1.113300 -1.311420 0.677477 0.674522 0.321885
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.066496 0.045077 -0.791638 0.424384 0.377594 -0.685571 -0.956033 -0.632203 0.633226 0.648743 0.322556
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.021628 -0.286779 0.810993 0.041385 -0.028116 1.988695 0.408023 -1.261079 0.668253 0.665641 0.316460
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.770942 0.456507 -1.072450 -0.331360 0.326891 -0.294852 -0.159518 -1.538701 0.656754 0.669875 0.315342
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 1.454707 0.029350 -0.006038 -0.170801 -0.723144 19.668292 -0.750460 -1.957733 0.666732 0.671063 0.314305
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.534600 2.285689 -0.952784 0.097124 1.099164 31.195036 -0.708956 1.103358 0.659326 0.662089 0.312354
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.213349 4.160554 5.990393 5.577547 8.078192 8.532739 6.212509 5.344809 0.640531 0.648778 0.331000
225 N19 RF_ok 100.00% 0.00% 65.73% 0.00% 1.848121 12.558851 1.273763 4.278013 -0.793843 10.692624 0.571564 6.167652 0.674857 0.187647 0.529359
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.298230 9.967168 0.550616 1.792497 -0.886887 3.637918 -0.365522 2.093690 0.671459 0.623166 0.317781
227 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 2.946836 1.431793 -1.253374 0.526251 -0.395762 -0.366474 1.670098 -0.490217 0.640602 0.660617 0.314386
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.206020 18.334018 -0.991575 0.120159 0.369642 3.373499 0.259072 3.403004 0.609815 0.562250 0.281259
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.153410 0.072831 1.913098 1.848436 0.026236 1.270824 1.166586 0.537631 0.650210 0.656438 0.332808
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 3.297860 1.402111 -0.090916 -1.275002 0.597132 -0.936329 -1.099251 -1.717177 0.611107 0.646343 0.327108
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.157065 1.355744 1.332981 0.599500 -0.118950 -0.716459 0.187991 -1.214281 0.665484 0.665403 0.325648
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.086882 -0.910335 0.297802 0.458155 -0.747565 -0.476310 -0.634593 -0.378350 0.666420 0.667583 0.321077
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 25.313061 64.223764 -0.744796 0.809359 13.026424 7.091219 7.198102 3.345763 0.526691 0.443588 0.208607
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.555758 6.502955 -0.412593 0.445643 -0.397217 0.994123 0.651882 5.085458 0.656135 0.624576 0.321581
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 23.777571 1.614860 0.448643 1.717823 5.403447 1.818179 2.287958 0.879278 0.549945 0.669385 0.322473
243 N19 RF_ok 100.00% 9.41% 0.00% 0.00% 63.047265 4.396858 0.782510 -1.135023 8.694293 -0.753643 4.397977 -1.006486 0.364209 0.647400 0.416283
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.535236 2.686790 1.320632 -0.859424 4.547257 0.754415 0.687162 -0.037132 0.558381 0.631781 0.318079
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.725547 3.291744 0.017314 -1.220016 -0.613233 -0.803771 -0.592619 -1.253721 0.646609 0.639773 0.317821
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 14.163981 13.397042 -0.621564 0.170722 4.303354 4.688071 4.552676 3.479215 0.366723 0.371441 0.150000
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 2.133204 2.238766 1.078312 -0.077912 -0.570835 -0.552223 0.941121 0.949048 0.644816 0.640025 0.323691
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.667580 7.089303 8.843387 9.641640 10.166424 9.828232 9.257836 10.194533 0.030569 0.026682 0.003496
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 7.919065 11.404327 2.628821 6.709729 1.374899 11.022094 8.479827 6.731178 0.496545 0.043468 0.398781
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 2.750146 2.659734 1.658877 2.005727 0.806777 2.008990 0.845063 0.167665 0.531153 0.543393 0.335195
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.436745 -0.336823 1.711140 -0.926819 1.624623 -0.386140 0.129071 1.067259 0.581032 0.571822 0.340576
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.104306 0.090503 -0.984247 0.044520 23.254731 -0.716875 1.308857 0.182289 0.497972 0.550085 0.339382
333 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.500001 4.685212 -0.694533 -1.193282 0.586261 -0.551624 2.913396 1.469286 0.481920 0.517348 0.332545
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, 9, 10, 15, 16, 18, 19, 27, 28, 29, 30, 31, 32, 34, 36, 40, 42, 47, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 77, 78, 79, 80, 81, 84, 85, 86, 87, 92, 94, 96, 97, 101, 103, 104, 106, 108, 109, 110, 111, 113, 114, 117, 120, 121, 122, 123, 126, 128, 131, 132, 133, 135, 136, 142, 143, 145, 146, 151, 155, 156, 158, 159, 161, 164, 165, 166, 168, 170, 171, 173, 179, 180, 182, 185, 187, 189, 192, 193, 200, 201, 202, 205, 206, 207, 208, 209, 210, 222, 223, 224, 225, 226, 228, 240, 241, 242, 243, 244, 246, 262, 320, 329, 333]

unflagged_ants: [5, 7, 8, 17, 20, 21, 22, 35, 37, 38, 41, 43, 44, 45, 46, 48, 49, 53, 61, 62, 64, 65, 66, 67, 69, 70, 73, 74, 82, 83, 88, 89, 90, 91, 93, 95, 102, 105, 107, 112, 115, 118, 124, 125, 127, 137, 139, 140, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 167, 169, 181, 183, 184, 186, 190, 191, 211, 220, 221, 227, 229, 237, 238, 239, 245, 261, 324, 325]

golden_ants: [5, 7, 17, 20, 21, 37, 38, 41, 44, 45, 53, 65, 66, 67, 69, 70, 83, 88, 91, 93, 105, 107, 112, 118, 124, 127, 140, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 167, 169, 181, 183, 184, 186, 190, 191]
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_2459956.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.5.dev13+gd6c757c
3.3.dev3+gb08b74d
In [ ]: