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 = "2460016"
data_path = "/mnt/sn1/2460016"
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: 3-12-2023
In [5]:
# Per-season options
def ant_to_report_url(ant):
    return f'https://htmlpreview.github.io/?https://github.com/HERA-Team/H6C_Notebooks/blob/main/antenna_report/antenna_{ant}_report.html'

Load Auto Metrics¶

In [6]:
use_auto_metrics = False

# find the auto_metrics file
glob_str = os.path.join(data_path, f'zen.{JD}*.auto_metrics.h5')
auto_metrics_file = sorted(glob.glob(glob_str))

# if it exists, load and extract relevant information
if len(auto_metrics_file) > 0:
    auto_metrics_file = auto_metrics_file[0]
    print(f'Found auto_metrics results file at {auto_metrics_file}.')
    
    auto_metrics = load_metric_file(auto_metrics_file)
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
    auto_ex_ants = auto_metrics['ex_ants']['r2_ex_ants']
    
    use_auto_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping auto_metrics.')
Found auto_metrics results file at /mnt/sn1/2460016/zen.2460016.21287.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 1851 ant_metrics files matching glob /mnt/sn1/2460016/zen.2460016.?????.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/2460016/zen.2460016.?????.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 2460016
Date 3-12-2023
LST Range 5.875 -- 15.837 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
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 42, 70
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 62 / 198 (31.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 130 / 198 (65.7%)
Redcal Done? ❌
Never Flagged Antennas 68 / 198 (34.3%)
A Priori Good Antennas Flagged 63 / 93 total a priori good antennas:
3, 5, 7, 15, 16, 17, 30, 31, 37, 38, 40, 42,
45, 53, 54, 55, 65, 66, 67, 70, 71, 72, 81,
83, 86, 93, 94, 101, 103, 109, 111, 112, 121,
122, 123, 124, 127, 128, 136, 140, 147, 148,
149, 150, 151, 158, 161, 165, 167, 168, 169,
170, 173, 181, 182, 184, 187, 189, 190, 191,
192, 193, 202
A Priori Bad Antennas Not Flagged 38 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 50, 57, 61, 62, 64,
73, 74, 89, 90, 115, 120, 125, 126, 132, 133,
135, 139, 179, 220, 222, 228, 229, 237, 238,
239, 241, 245, 320, 324, 325, 329, 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_2460016.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% 0.00% 100.00% 0.00% 1.077938 15.073675 0.162460 11.294867 0.978294 6.558863 -0.630285 1.661315 0.555527 0.040483 0.493175
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.062407 14.605161 2.187291 2.158732 1.603277 3.783816 -2.662923 0.290657 0.549911 0.420182 0.350764
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 11.428106 14.854477 10.728391 11.014168 5.641415 6.648838 0.932652 0.951451 0.040750 0.035579 0.002501
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.206689 -0.002121 -0.829496 -0.155273 0.422365 0.590265 3.860199 15.354316 0.569500 0.579266 0.355214
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.101247 -1.451346 -0.105147 0.203923 0.396554 0.617038 1.795658 2.457420 0.566899 0.574693 0.348458
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.449431 -0.775775 3.489492 -0.966581 0.217758 -0.205864 3.011621 -0.700836 0.545446 0.572874 0.354612
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.406510 -1.089393 -0.132111 -1.224559 -0.833463 0.403866 -1.146995 -0.063637 0.561450 0.568553 0.351082
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 28.764941 -0.233051 3.086883 2.413239 3.392747 0.128807 0.332286 4.256309 0.413217 0.562428 0.354657
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.084466 15.011604 3.285957 11.264864 0.782047 6.540260 5.278766 1.579415 0.548428 0.033691 0.449008
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.558780 7.679480 0.887573 10.042594 0.769747 3.255192 0.373342 4.088806 0.575091 0.355442 0.426774
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.621787 8.515352 10.753992 0.736498 5.597872 2.790445 0.756217 41.772788 0.034823 0.371590 0.296714
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.284429 -0.434221 -0.651500 0.362300 0.208093 -0.545264 -0.325619 2.692596 0.583019 0.593805 0.353666
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 3.169317 -1.487663 2.226109 -0.970064 1.036061 -0.001359 2.797659 -0.103334 0.563819 0.590217 0.350522
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.159339 -0.280488 -0.265801 0.138270 0.751287 0.451471 0.600516 0.551455 0.565437 0.570989 0.344670
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.962811 -0.481116 -0.157787 -0.231643 0.125205 1.270425 -0.876969 -1.079803 0.538207 0.549094 0.345455
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.239765 14.039236 10.815013 11.106128 5.616581 6.640763 3.557293 3.343466 0.029576 0.029902 0.000580
28 N01 RF_maintenance 100.00% 100.00% 12.59% 0.00% 10.705644 21.055180 10.575742 4.084464 5.605777 2.573158 0.336481 20.128529 0.028584 0.249142 0.187575
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.700333 -0.248076 2.894287 0.643218 0.049134 0.212303 3.954578 2.180785 0.575237 0.588541 0.352931
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.061810 -0.878697 0.530149 -1.324786 0.765018 0.180468 5.859001 -0.177390 0.579834 0.603149 0.355653
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.820503 -0.933120 1.358487 1.450661 1.689936 -0.029921 1.268460 8.961087 0.593776 0.595213 0.348730
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 22.344231 27.018109 1.573022 3.312939 0.271616 0.070348 4.627336 5.651662 0.466160 0.471486 0.199013
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 12.607453 15.793659 5.409159 5.588836 5.548057 6.574986 1.962636 1.795731 0.034386 0.044523 0.006763
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.728586 -0.514660 0.063411 -1.221725 -0.585308 -1.009239 2.792635 0.320282 0.545301 0.541933 0.341208
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.507445 8.318016 1.257620 0.866648 1.490177 1.896569 -0.009669 0.998447 0.552388 0.555279 0.370044
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.240132 26.558591 -0.949513 13.961977 0.404597 6.639527 0.196104 4.985799 0.569601 0.030234 0.448804
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.797225 0.615224 -1.240675 2.848875 0.098138 0.141328 3.922470 14.534560 0.577059 0.558944 0.366430
40 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.199346 0.860998 2.912639 -0.304287 0.137296 0.599170 2.548028 14.624204 0.568380 0.590225 0.358943
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.419693 0.931239 1.638542 1.240245 2.074246 -0.435526 0.093003 0.383342 0.587343 0.597763 0.355283
42 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.912947 3.177370 3.115740 -0.808157 1.639737 0.836720 2.136818 4.715037 0.237944 0.235740 -0.280611
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.406931 0.023334 -0.520067 0.757171 -0.901197 0.649560 -1.174695 0.688634 0.599359 0.604141 0.348930
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.289158 -0.058436 -0.864792 -0.339825 -0.747755 0.306143 -0.983162 -0.232594 0.599439 0.612921 0.352509
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.895044 4.082510 0.695814 0.780762 -0.063375 1.569975 0.003792 13.156413 0.587330 0.593694 0.345181
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.743079 -0.554854 -0.299259 -0.999383 -0.249591 -0.687549 -0.218471 -0.569034 0.586144 0.604577 0.359016
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.541960 15.418041 5.311967 5.211076 5.524591 6.510633 2.603975 0.458147 0.031412 0.052060 0.013701
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.010416 1.098813 -0.630377 1.446563 -0.758044 1.324516 -0.795525 -2.263769 0.545455 0.565830 0.349900
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.724649 -0.040663 -0.396002 -0.033373 -0.809261 -0.612431 0.272460 6.029059 0.511269 0.543126 0.347562
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.761357 0.514787 0.186663 1.790337 0.191824 1.098941 0.350930 0.525725 0.555326 0.554763 0.365161
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.341042 1.717581 -0.099566 0.205087 2.443130 1.402544 63.794567 1.258779 0.565690 0.571965 0.361459
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.681957 5.905995 0.589434 0.165275 1.644881 1.250170 4.227962 1.834551 0.578930 0.586411 0.360846
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.039334 1.685474 -0.015462 -0.433798 2.442910 0.307586 13.428397 3.431995 0.589167 0.599832 0.363057
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 10.674200 4.460923 2.356365 0.161885 3.062973 1.501959 -1.454016 0.781927 0.297563 0.355059 0.151861
55 N04 digital_ok 100.00% 6.59% 100.00% 0.00% 0.520264 56.195533 0.726416 7.129565 0.166639 6.897372 3.874728 1.722893 0.254489 0.039438 0.092221
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.437649 0.474907 -0.917266 2.547986 -0.571529 1.237543 -0.103020 1.376318 0.601238 0.601885 0.342791
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.889441 0.058405 2.351723 -0.803372 1.743507 0.207408 -2.276976 1.422707 0.596209 0.608372 0.342397
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.209238 14.453097 10.707434 11.218553 5.522047 6.557808 2.473352 2.180128 0.035489 0.035350 0.001929
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.166004 0.447944 10.254749 0.639363 5.374332 1.832468 0.481100 2.790865 0.045451 0.601965 0.462425
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.434857 14.349616 -0.107011 11.249462 0.272804 6.549362 1.189715 3.127981 0.586717 0.068395 0.467532
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.052449 -0.371679 0.443478 -1.188851 0.787692 -1.055862 0.013242 0.736434 0.526258 0.564677 0.347213
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.736097 0.910169 -0.490479 0.956109 -0.905056 -0.228953 0.531481 -1.452116 0.531563 0.565638 0.350138
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 1.295644 14.867726 -0.670304 5.620873 -0.460691 6.628448 -0.756213 2.999766 0.540444 0.044633 0.424436
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.395678 -0.251530 -1.287140 -0.628681 -0.885440 -1.159010 3.031457 -0.397392 0.534420 0.526826 0.338135
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 24.952005 23.968491 13.779472 13.688264 5.733413 6.749949 6.217257 7.845850 0.022334 0.024689 0.002482
66 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.258121 1.006882 7.147199 2.642795 0.397865 0.391747 6.971274 4.800138 0.523095 0.573093 0.376702
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.567564 0.130442 -1.295445 1.009173 -0.503036 0.699969 8.545817 2.080638 0.583930 0.580721 0.355142
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 26.896889 0.535720 13.895312 0.820230 5.536442 -0.795392 6.535549 -0.450348 0.033266 0.601323 0.466163
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.454677 0.103229 0.536585 2.872998 0.227297 1.381883 3.878958 2.275234 0.597337 0.595786 0.345399
70 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.189929 1.730804 1.351548 3.278327 2.821853 0.476138 5.723466 2.012423 0.251048 0.236531 -0.278265
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.535288 -0.448752 0.203290 4.528098 0.821661 -0.435973 0.559995 1.575821 0.599532 0.594289 0.337728
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 1.211810 0.411909 1.662725 7.447831 0.597871 0.017822 1.815946 15.272615 0.603900 0.550699 0.354992
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.590671 0.403203 -0.963649 -0.485321 0.987370 0.504160 0.089171 0.619439 0.609357 0.618069 0.348406
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.258157 -0.223514 -0.381725 -0.479353 -0.375142 1.390860 -0.811951 2.793620 0.605203 0.616397 0.352929
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 55.508435 22.547476 0.580025 -0.500389 2.589046 0.978922 4.183756 -1.050216 0.309463 0.456751 0.258228
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 29.354634 0.750259 -0.428891 1.229673 1.164894 0.491897 -0.583384 -0.292246 0.396578 0.569951 0.342162
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.729058 15.185868 -0.984119 5.622775 -0.712731 6.485787 0.633208 -0.023315 0.537737 0.039892 0.434951
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.699971 16.084822 -0.017892 5.528205 -0.900733 6.499911 -0.324883 2.299113 0.548583 0.058593 0.439195
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.503007 15.119689 0.711472 10.083839 6.226654 7.597762 37.362729 38.536964 0.524827 0.036418 0.398066
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.547997 0.372679 -0.388014 1.278669 5.719699 6.154372 36.975977 38.384280 0.561241 0.560777 0.353989
83 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 0.195152 -0.145149 0.785229 0.790289 6.086601 5.935224 37.049037 38.456537 0.570026 0.573527 0.351154
84 N08 RF_maintenance 100.00% 76.12% 100.00% 0.00% 20.071599 26.531613 13.467522 14.027155 4.207137 6.533456 4.606753 5.376083 0.188529 0.035475 0.124376
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.634538 0.212659 -1.333176 -1.332507 -0.846823 -0.304201 -0.355138 -0.590024 0.599582 0.607951 0.349794
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.821189 1.294073 -0.604201 -0.724824 1.274921 0.114505 0.234604 15.345828 0.598030 0.611225 0.341308
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.905437 7.050312 0.665838 -0.049922 8.588050 1.186240 5.023518 1.698141 0.564278 0.625538 0.330328
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.535593 0.393919 0.737658 1.038446 0.420157 -0.602042 -0.195312 -0.054689 0.600906 0.613449 0.336261
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.329665 0.276662 0.560176 1.004430 -0.255956 0.021525 -0.576378 -0.191125 0.600939 0.613950 0.342325
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.086685 -0.665621 -0.785841 -0.451480 0.044709 -1.366294 0.057593 1.545416 0.600174 0.617089 0.348163
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.536305 -0.214418 0.852776 0.439097 -0.170481 0.015291 -0.252516 -0.068039 0.578477 0.603399 0.350987
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.773579 -0.080055 10.705113 0.384792 5.622367 1.520859 0.277677 0.877449 0.034962 0.601306 0.407649
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.071269 14.644928 10.829732 11.315290 5.471748 6.509178 2.653381 2.159645 0.030183 0.025053 0.002889
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.891248 14.927001 10.954955 11.120268 5.467120 6.560498 2.461307 0.919079 0.025414 0.025339 0.000996
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.372462 1.842250 -1.012746 0.684171 2.277264 1.249445 -0.735789 -0.082788 0.404564 0.413371 0.188272
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 4.460370 18.907252 3.053474 1.398606 2.424075 1.710930 -3.171383 -1.841474 0.542849 0.450117 0.333966
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.496680 3.600599 -1.153603 0.763459 -0.912522 -0.405817 0.296665 12.620355 0.532069 0.502529 0.343984
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.642132 8.342531 0.015621 1.237243 0.487343 1.323074 -0.131718 -0.247370 0.589297 0.596871 0.349382
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.012844 0.776772 -1.021906 -1.293981 0.166895 0.336640 -0.822344 8.402653 0.593741 0.609515 0.348298
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.697033 3.197248 8.144713 -0.913324 -0.678958 0.186914 3.618022 22.729065 0.520313 0.606428 0.356712
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.901458 59.901521 -0.275544 7.222482 1.793883 0.091566 0.789812 0.082931 0.602102 0.590180 0.338016
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.119423 0.138612 0.500638 1.088243 1.113705 -0.078405 -0.305299 -0.254331 0.605123 0.614517 0.338855
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.098481 1.144093 -0.518110 -0.298945 -0.072037 -0.624962 0.156921 -0.466486 0.604429 0.617540 0.341225
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 2.258489 2.014614 -0.384532 -1.000157 1.050147 -0.039294 0.908369 1.802689 0.596457 0.610275 0.337707
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.839428 42.144671 10.746798 1.031341 5.537643 2.064612 1.741377 1.897977 0.033966 0.287651 0.147108
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.578527 14.406478 10.791529 10.993172 5.608058 6.649289 1.267336 2.941017 0.058809 0.033444 0.016850
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.655340 10.738489 6.550535 -0.114013 5.754852 -0.058167 1.423575 -0.460055 0.484820 0.556326 0.322451
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 25.367432 14.351611 1.157034 11.083708 3.850569 6.631562 24.975109 3.017404 0.474052 0.056378 0.340942
112 N10 digital_ok 100.00% 67.59% 100.00% 0.00% 1.613967 13.982339 7.631370 11.149919 -0.127256 6.392029 0.136815 0.811313 0.183558 0.066939 -0.092318
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.813601 15.825911 5.042445 5.615875 5.434642 6.465497 1.637595 0.886087 0.034098 0.031446 0.001627
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 13.705565 0.961930 5.208871 -0.166187 5.411976 -0.833252 0.308051 -0.632168 0.044337 0.545860 0.423192
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.227021 -0.873576 -1.352663 0.032475 -0.831002 -0.724368 -0.593518 -0.800918 0.514053 0.534559 0.353525
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.678240 15.998386 10.858296 11.557218 5.430370 6.501874 1.419369 4.585127 0.028203 0.031269 0.001963
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.442103 1.692330 0.306725 0.639015 -0.282996 0.494530 -0.201541 0.566452 0.564663 0.577050 0.356938
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.385492 1.862476 3.071703 -0.940886 0.261882 0.675699 1.396758 -0.148378 0.582840 0.608713 0.351450
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.105065 3.014464 -0.880496 6.122602 0.430430 -0.334545 34.737741 25.663031 0.603562 0.586763 0.337462
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.154489 6.248879 -0.873376 -1.148495 0.028223 0.464076 -0.474416 -0.628801 0.606558 0.620097 0.343101
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.208473 8.669532 1.113893 1.151521 0.880769 0.700278 -0.333631 0.417518 0.611363 0.620746 0.343224
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 10.933291 0.637626 11.005124 0.736376 5.427693 0.518558 1.004254 1.127093 0.040283 0.613579 0.420957
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.622311 -0.309719 1.091663 1.014600 1.163759 0.056446 1.542556 3.228350 0.599586 0.608863 0.343487
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.183789 2.681728 -0.430419 1.424139 0.826576 3.515480 2.255666 1.374573 0.599299 0.606947 0.347849
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 10.395463 -0.186741 10.700809 2.618244 5.617634 -0.162508 0.238002 0.323968 0.032294 0.595866 0.393444
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% -0.403366 -0.389064 -1.293769 0.164974 -0.463389 -0.609672 0.272580 4.711067 0.589113 0.595251 0.364901
131 N11 not_connected 100.00% 0.00% 51.00% 0.00% -0.927294 14.279051 -0.359060 5.511352 -0.200189 5.827943 -1.192853 0.591668 0.546942 0.217890 0.394987
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.217124 -0.021670 -0.536486 -1.315919 -0.378832 -0.950438 -0.066986 -0.130622 0.536433 0.536453 0.349157
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.808205 -1.192861 -1.149683 -0.518943 -0.758747 -0.943524 0.352954 2.054749 0.512735 0.539566 0.359067
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.081688 15.792614 5.181653 5.583455 5.440854 6.490903 0.462724 1.069876 0.039994 0.034904 0.003009
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.523984 -1.363150 -0.971465 -1.347985 2.030539 0.312769 0.613037 -0.013242 0.531572 0.552401 0.368181
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.917508 0.267408 10.394394 -0.513387 5.604830 0.619433 1.610939 0.360835 0.038257 0.552734 0.410878
137 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.336657 -0.377976 0.689399 -1.223786 6.607896 5.472953 37.537742 38.228237 0.547007 0.571855 0.356985
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.206526 1.606748 1.038740 -1.048854 0.274315 -0.884086 -1.739684 -0.356164 0.573789 0.567803 0.336310
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.973143 -1.164339 -0.469322 -0.346064 0.043683 -0.758472 20.913590 5.279616 0.588126 0.606774 0.343193
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.852770 -0.770520 0.062903 0.462709 1.217160 -0.618662 -0.113374 -1.412863 0.597344 0.612159 0.342470
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.386618 14.475008 -0.421545 11.256671 1.987797 6.585181 24.816271 2.831674 0.601963 0.044534 0.497999
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.616042 14.325112 10.611520 11.217190 5.053014 6.593439 0.860223 2.326946 0.096295 0.030013 0.053524
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.157617 0.594826 -0.765602 3.613546 0.138895 -0.724473 -0.542120 0.403240 0.608298 0.600907 0.347581
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.010416 -0.525312 2.085179 0.645152 0.090853 2.813150 0.430890 -0.861318 0.594842 0.614151 0.351027
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.543971 -0.651644 -1.228319 -0.846448 -1.082155 -1.312860 -0.306166 -0.041434 0.569873 0.588042 0.346338
147 N15 digital_ok 100.00% 96.81% 96.87% 0.00% 118.188708 116.481360 inf inf 1978.335585 1945.102030 7436.532783 7271.773617 0.384583 0.378623 0.304684
148 N15 digital_ok 100.00% 96.92% 96.92% 0.00% 162.363515 166.619369 inf inf 1382.686544 1382.162980 7141.900788 6933.269208 0.434623 0.436306 0.313089
149 N15 digital_ok 100.00% 97.51% 97.24% 0.00% 172.190113 173.687493 inf inf 1609.425806 1616.316525 6976.573264 6807.697306 0.368287 0.378730 0.344564
150 N15 digital_ok 100.00% 97.24% 96.81% 0.00% 165.847914 164.472270 inf inf 2160.107036 2170.316886 7217.112872 7190.301003 0.356969 0.380117 0.287758
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 22.729093 0.692847 -0.586021 0.694878 1.165814 -0.675150 1.504865 -0.117031 0.417625 0.510830 0.313680
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.289347 -1.217072 10.550646 -1.045667 5.624945 -0.304558 2.441316 1.414427 0.039718 0.556940 0.425285
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.045245 14.254217 8.714182 11.034923 1.405879 6.648589 3.578727 2.820223 0.394249 0.037460 0.306726
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.714494 -0.396601 0.446320 0.853485 0.544801 1.041574 -0.226171 0.229251 0.554610 0.570045 0.356211
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.598172 -0.589756 0.108371 -0.115906 2.167160 1.562004 5.729475 23.323381 0.568223 0.582423 0.354324
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.418908 27.787683 -0.879281 -0.492437 -0.462037 0.936402 0.483081 1.318482 0.543161 0.439300 0.314856
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.165271 -1.071778 -0.083087 -0.566796 0.208285 1.172036 -0.305510 1.236062 0.585660 0.599549 0.348328
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.190736 31.321820 0.397464 -0.123680 0.758036 0.048159 -0.397051 0.911927 0.591764 0.479566 0.319060
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.321737 -1.460043 -0.247860 -1.037720 0.001359 0.221407 0.147941 -0.287957 0.603232 0.613946 0.348964
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.558723 1.299740 0.227934 0.528657 0.541558 1.121650 0.757160 2.353125 0.604418 0.613827 0.351456
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.406304 0.443341 0.266432 1.405911 1.590785 1.974695 2.134745 2.552234 0.601073 0.605819 0.343440
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 27.263812 -0.256945 -0.153817 -0.715195 3.018326 0.136662 3.888631 -0.072790 0.476973 0.607739 0.340836
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.941415 -0.028261 1.028678 0.628281 0.482490 -0.489326 0.193164 -1.592022 0.590504 0.602892 0.343796
167 N15 digital_ok 100.00% 97.03% 96.87% 0.00% 244.788030 244.299692 inf inf 2047.855601 2046.566059 5365.992249 5216.802557 0.440069 0.460710 0.370916
168 N15 digital_ok 100.00% 97.30% 97.41% 0.00% 207.435689 209.363296 inf inf 1967.456035 1955.118281 5803.738474 5546.984789 0.403040 0.371471 0.331214
169 N15 digital_ok 100.00% 96.49% 96.43% 0.00% nan nan inf inf nan nan nan nan 0.438753 0.448953 0.333083
170 N15 digital_ok 100.00% 97.24% 97.24% 0.05% 170.352947 170.643949 inf inf 2095.717648 2097.732907 7182.832019 7236.546239 0.418588 0.420807 0.307786
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.577143 1.366521 -1.214744 -0.176531 -0.893444 -0.349245 -0.554220 0.373878 0.521362 0.506255 0.337561
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 12.925641 14.964824 4.797171 5.250515 5.647150 6.625272 3.364289 6.573556 0.035614 0.040932 0.003512
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.586496 -0.576546 0.143258 0.310983 -0.747205 1.528332 -0.105224 0.354054 0.556538 0.579369 0.355244
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.167126 15.138628 -1.120645 11.382698 0.588366 6.510688 22.248058 3.612319 0.584218 0.051110 0.488654
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.270441 0.178905 1.361443 0.669669 -0.062759 0.588402 0.278942 5.362795 0.587897 0.596714 0.353274
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.147205 14.170854 -0.518878 10.974026 -0.858929 6.634874 8.900488 2.367364 0.599973 0.046346 0.459848
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.956049 0.046324 0.551733 0.898333 1.334046 0.088306 1.265137 0.621260 0.590322 0.600304 0.341801
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 21.159316 -0.631283 7.060236 -0.993077 5.085178 0.505825 13.124204 0.334097 0.420182 0.607402 0.367282
185 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.681378 -0.356646 3.106356 0.740875 2.900563 -0.298383 -3.046586 -0.154474 0.571371 0.604982 0.356115
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.032480 -1.146869 0.118737 -0.321908 -0.685009 -0.773692 -0.426519 -0.807663 0.597957 0.604508 0.352108
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.179450 -1.027640 -1.112695 -0.230205 0.719396 0.661733 7.695644 0.326195 0.581671 0.593089 0.353551
189 N15 digital_ok 100.00% 96.97% 97.19% 0.00% nan nan inf inf nan nan nan nan 0.449105 0.441567 0.323646
190 N15 digital_ok 100.00% 96.54% 96.81% 0.05% 132.262541 128.273472 inf inf 2045.106375 2013.664596 7326.779873 7481.600251 0.438437 0.427646 0.314687
191 N15 digital_ok 100.00% 96.60% 96.70% 0.00% 165.339904 164.817953 inf inf 1861.137747 1861.014430 7202.785464 7159.515553 0.440211 0.460641 0.359081
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 1.936321 6.636436 1.979750 4.100952 1.518449 5.334583 0.330640 -3.837366 0.531863 0.500441 0.356479
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 7.143489 0.934381 4.131082 1.305289 4.432658 1.106764 -4.069255 -0.939171 0.495287 0.527425 0.368319
200 N18 RF_maintenance 100.00% 100.00% 48.95% 0.00% 12.580770 39.152289 5.203669 -0.036997 5.617630 2.245990 1.958198 6.242245 0.039965 0.214185 0.140763
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.907798 4.764908 2.457383 3.517127 2.004638 4.291359 -1.248514 -2.963198 0.564827 0.559657 0.344338
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.573757 0.885028 1.130202 -1.337504 0.348191 -0.006004 -1.252890 50.735947 0.578695 0.572200 0.342345
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.367088 14.528194 1.504378 -0.933803 -0.067668 0.002393 15.186500 2.032486 0.584435 0.599672 0.351715
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 9.105401 0.140481 3.793954 -0.757704 3.431652 -0.848996 23.901995 5.174532 0.337340 0.577172 0.414300
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.054780 6.245144 0.117339 2.843455 1.493951 1.290207 -0.365233 0.375905 0.528853 0.461671 0.337951
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.033511 1.693122 -0.985755 -0.688459 -0.986644 -0.553066 7.954167 0.140425 0.555178 0.548550 0.342024
208 N20 dish_maintenance 100.00% 97.03% 97.30% 0.00% nan nan inf inf nan nan nan nan 0.462710 0.438114 0.350430
209 N20 dish_maintenance 100.00% 97.46% 97.35% 0.00% nan nan inf inf nan nan nan nan 0.398497 0.445808 0.307278
210 N20 dish_maintenance 100.00% 97.46% 97.51% 0.00% nan nan inf inf nan nan nan nan 0.427091 0.406748 0.304430
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.018139 14.930077 -1.216565 5.645900 -0.628924 6.495350 -0.020448 1.449818 0.515924 0.039341 0.438836
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.241898 -0.740223 0.091831 -0.496205 -0.858922 -1.136239 2.599838 -1.057324 0.567833 0.565529 0.345455
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.107418 -0.349680 -1.354866 -0.759779 0.163836 -1.229898 6.958813 -0.177483 0.553103 0.572869 0.346913
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.565932 -0.279083 -0.477020 -0.032475 -0.242366 0.238918 3.600780 -1.156332 0.561924 0.577451 0.347113
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.680594 -1.055723 -0.956916 -0.371338 -1.154349 -1.192176 0.848533 8.274108 0.553711 0.575036 0.349256
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.276135 5.934005 4.289944 3.982215 4.608692 5.024608 -4.024354 -3.094608 0.529300 0.546498 0.343039
225 N19 RF_ok 100.00% 0.00% 91.19% 0.00% -0.719344 14.423180 0.361544 5.395622 -0.745203 6.332500 -1.442301 1.909660 0.564814 0.131962 0.460280
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.766718 21.101453 -0.816906 0.376370 -0.895826 2.531681 -1.035962 -0.414006 0.551782 0.460181 0.336225
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 3.408184 1.014998 2.466018 -0.572888 -0.122789 -0.996423 9.790310 9.631352 0.443580 0.529961 0.363143
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.108336 0.115169 0.556542 -1.352247 -0.239227 -0.789411 1.081565 1.484522 0.532307 0.524628 0.341957
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.242852 0.683360 0.502140 1.182987 -0.489618 0.433398 -1.877947 -2.177998 0.532465 0.537801 0.361566
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.010256 -0.537287 0.455115 -1.369832 -0.474984 -0.461269 0.387979 -0.404817 0.503370 0.546418 0.357712
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.092907 -0.320168 0.521896 0.338790 -0.673283 -0.794485 -1.435215 -1.433631 0.559955 0.563151 0.355198
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.388277 -1.257207 -0.449158 -0.369328 -0.704931 -1.054362 0.463211 2.608142 0.558073 0.563533 0.352519
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.352314 0.144821 0.351461 -0.959258 -0.905970 -1.276906 9.226594 6.552842 0.508189 0.562184 0.364933
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.023405 -1.141442 -0.636991 0.039650 -0.897209 -0.842318 0.904247 -0.773643 0.548245 0.566244 0.361933
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 20.917539 1.156334 -0.077210 1.425097 1.355563 0.879535 -1.491353 -0.554712 0.418727 0.557414 0.353542
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 20.367834 -1.024623 0.672480 -1.339282 1.776957 -0.567948 -0.303867 0.040311 0.429847 0.543461 0.351177
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.589495 -0.903299 -0.440116 -1.261790 -0.838117 -0.954332 3.101400 6.529003 0.505176 0.544603 0.355903
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.230750 0.537033 0.724512 -0.592571 -0.378387 -1.318783 -2.125988 0.065231 0.538729 0.536749 0.352982
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.540182 15.556829 -1.045421 5.144769 -0.442661 6.606318 -0.956062 0.398514 0.520270 0.037954 0.440645
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% -0.582838 -0.207840 -0.223398 -0.354986 -0.639389 -1.180384 18.648626 4.254378 0.527188 0.528879 0.350218
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 11.466608 14.226713 5.464866 5.381541 -0.083582 -0.594414 -0.196165 2.282159 0.507329 0.511836 0.351309
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.485723 1.039911 1.971861 1.032438 0.923500 0.231718 -1.420515 2.004609 0.456176 0.463011 0.347222
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 2.084562 2.814076 0.802078 1.286482 0.137417 1.030838 -1.766462 -2.117889 0.441710 0.445393 0.331655
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.035135 -0.978320 0.697481 -1.350570 0.030857 -0.850837 -1.899616 0.528595 0.468751 0.461722 0.346462
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.640474 -0.096700 -1.213539 -1.118046 -0.605756 -0.763909 0.228966 -0.660348 0.436779 0.448518 0.331582
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.976973 1.391305 -0.417238 -1.169816 -0.888157 -0.964003 1.155141 -0.217928 0.418170 0.438428 0.322447
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 5, 7, 15, 16, 17, 18, 27, 28, 30, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 49, 51, 52, 53, 54, 55, 58, 59, 60, 63, 65, 66, 67, 68, 70, 71, 72, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 92, 93, 94, 95, 96, 97, 101, 102, 103, 104, 108, 109, 110, 111, 112, 113, 114, 117, 121, 122, 123, 124, 127, 128, 131, 134, 136, 137, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 161, 165, 167, 168, 169, 170, 173, 180, 181, 182, 184, 185, 187, 189, 190, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 221, 223, 224, 225, 226, 227, 240, 242, 243, 244, 246, 261, 262]

unflagged_ants: [8, 9, 10, 19, 20, 21, 22, 29, 35, 41, 43, 44, 46, 48, 50, 56, 57, 61, 62, 64, 69, 73, 74, 85, 88, 89, 90, 91, 105, 106, 107, 115, 118, 120, 125, 126, 132, 133, 135, 139, 141, 144, 145, 146, 157, 160, 162, 163, 164, 166, 171, 179, 183, 186, 220, 222, 228, 229, 237, 238, 239, 241, 245, 320, 324, 325, 329, 333]

golden_ants: [9, 10, 19, 20, 21, 29, 41, 44, 56, 69, 85, 88, 91, 105, 106, 107, 118, 141, 144, 145, 146, 157, 160, 162, 163, 164, 166, 171, 183, 186]
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_2460016.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.3.dev121+gc95c57f
In [ ]: