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 = "2459967"
data_path = "/mnt/sn1/2459967"
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: 1-22-2023
In [5]:
# Per-season options
def ant_to_report_url(ant):
    return f'https://htmlpreview.github.io/?https://github.com/HERA-Team/H6C_Notebooks/blob/main/antenna_report/antenna_{ant}_report.html'

Load Auto Metrics¶

In [6]:
use_auto_metrics = False

# find the auto_metrics file
glob_str = os.path.join(data_path, f'zen.{JD}*.auto_metrics.h5')
auto_metrics_file = sorted(glob.glob(glob_str))

# if it exists, load and extract relevant information
if len(auto_metrics_file) > 0:
    auto_metrics_file = auto_metrics_file[0]
    print(f'Found auto_metrics results file at {auto_metrics_file}.')
    
    auto_metrics = load_metric_file(auto_metrics_file)
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
    auto_ex_ants = auto_metrics['ex_ants']['r2_ex_ants']
    
    use_auto_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping auto_metrics.')
Found auto_metrics results file at /mnt/sn1/2459967/zen.2459967.21326.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

# get a list of all ant_metrics files
glob_str = os.path.join(data_path, f'zen.{JD}.?????.sum{ant_metrics_ext}')
ant_metrics_files = sorted(glob.glob(glob_str))

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1849 ant_metrics files matching glob /mnt/sn1/2459967/zen.2459967.?????.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/2459967/zen.2459967.?????.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 2459967
Date 1-22-2023
LST Range 2.665 -- 12.616 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1849
Total Number of Antennas 196
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 196 (0.0%)
Antennas in Commanded State (observed) 0 / 196 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 56 / 196 (28.6%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 118 / 196 (60.2%)
Redcal Done? ❌
Never Flagged Antennas 78 / 196 (39.8%)
A Priori Good Antennas Flagged 47 / 93 total a priori good antennas:
3, 7, 9, 15, 16, 29, 30, 40, 42, 54, 55, 56,
71, 72, 81, 85, 86, 94, 101, 103, 107, 109,
111, 121, 122, 123, 128, 136, 140, 141, 143,
144, 146, 151, 158, 161, 165, 170, 173, 182,
185, 187, 189, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 32 / 103 total a priori bad antennas:
8, 22, 43, 46, 48, 49, 61, 62, 64, 73, 74,
82, 89, 95, 115, 125, 132, 137, 139, 205, 207,
211, 220, 221, 222, 237, 238, 239, 245, 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_2459967.csv

Build DataFrame¶

In [20]:
# build dataframe
to_show = {'Ant': [f'<a href="{ant_to_report_url(ant)}" target="_blank">{ant}</a>' for ant in ants],
           'Node': [f'N{nodes[ant]:02}' for ant in ants], 
           'A Priori Status': [a_priori_statuses[ant] for ant in ants]}
           #'Worst Metric': worst_metrics, 'Worst Modified Z-Score': worst_zs}
df = pd.DataFrame(to_show)

# create bar chart columns for flagging percentages:
bar_cols = {}
if use_auto_metrics:
    bar_cols['Auto Metrics Flags'] = [float(ant in auto_ex_ants) for ant in ants]
if use_ant_metrics:
    if np.sum(list(a_priori_flag_frac.values())) > 0:  # only include this col if there are any a priori flags
        bar_cols['A Priori Flag Fraction in Ant Metrics'] = [a_priori_flag_frac[ant] for ant in ants]
    for ap in antpols:
        bar_cols[f'Dead Fraction in Ant Metrics ({ap})'] = [dead_ant_frac[ap][ant] for ant in ants]
    bar_cols['Crossed Fraction in Ant Metrics'] = [crossed_ant_frac[ant] for ant in ants]
if use_redcal:
    bar_cols['Flag Fraction Before Redcal'] = [redcal_prior_flag_frac[ant] for ant in ants]
    bar_cols['Flagged By Redcal chi^2 Fraction'] = [redcal_flagged_frac[ant] for ant in ants]  
for col in bar_cols:
    df[col] = bar_cols[col]

# add auto_metrics
if use_auto_metrics:
    for label, modz in all_modzs.items():
        df[label] = modz
z_score_cols = [col for col in df.columns if 'Modified Z-Score' in col]        
        
# add ant_metrics
ant_metrics_cols = {}
if use_ant_metrics:
    for ap in antpols:
        ant_metrics_cols[f'Average Dead Ant Metric ({ap})'] = [average_dead_metrics[ap][ant] for ant in ants]
    ant_metrics_cols['Average Crossed Ant Metric'] = [average_crossed_metrics[ant] for ant in ants]
    for col in ant_metrics_cols:
        df[col] = ant_metrics_cols[col]   

# add redcal chisq
redcal_cols = []
if use_redcal:
    for ap in antpols:
        col_title = f'Median chi^2 Per Antenna ({ap})'
        df[col_title] = [cspa[ant, ap] for ant in ants]
        redcal_cols.append(col_title)

# sort by node number and then by antenna number within nodes
df.sort_values(['Node', 'Ant'], ascending=True)

# style dataframe
table = df.style.hide_index()\
          .applymap(lambda val: f'background-color: {status_colors[val]}' if val in status_colors else '', subset=['A Priori Status']) \
          .background_gradient(cmap='viridis', vmax=mean_round_modz_cut * 3, vmin=0, axis=None, subset=z_score_cols) \
          .background_gradient(cmap='bwr_r', vmin=dead_cut-.25, vmax=dead_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .background_gradient(cmap='bwr_r', vmin=crossed_cut-.25, vmax=crossed_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .background_gradient(cmap='plasma', vmax=4, vmin=1, axis=None, subset=redcal_cols) \
          .applymap(lambda val: 'font-weight: bold' if val < dead_cut else '', subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val < crossed_cut else '', subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .applymap(lambda val: 'color: red' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .bar(subset=list(bar_cols.keys()), vmin=0, vmax=1) \
          .format({col: '{:,.4f}'.format for col in z_score_cols}) \
          .format({col: '{:,.4f}'.format for col in ant_metrics_cols}) \
          .format({col: '{:,.2%}'.format for col in bar_cols}) \
          .applymap(lambda val: 'font-weight: bold', subset=['Ant']) \
          .set_table_styles([dict(selector="th",props=[('max-width', f'70pt')])])

Table 2: RTP Per-Antenna Metrics Summary Table¶

This admittedly very busy table incorporates summary information about all antennas in the array. Its columns depend on what information is available when the notebook is run (i.e. whether auto_metrics, ant_metrics, and/or redcal is done). These can be divided into 5 sections:

Basic Antenna Info: antenna number, node, and its a priori status.

Flag Fractions: Fraction of the night that an antenna was flagged for various reasons. Note that auto_metrics flags antennas for the whole night, so it'll be 0% or 100%.

auto_metrics Details: If auto_metrics is included, this section shows the modified Z-score signifying how much of an outlier each antenna and polarization is in each of four categories: bandpass shape, overall power, temporal variability, and temporal discontinuities. Bold red text indicates that this is a reason for flagging the antenna. It is reproduced from the auto_metrics_inspect.ipynb nightly notebook, so check that out for more details on the precise metrics.

ant_metrics Details: If ant_metrics is included, this section shows the average correlation-based metrics for antennas over the whole night. Low "dead ant" metrics (nominally below 0.4) indicate antennas not correlating with the rest of the array. Negative "crossed ant" metrics indicate antennas that show stronger correlations in their cross-pols than their same-pols, indicating that the two polarizations are probably swapped. Bold text indicates that the average is below the threshold for flagging.

redcal chi^2 Details: If redcal is included, this shows the median chi^2 per antenna. This would be 1 in an ideal array. Antennas are thrown out when they they are outliers in their median chi^2, usually greater than 4-sigma outliers in modified Z-score.

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.295725 13.249589 10.876090 -1.012406 11.744898 7.714552 -0.014596 5.152471 0.032360 0.354237 0.282743
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.065096 1.532820 4.101337 -0.009589 12.802720 6.781276 7.171720 3.490822 0.592806 0.634684 0.400584
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.610815 -0.391111 0.330943 -0.003344 -0.130007 2.314556 1.349466 0.295662 0.623420 0.636257 0.383146
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.315728 -0.207792 -1.255979 -0.428255 -0.069680 -0.188885 8.016873 7.336004 0.629593 0.644538 0.378866
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.159282 -1.430261 -0.632393 -0.160932 -0.494040 0.176370 2.676367 0.675649 0.629660 0.641090 0.375190
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.583261 -1.116714 9.036133 -0.683112 6.998996 -0.329815 -0.211687 -0.582215 0.460122 0.640103 0.451336
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.931516 -0.755060 0.076029 -1.575394 -0.659670 2.122239 0.129024 3.477544 0.623091 0.637164 0.381781
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.673877 17.015053 10.802171 0.499197 11.806621 5.404773 -0.266186 0.909807 0.031615 0.355205 0.274066
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.522377 -0.836474 10.838236 0.716690 11.759707 1.753591 0.291756 1.898286 0.032143 0.642487 0.523406
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.798551 1.399098 0.538071 0.273794 0.070373 0.072669 1.146482 1.127336 0.631149 0.645827 0.382797
18 N01 RF_maintenance 100.00% 100.00% 38.29% 0.00% 11.181181 18.254474 10.805404 -0.943156 11.956939 9.363020 -0.087039 13.666085 0.029723 0.243150 0.188049
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.793783 -0.674438 -1.299315 -0.747805 -0.426519 3.317607 1.026625 1.857091 0.636186 0.652860 0.375692
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.025181 -1.230451 2.785490 -1.410353 0.051982 0.610367 0.540028 -0.845772 0.628112 0.651418 0.383447
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.088457 -0.216610 -0.711371 -0.125010 0.151156 2.500142 -0.240773 -0.379374 0.622237 0.633223 0.375057
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.626871 -0.232323 0.836356 0.710345 0.907197 1.949405 -0.673333 -1.299179 0.591075 0.605655 0.375254
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.834730 11.908650 10.870819 11.163780 11.934866 14.211677 1.305126 0.874890 0.033933 0.037417 0.004391
28 N01 RF_maintenance 100.00% 0.00% 86.15% 0.00% 11.602354 25.230888 -0.223233 2.476031 7.497268 13.010403 3.408744 17.279440 0.369907 0.167767 0.271639
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.550040 12.394003 10.419523 10.717752 11.904040 14.175128 0.081638 -0.304643 0.029638 0.035753 0.006104
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.374853 -0.114485 0.011485 0.423049 3.392860 0.680256 12.031627 -0.162121 0.638925 0.655906 0.375673
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.518227 -1.507329 1.299110 0.920410 1.693560 0.104183 -0.212383 1.644343 0.647948 0.653808 0.372418
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.517171 24.720352 -0.155619 2.958708 -0.618523 0.823724 0.798131 6.780572 0.638066 0.548609 0.359159
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 12.133038 13.619935 4.691319 4.853073 11.879049 14.135206 0.978762 0.488508 0.034316 0.045737 0.007807
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.602015 -0.260668 0.706495 -1.533309 11.860740 -1.256219 2.078181 -0.113890 0.597567 0.593920 0.368728
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.824229 25.675393 14.452678 14.206170 12.017662 14.034820 2.411512 2.422924 0.031864 0.029811 0.001269
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.059530 0.485416 -1.371040 1.453466 2.191996 0.580130 -0.371398 3.250303 0.630280 0.633753 0.394640
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.019813 0.279935 0.206371 0.436708 -0.424018 0.492697 3.462073 0.985300 0.633863 0.644109 0.393624
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 9.913837 0.099695 10.449084 0.306304 11.849764 -0.785734 0.463960 -0.374491 0.037645 0.639301 0.497416
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.507391 0.095543 -0.043073 -0.166937 2.552854 -0.080647 -0.441381 1.375653 0.638966 0.654292 0.371386
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.782255 -0.129892 5.329704 6.427433 -1.310095 0.142930 -0.433245 -0.701270 0.615962 0.619729 0.362132
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.189168 0.041156 0.039636 0.544069 -0.655041 -0.067700 -0.156765 2.205461 0.649484 0.651075 0.372083
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.984794 -0.206063 -0.332033 -0.763677 -0.556720 0.008447 -1.208960 -0.917128 0.642370 0.657562 0.372389
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.010423 1.926851 0.211809 0.491688 -1.149384 1.434720 -0.409711 1.417972 0.636398 0.643293 0.367137
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.206793 0.292151 -0.943485 -0.682934 -0.668399 -0.664303 -0.829284 -1.130471 0.637789 0.659228 0.388428
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.271772 13.319136 4.496807 4.442931 11.798449 14.037570 0.680121 -0.039578 0.030068 0.047927 0.012182
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.246060 1.014193 0.895784 2.586431 -0.818348 3.498134 0.186936 -0.953714 0.596071 0.616196 0.377734
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.134481 0.001926 -1.151303 0.863295 1.296289 0.028725 0.047145 0.659091 0.546300 0.593699 0.378295
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.328440 3.510068 0.331581 1.026166 2.026645 2.860017 27.219900 53.022202 0.602724 0.602758 0.375127
51 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 22.959605 4.277118 13.864475 -0.762219 12.100094 5.889992 5.533343 2.900433 0.040413 0.525836 0.404237
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.089702 6.780288 -0.400658 0.411709 0.901451 -0.059951 0.802855 0.640251 0.637705 0.646458 0.386235
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.927780 2.522045 0.160765 0.193569 1.380627 1.661304 1.711589 3.088243 0.646125 0.652890 0.386513
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 27.609494 -1.059268 5.669098 3.295683 2.393640 -1.486294 1.705574 0.406544 0.452328 0.640199 0.369821
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.572474 12.714177 10.272073 10.665897 11.837156 14.091090 0.303136 1.165924 0.028816 0.032239 0.003204
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 1.350253 1.968123 6.201661 8.280212 1.898098 5.909356 -1.123259 0.245369 0.597643 0.574713 0.347149
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 21.515730 15.425990 8.902726 0.939970 11.511951 5.580194 10.789002 2.882583 0.395832 0.656810 0.403534
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.912020 12.331960 10.767639 11.306631 11.771186 14.074310 0.861523 0.466427 0.035135 0.035031 0.001509
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.815719 1.131914 10.278837 0.975572 11.522313 1.578243 0.021706 1.894124 0.046705 0.641546 0.515257
60 N05 RF_maintenance 100.00% 0.00% 98.22% 0.00% 0.953392 12.234930 -0.452858 11.335840 -1.042892 14.085422 -0.073733 1.114767 0.636444 0.069460 0.512452
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.645856 0.178389 -0.798421 -1.488671 1.777415 -1.420426 -0.788856 -0.150180 0.579332 0.610187 0.369834
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.892614 0.681184 -0.866521 1.777472 0.429642 0.219422 1.295835 -0.298874 0.562309 0.612378 0.378812
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.104629 12.761807 -0.006538 4.881448 1.157323 14.261541 0.671052 2.383110 0.599181 0.044771 0.473310
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.122793 0.306795 -0.796958 -1.146704 3.654717 0.229957 2.783892 -0.144759 0.581134 0.574154 0.359879
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.446914 -0.001926 0.444704 1.057244 0.187998 -0.407682 1.311113 0.329845 0.614074 0.622839 0.394949
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.469587 1.424257 -1.452573 -1.486060 3.406162 -0.623466 -0.600111 -0.348748 0.627322 0.645231 0.396755
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.518531 -0.748835 -0.951053 0.557502 -0.582605 0.370245 0.618162 1.953950 0.640812 0.648483 0.387579
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 20.001026 26.262852 1.245596 14.972830 6.069958 14.082576 -0.172828 5.531075 0.372922 0.029803 0.273005
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.692834 -0.538558 0.326499 0.708627 -0.578260 1.052081 -0.793735 -0.702281 0.641114 0.657553 0.371415
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.722357 -0.417062 -0.138834 -0.073663 1.023960 0.727098 0.184905 0.383034 0.651996 0.665098 0.371518
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.919289 -0.393565 0.740602 0.842090 0.287761 -0.842349 0.850720 0.016387 0.661165 0.669607 0.363814
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.341561 13.489947 11.304849 11.761463 11.573404 13.842083 -0.003377 0.017682 0.031124 0.034365 0.003417
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.682477 0.943678 -1.496416 -1.367128 0.798624 -0.511899 -0.551457 -0.643750 0.654783 0.666233 0.369718
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.978361 -0.116734 0.169022 -0.792961 -0.008447 0.520836 -0.865605 2.340240 0.653870 0.661187 0.367746
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 58.190194 0.897126 0.767894 0.070890 9.428775 -0.860213 5.464968 -1.268359 0.333288 0.613550 0.427039
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 33.652919 -0.007712 -0.322574 1.735061 2.709961 0.259503 0.116924 0.578985 0.429658 0.626218 0.374017
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.820982 13.082044 -1.512495 4.911430 -0.691366 14.009625 1.275546 -0.162107 0.592351 0.040079 0.452912
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -1.030612 13.895959 0.140243 4.798829 0.776030 14.041334 6.281491 0.213514 0.592729 0.044784 0.462803
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.466640 13.169874 0.151389 9.808575 -0.690849 13.675101 -0.214613 0.976019 0.589776 0.039238 0.450750
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.515194 -0.356418 0.494810 2.200176 -0.997508 -1.273582 -0.622626 0.261559 0.610720 0.611324 0.378502
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.413520 -0.039160 0.290184 0.291000 0.377263 -0.715134 -0.513883 0.425809 0.623004 0.638140 0.383089
84 N08 RF_maintenance 100.00% 71.61% 100.00% 0.00% 19.786247 23.234182 14.057358 14.489805 10.103456 14.047353 2.348169 2.760216 0.203506 0.034990 0.126982
85 N08 digital_ok 100.00% 0.00% 0.00% 0.00% -0.252841 0.345564 2.183084 0.669083 7.839375 -0.490920 0.858648 0.102014 0.627626 0.651516 0.377088
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.752059 -0.272042 0.796916 0.891719 5.293846 -1.321123 -0.153486 13.334889 0.630195 0.648538 0.359586
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.831726 7.677603 -0.648589 -0.443136 -0.628786 0.940972 -0.072118 1.808173 0.659139 0.674654 0.367784
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.445566 0.306054 0.445239 0.649911 -0.476885 0.031539 1.701235 0.173423 0.649502 0.663114 0.360709
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.181069 0.281655 0.081955 0.764510 -0.501393 -0.911354 -0.980810 -0.886457 0.654724 0.663583 0.362514
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.183186 -0.736509 1.083130 3.559650 -0.677061 15.385577 0.087206 1.812479 0.646038 0.630864 0.364085
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.359427 -0.272706 0.483599 0.128493 -1.097640 -1.187041 1.114806 0.135811 0.643296 0.662864 0.376451
92 N10 RF_maintenance 100.00% 0.00% 19.31% 0.00% 34.904326 38.796170 0.695530 1.475409 6.494252 6.119866 0.372950 6.477939 0.295262 0.252519 0.087396
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 2.141994 0.019010 2.556602 -1.435792 0.830747 -0.038932 2.118641 -0.797379 0.631801 0.655103 0.383167
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.335503 12.723243 11.067345 11.187128 11.700519 14.082375 0.151578 -0.180305 0.031929 0.026471 0.002675
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.332243 -0.478530 -0.891572 1.461029 0.749678 0.790434 0.126326 0.167681 0.603249 0.633532 0.390024
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.662673 13.500195 4.540848 5.029700 11.611339 13.892801 0.415538 0.231431 0.033698 0.038611 0.002861
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.986147 5.821674 -0.001501 1.232411 6.623583 5.585911 -0.245745 5.445392 0.551778 0.539899 0.351785
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.238154 8.881830 -0.404395 1.174427 0.004336 1.140381 0.948367 1.221787 0.642184 0.651611 0.379522
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.676057 1.003951 -0.780792 -1.442968 0.358396 0.915902 -0.247129 6.855873 0.650605 0.660690 0.374727
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.426952 5.586042 8.815261 -1.051393 61.255159 0.283130 3.594601 2.757789 0.465994 0.665971 0.419983
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.334844 59.776690 -1.012357 7.745242 2.264153 -0.043945 -0.066651 0.325793 0.659978 0.634749 0.369147
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.734206 -0.255382 0.343312 0.778866 -0.188400 -1.044192 -0.642024 -0.585955 0.654408 0.663237 0.360947
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.536088 0.996025 -1.477789 -0.767706 1.250445 -0.162122 -0.138101 0.042426 0.655695 0.665904 0.359333
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 1.946898 1.505494 -0.867275 -1.352090 0.428315 -0.644817 6.523670 4.223967 0.655970 0.670170 0.364240
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.401440 41.566805 10.814024 0.793328 11.857048 6.175694 0.512477 2.496976 0.034683 0.299012 0.172030
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.211682 12.325057 10.843891 11.030012 11.942844 14.171264 -0.230048 0.523910 0.026680 0.026824 0.001339
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.255197 24.924578 14.532674 14.715297 11.756559 13.858679 1.946140 2.038189 0.024297 0.026741 0.001352
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.016821 12.179066 0.618988 11.139219 -1.075362 14.201052 5.085657 1.048091 0.641477 0.036450 0.457869
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.507599 -0.523528 0.304811 0.121618 0.882953 3.280470 0.444385 -0.832052 0.633646 0.647664 0.388927
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.360913 13.652303 4.293393 4.905433 11.675932 13.969244 0.711693 0.033203 0.035635 0.030697 0.002609
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.594704 11.999185 13.193006 11.502536 11.037666 14.188035 152.709438 54.191646 0.025525 0.028472 0.001979
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.748125 -0.902567 -0.870147 -0.088702 -0.069788 -1.247203 0.435355 -0.424554 0.574914 0.603244 0.388502
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.288333 13.786616 10.966598 11.712260 11.672663 14.093360 0.582549 2.058504 0.027901 0.032292 0.003104
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.373548 1.331467 -0.172898 0.431579 -0.377828 -0.838063 -0.008836 0.652675 0.616902 0.636184 0.386681
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.930394 1.510962 2.903659 -1.337035 0.845290 2.053900 8.611368 7.815360 0.625506 0.656263 0.377201
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.447364 3.183152 -1.263221 6.585570 5.698482 1.683634 16.552603 11.215415 0.652006 0.633386 0.366550
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.203186 6.750219 0.208551 0.890495 -0.218625 0.565536 -0.604706 -0.974868 0.658761 0.665386 0.370226
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.193319 9.201101 0.906810 0.952643 -0.215389 -0.742787 -0.137677 -0.001979 0.662129 0.673320 0.372401
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.118064 -0.173326 0.003344 0.564993 -0.749207 -0.052921 0.258683 0.169858 0.663463 0.673902 0.371123
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.574685 0.804084 -0.471798 0.667028 -0.391725 0.692240 -0.378947 -0.569246 0.657755 0.665005 0.363942
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.312257 6.547837 -1.135098 1.883172 9.141266 5.155284 50.152402 6.826215 0.620544 0.658808 0.370074
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.476582 -0.087347 0.631363 0.274565 1.471247 -0.027956 0.062996 0.105623 0.651200 0.668534 0.379659
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.046877 11.883989 10.960171 11.312493 11.727101 14.004958 0.409600 0.500992 0.030440 0.028171 0.001304
131 N11 not_connected 100.00% 0.00% 0.38% 0.00% 0.264037 12.149229 0.252678 4.710647 -0.654712 12.569860 -1.186455 -0.545795 0.613528 0.305428 0.422405
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.604349 1.145860 0.117363 -1.340537 1.084355 -0.949080 -0.607693 -0.486670 0.599812 0.606347 0.374057
133 N11 not_connected 100.00% 100.00% 0.00% 0.00% 11.994850 -0.260601 4.270212 -1.433485 11.827423 -1.074681 0.534354 -0.950993 0.052991 0.598983 0.467536
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.737606 -1.115444 -0.851964 -1.287714 2.502395 0.471224 10.119095 0.432466 0.591993 0.621118 0.404640
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.516778 -0.224406 10.385776 -1.059256 11.930438 -0.082745 0.722081 -0.678879 0.041714 0.619836 0.475345
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.139513 -0.518589 0.270754 -1.150399 1.932548 -1.051160 0.245241 0.199058 0.599676 0.631678 0.392235
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.674543 -0.314056 2.035785 -0.542276 1.150360 -0.411583 -1.167391 -0.552731 0.627955 0.631684 0.373359
140 N13 digital_ok 100.00% 98.86% 98.92% 0.00% 168.059241 166.319175 inf inf 3549.505103 3478.499850 4581.475718 4572.069465 0.595344 0.548933 0.415772
141 N13 digital_ok 100.00% 98.81% 98.76% 0.00% 181.263002 180.664681 inf inf 3597.255656 3544.033669 4333.992030 4457.639522 0.597518 0.581032 0.398056
142 N13 RF_maintenance 100.00% 98.76% 98.76% 0.00% 124.159468 123.731166 inf inf 3939.655942 3937.596600 5203.136194 5247.330749 0.575740 0.574896 0.428622
143 N14 digital_ok 100.00% 0.00% 100.00% 0.00% -1.307390 12.731794 1.071885 11.434488 1.594110 13.843488 -0.207920 1.085185 0.653978 0.040283 0.534769
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.459174 4.595439 -1.248683 9.290955 -0.395368 15.888989 -0.894980 -0.370136 0.662942 0.500212 0.423350
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.104349 1.045914 -1.135181 4.070631 0.345598 8.392742 -0.701515 -0.217790 0.661409 0.646511 0.370476
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.731546 -1.118345 4.270678 0.267945 11.795729 -1.292339 -0.054495 -0.986339 0.039714 0.655258 0.513718
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.798135 -1.717775 1.363427 2.283520 -0.573786 -1.266509 1.270912 0.210606 0.639400 0.648572 0.369908
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.414405 -0.086680 -0.613140 -0.807386 2.011133 1.507316 -0.613610 -0.653352 0.641833 0.658159 0.379749
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.140841 -1.376775 -1.203248 -1.081644 -0.687956 0.998907 -0.176707 -0.185670 0.637720 0.652554 0.385213
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.276948 -0.789292 -1.029299 -0.990632 -1.555589 0.246253 -0.891684 -0.479826 0.637229 0.649898 0.389896
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 18.829709 1.242112 0.226906 0.286326 5.504849 -0.274455 4.196710 -0.395578 0.522850 0.582178 0.345625
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.869033 -0.818430 10.555669 -1.555700 11.975316 1.175912 1.077405 1.024839 0.043100 0.620716 0.488463
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 4.245610 11.989541 9.010405 11.044304 8.075210 14.226783 0.913248 1.323449 0.423007 0.039326 0.324325
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.127577 -0.388120 -0.008551 0.626605 -0.944482 -0.086717 -0.710059 -0.492377 0.609588 0.630401 0.390388
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.027278 -0.187130 -0.074633 -0.923557 2.001975 2.238886 1.619755 10.003586 0.623279 0.646094 0.393420
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.444663 21.849037 -1.404466 -0.848449 0.276048 8.289843 -0.344592 37.867365 0.593656 0.536168 0.355148
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.832283 -1.141885 -0.273860 -0.896049 -0.842844 1.777214 0.855367 0.738458 0.634063 0.652315 0.379754
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.114177 28.582312 0.059852 -0.576607 -0.648345 2.327574 -0.493821 0.503445 0.640645 0.521298 0.337561
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.151626 -1.076084 -0.681953 -0.925572 2.121907 1.121581 2.231644 -0.321687 0.652874 0.667661 0.374903
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.541949 0.332859 -0.198200 0.351702 -0.626665 0.067851 -0.370863 1.000063 0.658258 0.664758 0.374353
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.202749 0.461651 0.704147 -0.199421 3.195815 2.567780 0.681283 0.598931 0.653401 0.668229 0.367725
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 33.546159 -0.096029 -0.368703 -1.262538 5.516424 -0.625320 1.434157 -0.393212 0.513413 0.667504 0.363648
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.507630 1.770149 -1.010012 -0.523988 -0.267220 38.817798 4.683708 3.977920 0.658015 0.665249 0.373854
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.656242 -1.137234 -1.506343 -0.246604 1.540637 -0.250873 0.386586 3.040553 0.653541 0.662120 0.376630
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.008302 -0.658869 0.361901 -0.554722 1.201679 -0.318071 -0.785536 1.022952 0.644689 0.652581 0.378940
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.759165 -0.922317 -0.956734 -1.208481 0.303552 -0.008793 -0.932507 -0.901442 0.644840 0.659297 0.384256
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 11.227825 -0.708231 11.190434 -1.135017 11.659143 0.783430 1.742313 4.622123 0.040858 0.653309 0.516715
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.831838 2.775336 -1.277796 -0.152278 -0.922201 3.011924 -0.628679 0.394865 0.584569 0.566389 0.360160
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 12.504180 12.851599 3.965738 4.453922 12.003435 14.175469 1.643246 3.015375 0.039571 0.044532 0.003998
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.373236 -0.849813 -0.295883 -0.507810 5.411074 21.810200 -0.678059 0.226855 0.619703 0.638916 0.390967
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.355895 13.006423 -1.521757 11.505327 0.661766 14.052704 12.466422 1.495969 0.636799 0.052373 0.525984
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.271875 -0.454864 0.382082 0.596839 -0.192328 -0.604570 -0.642815 2.750190 0.642101 0.652494 0.381896
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.147120 11.973974 -0.188585 11.012783 2.718467 14.243554 6.591606 0.534103 0.654091 0.048679 0.503812
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.142369 0.462752 -0.105069 0.621985 1.156390 -0.768183 0.318053 -0.619947 0.642658 0.652437 0.364914
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.997270 -0.826480 -1.402802 -0.635849 -0.472368 -0.491791 0.304837 0.447831 0.651255 0.665998 0.363690
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 33.596905 -0.277492 -0.400609 -1.556879 12.307375 0.092053 6.588811 -0.323236 0.538974 0.664431 0.371120
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.724284 -1.273875 -1.574186 -0.030200 1.880990 -0.213752 -0.404778 -1.179687 0.660138 0.673744 0.381102
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.245925 1.830337 -1.249713 2.631743 -0.037302 1.243380 0.616516 7.092345 0.654850 0.666689 0.372386
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 9.436858 11.835186 10.362298 11.152936 12.091956 14.255887 2.634542 1.414269 0.028112 0.031947 0.001922
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.280674 -1.283381 -0.724373 0.943293 -1.109189 0.768855 -0.853684 -1.528265 0.638127 0.658024 0.392370
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.699558 0.453833 1.475652 -0.603310 -0.237879 0.435804 7.216185 1.935810 0.622758 0.642292 0.387783
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.925697 6.939443 5.680911 5.943046 8.763971 11.082106 -2.501867 -2.803914 0.588673 0.602614 0.381703
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.939361 0.299101 5.963295 1.925142 9.093836 2.972557 -2.415172 1.515916 0.571727 0.610044 0.406195
200 N18 RF_maintenance 100.00% 100.00% 53.60% 0.00% 12.192673 35.753387 4.429222 1.187440 12.008084 8.407256 0.489374 -0.411017 0.041372 0.224461 0.152215
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.628962 5.054928 3.765461 5.273656 4.070476 9.367950 -0.770156 -2.191048 0.628887 0.626482 0.376741
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.646678 2.654577 2.170886 -1.459803 1.594131 -0.466520 -0.870248 16.610805 0.636758 0.619917 0.372987
205 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.251794 2.647388 0.368988 -0.611272 -1.158583 -0.352792 -0.730285 2.971244 0.630927 0.617434 0.366615
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.015644 1.540995 3.144952 -0.414676 5.137172 -0.079381 -1.140035 3.052412 0.633941 0.628304 0.370069
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.963813 2.564036 1.862790 0.282594 1.054196 -0.047029 -0.730675 -1.233373 0.614389 0.620488 0.351504
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.762730 10.178644 9.891193 12.780804 11.536626 12.515969 7.051541 62.884109 0.034556 0.033373 0.001672
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.749243 8.105648 10.052606 10.060675 10.037175 14.666011 13.021660 12.236701 0.040491 0.039810 0.001605
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 12.775006 6.879403 -1.016864 -1.183991 -0.801366 -0.841906 -0.586486 -0.496474 0.629221 0.599622 0.385777
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.989865 1.297600 -1.012688 0.548072 0.603322 0.212774 2.912435 -0.227198 0.582402 0.602050 0.373644
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.167276 -0.849010 0.807179 0.123651 -0.639163 1.209099 2.543906 -1.289905 0.622356 0.629081 0.373720
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.866480 -0.147088 -1.009045 -0.287572 -0.025965 -0.245601 2.162873 -0.787632 0.604354 0.633857 0.378531
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.600719 -0.173432 -0.025139 0.495349 -0.609556 1.240388 0.916578 -1.534771 0.617189 0.641277 0.378760
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.815077 1.206523 -1.305080 0.447427 0.307374 26.325055 0.283304 2.874478 0.606909 0.631798 0.377523
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.240675 6.668882 6.192016 6.019596 8.757046 11.246174 -2.639268 -2.837225 0.604764 0.620190 0.372767
225 N19 RF_ok 100.00% 0.00% 87.89% 0.00% 1.429395 12.556593 1.272989 4.651185 -1.039954 13.837907 -0.863293 0.474134 0.629573 0.148109 0.515426
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.162102 14.109083 0.440344 1.908421 -1.082057 6.994734 -0.806415 -0.284862 0.621769 0.573627 0.366848
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 2.150149 0.650244 -1.424558 0.599370 -0.317557 -0.000059 10.099836 0.520906 0.587170 0.621681 0.370506
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.139197 21.606997 -0.896510 0.143454 1.854705 3.066381 28.675163 16.522224 0.536035 0.503945 0.301063
229 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.747220 0.070189 1.775658 2.041418 0.375752 2.007613 9.865635 -1.440066 0.601933 0.621503 0.387960
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.837505 -0.072518 -0.105762 -1.200473 -0.220987 -0.942956 -0.403177 -0.844626 0.558300 0.609697 0.391596
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.447393 -0.249373 1.354649 0.884691 -0.662267 -0.933112 -1.549132 -1.703387 0.616284 0.630042 0.384995
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.896599 -1.188743 0.280177 0.650109 -0.680582 0.047268 -0.402989 0.008836 0.617103 0.632345 0.382815
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 31.800830 51.864683 -0.313523 1.196913 6.775335 10.122797 24.114479 9.153291 0.470795 0.418140 0.248038
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.978972 3.788226 -0.603511 0.393998 -0.803584 1.266436 5.259654 13.421458 0.605864 0.582430 0.378104
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 48.340020 1.482071 0.540478 1.987684 14.690197 1.691162 19.702367 -0.024458 0.389347 0.634303 0.438544
243 N19 RF_ok 100.00% 15.90% 0.00% 0.00% 60.421772 2.393213 1.198733 -1.165961 10.768211 -1.258341 0.333885 -0.423418 0.270376 0.608603 0.468095
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.934616 2.076983 1.490475 -1.062670 3.362330 1.658766 2.523140 5.167325 0.492248 0.586526 0.376805
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.590607 2.020411 0.495275 -0.551213 -0.546770 -0.503840 -1.017050 -0.460301 0.597027 0.600725 0.377184
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.684947 7.235057 -0.466377 0.655521 5.398167 6.445355 1.299383 -0.258523 0.330196 0.330535 0.158809
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.427435 1.351030 1.070563 -0.240269 -0.753611 2.891897 -0.444347 8.129646 0.595984 0.598280 0.380061
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.466067 7.769318 9.779221 10.678612 11.384628 13.540415 5.286039 14.469981 0.032455 0.027427 0.004577
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 6.560429 12.737359 2.850625 7.240933 1.566653 14.261606 25.998009 1.960812 0.446079 0.046529 0.353963
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.552715 2.601237 1.634606 2.270425 0.531118 2.184339 3.058162 1.272689 0.505095 0.518623 0.370137
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.645825 -0.868921 1.725309 -0.931657 1.191164 -0.567211 -0.901789 0.079406 0.540098 0.539823 0.382679
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.432921 -0.688016 -0.608310 0.113501 4.863557 -0.711107 4.323743 0.290305 0.496209 0.525844 0.373058
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.567776 1.438107 -0.683240 -1.228442 0.264301 -0.572084 0.951430 1.076748 0.466528 0.511984 0.366748
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 7, 9, 15, 16, 18, 27, 28, 29, 30, 32, 34, 35, 36, 40, 42, 47, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 77, 78, 79, 80, 81, 84, 85, 86, 87, 90, 92, 94, 96, 97, 101, 102, 103, 104, 107, 108, 109, 110, 111, 113, 114, 117, 120, 121, 122, 123, 126, 128, 131, 133, 135, 136, 140, 141, 142, 143, 144, 145, 146, 151, 155, 156, 158, 159, 161, 165, 166, 170, 173, 179, 180, 182, 185, 187, 189, 191, 192, 193, 200, 201, 202, 206, 208, 209, 210, 223, 224, 225, 226, 227, 228, 229, 240, 241, 242, 243, 244, 246, 261, 262, 320, 329]

unflagged_ants: [5, 8, 10, 17, 19, 20, 21, 22, 31, 37, 38, 41, 43, 44, 45, 46, 48, 49, 53, 61, 62, 64, 65, 66, 67, 69, 70, 73, 74, 82, 83, 88, 89, 91, 93, 95, 105, 106, 112, 115, 118, 124, 125, 127, 132, 137, 139, 147, 148, 149, 150, 157, 160, 162, 163, 164, 167, 168, 169, 171, 181, 183, 184, 186, 190, 205, 207, 211, 220, 221, 222, 237, 238, 239, 245, 324, 325, 333]

golden_ants: [5, 10, 17, 19, 20, 21, 31, 37, 38, 41, 44, 45, 53, 65, 66, 67, 69, 70, 83, 88, 91, 93, 105, 106, 112, 118, 124, 127, 147, 148, 149, 150, 157, 160, 162, 163, 164, 167, 168, 169, 171, 181, 183, 184, 186, 190]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459967.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

# Figure out where to draw the nodes
node_centers = {}
for node in sorted(set(list(nodes.values()))):
    if np.isfinite(node):
        this_node_ants = [ant for ant in ants + unused_ants if nodes[ant] == node]
        if len(this_node_ants) == 1:
            # put the node label just to the west of the lone antenna 
            node_centers[node] = hd.antpos[ant][node] + np.array([-14.6 / 2, 0, 0])
        else:
            # put the node label between the two antennas closest to the node center
            node_centers[node] = np.mean([hd.antpos[ant] for ant in this_node_ants], axis=0)
            closest_two_pos = sorted([hd.antpos[ant] for ant in this_node_ants], 
                                     key=lambda pos: np.linalg.norm(pos - node_centers[node]))[0:2]
            node_centers[node] = np.mean(closest_two_pos, axis=0)
In [25]:
def Plot_Array(ants, unused_ants, outriggers):
    plt.figure(figsize=(16,16))
    
    plt.scatter(np.array([hd.antpos[ant][0] for ant in hd.data_ants if ant in ants]), 
                np.array([hd.antpos[ant][1] for ant in hd.data_ants if ant in ants]), c='w', s=0)

    # connect every antenna to their node
    for ant in ants:
        if nodes[ant] in node_centers:
            plt.plot([hd.antpos[ant][0], node_centers[nodes[ant]][0]], 
                     [hd.antpos[ant][1], node_centers[nodes[ant]][1]], 'k', zorder=0)

    rc_color = '#0000ff'
    antm_color = '#ffa500'
    autom_color = '#ff1493'

    # Plot 
    unflagged_ants = []
    for i, ant in enumerate(ants):
        ant_has_flag = False
        # plot large blue annuli for redcal flags
        if use_redcal:
            if redcal_flagged_frac[ant] > 0:
                ant_has_flag = True
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=7 * (2 - 1 * float(not outriggers)), fill=True, lw=0,
                                                color=rc_color, alpha=redcal_flagged_frac[ant]))
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=6 * (2 - 1 * float(not outriggers)), fill=True, color='w'))
        
        # plot medium green annuli for ant_metrics flags
        if use_ant_metrics: 
            if ant_metrics_xants_frac_by_ant[ant] > 0:
                ant_has_flag = True
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=6 * (2 - 1 * float(not outriggers)), fill=True, lw=0,
                                                color=antm_color, alpha=ant_metrics_xants_frac_by_ant[ant]))
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=5 * (2 - 1 * float(not outriggers)), fill=True, color='w'))
        
        # plot small red annuli for auto_metrics
        if use_auto_metrics:
            if ant in auto_ex_ants:
                ant_has_flag = True                
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=5 * (2 - 1 * float(not outriggers)), fill=True, lw=0, color=autom_color)) 
        
        # plot black/white circles with black outlines for antennas
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4 * (2 - 1 * float(not outriggers)), fill=True, color=['w', 'k'][ant_has_flag], ec='k'))
        if not ant_has_flag:
            unflagged_ants.append(ant)

        # label antennas, using apriori statuses if available
        try:
            bgc = matplotlib.colors.to_rgb(status_colors[a_priori_statuses[ant]])
            c = 'black' if (bgc[0]*0.299 + bgc[1]*0.587 + bgc[2]*0.114) > 186 / 256 else 'white'
        except:
            c = 'k'
            bgc='white'
        plt.text(hd.antpos[ant][0], hd.antpos[ant][1], str(ant), va='center', ha='center', color=c, backgroundcolor=bgc)

    # label nodes
    for node in sorted(set(list(nodes.values()))):
        if not np.isnan(node) and not np.all(np.isnan(node_centers[node])):
            plt.text(node_centers[node][0], node_centers[node][1], str(node), va='center', ha='center', bbox={'color': 'w', 'ec': 'k'})
    
    # build legend 
    legend_objs = []
    legend_labels = []
    
    # use circles for annuli 
    legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgecolor='k', markerfacecolor='w', markersize=13))
    legend_labels.append(f'{len(unflagged_ants)} / {len(ants)} Total {["Core", "Outrigger"][outriggers]} Antennas Never Flagged')
    legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markerfacecolor='k', markersize=15))
    legend_labels.append(f'{len(ants) - len(unflagged_ants)} Antennas {["Core", "Outrigger"][outriggers]} Flagged for Any Reason')

    if use_auto_metrics:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=autom_color, markersize=15))
        legend_labels.append(f'{len([ant for ant in auto_ex_ants if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas Flagged by Auto Metrics')
    if use_ant_metrics: 
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=antm_color, markersize=15))
        legend_labels.append(f'{np.round(np.sum([frac for ant, frac in ant_metrics_xants_frac_by_ant.items() if ant in ants]), 2)} Antenna-Nights on' 
                             f'\n{np.sum([frac > 0 for ant, frac in ant_metrics_xants_frac_by_ant.items() if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas '
                             'Flagged by Ant Metrics\n(alpha indicates fraction of time)')        
    if use_redcal:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=rc_color, markersize=15))
        legend_labels.append(f'{np.round(np.sum(list(redcal_flagged_frac.values())), 2)} Antenna-Nights on' 
                             f'\n{np.sum([frac > 0 for ant, frac in redcal_flagged_frac.items() if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas '
                             'Flagged by Redcal\n(alpha indicates fraction of time)')

    # use rectangular patches for a priori statuses that appear in the array
    for aps in sorted(list(set(list(a_priori_statuses.values())))):
        if aps != 'Not Found':
            legend_objs.append(plt.Circle((0, 0), radius=7, fill=True, color=status_colors[aps]))
            legend_labels.append(f'A Priori Status:\n{aps} ({[status for ant, status in a_priori_statuses.items() if ant in ants].count(aps)} {["Core", "Outrigger"][outriggers]} Antennas)')

    # label nodes as a white box with black outline
    if len(node_centers) > 0:
        legend_objs.append(matplotlib.patches.Patch(facecolor='w', edgecolor='k'))
        legend_labels.append('Node Number')

    if len(unused_ants) > 0:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markerfacecolor='grey', markersize=15, alpha=.2))
        legend_labels.append(f'Anntenna Not In Data')
        
    
    plt.legend(legend_objs, legend_labels, ncol=2, fontsize='large', framealpha=1)
    
    if outriggers:
        pass
    else:
        plt.xlim([-200, 150])
        plt.ylim([-150, 150])        
       
    # set axis equal and label everything
    plt.axis('equal')
    plt.tight_layout()
    plt.title(f'Summary of {["Core", "Outrigger"][outriggers]} Antenna Statuses and Metrics on {JD}', size=20)    
    plt.xlabel("Antenna East-West Position (meters)", size=12)
    plt.ylabel("Antenna North-South Position (meters)", size=12)
    plt.xticks(fontsize=12)
    plt.yticks(fontsize=12)
    xlim = plt.gca().get_xlim()
    ylim = plt.gca().get_ylim()    
        
    # plot unused antennas
    plt.autoscale(False)    
    for ant in unused_ants:
        if nodes[ant] in node_centers:
            plt.plot([hd.antpos[ant][0], node_centers[nodes[ant]][0]], 
                     [hd.antpos[ant][1], node_centers[nodes[ant]][1]], 'k', alpha=.2, zorder=0)
        
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4, fill=True, color='w', ec=None, alpha=1, zorder=0))
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4, fill=True, color='grey', ec=None, alpha=.2, zorder=0))
        if hd.antpos[ant][0] < xlim[1] and hd.antpos[ant][0] > xlim[0]:
            if hd.antpos[ant][1] < ylim[1] and hd.antpos[ant][1] > ylim[0]:
                plt.text(hd.antpos[ant][0], hd.antpos[ant][1], str(ant), va='center', ha='center', color='k', alpha=.2) 

Figure 1: Array Plot of Flags and A Priori Statuses¶

This plot shows all antennas, which nodes they are connected to, and their a priori statuses (as the highlight text of their antenna numbers). It may also show (depending on what is finished running):

  • Whether they were flagged by auto_metrics (red circle) for bandpass shape, overall power, temporal variability, or temporal discontinuities. This is done in a binary fashion for the whole night.
  • Whether they were flagged by ant_metrics (green circle) as either dead (on either polarization) or crossed, with the transparency indicating the fraction of the night (i.e. number of files) that were flagged.
  • Whether they were flagged by redcal (blue circle) for high chi^2, with the transparency indicating the fraction of the night (i.e. number of files) that were flagged.

Note that the last fraction does not include antennas that were flagged before going into redcal due to their a priori status, for example.

In [26]:
core_ants = [ant for ant in ants if ant < 320]
outrigger_ants = [ant for ant in ants if ant >= 320]
Plot_Array(ants=core_ants, unused_ants=unused_ants, outriggers=False)
if len(outrigger_ants) > 0:
    Plot_Array(ants=outrigger_ants, unused_ants=sorted(set(unused_ants + core_ants)), outriggers=True)

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.0.5.dev13+gd6c757c
3.2.1
In [ ]: