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 = "2459998"
data_path = "/mnt/sn1/2459998"
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: 2-22-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/2459998/zen.2459998.21316.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 1849 ant_metrics files matching glob /mnt/sn1/2459998/zen.2459998.?????.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/2459998/zen.2459998.?????.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 2459998
Date 2-22-2023
LST Range 4.700 -- 14.651 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1849
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas 70
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 55 / 198 (27.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 125 / 198 (63.1%)
Redcal Done? ❌
Never Flagged Antennas 72 / 198 (36.4%)
A Priori Good Antennas Flagged 61 / 93 total a priori good antennas:
3, 7, 10, 15, 16, 17, 29, 30, 31, 37, 38, 40,
42, 45, 53, 54, 55, 56, 65, 66, 67, 70, 71,
72, 81, 86, 93, 94, 101, 103, 107, 109, 111,
112, 121, 122, 123, 124, 127, 128, 136, 140,
145, 151, 158, 161, 162, 164, 165, 167, 170,
173, 181, 182, 184, 187, 189, 191, 192, 193,
202
A Priori Bad Antennas Not Flagged 40 / 105 total a priori bad antennas:
4, 8, 22, 35, 43, 46, 48, 49, 50, 57, 61, 62,
73, 82, 89, 90, 114, 115, 120, 125, 126, 132,
133, 135, 137, 139, 220, 221, 223, 228, 237,
238, 239, 241, 245, 320, 324, 325, 329, 333
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_2459998.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% 100.00% 0.00% 8.936531 12.266897 9.555272 10.177354 7.851481 10.152247 0.699884 1.555373 0.029401 0.030662 0.002169
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.970816 -0.227613 2.270874 -0.622615 -0.161600 2.846115 0.664832 -0.902280 0.568043 0.596678 0.403481
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.203948 -0.507448 0.505140 0.323473 0.798286 2.175289 1.214536 1.322743 0.588852 0.592752 0.387732
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.928365 0.293746 -0.905088 -0.075703 0.528789 0.629596 10.907123 17.922667 0.599231 0.611348 0.385677
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.127832 -0.998692 -0.257140 0.272900 0.155465 0.867251 1.783606 2.645559 0.598908 0.610807 0.380492
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.106669 -0.391529 3.075204 -0.798087 0.179218 -0.065895 3.766346 -0.625513 0.572674 0.610987 0.389994
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.191973 -0.361339 -0.187768 -1.050185 1.601252 1.056719 1.184900 0.464126 0.578168 0.608754 0.382825
15 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 9.167484 12.029528 9.024949 9.632443 7.857768 10.165155 0.080046 0.587317 0.027226 0.026206 0.001475
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.189732 -0.481157 9.526580 0.895096 7.856871 2.597585 0.721616 2.289179 0.030914 0.604355 0.482179
17 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 1.147667 11.843620 0.687766 10.187491 1.177115 10.206954 0.404934 1.024047 0.599253 0.038953 0.534578
18 N01 RF_maintenance 100.00% 100.00% 51.22% 0.00% 9.732936 15.498495 9.510845 -0.024692 8.020620 5.682713 0.681140 17.025595 0.029174 0.212490 0.159454
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.670157 -0.176164 -0.735924 0.384197 0.048278 -0.222488 -0.457115 2.242359 0.608221 0.624449 0.381336
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.013455 -1.260853 1.732733 -0.781774 1.392046 0.317015 1.777497 -0.305909 0.601092 0.619230 0.379050
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.148049 0.063911 -0.333233 0.217985 0.865023 0.865742 1.204807 0.829916 0.598514 0.605290 0.375305
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.594682 -0.248917 0.099047 -0.149850 0.678352 1.938959 -0.779232 -0.855589 0.561180 0.578658 0.371508
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.814476 11.446954 9.572733 10.006087 8.028623 10.237712 2.495198 1.817822 0.032875 0.036040 0.004325
28 N01 RF_maintenance 100.00% 0.00% 87.40% 0.00% 8.596694 22.532447 0.600064 3.087388 4.359284 7.078967 5.557629 18.797093 0.352907 0.149631 0.259503
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 9.199946 11.827002 9.201422 9.640461 7.989838 10.224410 0.716364 0.494642 0.029056 0.034615 0.005814
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.763328 0.073207 1.145017 -1.145079 1.622863 0.332104 5.036302 0.211931 0.601874 0.631203 0.387052
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.589653 -0.817183 1.128638 0.952048 2.017624 0.197490 0.755855 7.502734 0.621516 0.625829 0.377042
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 18.700143 21.195412 1.280233 3.052580 3.159119 0.605092 2.611552 5.564207 0.500113 0.506045 0.233107
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.523061 12.848175 4.607700 4.941319 7.931674 10.170391 1.339219 1.175437 0.032713 0.043517 0.007383
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.217391 -0.468721 0.647661 -0.962435 -0.425682 -0.540548 0.397651 0.541870 0.575429 0.570891 0.369933
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.134386 7.780480 1.036067 0.871462 2.579223 2.946483 -0.344675 0.578063 0.579128 0.592497 0.401974
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.476836 22.087909 -0.663762 12.617666 1.230123 10.273261 -0.853639 4.077137 0.596387 0.029512 0.478005
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.383474 0.162866 -1.219273 2.559185 -0.031145 0.482156 3.678357 14.411470 0.601929 0.593642 0.394674
40 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.313568 0.421551 1.879409 2.214467 -0.043783 1.014994 1.698470 69.463698 0.597848 0.600867 0.376085
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.597946 1.274266 1.444719 1.084944 2.634283 0.201290 -0.073560 0.092656 0.610779 0.628150 0.384422
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.657439 1.212290 0.695994 4.714411 1.659684 -0.207815 0.482121 1.812017 0.622964 0.611019 0.381126
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.070207 0.086527 -0.152509 0.768716 -0.904215 1.217834 -1.282096 0.380433 0.620371 0.626759 0.374645
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.151167 0.398479 -1.149572 0.316963 -0.810537 1.021530 -0.815075 -0.156093 0.622623 0.638314 0.378691
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.214710 3.541554 0.530806 0.780556 -0.387812 2.184482 0.291793 21.224131 0.611205 0.622141 0.372902
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.678825 -0.086664 -0.359431 -0.967467 -0.336524 -0.226984 0.157270 -0.328979 0.611200 0.635261 0.388153
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 9.737164 12.553590 4.520468 4.595844 7.909751 10.083047 2.683676 0.658851 0.030583 0.051554 0.014276
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.133336 0.815620 -0.350076 1.384748 -1.040652 2.396548 -0.672886 -1.943562 0.568662 0.594587 0.376191
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.422306 -0.046688 -0.496143 0.160671 -0.331791 -0.178620 0.146355 -0.093157 0.530159 0.571568 0.372287
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.922694 1.352706 0.051734 1.709894 -0.227721 1.767054 -0.045906 0.098603 0.582177 0.591456 0.398591
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.431539 1.598764 0.123779 0.183021 3.761807 2.073243 34.215793 0.650724 0.588666 0.605814 0.394276
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.757544 5.240706 -0.417592 -0.290749 2.274288 1.618988 2.477704 1.411031 0.603577 0.617506 0.391981
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.030792 1.745135 -0.169483 -0.810774 3.416211 2.297541 11.290111 15.230731 0.613656 0.631642 0.393736
54 N04 digital_ok 100.00% 28.50% 0.00% 0.00% 37.648263 17.409639 4.714349 -0.160675 3.169511 3.240291 4.293380 1.502780 0.241132 0.343043 0.163766
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.652580 42.493520 -0.853097 7.239174 2.797551 10.359395 4.415800 0.805995 0.258393 0.036704 0.107387
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 14.842074 15.636735 -0.110856 2.049175 3.174065 4.057680 -0.109663 1.178114 0.367473 0.359330 0.152434
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.973010 1.215537 2.546452 -0.466869 2.243731 0.118230 -1.935966 1.996560 0.622868 0.634961 0.366324
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.575677 11.728893 9.469826 10.107090 7.866705 10.117500 1.843262 1.552688 0.034473 0.034145 0.001730
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.579450 0.827327 9.521191 1.244041 7.696499 2.659631 1.079998 15.278332 0.044056 0.626604 0.491307
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.265232 11.648321 -0.226664 10.136932 0.518058 10.162864 12.009825 3.230424 0.611584 0.066972 0.495985
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.622498 -0.164906 0.069841 -1.027745 1.170796 -1.138530 -0.212265 0.305249 0.549049 0.588087 0.368683
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.421291 0.912565 -0.716697 0.933938 -1.258894 0.126026 1.567894 -1.277766 0.551793 0.592017 0.374871
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.934127 12.118302 -0.394352 4.972069 -0.215583 10.251313 -0.308703 3.031818 0.567708 0.042730 0.458972
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.137082 0.045602 -0.865972 -0.534806 -0.897052 -0.817817 5.505394 0.487532 0.562567 0.558817 0.361155
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 21.093794 19.987338 12.268315 12.368718 8.156339 10.400137 4.689562 6.376948 0.051267 0.026071 0.019581
66 N03 digital_ok 0.00% 0.00% 0.00% 99.95% 0.768669 0.661184 -1.179232 3.332378 2.374906 2.216138 -0.811748 1.507345 0.210689 0.191894 -0.302840
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.189427 -0.548279 -0.943219 1.747475 -0.433368 1.844672 8.260096 2.577580 0.607388 0.612147 0.383415
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 22.909825 0.341130 12.394738 0.689316 7.963638 -0.476291 6.061464 -0.518383 0.031513 0.632712 0.500507
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.037781 -0.347356 0.231445 2.787194 -0.066432 2.153556 1.752434 0.999504 0.620661 0.626283 0.374452
70 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.287491 1.233621 1.624050 3.720136 3.926526 0.801582 5.131131 1.638230 0.246188 0.229894 -0.292266
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 3.493464 -0.334053 0.214775 4.185366 0.974881 -0.425280 -0.470209 0.579450 0.621962 0.623480 0.362439
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 2.725298 0.943411 3.078577 7.200333 -0.478695 2.026068 1.152027 26.803475 0.609455 0.564621 0.369547
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.303179 0.896017 -0.963229 -0.334038 1.290755 1.028833 -0.080865 0.213182 0.631568 0.645199 0.372856
74 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.879261 -0.252030 0.306471 -0.870850 -0.601645 1.298811 -0.561626 4.470152 0.626840 0.639097 0.373872
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 50.901353 21.864061 0.623155 -0.414150 6.408294 3.500235 5.324037 1.423131 0.297379 0.467171 0.276159
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 26.199958 0.630285 -0.350275 1.155564 1.391443 1.098184 0.631338 0.379703 0.417133 0.605306 0.367483
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.691987 12.343692 -1.038521 4.973784 -1.039275 10.043037 0.815757 0.180164 0.573590 0.039042 0.455153
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.395381 13.105207 0.182007 4.887729 -1.010927 10.049963 -0.867501 1.306876 0.586066 0.054864 0.459306
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.204386 12.443976 0.285159 8.859045 0.982906 9.779111 0.166165 2.259169 0.551399 0.037459 0.438434
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.932327 0.937546 -0.696100 -0.452179 0.635804 -0.392007 -0.472666 -0.013198 0.587353 0.606478 0.392055
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.013455 0.053633 0.390589 0.631703 0.949693 0.344921 0.299317 1.072009 0.592781 0.604087 0.381287
84 N08 RF_maintenance 100.00% 71.93% 100.00% 0.00% 17.330432 22.125863 12.032177 12.677362 6.320798 10.132770 4.584018 4.861463 0.191095 0.034882 0.126825
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.066787 0.279035 0.210295 -1.173294 -0.998508 0.250741 -1.560908 -0.676095 0.621770 0.636950 0.378307
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.210861 0.964179 -0.135367 -0.040628 2.272468 0.755175 1.654316 14.367856 0.610765 0.634211 0.362760
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 14.108282 3.786323 0.210578 -0.156329 12.086667 2.344380 68.366818 45.171581 0.556305 0.642370 0.346958
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.068347 0.614976 0.573856 1.051646 0.400820 -0.640514 -0.515388 -0.204411 0.624031 0.640969 0.361802
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.748522 0.334269 0.406648 1.023881 -0.838989 0.136918 -0.560480 -0.130678 0.623282 0.641858 0.366287
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.257828 -0.179247 -0.987308 -0.405904 -0.159203 -1.161204 -0.044821 1.320064 0.628170 0.649285 0.373367
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.308315 0.019822 0.668159 0.488020 -0.141568 -0.065273 -0.251796 -0.064148 0.610354 0.639389 0.377894
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.009497 0.294702 9.464257 0.520166 8.056998 2.074046 0.508294 1.016891 0.034258 0.639716 0.430759
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.288126 11.929962 9.583769 10.196922 7.810133 10.077726 2.374811 2.125250 0.029167 0.024938 0.002238
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.864427 12.142481 9.693755 10.016812 7.962564 10.154257 2.814390 0.796873 0.025224 0.025153 0.000946
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.142315 1.658553 -0.769362 0.640963 2.694440 2.192304 -0.127961 -0.359970 0.428166 0.443837 0.207184
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 4.082047 17.039216 3.103195 1.374018 3.048724 2.643029 -2.870437 -1.570595 0.584137 0.491656 0.355046
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.019347 3.537899 -1.108396 0.919990 -1.079316 0.966526 3.218479 13.341289 0.565952 0.542450 0.366040
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.422107 6.394531 -0.105905 1.235261 0.607999 1.619889 -0.041339 -0.152444 0.611463 0.622632 0.375621
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.861917 0.667688 -0.742382 -1.141914 0.433820 1.091473 -1.023317 9.844190 0.616467 0.636784 0.375211
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.985183 2.999682 1.507672 -1.061489 -0.428226 0.694383 1.248293 17.993034 0.622163 0.635344 0.363636
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.361207 51.733933 -0.318861 6.753470 2.555919 0.364266 2.383689 0.192298 0.627199 0.616070 0.365549
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.205845 0.159634 0.369394 1.053441 1.301460 -0.113628 -0.159312 -0.152201 0.627663 0.642999 0.363222
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.199440 -0.733394 -0.550736 -0.154324 0.123397 -0.836290 0.698533 -0.421649 0.628985 0.635812 0.361245
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 6.549251 1.017906 0.066568 -0.295664 0.788409 0.293147 4.751946 3.508044 0.619195 0.647505 0.365168
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.058365 36.557096 9.505862 1.044969 7.924054 3.542085 1.677353 2.230131 0.033641 0.290927 0.157910
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 8.888857 11.721620 9.550884 9.899216 8.038066 10.254914 0.400792 2.029686 0.049997 0.032077 0.010650
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.533189 12.200496 6.299688 0.241611 6.399338 0.220846 1.487795 -0.329127 0.507277 0.592041 0.340368
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 28.544985 11.650891 1.290522 9.982610 1.467061 10.242129 3.072837 2.313136 0.474821 0.057568 0.318423
112 N10 digital_ok 100.00% 60.52% 98.70% 1.30% 2.278557 11.498418 6.935453 10.063277 0.703171 10.009997 0.267439 0.807323 0.196197 0.068250 -0.106660
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.684516 12.861670 4.271412 4.967429 7.762356 10.007812 1.726179 0.829206 0.033250 0.031228 0.001233
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 3.389949 0.661418 -0.006323 -0.136760 3.645710 -0.675131 0.316512 -0.869646 0.555998 0.594684 0.378660
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.159219 -0.803016 -1.062709 0.006323 -1.040713 -0.555564 -0.434030 1.863560 0.554679 0.582992 0.384743
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.765317 13.020051 9.609594 10.421055 7.750640 10.092417 1.104220 3.889327 0.027786 0.030664 0.001998
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.403898 1.305962 0.184777 0.708605 -0.629082 0.768069 0.309809 0.831115 0.589219 0.608984 0.385811
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.348893 1.437345 2.727248 -0.741723 -0.225080 1.203035 3.322267 -0.034623 0.603155 0.636008 0.378335
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.335599 2.733558 -1.108087 5.584327 0.188049 -0.455267 11.641041 16.739657 0.623120 0.614780 0.361558
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.436236 5.883679 -0.873342 -1.010154 0.263020 1.006198 -0.568501 -0.837814 0.629025 0.650809 0.371148
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.415751 7.853183 0.932878 1.178782 0.978966 0.650118 -0.361464 0.650357 0.634887 0.651967 0.371038
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 9.143567 0.120104 9.743539 0.748491 7.726665 0.877840 0.492488 0.409210 0.039256 0.650578 0.457800
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.428302 -0.090928 0.710933 0.997754 1.936396 1.237239 3.796980 3.964216 0.628217 0.637192 0.367472
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.121407 -0.909522 -0.499481 1.079985 1.298866 0.389492 1.002942 -0.018597 0.629410 0.640666 0.371474
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 8.718638 0.227358 9.461293 0.647971 8.031964 1.317337 0.195573 0.383267 0.032421 0.647112 0.429018
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.140183 -0.489851 -1.092395 -0.329050 -0.077358 0.985864 1.505478 6.267962 0.631195 0.645560 0.384792
131 N11 not_connected 100.00% 0.00% 12.44% 0.00% -0.565179 11.467942 -0.111486 4.845214 -0.335380 9.039108 -1.239049 0.597234 0.589465 0.262879 0.422890
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.903739 0.235142 -0.336024 -1.165780 -0.506575 -0.789389 0.346730 -0.168208 0.575382 0.585610 0.371862
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.175534 -1.164023 -1.225246 -0.478661 -0.763766 -0.959582 -0.060593 1.960087 0.556416 0.587766 0.388545
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.014691 12.815651 4.398996 4.936493 7.758044 10.043939 0.451011 1.104350 0.039319 0.033942 0.003080
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.276091 -0.914648 -0.862647 -1.234665 2.061311 1.207733 1.519144 0.013198 0.558901 0.594222 0.400697
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 8.300419 -0.079840 9.183746 -0.449278 8.030806 0.687268 1.565751 -0.015878 0.037971 0.593149 0.442558
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.194601 -0.337506 0.281461 -1.237727 1.940421 -0.001608 0.735147 1.133084 0.574930 0.607211 0.388200
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.197555 1.342728 1.186868 -0.941130 0.421022 -0.359026 -1.847791 -0.492085 0.600661 0.601725 0.365483
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.727039 -0.940569 -0.477116 -0.340281 -0.359921 -0.581375 5.093316 4.596974 0.618690 0.637756 0.371719
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.087486 -0.066436 -0.589587 0.834405 1.394691 0.455986 0.138547 -1.450165 0.619234 0.641877 0.370179
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.369642 11.705187 -0.483678 10.144930 2.700625 10.204106 23.118349 1.841567 0.624974 0.043589 0.515779
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.724569 11.736201 9.395949 10.105374 7.382223 10.238835 0.244660 1.620620 0.093955 0.029313 0.050044
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.696678 0.699986 -0.791100 3.134145 0.048693 -0.184223 -0.601953 0.269551 0.633837 0.634441 0.372076
145 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.285445 -0.483947 1.839457 0.574799 0.007484 4.770653 0.217796 -0.075678 0.622125 0.650499 0.376155
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.355329 0.491339 -0.943208 -0.157087 -0.761459 -0.287501 -0.499421 0.352077 0.606980 0.631190 0.369630
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.305106 -0.976335 1.935408 2.410415 -0.073645 0.001608 2.854109 0.449309 0.615446 0.628224 0.371126
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.719917 0.195542 -0.286075 -0.348283 1.964204 2.035721 -0.307301 -0.408545 0.623002 0.642318 0.388119
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.445515 -1.107249 -0.433036 -1.159606 -0.119401 0.977955 0.650770 1.308889 0.616478 0.633288 0.389818
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.263901 2.542245 -1.130648 -1.121960 -0.579817 -0.416498 -0.209501 -0.372555 0.613478 0.609899 0.381648
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 20.481238 0.796470 -0.388752 0.685520 1.757984 -0.573793 0.620692 0.899437 0.451229 0.561763 0.337361
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 8.633113 -0.551432 9.326289 -0.843553 8.049537 0.126885 2.107756 2.272246 0.039535 0.596669 0.456752
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.361867 11.566802 7.581654 9.940300 2.598345 10.276423 6.166875 2.245395 0.429282 0.037481 0.337878
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.616143 -0.080772 0.284916 0.891850 0.228329 1.185582 -0.342286 0.322747 0.584050 0.607272 0.386946
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.309583 -0.100576 -0.009757 -0.025716 2.638483 2.252499 7.545724 23.861341 0.597241 0.620431 0.386913
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.381368 24.558610 -1.060495 -0.429527 -0.838076 2.041503 -0.530124 0.129768 0.570872 0.460365 0.340328
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.162081 -0.743519 -0.192574 -0.397205 -0.023899 1.804838 -0.517136 1.019308 0.610896 0.632982 0.377704
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.387318 26.268092 0.258098 -0.122347 0.579095 0.894666 -0.263376 0.602161 0.616575 0.508210 0.341197
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.266642 -1.181371 -0.048556 -1.005830 0.696879 0.878412 6.499025 0.013398 0.629728 0.647107 0.374752
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.681987 1.478350 0.107335 0.581997 0.491084 1.723142 -0.145480 1.647673 0.631046 0.647405 0.378048
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.524398 0.184246 0.030583 1.438826 1.085828 2.147761 5.180380 1.450312 0.628475 0.637182 0.367321
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 24.445304 0.323415 -0.191049 -0.575322 4.226942 0.296725 5.731919 -0.175146 0.497874 0.646508 0.363275
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.743258 0.151703 0.834342 0.563359 0.688416 -0.205585 0.544120 -1.485406 0.626287 0.647312 0.367768
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.643515 -0.735938 -1.046302 -0.646960 1.501302 0.172308 -0.409048 5.172767 0.628439 0.643639 0.378418
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.629548 -0.877813 0.399329 -0.075036 1.926281 1.111705 -0.400499 2.008027 0.621534 0.636334 0.384681
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.314459 -0.881528 -0.559278 -1.235344 1.139780 0.620230 -0.715861 -0.680885 0.619764 0.636249 0.388126
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 9.714734 -0.374367 9.796012 -0.543963 7.767684 -0.024817 2.580043 12.490991 0.038587 0.629291 0.491211
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.725857 1.374710 -0.717323 0.424936 -1.043298 0.721223 -0.218251 1.746938 0.561759 0.558293 0.358665
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 10.885499 12.410224 4.044716 4.632747 8.091764 10.277069 3.053390 6.616153 0.034771 0.039973 0.003600
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.368036 -0.412303 -0.793202 -0.185618 -1.070698 1.628691 -0.640018 22.990185 0.593080 0.616893 0.386088
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.014916 12.287697 -1.145027 10.260256 1.435260 10.089348 24.851731 2.480153 0.611575 0.049657 0.509967
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.847273 0.203576 1.209398 0.720060 0.338173 0.550308 -0.213357 5.056402 0.613695 0.631811 0.381932
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.050719 11.469928 -0.823364 9.881916 -0.377191 10.301299 10.201294 2.470228 0.626058 0.045307 0.482030
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.082132 0.690770 0.278855 0.895890 1.729615 0.156624 0.825948 0.403186 0.616799 0.634139 0.368737
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 21.087644 -0.055051 5.929544 -0.923019 10.011183 0.744356 11.464882 -0.057948 0.434742 0.643059 0.384500
185 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.239540 -0.066659 3.160213 0.690868 3.894801 -0.064574 -1.855927 0.105604 0.599757 0.643070 0.381586
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 2.297876 -0.554037 0.265061 -0.328326 -0.463154 -0.576911 0.069075 -0.783661 0.611252 0.647485 0.378217
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 7.390578 -0.596582 8.882935 -0.236035 6.022726 2.156607 0.823949 0.099660 0.276523 0.639370 0.451244
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 8.164847 11.371208 9.167405 10.004636 8.215468 10.318920 4.980251 3.097108 0.028157 0.030797 0.001194
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.656405 -1.287992 -0.304079 0.221045 0.153148 -0.250059 -0.203403 -1.254255 0.608556 0.629336 0.393151
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 0.120855 -0.249150 1.407445 -0.148567 0.942939 0.950889 9.538270 1.298714 0.586955 0.606655 0.384254
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 2.084967 5.740204 2.154954 3.877088 1.748603 7.998172 -0.113898 -3.580715 0.572050 0.556304 0.381835
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.384714 0.406998 4.076735 0.894028 6.021739 1.656767 -3.860315 -0.225097 0.538767 0.576398 0.400692
200 N18 RF_maintenance 100.00% 100.00% 58.79% 0.00% 10.517249 33.475821 4.415559 -0.049312 8.053304 4.803571 1.489997 5.896088 0.040118 0.211531 0.140986
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.707727 4.242213 2.529926 3.382516 1.817641 6.577728 -0.844487 -2.785165 0.594006 0.597348 0.374190
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.705331 2.321304 1.269390 -1.148868 0.169845 0.276522 -1.381878 30.214959 0.606145 0.600364 0.368020
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.866459 13.470266 1.377859 -0.817637 -0.520635 0.558461 14.176720 1.077141 0.610150 0.639627 0.379970
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.555513 0.797691 3.118928 -0.748114 4.974556 -0.535768 37.199173 6.638331 0.367042 0.612649 0.439093
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.190478 5.242656 -0.436931 2.479416 6.379523 2.959871 0.074479 0.739796 0.569192 0.501112 0.368212
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.649740 1.646805 -0.711764 -0.177468 -1.121286 -0.640007 8.645377 0.331024 0.594395 0.588030 0.365308
208 N20 dish_maintenance 100.00% 98.92% 98.81% 0.00% nan nan inf inf nan nan nan nan 0.401015 0.372129 0.246956
209 N20 dish_maintenance 100.00% 98.81% 98.59% 0.00% nan nan inf inf nan nan nan nan 0.438070 0.520132 0.405859
210 N20 dish_maintenance 100.00% 98.65% 98.59% 0.00% nan nan inf inf nan nan nan nan 0.479221 0.465073 0.192501
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.099571 12.150920 -1.225535 4.994327 -0.650788 10.065050 0.153282 1.313834 0.556755 0.038314 0.481230
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.968438 -0.896528 0.306026 -0.435667 -1.031540 -0.824277 2.324691 -1.116092 0.596651 0.602945 0.373627
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.924281 -0.508856 -0.904010 -0.680822 0.465849 -1.046983 3.056783 -0.462108 0.579965 0.611011 0.375585
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.213303 -0.146105 -0.233863 0.064182 -0.102436 -0.748416 4.724496 -1.280620 0.590899 0.617224 0.374853
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.988535 -0.213860 -1.026019 0.316529 -1.368942 -0.633423 1.157536 1.642301 0.581355 0.620564 0.381680
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.591289 5.212334 4.292890 3.825285 6.386155 7.725734 -3.747871 -2.694171 0.566787 0.590388 0.370243
225 N19 RF_ok 100.00% 0.00% 90.32% 0.00% -0.435133 11.708280 0.542114 4.774911 -0.571828 9.878399 -1.323641 1.780768 0.599729 0.135842 0.495082
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.562572 19.695243 -0.570773 0.361409 -0.954953 3.843095 -0.895579 -0.738267 0.590009 0.492262 0.358033
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 3.238023 -0.166928 2.062188 -1.206738 0.427341 -0.691915 9.580685 4.848106 0.478219 0.588203 0.404686
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.518040 0.202045 0.765822 -1.223706 -0.191643 -0.978051 0.824733 1.895592 0.568533 0.573603 0.369228
229 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.243988 0.501391 0.558888 1.127756 -0.664866 1.105238 7.714767 -1.941611 0.570542 0.585404 0.390802
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.935708 -0.296721 0.228046 -1.222771 -0.486467 -0.455654 0.232919 -0.663555 0.531591 0.585515 0.388736
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.106735 -0.453821 0.718666 0.336261 -0.673851 -0.345830 -1.640473 -1.673481 0.587107 0.603821 0.383032
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.824571 -0.808305 -0.256907 -0.029079 -0.518097 -0.741572 -0.144957 0.327153 0.588456 0.604323 0.380096
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.370269 0.023400 -0.397154 -0.895620 -0.721116 -1.253059 15.045274 7.356023 0.583550 0.602013 0.379641
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.944595 -1.009913 -0.375266 0.045962 -0.630716 -0.693456 0.812920 -0.846944 0.582283 0.608155 0.388135
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 20.646187 0.423949 -0.227385 0.985028 1.574666 0.830729 -1.211406 -0.051524 0.445403 0.604309 0.383675
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 18.965366 -1.006053 0.851967 -1.180011 2.243730 -0.222856 -0.550485 0.341130 0.455624 0.586151 0.379270
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.539675 -0.815740 -0.554083 -1.092379 -0.681557 -0.455635 4.295554 8.570074 0.540818 0.590061 0.385696
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.696917 0.231475 0.471040 -1.046500 -0.682456 -0.932092 -1.824659 0.797421 0.569127 0.582103 0.380705
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.187904 12.691682 -0.775123 4.532914 -0.665446 10.237978 -0.225679 0.317435 0.555987 0.037378 0.479157
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% -0.078875 1.727826 0.145530 -0.340148 0.082934 -0.441746 10.259812 7.069649 0.562598 0.558346 0.374187
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 9.868388 12.415378 4.870300 4.994016 -0.317941 -0.173125 0.277357 3.381003 0.544580 0.556144 0.383715
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.448868 1.426241 2.098370 0.961747 0.831663 0.265320 -2.176481 1.157243 0.493744 0.512601 0.386268
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 2.479924 2.394523 1.108620 1.151721 0.580499 1.383838 -1.513909 -1.797253 0.469872 0.492591 0.365582
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.005862 -0.824335 0.908134 -1.217181 -0.045500 -1.029718 -1.729023 0.561352 0.503781 0.508006 0.380259
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.437326 -0.161831 -0.974369 -1.037062 -0.471162 -0.598246 0.677472 -0.585633 0.470356 0.495405 0.367138
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.725431 3.418674 -0.544429 -1.065152 -0.340214 -0.301472 3.381177 0.139160 0.451145 0.473213 0.349331
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, 7, 10, 15, 16, 17, 18, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 51, 52, 53, 54, 55, 56, 58, 59, 60, 63, 64, 65, 66, 67, 68, 70, 71, 72, 74, 77, 78, 79, 80, 81, 84, 86, 87, 92, 93, 94, 95, 96, 97, 101, 102, 103, 104, 107, 108, 109, 110, 111, 112, 113, 117, 121, 122, 123, 124, 127, 128, 131, 134, 136, 140, 142, 143, 145, 151, 155, 156, 158, 159, 161, 162, 164, 165, 167, 170, 173, 179, 180, 181, 182, 184, 185, 187, 189, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 222, 224, 225, 226, 227, 229, 240, 242, 243, 244, 246, 261, 262]

unflagged_ants: [4, 5, 8, 9, 19, 20, 21, 22, 35, 41, 43, 44, 46, 48, 49, 50, 57, 61, 62, 69, 73, 82, 83, 85, 88, 89, 90, 91, 105, 106, 114, 115, 118, 120, 125, 126, 132, 133, 135, 137, 139, 141, 144, 146, 147, 148, 149, 150, 157, 160, 163, 166, 168, 169, 171, 183, 186, 190, 220, 221, 223, 228, 237, 238, 239, 241, 245, 320, 324, 325, 329, 333]

golden_ants: [5, 9, 19, 20, 21, 41, 44, 69, 83, 85, 88, 91, 105, 106, 118, 141, 144, 146, 147, 148, 149, 150, 157, 160, 163, 166, 168, 169, 171, 183, 186, 190]
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_2459998.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.2.1
In [ ]: