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 = "2459893"
data_path = "/mnt/sn1/2459893"
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: 11-9-2022
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/2459893/zen.2459893.25258.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 1850 ant_metrics files matching glob /mnt/sn1/2459893/zen.2459893.?????.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/2459893/zen.2459893.?????.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 2459893
Date 11-9-2022
LST Range 22.749 -- 8.705 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 7
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 96
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 201 (0.0%)
Antennas in Commanded State (observed) 0 / 201 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 18
Nodes Registering 0s N20
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 86 / 201 (42.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 138 / 201 (68.7%)
Redcal Done? ❌
Never Flagged Antennas 55 / 201 (27.4%)
A Priori Good Antennas Flagged 67 / 96 total a priori good antennas:
3, 7, 16, 17, 19, 20, 29, 30, 31, 37, 38, 45,
51, 53, 54, 55, 56, 59, 68, 71, 81, 83, 84,
86, 88, 93, 94, 98, 99, 100, 101, 103, 107,
108, 109, 111, 116, 117, 118, 121, 122, 123,
124, 130, 136, 140, 142, 143, 144, 146, 158,
161, 162, 163, 164, 165, 170, 181, 183, 184,
185, 186, 187, 189, 190, 191, 202
A Priori Bad Antennas Not Flagged 26 / 105 total a priori bad antennas:
35, 43, 46, 48, 49, 61, 62, 64, 74, 79, 95,
115, 120, 125, 132, 139, 148, 149, 168, 207,
220, 221, 223, 238, 324, 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_2459893.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 11.422809 -0.680951 8.921137 0.293563 8.121843 0.956937 2.017952 2.324748 0.035069 0.674230 0.528752
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.155545 1.343233 0.727827 1.237885 10.643717 2.378264 9.725232 0.255836 0.687780 0.670820 0.395825
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.048468 0.009775 -0.510682 -0.417600 0.043244 1.160962 1.380166 0.582710 0.685275 0.678319 0.388284
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.933578 -0.860121 -0.127260 -0.054131 -0.188514 1.319661 16.837415 12.479838 0.678730 0.679028 0.385946
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.605250 -1.415339 -0.726738 -0.069518 -0.613080 0.726619 4.925247 1.290101 0.670325 0.673447 0.378712
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.009775 -0.144781 -0.063706 0.442376 0.179800 1.008384 -0.068966 1.423311 0.672189 0.672259 0.391624
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.036009 -0.873319 -1.338114 -1.130941 -0.749344 1.379585 0.322852 0.171370 0.666212 0.668849 0.395935
15 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.822871 -0.217388 0.054792 0.079680 -0.180101 0.746713 0.488140 1.393328 0.682457 0.683291 0.391032
16 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -1.023483 -1.006476 -0.729514 0.158873 0.023271 0.476130 3.440301 7.354391 0.686109 0.681381 0.384228
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.357131 0.667322 -0.326997 -0.074501 0.284304 0.828774 6.012684 3.559478 0.687989 0.687159 0.385982
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.192958 15.177505 -0.734425 0.136308 1.887660 3.217388 25.350113 32.365129 0.666367 0.467420 0.465277
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.133873 -1.583769 -0.866857 -1.595294 2.500139 12.558739 6.305687 8.613183 0.683118 0.695607 0.385467
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.364230 -0.897884 -0.590376 -0.981696 2.649608 -0.644439 4.580790 -0.921093 0.683661 0.695002 0.388562
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.338730 0.649986 -0.489210 0.152277 0.876723 0.298897 0.646964 0.699761 0.669556 0.669938 0.388516
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% 35.425158 10.647733 -0.580868 -1.042001 8.957876 3.607716 21.176553 12.827385 0.445749 0.606589 0.326568
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.355796 13.030773 8.953505 9.589987 8.182683 9.224261 4.522250 3.382243 0.033228 0.037745 0.004773
28 N01 RF_maintenance 100.00% 0.00% 82.86% 0.00% 14.430370 30.298280 0.909592 0.687218 5.244808 11.741410 7.027135 25.953489 0.374761 0.171156 0.261808
29 N01 digital_ok 100.00% 0.00% 100.00% 0.00% -1.226466 13.512446 -0.441112 9.217842 0.435299 9.205573 -0.196169 1.023963 0.693022 0.036482 0.559780
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.334953 -0.510498 -1.037275 0.241446 1.119117 0.448298 19.502365 0.701870 0.688928 0.693276 0.374107
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.068240 -0.924875 -0.519877 0.541208 1.115784 2.472541 4.007693 5.165785 0.700578 0.695178 0.381885
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.883962 26.765829 0.768621 -0.038750 13.929570 5.385716 19.981154 6.480794 0.596837 0.588770 0.243143
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 13.375115 1.229701 3.796355 -0.762284 8.136803 3.816350 2.029339 -1.189542 0.043517 0.663103 0.468349
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.017597 0.321994 0.481533 -1.352851 -0.632927 -1.654583 -0.825276 0.079151 0.651637 0.644678 0.390097
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.861910 8.609762 -0.256203 0.064419 0.797426 2.317124 2.703512 4.545368 0.669689 0.675132 0.393823
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.748182 0.383233 -1.244415 0.374810 0.221541 1.445788 -1.042877 13.047307 0.683887 0.688619 0.400509
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.219120 0.179227 -0.215478 0.321846 0.971074 2.356141 9.158002 2.858789 0.686188 0.693536 0.399090
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.141655 0.632768 -0.285717 0.236590 -0.538271 0.328764 -0.500294 -0.139327 0.686439 0.689380 0.383227
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.154374 -0.136868 -0.984247 -0.233621 0.383853 0.329640 0.142581 1.827002 0.694685 0.693511 0.375513
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.131887 1.063233 -0.348492 0.632392 0.666240 0.312149 -0.088023 -0.339384 0.702759 0.696417 0.384892
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.360139 0.354153 -0.149286 0.227973 -0.692190 0.183286 -1.945919 0.468472 0.706151 0.700554 0.380222
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.449905 0.082730 -0.772780 -0.416402 -0.827828 0.531298 -1.319214 -0.547388 0.703402 0.707267 0.381342
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -0.405479 0.589372 -0.193917 0.001173 -0.459574 -0.283178 0.052856 4.422099 0.691717 0.690883 0.377984
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.158088 1.629105 0.968259 1.499416 -0.111862 0.286240 0.110901 -2.876422 0.679048 0.702462 0.390502
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 12.488067 1.892356 3.624090 -1.586743 8.151015 -1.051139 2.332286 6.083598 0.038415 0.660144 0.455141
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.828072 1.297159 0.833569 0.938169 -0.519871 -0.372324 -2.104220 -2.813431 0.655958 0.674739 0.393618
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.102425 0.422555 -1.723548 0.396621 -1.244759 -1.577474 0.249776 -0.956171 0.625258 0.659181 0.389537
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.911881 28.018901 -0.240241 1.175626 1.517251 0.833418 4.028238 14.524661 0.662636 0.602074 0.365002
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 27.614316 1.059988 11.522655 -0.161396 8.171127 1.686980 14.428327 5.681514 0.042166 0.690673 0.519718
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.939728 7.352297 -0.695815 0.175337 0.814409 1.061543 0.982809 1.390117 0.687017 0.697569 0.387376
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.801458 2.915329 -0.566460 -0.235165 0.560186 0.823060 3.992830 8.306669 0.695928 0.702130 0.387761
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.481786 13.836151 8.958335 9.805899 8.163931 9.215139 3.911290 2.078938 0.045900 0.045275 0.001149
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.617291 14.632716 0.286717 9.724511 4.486826 9.212443 7.502130 5.431497 0.692780 0.035522 0.493837
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.422615 14.709434 -0.045215 9.901559 0.102023 9.227138 0.659766 2.451606 0.697556 0.038204 0.507255
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 32.379773 -0.216116 5.427849 0.856374 4.699859 0.915747 5.440609 3.104946 0.506976 0.704463 0.380653
58 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.531091 13.397401 -0.804545 9.685098 -0.434271 9.252520 2.368017 2.896593 0.699227 0.037106 0.471405
59 N05 digital_ok 100.00% 100.00% 64.43% 0.00% 11.985611 12.592241 8.383359 9.145455 8.119300 8.573232 1.313188 1.794795 0.046957 0.216714 0.137679
60 N05 RF_maintenance 100.00% 0.00% 97.19% 0.00% -1.115890 13.326304 -0.163894 9.723018 -1.757453 9.150141 -1.329929 4.794179 0.699190 0.084944 0.512667
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.611026 2.223843 -1.284847 0.003340 0.528937 -1.699768 -0.626821 3.842772 0.642327 0.644671 0.372741
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.662558 1.746888 0.093903 0.777558 -1.035015 -0.398482 -0.201199 -2.414457 0.659695 0.680644 0.382116
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.029998 13.703487 0.006719 4.370770 -1.104421 9.247636 -0.577108 4.853890 0.640232 0.045775 0.453921
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.814286 0.148725 -1.094326 0.000448 -1.322776 -1.942022 -0.326558 -1.777915 0.616718 0.647705 0.388631
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.687316 1.429458 0.055780 0.623634 0.813898 1.845794 -0.191108 0.686389 0.662078 0.683964 0.404317
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.395350 1.562465 1.523469 1.589491 1.765019 1.053325 -0.134240 2.552621 0.668950 0.686037 0.394589
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.155687 -0.702435 0.999037 0.905280 0.796428 1.161561 1.728195 2.605999 0.678745 0.693129 0.386521
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.095265 31.064492 0.085325 12.834095 0.294969 8.926708 -0.215230 14.763599 0.690230 0.032982 0.517427
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.065989 -0.521310 -0.046186 0.296606 -0.007198 1.261236 0.280194 1.314679 0.692002 0.704162 0.374979
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.513325 -0.596066 -0.835733 -0.408935 0.662453 0.087441 -0.364076 0.430019 0.700693 0.709058 0.372951
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 8.536768 -0.638596 0.116501 0.719697 0.519764 1.628992 0.105175 1.093656 0.710036 0.708600 0.371478
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.361961 -0.296495 0.212942 0.710641 -0.073022 0.494050 0.900934 0.625205 0.690958 0.699684 0.362676
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.232604 0.615075 -0.940889 2.169498 -0.289172 12.244410 -0.564572 0.133617 0.708579 0.697892 0.378565
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.122671 0.685670 0.013521 -1.023178 -1.156141 1.195957 -1.692480 1.925856 0.705431 0.704104 0.375585
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 25.123200 28.979280 0.210574 -0.826251 3.129967 3.465364 5.935256 2.157773 0.551333 0.508611 0.212106
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 35.424333 -0.810902 -0.401762 -0.456962 2.561886 -2.543665 0.568441 0.115559 0.480881 0.663716 0.365438
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.921710 -0.582381 -0.764507 -1.166526 -0.898220 -2.139604 -0.470300 -1.182336 0.642419 0.664137 0.386838
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 10.195741 15.121292 2.174605 4.252596 6.478583 9.212353 15.157740 2.116395 0.315452 0.039914 0.201779
81 N07 digital_ok 100.00% 38.49% 38.49% 0.00% -0.365802 -0.844229 -0.677680 3.348980 -1.029956 24.987078 -0.181733 1.295320 0.449589 0.458488 0.255220
82 N07 RF_maintenance 100.00% 38.49% 38.49% 0.00% 2.933682 -0.395879 -0.247252 4.470066 -0.458625 53.604521 -0.545635 7.360459 0.457613 0.437969 0.258992
83 N07 digital_ok 0.00% 38.49% 38.49% 0.00% -0.452652 -0.175941 -0.495200 -0.052692 -0.409009 -0.630406 -0.711750 0.304593 0.465426 0.476747 0.244119
84 N08 digital_ok 100.00% 24.38% 100.00% 0.00% 23.057425 27.394541 11.588558 12.424298 6.423609 8.898671 6.631707 7.767143 0.248433 0.037194 0.152748
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.490959 0.594735 -0.031015 0.898807 -0.166749 -0.489081 -0.264376 -0.338039 0.689777 0.696051 0.373356
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.377341 -0.194711 1.516120 1.161657 3.288703 -0.257523 -0.023858 26.303393 0.678630 0.695195 0.363072
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 18.679373 8.090895 0.934586 -0.263520 17.906331 0.982604 3.399946 1.550285 0.608561 0.714848 0.338218
88 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 1.069752 0.311591 -0.141318 0.601704 -1.181555 1.223554 5.764161 1.825970 0.692964 0.701762 0.358748
89 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% 275.086910 275.274371 inf inf 5120.385874 4969.135648 9284.473537 8275.210704 nan nan nan
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.122079 -0.394263 0.642813 0.779469 -1.711523 -0.625776 -0.059037 5.399242 0.688719 0.696007 0.369903
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.420654 -0.050180 -0.150391 0.013119 -1.110146 0.062510 0.004218 -0.258255 0.687194 0.703372 0.380448
92 N10 RF_maintenance 100.00% 0.00% 13.19% 0.00% 42.699556 51.792667 0.178103 0.763906 6.841969 8.688964 1.352871 15.383293 0.307295 0.256026 0.098812
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 2.036057 0.400376 1.658940 -0.045010 1.335035 0.111925 5.766156 -0.259221 0.676977 0.698605 0.387934
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 12.672776 -0.611028 9.074384 0.065494 8.115603 1.214457 1.970577 3.482358 0.033137 0.690984 0.432230
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.026259 -0.383761 -0.674021 0.574741 -0.717971 -1.205448 -0.000721 1.441657 0.648423 0.680256 0.394320
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.801532 14.667101 3.612315 4.409731 8.113070 9.241227 2.339425 1.324367 0.033441 0.037779 0.002544
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.971690 4.058777 0.293187 0.119781 -0.939373 -0.505608 -1.010248 14.644530 0.636262 0.614662 0.393915
98 N07 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
99 N07 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
100 N07 digital_ok 0.00% 38.49% 38.49% 0.00% -1.257942 -0.885194 -1.010875 0.072940 0.306523 -0.403865 0.230611 0.321928 0.456938 0.468129 0.244583
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.574700 7.560706 -0.883309 0.615879 -0.080476 0.558053 -0.351885 -0.300400 0.687758 0.692721 0.378285
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.031315 0.486349 -1.247299 2.439878 -0.411803 0.138857 -0.895236 9.352437 0.696319 0.689614 0.371290
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.880884 5.424682 3.204776 0.491517 5.453404 10.464147 8.049597 17.838087 0.676177 0.702386 0.367800
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.380481 67.775500 5.914034 6.521017 0.649931 3.802627 0.207952 2.058908 0.644238 0.679676 0.368854
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.092615 -0.195322 -0.449417 0.552873 0.190341 -0.054401 -0.066181 -0.341408 0.697670 0.702302 0.363160
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.219166 0.387240 0.548052 0.778916 0.668574 0.689239 0.578096 0.065984 0.680990 0.697627 0.364513
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 1.889346 0.625227 -1.423243 -0.801332 0.498812 -0.197953 4.764048 7.643133 0.692590 0.703577 0.371979
108 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 11.612393 3.782187 8.891762 -0.523907 8.146798 0.449553 3.558155 1.088303 0.041833 0.706468 0.464508
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -1.424003 13.469478 0.137770 9.483052 -0.339359 9.195802 1.824869 3.294588 0.690905 0.036756 0.455362
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.097771 29.297877 -0.369928 12.559856 9.680352 8.908222 10.400159 7.139073 0.683804 0.032639 0.437773
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.105467 13.370390 0.080170 9.580772 0.009253 9.202201 1.217731 4.161164 0.683282 0.037018 0.445418
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.538456 1.537099 -0.357442 -0.323335 1.119099 0.601223 0.916190 -0.029931 0.670945 0.682772 0.391017
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.711649 14.682926 3.413784 4.313796 8.111307 9.237827 2.860695 1.469324 0.035658 0.030742 0.003020
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 6.661636 0.670483 0.924067 -0.560412 5.622475 -1.864864 2.338826 -0.537330 0.535155 0.654682 0.418787
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.653681 1.014870 2.195776 1.353791 1.774782 0.077577 -3.445830 -1.668179 0.629827 0.654038 0.408852
116 N07 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 12.568436 15.175688 8.981089 10.028374 8.131195 9.261049 2.813580 6.222883 0.027559 0.029140 0.001424
118 N07 digital_ok 0.00% 38.49% 38.49% 0.00% -0.447121 0.795006 -0.506280 0.401529 0.729115 1.368777 2.260462 2.825392 0.454867 0.465563 0.246821
119 N07 RF_maintenance 100.00% 38.49% 38.49% 0.00% 0.907190 1.809092 -1.685754 2.133783 -0.679337 6.156696 1.101046 4.640316 0.467007 0.463450 0.243191
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.065234 2.533503 2.000958 1.746045 0.563870 1.031269 1.242367 -3.444403 0.672401 0.694742 0.364298
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.831926 5.334039 -0.742375 0.674530 3.116418 0.934589 24.930406 23.965670 0.695718 0.703594 0.370546
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.699717 7.877968 -0.918777 0.338013 3.585674 0.657543 -0.444081 -0.492737 0.706727 0.709258 0.372191
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.937406 9.430849 -0.016499 0.675521 0.320653 0.342277 -0.468838 0.384052 0.704604 0.708081 0.370696
124 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 276.734246 276.844563 inf inf 7011.732003 7012.157340 15464.143697 15472.063478 nan nan nan
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.546589 -0.161007 -0.824020 0.555022 0.426103 1.197526 -0.662592 -0.327516 0.696492 0.699874 0.376403
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.817593 2.524297 -0.996766 0.815712 3.600947 -0.489948 6.011925 0.155021 0.692173 0.692604 0.379724
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.127944 -0.165163 -0.389821 -0.000448 1.421842 0.130049 0.832724 3.864802 0.693960 0.707205 0.387071
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.946645 -0.143060 1.109399 0.639196 -0.065275 0.376253 -0.261327 0.356996 0.685896 0.701221 0.385034
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.500633 -2.126020 -0.281422 0.044096 -0.219710 0.585215 0.463677 0.188949 0.682311 0.699467 0.391563
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.568165 0.431810 -0.397130 -0.018034 -0.324788 -0.055419 2.086937 5.286808 0.664141 0.688431 0.386332
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.647593 14.795953 3.655854 4.538803 8.146504 9.202921 4.517114 0.432980 0.034245 0.039388 0.001880
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.056935 0.422427 0.136336 -1.216351 -0.688130 -1.772995 -0.687904 -0.213446 0.634075 0.645241 0.394693
133 N11 not_connected 100.00% 100.00% 79.73% 0.00% 13.129784 19.265456 3.423117 3.120494 8.153809 8.797246 3.087615 1.455760 0.042170 0.189774 0.102467
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -1.033525 13.458621 -0.247609 9.784840 0.818355 9.238422 0.166015 2.438997 0.631461 0.039503 0.452283
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 4.377764 1.013350 6.425083 4.694246 12.959047 16.413488 0.426812 0.762648 0.502088 0.606505 0.391409
137 N07 RF_maintenance 0.00% 38.49% 38.49% 0.00% 0.384871 -0.571355 -0.709135 -0.148118 1.026291 1.084210 1.179461 1.781783 0.443357 0.457526 0.254339
138 N07 RF_maintenance 0.00% 38.49% 38.49% 0.00% 1.262444 -0.246614 -0.215282 0.674961 0.007198 0.575064 1.676607 -0.323555 0.460089 0.466854 0.253024
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.933461 -0.663312 1.266810 -1.233859 -0.350564 -1.329583 -1.979634 -0.573008 0.670836 0.674114 0.376256
140 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.775978 14.160715 0.090603 9.670682 -1.018018 9.177354 2.896331 4.730570 0.684755 0.046640 0.526152
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.392617 -0.790607 -0.962181 0.305457 -0.718484 -2.347680 0.687623 -2.126110 0.689053 0.702499 0.369729
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.493264 13.292768 1.254823 9.728625 2.041642 9.217143 6.274404 3.465859 0.681619 0.044075 0.515824
143 N14 digital_ok 100.00% 100.00% 38.49% 0.00% 11.711320 -0.389811 9.034664 0.028410 8.103617 0.636580 1.100957 -0.408348 0.034117 0.486749 0.383492
144 N14 digital_ok 0.00% 38.49% 38.49% 0.00% -0.853288 -0.781584 -0.659882 3.176541 0.201566 -1.326926 -0.430564 0.102976 0.485081 0.480411 0.252229
145 N14 RF_maintenance 100.00% 38.49% 38.49% 0.00% -1.242617 2.619621 -0.579407 6.244653 2.545190 15.480541 1.009178 2.562080 0.483191 0.457568 0.266566
146 N14 digital_ok 0.00% 38.49% 38.49% 0.00% -0.112452 1.300633 -1.606534 0.678657 -0.533525 -1.213404 0.008464 -2.530768 0.465261 0.489920 0.257977
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.874221 -1.687117 0.780819 1.789419 0.786551 -0.118506 0.182040 0.000721 0.684085 0.693526 0.378130
148 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -2.125259 -0.544561 2.564413 1.345489 -0.956366 0.186551 -0.090638 -0.164943 0.670523 0.697903 0.392740
149 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.316865 1.090268 -1.232787 1.426421 -1.022890 -0.031841 -0.781349 -2.725850 0.682482 0.695750 0.392120
150 N15 RF_maintenance 100.00% 100.00% 0.00% 0.00% 12.320602 -0.220164 8.948547 -1.076888 8.173022 0.638864 4.173396 0.524547 0.044206 0.296941 0.145183
155 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.615574 -0.949637 -0.470641 5.241277 1.634034 30.394782 2.538044 1.440828 0.635634 0.595406 0.407599
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.376265 12.955374 0.844683 9.470440 31.407607 9.206829 12.843847 1.503277 0.632031 0.039266 0.458510
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.186573 -0.181572 -0.152389 0.302181 -0.411792 0.687773 -0.199390 -0.005169 0.647660 0.666220 0.397662
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.423078 -0.649773 -1.024435 -1.020922 0.661141 0.392881 6.754937 25.445818 0.666120 0.679682 0.398687
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.270923 33.589366 -1.531754 -0.866083 -1.280226 3.176147 0.969814 4.065029 0.642206 0.524468 0.363204
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.426411 -1.056048 -0.770904 -0.935481 -0.351678 0.023434 0.115142 0.496482 0.680169 0.689759 0.375887
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.881662 32.719339 -0.628047 -0.856194 -0.202643 0.288516 -0.209044 1.123783 0.683483 0.569543 0.349793
162 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 11.722766 14.246079 8.886481 9.806921 8.133700 9.215824 2.248215 2.273142 0.046582 0.053080 0.004541
163 N14 digital_ok 0.00% 38.49% 38.49% 0.00% -0.573401 1.158252 -0.694647 0.095635 -0.234694 0.941063 2.161686 1.732936 0.483922 0.482535 0.251827
164 N14 digital_ok 100.00% 38.49% 38.49% 0.00% -0.719223 0.068353 1.273085 -0.543041 7.797121 0.897303 1.232198 2.000169 0.482579 0.485757 0.250723
165 N14 digital_ok 100.00% 38.49% 38.49% 0.00% 32.723089 -0.107283 1.861049 0.232511 5.071979 0.211355 4.421161 0.023843 0.391857 0.484125 0.250803
166 N14 RF_maintenance 100.00% 38.49% 100.00% 0.00% 33.921823 12.019860 0.037824 9.323185 1.915212 9.263137 1.293057 2.565484 0.400066 0.032373 0.256850
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.756605 -1.180276 -0.888202 0.833782 -0.051003 0.450839 -1.237261 3.552383 0.697769 0.698069 0.388727
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.064624 -1.056899 -0.480783 -0.737021 0.678513 0.670469 -0.094539 1.923434 0.688010 0.701739 0.390610
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.757577 1.561664 -1.427848 -1.614466 -0.268397 -1.693422 -0.286678 -1.314462 0.684351 0.684901 0.391999
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 12.298598 -0.614632 9.095020 -1.392487 8.129913 11.296156 2.195888 5.760270 0.038887 0.691439 0.537209
179 N12 RF_maintenance 100.00% 99.73% 88.49% 0.00% 12.460833 14.033414 9.087809 10.086830 8.102862 8.853283 1.833211 2.291907 0.068556 0.144109 0.074974
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.829955 14.252453 9.019877 9.844987 8.161607 9.266837 2.399613 4.878605 0.047940 0.051807 0.004397
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.554270 -0.232296 -0.711921 0.204020 0.027468 1.701508 -0.261820 7.060419 0.688402 0.688955 0.383396
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.251697 4.218728 -1.247618 2.698998 -0.218633 3.812843 14.698736 -2.491626 0.693226 0.683499 0.387513
183 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 11.763367 -0.813215 8.322904 -0.672309 8.116562 0.530307 0.655260 0.197958 0.041355 0.687796 0.488186
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 11.730584 13.801829 9.027552 9.740885 8.209875 9.279480 2.996138 3.264896 0.025924 0.025271 0.001091
185 N14 digital_ok 100.00% 38.49% 38.49% 0.00% 9.733607 1.002292 8.453019 6.615893 7.451821 0.479076 1.079119 0.199184 0.218858 0.435475 0.298853
186 N14 digital_ok 100.00% 100.00% 38.49% 0.00% 11.187917 1.767061 9.035168 1.726672 8.152299 0.591029 3.988011 -3.131567 0.040292 0.488584 0.363981
187 N14 digital_ok 100.00% 100.00% 38.49% 0.00% 11.800907 1.783824 8.804614 1.371887 8.214695 -0.344809 4.221648 -0.724269 0.041179 0.490169 0.374526
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 9.812716 11.098516 1.291456 -0.018432 3.757550 7.284001 1.091027 1.538101 0.362185 0.385221 0.173488
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 50.091402 13.570941 -0.338635 9.809867 8.648316 9.311680 43.475363 5.201350 0.481367 0.035836 0.352317
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.178372 0.153052 3.117579 -0.150415 -0.642069 0.565522 19.046577 1.991441 0.637492 0.673513 0.417654
200 N18 RF_maintenance 100.00% 100.00% 54.22% 0.00% 13.369306 41.413449 3.610096 0.293801 8.176997 8.759740 3.446418 2.386677 0.047895 0.221112 0.145810
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.764820 6.310513 4.433544 3.572267 6.551026 6.333852 -4.948028 -4.674329 0.638955 0.649727 0.378718
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.688424 1.878001 0.598692 -0.391832 -1.023023 -1.378248 -0.478975 6.307857 0.666672 0.636420 0.388316
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 13.970022 15.665012 3.387534 4.126917 8.146599 9.211705 4.340443 5.448558 0.034620 0.041940 0.001571
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.221889 2.361073 0.478310 -1.311140 -1.085778 -0.936690 -1.306548 9.013858 0.662270 0.648689 0.389248
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.629391 0.302327 -1.381700 -1.208626 10.127413 -2.008726 -0.114514 4.035319 0.644168 0.656986 0.383342
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.590048 1.825203 1.184961 -0.283239 0.978154 1.176661 -1.899883 -1.661663 0.646201 0.652184 0.369833
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% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
219 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.677362 4.404476 4.431798 2.816832 6.565533 4.124800 -4.913629 -3.834920 0.637220 0.657277 0.397653
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.461218 -0.976784 -0.093542 -0.512575 -1.477885 -1.668915 2.959152 -1.563805 0.662171 0.659096 0.390573
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.614768 -0.141884 -0.976793 -0.741728 -0.115235 -2.027293 3.027639 -0.730467 0.630264 0.662780 0.394476
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.837124 2.696894 0.527683 0.279481 -0.821193 1.994108 8.172673 1.142843 0.659157 0.623619 0.403161
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.550779 2.013405 -1.614708 0.582525 -0.926697 -1.761131 0.181438 -1.356797 0.643969 0.668976 0.396847
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.984182 6.908059 4.614127 4.032708 6.642408 7.682709 -5.063655 -5.227775 0.638533 0.641019 0.391289
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
227 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
228 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
229 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 6.380960 1.415613 1.222053 -1.394060 1.676529 -2.129390 3.625208 -1.025391 0.537323 0.639100 0.429303
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.549307 -0.893747 1.024474 0.454296 -0.265262 -0.903450 -2.263831 -2.441993 0.660378 0.656548 0.400161
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.456417 3.552138 0.228309 0.680081 0.060616 4.212277 -0.660378 7.442899 0.654481 0.589124 0.415566
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
241 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
242 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
243 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 270.337151 270.677656 inf inf 5682.265256 5684.679884 11534.047515 11364.268281 nan nan nan
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
245 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
246 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
261 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.409828 14.527948 -0.755376 6.347486 -0.878834 9.222652 16.074050 5.355873 0.655526 0.049664 0.527075
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.871504 2.324017 0.979555 1.132820 0.156687 -0.154945 2.805287 0.044506 0.560428 0.562691 0.386725
325 N09 dish_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.490730 -1.470177 -1.563084 -1.087920 0.851222 -0.586996 5.815720 0.475210 0.537472 0.572460 0.395543
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.443425 0.471727 -1.197136 -1.620098 -1.219771 -1.182387 1.878982 0.971862 0.522331 0.555628 0.385889
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 7, 8, 16, 17, 18, 19, 20, 22, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 45, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 73, 77, 78, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90, 92, 93, 94, 96, 97, 98, 99, 100, 101, 102, 103, 104, 107, 108, 109, 110, 111, 113, 114, 116, 117, 118, 119, 121, 122, 123, 124, 126, 130, 131, 133, 135, 136, 137, 138, 140, 142, 143, 144, 145, 146, 150, 155, 156, 158, 159, 161, 162, 163, 164, 165, 166, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 202, 203, 205, 206, 208, 209, 210, 211, 219, 222, 224, 225, 226, 227, 228, 229, 237, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 325, 329]

unflagged_ants: [5, 9, 10, 15, 21, 35, 40, 41, 42, 43, 44, 46, 48, 49, 61, 62, 64, 65, 66, 67, 69, 70, 72, 74, 79, 85, 91, 95, 105, 106, 112, 115, 120, 125, 127, 128, 129, 132, 139, 141, 147, 148, 149, 157, 160, 167, 168, 169, 207, 220, 221, 223, 238, 324, 333]

golden_ants: [5, 9, 10, 15, 21, 40, 41, 42, 44, 65, 66, 67, 69, 70, 72, 85, 91, 105, 106, 112, 127, 128, 129, 141, 147, 157, 160, 167, 169]
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_2459893.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.0.4.dev44+g3962204
3.1.5.dev171+gc8e6162
In [ ]: