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 = "2460052"
data_path = "/mnt/sn1/2460052"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 4-17-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/2460052/zen.2460052.42109.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 361 ant_metrics files matching glob /mnt/sn1/2460052/zen.2460052.?????.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/2460052/zen.2460052.?????.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 2460052
Date 4-17-2023
LST Range 13.252 -- 15.192 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 361
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas 40, 42, 70, 112
Total Number of Nodes 19
Nodes Registering 0s N15
Nodes Not Correlating N07, N14
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 72 / 198 (36.4%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 123 / 198 (62.1%)
Redcal Done? ❌
Never Flagged Antennas 75 / 198 (37.9%)
A Priori Good Antennas Flagged 63 / 93 total a priori good antennas:
7, 15, 17, 19, 30, 31, 37, 38, 40, 42, 53,
54, 55, 56, 65, 66, 67, 70, 72, 81, 83, 86,
93, 94, 103, 109, 111, 112, 118, 121, 124,
127, 136, 140, 144, 145, 146, 147, 148, 149,
150, 151, 158, 160, 161, 162, 163, 164, 165,
166, 167, 168, 169, 170, 181, 182, 184, 186,
187, 189, 190, 191, 202
A Priori Bad Antennas Not Flagged 45 / 105 total a priori bad antennas:
8, 22, 35, 36, 43, 46, 48, 50, 52, 57, 62,
64, 80, 89, 90, 95, 113, 115, 120, 125, 132,
133, 135, 139, 201, 206, 220, 221, 222, 224,
228, 229, 237, 238, 239, 240, 241, 244, 245,
261, 320, 324, 325, 329, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2460052.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.058559 11.993887 -0.993709 -0.585966 0.875937 0.575747 -0.948242 -0.137354 0.591638 0.478649 0.410419
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.401171 0.354623 0.462456 2.958272 0.061675 1.078164 -0.300630 0.660751 0.595641 0.581152 0.413821
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.522651 0.166907 -0.282795 0.261058 -0.308857 0.671266 3.181585 11.479052 0.605824 0.594098 0.407794
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.522752 1.346635 0.925630 0.855300 -0.368667 -0.154547 -2.246133 -1.864289 0.583531 0.576052 0.392950
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.583870 -0.473822 2.747645 -0.207326 0.493141 -0.350284 2.459279 -0.330044 0.581575 0.594444 0.398530
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.908351 -0.306142 -0.467771 -0.321499 -1.019459 0.724946 -1.404751 0.126994 0.592156 0.578841 0.402823
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 11.329337 -0.339466 -0.607011 -0.341280 -0.352699 -0.025990 -0.522770 1.725739 0.485275 0.605256 0.398675
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.274502 0.903400 0.074916 0.608729 -0.335866 -0.567864 -1.545186 -2.069224 0.602881 0.595093 0.406753
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.182993 2.800534 0.910762 7.260787 0.290758 -0.466250 -0.040788 4.742551 0.599344 0.457146 0.439981
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.234074 4.044226 0.897817 1.320299 0.692369 1.528221 5.043025 11.296698 0.587024 0.406621 0.449575
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.178336 -0.206853 -0.080620 2.904672 -0.198447 4.580817 -0.091472 12.906906 0.615090 0.600806 0.403756
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.510633 -1.046458 1.791657 -0.278702 1.515047 1.227750 1.314845 -0.208198 0.607227 0.611797 0.397571
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.211420 0.373446 0.162461 0.463643 -0.223540 3.883749 0.467275 0.530070 0.599788 0.596729 0.394894
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.117011 -1.044589 -0.888892 -1.012039 -1.066118 -0.727457 -0.589459 -0.744319 0.574260 0.576687 0.397682
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.672573 18.638446 8.025625 5.191236 0.950103 3.113779 2.172763 44.687089 0.062832 0.064766 -0.050896
28 N01 RF_maintenance 100.00% 100.00% 0.55% 0.00% 6.489106 10.878082 8.154893 3.521011 1.156755 3.005678 1.156328 9.864273 0.029832 0.305965 0.242437
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.835759 -0.063975 0.006535 0.205331 1.459974 2.060135 1.341082 2.632139 0.625663 0.618921 0.401420
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.140646 -0.739930 0.478713 -0.498799 0.953938 -0.223082 4.316089 -0.053838 0.616104 0.625729 0.394119
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.355309 -0.179523 1.136789 2.542901 1.504705 0.776292 0.792136 24.402959 0.630589 0.612353 0.403964
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.684866 13.281723 0.044262 0.097158 -0.005325 0.771600 0.711368 3.498035 0.520483 0.539915 0.208555
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.436132 -0.816072 4.606600 -0.869041 1.071585 -0.902286 0.743842 -0.162965 0.040438 0.590160 0.432912
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.798983 -0.491320 -0.497971 -0.243939 -1.072571 -0.297773 -1.176982 -0.086607 0.584783 0.574444 0.399801
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.250555 3.822162 1.149385 0.895137 0.920215 1.443012 0.055589 0.892261 0.592665 0.587227 0.414997
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.760511 14.376886 -0.925315 10.081118 -0.739609 0.674651 -1.030172 2.705936 0.601952 0.031354 0.489590
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.312027 -0.353119 0.018111 0.399210 1.435123 1.785168 3.319278 11.518842 0.612669 0.602480 0.411316
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.141508 1.539901 0.186242 -0.079337 0.872782 3.022248 18.155732 1.043497 0.208215 0.205316 -0.300998
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.531391 0.659531 1.362406 1.720215 0.944135 0.285381 -0.038456 0.259510 0.620960 0.622379 0.400027
42 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.224856 2.266918 -0.179521 -0.277976 1.723257 2.242088 1.685851 9.229250 0.228310 0.212423 -0.298151
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.909909 0.186635 -1.043095 0.867817 0.028471 0.869101 -0.637118 0.967871 0.623777 0.626966 0.398030
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.530414 0.456760 -0.557587 0.579360 1.267721 0.665787 -0.697406 0.045828 0.636773 0.638273 0.404145
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.617577 1.567531 0.851784 0.846114 1.125370 0.569920 0.093839 2.860993 0.622876 0.617932 0.395069
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.198303 -0.600464 0.212938 -0.787259 0.681429 0.338710 0.052409 -0.318381 0.613697 0.626727 0.401376
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 6.933412 8.835768 4.539860 4.615068 1.157268 0.611411 1.889967 0.573760 0.031100 0.051314 0.014183
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.158807 -0.268793 -0.811422 -0.119076 -0.876268 -0.948075 1.947424 -1.410032 0.591482 0.596628 0.390882
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.151781 -0.776756 0.656412 -0.963193 -0.522443 -0.111593 0.339159 10.105409 0.557109 0.572876 0.384292
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.222695 0.427087 0.547435 1.559426 1.901644 1.412253 0.174145 0.497441 0.581141 0.575040 0.401934
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.928298 0.421538 0.302274 -0.038733 6.185127 0.441659 107.216985 0.056274 0.592242 0.594789 0.399630
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.294013 2.489496 0.709137 0.461369 2.139390 1.252470 3.913153 0.916377 0.614619 0.607268 0.405744
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.009881 -0.060034 0.141182 -1.015480 1.407251 -0.211814 9.879688 6.555641 0.623822 0.620741 0.405447
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 3.809083 1.370511 0.683502 -0.772142 0.206517 7.344027 -1.241780 -0.269160 0.361322 0.406838 0.180579
55 N04 digital_ok 100.00% 16.90% 100.00% 0.00% 0.233718 31.041894 -0.250864 5.945113 -0.290001 0.534155 1.421124 0.448788 0.237368 0.037817 0.070467
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.351517 1.340368 -0.918207 1.985187 0.456358 12.768547 -0.510674 1.255246 0.624338 0.616495 0.389510
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.598397 1.161216 -1.036700 -0.212899 1.345832 2.461916 0.280712 1.126219 0.632809 0.627758 0.392800
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.103059 8.303717 8.177457 8.669701 1.354217 0.942496 1.478185 1.537972 0.035896 0.035332 0.002649
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.807494 0.757631 8.199097 1.136281 1.004613 0.694358 0.420665 5.263160 0.042119 0.627568 0.472568
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.536504 8.265922 0.307720 8.693885 -0.182782 0.703046 0.676935 2.291494 0.612229 0.076295 0.494937
61 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.328821 -0.540438 4.347852 -0.266093 1.039998 0.436618 -0.116776 0.194804 0.033843 0.598746 0.425183
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.176849 -0.223715 0.415217 -0.276611 -0.674796 -0.743953 0.766125 -1.211697 0.579092 0.600930 0.388259
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.678159 8.582901 -0.987834 4.906420 0.265182 0.965475 -0.369865 2.547880 0.594702 0.043513 0.475581
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.549836 -0.223554 -0.673756 0.112800 -0.150142 -0.186305 -0.180531 -0.014391 0.573793 0.569053 0.388703
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 14.823141 14.355380 10.302068 10.384418 1.058977 0.845182 3.695151 5.163187 0.024027 0.029648 0.006293
66 N03 digital_ok 100.00% 37.95% 100.00% 0.00% 1.513262 14.728043 0.662291 10.500803 0.226865 1.031141 -1.757686 5.786118 0.206469 0.040757 0.093019
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.802064 -0.108159 -0.445783 0.982118 0.962588 1.978471 6.496144 2.688553 0.603184 0.597975 0.394803
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 15.767683 -0.571417 10.355079 -0.460084 0.966234 -0.928624 4.242955 -0.905479 0.031916 0.614961 0.491150
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.811727 1.433063 1.281129 -0.292150 1.266073 3.078494 2.174283 1.280512 0.624412 0.628402 0.399231
70 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.187424 2.251235 1.109881 2.521454 0.648919 2.483134 4.774838 0.891493 0.230972 0.209841 -0.287702
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.955743 -0.196343 -0.062948 0.427029 0.951049 2.707975 -0.563610 0.915592 0.638360 0.635094 0.392796
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.159086 8.360273 1.870939 8.763664 2.362779 0.545662 6.418839 1.861263 0.259010 0.083711 -0.026262
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.444423 0.940109 -0.347904 0.643218 1.300508 14.342906 0.641649 5.159374 0.641798 0.636681 0.403164
74 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.850155 -0.200414 -0.687000 -0.322849 -0.744996 4.750769 -1.149687 1.440221 0.638821 0.634557 0.402664
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 26.895331 7.889389 0.126678 -0.758055 1.165619 0.773664 10.200403 -0.022859 0.395484 0.527274 0.298757
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 14.589900 -0.432394 0.077875 -0.189574 1.032472 -1.078413 -0.385662 -0.367794 0.453684 0.601400 0.355121
79 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.413733 -0.592739 0.895722 -0.562321 -0.404188 -0.669860 4.149663 0.002131 0.563070 0.586820 0.390505
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.843862 0.929649 -0.862395 0.656125 -1.094222 0.053017 -1.066264 -1.620574 0.587855 0.576384 0.400059
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 32.965611 32.369779 18.461427 19.088602 31.627674 45.307346 372.363794 379.291286 0.018696 0.016400 0.001676
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 17.568587 42.479060 17.255305 21.060732 24.581292 67.888182 233.495114 488.654416 0.017428 0.016295 0.001014
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 15.002551 25.046694 15.733422 16.823464 19.344536 23.376523 207.703741 252.257659 0.017449 0.016555 0.000946
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.207038 15.924947 0.285539 10.569374 -0.859330 0.679596 -1.943069 4.074382 0.606508 0.045609 0.484470
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.673295 -0.033396 -0.749903 -0.444066 -1.281660 -0.314692 -1.287368 0.128852 0.623902 0.620742 0.394056
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.169845 0.341910 0.589407 0.295281 5.415340 0.634172 -0.144417 6.414640 0.629107 0.619259 0.384529
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 18.688191 2.063261 2.690666 -0.953428 11.646286 1.469846 46.153378 1.159826 0.507539 0.638474 0.350877
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.017441 0.844093 0.827261 1.204612 0.567602 2.524399 -0.156079 0.185455 0.632816 0.629431 0.381012
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.584415 0.139937 0.765063 1.092895 1.527294 -0.105755 -0.298171 0.135656 0.628760 0.625530 0.387052
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.533353 -0.987710 -0.059762 -1.070070 -0.257358 -0.150752 -0.186251 0.178706 0.625534 0.633555 0.394707
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.092352 0.330068 0.909532 0.730884 0.538312 0.708345 -0.130791 0.047706 0.614306 0.626657 0.395459
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.465425 0.118007 8.192276 0.604337 1.117721 0.473807 0.298877 0.891622 0.033759 0.625913 0.456654
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.650966 8.468815 8.254411 8.732147 1.118446 0.658291 1.960611 1.798058 0.029550 0.025035 0.002286
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 7.089142 0.569120 8.337929 5.306930 1.072232 5.426274 0.651363 3.136485 0.027934 0.565082 0.400060
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.265332 -0.690362 0.092882 -0.658392 0.133074 -1.095404 0.418864 -0.894594 0.574588 0.603298 0.397671
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.154318 12.958889 -0.121366 -0.568863 -1.551677 0.021668 -1.647328 -0.330865 0.592954 0.504863 0.379412
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.881760 1.443352 -0.587392 0.487211 -0.477287 0.063468 0.170543 8.937592 0.574097 0.561218 0.389894
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.762807 3.871892 0.301609 1.163955 1.293261 0.209137 -0.183856 0.139462 0.613226 0.608386 0.398540
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.735018 0.461899 -0.619618 -0.087983 -0.538519 2.121342 -0.692711 5.613204 0.627402 0.620795 0.393064
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.347888 1.938934 0.655390 -0.472769 -0.072207 -0.039465 -1.092763 8.175822 0.613811 0.626078 0.383374
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.369352 32.731956 0.778886 5.289235 0.996963 1.676148 1.047351 0.301280 0.624116 0.609302 0.389159
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.000566 0.378727 0.642808 1.145569 0.006411 1.288209 0.025972 0.159677 0.635633 0.632385 0.390979
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.008995 0.539835 0.201281 0.326056 3.534561 1.746015 0.386280 0.213330 0.625084 0.627854 0.385717
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.079646 1.837712 0.455621 -0.006535 0.783967 0.027178 0.332951 1.480604 0.617467 0.618997 0.382220
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.381556 1.429407 1.244435 2.142834 3.827790 0.439734 16.863752 0.426412 0.611789 0.621313 0.395766
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.320144 8.364961 8.248513 8.532153 1.099971 0.705194 0.402813 1.600914 0.060657 0.034619 0.020521
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 18.316278 -0.182083 0.733044 0.170708 0.945389 0.889451 0.057502 -0.136276 0.517984 0.628388 0.355518
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 5.760148 8.309511 0.912862 8.592219 13.739406 0.693381 5.160747 2.075694 0.576358 0.062229 0.458874
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% -0.427377 3.915011 1.378468 7.528079 0.622093 -0.401319 1.382567 0.777327 0.214477 0.137493 -0.249357
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.722729 2.134150 1.405352 1.315951 0.426852 0.089787 -2.929980 -2.600936 0.578982 0.565834 0.390542
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 2.051546 3.518388 1.106087 3.313194 0.064913 5.847955 -1.968306 1.663647 0.561519 0.482023 0.386345
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.881719 -1.060208 -0.540011 -0.848016 -0.014767 -0.674186 -0.301150 -0.957791 0.570305 0.571219 0.386626
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 137.680735 111.542175 46.466513 30.347286 114.422578 69.136824 942.059354 577.610749 0.071947 0.016925 0.035672
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 21.685608 23.301058 20.599958 18.435176 78.373891 37.468088 654.976896 337.701640 0.018755 0.016375 0.001869
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.648713 0.441068 2.395783 -0.241348 0.919760 -0.137802 2.236292 -0.005209 0.612865 0.616108 0.389028
121 N08 digital_ok 100.00% 3.60% 0.00% 0.00% 1.014515 1.744707 0.705431 4.652873 -0.320059 1.310047 2.448731 9.198403 0.555508 0.604257 0.393212
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.160491 2.289086 -0.193661 -0.533089 2.151220 -0.370901 -0.457808 -0.494858 0.638899 0.632663 0.396863
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.324057 1.324880 1.230525 0.086145 0.128345 -0.972394 -2.749959 -1.499965 0.607350 0.627195 0.394365
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 6.519776 -0.127836 8.364598 0.844796 1.011363 0.513668 0.469772 0.508744 0.040188 0.628819 0.457867
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.100241 -0.049848 2.049873 1.184344 0.472781 0.392075 0.223347 0.144348 0.617671 0.618789 0.400058
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.210580 0.149233 0.300012 1.157853 4.694466 0.109031 1.703583 0.401579 0.620029 0.619349 0.407225
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.392635 -0.946239 8.191006 -1.032105 1.113882 0.672607 0.234178 -0.440052 0.033639 0.620855 0.461057
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.153554 -0.621086 -0.289646 -0.939143 2.260804 -0.226478 1.511800 3.355005 0.613312 0.613783 0.412461
131 N11 not_connected 100.00% 0.00% 24.10% 0.00% -1.102665 8.060851 -0.955434 4.792733 -0.034052 0.538957 -0.999833 0.605104 0.608268 0.276470 0.463380
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.255332 -0.141707 -1.011394 -0.423318 0.232263 1.240252 -0.217625 0.012727 0.585720 0.575803 0.392918
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.164247 -1.086497 -0.452594 -1.066246 -0.475817 -0.861064 -0.121641 0.353474 0.576327 0.579826 0.391891
134 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.519578 1.239824 2.217562 0.824028 0.371081 -0.290785 5.676024 -2.029397 0.492845 0.552774 0.393484
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.734744 -0.943354 -0.235278 -0.611150 3.910557 -0.449972 0.261645 0.021766 0.558397 0.563346 0.393883
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 5.906368 0.302896 7.988912 0.096812 1.139005 2.365677 1.013926 0.502282 0.036700 0.560089 0.416980
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 17.331304 43.196097 17.440639 19.046477 39.206554 34.480406 437.885410 326.162053 0.018182 0.016356 0.001517
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.089566 -0.371124 -0.163634 -0.727669 -1.288290 -0.337035 -1.538868 0.758122 0.598822 0.590841 0.387967
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.962247 -1.230676 0.009477 -1.061861 8.705396 0.257831 28.849641 3.010964 0.601932 0.611061 0.378574
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.141743 -0.944508 0.319589 -0.590666 0.914197 -0.836378 0.005209 -1.078661 0.624285 0.613916 0.390738
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.316965 8.338722 -0.037879 8.701962 2.269536 0.660148 18.550102 1.656244 0.625654 0.041870 0.540683
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.801525 8.240389 8.077618 8.675605 0.737231 0.657478 0.281186 1.471097 0.027208 0.024040 0.002321
144 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 17.717002 22.804766 7.044940 6.738640 1.080875 3.064544 0.225405 0.976179 0.026211 0.026282 0.001120
145 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 17.178797 19.322960 7.226789 7.505553 1.503128 0.699388 0.088000 0.618737 0.026772 0.025647 0.001159
146 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 13.356405 16.037593 3.834542 4.095982 1.214011 0.894338 0.139062 0.294726 0.028985 0.028470 0.001017
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 120.978819 120.417587 inf inf 4003.734578 4007.813231 5019.987479 5025.761847 nan nan nan
149 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 127.537306 127.906787 inf inf 4758.536461 4730.600798 6533.947617 6472.615867 nan nan nan
150 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 9.874237 -0.425045 -0.653447 1.117145 -0.190567 0.131762 -0.808363 9.217164 0.486297 0.560528 0.331441
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.188092 -0.869082 8.098225 -0.209771 1.180296 2.671282 1.736513 0.602696 0.037893 0.568370 0.434478
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.511630 8.230507 5.939226 8.567574 -0.308452 0.731806 4.561661 1.873863 0.488924 0.037105 0.390610
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.569882 0.108675 0.674586 0.929501 0.694460 1.365604 -0.185720 0.222605 0.576177 0.583477 0.399904
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.155103 -0.592186 -0.652621 -0.684095 0.623433 0.098769 4.161071 14.423825 0.586943 0.594945 0.400643
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.195382 11.760264 0.034710 0.007246 -0.916545 1.153332 -0.270999 0.521411 0.569690 0.492367 0.371796
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 6.826442 -0.378798 8.175318 -0.012022 1.078168 -0.016669 0.482416 0.222164 0.044027 0.605634 0.498725
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.216479 17.747264 0.587545 0.500438 1.467780 0.408735 0.200415 0.971642 0.607943 0.498972 0.369697
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.771127 -0.936605 -0.837099 -0.815687 -0.391927 -0.412721 4.222549 -0.329999 0.624292 0.620260 0.395896
163 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 16.826580 17.791637 7.194374 7.589615 0.815602 1.429898 2.419539 2.893004 0.026509 0.025539 0.001145
164 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 16.639825 17.842967 7.259810 7.764790 1.110370 0.968828 0.292997 0.851209 0.026245 0.025392 0.001161
165 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 19.715123 20.426111 6.690241 7.065958 0.784116 0.612307 0.246174 0.447110 0.027036 0.026146 0.001084
166 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 14.337430 26.889578 7.594305 6.447529 1.107838 0.931870 0.284266 0.516792 0.025889 0.026607 0.001241
167 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
168 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
169 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
170 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.121901 -1.427201 0.982247 -0.671094 -0.527963 0.115741 -0.100864 0.657650 0.557961 0.573298 0.392244
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.755695 -0.000566 0.934124 -0.197739 -0.467212 -0.823169 -2.365378 -0.222109 0.575814 0.571594 0.400656
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.781628 2.278900 1.453879 1.372834 0.331935 0.124478 -2.970161 -2.099809 0.544866 0.531729 0.384460
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.266545 0.184222 0.211742 1.100160 1.726297 1.200529 0.541939 18.571718 0.590100 0.587784 0.398652
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.154645 8.711023 -0.426872 8.775822 0.087305 0.669858 14.627159 2.063693 0.609569 0.049528 0.522984
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.018185 0.448597 1.320672 1.084795 1.097134 0.833180 0.062108 4.859245 0.615918 0.611243 0.401910
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.704636 8.194973 -0.959128 8.518100 -0.618300 0.689032 1.613891 1.997934 0.613762 0.044744 0.492932
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.482947 0.224739 0.727345 0.962443 0.231624 0.478054 0.604464 0.463314 0.615589 0.609467 0.396450
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 7.516036 21.764674 7.987875 6.958980 1.518890 1.624942 1.420395 1.043203 0.025782 0.026335 0.001259
185 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 23.681143 21.770278 6.056857 6.780074 1.517239 1.330604 0.121213 0.423376 0.027266 0.026364 0.001032
186 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 28.581424 28.271419 5.415720 5.988353 3.162159 2.093624 1.101759 0.879424 0.027775 0.027017 0.001106
187 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 22.270517 29.507664 6.507882 5.839139 1.633185 2.992979 4.357157 2.433612 0.027013 0.026965 0.001139
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
190 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
191 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.437598 2.501946 1.319345 1.491753 -0.096601 0.249566 -2.790687 -2.823373 0.545656 0.529296 0.384080
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.096391 2.109621 1.612590 1.320328 0.500991 0.010701 -3.121525 -2.669646 0.536122 0.526462 0.383053
200 N18 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.442033 19.633428 4.484973 0.204981 1.203901 4.219885 1.551355 2.813580 0.039875 0.259343 0.176559
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.943847 1.704008 0.616568 1.157940 -0.716631 0.062346 -1.710968 -2.464209 0.592058 0.566304 0.400251
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% -0.199494 0.075993 -0.127310 -0.142394 -1.149863 2.059547 -1.544304 49.908767 0.598898 0.585181 0.392178
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.795598 6.770560 1.527339 -0.390417 1.571955 -0.062029 13.661413 1.248636 0.605233 0.608716 0.399415
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.752617 -0.755845 3.258894 -0.615802 -0.282408 1.501545 3.229340 3.600516 0.403763 0.595515 0.442739
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.499456 2.352336 1.084141 2.669903 -0.206926 -0.997904 -0.034161 0.688231 0.540706 0.502655 0.368917
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.561222 -0.845021 -0.760465 -0.844955 0.364702 -0.536173 7.336043 -0.580696 0.567772 0.584647 0.392543
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.008654 8.595387 -0.355848 4.902852 0.276977 0.644848 0.191987 1.230883 0.562877 0.037577 0.477273
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.027911 -0.877391 -0.724164 -1.025532 -1.135467 0.987476 0.639298 -0.736796 0.595358 0.577524 0.398639
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.618967 -0.676257 -0.674396 -0.876927 0.341499 -0.753279 2.968675 -0.511761 0.588843 0.588809 0.394143
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.496168 -0.875922 -1.009354 -0.840595 -0.288355 -0.759307 2.991356 -0.967138 0.587364 0.589969 0.389985
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.953692 0.184710 -0.181223 1.634320 -0.727424 0.074446 -0.033399 16.030705 0.588138 0.553196 0.395661
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.306611 2.258450 1.739259 1.416946 0.676660 0.162871 -3.240574 -2.564532 0.558291 0.561874 0.380302
225 N19 RF_ok 100.00% 0.00% 68.42% 0.00% -0.669674 8.170179 -0.492252 4.728325 -0.995311 0.526425 -1.257609 1.630369 0.595597 0.169191 0.491801
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.015890 9.112028 -0.939040 -0.646372 -0.543390 -0.186098 -0.752688 -0.618431 0.592354 0.511485 0.396446
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.387363 -0.551635 2.175956 -0.792853 0.045749 -0.025988 13.590016 1.565270 0.512086 0.576234 0.412602
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.452332 -0.238686 -0.469821 -0.410684 -0.139721 -0.123720 0.074134 0.726853 0.574740 0.571102 0.397083
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.266593 -0.284670 -0.502358 -0.167807 -0.378495 -0.929626 0.451689 -1.483698 0.565267 0.561810 0.398048
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.395556 -0.687321 0.675760 -0.512460 -0.006411 0.720178 0.468970 -0.315396 0.546553 0.569901 0.402472
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.631694 -0.757214 -0.406867 -0.572178 -1.139413 -0.651704 -1.318477 -1.208299 0.587203 0.576799 0.406618
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.027447 -0.862793 -0.884067 -0.680367 -1.195046 -0.742810 0.019741 1.749013 0.586875 0.579343 0.397743
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.889459 -0.356613 0.991131 -0.797850 -0.442430 -0.079220 2.441055 2.049314 0.550124 0.579343 0.398862
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.529893 -1.276389 -1.073357 -0.853063 -1.063640 -0.995078 0.141310 -0.991807 0.585031 0.583179 0.400576
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 9.567620 -0.515030 -0.680680 -0.294760 -0.441171 -1.220139 -0.961829 -0.965218 0.470528 0.584612 0.386412
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.856297 -0.780032 -0.402629 -0.464152 -0.077436 -0.644374 -0.976518 0.042886 0.492483 0.577249 0.386674
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.257800 -0.635746 0.202147 -0.234024 -0.414393 -0.286523 1.799415 3.765145 0.557806 0.575727 0.392311
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.881405 -0.285902 -0.598655 -0.622005 -1.234362 -0.972333 -1.415059 0.863102 0.577276 0.570537 0.400013
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.448846 8.937606 -0.814123 4.579664 1.530272 0.663903 -0.628804 0.489994 0.562082 0.037158 0.473074
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.863614 -0.888598 -0.764186 -1.076786 -0.706823 -0.710288 3.852801 -0.500774 0.560028 0.554885 0.393539
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.612960 7.573383 0.475283 0.570168 0.232854 0.268034 -0.128143 1.304100 0.575713 0.569346 0.409332
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.185534 -0.264742 0.442075 -0.230503 -0.135733 -0.067751 -1.920393 0.109791 0.461146 0.458969 0.372753
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.675687 0.647673 -0.298202 -0.147564 -0.377340 -0.197473 -1.454088 -1.458291 0.444641 0.444809 0.351019
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% -0.222192 -0.920353 -0.365876 -0.395192 -1.104666 -0.616716 -1.483275 0.107484 0.487439 0.483772 0.386916
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.624829 -0.368287 -0.796402 -0.620217 -0.091465 0.062649 -0.126354 -0.366194 0.442701 0.448663 0.348717
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.365204 0.385756 0.158691 -0.279996 -0.265741 -0.116647 1.978673 -0.005999 0.441445 0.456259 0.350079
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [4, 7, 15, 17, 18, 19, 27, 28, 30, 31, 32, 34, 37, 38, 40, 42, 47, 49, 51, 53, 54, 55, 56, 58, 59, 60, 61, 63, 65, 66, 67, 68, 70, 72, 73, 74, 77, 78, 79, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 102, 103, 104, 108, 109, 110, 111, 112, 114, 117, 118, 121, 124, 126, 127, 131, 134, 136, 137, 140, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 179, 180, 181, 182, 184, 185, 186, 187, 189, 190, 191, 200, 202, 204, 205, 207, 208, 209, 210, 211, 223, 225, 226, 227, 242, 243, 246, 262]

unflagged_ants: [5, 8, 9, 10, 16, 20, 21, 22, 29, 35, 36, 41, 43, 44, 45, 46, 48, 50, 52, 57, 62, 64, 69, 71, 80, 85, 88, 89, 90, 91, 95, 101, 105, 106, 107, 113, 115, 120, 122, 123, 125, 128, 132, 133, 135, 139, 141, 157, 171, 172, 173, 183, 192, 193, 201, 206, 220, 221, 222, 224, 228, 229, 237, 238, 239, 240, 241, 244, 245, 261, 320, 324, 325, 329, 333]

golden_ants: [5, 9, 10, 16, 20, 21, 29, 41, 44, 45, 69, 71, 85, 88, 91, 101, 105, 106, 107, 122, 123, 128, 141, 157, 171, 172, 173, 183, 192, 193]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2460052.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.1.1.dev3+gb291d34
3.2.3.dev158+gd5cadd5
In [ ]: