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 = "2460037"
data_path = "/mnt/sn1/2460037"
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-2-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/2460037/zen.2460037.21287.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 1851 ant_metrics files matching glob /mnt/sn1/2460037/zen.2460037.?????.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/2460037/zen.2460037.?????.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 2460037
Date 4-2-2023
LST Range 7.255 -- 17.217 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
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
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 67 / 198 (33.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 116 / 198 (58.6%)
Redcal Done? ❌
Never Flagged Antennas 80 / 198 (40.4%)
A Priori Good Antennas Flagged 62 / 93 total a priori good antennas:
5, 7, 9, 15, 16, 17, 19, 20, 30, 31, 37, 38,
40, 42, 45, 54, 55, 65, 66, 70, 71, 72, 81,
83, 86, 93, 94, 101, 109, 111, 112, 118, 121,
122, 123, 124, 127, 136, 140, 147, 148, 149,
150, 151, 158, 160, 161, 165, 167, 168, 169,
170, 173, 182, 184, 187, 189, 190, 191, 192,
193, 202
A Priori Bad Antennas Not Flagged 49 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 50, 57, 61, 62,
64, 73, 74, 89, 90, 95, 102, 115, 120, 125,
126, 132, 133, 135, 139, 179, 185, 201, 206,
207, 220, 221, 222, 228, 229, 237, 238, 239,
240, 241, 244, 245, 261, 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_2460037.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% -1.205195 17.128961 -0.834956 -0.428139 -0.801326 0.514935 -0.594464 2.425901 0.594904 0.481976 0.331055
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 9.636868 12.088644 9.948219 10.170018 3.198413 3.355281 1.478594 1.187839 0.044250 0.037369 0.002940
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.944215 -0.091745 -0.564686 0.111086 -0.005970 0.658197 6.148418 5.630988 0.612128 0.609174 0.318715
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.052955 3.200598 1.914256 2.021382 1.394306 1.617016 -0.688285 -0.871220 0.584366 0.584242 0.313031
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.222653 -0.534005 3.088935 -0.535464 1.135398 0.100674 4.246799 0.092869 0.602926 0.616241 0.322679
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.061450 -0.729385 0.407739 -0.754833 -0.882509 -0.295068 -1.142332 0.066196 0.601546 0.602957 0.316183
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 19.679985 2.484351 0.992769 0.242118 0.714409 0.677929 0.441281 0.913563 0.481463 0.598488 0.322658
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.424891 12.620663 -0.122923 10.393794 0.514636 3.300126 1.350620 2.772588 0.611233 0.047831 0.508250
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.038223 3.496243 0.911030 8.503788 1.105895 -0.189376 1.151073 2.260674 0.618009 0.483189 0.373666
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.826824 15.114474 9.970307 1.037850 3.184775 1.573631 1.635044 26.095680 0.043338 0.408704 0.325457
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.205098 -0.096165 -0.243173 -0.375532 -0.100841 8.835289 -0.020328 3.279121 0.624123 0.624135 0.321955
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.872531 -1.023926 1.154483 -0.447413 4.709837 -0.056237 1.784073 0.007373 0.617013 0.625985 0.315200
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.350161 0.518150 -0.026423 0.303712 0.686649 0.792818 0.610726 0.530177 0.613037 0.611917 0.312434
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.210539 -0.668490 -0.758468 -0.710792 -0.615239 0.290934 -0.166449 -0.426148 0.588555 0.592142 0.313145
27 N01 RF_maintenance 100.00% 93.35% 94.27% 0.11% 16.784568 31.077454 9.289929 5.582822 4.122553 2.447793 14.696715 40.313437 0.108053 0.101979 -0.034200
28 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.155165 22.700834 9.878598 3.555783 3.194380 2.100058 2.199027 20.408203 0.037203 0.298865 0.227931
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.064978 -0.639392 -0.552189 -0.487652 -0.010366 0.377938 -0.333932 0.057628 0.628514 0.626851 0.325822
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.313829 -1.005451 0.611126 -0.805118 4.297734 -0.451144 4.116892 -0.474990 0.625082 0.633136 0.324166
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.186083 0.148162 1.230227 2.610595 1.511923 2.690636 1.081159 6.911518 0.637158 0.630041 0.314686
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.552342 18.825189 -0.101932 0.041071 -0.670928 -0.642174 1.625379 2.718362 0.531147 0.548286 0.198401
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 10.544290 0.338787 5.495619 -0.111701 3.155929 -0.841240 2.387113 0.060302 0.052863 0.603525 0.431254
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.030480 -0.905183 0.200020 -0.673126 -0.711256 -0.552615 -1.218264 0.240278 0.597002 0.594323 0.314609
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.673767 5.867249 1.186406 0.784702 1.046343 1.237701 0.969790 0.568334 0.581250 0.571618 0.339644
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.227634 21.637045 -0.789879 12.656766 -0.470045 3.349251 -1.128277 3.403556 0.592738 0.039317 0.463835
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.367022 -0.030308 -0.142703 0.148489 0.314701 -0.205900 0.606124 4.750270 0.604055 0.597799 0.339733
40 N04 digital_ok 100.00% 0.00% 0.00% 99.41% 1.088996 1.269435 0.107642 -0.453627 0.243846 0.426265 6.605588 1.440615 0.294352 0.289403 -0.256328
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.860272 1.690778 1.323115 1.845799 1.740564 0.471576 1.250284 1.181094 0.623405 0.624765 0.324570
42 N04 digital_ok 0.00% 0.00% 0.00% 98.87% -0.001249 2.015521 -0.259142 -0.721592 0.227526 0.643813 0.396893 1.081055 0.317383 0.306336 -0.254257
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.545293 -0.058259 -0.823470 0.765178 -0.327285 0.999488 -0.344432 1.151208 0.634813 0.638034 0.318561
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.799726 0.615449 -0.754580 0.437246 -0.689067 0.490166 -0.367593 0.470149 0.631730 0.646008 0.320074
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 1.124891 4.176633 0.856032 0.683418 0.618410 1.784872 1.125571 3.811655 0.632977 0.629608 0.311008
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.240896 -0.573596 0.084093 -0.889831 0.167359 -0.470769 0.611153 -0.138985 0.629889 0.639525 0.325063
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 9.761400 12.491292 5.410755 5.310141 3.148242 3.293464 3.204976 1.502706 0.032195 0.062204 0.020222
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.381165 0.785076 -0.626323 0.732296 -1.137694 0.331608 -0.761919 -1.325519 0.598018 0.599584 0.317220
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.712249 0.080608 0.075137 -0.087633 -0.676605 -0.791220 0.917351 -0.448652 0.573465 0.587231 0.315984
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.449978 1.351972 0.518669 1.571854 0.466913 1.448155 0.909934 0.921992 0.580389 0.572226 0.337986
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.557895 1.102561 0.266352 -0.474986 1.088656 0.488551 52.755420 -0.050523 0.585790 0.584777 0.334756
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.448043 4.241819 0.643081 0.275217 1.106792 0.932808 1.450565 0.986147 0.607659 0.601919 0.333417
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.492612 0.855901 -0.014281 -0.339158 1.158394 -0.542691 3.062403 2.545840 0.618330 0.613235 0.336323
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.835762 3.046118 1.400933 -0.219815 1.551634 0.687641 -0.028608 -0.083182 0.323746 0.378393 0.147615
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.802185 43.263031 0.400264 7.046685 -0.405232 3.624976 1.241971 1.170185 0.306964 0.049882 0.138388
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.849877 1.268535 -0.896542 2.200224 -0.850189 0.829760 -0.688032 1.435604 0.633356 0.629109 0.314634
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.613158 0.030990 -0.571649 -0.574928 -0.750770 0.360999 -0.682068 0.069043 0.638152 0.644000 0.318690
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.578729 11.720189 9.911396 10.323002 3.142055 3.307396 3.135965 2.658214 0.044656 0.043615 0.001848
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.591067 0.853542 9.943114 0.991043 3.079473 1.922022 1.529968 3.140376 0.057895 0.640838 0.470313
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.164647 11.657455 0.210913 10.350792 0.088415 3.292421 0.969353 3.826155 0.617791 0.094932 0.468060
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.338451 -0.486032 1.000515 -0.648217 -0.127360 -0.613859 1.022948 0.682801 0.581999 0.607672 0.315863
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.315247 1.003698 0.253567 0.577414 -0.346078 -0.514838 0.300179 -1.030287 0.583416 0.600564 0.318502
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.443617 12.145632 -0.827473 5.663916 -1.246569 3.347476 -0.591263 2.702514 0.598951 0.054183 0.442823
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.568816 -0.303414 -1.030244 -0.193928 -0.494693 -0.568706 0.622400 0.802371 0.588146 0.578384 0.312605
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 20.637119 19.783400 12.531207 12.430471 3.208114 3.379705 4.017190 4.769490 0.024773 0.039200 0.013935
66 N03 digital_ok 100.00% 4.81% 100.00% 0.00% 2.619960 20.350126 1.546561 12.578402 0.944377 3.312418 -0.737186 5.259186 0.253533 0.060706 0.129456
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.407425 0.001249 -0.244127 1.355632 -0.353459 1.178703 1.550074 1.300112 0.608550 0.600750 0.332609
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 22.030492 0.914871 12.607353 0.572450 3.125107 -0.531733 4.573833 -0.751366 0.042074 0.608700 0.466073
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.252398 -0.651286 1.434175 -0.675194 0.484099 0.318120 1.772944 -0.085534 0.627766 0.630418 0.325597
70 N04 digital_ok 0.00% 0.00% 0.00% 98.16% 0.298790 2.236802 1.191272 2.641114 1.186249 1.641507 1.735047 2.304670 0.319658 0.306827 -0.249352
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.780988 -0.108063 -0.285488 0.337036 0.142372 0.500838 -0.396385 0.397453 0.643074 0.646935 0.317181
72 N04 digital_ok 100.00% 0.00% 0.00% 98.76% 0.661001 1.556475 2.446546 1.058023 0.747267 1.172599 11.197669 2.034939 0.331250 0.324940 -0.251894
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.416368 1.512198 -0.625086 0.728951 0.375105 1.269554 1.052292 1.608358 0.648822 0.650068 0.318133
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.092097 -0.059995 -0.429515 -0.176084 -1.017905 0.443298 -1.183266 0.605065 0.641384 0.649909 0.322001
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 40.495837 11.695312 0.509421 -0.540349 1.653438 -0.180673 0.561371 -0.155663 0.382495 0.523689 0.253537
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 19.723030 0.787016 -0.054058 0.716820 -0.001165 -0.103177 0.856436 -0.433654 0.457083 0.602533 0.309016
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.164909 12.325460 -0.470586 5.644436 -0.509966 3.273433 0.085707 0.936085 0.589345 0.048029 0.435021
80 N11 not_connected 100.00% 0.00% 72.66% 0.00% -0.503898 12.262993 -0.198378 5.424676 -1.239225 2.118007 -1.112842 1.592381 0.592553 0.125578 0.434047
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 91.329033 35.510935 29.507785 21.020952 13.621852 5.822571 688.911301 230.316961 0.017209 0.016558 0.000917
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 34.472235 55.061615 23.700328 24.149066 12.175254 8.963192 435.786182 418.883734 0.016388 0.016264 0.000768
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 27.816746 34.176140 21.059620 19.976362 4.684577 4.719274 313.057293 241.095042 0.016504 0.016561 0.000741
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 4.416468 21.276500 2.978641 12.706812 1.850063 3.298210 1.301880 3.986952 0.613517 0.048210 0.425905
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.049821 1.848690 -0.537943 -0.423872 -1.251671 0.439230 -1.312682 0.931940 0.626751 0.626665 0.321553
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.861880 0.513114 0.781304 0.123387 0.136944 0.623988 0.460469 9.309392 0.635088 0.636774 0.312561
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.463941 3.877791 2.874245 -0.489551 3.975514 -0.774589 1.634210 -0.854818 0.568770 0.650781 0.300330
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.064143 1.299347 0.845906 1.302351 0.513156 0.010366 0.496897 0.186602 0.642351 0.647295 0.307469
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.245434 0.454422 0.807597 1.083502 0.508586 0.907693 0.019272 0.084677 0.645166 0.650027 0.311298
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.254775 -0.622045 0.214430 -0.763172 -0.053552 1.930629 -0.130684 0.531552 0.639861 0.650007 0.316932
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.117373 0.506306 0.979476 0.695168 0.740340 0.587478 0.294338 -0.015643 0.634025 0.641833 0.318149
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.092906 0.128338 9.930669 0.361956 3.192902 1.031516 1.348374 0.375988 0.044345 0.637428 0.409888
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.411753 11.888841 10.008794 10.400611 3.111551 3.283977 2.676067 2.154302 0.037087 0.025479 0.006183
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.013593 12.144121 10.111258 10.244408 3.147828 3.306791 1.714240 1.401215 0.025760 0.026081 0.001138
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.609447 1.219595 -0.854722 0.355545 0.132384 0.264059 -0.642868 -0.477812 0.452925 0.445895 0.176707
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.645487 18.554905 0.587854 -0.391736 -0.560456 -0.057196 -0.941063 0.793666 0.591957 0.497565 0.313553
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.293409 2.195445 -0.924959 0.552698 -1.037509 -0.631719 -0.293817 3.986460 0.582049 0.562239 0.320038
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.952497 6.035075 0.271424 1.115048 0.682174 1.415280 -0.189446 0.251269 0.615320 0.615835 0.324264
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.718036 0.564994 -0.904807 -0.366895 0.103957 0.304187 -0.996127 1.638524 0.629203 0.628695 0.320842
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.551786 3.420504 2.017441 -0.895473 1.577037 0.047941 -0.908547 0.436378 0.607219 0.636723 0.321535
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.280996 45.924387 0.881402 6.449415 0.380871 0.525266 0.457475 0.954387 0.639104 0.630310 0.309042
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.149491 0.478044 0.585761 1.184833 0.859002 0.477660 0.109769 -0.011531 0.643958 0.645765 0.308250
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.879811 1.052460 1.232727 0.212993 2.784766 -0.107069 2.879282 -0.324246 0.638293 0.651058 0.311550
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.287347 1.608296 0.014281 -0.678066 0.225113 -0.322487 0.420223 0.807693 0.641915 0.644582 0.308036
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.779990 2.380240 1.445407 2.317611 0.261296 1.212201 8.357675 0.579345 0.633855 0.644197 0.313033
109 N10 digital_ok 100.00% 96.70% 100.00% 0.00% 8.879938 11.761226 9.992065 10.147272 3.158588 3.347723 1.414555 2.124130 0.091349 0.042733 0.033445
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 20.039177 -0.233218 0.436948 -0.133889 1.692320 0.140154 8.462587 -0.424039 0.555141 0.630544 0.309697
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 13.891333 11.708861 1.182872 10.222846 0.633921 3.329871 13.609315 2.324823 0.554627 0.075412 0.380723
112 N10 digital_ok 100.00% 0.00% 0.00% 95.57% 0.028849 5.753862 1.659661 9.021932 1.160158 0.901429 0.936874 1.970626 0.296812 0.205951 -0.205466
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.728634 12.837094 5.174835 5.637784 3.100863 3.269122 2.513232 1.717290 0.038962 0.031296 0.004815
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 11.421078 0.812809 5.310239 -0.267668 3.095064 -0.901700 1.876250 0.061941 0.053715 0.578932 0.418187
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.124215 -0.581393 -0.851271 -0.128756 -0.899271 -1.107404 0.132817 -1.066978 0.564355 0.569926 0.323726
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 26.695215 39.833466 20.385517 22.981774 5.027572 8.469609 255.849591 348.894302 0.017595 0.016339 0.001264
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 27.663455 28.485727 20.933495 19.691124 4.597888 4.182066 291.087389 189.168321 0.016567 0.016579 0.000774
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.604420 1.028117 2.763482 -0.619831 1.361388 0.433801 2.143706 -0.374806 0.618341 0.628969 0.321494
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.815108 2.543506 -0.979011 5.650281 -0.294146 0.191908 0.942779 8.682280 0.635113 0.618514 0.312218
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.717398 4.062526 -0.350991 -0.811158 -0.037517 -0.025599 -0.575107 -0.827343 0.642839 0.646891 0.314613
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.212894 6.297306 1.077639 1.152837 1.134852 1.007795 0.216573 0.301139 0.651003 0.653155 0.313159
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 9.217250 0.256120 10.153348 0.798331 3.099659 0.963812 1.570349 0.544801 0.049879 0.654957 0.419146
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.876092 -0.477382 2.132021 1.308771 1.268747 0.124481 0.697126 0.020295 0.640614 0.648853 0.315595
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.250800 1.271086 0.429394 1.045538 0.247084 1.212723 1.951930 0.334398 0.634014 0.645489 0.315289
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 8.797731 -0.702901 9.920252 -0.988659 3.183299 0.048878 1.310460 0.746237 0.044538 0.641278 0.410937
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.342411 -0.510283 -0.451183 -0.253368 -0.207749 -0.613396 -0.429619 1.760457 0.627914 0.626602 0.334490
131 N11 not_connected 100.00% 0.00% 13.99% 0.00% -0.899260 11.403491 -0.454506 5.536018 -1.128505 2.711959 -1.235118 0.552132 0.591499 0.269681 0.386689
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.076098 -0.463906 -0.637607 -0.782033 -1.104494 -0.508915 -1.013990 -0.455454 0.580976 0.576550 0.323718
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.179819 -0.980194 -0.678381 -0.610009 -0.600574 -1.238274 -0.245613 -0.362383 0.568449 0.572980 0.327539
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.112905 12.783485 5.288123 5.613578 3.102053 3.279089 1.356127 1.479303 0.047005 0.040369 0.003686
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.542745 -1.218301 -0.544962 -1.032615 0.710533 0.101963 0.988783 -0.247181 0.555548 0.564515 0.338623
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 8.333622 -0.383859 9.669203 -0.304678 3.188896 0.091414 2.151855 -0.230315 0.049370 0.574745 0.409448
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 36.508783 63.839633 25.141805 25.958273 10.539512 7.773422 568.962122 483.371223 0.016307 0.016182 0.000737
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.095889 -0.137030 0.561824 -0.992674 -0.249534 -0.978035 -0.969019 0.046462 0.600509 0.601877 0.315834
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.586210 -1.185564 0.005260 -0.513466 -0.034513 -1.117516 11.022398 1.705704 0.620891 0.630255 0.316928
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.347665 -0.249077 0.168181 0.132959 0.620824 -0.715892 -0.122347 -1.136103 0.635317 0.636187 0.314659
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.274714 11.759353 -0.268602 10.357395 0.936247 3.312147 10.882261 2.056654 0.642421 0.056921 0.508293
143 N14 RF_maintenance 100.00% 99.89% 100.00% 0.00% 9.683350 11.683137 9.814215 10.333041 2.838079 3.318322 1.328248 1.984241 0.123547 0.038071 0.069639
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.337280 -0.248275 -0.361541 -0.995764 0.125720 1.206489 -0.629830 -0.711923 0.649389 0.652478 0.318525
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.360139 0.331841 0.283881 0.407346 -0.137080 2.855864 -0.122776 0.258381 0.645224 0.644852 0.316833
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.518048 -0.673300 -0.937984 -0.814019 -1.149844 -1.088893 -0.733274 -0.617929 0.618517 0.626932 0.318136
147 N15 digital_ok 100.00% 98.76% 98.92% 0.00% 186.421223 185.882732 inf inf 1256.259218 1271.671503 5599.007637 5740.544858 0.568538 0.496346 0.269584
148 N15 digital_ok 100.00% 98.87% 98.87% 0.00% 193.047163 192.753577 inf inf 1098.398418 1028.984882 4596.143839 3768.926400 0.541636 0.530846 0.345207
149 N15 digital_ok 100.00% 98.54% 98.70% 0.05% nan nan inf inf nan nan nan nan 0.553074 0.431799 0.365856
150 N15 digital_ok 100.00% 98.43% 98.60% 0.00% nan nan inf inf nan nan nan nan 0.668406 0.594800 0.365291
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 14.442030 -0.528044 -0.517465 1.055992 -0.108992 0.133687 -0.593581 4.114524 0.475712 0.558293 0.285963
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 8.776379 -0.968839 9.804063 -0.553289 3.198242 0.049720 2.514468 0.061823 0.050514 0.572652 0.417473
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.340753 11.578809 7.724827 10.187845 -0.259309 3.361021 2.854017 2.572079 0.459802 0.048379 0.337661
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.932808 0.226004 0.593745 0.815104 0.462164 1.062506 0.307940 0.230350 0.583990 0.594717 0.327121
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.775305 -1.149622 -0.978289 -0.998822 0.181705 0.208042 -0.058092 4.515123 0.599890 0.610335 0.328963
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.360331 16.030216 -0.184588 -0.396051 -0.889657 0.179216 -0.217320 1.338342 0.579529 0.504806 0.297527
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 9.614576 -0.928242 9.906268 -0.416966 3.160430 0.771347 1.638790 -0.196461 0.054023 0.629424 0.482661
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.503123 24.479289 0.522717 0.276485 0.869126 -0.499696 0.284222 0.520564 0.630748 0.531210 0.291882
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.503263 -1.036402 -0.292293 -0.836903 0.571478 -0.022322 0.187160 -0.784183 0.637871 0.644159 0.317077
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.779861 1.407365 0.414164 0.575749 0.671801 1.133123 -0.000268 0.347110 0.644525 0.649612 0.319137
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.754204 1.235900 1.511365 1.227391 1.054830 1.663130 0.740260 0.843825 0.640628 0.644605 0.311055
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 18.179179 0.002905 0.553888 -0.329633 0.005715 0.167258 0.913347 -0.334306 0.529281 0.643267 0.303140
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.322949 -0.083909 1.142327 0.262982 0.672377 -0.759768 0.770582 -0.970131 0.634397 0.631862 0.315885
167 N15 digital_ok 100.00% 98.33% 98.49% 0.11% 186.439201 185.983418 inf inf 1074.880989 1095.785510 4413.754612 4601.703056 0.562793 0.566710 0.307167
168 N15 digital_ok 100.00% 98.49% 98.76% 0.00% 193.066971 192.753188 inf inf 1117.436456 1056.346713 4779.831270 4082.476641 0.593878 0.529674 0.363274
169 N15 digital_ok 100.00% 98.60% 98.54% 0.00% 186.341311 185.928090 inf inf 1450.779807 1451.466347 6997.556650 7005.432867 0.506594 0.507383 0.230532
170 N15 digital_ok 100.00% 98.11% 98.22% 0.00% nan nan inf inf nan nan nan nan 0.571219 0.466566 0.391133
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.333459 -1.368393 1.059657 -1.046223 -0.415445 -1.055992 0.159942 -0.199575 0.552992 0.577139 0.328471
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.266313 1.187367 1.923391 0.673788 1.391795 -0.510103 -1.287564 -0.694532 0.564961 0.565298 0.331577
173 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.605643 4.551866 2.586702 2.689289 2.401168 2.603854 -1.305240 -1.043656 0.531216 0.523682 0.321991
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.225643 -1.064370 0.247546 -0.773179 -0.527051 -0.049019 -0.319296 -0.741791 0.601299 0.610745 0.328483
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.177562 12.326369 -0.722889 10.457243 0.191128 3.285822 3.068069 2.387835 0.615917 0.063744 0.492785
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.701104 0.843737 1.446109 1.044679 0.705625 0.263549 0.433578 3.216861 0.625545 0.631479 0.324192
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.403160 11.567840 -0.822815 10.137177 4.611646 3.352554 0.015483 2.389303 0.635375 0.058018 0.464700
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.104711 0.691583 0.153209 0.448221 0.829475 0.624124 0.022270 -0.057258 0.628634 0.635495 0.310338
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 14.313555 -0.388997 7.547565 -0.377015 1.951310 -0.015658 2.228663 -0.401809 0.455948 0.640932 0.335742
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.034239 -0.131455 -1.009291 -0.034454 -0.600053 0.033185 -0.980844 0.025608 0.640616 0.640511 0.318648
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.747611 -1.027132 -0.066912 -0.503109 -1.080201 -1.064261 -1.112470 -0.887741 0.633277 0.633181 0.320225
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.893629 -0.329856 1.471548 -0.131754 10.731084 -0.465153 4.417003 -0.818262 0.619514 0.623208 0.323708
189 N15 digital_ok 100.00% 97.68% 97.95% 0.00% nan nan inf inf nan nan nan nan 0.579112 0.497598 0.386536
190 N15 digital_ok 100.00% 97.73% 97.84% 0.00% 193.815627 193.561941 inf inf 1453.196609 1451.699750 7032.047870 7015.427069 0.616461 0.534679 0.353864
191 N15 digital_ok 100.00% 98.11% 98.33% 0.00% 167.969269 167.337643 inf inf 1117.340474 1138.992544 4713.477053 4871.417587 0.631960 0.580402 0.348476
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 2.839389 4.796414 1.843613 2.794176 1.930715 2.626560 -0.992019 -1.362988 0.558013 0.530376 0.327691
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.911274 4.118030 2.738603 2.534535 2.420307 2.404953 -1.316366 -1.402697 0.529543 0.525635 0.321778
200 N18 RF_maintenance 100.00% 100.00% 19.99% 0.00% 10.522686 28.749833 5.337186 0.155729 3.191370 0.864208 2.207311 2.414785 0.048730 0.251051 0.162836
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.481139 3.698321 1.637299 2.404201 1.198594 2.128065 -1.211831 -1.441958 0.601278 0.587546 0.322960
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.585677 0.005789 0.588623 -0.534405 -0.266604 0.438367 -1.100700 26.518913 0.616218 0.610802 0.315828
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.078251 9.712180 1.681425 -0.693019 0.887635 -0.091250 10.052172 -0.184323 0.628900 0.631603 0.320229
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.417165 -0.921619 4.032029 -0.700152 0.468800 0.185171 0.776866 0.920792 0.461625 0.617623 0.367861
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.100541 3.344771 0.747738 2.947530 -0.658274 -0.506373 0.092645 0.165318 0.578469 0.523931 0.313238
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.280954 -0.484663 -0.943946 -1.016459 -1.021922 1.555875 1.346308 -0.487461 0.582140 0.600194 0.320745
208 N20 dish_maintenance 100.00% 98.60% 98.92% 0.00% nan nan inf inf nan nan nan nan 0.546099 0.515246 0.322291
209 N20 dish_maintenance 100.00% 98.70% 98.60% 0.00% nan nan inf inf nan nan nan nan 0.471504 0.608520 0.380150
210 N20 dish_maintenance 100.00% 98.27% 98.38% 0.00% nan nan inf inf nan nan nan nan 0.609569 0.606927 0.253026
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.189843 12.136063 -0.652341 5.666587 -0.655199 3.282745 -0.580977 1.590018 0.562236 0.047169 0.456846
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.856527 -0.829360 -0.124374 -0.675923 -1.261585 -0.904963 -0.056634 -0.897452 0.608164 0.601911 0.319018
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.705230 -0.536743 -0.775041 -0.853913 2.040203 -1.121310 0.304287 -0.922813 0.605878 0.610762 0.317347
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.528613 -0.162807 -0.455469 -0.196103 -0.901961 -1.020118 0.188825 -1.055563 0.606999 0.611302 0.318340
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.852043 0.189960 -0.394243 1.919477 -0.695620 4.158315 -0.644918 2.095610 0.601921 0.547690 0.328284
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.324485 4.508274 2.960492 2.748941 2.676441 2.560341 -1.195222 -1.237038 0.565676 0.569602 0.318602
225 N19 RF_ok 100.00% 0.00% 70.99% 0.00% -0.115346 11.568639 0.178615 5.440605 -0.992786 3.096884 -1.332137 1.838299 0.603457 0.179838 0.463656
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.018958 13.716864 -0.831491 -0.038611 -1.099603 0.648099 -1.176553 -0.521202 0.594591 0.514382 0.313336
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.802797 0.506306 2.406283 -0.846949 -0.635644 2.934271 6.018408 0.357630 0.517230 0.572322 0.333585
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.325921 -0.297964 0.190644 -0.868994 -0.839216 -0.596297 -0.161343 -0.044073 0.574813 0.563984 0.320506
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.460390 0.790777 0.165656 0.680743 -0.709941 -0.130135 -1.135391 -1.201225 0.567898 0.561525 0.332503
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.613830 -0.742614 0.622291 -0.932584 0.162417 -0.423186 -0.189074 -0.774664 0.559605 0.588190 0.323779
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.080103 -0.194224 0.230865 0.201054 -0.855093 -0.851089 -1.312287 -1.277964 0.599273 0.596227 0.327238
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.607981 0.237936 -0.258373 0.176166 -0.907944 -0.822972 -0.950373 0.439660 0.598996 0.596994 0.324645
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.758937 -0.069431 0.287344 -0.948336 3.038122 -0.951641 0.782486 0.000268 0.580740 0.597799 0.326346
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.258196 -0.798776 -0.647994 -0.180164 -1.120638 -1.087594 -0.626467 -1.146301 0.597919 0.597538 0.332109
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 13.930074 0.402421 -0.510015 0.480889 -0.167579 -0.255195 -0.846060 -1.050058 0.474789 0.590504 0.318136
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 13.044974 -0.990195 0.223849 -0.838486 0.176024 -0.385715 -0.286249 -0.551130 0.486192 0.578520 0.320308
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.363195 -0.758051 -0.046604 -0.613639 -0.405370 -0.817376 0.173657 1.014318 0.567347 0.574637 0.321410
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.256823 0.018572 0.014481 -1.007124 -0.979229 -0.934057 -0.666913 -0.087908 0.579011 0.567199 0.328441
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.280315 12.614161 -0.953853 5.261824 -0.654568 3.336513 4.764338 1.060076 0.559005 0.046886 0.454513
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.264590 -0.097525 -0.334123 -0.441501 0.289012 -1.130178 1.378551 -0.656069 0.566897 0.558797 0.325035
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 8.978748 11.129770 0.381701 0.413351 0.999311 0.446399 1.887019 0.457547 0.578239 0.568485 0.339468
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.682518 1.147021 1.375297 0.691672 0.446969 0.108584 -1.298195 -0.750984 0.471634 0.454820 0.315887
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.806722 2.343471 0.474718 0.815722 -0.664975 0.107284 -0.892180 -1.111493 0.460158 0.448187 0.306242
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.847594 -0.970499 0.341497 -0.826938 -0.712098 -0.794558 -1.407741 0.049860 0.497104 0.480288 0.325044
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.363393 -0.101311 0.279433 -0.974839 0.598973 -0.817060 -0.049081 0.043965 0.468427 0.460216 0.311931
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.680623 0.675682 -0.192426 -0.731924 -0.538260 -0.732804 1.033158 0.229847 0.447261 0.449810 0.298712
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, 5, 7, 9, 15, 16, 17, 18, 19, 20, 27, 28, 30, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 51, 52, 54, 55, 58, 59, 60, 63, 65, 66, 68, 70, 71, 72, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 101, 104, 108, 109, 110, 111, 112, 113, 114, 117, 118, 121, 122, 123, 124, 127, 131, 134, 136, 137, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 165, 167, 168, 169, 170, 173, 180, 182, 184, 187, 189, 190, 191, 192, 193, 200, 202, 204, 205, 208, 209, 210, 211, 223, 224, 225, 226, 227, 242, 243, 246, 262]

unflagged_ants: [8, 10, 21, 22, 29, 35, 41, 43, 44, 46, 48, 49, 50, 53, 56, 57, 61, 62, 64, 67, 69, 73, 74, 85, 88, 89, 90, 91, 95, 102, 103, 105, 106, 107, 115, 120, 125, 126, 128, 132, 133, 135, 139, 141, 144, 145, 146, 157, 162, 163, 164, 166, 171, 172, 179, 181, 183, 185, 186, 201, 206, 207, 220, 221, 222, 228, 229, 237, 238, 239, 240, 241, 244, 245, 261, 320, 324, 325, 329, 333]

golden_ants: [10, 21, 29, 41, 44, 53, 56, 67, 69, 85, 88, 91, 103, 105, 106, 107, 128, 141, 144, 145, 146, 157, 162, 163, 164, 166, 171, 172, 181, 183, 186]
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_2460037.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.dev149+g96d0dd5
In [ ]: