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 = "2460059"
data_path = "/mnt/sn1/2460059"
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-24-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/2460059/zen.2460059.42116.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/2460059/zen.2460059.?????.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/2460059/zen.2460059.?????.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 2460059
Date 4-24-2023
LST Range 13.713 -- 15.654 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
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 62 / 198 (31.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 106 / 198 (53.5%)
Redcal Done? ❌
Never Flagged Antennas 90 / 198 (45.5%)
A Priori Good Antennas Flagged 53 / 93 total a priori good antennas:
7, 15, 17, 19, 20, 31, 37, 38, 40, 42, 53,
54, 55, 56, 65, 66, 70, 72, 81, 83, 86, 93,
94, 103, 109, 111, 112, 118, 121, 124, 127,
136, 145, 147, 148, 149, 150, 151, 158, 160,
161, 164, 165, 167, 168, 169, 170, 182, 184,
189, 190, 191, 202
A Priori Bad Antennas Not Flagged 50 / 105 total a priori bad antennas:
8, 22, 35, 36, 43, 46, 48, 49, 50, 52, 57,
62, 73, 74, 79, 80, 89, 90, 95, 113, 114, 115,
120, 125, 126, 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_2460059.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.110419 11.463290 -1.086762 -0.608221 -0.887672 0.443321 -0.788238 0.134890 0.534864 0.418601 0.348187
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.763103 0.435809 0.324038 2.985430 1.052245 2.432337 -0.147046 0.676082 0.542495 0.524695 0.352482
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.680195 0.000935 -0.483481 0.128215 -0.001027 0.360672 3.029692 10.759668 0.552131 0.540090 0.347784
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.570763 1.564763 1.083932 1.040412 0.418338 0.343537 -1.991751 -1.679543 0.522435 0.513637 0.328151
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.614607 -0.446388 2.926867 -0.382746 0.113757 0.062030 1.625754 -0.300747 0.523983 0.535518 0.335846
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.233619 -0.496487 -0.520124 -0.488414 -0.610928 -0.139753 -1.084729 0.013455 0.532794 0.522112 0.340801
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 10.645594 -0.419989 -0.632221 -0.531553 -0.210708 -0.111788 -0.078760 1.254551 0.435805 0.544838 0.342243
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.038669 1.158679 0.237304 0.794801 -0.771092 -0.085717 -1.224767 -1.685657 0.544468 0.533320 0.346614
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.030415 2.430609 0.839027 7.631763 0.874574 -0.978984 0.132852 3.939759 0.546966 0.416521 0.379546
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.415532 4.124820 0.794370 1.348233 0.735610 0.876199 5.476496 16.812136 0.528696 0.351810 0.386393
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.355335 -0.008412 -0.223307 2.964733 0.069172 1.091286 -0.300221 10.082758 0.559566 0.546819 0.347135
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 7.234127 -0.957713 1.734235 -0.383311 6.478966 0.161524 4.909665 0.521595 0.542414 0.556282 0.329711
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.246937 0.371452 -0.002081 0.358421 1.072442 1.148237 0.421729 0.528684 0.540648 0.540606 0.332468
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.024864 -0.927512 -0.919176 -1.075177 -0.720494 0.203076 -0.122039 -0.350803 0.517645 0.515540 0.332180
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.792292 18.128679 8.638491 5.475419 1.831042 1.464749 3.384455 47.592328 0.072736 0.074420 -0.034536
28 N01 RF_maintenance 100.00% 100.00% 3.05% 0.00% 6.449431 10.448140 8.793899 3.628987 2.231690 0.841394 1.308953 16.410866 0.030185 0.261194 0.201886
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.836350 -0.109153 -0.127606 0.035722 0.451448 0.010765 1.244688 2.399665 0.563916 0.563557 0.342688
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.048576 -0.830805 0.351208 -0.658767 1.338526 -0.495367 1.911758 -0.242152 0.568586 0.570995 0.343019
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.316319 -0.110848 1.047279 2.570262 1.220439 0.785832 0.661741 17.563616 0.574548 0.561311 0.348141
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.501414 13.015196 -0.060876 -0.021667 -0.123830 1.214399 1.973916 3.486457 0.465267 0.485714 0.178718
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.528767 -0.644982 4.987172 -0.780311 2.205898 -1.043281 1.055409 0.066499 0.044901 0.532667 0.379634
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.745433 -0.580962 -0.449324 -0.435165 -0.380461 0.001692 0.508218 0.228550 0.529754 0.519012 0.339224
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.229350 3.451155 1.034776 0.772591 2.562568 1.970404 0.174994 0.892283 0.537862 0.527829 0.349312
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.845827 14.040626 -0.801962 10.841193 -0.386959 1.689935 -0.978244 2.509186 0.541002 0.034327 0.438117
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.396143 -0.254339 -0.080599 0.429875 0.690591 0.899728 2.582123 8.922678 0.552751 0.543505 0.349113
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.018222 1.116865 0.119501 -0.292217 0.246577 1.103842 23.974084 0.799412 0.218295 0.214025 -0.280309
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.466018 0.752774 1.200230 1.855138 3.110235 0.308931 0.237863 0.492493 0.567000 0.565668 0.346773
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.339201 1.525082 -0.308322 -0.544339 -0.397150 1.205929 0.146544 3.960398 0.238889 0.225452 -0.280063
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.045501 0.052082 -1.031800 0.718241 -1.129663 1.043984 -0.642118 1.178867 0.575358 0.575907 0.348457
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.709970 0.361940 -0.709656 0.437635 -0.648400 -0.215699 -0.483256 0.022588 0.582453 0.584712 0.352141
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.574629 1.860084 0.781227 0.671168 0.388856 1.693120 0.399585 2.536312 0.568516 0.564782 0.340898
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.321403 -0.765839 0.063523 -1.002194 -0.035939 -0.204723 0.106611 -0.236401 0.560937 0.570957 0.344489
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 7.005746 8.630173 4.915495 4.968364 2.604183 2.089459 3.708696 2.593058 0.031165 0.057028 0.017619
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.481184 -0.048276 -0.993173 0.014579 -0.554620 -0.871822 -0.888492 -1.324818 0.536595 0.537473 0.330318
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.217644 -0.764529 0.559586 -1.069659 -1.055685 -1.112450 0.090362 1.141533 0.505906 0.519430 0.324539
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.137825 0.394130 0.463619 1.482124 0.340262 1.941498 1.081338 1.353453 0.526300 0.517621 0.339083
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.605791 0.441260 0.178142 -0.221827 3.180540 0.873155 85.031637 1.886028 0.538220 0.536664 0.339239
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.070978 2.436804 0.580652 0.317956 2.008305 0.881497 1.601350 0.636193 0.560181 0.551370 0.347153
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.032626 -0.002060 0.000386 -0.912620 3.269771 0.062399 5.653518 4.039070 0.567090 0.560440 0.348204
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.221130 1.252193 0.693407 -0.630009 0.220185 1.947071 -1.316757 -0.646024 0.323242 0.374309 0.160085
55 N04 digital_ok 100.00% 14.96% 100.00% 0.00% 0.183628 29.801236 -0.112380 6.458896 -0.144788 2.639244 1.719474 0.874863 0.232396 0.042013 0.080473
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.666340 3.972244 -1.020465 1.356058 -0.169371 3.092406 0.150414 3.169900 0.575267 0.556537 0.330960
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.608978 0.089771 -0.939481 -0.427651 -0.047551 0.259741 0.272562 0.639964 0.578363 0.577388 0.343227
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.223141 8.122851 8.815938 9.315756 2.387584 1.894707 2.073716 2.049171 0.037852 0.037318 0.001974
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.910844 0.700997 8.835332 1.017322 2.208064 1.834322 1.132701 6.116246 0.048917 0.575939 0.420793
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.247814 8.094550 0.187178 9.341960 1.003192 2.008553 1.925998 3.684757 0.557549 0.076650 0.433457
61 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.407620 -0.683185 4.708698 -0.456231 2.287166 0.060141 0.762927 0.987364 0.034839 0.543395 0.377355
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.245859 0.007568 0.369602 -0.117766 -0.277597 -0.982381 0.693065 -1.178428 0.520309 0.541873 0.326382
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.680440 8.399370 -1.100009 5.281444 -0.729267 1.899430 0.101957 2.835009 0.538411 0.046212 0.411939
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.537567 -0.377340 -0.805308 0.064072 -0.308147 0.218802 0.591932 4.656297 0.525003 0.513558 0.330013
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 14.734563 13.978856 11.112844 11.168091 2.198874 1.772264 3.500860 4.785745 0.023836 0.032636 0.009282
66 N03 digital_ok 100.00% 47.37% 100.00% 0.00% 1.405522 14.359825 0.797310 11.291125 0.641638 1.713647 -1.798274 4.962749 0.205451 0.050392 0.096584
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.710087 -0.005762 -0.203314 1.266218 -0.150794 1.681525 3.783800 2.350633 0.552906 0.546050 0.341272
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 15.636504 -0.281015 11.165503 -0.322119 2.125967 -1.107723 3.855531 -0.790852 0.033580 0.559879 0.441295
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.748625 1.732106 1.260060 -0.494099 0.424942 2.447527 1.700376 2.280895 0.575700 0.574172 0.343687
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.213126 1.794763 1.010812 2.466442 0.837035 2.872877 3.714716 1.164663 0.242559 0.223769 -0.274162
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.697477 -0.073935 -0.242581 0.380392 0.835794 -0.435530 -0.468093 0.820214 0.588504 0.586106 0.346233
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.020230 8.147343 2.099858 9.410594 0.753263 1.533251 11.109354 1.783955 0.252335 0.093863 -0.006782
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.568836 1.068128 -0.561453 1.130478 -0.215822 2.046998 0.309079 2.701387 0.594504 0.588651 0.356712
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.777080 -0.062025 -0.830807 -0.116607 0.288864 0.712029 -0.544169 1.186087 0.588465 0.588246 0.353438
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 24.944093 7.438299 0.093076 -0.785091 2.554052 0.022561 1.807751 0.601898 0.354429 0.466677 0.238820
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 13.679516 -0.082934 0.016685 0.002016 -0.289661 -0.777244 -0.308184 -0.768119 0.408505 0.546941 0.318791
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.320867 -0.657200 0.792936 -0.761349 -0.164932 -0.315581 2.343873 0.120258 0.516278 0.533995 0.331207
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.708985 1.166909 -0.755918 0.844511 -1.253106 0.054778 -0.954352 -1.612122 0.535137 0.519563 0.342121
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 41.451016 23.289104 21.597521 17.284255 21.118421 17.313301 381.834138 205.812540 0.017594 0.016844 0.000867
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.227027 39.799011 21.413116 21.312190 92.097777 23.187717 570.101716 367.271789 0.016376 0.016265 0.000773
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 17.839675 23.510592 17.945193 16.213129 19.889036 10.731681 325.201899 189.044849 0.016544 0.016978 0.000834
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.006188 15.504514 0.443875 11.369930 -0.819953 1.556198 -1.738731 3.713268 0.551864 0.055751 0.416176
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.566615 -0.335079 -0.766954 -0.658579 -1.424468 -0.127044 -0.806028 -0.226043 0.572493 0.568495 0.340507
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.284429 0.384901 0.647398 0.149465 -0.207001 0.534093 -0.020471 8.622348 0.579052 0.572196 0.334067
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.433673 1.711588 2.393466 -0.840635 13.567914 -0.660330 143.263573 4.726787 0.458196 0.588029 0.325840
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.132355 0.967412 0.714167 1.195548 0.195724 -0.674661 -0.164189 0.137800 0.588280 0.583625 0.334724
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.427158 0.211304 0.684437 1.039530 -0.001692 0.378225 -0.203559 0.136634 0.585714 0.582537 0.341531
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.424298 -0.912975 0.044927 -0.982423 0.350997 -1.127013 -0.028897 0.195716 0.583027 0.587386 0.345441
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.062874 0.371649 0.861557 0.646003 0.810185 0.285708 -0.095632 0.019037 0.570726 0.580165 0.345784
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.568318 0.062596 8.838493 0.437749 2.228838 1.169031 0.378345 0.847278 0.035728 0.576145 0.400483
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.775864 8.269373 8.896576 9.380504 2.155894 1.645815 1.880316 1.738323 0.030194 0.025122 0.002522
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 7.128717 1.734978 8.999204 6.851628 2.199699 1.416827 0.828137 0.832134 0.027979 0.470160 0.318044
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.804635 -0.674846 -0.042584 -0.523293 -0.299851 -1.115104 0.672899 -0.742064 0.524050 0.546512 0.337193
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.080652 9.893742 0.024662 -0.706556 -1.525773 0.538239 -1.474207 3.103397 0.536896 0.467182 0.325257
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.009201 1.204197 -0.838506 0.478027 -0.467132 -0.727392 1.785685 6.356870 0.527039 0.509046 0.333839
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.521505 3.703705 0.203160 1.013804 0.929127 1.521861 -0.197868 0.186734 0.559205 0.556101 0.342450
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.035664 0.115341 -1.096061 -0.595974 -0.016798 0.388296 -0.792769 4.605163 0.574653 0.570558 0.338017
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.195996 1.927125 -0.163293 -0.275003 -1.011356 1.980759 1.186474 9.615232 0.571566 0.577783 0.332507
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.903730 31.350052 1.076239 5.583239 4.879477 -0.501781 1.811224 0.500554 0.573644 0.563442 0.335572
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.328534 0.201945 0.038890 0.611864 0.537267 0.071590 -0.018795 -0.017998 0.591516 0.588677 0.341884
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.156491 0.540484 0.184162 0.254062 -0.784920 -0.649857 0.429919 0.259367 0.586191 0.588328 0.337594
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.397920 0.545637 0.297050 -0.167296 0.500630 0.599684 0.680139 1.355512 0.581371 0.582219 0.334995
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.317418 1.413222 1.191663 2.152906 -0.197054 0.366023 9.071066 0.401871 0.574630 0.582058 0.343002
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.416996 8.189165 8.893838 9.171322 2.193529 1.715409 0.498584 1.653497 0.072170 0.036216 0.025005
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.662594 -0.256288 0.488738 -0.036706 3.256458 -0.417478 0.065158 -0.183697 0.470727 0.575691 0.323892
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 6.314621 8.127447 0.954630 9.235260 9.693398 1.676943 20.970091 1.948030 0.513814 0.065768 0.379765
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% -0.130898 3.533361 1.261392 7.967703 1.241860 -0.741284 0.795650 0.698008 0.222021 0.153660 -0.231619
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.634479 2.272243 1.582757 1.500828 1.101480 0.988661 -2.524608 -2.287488 0.522212 0.511356 0.327462
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.068548 2.889943 1.291151 3.284291 0.596330 0.564647 -1.924130 1.159619 0.511452 0.442807 0.326124
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.958561 -0.845433 -0.714812 -0.693919 -0.086153 -0.904689 -0.359852 -0.886388 0.514936 0.514867 0.325938
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 22.366537 28.961219 20.149907 24.210105 14.096739 32.282665 260.348313 528.552235 0.017098 0.016145 0.001092
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 16.198471 24.534970 17.749634 21.439728 16.299720 17.574294 241.373821 302.217341 0.016667 0.016236 0.000822
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.589599 0.530270 2.447430 -0.434347 1.136704 0.517643 1.650706 -0.277948 0.558713 0.567251 0.338123
121 N08 digital_ok 100.00% 3.05% 0.00% 0.00% 1.170164 1.712494 0.742898 4.831457 -0.330644 0.013830 2.254529 7.663088 0.504810 0.557431 0.339010
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.042143 2.210479 -0.402644 -0.751310 0.206316 0.116413 -0.413518 -0.525649 0.586379 0.587182 0.340731
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.231837 1.212784 1.403668 0.233714 0.975764 -0.289122 -2.199900 -1.339240 0.559071 0.582810 0.340046
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 6.635629 -0.037248 9.016248 0.764012 2.125211 0.776889 0.512596 0.553709 0.042989 0.591767 0.402655
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.718873 0.442736 2.557423 1.165263 0.595089 -0.462638 0.982226 0.109894 0.578206 0.586363 0.343215
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.155071 1.966187 0.281025 1.183926 -0.362687 0.676717 1.024123 0.249671 0.583248 0.583668 0.348671
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.364861 -1.028376 8.832022 -1.076985 2.218265 0.409903 0.345260 -0.270852 0.036813 0.578924 0.404407
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.005762 -0.604570 -0.406684 -0.776083 0.582592 -0.538490 0.622301 1.789718 0.564848 0.567591 0.349417
131 N11 not_connected 100.00% 0.00% 44.32% 0.00% -1.055562 7.865847 -0.902303 5.153234 -0.485268 1.151369 -0.874160 0.541657 0.554253 0.237720 0.396082
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.149118 -0.277984 -0.958518 -0.565605 -0.974099 1.121897 -0.518075 -0.141756 0.535379 0.523327 0.334574
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.132653 -0.998475 -0.579800 -1.042754 0.640862 -1.081263 -0.272935 -0.067240 0.525137 0.525693 0.332369
134 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.300405 1.487190 2.269461 0.995815 0.139260 0.337360 4.697397 -1.843253 0.448700 0.494954 0.328085
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.937700 -0.906863 -0.486414 -0.851028 4.089876 0.313127 0.209600 -0.034956 0.503837 0.509076 0.330849
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 6.025161 0.451665 8.618381 -0.072163 2.240646 0.695579 0.947771 1.346995 0.040852 0.507698 0.365478
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 21.842238 32.278206 21.085520 19.283711 30.393249 16.826900 532.645849 283.612114 0.016262 0.016373 0.000780
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.182713 -0.300482 -0.047473 -0.907496 -1.198786 -0.642235 -1.272433 0.417147 0.544089 0.543180 0.330569
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.250808 -1.090797 0.082339 -1.027109 -0.305488 -1.147299 1.196651 1.547188 0.564206 0.568039 0.331534
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.322024 -0.702430 0.109284 -0.465837 1.531526 -1.236659 -0.032489 -1.069657 0.576188 0.571998 0.333553
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.040151 8.159644 -0.214586 9.349566 1.546748 1.675873 15.716370 1.591116 0.582461 0.048642 0.472653
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.853176 7.991811 8.701379 9.323690 1.912736 1.781486 0.847731 1.877460 0.126537 0.032868 0.078974
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.216405 -0.765546 -0.325045 -0.293496 2.384895 -0.252708 -0.393895 -1.021043 0.587581 0.582380 0.342546
145 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.029810 0.162422 0.010294 0.519065 0.424903 1.885170 0.512366 1.750310 0.579780 0.576866 0.338097
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.378673 -0.883938 -0.725271 -1.105100 -0.970617 -0.778940 -0.351661 -0.335519 0.561517 0.569640 0.345726
147 N15 digital_ok 100.00% 97.78% 98.06% 0.00% nan nan inf inf nan nan nan nan 0.482485 0.522574 0.480707
148 N15 digital_ok 100.00% 96.95% 97.23% 0.00% 126.911233 126.511192 inf inf 2192.876396 2195.161442 4543.323302 4531.370059 0.509654 0.500138 0.465668
149 N15 digital_ok 100.00% 98.34% 98.34% 0.00% 92.132114 89.112545 inf inf 1707.692081 1846.934093 4198.406749 4671.946442 0.315557 0.229692 0.299661
150 N15 digital_ok 100.00% 97.78% 97.78% 0.00% 127.867357 128.023902 inf inf 2197.057185 2193.865959 4596.561913 4565.119616 0.425785 0.359659 0.386070
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 9.110274 -0.524833 -0.696906 0.975165 -0.404384 0.994504 -0.619761 6.574173 0.438979 0.512506 0.301267
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.357539 -0.863084 8.736265 -0.315514 2.252151 0.802452 1.708884 0.605344 0.043342 0.511211 0.378315
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.455298 8.063277 6.198203 9.210865 0.346858 1.785735 4.936038 2.075737 0.438188 0.040203 0.332614
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.406368 0.042884 0.534147 0.799278 0.671516 0.681231 0.313926 0.640075 0.524986 0.529635 0.339990
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.269449 -0.766281 -0.896250 -0.936464 0.215429 0.432278 1.973364 10.720170 0.540664 0.543627 0.342954
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.194847 11.302695 0.007637 0.030462 0.085686 0.043760 1.112954 1.833725 0.520468 0.430340 0.311333
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 6.922715 -0.592773 8.816856 -0.259203 2.398555 0.805272 1.571814 0.978179 0.046364 0.562760 0.434719
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.308606 16.899293 0.463050 0.423140 1.609655 0.084355 0.704200 1.303097 0.565017 0.462317 0.313644
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.780943 -1.061248 -0.673342 -1.063274 0.323359 0.432141 0.041609 -0.506734 0.578406 0.581443 0.337611
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.011897 0.652603 0.352106 0.592301 1.000452 1.346632 0.481924 1.028183 0.583902 0.586923 0.345849
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.385695 0.748766 1.200012 1.122460 4.701552 2.260467 2.323977 1.404654 0.581825 0.583514 0.338243
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 11.809342 -0.303630 0.505784 -0.213305 0.024028 0.376954 1.764689 -0.134911 0.482966 0.581531 0.325366
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.229475 -0.489353 0.970857 -0.368316 0.367540 -1.118254 0.189823 -1.129779 0.578834 0.574854 0.339098
167 N15 digital_ok 100.00% 97.51% 97.78% 0.28% 122.002517 122.216346 inf inf 2169.024810 2173.317733 4402.521261 4389.997374 0.465871 0.376544 0.356124
168 N15 digital_ok 100.00% 98.06% 98.06% 0.00% 127.877617 128.019091 inf inf 2197.700277 2180.349640 4559.955506 4507.823016 0.472648 0.493626 0.422758
169 N15 digital_ok 100.00% 98.61% 98.34% 0.00% 129.031987 128.976709 inf inf 2912.722841 2910.510554 6945.903219 6930.200491 0.371117 0.486042 0.355383
170 N15 digital_ok 100.00% 97.78% 97.78% 0.28% 107.319283 107.211373 inf inf 2268.556515 2247.455651 4762.332768 4702.118876 0.322780 0.387057 0.286111
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.219434 -1.218057 0.479167 -1.134897 0.073140 -1.206524 -0.053410 -0.153721 0.510382 0.524495 0.335596
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.798049 0.297431 1.105510 0.002081 0.464090 -1.005669 -2.076100 -0.536880 0.522817 0.519667 0.340755
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.672743 2.394447 1.622304 1.557049 1.466778 1.093936 -2.542640 -1.929271 0.492148 0.476424 0.324793
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.414596 -0.841230 0.065220 -0.478521 -0.890550 2.332051 -0.317396 -0.269972 0.541005 0.542952 0.345595
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.283345 8.548907 -0.629901 9.429491 1.422737 1.736805 10.357903 2.519396 0.556023 0.055240 0.450279
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.974682 0.390632 1.318797 1.000273 1.098512 0.327127 0.041356 3.341048 0.567954 0.566260 0.346082
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.613937 8.028619 -0.856056 9.159017 -1.086091 1.794832 1.033954 2.309331 0.572999 0.050664 0.427973
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.323752 0.674136 0.573980 0.926729 1.175482 0.208284 0.220261 0.421192 0.576453 0.572659 0.334603
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 8.961729 -0.250898 7.309047 -0.119219 0.450022 2.031994 3.064201 0.512799 0.342510 0.580709 0.371565
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.190044 -0.135986 -0.626422 0.068893 0.008511 -0.062076 3.548371 0.293382 0.582959 0.577690 0.343656
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.101663 -1.057685 -0.577844 -1.040938 -0.933073 -1.145602 -0.872576 -0.580086 0.579679 0.578962 0.343227
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.088469 -0.854027 -0.152323 -0.676480 0.597317 0.690576 2.017832 -0.640980 0.568180 0.561956 0.341701
189 N15 digital_ok 100.00% 97.78% 97.23% 0.00% nan nan inf inf nan nan nan nan 0.481625 0.473346 0.447100
190 N15 digital_ok 100.00% 97.51% 97.78% 0.00% 117.715226 117.852448 inf inf 2322.677778 2331.148842 4882.825061 4959.319500 0.475434 0.391465 0.483896
191 N15 digital_ok 100.00% 98.34% 98.34% 0.00% 114.128298 113.798504 inf inf 2263.880952 2257.812078 4797.482561 4782.675635 0.357513 0.493335 0.417832
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.273694 2.558938 1.422821 1.655510 1.106692 1.142457 -2.343882 -2.447743 0.499074 0.479665 0.326228
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.884924 2.144572 1.743367 1.444189 1.550252 1.078709 -2.623550 -2.306535 0.485201 0.476919 0.322034
200 N18 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.530238 18.952239 4.860072 0.167527 2.250797 1.181208 1.197203 1.722730 0.040742 0.253231 0.169627
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.228696 1.876321 0.826593 1.339840 0.172692 0.728754 -1.771079 -2.234387 0.540708 0.519038 0.340203
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% -0.028899 -0.111679 -0.017694 -0.329093 -1.381253 1.470213 -1.398153 35.189421 0.553508 0.543565 0.331286
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.872470 6.288366 1.550548 -0.576201 0.846895 -0.183355 14.396620 0.429037 0.568839 0.567327 0.336898
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.841892 -0.782525 3.528294 -0.912326 -0.076247 -0.270647 1.703825 3.151205 0.371979 0.556429 0.384989
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.703374 2.213175 1.165321 2.783860 -1.037555 -0.919715 0.118640 0.785022 0.509161 0.467658 0.314926
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.350759 -0.815707 -0.928453 -1.034478 0.209058 -0.738533 4.358699 -0.600046 0.529181 0.543947 0.332204
208 N20 dish_maintenance 100.00% 98.61% 98.34% 0.28% nan nan inf inf nan nan nan nan 0.364190 0.316283 0.252858
209 N20 dish_maintenance 100.00% 98.89% 99.17% 0.00% nan nan inf inf nan nan nan nan 0.374019 0.229106 0.350209
210 N20 dish_maintenance 100.00% 98.34% 98.61% 0.28% nan nan inf inf nan nan nan nan 0.397066 0.326374 0.255303
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.037541 8.392661 -0.583091 5.273185 -0.018370 1.639126 0.019923 1.113645 0.515064 0.039082 0.426966
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.851075 -0.962832 -0.614466 -1.095678 -0.965874 -0.298170 0.523438 -0.532779 0.541268 0.528722 0.336039
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.707471 -0.652504 -0.828973 -1.024289 0.630810 -0.793772 2.615118 -0.479428 0.541152 0.542929 0.334305
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.502078 -0.692842 -0.921960 -0.734765 -0.626111 -1.228135 1.324710 -0.884237 0.546906 0.547270 0.334192
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.840477 -0.071637 -0.304736 1.238870 -0.338725 -0.074964 -0.118402 14.122547 0.542830 0.517352 0.332392
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.137850 2.403117 1.920601 1.611009 1.789680 1.077986 -2.732033 -2.298560 0.510652 0.510767 0.317321
225 N19 RF_ok 100.00% 0.00% 89.75% 0.00% -0.358486 8.002316 -0.334726 5.082413 -1.158706 1.500285 -1.203697 1.404861 0.547394 0.153055 0.434488
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.821858 8.505660 -1.113867 -0.630179 -0.489012 -0.315661 -0.682988 -0.491328 0.542571 0.455621 0.330006
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.241090 -0.503673 2.183879 -0.865606 0.061205 -0.537122 12.333547 0.102728 0.468033 0.522623 0.345017
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.232981 -0.366944 -0.361584 -0.580785 -1.470156 -0.214513 -0.290739 0.339162 0.524773 0.514264 0.328815
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.058309 -0.007993 -0.423245 -0.028395 -1.352184 -0.674320 -0.535082 -1.352783 0.518120 0.510078 0.336236
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.167074 -0.736035 0.612514 -0.675639 -0.351439 -0.273888 1.136019 -0.388948 0.494304 0.516340 0.340116
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.408138 -0.563258 -0.286919 -0.409287 -1.426803 -0.670449 -1.233243 -1.135756 0.535972 0.524769 0.345820
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.954655 -0.864521 -1.028394 -0.830073 -1.221788 -0.213939 -0.802705 1.268060 0.537903 0.530241 0.339919
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.847424 -0.387864 0.612522 -1.038493 -0.344161 -1.010297 1.841850 0.148464 0.504163 0.530332 0.341138
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.299791 -1.021297 -1.022608 -0.765020 -0.437503 -1.136524 0.134575 -0.902923 0.537084 0.530450 0.339504
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 9.334111 -0.243631 -0.693845 -0.174530 -0.298318 -1.042202 2.127317 -0.909686 0.430838 0.527483 0.326925
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.287749 -0.836322 -0.331233 -0.637571 -0.549172 0.074702 -1.019047 -0.217212 0.438112 0.522029 0.328073
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.153449 -0.486810 0.089989 -0.155097 -0.476901 -0.152637 1.138408 1.832917 0.512828 0.517190 0.324195
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.645493 -0.330125 -0.489971 -0.788752 -1.373709 -0.580501 -1.223663 0.284591 0.524905 0.513902 0.332808
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.457861 8.710910 -1.046738 4.931690 -0.337645 1.692673 -0.290403 0.508473 0.512528 0.038871 0.421386
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.616329 -0.612423 -0.635086 -0.986075 -1.036693 -1.017251 2.623645 -0.575256 0.512889 0.502119 0.332336
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.439023 7.213552 0.309821 0.413594 1.246673 0.081447 -0.056554 0.832105 0.522577 0.510912 0.343359
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.359331 0.113871 0.649635 -0.030477 -0.409537 -0.820432 -1.809996 -0.515573 0.416590 0.403297 0.306111
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.899547 0.925613 -0.090268 0.044912 -1.073835 -0.662559 -1.104773 -1.156728 0.403049 0.390734 0.287417
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.213697 -0.894587 -0.200075 -0.596509 -1.491177 -0.466458 -1.294353 -0.054513 0.438477 0.423827 0.316283
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 7.363697 8.365288 4.788898 5.387461 2.105076 1.588719 0.471192 0.482475 0.041236 0.039200 0.002355
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.164705 0.169288 -0.094255 -0.540295 0.118930 -0.554195 0.712827 -0.013455 0.406872 0.407359 0.288975
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, 31, 32, 34, 37, 38, 40, 42, 47, 51, 53, 54, 55, 56, 58, 59, 60, 61, 63, 64, 65, 66, 68, 70, 72, 77, 78, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 102, 103, 104, 108, 109, 110, 111, 112, 117, 118, 121, 124, 127, 131, 134, 135, 136, 137, 142, 143, 145, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 164, 165, 167, 168, 169, 170, 180, 182, 184, 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, 29, 30, 35, 36, 41, 43, 44, 45, 46, 48, 49, 50, 52, 57, 62, 67, 69, 71, 73, 74, 79, 80, 85, 88, 89, 90, 91, 95, 101, 105, 106, 107, 113, 114, 115, 120, 122, 123, 125, 126, 128, 132, 133, 139, 140, 141, 144, 146, 157, 162, 163, 166, 171, 172, 173, 179, 181, 183, 185, 186, 187, 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, 29, 30, 41, 44, 45, 67, 69, 71, 85, 88, 91, 101, 105, 106, 107, 122, 123, 128, 140, 141, 144, 146, 157, 162, 163, 166, 171, 172, 173, 181, 183, 186, 187, 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_2460059.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 [ ]: