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 = "2459971"
data_path = "/mnt/sn1/2459971"
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: 1-26-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/2459971/zen.2459971.21327.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 1849 ant_metrics files matching glob /mnt/sn1/2459971/zen.2459971.?????.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/2459971/zen.2459971.?????.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 2459971
Date 1-26-2023
LST Range 2.928 -- 12.879 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1849
Total Number of Antennas 196
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 196 (0.0%)
Antennas in Commanded State (observed) 0 / 196 (0.0%)
Cross-Polarized Antennas 96
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 55 / 196 (28.1%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 114 / 196 (58.2%)
Redcal Done? ❌
Never Flagged Antennas 82 / 196 (41.8%)
A Priori Good Antennas Flagged 46 / 93 total a priori good antennas:
3, 5, 7, 9, 10, 15, 16, 29, 30, 38, 40, 42,
54, 55, 56, 71, 72, 81, 86, 94, 101, 103, 107,
109, 111, 121, 122, 123, 127, 128, 136, 143,
151, 158, 161, 165, 170, 173, 182, 185, 187,
189, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 35 / 103 total a priori bad antennas:
8, 43, 46, 48, 49, 61, 62, 64, 73, 74, 82,
89, 90, 95, 114, 115, 125, 132, 133, 137, 139,
205, 211, 220, 222, 223, 229, 237, 238, 239,
245, 261, 324, 325, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459971.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% 9.424885 11.298189 9.807254 -1.150529 11.291783 4.724728 0.323972 4.981331 0.034025 0.341624 0.272903
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.230172 1.009469 1.617475 0.602322 16.691971 4.219210 23.203430 5.464004 0.594495 0.623220 0.401267
5 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.768232 -0.155194 0.981551 0.309481 0.156654 2.396065 4.643847 3.187125 0.606276 0.624693 0.393685
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.863434 -0.066126 -1.082755 -0.201669 -0.013193 0.092385 10.308676 9.248325 0.615723 0.632035 0.389708
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.020318 -1.250432 -0.550723 -0.012593 -0.286528 0.722662 3.691046 0.471945 0.615260 0.628373 0.385511
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.255186 -0.724411 8.152209 -0.495054 6.619619 0.271630 -0.005965 -0.412678 0.439476 0.627791 0.463438
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.425265 -0.386106 5.999008 -1.454154 0.562094 1.103089 0.869467 -0.166992 0.531576 0.626104 0.427863
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.638928 15.994912 9.207167 -0.049214 11.294750 5.028225 -0.171556 1.544367 0.033960 0.342536 0.263628
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.640490 -0.814834 9.772377 0.778948 11.295332 2.499912 0.293592 1.983741 0.033166 0.632735 0.518336
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.427355 1.459300 0.495630 0.353091 0.700135 0.521773 1.357521 1.634783 0.618269 0.635700 0.393595
18 N01 RF_maintenance 100.00% 100.00% 49.65% 0.00% 10.229250 16.743830 9.740662 -0.800282 11.452051 8.489573 0.244817 17.347064 0.031249 0.225874 0.173793
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.991571 -0.908237 -1.131478 -0.929738 -0.438856 2.143692 -0.199792 2.523285 0.622586 0.641558 0.386363
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.826844 -0.890884 2.512184 -1.127570 0.531742 1.597094 1.187138 -0.766070 0.610503 0.641686 0.393962
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.131225 0.346381 -0.594708 -0.000403 0.677155 2.238457 0.163261 0.246821 0.607849 0.619921 0.384378
22 N06 not_connected 100.00% 100.00% 100.00% 0.00% 227.206519 227.019875 inf inf 5354.136047 5353.315302 8253.873220 8251.561253 nan nan nan
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.070129 11.111297 9.804536 10.169225 11.438105 13.321889 1.485927 1.071136 0.035563 0.038710 0.004228
28 N01 RF_maintenance 100.00% 0.00% 89.40% 0.00% 10.535613 23.406345 -0.213884 2.288644 8.316851 13.405791 5.176914 22.649542 0.358409 0.154958 0.271996
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
30 N01 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.489448 -1.226993 1.219303 0.897976 1.591360 -0.344008 0.251936 1.917870 0.635526 0.643253 0.382262
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.419152 22.569091 -0.115535 2.746305 -0.214700 1.041265 2.140431 14.816085 0.624975 0.533490 0.367325
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 226.835290 227.085705 inf inf 4797.307462 4738.459997 7070.387429 6865.015754 0.174924 0.134981 0.067124
35 N06 not_connected 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.450693 0.672689 0.643836
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 23.777789 23.815977 13.026077 12.905357 11.528456 13.144617 3.437073 3.361790 0.032905 0.030910 0.001879
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.198086 0.488451 -1.391681 0.776183 0.743870 0.621211 -0.664710 2.744391 0.616084 0.627916 0.401334
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.058389 -0.081513 0.192241 0.517266 -0.053133 1.025028 4.434554 0.164839 0.622735 0.636601 0.399764
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 9.084902 2.045467 9.422025 0.413120 11.364147 -0.980570 0.273311 -0.410809 0.038085 0.623268 0.480695
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.629492 0.080798 0.020076 0.000403 2.662704 0.361061 -0.230748 1.751217 0.627365 0.646051 0.377632
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.769623 -0.185679 4.836931 5.871718 -0.885728 0.087334 -0.487676 -0.758819 0.601867 0.610017 0.368772
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.111801 0.678109 -0.046490 0.599033 -1.082545 0.282156 -1.117166 0.159037 0.641283 0.644020 0.381339
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.874665 -0.138725 -0.499208 -0.605550 -0.297801 0.699067 -1.063972 -0.842049 0.634609 0.654675 0.384511
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.602915 2.843549 0.200012 0.560761 -0.842217 2.676734 -0.248497 1.466245 0.627138 0.637780 0.376598
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.098759 0.146025 -0.857859 -0.945303 -0.045343 -0.199624 -0.691203 -1.111389 0.631762 0.653202 0.399507
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.317832 12.384023 4.055615 4.110150 11.298991 13.146656 0.446935 -0.486498 0.032065 0.047606 0.011379
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.151670 0.762045 0.428946 2.020777 -0.611862 2.946145 0.448216 -1.350606 0.595796 0.615692 0.394404
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.003330 -0.187619 -1.037213 0.453787 1.112747 -0.730460 -0.137416 -0.363644 0.547523 0.597426 0.399185
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.407433 20.627110 0.294056 1.421560 0.549948 3.618046 12.955690 39.452493 0.598673 0.538715 0.372425
51 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 21.132197 4.002216 12.498756 -0.526400 11.622923 5.491134 6.496539 1.662286 0.038527 0.518987 0.395115
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.419783 5.976399 -0.340221 0.466071 1.393038 0.814629 0.690807 0.837103 0.627459 0.639992 0.391812
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.913442 2.719545 0.186780 0.323869 1.563460 2.291707 2.293952 2.909918 0.636421 0.649425 0.394416
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 25.581550 -0.866538 5.149288 3.068831 2.718995 -0.989435 2.989425 0.292370 0.441547 0.634385 0.377053
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.868083 12.335033 9.824374 10.293183 11.382874 13.220232 0.309882 1.534498 0.028359 0.032625 0.003878
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.014606 2.071105 5.581126 7.631844 1.570712 5.190716 -0.658795 0.730586 0.590731 0.561799 0.357351
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 19.175106 1.423947 7.548276 1.104238 9.072752 1.582681 22.545145 2.570876 0.422864 0.652291 0.415055
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.087514 11.479795 9.709517 10.295877 11.295245 13.200741 0.785721 0.319126 0.036792 0.036540 0.001905
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.875819 0.657983 9.266505 0.978597 11.070734 2.136896 -0.030767 5.410459 0.046151 0.642153 0.511924
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.282294 11.405414 -0.408987 10.323131 -0.695022 13.232416 0.366829 1.546613 0.625953 0.063226 0.511829
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.188506 0.222637 -0.751230 -1.493763 1.723024 -1.327398 -0.760296 -0.358486 0.576016 0.606704 0.382664
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.844453 0.429836 -0.729883 1.261087 -0.505630 -0.456512 2.354139 -0.999210 0.563760 0.617850 0.399883
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.004302 11.886591 -0.202423 4.502234 0.513545 13.340298 -0.546268 1.750410 0.596955 0.045177 0.486094
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.109836 0.246632 -0.815743 -1.067236 -0.562824 -0.907177 1.301076 -0.394559 0.580610 0.574459 0.373478
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.539234 1.184027 0.431983 1.071246 0.400109 0.743718 2.015758 0.839000 0.603987 0.622348 0.405034
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.633854 1.442231 -1.209476 -1.328406 3.716304 -0.030011 -0.654497 -0.549391 0.618889 0.640536 0.404127
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.518434 2.048793 -0.192436 1.269581 -0.329120 0.455691 -0.009535 1.453214 0.631335 0.630814 0.387886
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 18.273770 24.395218 1.091147 13.599396 5.852375 13.218667 -0.086767 7.692983 0.362671 0.030443 0.273644
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.748584 0.038825 0.279520 0.750311 -0.032275 1.781077 -0.574950 -0.532243 0.631095 0.652188 0.376514
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.692732 -0.311053 -0.079392 0.059806 0.937131 1.866251 -0.116648 -0.610934 0.643077 0.660055 0.377113
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.274636 -0.263262 0.687176 0.862428 0.738503 -0.400738 1.855032 0.321331 0.649506 0.663213 0.368295
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.453206 12.549289 10.191214 10.705711 11.131600 12.990404 0.287237 0.300179 0.032860 0.035443 0.003166
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.530954 0.942036 -1.309324 -1.155716 1.363696 -0.318645 -0.479516 -0.758599 0.649419 0.663642 0.377711
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.059791 -0.125197 -0.068669 -0.615573 0.298195 1.943044 -0.880853 2.132904 0.648271 0.658508 0.378329
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 53.861270 0.710771 0.553733 -0.296597 7.531313 -0.928279 14.187615 -1.231997 0.315331 0.611043 0.441770
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 31.244151 -0.299079 -0.417673 1.185950 2.786343 0.331521 1.532240 0.405467 0.426711 0.625225 0.384663
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.628399 12.163698 -1.457865 4.530499 -0.994346 13.121718 1.065867 -0.646207 0.584888 0.041243 0.464987
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.527102 12.929464 0.327270 4.428700 -0.565168 13.156943 -0.257576 0.556588 0.594349 0.046810 0.470615
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.445173 12.223074 0.159467 8.942722 -0.043648 12.806631 1.259966 0.944283 0.581002 0.038542 0.457865
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.595611 -0.134343 0.458630 2.125883 -0.602893 -0.901837 -0.583773 0.510494 0.600976 0.606534 0.383601
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.374581 -0.035883 0.253853 0.371146 0.629140 -0.003991 -0.523826 0.377180 0.613683 0.632189 0.388868
84 N08 RF_maintenance 100.00% 77.93% 100.00% 0.00% 18.433086 21.530900 12.669196 13.155803 9.664068 13.141264 3.054411 3.305678 0.188940 0.037191 0.122774
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.031539 0.571884 1.450959 1.362334 -1.058264 -0.425775 -0.648112 -0.685970 0.628022 0.646871 0.381171
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.452720 -0.141856 1.323312 1.604971 4.883890 -1.094086 0.416109 16.091319 0.620138 0.642384 0.362878
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.132020 6.750984 -0.595048 -0.316997 -0.139378 0.488136 0.264127 2.662919 0.647200 0.668632 0.370438
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.704099 0.203664 0.444594 0.647408 -0.218075 -0.274848 2.235756 0.324957 0.640658 0.658989 0.367066
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.354998 0.371167 0.057061 0.749088 -0.244215 -0.696580 -0.670344 -0.679593 0.646573 0.658591 0.369530
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.100074 -0.560539 0.854235 3.189288 -0.768264 -0.375102 0.134655 1.649791 0.638464 0.631268 0.367137
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.267905 -0.193033 0.426563 0.170727 -0.797053 -0.907416 0.767931 0.059740 0.637621 0.655615 0.384194
92 N10 RF_maintenance 100.00% 0.00% 19.20% 0.00% 31.937035 34.145909 0.392481 1.373454 6.676214 6.132179 0.857346 7.829334 0.284319 0.247526 0.066505
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.499578 -0.160168 2.269732 -1.176241 1.241402 0.566203 3.055612 0.397109 0.626776 0.648169 0.393653
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.376368 11.853417 9.937534 10.188782 11.284473 13.217700 0.464990 0.080532 0.033404 0.027485 0.003037
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.715840 -0.481081 -0.939939 0.991060 -0.493187 0.423439 0.307373 0.103872 0.596919 0.626910 0.394715
96 N11 not_connected 100.00% 0.00% 0.00% 100.00% 12.162769 6.171182 3.454164 5.027286 4.427948 10.568528 -2.125875 -3.222660 0.263123 0.214032 -0.254132
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.749340 5.246767 -1.126299 1.174969 -0.841664 3.714081 0.334764 6.072417 0.580577 0.533308 0.378407
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.721223 8.045894 -0.366744 1.169415 0.016464 1.607303 0.621258 0.774661 0.633485 0.646601 0.383247
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.451403 1.176865 -1.483491 -0.882609 1.031067 1.428983 -0.106092 7.715084 0.643932 0.656874 0.379516
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.009438 5.027692 5.676402 -1.291066 3.014445 0.843402 7.028419 5.289573 0.598694 0.662337 0.386756
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.941332 55.569623 -0.993735 6.993843 2.602876 -0.264214 0.560232 1.974187 0.651974 0.630674 0.370199
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.659510 0.076909 0.316077 0.790728 0.078082 -0.671827 -0.497048 -0.398717 0.646204 0.659524 0.365864
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.473376 1.386999 -1.395671 -0.659860 1.106884 -0.785108 0.314795 2.270142 0.648839 0.662552 0.365976
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 2.058863 1.103411 -0.114609 -0.481358 0.387139 0.136450 5.988609 4.266142 0.647488 0.664129 0.369155
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.522974 38.303644 9.746781 0.850732 11.369649 6.354622 1.030177 3.090384 0.035666 0.290557 0.169792
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 3.184130 11.461563 7.672882 10.045608 4.682356 13.303115 -0.451613 1.044119 0.502751 0.031992 0.350967
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 23.246338 23.159952 13.100916 13.368479 11.334271 13.036270 3.188678 3.180507 0.025919 0.028397 0.001540
111 N10 digital_ok 100.00% 0.00% 80.31% 0.00% 0.029000 10.539145 -0.391256 9.976124 -0.075032 12.520075 2.835324 1.148210 0.640011 0.179517 0.470164
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.785973 -0.343421 0.278408 0.242440 0.614947 3.633020 0.249794 -0.827389 0.627102 0.641632 0.396294
113 N11 not_connected 100.00% 0.00% 100.00% 0.00% 3.757594 12.715744 3.822539 4.515752 4.545467 13.042920 -2.682588 -0.003215 0.612913 0.068716 0.479454
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.394502 0.685307 0.767381 -0.076479 1.740925 -0.811133 -0.500329 0.109381 0.593428 0.607827 0.382144
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.888924 -0.628928 -1.030758 -0.405432 -0.048637 -1.218320 -0.565597 0.623211 0.568563 0.596213 0.392165
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.307978 12.854668 9.884840 10.660694 11.188398 13.184367 0.633688 2.467141 0.028931 0.033508 0.003279
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.037988 1.338310 -0.188209 0.486309 -0.308521 -0.196785 -0.115885 0.597481 0.609627 0.631146 0.394624
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.304767 1.789908 2.685555 -1.018155 -0.138757 1.575671 3.873517 2.093160 0.621962 0.656956 0.386028
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.614389 3.049574 -1.222864 5.893703 0.799640 -0.608460 12.073604 12.818672 0.645942 0.632923 0.367034
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.436176 6.253242 0.295393 0.878880 1.871422 1.540583 0.213575 -0.702181 0.637964 0.662660 0.374464
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.634335 8.397972 0.820134 0.936297 0.086545 -0.184726 -0.448637 0.013332 0.655103 0.669050 0.376176
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.350193 -0.102170 0.006406 0.558008 -0.164573 0.362155 1.051056 0.833023 0.653808 0.668652 0.377786
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.768448 -0.712605 -0.369562 0.676952 0.091111 -0.600446 0.040565 -0.104153 0.649238 0.658441 0.371128
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.633401 -1.053514 -1.245011 0.899385 5.061079 -0.609751 27.912101 -0.599642 0.647058 0.653032 0.374502
127 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.560707 0.108354 0.786988 0.711768 3.909088 11.305574 8.177435 16.690779 0.646452 0.660179 0.383470
128 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 1.300046 11.031637 7.257196 10.300547 3.135599 13.130989 -0.767002 0.085470 0.538520 0.034032 0.385503
131 N11 not_connected 100.00% 0.00% 3.95% 0.00% -0.759718 11.258324 -0.001622 4.346987 -0.681116 11.524603 -0.856227 -0.274992 0.612860 0.294796 0.432057
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.262629 2.368830 -0.636969 -1.410504 3.731511 -0.862911 -0.204753 -0.440960 0.589397 0.594296 0.373756
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.838033 0.246788 -0.844725 1.989809 -0.554394 1.616796 -0.598586 -0.759517 0.580988 0.616028 0.404684
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.374072 -0.883309 -0.924777 -1.473032 3.898267 1.129597 12.326898 0.606346 0.581776 0.613955 0.410765
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 8.713511 -0.199263 9.364877 -0.826781 11.459593 0.654715 0.958699 -0.766540 0.040401 0.614353 0.461080
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.110078 -0.483331 0.274487 -1.328212 2.638262 -0.318700 0.009535 -0.663933 0.590815 0.627177 0.399779
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.739262 -0.206119 1.616355 -0.775517 1.106804 -0.865844 -0.336032 -0.044347 0.620046 0.627532 0.377912
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.409838 -0.713990 -0.979479 -0.068838 -0.505065 -0.328337 3.352133 1.906845 0.637134 0.658045 0.378984
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.372594 -0.700603 -0.179426 0.805359 2.441244 -0.982457 0.535399 -1.235315 0.638960 0.664969 0.376729
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.490430 11.402933 -0.521974 10.328867 3.675516 13.279983 30.408991 0.804147 0.636745 0.044634 0.519729
143 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -1.250099 -0.059394 -0.673411 1.632620 -0.372655 7.803719 -0.365715 -1.116061 0.656598 0.664653 0.374502
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.226746 -0.618080 -1.171862 3.383882 0.608158 3.242913 -0.678638 -0.614261 0.655074 0.645933 0.373113
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.743450 11.560658 9.773288 10.362834 11.162616 13.363487 0.081186 2.044501 0.065589 0.032799 0.025294
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.191114 -0.584691 1.547178 -0.715961 1.236229 -1.318832 -1.421091 -0.710016 0.644362 0.646481 0.374964
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.502108 -1.563149 1.144570 2.320731 -0.622363 -0.940546 0.265002 0.289888 0.638670 0.644614 0.377261
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.208911 0.132491 -0.517598 -0.589422 2.203163 2.094121 -0.502782 -0.720086 0.640947 0.656080 0.390716
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.294127 -1.179276 -1.109651 -1.319214 -0.427439 1.667526 1.348640 0.749276 0.632652 0.649205 0.393533
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.267267 -0.660078 -1.132232 -1.195208 -0.916439 1.118809 0.429418 1.074251 0.630884 0.643560 0.394942
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 23.638954 0.966974 -0.091874 0.379099 2.963705 -0.491382 2.741060 -0.523379 0.476492 0.575592 0.345890
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.162168 -0.694765 9.519986 -1.478585 11.487791 0.171129 1.463241 0.943643 0.041151 0.614924 0.471958
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.464379 11.150583 7.946211 10.059451 5.342608 13.325456 1.054434 1.150532 0.421215 0.039049 0.330005
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.039904 -0.333110 0.018663 0.671306 -0.639828 0.102614 -0.413222 -0.310707 0.599272 0.624710 0.398040
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.070108 -0.101497 -0.047963 -0.504174 2.303774 2.646067 2.032642 9.583693 0.614910 0.640354 0.399147
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.361310 18.952777 -1.479758 -0.919995 0.297148 6.539588 -0.459707 74.143420 0.586122 0.541079 0.358150
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.689256 -1.043479 -0.244783 -0.672029 -0.623299 2.019558 0.717530 0.075632 0.627976 0.646690 0.382568
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.928115 26.475514 0.078038 -0.561977 0.131263 1.954130 -0.361542 0.347252 0.634859 0.516841 0.342874
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 2.111195 -1.045218 -0.876986 -1.163333 1.759168 1.789421 2.571603 -0.053808 0.637605 0.663392 0.381992
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.542798 1.047388 -0.163151 0.445013 -0.299987 0.878484 -0.462386 0.767402 0.649413 0.661153 0.381576
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.002053 0.297748 0.536199 1.483426 2.335272 2.755593 0.906661 0.616002 0.644809 0.656028 0.370516
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 30.581983 -0.072192 -0.458599 -1.031830 5.058029 0.218578 3.009166 -0.175993 0.509140 0.661629 0.373129
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.744462 2.628588 -0.354400 3.317900 0.551947 5.312056 3.174208 1.102978 0.642341 0.652303 0.376445
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.670873 -0.886124 -1.312348 -0.140425 1.855829 0.414572 0.808427 3.638086 0.648341 0.656470 0.382380
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.894559 -1.115900 0.343213 -0.385323 1.684299 1.242906 -0.454619 1.414379 0.637637 0.650848 0.388911
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.618448 -0.809532 -0.836582 -1.397531 0.451207 0.632015 -0.735213 -0.801568 0.637886 0.651854 0.391201
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.250529 -0.486015 10.089100 -0.921284 11.208074 0.776621 1.833113 7.039376 0.039573 0.646228 0.506967
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.686856 2.500647 -1.388561 -0.030279 -0.699477 2.455100 -0.518081 0.642182 0.576601 0.558473 0.363771
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 11.444849 11.876139 3.576557 4.119367 11.506949 13.299896 2.433809 3.900301 0.041145 0.044714 0.003409
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.969904 -0.470227 -0.085164 -1.296249 -0.412248 2.556335 -0.459667 -0.226846 0.581098 0.636794 0.398987
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.298778 12.100318 -1.525369 10.472718 0.872085 13.166304 14.834799 1.457110 0.630085 0.050306 0.527057
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.386556 -0.263422 0.442188 0.474670 -0.130638 -0.197500 -0.501336 2.966551 0.634187 0.646967 0.387186
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.295560 11.129543 -0.972856 10.027410 -0.311157 13.333377 8.295720 1.052128 0.643425 0.045279 0.496403
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.377748 0.438379 -0.074969 0.617146 1.495895 -0.441134 1.265778 0.630100 0.633532 0.649041 0.373645
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.014302 -0.566406 -1.487709 -0.448659 -0.386346 -0.096318 0.205073 0.151742 0.647396 0.661664 0.368739
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 34.528758 -0.137978 -0.333326 -1.453513 9.998417 0.566167 4.961621 0.128470 0.514633 0.658568 0.376119
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.990251 -0.548963 0.421719 -0.122726 -0.229581 -0.500612 -0.086723 1.879984 0.652079 0.664647 0.382763
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.810195 0.537642 -0.815478 1.924352 1.330997 0.712529 5.289929 -1.361488 0.639703 0.653957 0.375768
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 8.599848 11.024380 9.338548 10.157896 11.684418 13.371837 4.197399 2.018643 0.029099 0.033343 0.002296
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.130569 -1.257285 -0.635984 0.551256 -0.793685 0.110434 -0.582058 -1.174881 0.629720 0.651412 0.400499
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.588896 0.369116 1.362703 -0.430120 0.439332 0.517633 8.070874 0.312452 0.614975 0.633618 0.395871
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.793841 6.437951 5.033042 5.114646 8.554926 10.572358 -3.092700 -3.349308 0.577150 0.592659 0.386719
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.635262 0.518548 5.237961 1.835674 9.011731 3.602178 -3.018480 -0.381372 0.561445 0.602409 0.414497
200 N18 RF_maintenance 100.00% 100.00% 81.67% 0.00% 11.129608 29.523067 3.994953 1.377396 11.489479 7.961661 0.904519 16.925031 0.043023 0.167406 0.102860
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.405816 4.527394 3.206799 4.426091 3.782475 8.574026 -0.134632 -2.512770 0.620211 0.620008 0.383480
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.613629 3.268717 1.732693 -1.257674 1.284206 0.071780 -0.332826 24.243236 0.627079 0.609767 0.379659
205 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.959016 2.243470 0.108234 -0.307144 -1.002261 -0.094081 -0.812448 3.052436 0.621740 0.608149 0.372018
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.744837 2.741664 2.605326 -0.715555 6.047652 0.644669 -1.112860 3.247757 0.625640 0.608864 0.377514
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.687574 3.014106 1.444884 -1.390322 1.312151 5.538901 -0.518850 0.208715 0.606193 0.595283 0.357593
208 N20 dish_maintenance 100.00% 100.00% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.123661 0.560183 0.481940
209 N20 dish_maintenance 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.865878 0.771901 0.812877
210 N20 dish_maintenance 100.00% 99.95% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.524975 0.039987 0.485616
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.868881 2.255865 -1.223219 0.169237 -0.336788 0.038978 2.794425 -0.112100 0.571600 0.589673 0.375665
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.245437 -1.133220 0.486883 -0.233640 -0.544519 0.544866 3.117942 -1.117523 0.612520 0.621356 0.380904
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 1.058542 -0.129576 -1.338042 -0.546044 0.066419 -0.642640 9.678858 -0.859934 0.593599 0.626886 0.386719
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.484031 -0.150133 -0.278554 0.313991 -0.186398 -0.060850 2.580396 -1.257567 0.606124 0.634790 0.386911
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.941421 1.618700 -1.374884 0.784575 0.442430 -0.155889 0.747079 0.223864 0.595102 0.632373 0.388387
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.747941 6.025703 5.332502 5.096135 8.965285 10.479202 -3.105822 -3.285637 0.593678 0.612382 0.379771
225 N19 RF_ok 100.00% 0.00% 90.64% 0.00% 1.257629 11.650124 0.893418 4.300127 -0.809611 12.982375 -1.104904 0.674271 0.619224 0.137098 0.517856
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.246253 3.221226 0.154098 1.576215 -0.790287 5.337468 -0.780966 -0.935151 0.612008 0.612691 0.380692
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.638870 0.386547 -1.468870 0.235960 0.410648 -0.434216 13.232449 -0.085047 0.572551 0.611698 0.374862
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.725775 15.543950 -0.871511 -0.060205 0.949173 5.058234 22.272254 57.694106 0.538577 0.520641 0.330401
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.717580 -0.043648 1.659634 1.533104 0.334462 1.378514 0.015539 -1.479954 0.594255 0.611338 0.393513
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.690218 0.022695 -0.082095 -1.421761 0.071161 -0.896786 -0.375544 -0.980692 0.545511 0.600781 0.399684
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.003330 -0.277527 1.450091 0.953084 0.124901 -0.503451 -1.612377 -1.785079 0.606985 0.620654 0.393135
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.774410 -0.947233 0.532033 0.686612 0.003991 -0.809700 1.152813 0.692486 0.605596 0.623671 0.389881
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 27.012668 49.134808 0.444876 0.892985 4.360565 7.804958 6.824859 18.026998 0.470074 0.397313 0.260163
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.827902 3.528889 -0.770569 0.450482 -0.772673 0.827501 4.430933 12.426372 0.593944 0.574493 0.382266
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 36.575970 1.267978 -0.062486 1.502041 11.394666 1.234864 32.340246 -0.754699 0.399092 0.626818 0.426498
243 N19 RF_ok 100.00% 24.28% 0.00% 0.00% 56.486614 2.196902 0.933218 -1.355351 8.970589 -0.853780 -1.199312 -0.282749 0.250948 0.599126 0.480227
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.537921 1.902543 1.352231 -0.887064 3.218887 1.158603 2.590844 6.243847 0.475819 0.576965 0.385775
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.420457 1.942908 -0.343521 -1.418694 -0.746930 -0.904183 -0.788034 -0.069138 0.585267 0.590031 0.383771
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.415111 7.011561 -1.076139 -0.234327 5.858846 5.781244 2.438676 -0.460667 0.316457 0.317931 0.158466
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.291967 1.433232 0.725284 -0.316253 -0.722154 -0.911993 -0.680152 -0.247772 0.584899 0.589604 0.387390
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.110977 7.859284 8.976277 9.190457 11.671975 12.121277 9.706442 15.422326 0.033410 0.029305 0.003703
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 5.796140 11.912586 2.573977 6.636904 1.300843 13.338290 29.546019 1.682372 0.434624 0.046664 0.348142
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.162121 2.193142 1.210802 1.688362 0.611531 1.600404 0.687277 -0.564768 0.494362 0.510986 0.377311
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.385212 -0.969429 1.321161 -1.182164 1.146055 -0.830910 -1.110353 -0.330385 0.526390 0.527853 0.389471
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 4.700441 -0.400256 1.204626 -0.868811 2.954899 -0.744612 2.603700 0.878901 0.411187 0.517708 0.383997
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.178922 1.947057 -0.565055 -1.421841 0.242704 -0.433822 0.909905 0.762273 0.452865 0.497729 0.371906
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, 9, 10, 15, 16, 18, 22, 27, 28, 29, 30, 32, 34, 35, 36, 38, 40, 42, 47, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 77, 78, 79, 80, 81, 84, 86, 87, 92, 94, 96, 97, 101, 102, 103, 104, 107, 108, 109, 110, 111, 113, 117, 120, 121, 122, 123, 126, 127, 128, 131, 135, 136, 142, 143, 145, 151, 155, 156, 158, 159, 161, 165, 166, 170, 173, 179, 180, 182, 185, 187, 189, 191, 192, 193, 200, 201, 202, 206, 207, 208, 209, 210, 221, 224, 225, 226, 227, 228, 240, 241, 242, 243, 244, 246, 262, 320, 329]

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

golden_ants: [17, 19, 20, 21, 31, 37, 41, 44, 45, 53, 65, 66, 67, 69, 70, 83, 85, 88, 91, 93, 105, 106, 112, 118, 124, 140, 141, 144, 146, 147, 148, 149, 150, 157, 160, 162, 163, 164, 167, 168, 169, 171, 181, 183, 184, 186, 190]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459971.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 [ ]: