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 = "2459981"
data_path = "/mnt/sn1/2459981"
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: 2-5-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/2459981/zen.2459981.21274.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1851 ant_metrics files matching glob /mnt/sn1/2459981/zen.2459981.?????.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/2459981/zen.2459981.?????.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 2459981
Date 2-5-2023
LST Range 3.572 -- 13.534 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas 96
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 53 / 198 (26.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 119 / 198 (60.1%)
Redcal Done? ❌
Never Flagged Antennas 79 / 198 (39.9%)
A Priori Good Antennas Flagged 46 / 93 total a priori good antennas:
3, 7, 9, 10, 15, 16, 29, 30, 40, 42, 54, 55,
56, 71, 72, 81, 86, 94, 101, 103, 107, 109,
111, 121, 122, 123, 128, 136, 140, 143, 144,
146, 151, 158, 161, 165, 170, 173, 182, 185,
187, 189, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 32 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 61, 62, 64, 73,
74, 82, 89, 95, 115, 132, 137, 139, 211, 220,
222, 223, 229, 237, 238, 241, 245, 261, 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_2459981.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% 100.00% 0.00% 9.866232 12.995503 10.569946 11.193192 10.344184 12.322539 0.254460 0.706532 0.030722 0.033651 0.003609
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.536961 1.703470 1.792481 0.405440 3.342256 -0.358958 10.968176 3.169719 0.593908 0.616910 0.398000
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.793253 -0.226392 0.359458 0.138545 0.251410 1.996444 0.509465 0.388985 0.607568 0.617458 0.387253
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.989207 0.060446 -1.166481 -0.175234 0.008498 0.400797 11.288424 10.333236 0.612709 0.627367 0.380687
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.076560 -1.334926 -0.563282 -0.049389 -0.268510 0.411872 3.165410 0.580931 0.612357 0.623730 0.377353
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.285795 -0.646518 3.181342 -1.361929 5.975340 0.581450 1.725880 -0.418105 0.588963 0.623241 0.390825
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 2.785838 -0.743285 6.766003 -1.548869 9.588210 0.732539 1.943911 0.826035 0.523658 0.622212 0.415678
15 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.244436 13.227793 10.499749 11.114772 10.388895 12.344894 -0.107858 0.179958 0.026431 0.025687 0.001362
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.071387 -0.779054 10.533129 0.748620 10.340191 1.837802 0.226078 2.416912 0.033575 0.623267 0.503361
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.680293 1.391572 0.486134 0.344225 0.582431 0.724783 2.311725 1.663118 0.617202 0.631441 0.385737
18 N01 RF_maintenance 100.00% 100.00% 37.39% 0.00% 10.695776 17.232317 10.499792 -0.818691 10.507719 7.774710 0.166602 20.538813 0.030873 0.228688 0.174367
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.687620 -0.638459 -1.209473 -0.878402 -0.658262 0.576737 0.589557 1.568710 0.622308 0.639142 0.377660
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.175074 -1.105296 2.655419 -1.262204 0.303508 0.831261 3.374116 -0.245788 0.610015 0.638000 0.383448
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.143486 0.435297 -0.674026 -0.035250 0.258305 1.557548 -0.187620 -0.010929 0.607483 0.614478 0.371966
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.662038 -0.271192 0.649812 0.458093 1.126165 1.248619 -0.379113 -1.221970 0.579579 0.594260 0.373521
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.521608 12.075740 10.565115 10.976387 10.478008 12.396419 1.603033 1.112836 0.035370 0.038841 0.004435
28 N01 RF_maintenance 100.00% 0.00% 87.36% 0.00% 9.957270 24.078414 -0.196390 2.724401 7.104656 10.807942 3.722259 25.851658 0.361833 0.154678 0.265650
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.145372 12.523065 10.131561 10.547460 10.463778 12.375013 0.147174 -0.206662 0.030580 0.037318 0.006976
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 1.012544 -0.251359 1.415145 -1.447230 4.533588 1.808075 1.013842 -0.110780 0.616833 0.648548 0.385635
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.538275 -1.175246 1.233240 0.969729 1.421865 -0.461635 0.787107 3.183570 0.634235 0.639290 0.374621
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.711055 24.588535 -0.087558 3.011978 0.672600 0.914168 1.996934 8.640179 0.619422 0.526295 0.357634
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.617858 13.688218 4.648739 4.933175 10.439400 12.329440 0.873933 0.424842 0.035898 0.047355 0.007740
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.468343 -0.105900 1.613025 -1.059013 0.691945 -1.307076 -0.867541 -0.471473 0.590247 0.582206 0.370211
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 24.705361 25.066399 13.989848 13.881792 10.559121 12.222765 4.076620 4.263589 0.033805 0.031535 0.001479
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.161286 0.408541 -1.256117 1.452500 1.047147 0.989638 -0.744229 2.280518 0.611881 0.619980 0.393590
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.036376 0.085710 0.208954 0.439197 0.124947 0.671797 3.090624 0.709424 0.621278 0.629943 0.395109
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 9.527792 3.553462 10.158872 0.403067 10.420064 -0.487298 0.442990 0.483414 0.039071 0.611062 0.467600
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.589221 0.021583 -0.035560 -0.012198 1.771668 0.027967 0.284146 1.311443 0.623488 0.638156 0.370393
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.120022 3.139899 -0.956293 8.872700 5.981737 4.746893 -0.603317 0.311998 0.639694 0.522145 0.421522
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.077265 0.675632 0.044718 0.601522 -1.016822 0.053860 -1.226693 0.590023 0.634051 0.634814 0.371921
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.373835 -0.311133 -0.427197 -0.662840 -0.604158 -0.095112 -1.082299 -0.776772 0.625083 0.644985 0.372678
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.498658 3.405025 0.209486 0.580574 -0.850542 1.465101 0.016223 1.776834 0.618757 0.628165 0.365741
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.082799 -0.054481 -0.894752 -0.855077 -0.879471 -0.387947 -0.797371 -1.072594 0.623794 0.644686 0.385342
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.699234 13.374602 4.545585 4.530156 10.482399 12.237636 1.958568 0.074408 0.030697 0.054437 0.016155
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.033850 0.857183 0.640668 2.205754 -0.309054 2.717260 -0.677211 -2.158420 0.590769 0.609737 0.378968
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.095531 -0.091508 -1.038146 0.581713 1.208225 -0.315766 0.074871 0.095916 0.542624 0.589288 0.380726
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.150565 5.606974 0.349947 1.091359 1.232598 3.324915 20.434412 64.072147 0.591629 0.575456 0.372750
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 9.708019 3.916366 0.259485 1.731707 4.642077 3.953771 52.442228 2.046214 0.500096 0.509272 0.253605
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.401195 5.922223 -0.426527 0.475106 0.575345 0.628630 1.990867 1.414269 0.623609 0.632605 0.385600
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.853364 2.726208 -1.504223 -1.352943 2.956861 3.273937 2.628832 2.893002 0.635798 0.645853 0.390475
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 26.995752 -0.682394 4.924183 -0.899726 2.761855 6.224173 7.424638 1.899658 0.455804 0.646041 0.384571
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.157118 12.847486 10.010039 10.519226 10.429834 12.317862 0.631621 1.888820 0.029396 0.033452 0.003749
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.460530 -0.109511 -0.759393 1.333635 5.106169 6.430326 0.079942 2.432218 0.643676 0.650444 0.371154
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 20.510168 3.388449 8.478218 -1.361204 6.562876 6.270183 20.429393 5.055491 0.389688 0.652880 0.409934
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.510170 12.460507 10.467694 11.112798 10.343648 12.284448 1.064866 0.704991 0.036873 0.036423 0.001472
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.337725 0.654932 9.998935 0.951408 10.157227 1.492385 -0.087811 5.441270 0.048071 0.632316 0.497173
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.952794 12.367424 -0.438756 11.140352 -0.470748 12.311863 0.522489 2.133850 0.619350 0.066813 0.499240
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.589376 0.278065 -0.701096 -1.542576 1.821941 -1.286129 -0.855751 -0.081315 0.567414 0.597843 0.366417
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.186826 0.510976 -1.296889 1.445025 -0.073102 0.031953 2.609703 -0.953101 0.567142 0.608291 0.379489
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.032118 12.874286 -0.158389 4.958224 0.839355 12.416265 -0.560266 1.754094 0.590863 0.045608 0.471280
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.016514 0.311364 -0.699399 -1.024495 -0.608677 -0.164966 2.228528 0.201372 0.573862 0.564332 0.360437
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.525741 1.137041 0.473687 1.094634 -0.540704 0.745187 1.232211 -0.286959 0.600369 0.617159 0.397252
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.647061 1.314357 -1.389505 -1.384671 2.548062 -0.642012 -0.716697 -0.424224 0.616516 0.634713 0.396200
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.523444 1.916264 -0.232596 1.272872 -0.390565 0.204883 -0.017704 1.743396 0.628266 0.625257 0.382220
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 18.428533 25.678125 1.039217 14.623183 5.543055 12.237272 -0.368250 7.769199 0.367045 0.030866 0.276727
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.746472 -0.317752 0.312325 0.760347 -0.385558 1.397531 -0.643696 -0.607216 0.624618 0.644764 0.368469
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.320311 -0.216981 -0.124401 0.012762 0.556750 1.184021 0.034023 -0.235401 0.636146 0.650267 0.367480
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.410195 -0.451493 0.692535 0.956295 0.425741 -0.828718 0.834799 0.672095 0.646541 0.656140 0.364444
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.525633 13.557475 10.994190 11.546160 10.214239 12.117714 0.669367 0.835591 0.035896 0.039569 0.004786
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.706654 0.750867 -1.444595 -1.229588 0.824593 -0.638383 -0.648612 -0.792232 0.642260 0.653343 0.369173
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.212941 -0.115192 0.036705 -0.665046 0.012510 1.031769 -0.838602 3.394905 0.640829 0.648947 0.369353
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 49.559531 13.139176 0.620559 -0.468244 4.924972 6.993290 7.544838 24.596214 0.325844 0.538302 0.342548
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 31.141957 -0.235663 -0.381827 1.374338 2.755279 0.301092 3.061327 1.239264 0.424458 0.616029 0.373758
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.706058 13.163846 -1.486450 4.989044 -0.379660 12.233403 0.839476 -0.639143 0.583078 0.041520 0.452924
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.532409 13.960494 0.495553 4.882083 -0.687756 12.264808 -0.849901 0.647482 0.597253 0.049127 0.471392
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.237892 13.210799 0.160021 9.676334 -0.544498 11.957970 0.586839 0.884346 0.577590 0.039650 0.447902
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.442118 -0.308460 0.483748 2.256324 -0.622854 -0.960610 -0.324199 2.025596 0.599031 0.601566 0.376564
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.397690 -0.068027 0.273907 0.336879 -0.011489 -0.149439 -0.781856 -0.025443 0.611980 0.627349 0.381794
84 N08 RF_maintenance 100.00% 72.29% 100.00% 0.00% 18.683397 22.790218 13.596567 14.150773 8.832334 12.221606 2.931716 3.456964 0.194757 0.037857 0.123361
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.186190 0.424601 1.564046 1.432583 -0.243220 -0.319600 -0.670029 -0.609732 0.624716 0.640673 0.371491
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.515147 -0.176860 1.497266 1.747659 3.496289 -0.773944 0.234648 18.666798 0.616457 0.636703 0.355023
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.343845 5.813635 -0.672829 -0.486097 1.646922 0.913598 15.920009 13.007303 0.639069 0.660850 0.359954
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.605058 0.020899 0.472270 0.719640 -0.462857 -0.771746 1.829718 0.224719 0.638169 0.652404 0.359561
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.066455 0.212753 0.075164 0.833928 -0.454435 -0.778912 -0.765715 -0.523644 0.642147 0.653138 0.361904
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.143894 -0.237332 -1.394589 -0.855872 3.257298 5.439871 -0.427926 3.186754 0.645992 0.656810 0.368015
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.366305 -0.180314 -0.193804 -0.450499 -0.643226 -1.018866 0.861683 0.040687 0.632518 0.650019 0.375118
92 N10 RF_maintenance 100.00% 0.00% 15.94% 0.00% 32.437436 35.108391 0.455152 1.503455 6.065584 5.427234 0.600344 7.369236 0.287348 0.248469 0.064069
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.564592 -0.443294 2.437737 -1.256579 1.657941 0.046114 2.671656 0.049164 0.619755 0.639266 0.382071
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.844747 12.842518 10.709471 10.999377 10.381474 12.299345 0.470783 0.155022 0.033613 0.026909 0.003290
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 3.497079 3.494179 -0.833716 1.146733 0.383134 0.895405 -0.233769 0.599545 0.569081 0.597093 0.351617
96 N11 not_connected 100.00% 0.00% 0.00% 100.00% 24.275696 2.610225 0.968993 3.372681 10.647848 10.472751 1.145069 -1.335205 0.249065 0.221203 -0.262090
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.810717 5.849468 -0.956366 1.427330 0.903719 4.617589 0.083652 6.486844 0.575691 0.524102 0.374583
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.983231 8.174636 -0.365336 1.197767 -0.195857 1.593243 0.654622 1.022384 0.629783 0.640841 0.374798
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.502504 1.293094 -1.430219 -0.986832 0.255524 1.118023 -0.541622 7.150442 0.639953 0.650560 0.371427
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.032351 5.042215 1.460391 -1.213230 20.131309 0.623888 5.313681 2.705090 0.632465 0.656929 0.368797
104 N08 RF_maintenance 100.00% 15.18% 0.49% 0.00% 12.222619 49.642936 -1.156435 6.956979 20.269734 51.654386 189.240156 390.918017 0.535823 0.592257 0.337711
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.688940 -0.200695 -0.348697 0.181688 -0.020966 -0.969222 -0.800452 -0.464696 0.643256 0.653553 0.359231
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.544815 1.248752 -1.413678 -0.661554 0.492955 -1.036153 -0.417857 0.227866 0.645939 0.657261 0.359732
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 2.113607 2.904004 -0.787589 -1.172297 0.485620 0.065598 5.545122 5.305400 0.642905 0.656208 0.360217
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.975201 39.578341 10.507286 1.084610 10.447330 5.427580 0.917856 6.561492 0.036495 0.282937 0.158108
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.804343 12.433442 10.539915 10.847937 10.508809 12.382365 -0.000581 1.151911 0.028332 0.026011 0.001967
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 24.058228 24.438393 14.069561 14.374434 10.351952 12.072186 3.102879 3.290865 0.023402 0.025541 0.001293
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 27.135943 12.517518 2.813737 10.783914 5.262107 11.976767 1.615584 1.280316 0.301889 0.084739 0.173022
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.703401 -0.475117 0.279034 0.187938 0.820233 2.752721 0.603090 -0.721339 0.619946 0.631518 0.386067
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.793562 13.694378 4.268202 4.984151 10.290423 12.211094 0.975386 0.057199 0.037310 0.031049 0.003308
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 14.025150 11.234917 15.161358 12.096510 10.577191 12.453057 191.007385 132.182911 0.023814 0.029154 0.003226
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.859638 -0.673350 -0.989580 -0.306161 0.011489 -1.374243 -0.301165 0.052414 0.564370 0.590100 0.383341
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.785653 13.842500 10.654592 11.498216 10.284351 12.293216 0.467703 2.682105 0.028868 0.033873 0.003533
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.076643 1.427174 -0.166294 0.508260 -0.313501 -0.146177 -0.146004 0.724948 0.610087 0.627487 0.388960
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.941830 1.906206 2.959009 -1.067080 -0.343879 0.785156 1.599642 0.299395 0.620541 0.653051 0.379559
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.101226 2.963623 -1.401274 6.311894 1.071230 -0.639945 2.916974 14.583155 0.642950 0.627021 0.363209
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.674962 6.595502 -1.352913 -1.310234 2.907224 4.001781 -0.390957 -0.799413 0.638498 0.662574 0.370102
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.645577 8.358544 0.874021 0.973501 0.004019 -0.074458 -0.230351 0.639440 0.652058 0.662570 0.368863
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.030160 -0.144157 0.042204 0.610690 -0.848452 0.036622 1.184209 0.628071 0.650702 0.662917 0.369934
125 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.903722 1.291448 -0.369093 0.741510 1.375937 0.768986 1.852643 1.057534 0.644403 0.653361 0.360088
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.467973 -0.894647 -1.264798 1.002904 2.893535 2.139377 9.051557 6.625473 0.640920 0.648007 0.368623
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.559844 0.176401 0.627072 0.376585 1.188072 0.743352 0.528349 2.119128 0.637074 0.654249 0.376003
128 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.314955 11.973932 0.953605 11.116707 7.634815 12.238691 -0.520113 0.984532 0.636861 0.040192 0.470672
131 N11 not_connected 100.00% 0.00% 3.19% 0.00% -0.808582 12.187279 0.129515 4.791359 -1.056825 10.816495 -0.895509 -0.324946 0.607659 0.284413 0.426972
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.513717 2.720584 -0.210004 -1.397613 1.455576 -0.368633 0.318274 -0.022344 0.585619 0.584396 0.368203
133 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.306753 -0.878757 -1.427468 -0.126850 0.112637 7.995322 -0.611556 0.699475 0.568564 0.601137 0.390863
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.437223 13.665031 4.440711 4.960864 10.270406 12.241177 -0.135656 0.235458 0.042306 0.036299 0.003134
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.440074 -1.204842 -0.993505 -1.413006 2.393992 0.323389 11.718334 0.104661 0.568283 0.605790 0.401436
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.154665 -0.314822 10.098912 -0.914097 10.471258 0.287931 0.872801 -0.705512 0.042566 0.608597 0.459343
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.176435 -0.593467 0.262938 -1.262807 1.501574 -0.734606 0.143368 0.010929 0.589886 0.622937 0.390394
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.822945 0.024241 1.785473 -0.730061 1.195661 -1.083848 -0.365829 0.302942 0.618053 0.622707 0.370275
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 2.480580 -1.129001 -1.328646 0.064546 9.359503 -0.413132 34.916501 4.724154 0.624032 0.651271 0.370572
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.282641 -0.827431 -0.227083 0.938442 1.322449 -0.706639 1.072005 -0.943859 0.637697 0.659857 0.370023
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.552862 12.412368 -0.622720 11.145287 2.438406 12.343256 26.511627 0.898424 0.632997 0.047509 0.513769
143 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.672379 -0.817905 -1.420221 -1.444661 0.822841 20.987213 -0.424065 -0.296479 0.652523 0.660181 0.368807
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.093809 -0.305899 -1.212963 4.999386 0.848196 26.860034 -1.020315 -0.163224 0.653921 0.609054 0.384223
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.216636 12.532052 10.530389 11.185045 10.177579 12.370010 -0.045440 2.240579 0.075321 0.031665 0.032949
146 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.249219 -0.492472 -0.697178 0.886816 8.987308 0.445686 0.276139 -1.697819 0.623807 0.651312 0.372929
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.398238 -1.556515 1.240079 2.442341 -0.412356 -0.800497 -0.019412 0.430305 0.627905 0.633383 0.367454
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.190066 0.042073 -0.576879 -0.700999 1.386620 2.044054 -0.734543 -0.788454 0.630746 0.645284 0.381885
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.035991 -1.332704 -1.210127 -1.228512 -0.640242 0.953970 0.911022 0.564291 0.624004 0.639009 0.387632
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.462407 -0.641174 -1.094443 -1.117729 -1.147051 0.298633 0.617700 1.374939 0.615930 0.628286 0.386972
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 12.084016 1.225778 0.404873 0.432386 5.356881 -0.361028 7.753223 -0.360790 0.536458 0.568250 0.350383
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.571302 -0.952272 10.263578 -1.537443 10.506934 -0.062257 1.366482 1.511270 0.043611 0.611337 0.470547
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.767135 12.121974 8.628629 10.860085 6.409224 12.381350 0.640346 1.271861 0.420978 0.040411 0.325366
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.091932 -0.376055 0.019351 0.690366 -0.517316 0.395225 -0.424376 -0.052360 0.596753 0.620599 0.387636
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.014352 0.001049 -0.065096 -0.578811 1.392260 2.105142 1.401236 12.480849 0.611627 0.636232 0.389706
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.417341 24.925296 -1.485741 -0.713067 0.295525 6.212868 -0.478876 66.714918 0.583805 0.504028 0.347843
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.482380 -1.085842 -0.251753 -0.764883 -0.466421 1.644328 0.583801 0.333407 0.626390 0.643196 0.375740
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.992467 27.440913 0.064900 -0.540940 -0.071780 1.715083 -0.490780 0.247909 0.633511 0.517987 0.342294
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 2.097835 -0.997026 -0.756432 -1.069537 1.011668 0.851132 2.895371 0.095772 0.636541 0.659646 0.374487
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.604503 0.995438 -0.187089 0.465828 -0.225410 0.605383 -0.411603 0.798661 0.647370 0.657939 0.374703
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.995798 0.137119 0.470423 1.499831 0.399605 1.656115 0.572666 0.821687 0.641385 0.651647 0.365285
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 29.127688 -0.153740 -0.517482 -1.104475 5.138636 -0.298065 6.493139 0.274153 0.516652 0.657591 0.370497
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.273031 2.694623 -0.410673 3.630463 0.205027 5.431906 4.061572 0.162955 0.641416 0.646841 0.368127
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.891987 -1.122500 -1.448175 -0.175714 1.211560 -0.166685 1.044387 3.453980 0.632651 0.638991 0.370655
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.929402 -1.387832 0.359126 -0.451250 0.924214 0.420714 -0.267136 1.302945 0.623998 0.636997 0.378466
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.797343 -1.185890 -0.907316 -1.323246 0.370011 0.333226 -0.685919 -0.505543 0.623214 0.637606 0.381755
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.758842 -0.455423 10.870697 -0.826621 10.267496 0.936061 1.977237 6.603671 0.041184 0.630835 0.493015
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.696205 2.729903 -1.372770 0.012198 -0.477945 1.877434 -0.586471 1.007494 0.571914 0.552649 0.360342
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 11.929099 12.868144 3.957188 4.554481 10.565140 12.381817 2.558450 4.454818 0.041708 0.046102 0.003939
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.224825 -0.605558 -0.199470 -1.322213 1.011758 2.001535 -0.622047 0.055177 0.591609 0.632408 0.389309
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.408270 13.057447 -1.530493 11.300564 0.923935 12.216082 12.798934 1.621366 0.628385 0.053523 0.521058
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.284711 -0.327450 0.527662 0.443252 -0.565526 -0.405318 -0.331814 3.603346 0.629827 0.643267 0.380539
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.287902 12.106894 -1.153003 10.829090 0.229163 12.422410 7.402290 1.130681 0.641128 0.048248 0.490219
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.158499 0.668882 -0.058345 0.697037 1.246430 -0.496568 0.265795 -0.109891 0.631191 0.644450 0.364170
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.972391 -0.686228 -1.486738 -0.474426 -0.743539 -0.162472 -0.032759 -0.052123 0.643790 0.656004 0.361785
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 32.115758 -0.354401 -0.411832 -1.541670 8.303371 0.594919 10.212853 -0.126000 0.521693 0.655011 0.371007
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.000590 -0.715939 0.609587 0.022332 -0.840768 -0.768177 -0.357975 -0.629166 0.648543 0.659798 0.373382
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.446501 -0.877870 -1.500669 -0.156299 2.895087 4.470086 1.319686 0.527783 0.640180 0.652138 0.371257
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 8.794351 11.993023 10.054539 10.966297 10.318863 12.426626 9.305402 2.216755 0.028630 0.032813 0.002261
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.171161 -1.285274 -0.674956 0.661173 -0.399618 0.168734 -0.671770 -1.175051 0.618256 0.639441 0.391931
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.579377 0.558355 1.414400 -0.498860 -0.014274 0.430581 9.717434 0.831564 0.603568 0.620834 0.387229
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.914521 6.453604 5.338516 5.411708 8.022683 9.996714 -3.369909 -3.519921 0.570049 0.584606 0.378232
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.752726 0.710111 5.561312 1.993643 8.289359 2.715229 -3.396730 -0.544310 0.555733 0.595555 0.403190
200 N18 RF_maintenance 100.00% 100.00% 72.83% 0.00% 11.653693 34.206957 4.400073 0.647279 10.548489 5.515448 1.063397 22.744504 0.043311 0.184504 0.116435
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.555681 4.570327 3.496489 4.707816 3.987982 8.153115 -0.728467 -2.566516 0.617759 0.615073 0.376436
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.637740 2.969834 1.917545 -1.223252 1.538911 0.439324 -0.625353 25.482117 0.624348 0.614272 0.371344
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.866387 14.430121 1.137850 -1.066805 6.910587 7.503192 13.595887 1.646375 0.635041 0.653892 0.379164
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.851447 0.354205 3.081385 -0.930425 7.454852 -0.296023 0.227024 7.465437 0.362832 0.612287 0.438443
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.139486 7.395568 -0.609538 2.168912 3.901867 4.479489 -0.527180 0.150645 0.606362 0.504350 0.393710
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.268377 0.917029 -0.593034 -1.470558 -0.387992 0.120962 5.359014 -0.778054 0.608314 0.611868 0.364578
208 N20 dish_maintenance 100.00% 99.30% 99.30% 0.00% 226.744101 226.121119 inf inf 3966.326410 4066.137780 4951.895451 5105.941258 0.555151 0.584424 0.395185
209 N20 dish_maintenance 100.00% 99.08% 99.14% 0.00% 232.068823 231.534248 inf inf 4253.865665 4448.170198 5484.269298 5457.570580 0.732340 0.703369 0.456517
210 N20 dish_maintenance 100.00% 99.14% 99.24% 0.00% 226.470757 225.935854 inf inf 4492.284163 4473.906675 5788.139324 5794.621466 0.652073 0.577536 0.414724
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.804334 2.137139 -1.145612 0.272814 -0.479777 0.022113 0.736589 -0.425461 0.568759 0.584864 0.369638
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.116165 -0.934637 0.654959 -0.123751 -0.459886 0.326358 3.156786 -0.717884 0.611703 0.617112 0.374022
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 1.326118 0.060050 -1.202228 -0.488358 0.998190 -0.695671 10.611462 -0.790135 0.594357 0.623251 0.376713
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.429502 -0.077953 -0.141478 0.403027 -0.813761 -0.870732 2.418557 -1.279564 0.606509 0.630794 0.375445
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.076232 -0.314108 -1.579567 0.753803 -0.427473 -0.390942 0.628816 2.259203 0.597669 0.633101 0.380937
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.995311 5.778391 5.753254 5.274875 8.552273 9.525574 -3.321141 -2.832003 0.595266 0.609323 0.373262
225 N19 RF_ok 100.00% 0.00% 91.73% 0.00% -0.696491 12.610679 0.885659 4.739767 -0.864181 12.057906 -1.473871 0.831085 0.616313 0.135863 0.506494
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.720591 19.207009 -0.395437 1.275558 -0.993001 4.483264 -0.968910 2.783609 0.604013 0.533213 0.362846
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.790008 0.453637 -1.472221 0.347708 -0.458462 -0.355590 12.384212 -0.405086 0.569011 0.605441 0.368708
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.977158 18.393779 -0.860536 -0.005022 1.604616 6.316070 50.872663 46.430795 0.524055 0.494844 0.314411
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.889363 0.016514 1.884917 1.699592 0.411598 1.635550 -1.333247 -1.714272 0.588889 0.604440 0.387356
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.743535 0.036026 -0.056833 -1.370494 -0.154128 -1.269717 -0.520357 -1.026122 0.546925 0.597173 0.387909
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.403267 -0.051138 1.161181 0.608121 -0.396224 -1.082356 -1.624804 -1.728398 0.606469 0.617244 0.383637
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.807168 -1.228992 0.240229 0.338551 1.794690 -0.888253 14.918172 1.232610 0.598049 0.619562 0.381765
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.495082 0.436913 -0.720166 -0.702150 5.737918 8.786522 3.918949 5.734632 0.597440 0.616720 0.381883
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.423560 -1.106782 -0.273468 0.459343 -1.169290 0.338880 0.570467 -0.847624 0.602834 0.624009 0.390448
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 23.156257 0.847382 0.560897 2.067266 3.595873 2.333881 -0.135869 -0.469175 0.453032 0.618498 0.381280
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 51.674956 -0.435476 0.994757 -1.494027 8.404720 -1.405663 39.218672 0.554868 0.374900 0.595335 0.420660
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.533685 2.010557 1.509768 -0.889030 3.369733 0.999377 3.255281 7.152352 0.472800 0.570912 0.374660
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.300239 2.056858 -0.258331 -1.398913 -0.677184 -1.114151 -1.136937 -0.044148 0.581817 0.584261 0.378417
246 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 8.473594 6.982003 -1.032840 -0.118599 5.213998 5.193791 3.447987 -0.607713 0.320350 0.312764 0.152541
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.304278 1.519189 0.878042 -0.201895 -0.645608 -1.035906 -0.803132 1.521290 0.581172 0.582509 0.381083
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.254513 7.751807 9.618104 10.052120 9.927571 11.852543 11.261069 18.021786 0.034205 0.028835 0.004830
320 N03 dish_maintenance 100.00% 100.00% 100.00% 0.00% 13.780707 12.825088 6.951891 7.223622 10.498642 12.434867 0.958077 2.459304 0.056669 0.049293 0.006634
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.395261 2.374941 1.302114 1.814793 1.116076 1.705170 1.287893 -0.825419 0.492165 0.508058 0.369844
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.780080 -0.677695 1.415722 -1.251633 1.149814 -0.887355 -1.215078 -0.292981 0.523680 0.524781 0.383724
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.478214 -0.385725 -0.288445 -0.880696 1.675251 -1.225361 4.728393 0.892068 0.456619 0.516231 0.370870
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.002578 1.407312 -1.235667 -1.421821 -0.054187 -0.879925 0.556057 0.655889 0.468026 0.501910 0.363482
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, 10, 15, 16, 18, 27, 28, 29, 30, 32, 34, 36, 40, 42, 47, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 77, 78, 79, 80, 81, 84, 86, 87, 90, 92, 94, 96, 97, 101, 102, 103, 104, 107, 108, 109, 110, 111, 113, 114, 117, 120, 121, 122, 123, 125, 126, 128, 131, 133, 134, 135, 136, 140, 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, 204, 205, 206, 207, 208, 209, 210, 221, 224, 225, 226, 227, 228, 239, 240, 242, 243, 244, 246, 262, 320, 329]

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

golden_ants: [5, 17, 19, 20, 21, 31, 37, 38, 41, 44, 45, 53, 65, 66, 67, 69, 70, 83, 85, 88, 91, 93, 105, 106, 112, 118, 124, 127, 141, 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_2459981.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 [ ]: