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 = "2460048"
data_path = "/mnt/sn1/2460048"
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: 4-13-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/2460048/zen.2460048.42108.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 361 ant_metrics files matching glob /mnt/sn1/2460048/zen.2460048.?????.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/2460048/zen.2460048.?????.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 'startTime' 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 2460048
Date 4-13-2023
LST Range 12.989 -- 14.929 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 361
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 40, 42, 70, 112
Total Number of Nodes 19
Nodes Registering 0s N15
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 61 / 198 (30.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 111 / 198 (56.1%)
Redcal Done? ❌
Never Flagged Antennas 85 / 198 (42.9%)
A Priori Good Antennas Flagged 59 / 93 total a priori good antennas:
7, 15, 17, 19, 20, 29, 31, 37, 38, 40, 42,
45, 53, 54, 55, 56, 65, 66, 70, 72, 81, 83,
85, 86, 93, 94, 101, 103, 109, 111, 112, 118,
121, 124, 127, 136, 140, 147, 148, 149, 150,
151, 158, 160, 161, 165, 167, 168, 169, 170,
181, 182, 183, 184, 187, 189, 190, 191, 202
A Priori Bad Antennas Not Flagged 51 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 50, 52, 57, 61,
62, 64, 73, 74, 79, 80, 89, 90, 95, 102, 113,
114, 115, 120, 125, 132, 133, 139, 179, 185,
201, 206, 220, 221, 222, 224, 228, 229, 237,
238, 239, 240, 241, 244, 245, 261, 320, 324,
325, 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_2460048.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
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.894827 10.869999 -0.948056 -0.577571 -0.929329 5.126244 -0.720314 48.936514 0.627888 0.518404 0.437263
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.373211 0.332523 0.477263 2.896560 0.941597 1.905709 -0.043311 1.409914 0.631536 0.618194 0.439501
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.427392 -0.037325 -0.285570 0.310687 0.989617 -0.109131 5.218616 8.429704 0.638714 0.628611 0.431146
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.757409 1.461760 1.001264 0.980059 0.292528 0.273686 -2.117262 -1.791738 0.618280 0.609081 0.419278
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.760311 -0.318909 2.897527 -0.199160 -0.006460 -0.071162 1.228055 -0.135197 0.620474 0.629673 0.423640
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.804049 -0.311166 -0.417593 -0.362641 -1.045603 1.134822 2.039795 0.754014 0.628359 0.615947 0.429668
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 11.080599 -0.328661 -0.546721 -0.367938 -0.418163 0.056008 -0.089510 0.994422 0.518982 0.640954 0.421262
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.183577 1.038643 0.150238 0.732640 -0.825519 -0.174933 -1.544618 -1.933208 0.638118 0.630532 0.433106
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.052921 2.462442 0.948120 7.281240 0.497842 -0.511683 0.136505 3.650299 0.633794 0.497798 0.465062
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.660729 4.806086 0.941730 1.280966 0.564329 1.301782 6.235135 15.987893 0.622340 0.432934 0.480329
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.037631 -0.055635 -0.033548 1.569791 0.064340 47.873538 0.092067 24.632911 0.650345 0.641491 0.426360
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.329363 -0.837099 1.229212 -0.223831 7.929655 0.189714 2.024140 0.150371 0.642944 0.646107 0.419699
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.475511 0.391694 0.206797 0.355120 0.901253 0.218568 0.046184 0.188609 0.635317 0.631880 0.416640
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.155388 -0.808554 -0.909722 -1.003135 -0.830382 -0.747921 -0.205566 -0.381563 0.611814 0.614998 0.422765
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.486801 18.501769 8.189652 5.217503 1.419183 2.375057 3.896706 64.499788 0.068555 0.070690 -0.057335
28 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.293079 10.836430 8.318770 3.496637 1.836037 1.697459 1.447229 17.632948 0.031359 0.329373 0.262285
29 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.651912 -0.034646 0.011018 0.236321 1.219061 0.270343 0.917736 4.651458 0.663197 0.651221 0.427606
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.248439 -0.710972 0.456752 -0.474183 2.402189 0.211519 1.173600 -0.063663 0.657671 0.657404 0.421094
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.578107 -0.061325 1.193826 2.595406 1.392375 1.185550 0.413047 14.943028 0.667166 0.646370 0.428900
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.717670 12.916115 0.094192 0.147484 -0.047899 0.623931 2.564290 4.675619 0.562173 0.575373 0.229831
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.206781 -0.612465 4.736673 -0.762035 1.787534 -1.015888 0.876325 0.424563 0.045217 0.624459 0.469009
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.157306 -0.897709 -0.123360 -0.655017 -1.297417 -0.317551 -1.497199 -0.238347 0.618889 0.610855 0.422055
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.358360 4.081963 1.171772 0.846356 2.004754 1.548705 0.403880 1.068018 0.630665 0.627543 0.443902
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.500124 15.248564 -0.979459 10.717610 0.002328 1.624508 -0.688028 3.611213 0.639573 0.033137 0.527313
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.127716 -0.133478 0.054908 0.329649 1.107583 0.124588 3.724381 8.634344 0.650001 0.639513 0.438570
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.421051 1.733447 0.210548 -0.037001 0.405125 1.518568 17.334586 2.085527 0.224007 0.221553 -0.330420
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.476277 0.736939 1.335395 1.815900 0.974719 0.071186 0.068722 0.445372 0.655689 0.655725 0.423523
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% 0.046109 2.263982 -0.131126 -0.354115 0.619368 1.253672 -0.287188 0.201981 0.244973 0.226549 -0.327118
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.726590 0.053716 -0.987101 0.840297 -0.589073 0.621744 -0.804463 1.011987 0.656050 0.659293 0.420818
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.381149 0.470269 -0.455873 0.571218 -0.202832 0.741990 -0.526927 0.103179 0.671433 0.670857 0.425067
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.906977 1.135502 0.927821 0.834957 0.415953 0.751179 0.283326 4.224665 0.657957 0.653545 0.416555
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.018373 -0.467242 0.291978 -0.793394 0.187814 -0.634401 -0.074362 -0.290828 0.649325 0.660196 0.422342
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 6.664790 8.589681 4.668115 4.709448 1.815947 1.561140 1.977654 0.707092 0.030999 0.055889 0.017128
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.475334 -0.118358 -0.977156 -0.026205 -1.026975 -0.491004 -0.855091 -1.373885 0.628982 0.629417 0.414465
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.434574 -0.634417 0.241406 -0.660393 -0.053112 -0.170175 -0.050097 -0.087230 0.595456 0.605967 0.408670
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.373474 0.675340 0.652440 1.540774 0.634004 1.824333 0.162047 0.688217 0.619678 0.614727 0.430668
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.023694 0.643280 0.392951 -0.176183 2.360043 0.888847 83.483150 1.281332 0.628741 0.633239 0.425730
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.461664 2.863280 0.676232 0.432563 1.877024 1.162618 3.175701 0.870050 0.650663 0.644968 0.430872
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.110599 0.285001 0.095047 -0.842079 0.423767 -0.118967 8.344127 5.478891 0.657463 0.654421 0.428886
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.351992 1.328907 0.617142 -0.737847 -0.165079 3.386719 -1.195329 -0.459971 0.367503 0.423952 0.191177
55 N04 digital_ok 100.00% 2.22% 100.00% 0.00% 0.518898 30.265183 -0.139053 6.118688 -0.592333 1.798408 1.594247 0.718246 0.247457 0.042607 0.078555
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.201903 1.143525 -0.862431 2.047177 0.109396 5.480364 -0.713974 5.339348 0.657851 0.651319 0.413362
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.228965 -0.268503 -0.967016 -0.232918 -0.551777 1.289783 -0.405262 1.292356 0.666796 0.661247 0.415794
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.901490 8.073075 8.339781 8.801323 1.784617 1.562550 1.204679 1.252236 0.039176 0.038531 0.002141
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.586337 0.560905 8.364787 1.016343 1.720076 2.269331 0.546759 5.019839 0.047281 0.660545 0.507026
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.542774 8.036803 0.357609 8.824116 0.518734 1.590248 0.588490 2.504477 0.649156 0.086737 0.528344
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.102469 -0.673532 1.077557 -0.289169 -0.905858 -0.742592 0.197424 0.753741 0.608649 0.633435 0.410783
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.228580 0.066360 0.591685 -0.142218 -0.535322 -0.978977 0.878002 -1.091977 0.615946 0.635504 0.411819
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.565079 8.310112 -0.904039 5.001891 -0.811618 1.639765 -0.071492 2.414616 0.631969 0.045460 0.503176
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.625742 -0.411372 -0.718025 0.096833 0.217861 -0.193450 -0.018016 0.240683 0.611283 0.607095 0.415939
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 14.465385 13.993019 10.488382 10.535256 1.789054 1.704944 3.929565 5.171661 0.023654 0.033384 0.009956
66 N03 digital_ok 100.00% 24.65% 100.00% 0.00% 1.736446 14.383491 0.755479 10.652607 0.280869 1.667695 -1.988003 5.478051 0.216734 0.048119 0.094951
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.594548 -0.149561 -0.438625 0.859880 0.420393 1.475724 3.777407 2.190211 0.637759 0.634424 0.421435
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 15.398586 -0.344614 10.544051 -0.317189 1.692612 -1.167165 4.408315 -0.424165 0.034694 0.649914 0.525161
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.741414 -0.421039 1.371601 -0.345135 0.681377 1.398469 3.728541 0.250169 0.656659 0.664631 0.424364
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% 0.038849 2.233100 1.089839 2.499890 0.621350 3.134962 3.336564 1.230045 0.250233 0.223065 -0.311123
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.962416 -0.205997 -0.077851 0.415555 0.528181 0.564150 -0.415682 1.447664 0.673040 0.666749 0.414195
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.068940 7.805586 1.941994 8.836270 0.990709 0.716933 5.314486 1.154753 0.273100 0.098001 -0.055649
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.376558 1.139872 -0.345302 1.017208 0.861935 2.342089 -0.158267 0.379509 0.679252 0.669036 0.425187
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.707241 0.004683 -0.873065 -0.001521 0.463187 2.890738 -1.041956 0.744646 0.675806 0.667877 0.423059
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 23.013863 8.038245 -0.010524 -0.684723 12.932970 0.309593 36.843359 1.959882 0.432460 0.553230 0.279044
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 14.193793 -0.115240 0.103308 -0.025916 -0.279215 -1.038707 2.547365 -0.826826 0.490778 0.637619 0.371980
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.289416 -0.743956 0.956049 -0.634253 -0.576697 -0.188946 1.471612 -0.418116 0.599854 0.623031 0.414139
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.816724 1.084499 -0.745074 0.801923 -1.140048 -0.031372 -0.589873 -1.769832 0.625202 0.612980 0.426266
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 87.424247 23.591117 23.966406 17.948819 30.569500 23.055955 472.944464 312.596035 0.017681 0.016582 0.001104
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 18.457440 38.141169 17.567239 20.302407 12.673744 32.892000 226.851551 441.321728 0.016604 0.016263 0.000779
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 26.673215 32.512203 20.903989 22.522921 35.905718 36.004485 546.210801 615.218969 0.016235 0.016168 0.000717
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.511117 15.564335 0.400139 10.720453 -0.748967 1.519870 -1.880187 4.203007 0.641197 0.051681 0.506826
85 N08 digital_ok 100.00% 0.00% 0.00% 0.00% -0.885303 -0.261089 -0.660618 -0.484885 4.448904 -0.037113 0.325017 -0.153598 0.657930 0.655922 0.418181
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.486924 0.403868 0.856043 0.290007 -0.448652 1.232399 0.281260 16.215560 0.663416 0.653631 0.405988
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.082262 2.352947 2.597440 -0.837093 20.950481 0.581599 35.260885 1.090002 0.573072 0.673053 0.382644
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.423561 1.119472 0.879555 1.307989 0.999179 0.411477 1.035990 0.925748 0.669159 0.662579 0.401779
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.673641 0.362405 0.866695 1.109478 0.583462 -0.158324 -0.105771 0.324671 0.665404 0.659569 0.408384
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.327500 -0.719670 0.107735 -1.007568 -0.405535 -0.578945 0.016155 0.939230 0.658835 0.668181 0.411187
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.086688 0.350642 1.012813 0.790539 0.470014 0.080842 0.396217 0.451343 0.651911 0.662786 0.414348
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.332936 0.107565 8.357731 0.502304 1.836489 1.082037 0.477133 1.260849 0.037006 0.662066 0.478023
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.442577 8.222936 8.419621 8.865237 1.788697 1.566938 2.044364 1.981900 0.032110 0.025351 0.003301
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.836475 0.623219 8.504035 5.881111 1.794081 1.598352 0.894138 0.571370 0.029596 0.586662 0.415212
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.949441 -0.636598 0.193285 -0.550289 -0.232176 -1.141105 -0.099822 -0.541913 0.611540 0.640602 0.423627
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.048558 11.564717 -0.014386 -0.567367 -1.349928 -0.016592 -1.456865 4.805693 0.630226 0.549627 0.406018
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.091404 1.357013 -0.831224 0.664571 0.372448 -0.615842 -0.701763 7.254773 0.609471 0.594096 0.417346
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.934255 4.216408 0.408251 1.143896 0.359772 0.374124 0.092794 1.491138 0.649060 0.646580 0.420199
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.885986 0.123049 -0.948526 -0.486372 0.317222 0.623202 -0.873213 3.257543 0.661120 0.656700 0.414810
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.522950 2.367632 0.063297 -0.680267 25.846908 0.398080 3.009178 3.035752 0.658781 0.660064 0.405156
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.444688 32.475062 0.919396 5.354114 -0.046927 0.904663 0.598113 2.582453 0.663406 0.650042 0.412130
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.177587 0.587404 0.672749 1.208729 1.370100 0.895048 0.305243 0.738717 0.674178 0.670954 0.409569
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.270564 0.787835 0.643987 0.404010 2.642617 0.081119 0.404434 1.079463 0.662217 0.665766 0.402751
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.633880 0.145855 0.168471 -0.390405 0.798938 0.472901 2.607511 2.311655 0.659116 0.662534 0.403140
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.418087 1.517814 1.369598 2.171130 -0.131545 1.005956 11.977585 0.881997 0.652338 0.662676 0.412079
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.101609 8.118944 8.409885 8.661096 1.777949 1.625836 0.550026 1.853969 0.073317 0.037974 0.027392
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 18.033012 -0.184462 0.753644 0.092876 1.583908 0.670396 0.988462 -0.027269 0.559381 0.667874 0.359537
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 2.504233 8.066589 0.858887 8.722632 6.804115 1.597954 41.757807 2.142616 0.633307 0.070789 0.496183
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% -0.382286 3.826332 1.382068 7.625940 0.677728 -0.621092 0.965373 0.773656 0.226278 0.144271 -0.272277
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.803893 2.237661 1.486599 1.442485 0.848853 0.973374 -2.818853 -2.523372 0.615938 0.602814 0.418098
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.164019 3.233748 1.188079 3.344995 0.298856 1.669651 -2.214179 1.020641 0.594159 0.522041 0.408266
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.948902 -0.969768 -0.475925 -0.689064 -0.907849 -1.068635 -0.427196 -0.635067 0.606584 0.607878 0.416496
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 19.587345 27.724492 17.607384 19.719582 18.344640 29.340775 306.063721 382.525403 0.017368 0.016379 0.001175
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 19.488659 22.112084 18.277701 19.246346 22.572554 17.819314 357.982122 345.350724 0.016451 0.016324 0.000819
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.923085 0.689399 2.481918 -0.294206 0.752731 0.254090 0.499082 -0.192372 0.649431 0.653941 0.410741
121 N08 digital_ok 100.00% 0.55% 0.00% 0.00% 1.292813 1.831934 0.842890 4.794358 0.051824 0.441406 0.036487 12.448056 0.592863 0.642242 0.413478
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.149280 2.691324 0.042496 -0.531742 0.398000 0.282940 -0.217448 -0.338727 0.677519 0.671606 0.414748
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.458698 1.609793 1.312699 0.203981 0.587298 -0.344180 -2.417574 -1.324420 0.647016 0.664467 0.407365
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 6.306970 0.069958 8.531625 0.858995 1.746449 0.630321 0.599729 3.776512 0.043167 0.671732 0.473166
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.138655 1.202475 2.037390 1.220558 -0.317372 0.006460 0.596535 0.537619 0.664675 0.664759 0.409619
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.384425 0.293308 0.478741 1.108941 -0.525865 0.726397 6.426276 0.397812 0.665927 0.666642 0.416479
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.127355 -0.856723 8.352079 -0.996859 1.828402 0.829341 0.384565 -0.033157 0.037676 0.664842 0.477701
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.380255 -0.910538 -0.209129 -0.757213 -0.200889 -0.316416 1.348194 2.005014 0.653467 0.655168 0.428101
131 N11 not_connected 100.00% 0.00% 7.20% 0.00% -1.103532 7.817935 -0.858503 4.883918 -0.211746 0.959524 -0.834694 0.615040 0.645299 0.305907 0.485962
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.222359 -0.425925 -1.014433 -0.430615 -0.457039 0.742182 -0.229606 0.025506 0.619556 0.613693 0.417477
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.146712 -1.233094 -0.412356 -1.015788 -0.829423 -0.880612 -0.450239 -0.074184 0.611783 0.616849 0.419600
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 7.126265 9.182471 4.165206 4.566496 1.727884 1.617577 0.526854 1.072234 0.031456 0.035888 0.002228
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.746985 -1.002697 -0.422044 -0.656142 3.624574 0.429053 4.782701 0.214377 0.599244 0.605756 0.422366
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 5.701814 -0.453595 8.151510 -0.053250 1.835319 0.611208 1.067425 0.773060 0.041728 0.609699 0.461144
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.413625 35.834397 21.752053 18.972276 49.833139 17.768577 760.118633 325.457648 0.016240 0.016351 0.000744
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.209920 -0.400254 -0.094789 -0.742462 -1.214618 -0.393687 -0.567026 1.257876 0.638864 0.632184 0.410828
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.717357 -0.961623 0.054740 -0.975529 12.166649 0.891004 95.213825 14.239118 0.637551 0.649137 0.397629
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.037945 -0.730550 0.276887 -0.470934 0.571215 -1.063113 0.704418 -0.858568 0.663781 0.655136 0.405531
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.051268 8.110330 -0.030005 8.833974 2.551066 1.579052 18.282886 1.825226 0.668063 0.047814 0.560252
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.612254 7.924660 8.249945 8.811222 1.396491 1.601770 0.422083 1.615566 0.127693 0.033397 0.081566
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.194686 -0.573352 -0.162754 -0.911984 -0.448399 0.511692 -0.130663 -0.047240 0.668821 0.666788 0.412046
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.324193 0.182904 0.357514 0.606255 1.228199 -0.487115 0.016543 0.487767 0.655229 0.656002 0.406901
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.419662 -0.994955 -0.611587 -0.972496 -0.474233 -0.651503 -0.297330 -0.368510 0.648618 0.655970 0.420242
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
149 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
150 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 9.859209 -0.578455 -0.573675 1.095635 -0.382509 1.023848 0.203425 6.664642 0.522890 0.602271 0.356651
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.980071 -0.711896 8.262277 -0.155247 1.856041 0.442905 1.834224 0.328739 0.042460 0.611140 0.467188
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.490881 7.976153 6.113666 8.700231 0.309819 1.624437 1.097094 2.250336 0.532533 0.041108 0.423682
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.694179 0.184413 0.692651 0.933200 0.959445 0.782532 0.018742 0.233219 0.616216 0.626446 0.425645
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.741124 -0.885786 -0.678178 -0.732770 1.203710 0.432532 1.536984 5.447028 0.624470 0.636407 0.426512
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.224739 5.605004 0.048414 -0.360152 -0.554152 5.054311 0.187108 45.548631 0.609338 0.570916 0.398454
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 6.608578 -0.514723 8.339566 -0.078185 1.789587 1.113382 0.609806 0.139791 0.046171 0.646812 0.515918
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.339801 17.514384 0.629823 0.535155 1.577860 -0.427180 -0.098344 1.096982 0.648765 0.543215 0.382891
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.865297 -1.178404 -0.707172 -0.843703 0.404343 -0.246172 1.836421 -0.300405 0.668394 0.666681 0.409236
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.354968 0.826429 0.546594 0.736926 0.963074 0.615137 0.124353 0.841789 0.663847 0.670789 0.420070
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.506642 0.668677 1.082501 1.205421 -0.029172 1.186060 0.352648 1.373290 0.665588 0.671676 0.414567
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 13.163269 -0.052273 0.712814 -0.034209 1.428139 0.229039 4.742778 0.077992 0.548764 0.666211 0.382117
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.129520 -0.558628 1.132276 -0.387582 1.004591 -0.965725 0.210105 -1.072926 0.661989 0.659428 0.409858
167 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
168 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
169 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
170 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.240188 -1.204603 0.577995 -0.979982 -0.112982 -1.075568 -0.016155 0.305412 0.599230 0.613084 0.418080
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.881718 0.203370 1.019494 0.001521 0.012027 -1.098389 -2.308692 -0.597191 0.613479 0.610505 0.428234
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.871051 2.369325 1.530681 1.488740 1.162583 1.018976 -2.862553 -2.244417 0.581199 0.571106 0.414127
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.021615 -0.832239 0.298993 -0.478758 -0.383131 0.587007 -0.127328 -0.029688 0.627271 0.631863 0.420486
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.039034 8.475371 -0.376986 8.909662 0.617826 1.572665 11.652359 2.172031 0.650141 0.053703 0.544263
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.193181 0.444671 1.390546 1.155504 1.797086 0.432325 0.130319 4.901564 0.656144 0.655204 0.420608
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.435298 7.956810 -0.896451 8.648938 1.352864 1.614574 0.876322 2.090957 0.653530 0.050108 0.510778
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.408278 0.044176 0.725241 1.011206 1.083528 0.255413 6.042652 5.475831 0.655469 0.658252 0.402128
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 9.306836 -0.127063 6.671080 -0.041152 2.550274 1.056679 3.157068 0.497415 0.442794 0.664099 0.427243
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.235556 -0.084784 -0.729456 0.160467 1.786358 -0.235923 -0.618724 0.612258 0.664679 0.662892 0.418162
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.035066 -0.979191 -0.554176 -0.983526 -1.108302 -0.889679 -1.015282 -0.575757 0.667134 0.671842 0.420502
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.659770 -0.710120 1.444704 -0.623914 19.318000 -0.213212 10.251202 -0.503159 0.649875 0.652302 0.419237
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
190 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
191 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.348183 2.587945 1.331726 1.613615 0.732705 1.041247 -2.517656 -2.763685 0.584505 0.570642 0.411971
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.172200 2.174298 1.692011 1.429496 1.161761 0.905327 -3.012841 -2.587554 0.574283 0.567031 0.412595
200 N18 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.199672 19.102317 4.611795 0.265778 1.840041 1.213725 1.520819 1.216911 0.042437 0.281673 0.196819
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.167196 1.825958 0.738966 1.276370 0.335093 0.761767 -1.563296 -2.440650 0.631660 0.611354 0.420844
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% -0.122673 -0.340779 -0.039034 -0.254183 -0.825231 0.412848 -1.435668 23.816412 0.638502 0.633393 0.407875
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.070245 6.926107 1.622032 -0.428870 1.770935 0.496784 16.250251 1.674881 0.654298 0.659191 0.411428
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.239717 -0.550635 3.702513 -0.362269 -0.180866 1.587062 1.676887 1.867565 0.467188 0.648383 0.470260
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.642205 2.119564 1.246392 2.706790 0.008873 -0.980132 0.660765 1.342893 0.583205 0.552966 0.387925
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.335084 -0.884531 -0.734746 -0.637352 0.182399 -0.074326 5.429625 -0.221431 0.615929 0.632487 0.410261
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.087215 8.336963 -0.340549 4.999509 0.418700 1.560769 0.397466 1.256540 0.601119 0.040562 0.511848
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.924634 -0.949717 -0.610065 -0.945780 -1.042447 -0.535492 0.408021 -0.509302 0.637565 0.620655 0.421116
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.840042 -0.884330 -0.766653 -0.832659 2.293638 -0.789859 1.419715 -0.351049 0.633120 0.634435 0.415547
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.621199 -0.682736 -0.872134 -0.715682 -0.491190 -0.944096 2.982196 -0.594130 0.632726 0.635275 0.411535
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.752508 0.665885 -0.127325 2.275861 -0.197084 0.939201 -0.003259 8.338517 0.636339 0.580074 0.430738
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.384086 2.335431 1.822633 1.537865 1.360615 0.939987 -3.148264 -2.573610 0.607124 0.608875 0.407995
225 N19 RF_ok 100.00% 0.00% 51.52% 0.00% -0.535913 7.932645 -0.354824 4.818257 -0.932623 1.380072 -1.285370 1.792951 0.639214 0.193407 0.531297
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.049295 8.873820 -0.918582 -0.576818 -0.023836 -0.029235 -0.669763 1.810765 0.633985 0.551815 0.415899
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.203159 -0.542587 2.185857 -0.632850 -0.457826 3.179613 11.660693 3.629144 0.559097 0.618968 0.438129
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.361122 -0.418429 -0.385100 -0.471554 -1.134040 -0.732007 0.096434 0.571631 0.611582 0.614063 0.420645
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.417133 -0.081249 -0.377984 -0.035506 -1.167615 -0.669111 -0.288872 -1.400980 0.603543 0.603256 0.424240
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.299465 -0.837250 0.687404 -0.560805 0.100278 -0.286144 1.879173 -0.147055 0.591963 0.614879 0.429327
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.385715 -0.780766 -0.310585 -0.405708 -1.143586 -0.905801 -1.246196 -1.062503 0.628244 0.620229 0.429958
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.935518 -0.618639 -0.694991 -0.547300 -1.200377 -0.027260 -0.290624 2.003519 0.629451 0.622776 0.422504
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.623707 -0.638382 0.348132 -0.997704 -0.444751 -0.312689 1.494777 0.289983 0.600356 0.620282 0.418313
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.269252 -1.043584 -0.998206 -0.714441 -0.679870 -1.034077 0.386090 -0.841363 0.627080 0.625247 0.426892
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 9.393486 -0.256037 -0.617588 -0.181375 -0.394339 -0.679776 -0.572283 -1.060887 0.511975 0.626894 0.408550
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.066846 -0.939232 -0.212942 -0.476958 1.006497 -0.367685 19.285542 -0.103407 0.548627 0.618844 0.412276
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.162533 -0.853881 0.211931 -0.275119 0.660682 0.040717 1.044959 2.331274 0.596416 0.618607 0.420037
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.328667 -0.580385 -0.241976 -0.987243 -1.274792 -0.795096 -1.439609 0.336871 0.614793 0.611453 0.427097
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.485789 8.675587 -0.815249 4.672800 1.805687 1.608336 -0.257689 0.590235 0.599933 0.039840 0.507827
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.685390 -0.746206 -0.666305 -0.931422 -0.082087 -0.958562 3.552455 -0.411165 0.597280 0.594767 0.420356
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.760654 7.941889 0.519638 0.606445 0.493548 -0.185084 -0.009771 1.500468 0.614295 0.611470 0.436471
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.435891 -0.004683 0.583951 -0.053053 -0.731606 -0.867885 -2.035175 -0.634286 0.496090 0.499933 0.401153
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.725441 0.911371 -0.157147 0.031144 -0.668464 -0.558376 2.843270 0.883161 0.477554 0.484553 0.381178
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.112939 -0.830333 -0.252184 -0.428843 -1.260369 -0.439013 -1.182018 0.100273 0.525826 0.527378 0.417032
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 0.466900 -0.223949 -0.684332 -0.680515 9.606241 -0.334871 6.062986 2.597247 0.476690 0.492476 0.383003
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.206587 0.083376 0.108731 -0.313147 0.696433 -0.121743 1.251437 1.445145 0.477684 0.497762 0.383052
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: [4, 7, 15, 17, 18, 19, 20, 27, 28, 29, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 51, 53, 54, 55, 56, 58, 59, 60, 63, 65, 66, 68, 70, 72, 77, 78, 81, 82, 83, 84, 85, 86, 87, 92, 93, 94, 96, 97, 101, 103, 104, 108, 109, 110, 111, 112, 117, 118, 121, 124, 126, 127, 131, 134, 135, 136, 137, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 165, 167, 168, 169, 170, 180, 181, 182, 183, 184, 187, 189, 190, 191, 200, 202, 204, 205, 207, 208, 209, 210, 211, 223, 225, 226, 227, 242, 243, 246, 262, 329]

unflagged_ants: [5, 8, 9, 10, 16, 21, 22, 30, 35, 41, 43, 44, 46, 48, 49, 50, 52, 57, 61, 62, 64, 67, 69, 71, 73, 74, 79, 80, 88, 89, 90, 91, 95, 102, 105, 106, 107, 113, 114, 115, 120, 122, 123, 125, 128, 132, 133, 139, 141, 144, 145, 146, 157, 162, 163, 164, 166, 171, 172, 173, 179, 185, 186, 192, 193, 201, 206, 220, 221, 222, 224, 228, 229, 237, 238, 239, 240, 241, 244, 245, 261, 320, 324, 325, 333]

golden_ants: [5, 9, 10, 16, 21, 30, 41, 44, 67, 69, 71, 88, 91, 105, 106, 107, 122, 123, 128, 141, 144, 145, 146, 157, 162, 163, 164, 166, 171, 172, 173, 186, 192, 193]
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_2460048.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.1.1.dev3+gb291d34
3.2.3.dev158+gd5cadd5
In [ ]: