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

Figure out some general properties¶

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

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

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

Load a priori antenna statuses and node numbers¶

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

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

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

Summarize auto metrics¶

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

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

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

Summarize ant metrics¶

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

Summarize redcal chi^2 metrics¶

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

Get FEM switch states¶

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

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

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

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

Find X-engine Failures¶

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

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

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

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

Build Overall Health DataFrame¶

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

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

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

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

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

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

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

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

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

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

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

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

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

Table 1: Overall Array Health¶

In [18]:
HTML(table.render())
Out[18]:
JD 2460061
Date 4-26-2023
LST Range 13.853 -- 15.783 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 359
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas 40, 42, 70, 112
Total Number of Nodes 19
Nodes Registering 0s N15
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 64 / 198 (32.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 108 / 198 (54.5%)
Redcal Done? ❌
Never Flagged Antennas 88 / 198 (44.4%)
A Priori Good Antennas Flagged 52 / 93 total a priori good antennas:
7, 15, 17, 19, 31, 37, 38, 40, 42, 53, 55,
65, 66, 67, 70, 72, 81, 83, 86, 93, 94, 101,
103, 109, 111, 112, 118, 121, 123, 124, 127,
136, 147, 148, 149, 150, 151, 158, 160, 161,
165, 167, 168, 169, 170, 181, 182, 184, 189,
190, 191, 202
A Priori Bad Antennas Not Flagged 47 / 105 total a priori bad antennas:
8, 22, 35, 36, 46, 48, 49, 50, 52, 62, 80,
89, 90, 95, 102, 113, 114, 115, 120, 125, 126,
132, 133, 135, 139, 179, 185, 201, 206, 220,
221, 222, 224, 228, 229, 237, 238, 239, 240,
241, 244, 245, 261, 320, 324, 325, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2460061.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.070950 11.269597 -1.043681 -0.573247 -0.357183 0.910692 -0.796705 2.241296 0.505832 0.388689 0.340352
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.219404 0.357976 0.410562 3.236276 0.502233 0.356116 -0.248799 0.631138 0.512286 0.491729 0.341675
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.651027 0.052322 -0.393982 0.267281 0.362236 -0.133924 2.930849 7.282628 0.520818 0.508860 0.338783
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.585542 1.613087 1.182900 1.093358 0.276148 0.362878 -1.802984 -1.665771 0.491522 0.483409 0.317092
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.554306 -0.355220 2.985103 -0.272373 0.656959 0.520668 1.661965 -0.318808 0.495520 0.507765 0.326771
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.771724 -0.690258 -0.487697 -0.394065 -1.233024 1.151246 -1.060007 0.380618 0.504960 0.495423 0.331505
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 10.302870 -0.277741 -0.610908 -0.413530 -0.397801 0.309738 -0.331467 1.279223 0.405735 0.512134 0.332350
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.037154 1.186561 0.302544 0.831737 -0.779946 -0.049395 -1.408285 -1.788820 0.513862 0.499155 0.336390
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.026259 2.593187 0.903633 7.853460 0.533843 -0.720583 0.052172 3.983060 0.516165 0.379078 0.368947
18 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.198862 0.113566 -0.172667 3.227163 -0.056786 2.442811 -0.358771 6.711151 0.526680 0.514720 0.336039
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 3.252097 -0.868552 1.850979 -0.327444 3.416861 0.115124 1.798681 -0.111483 0.513255 0.526200 0.323848
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.166864 0.611711 0.097632 0.432712 0.850504 3.333371 0.269644 0.546535 0.512732 0.512587 0.324388
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.008523 -0.919743 -0.992965 -1.088743 -1.038070 -1.022864 -0.499648 -0.510835 0.488930 0.487582 0.321886
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
28 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.671941 0.003580 -0.076874 0.169914 0.930301 0.821389 1.282361 3.208830 0.532416 0.531804 0.333716
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.053159 -0.718925 0.479740 -0.573030 2.079535 -0.336100 1.693115 -0.128663 0.535207 0.538199 0.336256
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.341143 -0.247872 1.131968 2.683359 1.464541 0.667431 0.228626 22.428478 0.543422 0.529540 0.341620
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.977440 13.312489 0.016870 0.095649 -0.316981 1.029478 3.634189 4.433684 0.432398 0.458854 0.179852
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.589072 -0.615622 5.048872 -0.759027 2.198380 -1.060462 0.797757 0.073250 0.040965 0.506306 0.367783
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.793937 -0.517506 -0.474396 -0.288144 -1.034377 0.490791 0.346477 0.620315 0.503330 0.492458 0.328175
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.429194 3.753896 1.117273 0.878360 0.379433 0.811339 0.551053 1.278830 0.510233 0.499329 0.337213
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.659857 15.095024 -1.031364 11.539875 -0.883377 1.842050 -0.744044 3.023280 0.516069 0.029758 0.413708
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.075059 -0.181570 -0.074783 0.355479 0.485530 0.389491 3.266891 8.555947 0.516745 0.512911 0.330371
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.184081 0.965694 0.121949 -0.185480 -0.228439 1.588591 18.549726 0.793610 0.199816 0.195679 -0.280100
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.481412 0.818910 1.348274 1.821903 0.617238 0.312018 0.000486 0.246268 0.537581 0.535708 0.338926
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.257866 1.443566 -0.278484 -0.449779 -0.488097 1.569040 -0.042616 1.584161 0.218507 0.207387 -0.280954
43 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.727108 0.425234 -0.697999 0.562439 -0.811797 0.324792 -0.594073 0.044791 0.548535 0.553149 0.343281
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.478931 0.871964 0.822708 0.874278 0.448566 0.910956 0.093867 1.540260 0.537880 0.540912 0.337763
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.300927 -0.599549 0.125524 -0.892850 0.486901 -0.175298 -0.176920 -0.364063 0.531170 0.544183 0.335915
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 7.033502 8.667433 4.976561 5.075566 2.219165 1.810005 1.766463 0.565635 0.030930 0.053680 0.016292
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.178942 -0.012597 -0.906266 0.051208 -0.145500 -0.576268 1.740114 -1.263898 0.507403 0.512010 0.318378
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.215146 -0.733657 0.638121 -1.081968 0.244377 -0.727376 0.067076 2.068620 0.479994 0.496523 0.315714
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.004734 0.605120 0.448620 1.604068 -0.013421 0.840223 -0.103780 0.160108 0.500029 0.490345 0.329460
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.760702 0.620987 0.238845 -0.123082 2.722606 0.179260 87.959935 0.179452 0.511098 0.510570 0.328915
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.319188 2.760006 0.655876 0.459086 1.364764 0.517613 2.266040 0.381662 0.533249 0.525706 0.336040
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.058559 0.161238 0.016353 -0.940043 1.390782 -0.432640 8.267002 5.593163 0.541516 0.535362 0.339941
54 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.168197 1.450334 0.958394 -0.611080 0.587959 1.221765 -1.244411 -0.644019 0.317292 0.354381 0.158724
55 N04 digital_ok 100.00% 49.30% 100.00% 0.00% 0.119989 29.779815 -0.065750 6.547820 -0.407475 1.728216 1.083908 0.432002 0.212326 0.038224 0.067931
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.058130 2.298130 -1.019049 1.629536 -0.973996 2.920314 -0.231008 1.726343 0.547249 0.531144 0.330564
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.576900 4.663897 -0.926350 -0.321760 0.040455 1.123043 0.031832 1.385622 0.550045 0.537047 0.329989
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.288841 8.157309 8.929214 9.481060 2.379883 2.037604 1.810930 1.810937 0.035362 0.035125 0.002410
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.972956 0.749496 8.952699 1.229295 2.157981 0.704026 0.510086 6.739975 0.043155 0.549027 0.401694
60 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
61 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.474790 -0.659285 4.767268 -0.341236 2.185577 0.186599 -0.019420 0.329662 0.033574 0.517615 0.367734
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.288615 -0.045816 0.428802 -0.129627 0.438659 -0.959769 0.511327 -0.977418 0.491579 0.516876 0.316438
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.619805 8.415626 -1.060195 5.390834 -0.881205 1.886997 -0.378758 2.092544 0.512946 0.043252 0.399516
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.500030 -0.382979 -0.737715 0.180696 -0.975226 0.088729 0.555515 4.337651 0.499910 0.488130 0.320854
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 14.634774 13.844523 11.240008 11.342562 2.186199 1.907389 3.206808 4.500093 0.023591 0.029650 0.006965
66 N03 digital_ok 100.00% 66.02% 100.00% 0.00% 1.384714 14.293245 0.896950 11.472919 0.584131 1.840957 -1.736137 4.529200 0.188263 0.043904 0.090374
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.637803 0.162178 -0.201797 1.424945 -0.508583 1.509945 4.730495 1.759167 0.530161 0.523910 0.332365
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 15.557439 -0.256825 11.297380 -0.271788 2.154452 -0.716917 3.809088 -0.473678 0.031547 0.535371 0.426721
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.677041 2.017153 1.300748 -0.368626 0.375225 2.551362 1.449956 1.201503 0.550454 0.549143 0.333772
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.147694 1.640989 1.123398 2.619389 0.289125 1.214318 2.827664 0.543855 0.227459 0.210850 -0.274419
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.960668 -0.120311 -0.170752 0.444682 0.530738 0.457748 -0.479766 0.827909 0.560999 0.561005 0.339517
72 N04 digital_ok 100.00% 28.13% 100.00% 0.00% 0.322504 8.263581 1.979837 9.601814 -0.078935 1.461072 15.036835 1.082282 0.227584 0.080564 -0.001474
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.548894 0.841860 -0.474605 0.409964 0.037933 3.976814 0.234303 3.783867 0.564658 0.565065 0.349149
74 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 26.709617 7.083393 0.272237 -0.754937 0.325963 -0.156977 4.692500 0.523407 0.324359 0.447484 0.248229
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 13.685348 -0.113084 0.056165 0.022294 -0.199164 -0.747855 0.330004 -0.274823 0.381746 0.522720 0.312109
79 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.233409 -0.619380 0.865588 -0.637493 0.323687 0.075662 4.092812 0.429931 0.490708 0.510347 0.321468
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.680833 1.159909 -0.718980 0.877922 -0.973638 0.093210 -0.917819 -1.468511 0.510527 0.496578 0.332714
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 45.964276 25.190335 22.725250 19.633880 23.014485 15.876316 375.583523 252.851829 0.017584 0.016441 0.001164
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 21.893020 53.574392 20.886701 29.022966 20.299881 48.977998 361.537298 653.050132 0.016393 0.016260 0.000757
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 24.037858 25.126649 22.327092 21.349548 37.635044 19.305083 492.857233 362.369958 0.016214 0.016301 0.000723
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.122284 15.460843 0.524950 11.553999 -0.732624 1.787432 -1.390073 3.787943 0.527141 0.045360 0.405974
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.390006 -0.194604 -0.556594 -0.545343 -1.642145 -0.294462 -1.056906 -0.317049 0.547125 0.546227 0.331694
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.339892 0.562430 0.533919 0.312130 -0.505819 0.109572 0.307247 6.978568 0.553765 0.550599 0.326550
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.181897 2.197844 2.065350 -0.884870 22.907150 0.474282 2.674236 -0.055847 0.520230 0.568063 0.330260
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.095627 1.067496 0.779194 1.236990 0.442150 -0.355152 -0.171538 0.115763 0.561856 0.561613 0.328961
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.524035 0.340489 0.731895 1.179936 0.777712 0.532436 0.604108 0.998980 0.559475 0.559824 0.335495
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.465222 -0.872152 0.036750 -0.986608 0.188960 -0.975175 0.015573 0.463904 0.554934 0.563859 0.340437
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.015553 0.440915 0.888790 0.760087 1.090076 0.600549 -0.151919 0.018655 0.541873 0.556209 0.340421
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.635646 0.267311 8.947919 0.638201 2.226749 1.624400 0.380080 0.606559 0.033462 0.551830 0.387278
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.829913 8.311785 9.013127 9.548932 2.196101 1.822861 1.880763 1.663567 0.029131 0.024981 0.002145
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 7.192502 0.891529 9.100087 6.283086 2.195008 1.029631 0.707717 1.706336 0.027499 0.473232 0.323665
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.644756 -0.735697 0.039876 -0.514133 1.082759 -1.207901 2.168902 -0.541745 0.497991 0.522356 0.327077
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.097054 11.749087 0.076948 -0.566251 -1.608200 -0.018987 -1.380866 -0.250167 0.512721 0.425036 0.310904
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.934723 1.269383 -0.710036 0.532787 -0.286119 -0.666541 1.585028 7.173287 0.501556 0.485832 0.323328
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.712343 3.947986 0.261924 1.156402 0.615228 0.885894 -0.148000 0.230977 0.533813 0.532782 0.333252
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.951626 0.142161 -1.056266 -0.555749 -0.254553 -0.797466 -0.777503 3.664366 0.550828 0.548449 0.329192
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.572149 2.225522 0.928350 -0.104280 1.309183 0.296487 8.035723 8.079349 0.549304 0.556208 0.322908
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.992949 31.184392 0.674699 5.698703 2.203228 -0.281284 0.813325 0.986770 0.551494 0.542600 0.327063
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.026415 0.396848 0.593991 1.198021 0.869244 0.345547 0.111906 0.401350 0.566745 0.565713 0.333800
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.110985 0.727297 0.120476 0.313187 -0.767168 -0.438888 0.239055 -0.055378 0.561377 0.566513 0.330028
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.407974 0.983521 -0.016186 -0.452182 0.555545 0.774877 0.956299 1.632229 0.555758 0.558900 0.327820
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.256333 1.594090 1.178755 2.261079 -0.208280 0.683074 18.536198 0.344271 0.549037 0.558961 0.335175
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.490957 8.208620 9.006222 9.332049 2.234460 1.957889 1.040230 2.042563 0.059533 0.034287 0.017123
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.588434 -0.160096 0.790708 0.102127 -0.126363 1.266905 0.167228 -0.153994 0.439843 0.551515 0.322765
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 4.865782 8.135500 0.916099 9.396364 5.828539 1.836837 17.112747 2.016510 0.499068 0.059922 0.377888
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% -0.064366 3.505199 1.394685 8.151564 0.813875 -0.431678 1.804626 1.707421 0.205506 0.140566 -0.227931
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.679854 2.335285 1.695325 1.569683 1.074247 1.119398 -2.423109 -2.223134 0.497242 0.487919 0.317139
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.072876 3.246144 1.380613 3.578909 0.437907 -0.577767 -1.895219 1.211503 0.488897 0.408470 0.320458
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.956964 -0.971819 -0.650986 -0.736153 -0.241890 -1.094625 -0.414618 -0.793222 0.489559 0.491071 0.316297
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 20.423525 33.152014 19.571460 23.537828 16.085772 35.819896 252.997684 483.415976 0.017346 0.016229 0.001248
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 18.918013 28.161063 20.480428 21.869083 24.830559 30.337272 421.243114 436.337749 0.016409 0.016312 0.000809
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.385435 0.702589 2.542518 -0.328587 0.938408 0.168249 1.279503 -0.283984 0.534725 0.545964 0.330080
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.509100 1.788806 -0.658182 4.979685 0.174502 1.074502 11.516729 9.025811 0.554969 0.536194 0.332026
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.252966 2.421527 -0.209035 -0.634233 0.646293 -0.021377 -0.333343 -0.465516 0.563612 0.566352 0.332025
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.117654 4.166419 0.989795 1.188017 1.400018 0.273808 -0.033597 0.528269 0.566355 0.571863 0.334729
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 6.707379 0.470430 9.135422 0.867082 2.172808 0.433201 0.513312 0.295832 0.039705 0.574205 0.395738
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.463494 -0.416630 2.435850 1.253655 0.763616 0.013421 1.010721 0.208061 0.555489 0.566432 0.336624
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.293863 0.928006 0.213843 1.166706 -0.317022 1.834778 0.836508 1.210188 0.558917 0.562515 0.339646
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.424330 -0.971395 8.942375 -1.063904 2.228381 -0.041236 0.314189 -0.293051 0.033750 0.557164 0.391712
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.028953 -0.649807 -0.412263 -0.818242 0.031647 -0.379500 0.258754 2.150125 0.539218 0.545785 0.343037
131 N11 not_connected 100.00% 0.00% 53.48% 0.00% -1.030760 7.862081 -0.843161 5.264009 -0.309145 1.329509 -0.898148 0.471557 0.528731 0.216766 0.382389
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.092242 -0.228949 -0.892633 -0.470916 -0.621940 -0.371898 -0.554091 -0.089408 0.513510 0.500357 0.325413
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.188666 -1.062789 -0.527143 -1.043484 -0.664924 -0.466759 -0.266609 0.050478 0.499236 0.501904 0.322484
134 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.321497 1.533358 2.365380 1.064285 -0.797499 0.731722 5.102635 -1.740606 0.421158 0.470905 0.317700
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.653324 -0.848743 -0.422505 -0.743035 1.852048 -0.230049 0.104289 -0.017955 0.482127 0.484981 0.325656
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 6.096111 -0.546028 8.723832 -0.083622 2.233365 -0.355057 0.954506 0.022648 0.036801 0.493037 0.354771
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 19.418848 35.771106 19.847910 20.839259 22.836016 19.656234 374.026769 359.793590 0.016398 0.016313 0.000795
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.190860 -0.370396 0.044496 -0.812427 -0.889051 -0.788116 -1.295470 0.669660 0.518817 0.519400 0.321227
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.106645 -1.023573 0.101089 -0.988793 -0.671497 -1.079011 1.941673 1.791166 0.543073 0.548255 0.323999
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.236851 -0.691512 0.243315 -0.451257 1.076035 -1.233494 -0.052451 -0.995067 0.553578 0.551939 0.324669
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.263918 8.205059 -0.128173 9.515033 1.160335 1.839443 15.433436 1.454317 0.559518 0.044343 0.457734
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.892632 7.989003 8.817758 9.486941 1.939623 1.884565 0.523444 1.498920 0.115374 0.031337 0.071234
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.009936 -0.586123 -0.257167 -0.074961 0.804641 -0.369780 -0.408723 -1.129659 0.566185 0.562182 0.336088
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.003580 -0.007618 0.003038 0.150015 0.476148 0.150611 -0.000486 0.280093 0.559618 0.559040 0.330666
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.431891 -0.958378 -0.748698 -1.037178 -0.995330 -0.687396 -0.288279 -0.401629 0.536014 0.547942 0.337127
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
149 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
150 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 9.127082 -0.428505 -0.653749 1.201191 -0.521231 1.418915 -0.563808 8.153999 0.414924 0.486103 0.293889
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.405679 -0.768307 8.842948 -0.306830 2.237751 0.063511 1.604341 0.378450 0.038242 0.486249 0.360082
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.436749 8.085727 6.373845 9.370228 -1.064558 1.864137 3.745030 1.672008 0.407200 0.036685 0.309574
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.410754 0.122290 0.590221 0.910455 -0.172107 -0.237764 -0.115333 0.147648 0.500551 0.504782 0.330854
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.493104 -0.711081 -0.799957 -0.813280 -0.175982 -0.006789 3.308525 10.639629 0.518935 0.521851 0.335687
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.107810 10.082499 -0.019508 -0.051113 -1.094274 0.464401 -0.139032 0.372331 0.498821 0.423621 0.306908
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 6.995296 -0.419025 8.927717 -0.093837 2.199947 0.561070 0.497669 0.166724 0.043160 0.543639 0.425955
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.307301 16.741161 0.528131 0.531995 0.808240 -0.645798 -0.158734 0.454540 0.543906 0.440781 0.306957
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.486515 -0.878802 -0.683576 -0.946155 -0.270781 0.217469 0.583293 -0.416886 0.556365 0.560990 0.330343
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.233803 0.858955 0.432585 0.777614 0.933836 1.061428 0.070982 0.783585 0.562737 0.566166 0.337935
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.251211 0.851493 0.856730 1.292897 -0.069268 2.275582 1.075315 1.065959 0.560227 0.560983 0.328441
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 11.750225 -0.104616 0.555087 -0.079988 0.336612 0.289282 1.257719 -0.153227 0.455088 0.560393 0.318167
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.157669 -0.579411 1.045636 -0.354549 0.631976 -1.096558 0.153452 -1.078595 0.554167 0.553821 0.330713
167 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
168 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
169 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
170 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.239487 -1.257960 0.590704 -1.091431 -0.108408 -1.157003 -0.088817 0.413638 0.483436 0.500898 0.327165
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.786917 0.151186 1.188414 -0.058819 0.354579 -1.113405 -1.941027 -0.463757 0.500185 0.496653 0.331141
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.734300 2.484596 1.751337 1.636105 1.360367 1.215689 -2.465649 -1.877096 0.466516 0.451028 0.314042
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.524303 -0.693431 -0.003038 -0.338264 -0.320928 1.959205 -0.298427 1.822040 0.517686 0.521324 0.337196
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.297308 8.580283 -0.577141 9.598668 -0.081290 1.831082 10.442669 1.836356 0.532500 0.050773 0.434959
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.950533 0.496294 1.364872 1.055168 1.655575 0.285705 0.009423 5.038612 0.545014 0.544879 0.338407
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.614974 8.051344 -0.818331 9.318564 -0.760840 1.852161 1.035658 1.839302 0.552954 0.046149 0.417778
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.433140 0.769873 0.672650 1.014330 1.588010 0.324200 0.298516 0.289959 0.555897 0.552357 0.328498
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 9.208733 -0.093075 7.360275 0.043680 0.343517 1.714374 1.017654 -0.018607 0.322692 0.560085 0.363315
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.137376 -0.038072 -0.523046 0.130221 -0.160458 0.092602 2.202210 0.363151 0.561436 0.557375 0.335863
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.034705 -1.014575 -0.510430 -1.005761 -0.834727 -0.931864 -0.887748 -0.520617 0.556064 0.556252 0.334020
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.083158 -0.942136 -0.116603 -0.727718 0.773018 -0.440170 2.120866 -0.388509 0.544403 0.540991 0.332635
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
190 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
191 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.250629 2.616960 1.501581 1.718068 0.705338 1.255292 -2.228451 -2.379382 0.476225 0.455089 0.316447
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.928248 2.207185 1.862136 1.513162 1.480505 1.120088 -2.541325 -2.226258 0.460250 0.452538 0.311732
200 N18 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.607104 18.489924 4.916816 0.224072 2.222941 0.519297 1.200826 1.885435 0.038284 0.244849 0.164796
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.200080 1.911105 0.889537 1.400771 -0.187945 1.001717 -1.579603 -2.120352 0.518435 0.498116 0.330580
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.050818 -0.137656 0.077229 -0.198674 -0.882998 0.513860 -1.307970 26.070965 0.531640 0.522100 0.322675
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.641498 6.531438 1.553088 -0.433157 1.733994 0.777153 15.419383 0.891808 0.547562 0.546945 0.329465
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.876572 -0.600765 4.064227 -0.390404 0.126840 1.405144 2.082259 2.621360 0.341177 0.535088 0.377054
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.633990 2.231956 1.144158 2.893110 0.234644 -1.029146 0.029126 0.601339 0.487507 0.443600 0.305508
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.368889 -0.899950 -0.888102 -1.013258 -0.457907 -0.397356 4.516800 -0.592030 0.505392 0.521935 0.323041
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.070896 8.431448 -0.513580 5.387142 0.482398 1.820816 -0.060681 1.044062 0.490498 0.037505 0.408631
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.770594 -0.912354 -0.556669 -1.083595 -1.363968 -0.604508 1.008814 -0.679321 0.518669 0.508330 0.326796
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.635170 -0.694462 -0.781074 -0.944859 0.048705 -0.299389 3.253427 -0.403909 0.517272 0.521207 0.325121
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.449796 -0.680277 -0.888684 -0.717060 -1.266324 -1.232652 1.351152 -0.881188 0.524503 0.525332 0.325539
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.986988 -0.009852 -0.272591 1.245494 -0.381234 0.325657 -0.084409 12.744958 0.518967 0.496050 0.322260
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.191522 2.459601 2.046754 1.680720 1.730629 1.228575 -2.662445 -2.243879 0.486376 0.486867 0.306661
225 N19 RF_ok 100.00% 0.00% 98.33% 0.00% -0.399409 8.015196 -0.310825 5.191660 -1.172034 1.618592 -1.065508 1.388979 0.523138 0.138055 0.417837
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.701076 8.326045 -1.065670 -0.573463 -0.864521 -0.217621 -0.717777 -0.523321 0.517025 0.433006 0.319049
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.447994 -0.554352 2.329885 -0.693138 -0.156773 -0.224435 7.863947 0.386482 0.437734 0.497073 0.334300
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.120622 -0.379749 -0.280067 -0.453350 -1.206794 -0.440185 -0.098571 0.528936 0.500214 0.488105 0.317458
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.113109 -0.031098 -0.317552 0.009767 -1.039670 -0.632515 -0.734849 -1.296417 0.494128 0.485515 0.325433
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.105162 -0.755293 0.676331 -0.594796 0.601173 0.126917 0.755774 -0.387970 0.467853 0.492138 0.330108
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.387609 -0.647280 -0.228533 -0.439142 -1.616010 -1.018039 -1.164941 -1.061958 0.511436 0.501715 0.335707
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.747590 -0.583909 -0.648512 -0.555275 -1.222136 -1.069104 -0.665011 0.724732 0.511864 0.506009 0.329716
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.835640 -0.376777 1.119061 -0.883534 -0.154338 -0.677484 1.457435 0.753971 0.478911 0.509613 0.334041
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.296693 -1.116122 -0.994200 -0.742848 -0.644204 -1.070890 0.145271 -0.835740 0.513820 0.508042 0.330581
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 9.264843 -0.288862 -0.650057 -0.144026 -0.638914 -0.895193 -0.190440 -0.785788 0.411701 0.502960 0.316568
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.406283 -0.857595 -0.240557 -0.528194 -0.312852 -0.124927 -0.706627 -0.106548 0.418583 0.496848 0.318033
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.234358 -0.639539 0.117370 -0.293403 -0.247450 0.103869 1.549977 2.936902 0.488534 0.493554 0.312961
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.303755 -0.426522 -0.162530 -1.053428 -1.542594 -0.707563 -1.331075 0.336261 0.498622 0.487860 0.320385
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.585105 8.762365 -0.924755 5.036796 -0.120662 1.844515 -0.510467 0.462279 0.488505 0.036737 0.402121
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.669741 -0.633115 -0.641857 -0.996064 -1.232215 -0.880041 3.030410 -0.434951 0.488840 0.477688 0.320298
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.521406 7.345540 0.417816 0.554881 1.150840 2.181785 -0.083136 0.980517 0.496569 0.485570 0.330857
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.348940 0.092388 0.717825 -0.021324 -0.328911 -0.373933 -1.651181 -0.241382 0.391615 0.375477 0.292876
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.860516 0.910296 -0.043910 0.061064 -1.178024 -0.487471 -1.139327 -1.255212 0.380671 0.366795 0.277396
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.210627 -0.876019 -0.141522 -0.485190 -1.293644 -0.719289 -1.260740 0.009934 0.411886 0.394361 0.303583
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 7.430791 8.398165 4.853529 5.506366 2.155211 1.788529 0.461983 0.469335 0.039090 0.037231 0.002059
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.085178 0.151939 -0.004205 -0.426538 -0.173635 -0.150103 1.398150 -0.070523 0.383983 0.382583 0.278558
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [4, 7, 15, 17, 18, 19, 27, 28, 31, 32, 34, 37, 38, 40, 42, 43, 47, 51, 53, 55, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 70, 72, 73, 74, 77, 78, 79, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 101, 103, 104, 108, 109, 110, 111, 112, 117, 118, 121, 123, 124, 127, 131, 134, 136, 137, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 165, 167, 168, 169, 170, 180, 181, 182, 184, 189, 190, 191, 200, 202, 204, 205, 207, 208, 209, 210, 211, 223, 225, 226, 227, 242, 243, 246, 262, 329]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

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