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 = "2459988"
data_path = "/mnt/sn1/2459988"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 2-12-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/2459988/zen.2459988.21304.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/2459988/zen.2459988.?????.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/2459988/zen.2459988.?????.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 2459988
Date 2-12-2023
LST Range 4.039 -- 13.996 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
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 110
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 60 / 198 (30.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 123 / 198 (62.1%)
Redcal Done? ❌
Never Flagged Antennas 75 / 198 (37.9%)
A Priori Good Antennas Flagged 47 / 93 total a priori good antennas:
3, 5, 7, 15, 16, 19, 29, 40, 41, 42, 45, 53,
54, 55, 71, 72, 81, 86, 94, 101, 103, 106,
107, 109, 111, 121, 122, 123, 124, 136, 140,
144, 147, 151, 158, 161, 165, 170, 173, 182,
184, 185, 187, 189, 192, 193, 202
A Priori Bad Antennas Not Flagged 29 / 105 total a priori bad antennas:
8, 22, 43, 46, 48, 61, 62, 64, 73, 74, 89,
115, 125, 132, 133, 137, 139, 179, 220, 222,
223, 228, 229, 237, 238, 239, 241, 245, 325
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_2459988.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
4 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.018424 -0.115071 -1.172323 -0.353429 -0.092905 0.722717 7.455798 8.678505 0.603711 0.618262 0.382864
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.312924 -1.719245 -0.571764 0.045381 -0.149326 0.018893 1.032518 0.967592 0.604472 0.614502 0.377143
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.918159 -0.882125 3.052686 -1.229257 0.886974 -0.466354 1.242465 -0.657040 0.583248 0.617607 0.386038
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.217440 -0.531349 1.278530 -1.434219 0.580271 0.464076 0.629077 0.884030 0.594880 0.613291 0.382145
15 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 12.490317 16.441401 10.078616 10.735644 10.730129 13.196268 -0.207651 -0.003778 0.026428 0.025507 0.001323
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 12.267509 -0.968527 10.108349 0.760986 10.707657 1.647545 0.093406 1.927982 0.030365 0.609557 0.495705
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.607651 2.068950 0.545251 0.444742 0.931540 0.759096 1.480985 2.373135 0.602216 0.617725 0.385962
18 N01 RF_maintenance 100.00% 100.00% 47.19% 0.00% 12.978432 20.558207 10.081086 -0.572499 10.821012 7.363604 0.006449 13.323511 0.029367 0.220830 0.168237
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.446469 -0.717559 -1.138304 1.381679 -0.316808 1.090307 0.107886 7.162933 0.613202 0.622205 0.373911
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.341666 -1.588027 1.912273 -1.092796 0.042383 0.182352 1.323484 -0.743746 0.606763 0.625422 0.376243
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.433081 0.382634 -0.601800 0.078440 0.447372 0.871144 -0.246249 0.088809 0.603733 0.608650 0.370602
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.413643 0.080699 0.532728 0.322872 0.814273 1.471286 -0.401942 -0.815043 0.559892 0.574760 0.364425
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.493211 15.011513 10.142070 10.603264 10.825271 13.253183 1.187406 0.803615 0.033030 0.035730 0.004069
28 N01 RF_maintenance 100.00% 0.00% 88.11% 0.00% 11.968388 29.345292 -0.164261 2.871118 7.317595 10.130592 3.892634 14.023781 0.350711 0.146245 0.260368
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 12.398332 15.572353 9.732878 10.198041 10.783178 13.209987 -0.004532 -0.291598 0.029300 0.033663 0.004793
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.554345 -0.041033 2.025304 -1.457973 0.574862 -0.408061 1.189174 -0.002269 0.600453 0.636003 0.387000
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.098837 -1.740329 1.082443 0.189609 1.260262 -1.045188 -0.093509 1.155799 0.627892 0.633366 0.375926
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.463030 30.535798 0.363656 3.174617 6.926313 1.330123 48.559188 11.697644 0.572247 0.511203 0.304933
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 14.031151 16.951026 4.524590 4.867177 10.768279 13.181351 0.557236 0.233249 0.032712 0.041685 0.006594
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.832995 -0.352243 0.773040 -1.085336 -0.151161 -1.178876 11.578987 0.477541 0.567793 0.563772 0.357903
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 30.595486 31.365549 13.405425 13.371059 10.832781 13.034771 2.549341 2.565166 0.030070 0.027951 0.001706
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.710873 0.860113 -1.108437 1.463133 1.325853 0.825876 -0.551274 1.371107 0.606240 0.612868 0.392865
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.356704 0.019989 0.237188 0.533179 0.048150 0.003702 3.417760 0.901693 0.611581 0.609990 0.388386
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 11.604216 0.436627 9.765508 0.506479 10.774163 -0.644178 0.785254 0.722443 0.035196 0.609820 0.469805
41 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 194.238119 191.616849 inf inf 3688.048542 3646.309538 4804.602139 4828.894525 nan nan nan
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.337150 3.508720 -0.527991 8.484529 0.980374 4.254070 0.078935 0.249629 0.625360 0.525515 0.402334
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.301002 -0.004294 0.133061 0.641935 -1.014204 0.318901 -0.781312 0.696351 0.620968 0.627731 0.376328
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.153587 -0.134285 -0.473533 -0.547524 -1.092371 0.183912 -0.922370 -0.676395 0.623878 0.638571 0.376088
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.052390 4.315420 0.226573 0.810574 -0.651442 1.192248 -0.330773 10.620385 0.616476 0.623302 0.368359
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.032417 0.212249 -0.834318 -0.895323 -0.301892 -0.786723 -0.643858 -0.961752 0.619268 0.639795 0.385205
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 12.941451 16.565190 4.427312 4.483980 10.768474 13.109728 1.493601 -0.033449 0.030449 0.049876 0.013899
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.402914 1.434347 -0.200704 1.964339 -0.983071 2.890034 -0.603398 -1.737267 0.572721 0.597901 0.373250
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.117269 -0.256660 -0.244080 -0.301434 1.281810 -0.478502 0.650360 4.729693 0.533330 0.573543 0.367562
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.330769 11.714672 0.305147 1.219975 0.270457 3.577079 13.280319 62.827931 0.585304 0.560800 0.362029
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 11.904476 5.199686 0.165336 1.883782 4.761895 3.987447 30.269848 1.482734 0.497779 0.510396 0.252187
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.639802 7.949415 -0.453504 0.528812 1.398382 0.824183 0.492612 0.560319 0.615336 0.624453 0.385221
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.510591 3.998551 -1.395978 0.067540 0.839541 1.773915 1.685141 13.187725 0.625663 0.633733 0.389458
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 32.349208 -0.820096 4.752894 -0.840210 1.967787 -0.081431 3.360733 1.131477 0.451212 0.634652 0.377959
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 12.593656 16.545996 10.172828 10.738409 10.780625 13.174680 0.275896 1.411455 0.027628 0.029931 0.002292
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.459399 0.020778 -0.706023 1.243123 -0.498526 0.192938 -0.360954 3.411935 0.617337 0.641130 0.374802
57 N04 RF_maintenance 100.00% 100.00% 100.00% 0.00% 158.723693 162.049650 inf inf 3543.697381 3583.572275 4849.919570 4491.464230 nan nan nan
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.605027 15.475802 10.046913 10.732117 10.707163 13.157359 0.989667 0.739527 0.033503 0.033450 0.001893
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 12.540942 0.981861 9.598169 0.721895 10.542491 1.053162 0.450771 9.504770 0.043701 0.626822 0.498671
60 N05 RF_maintenance 100.00% 0.00% 99.41% 0.00% 0.275112 15.374172 -0.497826 10.760319 -0.055339 13.163383 7.620308 1.560087 0.619887 0.063884 0.507759
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.355069 0.344301 -0.608458 -1.422932 1.408806 -1.520045 -0.492350 0.229617 0.563001 0.592040 0.362424
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.050051 0.935417 -1.100206 1.261481 -0.769292 0.378658 1.305167 -0.738670 0.555246 0.595323 0.370107
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 1.943251 16.002966 -0.202428 4.893798 0.772643 13.278961 -0.347763 1.358277 0.567884 0.041569 0.457392
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.151407 0.142124 -0.918501 -0.949399 -0.230488 -0.712782 2.443720 3.788848 0.561105 0.554879 0.352876
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.810820 1.865427 0.489981 1.036190 -0.430009 0.258694 1.667037 0.279942 0.592508 0.610618 0.392942
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.423693 2.134152 -1.265078 -0.992529 2.314810 0.008011 -0.673156 0.101080 0.608963 0.624650 0.392920
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.372499 -0.459309 -0.839476 0.585068 -0.665292 0.324259 -0.125313 0.986198 0.619715 0.624578 0.381636
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 22.084781 31.979131 0.912956 14.071981 5.847770 13.091880 -0.175181 5.839352 0.364396 0.027646 0.270970
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.035446 0.632165 0.353957 0.852113 -0.581912 1.213283 -0.423252 -0.401809 0.617420 0.635667 0.369103
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.810167 -0.327760 -0.088470 0.050740 0.847994 1.017946 0.492397 1.012837 0.624855 0.640229 0.369725
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 5.117571 -0.532245 0.685401 0.995026 0.049232 -0.456174 1.824081 0.263085 0.620559 0.647827 0.369530
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 12.689918 16.822903 10.541234 11.141319 10.573452 12.982584 0.123629 0.227527 0.032632 0.035238 0.003922
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.505813 0.793032 -1.329556 -1.036920 0.905114 -0.834979 -0.587961 -0.870508 0.633600 0.646034 0.373318
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.096476 -0.318882 0.005630 -0.625800 -0.033105 1.697741 -0.874767 3.028135 0.634036 0.641471 0.372984
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 57.802326 19.865860 0.296541 -0.223733 7.525587 6.078660 11.328214 11.695647 0.357243 0.518172 0.307715
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 38.328967 0.927564 -0.374318 1.618267 3.082994 1.709353 2.943008 0.642266 0.414765 0.604937 0.366358
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.389190 16.320047 -1.424697 4.916266 -0.816814 13.077813 0.576607 -0.635272 0.580131 0.038080 0.453608
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.601636 17.308528 0.423685 4.817520 -0.840340 13.101626 -0.560478 0.324758 0.592558 0.046280 0.465505
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.250437 16.396517 0.227815 9.356212 -0.586529 12.837055 -0.029679 0.737667 0.568938 0.036642 0.442770
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.218966 1.083129 0.495240 5.347482 -0.384219 2.416706 -0.354189 0.959941 0.592034 0.548166 0.372512
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.102732 0.083445 0.281778 0.432556 0.482104 -0.289316 -0.496766 0.279575 0.604760 0.613237 0.374189
84 N08 RF_maintenance 100.00% 52.05% 100.00% 0.00% 23.060635 28.582085 13.005931 13.627155 8.968406 13.045539 2.338612 2.554051 0.207795 0.032870 0.125161
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.646855 -0.030175 2.750026 1.376389 -1.164747 -0.295425 0.063909 -0.335480 0.604751 0.632997 0.371669
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.400610 0.101894 1.407566 1.748470 2.274002 -0.202794 0.501640 14.753610 0.608904 0.628863 0.354316
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.117955 7.092267 -0.762446 -0.201513 1.634855 0.816353 20.465912 16.913268 0.623518 0.651466 0.360304
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.046706 -0.105540 0.452720 0.734902 -0.315315 -1.037117 1.549457 0.140153 0.627182 0.642728 0.359814
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.225628 0.549555 0.106834 0.836082 -0.897636 -0.510706 -0.722708 -0.654181 0.628446 0.645903 0.364643
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.478435 -0.076064 -1.318901 -0.422610 -0.173069 3.781333 -0.363213 4.986484 0.635514 0.654726 0.373187
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.279138 -0.313357 0.484585 0.291220 -0.446096 -0.871612 0.724359 0.709365 0.618660 0.642997 0.373376
92 N10 RF_maintenance 100.00% 0.11% 20.92% 0.00% 38.705664 47.865426 0.409067 1.515241 6.025811 5.257177 1.360258 7.521900 0.290700 0.249549 0.068958
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.819035 -0.244004 2.374012 -1.138050 0.338435 -0.157531 2.268403 0.481028 0.617194 0.637941 0.379734
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 13.246923 15.943306 10.291533 10.622681 10.671774 13.165330 0.302377 -0.028696 0.030143 0.026130 0.001972
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 8.502483 4.890746 -0.836502 0.993006 0.342928 1.059657 0.702164 0.130822 0.537846 0.583348 0.346056
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.382239 24.747399 3.888099 1.870198 4.420959 3.923584 -2.388506 -1.377784 0.593311 0.498945 0.358111
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.343384 5.412839 -0.837746 0.742969 -0.768621 2.024017 -0.689018 7.885655 0.572565 0.540549 0.368634
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 10.715999 9.258718 -0.358334 1.155701 0.467134 1.318239 0.306803 0.515190 0.623574 0.631389 0.372516
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.974908 1.155655 -1.393434 -0.942346 0.482469 1.124699 -0.127157 5.999508 0.624637 0.641651 0.371535
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.786660 3.964824 3.938766 -1.359906 4.298082 -0.166653 -1.928807 6.999541 0.617082 0.641318 0.368471
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.139455 69.873941 -1.083889 7.105368 3.153034 -0.437819 0.318684 0.659346 0.635941 0.626524 0.364148
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.455936 0.035954 0.288277 0.877809 0.347254 -0.658374 -0.587283 -0.286721 0.633118 0.646902 0.360690
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 1.481228 -0.989428 0.955757 -0.581229 9.066586 -0.804173 107.980645 0.043321 0.620805 0.636455 0.354405
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 3.796127 3.689193 0.028035 -0.593054 -0.067115 -0.197416 7.549076 7.069944 0.628979 0.652053 0.361962
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 12.166934 48.562625 10.087288 0.943454 10.763651 5.457371 0.735189 1.421041 0.032484 0.290106 0.163482
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.955217 15.465142 10.118855 10.483080 10.853821 13.251484 -0.151177 0.729702 0.027374 0.029292 0.001673
110 N10 RF_maintenance 100.00% 0.00% 0.00% 100.00% 18.221596 0.361983 11.027667 4.806374 5.106588 0.914730 1.077557 -0.152938 0.170315 0.256509 -0.221848
111 N10 digital_ok 100.00% 0.00% 99.84% 0.00% 39.883836 15.304054 0.951485 10.573462 3.556297 13.233975 7.451913 0.888676 0.488127 0.057471 0.324611
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.375102 -0.754572 0.327256 0.268994 1.175346 2.254612 0.753621 -0.662064 0.618371 0.626439 0.380608
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 14.322824 16.997839 4.161747 4.912874 10.613453 13.048682 0.611731 -0.034998 0.034245 0.030773 0.001936
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 15.863434 14.095776 13.103441 10.461400 11.347162 11.855799 190.127742 62.345273 0.023756 0.028147 0.002595
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.295651 -0.776698 -1.004520 0.339399 -0.184589 -0.325619 -0.487967 -0.400536 0.558719 0.587669 0.384238
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 13.055716 17.149717 10.221067 11.096716 10.640672 13.156801 0.632756 2.387321 0.027790 0.030410 0.001996
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.344773 1.918989 -0.128853 0.558316 -0.751427 0.424099 0.234130 0.843321 0.601754 0.620181 0.383128
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.545418 2.197348 2.832532 -1.113176 -0.350259 0.399844 1.066220 0.079942 0.617200 0.642950 0.372354
121 N08 digital_ok 100.00% 0.16% 0.00% 0.00% 2.800340 3.969359 -1.188854 6.076946 0.666504 -0.723153 10.727133 12.473107 0.625520 0.626560 0.360993
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.723852 8.257567 -1.214297 -1.236127 2.195780 0.616581 -0.454932 -0.789419 0.637130 0.655802 0.369515
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.485227 10.358679 0.818604 1.000392 0.362462 -0.394128 -0.411591 0.089658 0.643104 0.655077 0.367235
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 12.273076 0.094583 10.376144 0.637213 10.593768 0.027037 -0.026777 0.185159 0.038357 0.656693 0.463245
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.151926 0.223380 -0.101167 0.759977 1.520453 0.843076 0.583484 1.210222 0.637337 0.645420 0.361135
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.837285 5.754128 -1.165084 1.684242 0.862573 1.965522 1.404787 2.740705 0.640885 0.642540 0.367177
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.656360 0.276078 0.683922 0.447447 0.958480 0.756547 0.057182 3.682501 0.634433 0.653944 0.375233
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.241181 -0.505125 -1.235719 -0.210903 -0.508739 0.433686 -0.131670 3.119775 0.641909 0.652027 0.382356
131 N11 not_connected 100.00% 0.00% 5.24% 0.00% -0.649909 15.123210 0.080236 4.743045 -0.508185 11.614772 -0.784138 -0.368279 0.600885 0.279339 0.422810
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.787664 0.826369 -0.071043 -1.430071 0.065768 -0.831839 -0.308809 -0.214164 0.582217 0.587761 0.369885
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.686186 -1.286457 -1.384479 -0.280295 -0.989003 -1.018490 -0.653278 0.793736 0.562907 0.592929 0.388095
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.467403 16.949230 4.318011 4.891334 10.597862 13.060586 -0.231823 0.030901 0.038315 0.033819 0.002608
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.260552 -1.418989 -0.908610 -1.371774 2.625742 0.408717 7.965072 -0.485969 0.565751 0.599860 0.398366
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 11.221633 -0.505182 9.704072 -0.789224 10.836299 -0.108442 0.577571 -0.630004 0.037663 0.600642 0.448124
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.227443 -0.585795 0.277998 -1.275742 1.520890 -0.976902 0.278650 0.038830 0.583206 0.614028 0.385295
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.538032 2.133065 1.640840 -0.805840 0.923125 -0.431909 -0.004366 0.294476 0.609721 0.608461 0.365684
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.420314 -0.802509 -0.907803 -0.046536 -0.600258 -0.645660 4.603409 2.513389 0.627950 0.644526 0.369993
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.478203 -0.662795 -0.166193 0.768501 1.470757 -0.698944 0.673496 -0.873490 0.627734 0.650908 0.369896
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.176444 15.428358 -0.592724 10.764141 3.085513 13.221599 18.605401 0.575794 0.632530 0.043466 0.516239
143 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.613557 -1.444982 -1.375626 -0.999803 0.067056 1.679321 -0.466096 -0.482206 0.642230 0.653576 0.369633
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.551748 3.699763 -1.124572 8.192293 0.251329 5.164471 -0.853390 0.104074 0.643246 0.535041 0.399227
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.434757 15.539005 10.103550 10.798747 10.543499 13.301593 -0.081007 1.775407 0.071853 0.029137 0.031345
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.288395 0.890290 -0.781218 0.615005 -0.735150 0.639765 -0.535356 -1.484348 0.615867 0.639150 0.366374
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.571568 -1.639984 2.368065 2.439352 -0.581062 -0.970716 4.850905 0.432568 0.620463 0.632789 0.364389
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.435673 0.269074 -0.545172 -0.566411 1.770356 1.816032 -0.625082 -0.745966 0.630072 0.646638 0.382490
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.127260 -1.423786 -0.863497 -1.216954 -0.288947 0.573195 0.002269 -0.219321 0.624390 0.638974 0.387626
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.096250 3.607912 -1.056773 -1.163344 -0.572383 -0.994788 0.111385 0.494742 0.622515 0.616207 0.382950
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 28.415165 1.354026 -0.160969 0.541654 3.786281 -0.136970 9.220302 -0.108809 0.471375 0.562082 0.337207
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.587007 -1.219263 9.861286 -1.435466 10.868273 -0.308460 0.956364 2.354340 0.039149 0.600856 0.457514
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 5.039081 15.098841 8.533960 10.498185 5.910855 13.250126 2.203685 0.863744 0.421227 0.036613 0.311676
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.521975 -0.467937 0.004879 0.649747 -0.315980 -0.003702 -0.383123 -0.198442 0.591675 0.614268 0.381767
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.196212 -0.276786 -0.031438 -0.167991 1.741006 1.427237 1.911680 12.044159 0.604184 0.626829 0.383113
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.519311 12.161177 -1.450684 -1.156543 0.149521 4.409362 -0.336361 77.538776 0.577281 0.568944 0.351246
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.276887 -1.140987 -0.512390 -0.657228 -0.473335 0.992292 -0.717117 0.316633 0.619360 0.639010 0.374812
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.004167 34.065336 0.095270 -0.466396 0.214737 2.026794 -0.466583 1.017283 0.625450 0.510981 0.339271
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.515548 -1.081906 -0.004879 -1.102258 0.194010 0.880978 2.821712 -0.170984 0.638602 0.653773 0.374394
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 1.161960 1.819705 -0.131793 0.459986 0.077916 0.740476 -0.248718 1.032655 0.638728 0.654169 0.375059
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.465795 -0.266199 -0.455950 1.446346 -0.444918 1.287435 2.706318 0.675486 0.637183 0.643825 0.365192
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 32.472630 0.154113 -0.588870 -0.905136 5.983121 -0.219315 20.616021 0.120033 0.523033 0.652519 0.366614
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.278548 3.854364 -1.392065 3.327084 0.207212 5.892089 2.945028 -1.738857 0.623045 0.639051 0.368622
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.230618 -1.248113 -1.389664 -1.108606 1.254104 0.043344 -0.415082 0.811935 0.633995 0.648740 0.376152
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.223650 -1.422859 0.326554 -0.356723 1.463252 0.454515 -0.382683 3.703829 0.629847 0.640660 0.380646
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.379300 -0.941171 -0.872349 -1.321094 0.678750 0.091535 -0.786787 -0.970250 0.628463 0.642518 0.385887
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 13.014651 -0.776817 10.425945 -0.782066 10.638972 -1.099000 1.307037 6.651019 0.037566 0.633956 0.493349
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.047049 2.001785 -1.363971 -0.665060 -0.821439 1.121211 -0.420446 0.932389 0.565975 0.564103 0.355238
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 14.561951 16.348257 3.872712 4.510564 10.884203 13.241305 1.874393 3.353063 0.034875 0.039718 0.003715
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.027216 -0.873469 -1.215875 -1.156265 -1.279199 2.383022 -0.640025 0.031646 0.601401 0.624153 0.382889
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.302552 16.170805 -1.443096 10.906332 0.180610 13.118299 14.883937 1.002743 0.620394 0.049303 0.516614
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.649807 -0.439138 0.785070 0.543005 -0.140222 -0.268096 -0.387666 3.071421 0.624294 0.638923 0.377577
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.345567 15.088415 -1.360423 10.465418 -0.700934 13.261314 3.857661 0.722414 0.633473 0.043945 0.485731
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.387859 0.269078 -0.592989 0.116119 0.990991 -0.010039 3.757647 2.082007 0.623951 0.641920 0.366648
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.795521 -0.907563 -1.410472 -0.408276 13.001009 -0.391829 1.652674 -0.149606 0.639080 0.651465 0.362474
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 24.135769 -0.198326 -0.658600 -1.365632 8.806027 -0.042394 7.219434 0.041356 0.570631 0.649716 0.364308
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.861339 -0.801556 0.532185 -0.063735 -0.672441 -0.898490 -0.199453 -0.975040 0.619713 0.654640 0.378106
187 N14 digital_ok 100.00% 45.73% 0.00% 0.00% 11.196872 -0.789388 9.117403 0.290187 9.665987 1.688877 0.050388 -0.579935 0.214664 0.646222 0.463531
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 10.900174 14.949971 9.665629 10.596403 10.867272 13.306105 3.656487 1.431876 0.028074 0.030647 0.001082
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.224951 -1.347691 -0.659840 0.540207 -0.224270 -0.317923 -0.706642 -1.321033 0.618174 0.636836 0.392428
191 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.512169 -0.069544 1.342562 -0.445155 -0.036867 -0.038263 3.786407 0.669014 0.594825 0.616145 0.386901
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.403528 8.230386 3.224748 4.904053 4.668890 10.571350 0.201815 -2.914433 0.582948 0.565178 0.388349
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 8.765743 0.941963 5.109940 1.380530 8.388490 2.282482 -2.731731 0.254565 0.547997 0.582624 0.402359
200 N18 RF_maintenance 100.00% 100.00% 57.03% 0.00% 14.072443 44.359505 4.291212 -0.114639 10.862105 7.071874 0.782058 11.355830 0.040115 0.210536 0.140738
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.638339 6.110808 3.303268 4.319653 3.437670 8.598525 -0.429820 -2.164978 0.602706 0.606653 0.374871
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.949201 4.451831 1.765235 -1.219987 0.909288 -0.644057 -0.365404 17.902370 0.616334 0.607091 0.367716
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.371366 18.468430 1.109736 -0.995610 -0.624666 0.423567 8.925919 1.197870 0.620704 0.648907 0.376200
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 11.460457 1.793031 3.902078 -1.335827 8.872098 -0.993119 -0.094039 2.577014 0.298776 0.615118 0.455480
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.097876 7.362062 -1.196354 2.208855 8.865361 5.004585 -0.012065 0.850300 0.591505 0.507435 0.375077
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.510728 2.406484 -0.595945 -0.614052 -0.947357 -1.499079 6.440652 -0.725581 0.602084 0.595422 0.363342
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 284.647544 285.124258 inf inf 4040.029163 4069.732374 4637.255003 4792.346774 nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
211 N20 RF_ok 100.00% 0.00% 90.43% 0.00% 0.098818 16.291667 -1.318632 3.463945 -0.816329 103.396862 -0.126421 3.096405 0.563563 0.106206 0.470708
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.534578 -0.988266 0.588773 -0.226566 -0.860727 -0.008199 2.769722 -0.837969 0.604713 0.609898 0.370266
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 4.049808 -0.319994 -1.299635 -0.564183 -0.308367 -1.206783 12.967371 -0.809425 0.583181 0.618275 0.374923
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.122360 -0.073182 -0.137175 0.306295 -0.384522 -0.657662 2.351488 -1.269526 0.599611 0.625200 0.373058
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.700691 0.004294 -1.492852 0.655736 -0.597379 -0.315398 1.064399 0.064552 0.585108 0.625866 0.377605
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 9.075487 7.489074 5.377024 4.857025 8.873586 10.202738 -2.892308 -2.210534 0.577015 0.599299 0.372147
225 N19 RF_ok 100.00% 0.00% 91.95% 0.00% -0.672815 15.617793 0.799478 4.681188 -0.887185 12.895525 -1.172455 0.499788 0.608850 0.133401 0.501001
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.315632 12.896956 -0.421049 1.283487 -1.247340 6.758702 -0.751604 3.377240 0.598237 0.567388 0.370994
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 5.192835 -0.399299 1.949586 -0.367930 2.769623 -0.421225 3.513211 0.834268 0.478884 0.600254 0.411178
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.863848 -0.126968 1.224708 -1.263560 0.936495 -1.101168 -0.227214 0.586144 0.578916 0.582103 0.371390
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.365039 0.867043 0.903155 1.626307 0.079795 1.970161 2.092558 -1.753230 0.579913 0.593793 0.392969
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 3.198607 -0.216298 -0.045766 -1.380288 -0.752437 -1.339681 -0.393081 -0.967934 0.538264 0.592593 0.381671
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.467128 -0.322953 1.526963 0.991799 0.294941 -0.613638 -1.513185 -1.619846 0.594404 0.609905 0.380440
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.538486 -0.512409 0.584659 0.734154 -0.614536 -0.689240 0.468608 0.156441 0.597077 0.612007 0.377285
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.904655 0.238565 -0.403455 -0.804222 -0.787850 -1.591560 11.168979 5.892256 0.587149 0.610828 0.379318
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.237900 -1.034175 -0.285347 0.341255 -0.797866 -0.924214 0.495527 -0.811040 0.587641 0.617028 0.388963
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 22.156996 1.619309 0.895368 1.890300 4.599608 2.213428 3.317864 -0.218517 0.485891 0.610178 0.385600
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 26.265284 -0.721889 1.250348 -1.484513 4.040368 -1.172142 -1.019285 -0.110985 0.456992 0.592328 0.374610
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.733908 -0.943305 -0.983426 -0.803152 0.186732 -0.105137 1.264281 4.339584 0.547726 0.599412 0.389303
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.466928 0.563383 1.259684 -0.412707 0.676541 -0.633345 -1.570915 -0.034279 0.577709 0.590510 0.383369
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% 0.088960 17.191859 -0.144920 3.805519 -0.835547 13.186218 -0.784190 -0.580267 0.564016 0.037109 0.486128
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% -0.352358 2.823123 0.317187 -0.126100 -0.225478 -0.438655 4.852772 1.713984 0.572161 0.567211 0.375466
262 N20 dish_maintenance 100.00% 2.65% 12.92% 0.00% 12.837710 14.891861 5.297796 5.395634 4.919771 7.122904 0.058462 1.681330 0.272883 0.252819 0.125141
320 N03 dish_maintenance 100.00% 100.00% 100.00% 0.00% 16.840154 15.964632 6.715542 7.043272 10.825797 13.287322 0.353965 1.531053 0.051678 0.043781 0.006687
324 N04 not_connected 100.00% 100.00% 100.00% 0.00% 163.346173 163.562385 inf inf 3192.368937 3189.216834 4941.769021 5009.022820 nan nan nan
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.394106 -0.726913 1.297062 -1.310647 1.075661 -1.042860 -1.280351 0.158545 0.513954 0.516975 0.377071
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.530524 -0.284874 -1.019965 -0.915852 -0.130935 -1.008460 4.752284 0.724145 0.467924 0.508757 0.360034
333 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.399969 5.012673 -1.121158 -1.317481 -0.230640 -1.122889 0.487088 1.309578 0.462736 0.485820 0.346861
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, 5, 7, 15, 16, 18, 19, 27, 28, 29, 32, 34, 35, 36, 40, 41, 42, 45, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 63, 68, 71, 72, 77, 78, 79, 80, 81, 82, 84, 86, 87, 90, 92, 94, 95, 96, 97, 101, 102, 103, 104, 106, 107, 108, 109, 110, 111, 113, 114, 117, 120, 121, 122, 123, 124, 126, 131, 134, 135, 136, 140, 142, 144, 145, 147, 151, 155, 156, 158, 159, 161, 165, 166, 170, 173, 180, 182, 184, 185, 187, 189, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 221, 224, 225, 226, 227, 240, 242, 243, 244, 246, 261, 262, 320, 324, 329, 333]

unflagged_ants: [8, 9, 10, 17, 20, 21, 22, 30, 31, 37, 38, 43, 44, 46, 48, 56, 61, 62, 64, 65, 66, 67, 69, 70, 73, 74, 83, 85, 88, 89, 91, 93, 105, 112, 115, 118, 125, 127, 128, 132, 133, 137, 139, 141, 143, 146, 148, 149, 150, 157, 160, 162, 163, 164, 167, 168, 169, 171, 179, 181, 183, 186, 190, 191, 220, 222, 223, 228, 229, 237, 238, 239, 241, 245, 325]

golden_ants: [9, 10, 17, 20, 21, 30, 31, 37, 38, 44, 56, 65, 66, 67, 69, 70, 83, 85, 88, 91, 93, 105, 112, 118, 127, 128, 141, 143, 146, 148, 149, 150, 157, 160, 162, 163, 164, 167, 168, 169, 171, 181, 183, 186, 190, 191]
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_2459988.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

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