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 = "2460062"
data_path = "/mnt/sn1/2460062"
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-27-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/2460062/zen.2460062.42122.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/2460062/zen.2460062.?????.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/2460062/zen.2460062.?????.sum.known_good.omni.calfits. Skipping redcal chisq.

Figure out some general properties¶

In [9]:
# Parse some general array properties, taking into account the fact that we might be missing some of the metrics
ants = []
pols = []
antpol_pairs = []

if use_auto_metrics:
    ants = sorted(set(bl[0] for bl in auto_metrics['modzs']['r2_shape_modzs']))
    pols = sorted(set(bl[2] for bl in auto_metrics['modzs']['r2_shape_modzs']))
if use_ant_metrics:
    antpol_pairs = sorted(set([antpol for dms in ant_metrics_dead_metrics.values() for antpol in dms.keys()]))
    antpols = sorted(set(antpol[1] for antpol in antpol_pairs))
    ants = sorted(set(antpol[0] for antpol in antpol_pairs) | set(ants))
    pols = sorted(set(utils.join_pol(ap, ap) for ap in antpols) | set(pols))
if use_redcal:
    antpol_pairs = sorted(set([ant for cspa in cspa_med_dict.values() for ant in cspa.keys()]) | set(antpol_pairs))
    antpols = sorted(set(antpol[1] for antpol in antpol_pairs))
    ants = sorted(set(antpol[0] for antpol in antpol_pairs) | set(ants))
    pols = sorted(set(utils.join_pol(ap, ap) for ap in antpols) | set(pols))

# Figure out remaining antennas not in data and also LST range
data_files = sorted(glob.glob(os.path.join(data_path, 'zen.*.sum.uvh5')))
hd = io.HERAData(data_files[0])
unused_ants = [ant for ant in hd.antpos if ant not in ants]    
hd_last = io.HERAData(data_files[-1])

Load a priori antenna statuses and node numbers¶

In [10]:
# try to load a priori antenna statusesm but fail gracefully if this doesn't work.
a_priori_statuses = {ant: 'Not Found' for ant in ants}
nodes = {ant: np.nan for ant in ants + unused_ants}
try:
    from hera_mc import cm_hookup

    # get node numbers
    hookup = cm_hookup.get_hookup('default')
    for ant_name in hookup:
        ant = int("".join(filter(str.isdigit, ant_name)))
        if ant in nodes:
            if hookup[ant_name].get_part_from_type('node')['E<ground'] is not None:
                nodes[ant] = int(hookup[ant_name].get_part_from_type('node')['E<ground'][1:])
    
    # get apriori antenna status
    for ant_name, data in hookup.items():
        ant = int("".join(filter(str.isdigit, ant_name)))
        if ant in a_priori_statuses:
            a_priori_statuses[ant] = data.apriori

except Exception as err:
    print(f'Could not load node numbers and a priori antenna statuses.\nEncountered {type(err)} with message: {err}')

Summarize auto metrics¶

In [11]:
if use_auto_metrics:
    # Parse modzs
    modzs_to_check = {'Shape': 'r2_shape_modzs', 'Power': 'r2_power_modzs', 
                      'Temporal Variability': 'r2_temp_var_modzs', 'Temporal Discontinuties': 'r2_temp_diff_modzs'}
    worst_metrics = []
    worst_zs = []
    all_modzs = {}
    binary_flags = {rationale: [] for rationale in modzs_to_check}

    for ant in ants:
        # parse modzs and figure out flag counts
        modzs = {f'{pol} {rationale}': auto_metrics['modzs'][dict_name][(ant, ant, pol)] 
                 for rationale, dict_name in modzs_to_check.items() for pol in pols}
        for pol in pols:
            for rationale, dict_name in modzs_to_check.items():
                binary_flags[rationale].append(auto_metrics['modzs'][dict_name][(ant, ant, pol)] > mean_round_modz_cut)

        # parse out all metrics for dataframe
        for k in modzs:
            col_label = k + ' Modified Z-Score'
            if col_label in all_modzs:
                all_modzs[col_label].append(modzs[k])
            else:
                all_modzs[col_label] = [modzs[k]]
                
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
else:
    mean_round_modz_cut = 0

Summarize ant metrics¶

In [12]:
if use_ant_metrics:
    a_priori_flag_frac = {ant: np.mean([ant in apxa for apxa in ant_metrics_apriori_exants.values()]) for ant in ants}
    dead_ant_frac = {ap: {ant: np.mean([(ant, ap) in das for das in ant_metrics_dead_ants_dict.values()])
                                 for ant in ants} for ap in antpols}
    crossed_ant_frac = {ant: np.mean([np.any([(ant, ap) in cas for ap in antpols])
                                      for cas in ant_metrics_crossed_ants_dict.values()]) for ant in ants}
    ant_metrics_xants_frac_by_antpol = {antpol: np.mean([antpol in amx for amx in ant_metrics_xants_dict.values()]) for antpol in antpol_pairs}
    ant_metrics_xants_frac_by_ant = {ant: np.mean([np.any([(ant, ap) in amx for ap in antpols])
                                     for amx in ant_metrics_xants_dict.values()]) for ant in ants}
    average_dead_metrics = {ap: {ant: np.nanmean([dm.get((ant, ap), np.nan) for dm in ant_metrics_dead_metrics.values()]) 
                                 for ant in ants} for ap in antpols}
    average_crossed_metrics = {ant: np.nanmean([cm.get((ant, ap), np.nan) for ap in antpols 
                                                for cm in ant_metrics_crossed_metrics.values()]) for ant in ants}
else:
    dead_cut = 0.4
    crossed_cut = 0.0

Summarize redcal chi^2 metrics¶

In [13]:
if use_redcal:
    cspa = {ant: np.nanmedian(np.hstack([cspa_med_dict[cal][ant] for cal in redcal_files])) for ant in antpol_pairs}
    redcal_prior_flag_frac = {ant: np.mean([np.any([afd[ant, ap] and not ant in flagged_by_redcal_dict[cal] for ap in antpols])
                                            for cal, afd in post_redcal_ant_flags_dict.items()]) for ant in ants}
    redcal_flagged_frac = {ant: np.mean([ant in fbr for fbr in flagged_by_redcal_dict.values()]) for ant in ants}

Get FEM switch states¶

In [14]:
HHautos = sorted(glob.glob(f"{data_path}/zen.{JD}.*.sum.autos.uvh5"))
diffautos = sorted(glob.glob(f"{data_path}/zen.{JD}.*.diff.autos.uvh5"))

try:
    db = mc.connect_to_mc_db(None)
    session = db.sessionmaker()
    startJD = float(HHautos[0].split('zen.')[1].split('.sum')[0])
    stopJD = float(HHautos[-1].split('zen.')[1].split('.sum')[0])
    start_time = Time(startJD,format='jd')
    stop_time = Time(stopJD,format='jd')

    # get initial state by looking for commands up to 3 hours before the starttime
    # this logic can be improved after an upcoming hera_mc PR
    # which will return the most recent command before a particular time.
    search_start_time = start_time - TimeDelta(3*3600, format="sec")
    initial_command_res = session.get_array_signal_source(starttime=search_start_time, stoptime=start_time)
    if len(initial_command_res) == 0:
        initial_source = "Unknown"
    elif len(command_res) == 1:
        initial_source = initial_command_res[0].source
    else:
        # multiple commands
        times = []
        sources = []
        for obj in command_res:
            times.append(obj.time)
            sources.append(obj.source)
        initial_source = sources[np.argmax(times)]
    
    # check for any changes during observing
    command_res = session.get_array_signal_source(starttime=start_time, stoptime=stop_time)
    if len(command_res) == 0:
        # still nothing, set it to None
        obs_source = None
    else:
        obs_source_times = []
        obs_source = []
        for obj in command_res:
            obs_source_times.append(obj.time)
            obs_source.append(obj.source)

    if obs_source is not None:
        command_source = [initial_source] + obs_source
    else:
        command_source = initial_source
    
    res = session.get_antenna_status(starttime=startTime, stoptime=stopTime)
    fem_switches = {}
    right_rep_ant = []
    if len(res) > 0:
        for obj in res:
            if obj.antenna_number not in fem_switches.keys():
                fem_switches[obj.antenna_number] = {}
            fem_switches[obj.antenna_number][obj.antenna_feed_pol] = obj.fem_switch
        for ant, pol_dict in fem_switches.items():
            if pol_dict['e'] == initial_source and pol_dict['n'] == initial_source:
                right_rep_ant.append(ant)
except Exception as e:
    print(e)
    initial_source = None
    command_source = None
    right_rep_ant = []
name 'startTime' is not defined

Find X-engine Failures¶

In [15]:
read_inds = [1, len(HHautos)//2, -2]
x_status = [1,1,1,1,1,1,1,1]
s = UVData()
s.read(HHautos[1])

nants = len(s.get_ants())
freqs = s.freq_array[0]*1e-6
nfreqs = len(freqs)

antCon = {a: None for a in ants}
rightAnts = []
for i in read_inds:
    s = UVData()
    d = UVData()
    s.read(HHautos[i])
    d.read(diffautos[i])
    for pol in [0,1]:
        sm = np.abs(s.data_array[:,0,:,pol])
        df = np.abs(d.data_array[:,0,:,pol])
        sm = np.r_[sm, np.nan + np.zeros((-len(sm) % nants,len(freqs)))]
        sm = np.nanmean(sm.reshape(-1,nants,nfreqs),axis=1)
        df = np.r_[df, np.nan + np.zeros((-len(df) % nants,len(freqs)))]
        df = np.nanmean(df.reshape(-1,nants,nfreqs),axis=1)

        evens = (sm + df)/2
        odds = (sm - df)/2
        rat = np.divide(evens,odds)
        rat = np.nan_to_num(rat)
        for xbox in range(0,8):
            xavg = np.nanmean(rat[:,xbox*192:(xbox+1)*192],axis=1)
            if np.nanmax(xavg)>1.5 or np.nanmin(xavg)<0.5:
                x_status[xbox] = 0
    for ant in ants:
        for pol in ["xx", "yy"]:
            if antCon[ant] is False:
                continue
            spectrum = s.get_data(ant, ant, pol)
            stdev = np.std(spectrum)
            med = np.median(np.abs(spectrum))
            if (initial_source == 'digital_noise_same' or initial_source == 'digital_noise_different') and med < 10:
                antCon[ant] = True
            elif (initial_source == "load" or initial_source == 'noise') and 80000 < stdev <= 4000000 and antCon[ant] is not False:
                antCon[ant] = True
            elif initial_source == "antenna" and stdev > 500000 and med > 950000 and antCon[ant] is not False:
                antCon[ant] = True
            else:
                antCon[ant] = False
            if np.min(np.abs(spectrum)) < 100000:
                antCon[ant] = False
for ant in ants:
    if antCon[ant] is True:
        rightAnts.append(ant)
            
x_status_str = ''
for i,x in enumerate(x_status):
    if x==0:
        x_status_str += '\u274C '
    else:
        x_status_str += '\u2705 '

Build Overall Health DataFrame¶

In [16]:
def comma_sep_paragraph(vals, chars_per_line=40):
    outstrs = []
    for val in vals:
        if (len(outstrs) == 0) or (len(outstrs[-1]) > chars_per_line):
            outstrs.append(str(val))
        else:
            outstrs[-1] += ', ' + str(val)
    return ',<br>'.join(outstrs)
In [17]:
# Time data
to_show = {'JD': [JD]}
to_show['Date'] = f'{utc.month}-{utc.day}-{utc.year}'
to_show['LST Range'] = f'{hd.lsts[0] * 12 / np.pi:.3f} -- {hd_last.lsts[-1] * 12 / np.pi:.3f} hours'

# X-engine status
to_show['X-Engine Status'] = x_status_str

# Files
to_show['Number of Files'] = len(data_files)

# Antenna Calculations
to_show['Total Number of Antennas'] = len(ants)

to_show[' '] = ''
to_show['OPERATIONAL STATUS SUMMARY'] = ''

status_count = {status: 0 for status in status_colors}
for ant, status in a_priori_statuses.items():
    if status in status_count:
        status_count[status] = status_count[status] + 1
    else:
        status_count[status] = 1
to_show['Antenna A Priori Status Count'] = '<br>'.join([f'{status}: {status_count[status]}' for status in status_colors if status in status_count and status_count[status] > 0])

to_show['Commanded Signal Source'] = ', '.join(command_source if hasattr(command_source, '__iter__') else [str(command_source)])
to_show['Antennas in Commanded State (reported)'] = f'{len(right_rep_ant)} / {len(ants)} ({len(right_rep_ant) / len(ants):.1%})'
to_show['Antennas in Commanded State (observed)'] = f'{len(rightAnts)} / {len(ants)} ({len(rightAnts) / len(ants):.1%})'

if use_ant_metrics:
    to_show['Cross-Polarized Antennas'] = ', '.join([str(ant) for ant in ants if (np.max([dead_ant_frac[ap][ant] for ap in antpols]) + crossed_ant_frac[ant] == 1) 
                                                                                 and (crossed_ant_frac[ant] > .5)])

# Node calculations
nodes_used = set([nodes[ant] for ant in ants if np.isfinite(nodes[ant])])
to_show['Total Number of Nodes'] = len(nodes_used)
if use_ant_metrics:
    node_off = {node: True for node in nodes_used}
    not_correlating = {node: True for node in nodes_used}
    for ant in ants:
        for ap in antpols:
            if np.isfinite(nodes[ant]):
                if np.isfinite(average_dead_metrics[ap][ant]):
                    node_off[nodes[ant]] = False
                if dead_ant_frac[ap][ant] < 1:
                    not_correlating[nodes[ant]] = False
    to_show['Nodes Registering 0s'] = ', '.join([f'N{n:02}' for n in sorted([node for node in node_off if node_off[node]])])
    to_show['Nodes Not Correlating'] = ', '.join([f'N{n:02}' for n in sorted([node for node in not_correlating if not_correlating[node] and not node_off[node]])])

# Pipeline calculations    
to_show['  '] = ''
to_show['NIGHTLY ANALYSIS SUMMARY'] = ''
    
all_flagged_ants = []
if use_ant_metrics:
    to_show['Ant Metrics Done?'] = '\u2705'
    ant_metrics_flagged_ants = [ant for ant in ants if ant_metrics_xants_frac_by_ant[ant] > 0]
    all_flagged_ants.extend(ant_metrics_flagged_ants)
    to_show['Ant Metrics Flagged Antennas'] = f'{len(ant_metrics_flagged_ants)} / {len(ants)} ({len(ant_metrics_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Ant Metrics Done?'] = '\u274C'
if use_auto_metrics:
    to_show['Auto Metrics Done?'] = '\u2705'
    auto_metrics_flagged_ants = [ant for ant in ants if ant in auto_ex_ants]
    all_flagged_ants.extend(auto_metrics_flagged_ants)    
    to_show['Auto Metrics Flagged Antennas'] = f'{len(auto_metrics_flagged_ants)} / {len(ants)} ({len(auto_metrics_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Auto Metrics Done?'] = '\u274C'
if use_redcal:
    to_show['Redcal Done?'] = '\u2705'    
    redcal_flagged_ants = [ant for ant in ants if redcal_flagged_frac[ant] > 0]
    all_flagged_ants.extend(redcal_flagged_ants)    
    to_show['Redcal Flagged Antennas'] = f'{len(redcal_flagged_ants)} / {len(ants)} ({len(redcal_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Redcal Done?'] = '\u274C' 
to_show['Never Flagged Antennas'] = f'{len(ants) - len(set(all_flagged_ants))} / {len(ants)} ({(len(ants) - len(set(all_flagged_ants))) / len(ants):.1%})'

# Count bad antennas with good statuses and vice versa
n_apriori_good = len([ant for ant in ants if a_priori_statuses[ant] in good_statuses.split(',')])
apriori_good_flagged = []
aprior_bad_unflagged = []
for ant in ants:
    if ant in set(all_flagged_ants) and a_priori_statuses[ant] in good_statuses.split(','):
        apriori_good_flagged.append(ant)
    elif ant not in set(all_flagged_ants) and a_priori_statuses[ant] not in good_statuses.split(','):
        aprior_bad_unflagged.append(ant)
to_show['A Priori Good Antennas Flagged'] = f'{len(apriori_good_flagged)} / {n_apriori_good} total a priori good antennas:<br>' + \
                                            comma_sep_paragraph(apriori_good_flagged)
to_show['A Priori Bad Antennas Not Flagged'] = f'{len(aprior_bad_unflagged)} / {len(ants) - n_apriori_good} total a priori bad antennas:<br>' + \
                                            comma_sep_paragraph(aprior_bad_unflagged)

# Apply Styling
df = pd.DataFrame(to_show)
divider_cols = [df.columns.get_loc(col) for col in ['NIGHTLY ANALYSIS SUMMARY', 'OPERATIONAL STATUS SUMMARY']]
try:
    to_red_columns = [df.columns.get_loc(col) for col in ['Cross-Polarized Antennas', 'Nodes Registering 0s', 
                                                          'Nodes Not Correlating', 'A Priori Good Antennas Flagged']]
except:
    to_red_columns = []
def red_specific_cells(x):
    df1 = pd.DataFrame('', index=x.index, columns=x.columns)
    for col in to_red_columns:
        df1.iloc[col] = 'color: red'
    return df1

df = df.T
table = df.style.hide_columns().apply(red_specific_cells, axis=None)
for col in divider_cols:
    table = table.set_table_styles([{"selector":f"tr:nth-child({col+1})", "props": [("background-color", "black"), ("color", "white")]}], overwrite=False)

Table 1: Overall Array Health¶

In [18]:
HTML(table.render())
Out[18]:
JD 2460062
Date 4-27-2023
LST Range 13.912 -- 15.853 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 361
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas 40, 42, 70, 112
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 62 / 198 (31.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 102 / 198 (51.5%)
Redcal Done? ❌
Never Flagged Antennas 94 / 198 (47.5%)
A Priori Good Antennas Flagged 51 / 93 total a priori good antennas:
7, 15, 17, 19, 31, 37, 40, 42, 53, 54, 55,
56, 65, 66, 70, 72, 81, 83, 86, 93, 94, 101,
103, 109, 111, 112, 118, 121, 124, 127, 136,
140, 147, 148, 149, 150, 151, 158, 160, 161,
165, 167, 168, 169, 170, 182, 184, 189, 190,
191, 202
A Priori Bad Antennas Not Flagged 52 / 105 total a priori bad antennas:
8, 22, 35, 36, 43, 46, 48, 49, 50, 52, 62,
64, 74, 79, 80, 89, 90, 95, 113, 114, 115,
120, 125, 126, 132, 133, 134, 135, 139, 179,
185, 201, 206, 207, 220, 221, 222, 224, 228,
229, 237, 238, 239, 240, 241, 244, 245, 261,
320, 324, 325, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2460062.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.109076 9.645700 -1.016538 -0.658477 -0.357933 2.138436 -0.825291 9.039965 0.504179 0.402977 0.332346
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.116137 0.410901 0.279939 3.036150 0.394293 1.121992 -0.258722 0.405366 0.513049 0.491775 0.336133
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.738832 -0.115340 -0.497499 0.171462 -0.181135 -0.063096 4.061495 6.520958 0.521845 0.508816 0.330304
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.562473 1.515279 1.127727 1.018615 0.115774 0.061159 -1.540906 -1.785714 0.488773 0.480914 0.308985
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.551269 -0.385292 2.851320 -0.335468 0.764698 0.333424 1.304316 -0.368809 0.493412 0.504817 0.320311
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.772958 -0.682306 -0.479261 -0.450389 -1.351028 0.688814 -0.733366 0.214909 0.502450 0.491497 0.324411
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 9.746203 -0.321503 -0.645065 -0.480199 -0.319298 0.391947 -0.213431 0.832598 0.405321 0.510301 0.326616
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.029217 1.116915 0.300144 0.770606 -0.969925 -0.293339 -1.510049 -1.877666 0.513031 0.500198 0.330648
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.086730 2.366695 0.757618 7.539194 0.292507 -0.909515 0.003891 3.028382 0.519705 0.391840 0.361604
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.540951 5.880800 0.750910 1.273964 0.983119 1.041820 6.959091 11.663050 0.496563 0.323555 0.364181
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.205502 0.310500 -0.257789 2.992571 0.005456 1.756644 -0.379912 8.331040 0.530258 0.517131 0.330911
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 2.545726 -0.894836 1.560785 -0.349706 3.703156 0.361924 1.415081 0.249467 0.511438 0.523793 0.319547
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.155891 0.332555 -0.019070 0.325683 0.493765 -0.526081 -0.017119 0.148778 0.513125 0.510390 0.320532
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.098184 -0.959037 -1.014297 -1.082237 -0.340109 0.103242 1.255410 1.073815 0.487762 0.483869 0.315655
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.742729 18.067014 8.483845 5.451973 1.560860 2.744052 3.385593 56.495930 0.069031 0.071995 -0.029503
28 N01 RF_maintenance 100.00% 100.00% 22.71% 0.00% 6.379134 10.904000 8.650656 3.549393 1.765784 2.086420 1.284037 14.656666 0.032542 0.237899 0.179942
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.653770 -0.066436 -0.157753 0.073099 0.776913 0.137526 0.055133 1.864759 0.530405 0.534082 0.323560
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.017870 -0.666676 0.242192 -0.615517 1.562500 -0.376487 0.340016 -0.345898 0.540487 0.541482 0.327795
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.248826 -0.007160 0.984170 2.612816 0.271048 0.810898 0.008387 14.281542 0.545368 0.532076 0.331572
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.310925 12.734155 -0.067669 -0.003825 -0.757340 0.086734 0.837551 2.632398 0.433149 0.457696 0.175169
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.437229 -0.665287 4.905529 -0.761167 1.727526 -1.090730 0.953711 -0.280992 0.047635 0.502219 0.353932
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.524137 -0.659861 -0.252535 -0.387829 -1.418418 -0.273884 -1.046923 -0.084571 0.499134 0.489754 0.320532
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.200063 3.612060 0.965692 0.783282 1.809702 1.551366 0.791166 1.320335 0.503840 0.491728 0.329909
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.739228 13.823235 -0.718039 10.736249 -0.207678 1.568300 1.114609 4.307314 0.506721 0.036324 0.400603
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.140844 -0.193046 -0.185933 0.363185 0.742571 0.107898 1.672262 3.915988 0.511082 0.507796 0.324403
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.061299 0.733526 0.033617 -0.246004 0.070250 2.103173 18.244318 1.354982 0.203973 0.201553 -0.270981
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.459539 0.826066 1.162389 1.767996 1.231457 0.347736 0.909043 1.190303 0.535734 0.534499 0.332389
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.274732 1.390715 -0.341737 -0.529993 -0.187964 1.530511 0.837277 0.694412 0.224169 0.214285 -0.272577
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.985991 0.108365 -0.936325 0.767310 -0.756202 0.571255 -0.507609 0.917890 0.548733 0.547524 0.335095
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.745070 0.464156 -0.740798 0.473220 -0.452041 1.057043 -0.553375 0.011892 0.552095 0.554759 0.337632
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.474363 0.728697 0.703248 0.730373 0.568635 0.447309 0.026225 1.011556 0.541933 0.542628 0.330251
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.318801 -0.654486 0.018984 -0.957978 -0.009892 -0.257531 -0.111049 -0.448800 0.533541 0.542596 0.329449
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 6.913133 8.503262 4.834522 4.953490 1.848886 1.333037 2.576818 1.309282 0.031175 0.058364 0.018472
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.531556 -0.063938 -0.923177 0.000544 -1.188811 -0.773221 -0.621139 -1.059383 0.505500 0.506285 0.313333
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.371482 -0.745307 0.514937 -1.049912 0.402367 -0.461660 1.366408 2.127352 0.479080 0.492594 0.309867
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.174583 0.371747 0.394884 1.464417 1.107615 0.908989 0.138561 0.367125 0.494154 0.484901 0.323168
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.809361 0.486383 0.170822 -0.217498 2.124280 0.257670 71.523946 1.002487 0.504436 0.503394 0.322941
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.925304 2.294812 0.084828 -0.057634 0.771325 0.189594 0.079750 0.123569 0.526244 0.520046 0.329822
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.019828 0.081067 -0.037286 -0.901603 -0.072640 -0.100644 4.432416 2.826640 0.534762 0.529216 0.333553
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 3.953291 1.347726 0.723491 -0.602915 0.035374 1.630471 -0.933739 -0.612550 0.301759 0.356191 0.156081
55 N04 digital_ok 100.00% 46.26% 100.00% 0.00% 0.132223 29.440077 -0.052181 6.443096 -0.736009 1.110995 1.175519 0.408927 0.214773 0.044636 0.066134
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.446808 1.991859 -1.006531 1.661014 -0.518705 4.352736 0.797704 2.283252 0.546806 0.534730 0.325722
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.366339 7.080492 -1.040685 0.005074 -0.195668 1.505514 0.524438 2.138511 0.553409 0.535475 0.318263
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.147801 8.039618 8.674835 9.234639 1.894938 1.420385 2.218133 2.144461 0.040668 0.039981 0.002138
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.829533 0.733628 8.698523 1.080073 2.007905 1.782373 2.511758 6.327202 0.049559 0.548409 0.397461
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.038035 8.006845 0.147083 9.256869 0.315700 1.244224 -0.162599 2.271008 0.528063 0.073825 0.408158
61 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.308920 -0.722703 4.633162 -0.420369 2.034625 0.260417 1.812842 1.806290 0.037427 0.514880 0.354132
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.372661 -0.008797 0.358438 -0.118097 -0.084238 -0.747420 0.733710 -0.691186 0.489241 0.511077 0.309871
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.637267 8.316146 -1.061110 5.260918 -0.759066 1.321736 -0.155654 2.416470 0.510241 0.047581 0.380894
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.639011 -0.508608 -0.847784 0.016615 0.345147 0.117259 -0.360667 0.423887 0.498431 0.485839 0.315599
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 14.485358 13.755090 10.935435 11.055647 1.696988 1.302871 3.470873 4.787462 0.024092 0.035237 0.011228
66 N03 digital_ok 100.00% 68.14% 100.00% 0.00% 1.357591 14.183222 0.847807 11.178880 0.329878 1.245325 -1.832777 4.675791 0.185856 0.049808 0.081561
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.689710 0.071880 -0.254205 1.282587 -0.147642 1.400204 2.065510 1.864632 0.523729 0.517485 0.328177
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 15.390890 -0.103519 10.990221 -0.130342 1.654070 -1.158382 3.918020 -1.025797 0.037680 0.527013 0.413287
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.753690 3.208426 1.183498 -0.452975 1.262449 1.947716 2.307216 1.091916 0.545272 0.542634 0.325508
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.184812 1.605858 0.967252 2.440173 0.185095 1.467387 2.155763 0.668738 0.227586 0.212992 -0.267928
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.823495 -0.003469 -0.275200 0.384140 0.597985 0.750003 0.379448 1.346237 0.559643 0.558632 0.334660
72 N04 digital_ok 100.00% 12.47% 100.00% 0.00% 0.506217 8.051823 1.893889 9.332127 0.004855 0.977297 9.353974 1.924904 0.233097 0.088261 -0.007133
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.623159 1.069582 -0.592545 0.809778 0.031067 3.918037 -0.347117 4.331616 0.566158 0.562250 0.342060
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.772267 0.003469 -0.729351 -0.040873 -0.141097 1.162167 -0.093663 1.211899 0.557926 0.559916 0.338973
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 20.319251 6.552368 -0.149430 -0.785177 2.932481 -0.021452 2.545017 0.210010 0.350055 0.442388 0.227078
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 13.258572 -0.133116 -0.007171 0.002022 -0.351420 -0.944804 -0.284404 -0.922757 0.381377 0.517626 0.307270
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.091614 -0.723371 0.722813 -0.705876 -0.007828 -0.473604 0.759774 -0.374083 0.488890 0.504133 0.315026
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.726040 1.106127 -0.674483 0.815244 -1.318908 -0.022994 -1.054130 -1.766786 0.507464 0.489508 0.326986
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 102.885055 27.205905 32.746722 17.885739 101.508294 13.573026 974.249932 218.481397 0.017476 0.016674 0.001379
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 47.415678 56.121908 27.810458 29.184090 53.406339 52.689330 711.865847 737.104075 0.017068 0.016362 0.001069
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 15.211120 21.526464 16.746821 16.489713 15.918065 10.232827 270.537584 203.767605 0.016802 0.016770 0.000772
84 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 28.285328 14.568658 6.203969 11.278267 1.400317 1.196542 0.185555 3.717089 0.056829 0.050443 0.007793
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.649145 -0.068036 -0.846448 -0.265812 -1.127480 0.486073 -0.920853 -0.226540 0.543108 0.541451 0.326917
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.363797 0.482794 0.578568 0.232843 -0.036514 0.833629 -0.067058 10.306358 0.549296 0.546998 0.321182
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 18.851670 2.043613 2.829512 -0.832941 4.806018 -0.563325 17.685109 0.168489 0.451432 0.562972 0.316020
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.182622 1.046275 0.668583 1.200856 0.531071 0.260685 -0.096152 0.127113 0.560558 0.558286 0.323721
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.396823 0.319830 0.637512 1.081752 0.873746 0.473720 -0.006443 0.285289 0.559575 0.558450 0.329652
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.461547 -0.835750 -0.000544 -0.979210 -0.583149 -0.685441 -0.150458 0.178855 0.557156 0.561712 0.333082
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.100961 0.526762 0.763118 0.683146 0.425996 0.585278 0.326025 0.218683 0.544901 0.551409 0.332590
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.478835 0.144434 8.695216 0.460756 1.748342 0.917487 0.448614 0.677638 0.039216 0.547955 0.381215
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.708871 8.164941 8.756612 9.299887 1.739751 1.237807 1.979418 1.662542 0.033199 0.025645 0.003759
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 7.058434 1.151208 8.844348 6.523103 1.872102 0.217398 1.444564 1.454140 0.030734 0.452805 0.305090
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.309585 -0.663697 -0.102943 -0.534628 -0.387030 -1.149496 0.142094 -0.681325 0.495955 0.514886 0.319297
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.115234 10.603006 0.104087 -0.631357 -1.281246 -0.169602 -1.463561 0.003336 0.507551 0.421883 0.305722
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.977081 1.303075 -0.814110 0.552997 -0.405276 -0.184313 -0.402027 4.297543 0.499033 0.479208 0.317782
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.609495 3.852271 0.181504 1.021404 0.980172 1.176464 -0.217089 0.191386 0.527012 0.527163 0.328611
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.804893 0.427108 -0.840476 -0.177815 -0.004555 -0.050833 -0.066847 4.191865 0.544802 0.543295 0.324745
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.526802 2.077078 0.869672 -0.389790 1.874846 1.185137 2.790319 8.594845 0.544356 0.550299 0.319222
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.016824 31.026275 0.617700 5.560555 0.513975 1.041381 0.595076 0.817201 0.549051 0.539043 0.323934
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.082340 0.391770 0.460050 1.109087 1.005438 0.557705 0.168488 0.136188 0.563064 0.558911 0.328063
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.130712 0.620294 0.160429 0.287653 -0.125421 0.188127 0.147753 0.106925 0.559402 0.562555 0.325920
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.063560 1.122688 0.270806 -0.143417 0.351635 0.138100 0.708264 1.573965 0.556474 0.555739 0.320674
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.193126 1.565007 1.090045 2.114145 -0.065609 0.043233 5.579140 0.308121 0.549176 0.555260 0.330769
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.331990 8.079107 8.749780 9.090319 1.713038 1.265316 0.505830 1.506908 0.068008 0.039077 0.020123
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.302904 -0.222773 0.573282 -0.005769 0.094181 1.228332 1.292932 0.518618 0.437703 0.544615 0.317099
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 8.590759 7.987818 0.950347 9.153456 4.062787 1.245088 7.483693 1.939339 0.469404 0.064322 0.340643
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% 0.000197 3.257912 1.200001 7.867572 -0.015710 -0.741703 0.732471 0.650705 0.207262 0.145746 -0.224376
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.597844 2.234890 1.616816 1.467280 0.920887 0.684097 -2.495796 -2.332597 0.491930 0.480806 0.309501
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.040042 3.058900 1.325157 3.421375 0.469924 -0.635731 -2.231357 1.068482 0.484434 0.407097 0.312619
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.059044 -0.990094 -0.729948 -0.703033 -0.486941 -0.738494 0.038328 -0.445571 0.485247 0.485438 0.310015
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 21.778858 23.708340 19.698478 20.005568 18.347312 29.245585 286.239254 355.710732 0.017541 0.016341 0.001384
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 15.067100 35.122273 16.585214 26.166285 8.503739 50.409009 182.229260 767.515673 0.016953 0.016261 0.000843
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.461395 0.654859 2.351758 -0.409085 1.364806 0.321577 1.319113 -0.354373 0.528121 0.538907 0.324345
121 N08 digital_ok 100.00% 0.83% 0.00% 0.00% 1.206123 1.740673 0.936895 4.834127 -0.252229 0.804749 -0.145784 9.221322 0.523313 0.529403 0.315640
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.191863 2.356493 -0.325417 -0.691573 1.357440 -0.011149 -0.319530 -0.530248 0.557751 0.559327 0.327293
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.231568 1.235737 1.435371 0.232708 0.602836 -0.567009 -1.576637 -1.469149 0.528178 0.552847 0.325613
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 6.567233 0.387028 8.875319 0.777820 1.714860 0.641688 0.548017 0.659065 0.045018 0.568786 0.385346
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.256448 0.261171 2.401862 1.200593 1.679136 0.154798 0.649662 0.089889 0.551691 0.560682 0.331620
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.266595 0.625897 0.248870 0.999129 0.802747 1.048291 1.250648 0.336049 0.556156 0.557629 0.334658
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.268804 -1.003361 8.688811 -1.043502 1.745174 0.282505 0.348286 -0.091575 0.039825 0.551232 0.384435
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.014028 -0.783168 -0.456505 -0.754219 0.402313 -0.821409 0.058612 1.350180 0.537056 0.538819 0.337148
131 N11 not_connected 100.00% 0.00% 55.12% 0.00% -1.102719 7.737259 -0.779593 5.126618 -0.982870 0.818921 -0.964327 0.481815 0.523584 0.216899 0.374124
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.098944 -0.279985 -0.921392 -0.525031 -1.163459 -0.223943 -0.259795 -0.156979 0.509797 0.494765 0.319893
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.273160 -1.105027 -0.605100 -1.010706 -0.105645 -0.785557 -0.457972 -0.471940 0.496853 0.495221 0.317104
134 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.165669 1.439844 2.225505 0.975974 -0.657052 0.259454 2.354634 -1.934752 0.419501 0.463681 0.310003
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.685624 -0.893666 -0.453434 -0.803324 1.266631 0.420271 0.394000 0.139969 0.476009 0.477651 0.319558
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 5.939069 -0.197546 8.477165 -0.096873 1.746115 0.181297 1.127006 0.375633 0.043800 0.479530 0.342390
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 15.311516 30.470610 16.940289 19.504046 16.450325 20.679330 265.928212 309.857628 0.016802 0.016322 0.000798
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.247269 -0.316268 0.034678 -0.837959 -1.096392 -0.397459 -0.657734 1.155019 0.512633 0.513982 0.316383
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 3.510620 -0.865219 -0.334520 -0.947028 4.909862 -0.392142 40.338193 5.636460 0.506974 0.536123 0.314335
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.301510 -0.734469 0.073504 -0.464311 1.226871 -1.193892 -0.206679 -1.112133 0.548130 0.544885 0.320106
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.019057 8.094092 -0.251486 9.265484 0.680264 1.247929 17.175256 1.549705 0.557163 0.050453 0.447035
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.738753 7.848344 8.568897 9.243454 1.726170 1.391296 0.970466 1.991835 0.118638 0.035887 0.069956
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.073484 -0.713919 -0.342789 -0.203176 0.007828 -0.211140 -0.321307 -1.067355 0.562155 0.556182 0.331470
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.092709 0.124661 -0.101752 0.219626 0.319405 0.743418 -0.312580 0.679521 0.556760 0.553071 0.327232
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.553573 -0.986275 -0.775780 -1.081450 -1.259003 -1.006543 -0.567712 -0.658880 0.533741 0.541620 0.332064
147 N15 digital_ok 100.00% 99.72% 99.45% 0.00% 124.112432 124.053754 inf inf 2243.104932 2203.713283 4884.755666 4675.060933 0.218992 0.401061 0.449197
148 N15 digital_ok 100.00% 98.34% 98.61% 0.00% nan nan inf inf nan nan nan nan 0.389276 0.342981 0.240305
149 N15 digital_ok 100.00% 98.61% 99.17% 0.00% nan nan inf inf nan nan nan nan 0.189304 0.139171 0.116189
150 N15 digital_ok 100.00% 98.34% 98.89% 0.00% nan nan inf inf nan nan nan nan 0.412264 0.390217 0.369163
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 8.770042 -0.436999 -0.675179 1.047988 -0.439416 0.501304 -0.197787 5.116666 0.412064 0.481727 0.289256
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.281800 -0.849820 8.593510 -0.362534 1.751188 0.020943 1.606433 -0.028074 0.045011 0.478707 0.351506
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.400743 7.965249 6.155485 9.130466 -0.057871 1.451805 2.955765 2.379492 0.401671 0.042471 0.297700
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.356801 0.141210 0.466880 0.801489 0.359165 0.599501 -0.080516 0.077115 0.493920 0.498366 0.324359
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.326167 -0.662900 -0.904972 -0.868983 0.015203 0.044022 0.130330 6.108124 0.510761 0.514064 0.329172
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.069212 7.898961 -0.051183 -0.273130 -0.521231 -0.334787 -0.146724 -0.090052 0.490918 0.434974 0.303037
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 6.851545 -0.505865 8.673705 -0.216748 1.767651 0.631568 0.730406 0.015642 0.049274 0.535768 0.413768
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.287068 16.652400 0.390418 0.477296 0.755816 0.156692 0.946978 1.262329 0.539405 0.435710 0.303439
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.447426 -0.909591 -0.597602 -1.005003 -0.440065 0.081421 -0.018035 -0.325865 0.549904 0.553113 0.325135
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.131189 0.754757 0.311229 0.674499 0.813874 2.064782 0.149198 0.755908 0.557435 0.559187 0.333058
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.240534 0.813915 0.774266 1.084807 0.132559 0.537615 0.256459 0.735238 0.554548 0.553912 0.323813
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 11.435620 -0.221445 0.424853 -0.174305 -0.112443 0.132147 1.306248 -0.267015 0.454308 0.553125 0.315439
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.240283 -0.566268 0.918104 -0.355463 0.327509 -0.907617 0.488287 -0.842198 0.550152 0.544781 0.324609
167 N15 digital_ok 100.00% 98.89% 98.89% 0.00% nan nan inf inf nan nan nan nan 0.267535 0.256994 0.168558
168 N15 digital_ok 100.00% 99.17% 99.45% 0.00% nan nan inf inf nan nan nan nan 0.278253 0.158018 0.194653
169 N15 digital_ok 100.00% 99.17% 99.17% 0.00% 102.403861 102.354226 inf inf 2255.476470 2227.117042 4888.751867 4758.555209 0.288653 0.273845 0.208541
170 N15 digital_ok 100.00% 98.34% 99.17% 0.00% 103.098528 103.194844 inf inf 2599.270788 2615.500332 5999.863551 6019.196327 0.426454 0.236923 0.344927
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.338168 -1.266916 0.461739 -1.091790 -0.747283 -1.100825 -0.095351 -0.341374 0.481016 0.494511 0.319330
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.747652 0.208282 1.132843 -0.030955 0.109701 -0.775357 -2.056571 -0.896301 0.493953 0.487587 0.323208
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.645231 2.358582 1.654568 1.527794 1.049784 0.888589 -2.315740 -2.022685 0.461009 0.445145 0.306544
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.545551 -0.917075 -0.029705 -0.579654 -0.439377 -0.212820 -0.071283 -0.153676 0.510889 0.512573 0.330679
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.429743 8.458745 -0.651003 9.347388 0.224673 1.313277 4.052902 2.098106 0.526208 0.056633 0.422466
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.944450 0.499645 1.239371 1.001557 1.278278 0.641971 0.301843 3.594466 0.538273 0.536499 0.333239
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.633609 7.919348 -0.758941 9.077345 -0.542491 1.444260 0.089168 2.705504 0.547530 0.052324 0.406459
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.468908 0.723029 0.524518 0.929233 0.924921 0.690432 0.337411 0.538346 0.546430 0.544988 0.321755
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 8.649152 -0.207744 7.311478 -0.077257 1.445865 0.056092 0.602993 -0.169904 0.309690 0.552366 0.359992
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.216053 -0.105526 -0.608587 0.060348 0.121557 -0.157061 1.440927 0.127768 0.556828 0.550325 0.330299
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.965435 -1.123855 -0.440736 -1.000164 -1.382783 -0.919995 -1.145893 -0.751235 0.550336 0.547668 0.327227
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.154067 -0.887258 0.066171 -0.669801 -0.664884 -0.886046 1.696979 -0.359930 0.539045 0.532935 0.325925
189 N15 digital_ok 100.00% 99.45% 99.17% 0.00% nan nan inf inf nan nan nan nan 0.209415 0.264304 0.145879
190 N15 digital_ok 100.00% 99.17% 99.17% 0.00% nan nan inf inf nan nan nan nan 0.369129 0.339066 0.292910
191 N15 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.538895 0.590414 0.475465
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.105063 2.513056 1.373382 1.615028 0.594001 0.855515 -2.250188 -2.483147 0.473188 0.449039 0.310712
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.853302 2.102177 1.772521 1.408123 1.185198 0.653047 -2.575851 -2.312036 0.454588 0.444910 0.303474
200 N18 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.442627 18.621772 4.776903 0.216588 1.742610 0.667665 1.290851 1.682480 0.043752 0.245276 0.160109
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.222937 1.820297 0.876686 1.305583 -0.740423 0.483797 -1.793721 -2.254368 0.511000 0.490393 0.323083
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.020752 -0.153511 0.059921 -0.298209 -0.897859 0.794130 -0.659802 32.398571 0.525868 0.515792 0.317915
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.024944 6.374664 1.435232 -0.532304 0.871024 0.096191 9.240482 0.382313 0.541806 0.538785 0.324174
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.745346 -0.568790 3.922075 -0.489548 -0.029451 0.284805 1.263754 1.650607 0.340366 0.528102 0.369312
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.507726 2.133932 1.083089 2.788362 -0.297816 -0.984071 -0.062238 0.340699 0.484194 0.438602 0.300408
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.101631 -0.881124 -0.964470 -0.858507 -1.322303 -0.142700 2.520720 -0.596823 0.502229 0.513789 0.315261
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.107719 0.189277 0.045601
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.116241 0.061511 0.049529
210 N20 dish_maintenance 100.00% 99.72% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.203937 0.109222 0.151454
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.173972 8.274334 -0.624980 5.256003 -0.399878 1.230783 -0.425155 1.031026 0.486177 0.042008 0.392656
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.824525 -1.119246 -0.529895 -1.067514 -1.368258 -0.764326 0.282305 -0.669461 0.512305 0.501080 0.321092
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.891524 -0.776282 -0.946423 -1.001835 -0.218165 -0.466209 0.526614 -0.635202 0.512998 0.514192 0.320251
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.597631 -0.736410 -0.814982 -0.721673 -1.280976 -1.217697 0.693181 -0.913457 0.519195 0.517650 0.319632
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.870509 -0.078846 -0.352143 1.642758 -0.546737 -0.077716 -0.382159 7.158334 0.513478 0.478916 0.318247
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.112561 2.360793 1.948533 1.576914 1.383804 0.782148 -2.586287 -2.386501 0.480127 0.477524 0.299289
225 N19 RF_ok 100.00% 0.00% 98.89% 0.00% -0.348220 7.906113 -0.254757 5.061994 -1.461862 1.127732 -1.127130 1.477485 0.517292 0.141491 0.407826
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.844143 7.871654 -1.073011 -0.590657 -0.829450 -0.260723 -0.432245 -0.129686 0.511893 0.430563 0.313255
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.247867 -0.694340 2.145184 -0.746481 -0.287918 -0.346899 9.966926 0.284415 0.439007 0.489995 0.325130
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.132899 -0.481985 -0.255637 -0.528091 -1.185211 -0.106265 -0.769132 0.006443 0.495312 0.481801 0.310464
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.076762 -0.092739 -0.316435 -0.035960 -0.925153 -0.758713 -1.101743 -1.397412 0.490073 0.478387 0.318084
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.933716 -0.804237 0.527698 -0.634640 -0.646025 -0.422694 0.301640 -0.495440 0.464946 0.485132 0.321178
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.015280 -0.466940 0.033340 -0.172219 -1.265409 -1.129319 -1.447597 -1.314823 0.503451 0.491901 0.328946
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.804346 -0.590811 -0.629722 -0.520802 -1.505000 -0.892445 -0.901117 1.273240 0.505882 0.498720 0.323865
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.799105 -0.397871 1.017349 -0.887122 -1.098817 -0.809142 1.065612 0.156034 0.475146 0.502311 0.327053
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.270189 -1.122175 -0.938780 -0.731745 -1.082587 -1.004387 0.027197 -0.710369 0.507319 0.499547 0.324126
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.347316 -0.288865 -0.689563 -0.174146 -0.620562 -0.973066 0.236149 -1.163262 0.395879 0.496781 0.312424
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.313746 -0.941496 -0.205966 -0.598358 -0.178300 -0.744871 0.234507 -0.208002 0.426115 0.489654 0.311530
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.244096 -0.719724 0.029450 -0.321609 -0.940762 -0.741510 0.480297 2.381848 0.485026 0.486726 0.306588
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.266116 -0.495890 -0.127995 -1.071309 -1.340837 -1.089553 -1.408376 -0.027681 0.493847 0.480495 0.314099
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.710800 8.596910 -1.043518 4.918188 -0.129316 1.239154 -0.685619 0.471702 0.485751 0.041561 0.388690
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.594544 -0.653302 -0.562036 -0.970066 -1.416222 -0.948199 0.902707 -0.705190 0.486070 0.471411 0.315113
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.591484 7.238610 0.279587 0.439985 0.327744 0.843483 -0.151111 0.530580 0.493522 0.478755 0.324714
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.398484 0.093438 0.722368 -0.013771 -0.186591 -0.481832 -0.978830 -0.019096 0.389473 0.370372 0.284698
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.909234 0.839358 0.004268 0.054762 -1.038590 -0.605027 -0.879384 -0.968400 0.380538 0.363805 0.272328
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.202226 -1.004060 -0.129364 -0.545503 -1.456320 -0.520320 -1.311702 -0.294669 0.406311 0.385482 0.293187
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 7.260777 8.258128 4.712926 5.369315 1.707699 1.210516 0.564306 0.473030 0.044189 0.042274 0.002412
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.894867 0.013842 -0.166299 -0.510819 0.319452 0.401107 1.347179 0.572986 0.380809 0.377984 0.270928
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, 31, 32, 34, 37, 40, 42, 47, 51, 53, 54, 55, 56, 57, 58, 59, 60, 61, 63, 65, 66, 68, 70, 72, 73, 77, 78, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 101, 102, 103, 104, 108, 109, 110, 111, 112, 117, 118, 121, 124, 127, 131, 136, 137, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 165, 167, 168, 169, 170, 180, 182, 184, 189, 190, 191, 200, 202, 204, 205, 208, 209, 210, 211, 223, 225, 226, 227, 242, 243, 246, 262, 329]

unflagged_ants: [5, 8, 9, 10, 16, 20, 21, 22, 29, 30, 35, 36, 38, 41, 43, 44, 45, 46, 48, 49, 50, 52, 62, 64, 67, 69, 71, 74, 79, 80, 85, 88, 89, 90, 91, 95, 105, 106, 107, 113, 114, 115, 120, 122, 123, 125, 126, 128, 132, 133, 134, 135, 139, 141, 144, 145, 146, 157, 162, 163, 164, 166, 171, 172, 173, 179, 181, 183, 185, 186, 187, 192, 193, 201, 206, 207, 220, 221, 222, 224, 228, 229, 237, 238, 239, 240, 241, 244, 245, 261, 320, 324, 325, 333]

golden_ants: [5, 9, 10, 16, 20, 21, 29, 30, 38, 41, 44, 45, 67, 69, 71, 85, 88, 91, 105, 106, 107, 122, 123, 128, 141, 144, 145, 146, 157, 162, 163, 164, 166, 171, 172, 173, 181, 183, 186, 187, 192, 193]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2460062.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 [ ]: