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 = "2460044"
data_path = "/mnt/sn1/2460044"
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-9-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/2460044/zen.2460044.21294.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 1292 ant_metrics files matching glob /mnt/sn1/2460044/zen.2460044.?????.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/2460044/zen.2460044.?????.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 2460044
Date 4-9-2023
LST Range 7.717 -- 14.670 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1292
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 64 / 198 (32.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 126 / 198 (63.6%)
Redcal Done? ❌
Never Flagged Antennas 70 / 198 (35.4%)
A Priori Good Antennas Flagged 65 / 93 total a priori good antennas:
7, 15, 17, 30, 31, 37, 38, 40, 42, 45, 53,
54, 55, 56, 65, 66, 67, 70, 71, 72, 81, 83,
86, 93, 94, 101, 103, 107, 109, 111, 112, 118,
121, 122, 123, 124, 127, 136, 140, 145, 147,
148, 149, 150, 151, 158, 160, 161, 162, 164,
165, 167, 168, 169, 170, 173, 181, 182, 184,
189, 190, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 42 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 50, 57, 61, 62,
64, 73, 74, 89, 90, 95, 115, 120, 125, 126,
132, 133, 139, 179, 185, 201, 220, 222, 228,
229, 237, 238, 239, 240, 241, 244, 245, 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_2460044.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.175420 22.885807 -0.926635 -0.509593 -0.547367 0.819638 -1.161530 8.099017 0.584092 0.466737 0.381843
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.353773 -0.116187 0.277323 3.549292 0.804657 1.764813 -0.509611 1.039049 0.591371 0.587777 0.385590
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.853353 0.345847 -0.715492 0.237943 0.041286 0.471821 9.217055 15.870810 0.600228 0.607212 0.375959
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.490086 3.056495 2.135893 1.994243 1.311566 1.465708 -2.446328 -1.563154 0.578307 0.590169 0.364549
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.804415 -0.441425 3.290915 -0.431750 0.194691 0.115317 1.812627 -0.495466 0.575419 0.610083 0.380416
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.276209 -0.144511 0.128141 -0.671715 -0.861353 -0.248134 2.788627 0.619288 0.586782 0.595248 0.371805
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 21.045070 -0.308410 -0.535626 -0.568984 1.567940 0.096839 -0.162338 2.294012 0.455961 0.608476 0.383733
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.589706 2.305831 0.941424 1.630341 -0.195561 0.755962 -2.065108 -2.419006 0.595596 0.601533 0.380102
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.575032 4.487717 0.953500 8.924452 0.700440 0.087772 -0.129522 4.120007 0.601613 0.448562 0.426069
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.058042 7.499473 0.853728 1.427628 0.860445 -0.007740 10.269980 22.351354 0.592897 0.401983 0.435671
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.202217 -1.094219 -0.401758 -0.809373 0.156626 1.511290 0.178205 2.609421 0.609691 0.629791 0.376981
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.648822 -1.219369 2.064910 -0.359479 1.807611 -0.221480 1.672367 0.158531 0.599311 0.625214 0.374676
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.732697 0.884255 -0.108362 0.379062 0.700068 0.690867 0.069293 0.469237 0.595604 0.611700 0.370063
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.435870 -0.868783 -0.989879 -1.122603 -0.333948 1.034795 -0.466213 -0.644260 0.563897 0.586594 0.372019
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.998105 27.443725 9.652996 6.102679 3.225180 2.910478 9.842555 66.805506 0.067187 0.071119 -0.030894
28 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.147842 17.947542 9.785694 4.065865 3.313020 0.991413 1.426782 22.984905 0.030268 0.283025 0.217355
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.184155 -0.219131 -0.260005 0.135348 0.514590 1.469527 2.089891 3.906538 0.619659 0.629887 0.375315
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.251406 -0.935016 0.454656 -0.772251 1.778017 0.097653 8.698845 -0.031496 0.616837 0.635942 0.373620
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.632367 -0.623223 1.197518 3.205598 1.362983 -0.144217 0.302868 22.163226 0.626656 0.623182 0.369857
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 19.988816 20.782934 -0.358022 -0.159876 -0.055760 -0.359888 1.470662 4.180655 0.505623 0.541491 0.226143
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 10.631685 0.005035 5.196339 -0.481009 3.250224 -1.326401 0.742244 0.890848 0.042781 0.602729 0.442864
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.385533 -0.999341 -0.006972 -0.677267 -1.130446 0.057443 -0.775359 -0.349695 0.577925 0.585389 0.371211
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.399554 6.872399 1.195687 0.993481 0.842214 1.344499 0.019274 0.659005 0.573292 0.582405 0.400951
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.369332 21.654398 -0.462423 12.327399 -0.580925 3.514799 -0.897295 3.238534 0.586422 0.032325 0.472997
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.292706 0.271219 -0.197400 0.378573 0.184210 -0.129111 6.378421 11.191445 0.599271 0.606830 0.397392
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 1.111999 2.052306 0.028094 -0.311163 1.334901 0.214219 17.019751 2.138460 0.237226 0.228622 -0.292327
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.485483 0.916608 1.332852 2.351503 1.915529 0.006850 -0.100196 0.173317 0.609905 0.624886 0.373075
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% 0.118240 3.006150 -0.375346 -0.695757 1.752274 0.519836 -0.156769 1.912444 0.260959 0.247401 -0.290111
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.513042 0.268958 -0.806536 0.971881 -0.437598 1.084338 -1.085781 0.925842 0.627416 0.637823 0.366834
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.482579 0.762301 -0.957115 0.649619 -0.229047 0.408309 -0.690760 -0.012838 0.630052 0.645348 0.370172
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.703072 3.484619 0.884142 0.860325 0.469848 1.930024 0.170607 9.145654 0.618107 0.627642 0.364746
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.489978 -0.262364 0.015119 -1.202615 0.275694 0.033534 -0.232450 -0.491647 0.616342 0.642534 0.381465
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 9.754302 13.069336 5.109845 5.264206 3.261749 3.451680 2.122024 0.422897 0.031691 0.051403 0.013361
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.240335 0.382487 -0.688338 0.531979 -0.866035 -0.167230 -1.155165 -1.837969 0.577441 0.602145 0.373171
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.554058 -0.843781 0.440008 -0.823898 -0.515207 -0.837434 -0.191981 -0.062937 0.545279 0.586158 0.378959
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.825640 1.219086 0.525331 1.866510 0.230128 1.623822 -0.244170 0.077275 0.572898 0.579828 0.396377
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.528468 1.700644 -0.041020 -0.327019 1.148188 0.792289 104.088554 1.388617 0.576678 0.597449 0.392444
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.058365 5.040130 0.577400 0.453348 1.092038 1.233148 3.957813 0.811099 0.600202 0.610068 0.389819
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.683512 1.451851 -0.115494 -0.668290 1.596632 -0.407371 11.237178 7.048490 0.610360 0.624186 0.386950
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 8.249512 3.456789 1.676012 -0.644114 1.985855 2.041536 -0.089929 -0.190361 0.303878 0.364293 0.160069
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.789852 47.911312 0.420266 7.078191 -0.124823 3.947510 2.451452 0.995318 0.265113 0.040248 0.099202
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.555208 1.883465 -1.068633 2.343277 -0.230714 4.170731 -0.461809 4.934409 0.627610 0.620037 0.355731
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.587148 1.837990 -0.698816 -0.439979 -0.047279 0.022404 0.247313 1.734234 0.633955 0.639089 0.360280
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.537273 12.262615 9.814089 10.504804 3.237012 3.465548 1.138034 0.994005 0.036692 0.035809 0.001871
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.615413 0.886114 9.842990 1.249459 3.180257 2.277014 0.446157 12.545838 0.044972 0.637065 0.473282
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.844800 12.209172 0.103863 10.538542 0.061580 3.475743 1.072476 2.787346 0.601921 0.075139 0.480206
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.993223 -0.366026 0.862176 -0.648777 0.928633 -0.713033 -0.338709 0.875360 0.556506 0.604563 0.372318
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.165772 0.673440 0.222177 0.381201 -0.817632 -0.961656 1.044432 -1.554298 0.555906 0.603405 0.376187
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.367578 12.597272 -0.941634 5.637297 -0.815017 3.516635 -0.479907 2.314049 0.583126 0.043409 0.453677
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.524168 -0.334717 -1.217948 -0.104319 -0.645071 -0.658114 0.340730 2.681923 0.564769 0.569794 0.368960
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 22.259643 21.583226 12.559392 12.720469 3.367799 3.592559 5.032691 6.362486 0.023546 0.031483 0.008267
66 N03 digital_ok 100.00% 28.95% 100.00% 0.00% 3.027988 22.247388 1.728368 12.872010 0.641000 3.489450 -2.313396 5.878285 0.214492 0.044900 0.097359
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.474477 -0.189759 -0.358525 1.581984 -0.115533 0.967131 4.713738 1.805093 0.599990 0.608664 0.386806
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 23.835154 0.003446 12.629730 0.083511 3.255781 -1.029497 4.723509 -1.147646 0.033121 0.623006 0.483634
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.837878 2.427605 1.461709 -0.703544 0.323497 1.348672 3.685086 1.866308 0.615584 0.633705 0.374682
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% 0.083789 2.678564 1.165985 2.941394 2.212358 0.387565 3.702066 0.535089 0.263808 0.241771 -0.281384
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 5.769368 -0.088336 -0.443452 0.535619 0.146887 0.043071 -0.397538 1.308459 0.636619 0.647971 0.365478
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.348698 12.496385 2.474584 10.654841 2.958703 2.993900 13.653875 2.146685 0.290808 0.093300 0.019214
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.485201 1.392960 -0.783495 1.381041 0.476655 0.420112 -0.139734 0.655751 0.639529 0.647081 0.365674
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.766088 0.236524 -0.496942 -0.057189 -0.329711 0.461601 -1.351862 0.695197 0.634811 0.649046 0.370305
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 44.692064 16.339339 0.336153 -0.673208 1.908670 -0.061701 7.409387 0.069174 0.341692 0.504183 0.274842
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 24.524311 0.422151 -0.306092 0.506824 0.481512 -0.582220 2.429696 -0.652229 0.421696 0.609831 0.363587
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.526030 12.870051 -0.686409 5.609555 -0.601921 3.428529 0.530630 -0.127909 0.570091 0.039387 0.450630
80 N11 not_connected 100.00% 0.00% 48.14% 0.00% -0.671400 12.208032 -0.203002 5.244571 -0.824488 1.205096 -1.159000 1.147476 0.577953 0.196050 0.448722
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 71.835050 38.609934 22.920399 20.655642 7.384443 7.666525 392.926931 299.494393 0.018544 0.016871 0.001427
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 31.200826 50.298622 21.343534 21.112221 6.624672 7.796573 293.991461 344.897463 0.016793 0.016602 0.000844
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 32.493728 51.117563 21.973637 23.690563 10.348332 11.785523 445.030683 509.880302 0.016501 0.016300 0.000751
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 4.096680 24.357298 1.259741 12.971474 0.110765 3.366347 -2.425562 4.465409 0.603054 0.049889 0.470356
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.600955 2.921307 -0.693269 -0.365702 -0.392587 1.448208 -0.071640 1.462442 0.618183 0.631320 0.369418
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.937355 0.817740 0.819810 0.257620 1.201077 0.836018 0.205285 16.766060 0.623946 0.635703 0.359813
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 14.509223 4.636211 2.510906 -0.773223 9.331802 -0.404982 38.684360 2.205660 0.533206 0.654616 0.352620
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.607080 0.987618 0.802988 1.578891 0.203864 -0.229646 1.441157 0.468886 0.629938 0.642591 0.355143
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.186359 0.452634 0.814352 1.319177 0.089975 0.898618 -0.420303 -0.132014 0.631532 0.643972 0.359222
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.386097 -0.537698 -0.413345 -0.866908 -0.491151 -0.891882 -0.403164 0.972971 0.626525 0.648546 0.365699
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.015055 0.466481 0.974652 0.869938 0.400127 0.613737 0.885347 0.189047 0.615425 0.638369 0.368515
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.074631 0.128360 9.834172 0.548743 3.302372 1.491028 0.126593 1.006283 0.034879 0.635444 0.436569
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.375590 12.499663 9.915653 10.586147 3.219730 3.444580 2.019232 1.791550 0.030320 0.025004 0.002779
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.034197 12.723233 10.019725 10.423674 3.251147 3.473950 0.648496 0.657188 0.025464 0.025292 0.001066
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 3.143640 1.025686 -0.993274 0.092681 1.597080 1.148274 -0.720329 -0.502920 0.430089 0.437443 0.196345
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.373850 22.065408 0.676690 -0.521987 -0.373466 0.481372 -1.911239 1.071473 0.584602 0.489212 0.367489
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.462994 2.344741 -1.191553 0.462034 -0.766861 -1.045952 0.275793 9.160668 0.564668 0.560645 0.373942
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.087325 7.145219 0.221752 1.320505 0.649506 1.394476 0.085714 1.241413 0.606877 0.618175 0.375737
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.652814 0.985364 -1.132977 -0.258879 0.608593 0.730552 -0.872045 7.721492 0.623915 0.634946 0.371536
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.132666 4.538198 0.617425 -0.961667 -0.608807 0.412215 2.321237 5.184352 0.626544 0.642227 0.363061
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.710958 52.579040 1.167202 6.859127 2.703739 -0.561814 1.375164 2.393112 0.623524 0.619103 0.353525
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.163393 0.651943 0.493028 1.400988 0.980104 0.586356 0.065281 0.013060 0.632781 0.643918 0.356599
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.737735 1.256360 0.182170 0.388378 0.011985 -0.006850 -0.106853 0.012838 0.630718 0.648281 0.358900
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 1.529717 4.664800 -0.204737 -0.663543 0.858852 0.059037 5.655834 4.218996 0.628406 0.641977 0.350409
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.451616 2.314566 1.416543 2.619018 0.392154 0.802406 18.050427 0.496601 0.615983 0.637500 0.363571
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 8.891164 12.323952 9.906225 10.326135 3.298736 3.531124 0.316676 1.602045 0.063012 0.035262 0.019689
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 27.947619 0.040735 0.464321 0.069239 1.187668 0.374851 0.527689 -0.443414 0.501428 0.632298 0.350338
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 12.465031 12.270894 0.903844 10.406294 4.076983 3.507195 65.770368 2.047305 0.552813 0.060428 0.412558
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% -0.400562 6.528843 1.511880 9.241549 2.481666 1.342699 0.437672 0.473722 0.235786 0.139824 -0.240582
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.852482 13.433972 4.855940 5.600787 3.198193 3.419752 1.246981 0.729402 0.033252 0.030984 0.001503
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 11.620234 0.586742 4.996664 -0.536378 3.187622 -0.864355 0.043829 0.812475 0.044311 0.585874 0.449166
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.344423 -1.113016 -1.081278 -0.436032 -0.809880 -1.061142 -0.554888 -0.761457 0.551318 0.575778 0.383290
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 27.422589 45.252851 19.867637 26.204827 5.351514 15.301082 273.078770 649.053758 0.017925 0.016223 0.001481
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 28.823702 48.253682 21.945653 28.108884 11.367152 16.592991 492.160450 625.153608 0.016552 0.016182 0.000808
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.596452 1.231459 2.823407 -0.577984 0.641046 1.021045 3.405397 1.782134 0.604172 0.633444 0.373850
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.398488 2.883842 1.816774 5.891109 0.963500 0.195742 2.164958 13.551468 0.615426 0.616896 0.353848
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.021897 5.012106 -0.390367 -0.884338 -0.279334 0.290260 -0.390583 -0.666676 0.635492 0.649098 0.363867
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.956638 4.151571 2.581393 0.832943 1.866978 0.019511 -2.951508 -1.709985 0.613950 0.646641 0.364497
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 9.194486 0.782145 10.059512 0.978933 3.198545 1.340512 0.342211 2.101648 0.040788 0.652532 0.438545
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.257316 0.938082 2.568349 1.484229 0.349793 -0.150970 0.610997 0.483040 0.620485 0.640852 0.363156
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.690726 0.516574 0.386511 1.228177 0.901086 1.269081 2.480200 -0.176136 0.627636 0.642832 0.365773
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 8.886697 -0.758517 9.829389 -1.086946 3.315046 -0.001045 0.168010 2.615315 0.035233 0.643529 0.436530
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.355386 -0.926116 -0.619544 -0.521043 -0.076779 -0.450457 2.133608 2.509495 0.617741 0.632762 0.386120
131 N11 not_connected 100.00% 0.00% 39.40% 0.00% -1.170272 12.202829 -0.489627 5.553791 -0.753006 2.820473 -0.999645 0.236889 0.581741 0.235062 0.429695
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.123587 -0.047600 -0.592090 -0.780583 -0.541058 0.146854 0.204684 -0.307400 0.569816 0.577277 0.374528
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.122742 -1.354022 -0.912762 -0.930211 -0.416988 -1.272852 -0.561521 0.443473 0.555340 0.580773 0.383877
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.226564 13.489781 4.975926 5.578323 3.218047 3.452093 0.225995 0.747331 0.039562 0.034205 0.002993
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.119838 -1.210014 -0.877115 -1.036312 1.532019 0.600805 8.380970 0.698301 0.553372 0.578963 0.398139
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 8.246013 -0.288462 9.571439 -0.188278 3.307792 0.264019 1.577592 1.295629 0.038755 0.581993 0.431035
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 33.051760 56.757020 23.360424 25.149378 13.820173 10.943214 613.603357 558.534882 0.016360 0.016239 0.000723
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.186325 -0.038794 0.614205 -1.168211 -0.391080 -1.112895 -0.385712 1.680716 0.595206 0.606018 0.364910
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.775628 -0.899299 0.011407 -0.924058 0.012148 -0.991957 5.774045 2.255432 0.616095 0.637700 0.367577
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.466775 -0.831618 0.039677 -0.154879 0.830960 -0.937289 0.421857 -1.291634 0.623471 0.639503 0.363126
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.081226 12.250385 -0.394558 10.546111 1.608861 3.484071 20.363574 1.572539 0.626918 0.045091 0.518878
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.938222 12.209908 9.720579 10.520373 2.875161 3.473400 0.421284 1.685176 0.100819 0.031479 0.057916
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.309967 -0.413488 -0.518520 -1.105807 0.748282 1.907183 -0.391813 0.090748 0.637129 0.652496 0.366874
145 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.033935 0.226777 0.213301 0.727647 -0.095163 3.828814 0.203874 0.622888 0.629013 0.638876 0.361588
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.368657 -0.876823 -1.182763 -1.092732 -0.808165 -1.076602 -0.156754 -0.393975 0.601728 0.627094 0.368368
147 N15 digital_ok 100.00% 98.99% 99.15% 0.00% nan nan inf inf nan nan nan nan 0.432077 0.412396 0.352922
148 N15 digital_ok 100.00% 99.07% 99.07% 0.00% nan nan inf inf nan nan nan nan 0.478530 0.461522 0.392337
149 N15 digital_ok 100.00% 99.15% 99.07% 0.00% 195.554851 196.263327 inf inf 2072.290796 2080.932652 7051.071381 7200.323517 0.482679 0.551862 0.533112
150 N15 digital_ok 100.00% 98.92% 98.76% 0.00% nan nan inf inf nan nan nan nan 0.468911 0.467031 0.408120
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 18.535300 -0.625744 -0.607713 1.121001 0.901544 0.186726 -0.153716 8.477761 0.450926 0.560096 0.336139
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 8.944855 -0.951398 9.716514 -0.427754 3.299015 0.230360 1.879516 0.517628 0.040273 0.583706 0.444227
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.021554 12.148512 7.257451 10.374359 -0.410907 3.536621 2.037322 1.936640 0.463780 0.038181 0.362544
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.686795 0.027578 0.552162 1.061328 0.599794 1.275919 -0.260772 -0.199236 0.572741 0.598648 0.384876
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -1.021572 -1.123792 -1.213459 -1.152805 0.918176 0.565899 3.172651 12.646137 0.591363 0.616567 0.384695
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.601028 19.586969 -0.325823 -0.536448 -0.443978 1.105272 0.014944 19.986941 0.563382 0.496904 0.341040
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 9.663547 -0.883906 9.811829 -0.298108 3.262076 1.367530 0.359535 -0.187750 0.043980 0.630318 0.498518
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.055004 27.949213 0.470544 0.290956 0.784886 -0.290425 -0.489766 0.411001 0.615657 0.509863 0.339872
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.837343 -1.193168 -0.327417 -1.204144 -0.016403 0.459835 4.546945 -0.526064 0.628400 0.644859 0.369112
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.175493 1.244481 0.384200 0.798913 0.713008 1.736988 -0.204101 0.564313 0.631256 0.646391 0.371469
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.230956 0.789456 1.588630 1.431344 6.162888 2.169720 0.422746 1.235514 0.623800 0.641456 0.363375
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 20.512212 -0.026386 0.145328 -0.212013 3.561116 0.502051 41.020605 0.018543 0.522361 0.641804 0.360997
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.541966 -0.300496 1.118825 0.006972 0.363681 -1.134745 0.072036 -1.351918 0.618312 0.637141 0.364565
167 N15 digital_ok 100.00% 98.99% 98.84% 0.00% nan nan inf inf nan nan nan nan 0.457002 0.532290 0.445386
168 N15 digital_ok 100.00% 99.30% 99.30% 0.00% nan nan inf inf nan nan nan nan 0.426885 0.440519 0.436956
169 N15 digital_ok 100.00% 99.30% 99.23% 0.00% nan nan inf inf nan nan nan nan 0.451114 0.505747 0.382464
170 N15 digital_ok 100.00% 98.84% 98.61% 0.00% nan nan inf inf nan nan nan nan 0.509709 0.519480 0.421303
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.300180 -1.543917 0.890049 -1.115443 -1.029692 -1.264417 -0.159748 0.176189 0.536382 0.581564 0.384116
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.650155 0.732001 2.159296 0.585507 1.389245 -0.693263 -2.898819 -0.583067 0.566005 0.578575 0.384307
173 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.307451 4.733179 2.883856 2.734907 2.586771 2.752574 -3.535834 -2.596668 0.533879 0.541604 0.373372
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.380001 -0.763509 0.292601 -0.438670 0.250618 0.775900 -0.426469 3.607262 0.586710 0.611855 0.382922
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.114912 12.926081 -0.929806 10.644800 0.765944 3.445232 18.404093 2.028863 0.606845 0.051679 0.508530
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.290699 0.547163 1.515923 1.331489 -0.250891 0.591497 -0.098816 5.320081 0.609838 0.626214 0.376765
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.166184 12.068105 -0.683344 10.310811 -0.585380 3.534651 2.604882 2.109370 0.622684 0.047274 0.478276
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.668882 -0.153585 0.595350 1.235310 1.325230 0.767622 2.904582 1.821479 0.612857 0.630799 0.360550
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 14.906894 -0.221849 7.834025 -0.212260 4.200784 0.632649 4.876953 -0.202910 0.389480 0.638853 0.403384
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.021979 -0.244379 -1.208746 0.089860 -0.109387 -0.354031 -0.863268 0.193833 0.626936 0.638173 0.371049
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.962036 -1.081569 -0.073133 -0.857136 -0.752257 -0.733864 -1.358923 -0.930066 0.623547 0.638158 0.372746
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.260226 -0.675542 -0.422085 -0.380584 0.509826 -0.018093 3.275585 -0.746814 0.614201 0.628051 0.376209
189 N15 digital_ok 100.00% 98.61% 98.30% 0.08% nan nan inf inf nan nan nan nan 0.480825 0.566347 0.405400
190 N15 digital_ok 100.00% 98.53% 98.37% 0.00% 213.043630 212.046978 inf inf 2462.490075 2461.481345 4551.562518 4547.893553 0.518942 0.592891 0.450828
191 N15 digital_ok 100.00% 98.92% 98.92% 0.00% nan nan inf inf nan nan nan nan 0.453834 0.426674 0.362622
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.493143 5.143538 2.685237 2.925408 2.022487 2.786630 -3.162149 -3.368251 0.545747 0.543617 0.367973
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.816755 4.362913 3.127302 2.649058 2.544949 2.577316 -3.712238 -3.239078 0.528901 0.539191 0.372215
200 N18 RF_maintenance 100.00% 100.00% 44.12% 0.00% 10.610446 34.025053 5.036558 0.089766 3.298480 1.576207 1.327423 3.609869 0.040993 0.223132 0.146123
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.584416 3.746052 1.778365 2.434605 0.887539 2.116808 -2.026873 -3.238622 0.593013 0.590825 0.371551
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.285754 0.248035 0.639284 -0.544866 0.023313 0.574936 -1.350199 35.283426 0.604728 0.606700 0.364535
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.500131 12.338845 1.772941 -0.731254 0.528666 -0.185258 17.666904 1.687060 0.612854 0.631325 0.371246
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.726514 -0.629957 3.998291 -0.692009 1.329364 0.589231 1.550107 3.877273 0.404208 0.617390 0.434008
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.957249 4.190521 1.154368 3.119311 0.909131 -0.425153 0.429771 0.797839 0.540235 0.505368 0.345434
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.309278 -0.953054 -1.087342 -1.071452 -0.626792 -0.616159 6.498890 -0.934669 0.566014 0.604916 0.375598
208 N20 dish_maintenance 100.00% 98.92% 98.84% 0.00% nan nan inf inf nan nan nan nan 0.395632 0.387480 0.276433
209 N20 dish_maintenance 100.00% 99.15% 99.23% 0.00% nan nan inf inf nan nan nan nan 0.277240 0.337990 0.331319
210 N20 dish_maintenance 100.00% 98.53% 98.68% 0.00% nan nan inf inf nan nan nan nan 0.581333 0.539889 0.287061
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.124871 12.646377 -0.916936 5.633198 -0.440464 3.438998 0.594957 1.092142 0.552875 0.038869 0.459907
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.199052 -0.931681 -0.181879 -1.136080 -0.950458 0.048559 1.857187 -0.693147 0.595447 0.597969 0.371424
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.913515 -0.723204 -1.199113 -1.197115 0.116168 -1.028331 4.945218 -0.768704 0.588018 0.607267 0.370278
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.523099 -0.521893 -0.495197 -0.465975 -0.403053 -1.350104 3.732902 -0.881931 0.590632 0.611582 0.371633
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.199757 1.184680 -0.566280 2.170712 -0.900004 -0.807448 -0.161033 13.231240 0.584672 0.548964 0.374997
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.152670 4.602757 3.308204 2.813589 2.713695 2.630748 -3.781543 -3.200945 0.561995 0.578193 0.368168
225 N19 RF_ok 100.00% 0.00% 84.21% 0.00% -0.453220 12.103598 0.218550 5.424010 -0.826387 3.294628 -1.624609 1.497086 0.593136 0.152865 0.489499
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.271226 17.115619 -0.955465 -0.243451 -1.018369 0.990982 -0.971887 0.924545 0.582672 0.508917 0.360871
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 2.244075 0.291231 2.238985 -1.167388 -0.585094 -1.113294 11.082876 2.535276 0.492321 0.577577 0.395097
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.176881 -0.207521 0.180782 -0.820409 -0.720677 -0.515492 0.219835 0.344199 0.566810 0.567319 0.371854
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.015055 0.289848 0.142206 0.501536 -0.566353 -0.531536 0.212739 -1.989139 0.560812 0.572571 0.386637
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.845522 -0.715765 0.434817 -0.939563 -0.036779 -0.424635 2.083434 -0.704381 0.534107 0.584504 0.385520
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.101270 -0.767823 0.263202 0.012115 -0.799262 -0.988267 -1.616715 -1.616796 0.586314 0.597862 0.380860
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.873993 -0.376364 -0.301118 -0.225664 -0.318195 -1.119581 -0.658222 0.742620 0.584638 0.597030 0.377122
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.981409 -0.396223 -0.032512 -0.871583 -0.855730 -1.159860 1.765506 0.628279 0.551062 0.596232 0.385307
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.266062 -0.993578 -0.687325 -0.470227 -1.011460 -1.290318 0.424176 -1.249939 0.584784 0.600514 0.387246
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 17.683937 -0.025312 -0.561229 0.272355 0.637588 -0.470965 0.674468 -1.201640 0.445970 0.594403 0.378880
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 16.602107 -1.249607 0.263657 -0.871317 0.782282 -0.290011 -0.530578 -0.395419 0.452889 0.581157 0.377315
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.360334 -0.443378 -0.157693 -0.437249 -0.717127 0.219412 1.265833 3.727615 0.550316 0.577696 0.376313
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.268522 -0.161658 0.397563 -0.985349 -0.636450 -1.095637 -1.969892 0.543097 0.570011 0.574169 0.381440
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.175310 13.177300 -1.045907 5.217040 -0.342353 3.500537 -0.669871 0.208962 0.548374 0.038342 0.456222
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% -0.392453 -0.509879 -0.225350 -0.731029 -0.521001 -1.221096 5.045397 -0.639376 0.557184 0.563572 0.378359
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 10.402574 13.610320 0.300893 0.632624 1.090836 0.931533 -0.232598 1.483803 0.568619 0.574817 0.397698
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.068913 0.651722 1.536006 0.514699 0.423821 -0.222834 -2.307272 -0.388592 0.470251 0.474326 0.372188
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.840550 2.345255 0.513114 0.643188 -0.436861 0.011185 -0.475266 -1.500540 0.457212 0.467716 0.359337
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.952547 -0.931467 0.374410 -0.791648 -0.578068 -0.736575 -1.811964 -0.280055 0.491998 0.494614 0.383330
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.447954 0.179423 -0.824782 -1.138055 -0.483123 -0.489921 5.649524 1.153112 0.452377 0.476243 0.362124
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.408872 0.697919 -0.340316 -0.702140 -0.190694 -0.171037 0.527513 0.817529 0.439565 0.466479 0.353166
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, 27, 28, 30, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 51, 52, 53, 54, 55, 56, 58, 59, 60, 63, 65, 66, 67, 68, 70, 71, 72, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 101, 102, 103, 104, 107, 108, 109, 110, 111, 112, 113, 114, 117, 118, 121, 122, 123, 124, 127, 131, 134, 135, 136, 137, 140, 142, 143, 145, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 162, 164, 165, 167, 168, 169, 170, 173, 180, 181, 182, 184, 189, 190, 191, 192, 193, 200, 202, 204, 205, 206, 207, 208, 209, 210, 211, 221, 223, 224, 225, 226, 227, 242, 243, 246, 261, 262, 329]

unflagged_ants: [5, 8, 9, 10, 16, 19, 20, 21, 22, 29, 35, 41, 43, 44, 46, 48, 49, 50, 57, 61, 62, 64, 69, 73, 74, 85, 88, 89, 90, 91, 95, 105, 106, 115, 120, 125, 126, 128, 132, 133, 139, 141, 144, 146, 157, 163, 166, 171, 172, 179, 183, 185, 186, 187, 201, 220, 222, 228, 229, 237, 238, 239, 240, 241, 244, 245, 320, 324, 325, 333]

golden_ants: [5, 9, 10, 16, 19, 20, 21, 29, 41, 44, 69, 85, 88, 91, 105, 106, 128, 141, 144, 146, 157, 163, 166, 171, 172, 183, 186, 187]
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_2460044.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 [ ]: