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 = "2459972"
data_path = "/mnt/sn1/2459972"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 1-27-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/2459972/zen.2459972.21322.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

# get a list of all ant_metrics files
glob_str = os.path.join(data_path, f'zen.{JD}.?????.sum{ant_metrics_ext}')
ant_metrics_files = sorted(glob.glob(glob_str))

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1849 ant_metrics files matching glob /mnt/sn1/2459972/zen.2459972.?????.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/2459972/zen.2459972.?????.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 2459972
Date 1-27-2023
LST Range 2.992 -- 12.944 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1849
Total Number of Antennas 196
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 196 (0.0%)
Antennas in Commanded State (observed) 0 / 196 (0.0%)
Cross-Polarized Antennas 96
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 56 / 196 (28.6%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 113 / 196 (57.7%)
Redcal Done? ❌
Never Flagged Antennas 83 / 196 (42.3%)
A Priori Good Antennas Flagged 43 / 93 total a priori good antennas:
3, 7, 9, 10, 15, 16, 29, 40, 42, 54, 55, 56,
66, 71, 72, 81, 86, 94, 101, 103, 109, 111,
121, 122, 123, 128, 136, 143, 144, 151, 158,
161, 164, 165, 170, 173, 182, 185, 189, 191,
192, 193, 202
A Priori Bad Antennas Not Flagged 33 / 103 total a priori bad antennas:
8, 22, 35, 43, 46, 61, 73, 74, 89, 90, 95,
115, 125, 126, 132, 133, 137, 139, 205, 207,
211, 220, 221, 222, 223, 237, 238, 239, 245,
261, 324, 325, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459972.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.647872 12.263941 10.385766 -0.708459 11.882009 7.595069 -0.214257 4.691634 0.034119 0.336571 0.271117
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.410265 1.695943 1.502699 1.232449 1.923537 5.850475 3.108704 -0.722091 0.595824 0.624231 0.405486
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.699159 -0.044926 0.456647 0.072317 -0.018353 2.945861 0.134330 -0.116392 0.606299 0.622167 0.394775
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.837704 0.266159 -1.125858 -0.315510 -0.182818 0.293289 7.390554 8.210608 0.614503 0.630334 0.389141
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.073803 -1.166811 -0.578106 -0.102985 -0.467086 0.308938 2.777875 -0.089942 0.612730 0.625101 0.385302
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.322205 -0.588078 8.628716 -0.635421 6.935300 -0.153121 -0.736131 -1.089471 0.437646 0.624552 0.460815
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 2.433183 -0.347957 6.944688 -1.583995 1.478858 1.302485 0.090419 0.212091 0.510976 0.623456 0.433963
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.840079 16.421620 9.748352 -0.127367 11.873778 5.224700 -0.777980 0.661042 0.033478 0.340020 0.264565
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.821460 -0.773384 10.348549 0.769855 11.883878 2.432385 -0.596618 0.775373 0.032858 0.630085 0.517598
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.707546 1.518396 0.569744 0.258575 0.793715 0.908730 0.414890 1.294970 0.616611 0.634292 0.393545
18 N01 RF_maintenance 100.00% 100.00% 47.38% 0.00% 10.426522 18.050163 10.311732 -0.920257 12.047554 8.632253 -0.634138 10.322578 0.031552 0.228740 0.178938
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.848005 -0.766036 -1.191889 -1.114257 -0.646561 1.929843 0.010629 1.460683 0.620279 0.640412 0.386801
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.337400 -0.808814 2.654523 -1.274578 0.230082 0.990090 0.359661 -1.270792 0.610982 0.638728 0.394511
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.190417 0.051078 -0.610878 -0.038756 0.860782 1.454878 -0.333294 -0.206740 0.604927 0.617890 0.387052
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.687142 -0.286650 0.576081 0.460089 1.929026 3.568287 1.592065 1.061257 0.565017 0.582257 0.383106
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.225109 11.198061 10.377065 10.674110 12.044943 14.650302 0.465036 0.095636 0.035506 0.036400 0.004285
28 N01 RF_maintenance 100.00% 0.00% 88.10% 0.00% 11.157907 24.117563 -0.187509 2.395498 8.991612 13.890818 3.349366 12.666222 0.357319 0.156414 0.269873
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 9.860980 11.627046 9.943884 10.245510 12.007346 14.593897 -0.413472 -0.688472 0.031694 0.034876 0.005671
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.286821 -0.059025 -0.302297 0.430272 1.191608 0.657275 0.614744 -0.413939 0.622764 0.643475 0.384714
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.457856 -1.221624 1.317311 0.847219 1.877927 -0.194218 -0.010629 1.980550 0.633439 0.640389 0.381872
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.358475 23.366882 -0.035159 2.849360 3.036158 1.747822 1.461200 9.476329 0.616739 0.529496 0.362042
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.261456 12.786836 4.487205 4.658069 12.159381 14.715786 3.845491 3.626922 0.035051 0.043565 0.007479
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.210582 -0.043823 0.919367 -1.578596 -0.121059 -0.478185 0.546263 0.821664 0.575681 0.566680 0.380766
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 23.586150 23.336464 13.818854 13.593618 12.246812 14.563359 2.793236 2.821988 0.032920 0.028283 0.001860
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.208528 0.776758 -1.165999 1.450063 0.738517 0.397237 -1.283230 1.744212 0.612634 0.622137 0.401910
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.105881 0.081964 0.196249 0.484887 -0.241509 0.063493 3.623523 -0.136529 0.619862 0.633291 0.402053
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 9.225375 3.049270 9.980298 0.324365 12.183905 0.172407 3.080261 2.735601 0.038091 0.616007 0.480063
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.447645 -0.101725 0.053013 -0.123238 3.198349 0.121437 0.298201 1.314985 0.623327 0.642970 0.378824
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.712410 -0.216751 5.141070 6.120792 -0.717000 0.855501 -0.246565 -0.239493 0.599641 0.607703 0.367940
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.165079 0.672397 0.015645 0.559753 -0.575551 0.586556 0.418303 1.508156 0.633597 0.636010 0.377912
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.898968 -0.254795 -0.457522 -0.722398 0.264831 0.801780 1.242916 1.599498 0.632616 0.649842 0.381572
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.517201 2.858624 0.217488 0.523300 -0.416375 2.785510 0.852301 2.244052 0.620297 0.631498 0.375553
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.003352 0.033785 -0.900467 -0.862029 -0.004402 -0.394009 -0.107398 -0.361687 0.625348 0.645688 0.397881
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.505629 12.494029 4.300957 4.269134 12.047928 14.588117 2.605727 1.934860 0.032100 0.045727 0.011064
48 N06 not_connected 100.00% 90.86% 91.94% 0.00% 110.529759 105.161054 inf inf 2454.194828 2446.943585 4367.476317 4269.085888 0.436494 0.376879 0.348944
49 N06 not_connected 100.00% 90.75% 91.83% 0.00% 99.819265 98.542602 inf inf 1948.816404 1958.941102 4317.507059 4267.616782 0.465610 0.422840 0.393179
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.253108 2.048953 0.828955 0.892265 1.138097 0.854067 7.788316 3.344124 0.561581 0.602686 0.371727
51 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 21.669968 4.242940 13.248354 -0.623016 12.280472 4.961043 4.903160 1.462377 0.038974 0.514587 0.396751
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.023802 5.875443 -0.374081 0.385756 1.463456 0.605882 0.762048 1.120646 0.622762 0.634181 0.392801
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.914292 2.980904 0.237621 0.269575 1.803770 2.562384 1.370287 2.148136 0.632888 0.646001 0.397300
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 26.574501 -0.773630 5.470295 3.168236 2.938578 -0.760591 2.462984 0.842888 0.438830 0.630449 0.379268
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.057791 12.481097 10.404772 10.809887 12.097742 14.643061 1.662234 2.728742 0.029970 0.030419 0.002715
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.095208 2.093555 5.923793 7.958738 1.383819 5.484714 -0.240301 0.532999 0.587904 0.558044 0.357425
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 22.969554 0.130428 7.464984 0.498103 8.208273 0.806220 9.285875 2.434669 0.402395 0.653315 0.413920
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.311675 11.617854 10.286784 10.815305 12.020589 14.635275 2.942912 2.747998 0.036412 0.034236 0.001964
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.078464 0.591386 9.820781 0.959266 11.746137 3.230426 2.481784 7.143275 0.046348 0.636264 0.510904
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.353711 11.519305 -0.407965 10.840475 0.168506 14.687659 2.538393 3.250889 0.617443 0.060627 0.504767
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.427229 0.202898 -0.734095 -1.576028 2.731997 -0.319962 1.356701 1.918268 0.561566 0.592173 0.379366
62 N06 not_connected 100.00% 91.73% 92.92% 0.16% 110.677293 95.323802 inf inf 2541.619152 2509.284612 4360.774335 4422.103158 0.405905 0.370538 0.366694
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.111532 12.061992 -0.157227 4.681668 0.673356 14.697027 0.400649 1.921769 0.580709 0.042371 0.477686
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.031314 0.282864 -0.817317 -1.212639 -0.480353 -0.415502 4.766811 0.331192 0.566033 0.557458 0.370648
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.576736 1.393873 0.460606 1.049082 0.168549 0.526976 -0.353650 -0.654355 0.600763 0.617818 0.406543
66 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.624631 1.647845 -1.234529 -1.461007 4.256598 -0.261000 -1.124008 -1.001990 0.615940 0.636547 0.404522
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.458112 2.026109 -0.894205 0.593191 -0.602944 -0.057278 -0.601359 0.434632 0.628702 0.628406 0.389938
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 19.281839 24.730646 1.207843 14.330241 6.275779 14.658948 -0.748853 5.673737 0.361880 0.028199 0.267818
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.792065 -0.167699 0.281796 0.735503 -0.054264 1.627020 0.388782 0.655399 0.627015 0.647254 0.377160
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.642334 -0.357956 -0.085366 -0.015645 1.792629 2.184562 1.027332 0.715564 0.639180 0.655419 0.377597
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 6.974544 -0.253754 0.726698 0.834599 1.345819 0.369272 5.137342 3.895407 0.646184 0.659577 0.368568
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.640255 12.733709 10.794514 11.248252 11.690671 14.278993 -0.382582 -0.256532 0.032437 0.032917 0.003109
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.504617 0.951605 -1.366702 -1.373408 1.571378 1.569857 0.549932 0.447119 0.643657 0.657531 0.377705
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.167919 -0.355493 0.553100 -1.388504 -0.004026 1.511858 -0.226933 2.981264 0.639997 0.650028 0.377367
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 58.896894 0.842024 0.731874 -0.174270 7.037168 -0.298714 12.205691 -0.141080 0.290256 0.594561 0.449909
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 31.642112 -0.175951 -0.447051 1.404385 3.000181 1.070057 2.128415 2.472837 0.411618 0.608286 0.385268
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.739019 12.295912 -1.513174 4.708230 -1.107645 14.414276 0.718997 -1.123220 0.577791 0.038859 0.449965
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.516375 13.090284 0.401447 4.602462 -1.268175 14.455650 -0.668761 -0.150412 0.587458 0.044738 0.465375
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.296451 12.382299 0.200132 9.383628 0.476127 14.074747 0.901046 1.171280 0.575489 0.036306 0.443998
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.550928 0.169739 0.503189 4.307335 -0.096443 0.612322 0.875047 2.450953 0.596654 0.573506 0.383821
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.398762 0.007166 0.285762 0.231095 0.727998 0.490156 0.310055 0.786001 0.610212 0.628638 0.389962
84 N08 RF_maintenance 100.00% 76.37% 100.00% 0.00% 18.304198 21.314244 13.438841 13.859682 10.126343 14.519665 2.145698 2.394219 0.187263 0.034760 0.118887
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.011284 0.599188 1.541815 1.343666 -1.171100 -0.370182 -0.835870 -0.774512 0.624515 0.642401 0.381557
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.656152 -0.074194 1.374704 1.583850 5.186238 0.009482 2.630930 14.177943 0.616991 0.637699 0.362746
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.590389 6.320552 -0.602841 -0.495264 7.329622 1.143247 2.811214 1.789754 0.636202 0.664759 0.366794
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.791510 0.579830 0.505661 0.596759 -0.177627 -0.133997 -0.693583 -0.915879 0.638124 0.655456 0.367288
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.453498 0.507611 0.052446 0.714784 -0.707006 -0.936926 -1.143287 -1.052851 0.643523 0.653792 0.369384
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.096733 -0.306456 0.910005 3.178481 -0.289816 -0.447306 -0.289059 1.191097 0.634613 0.628047 0.369354
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.448589 -0.086387 -0.217230 -0.589191 -0.870480 -1.117979 0.533084 -0.035511 0.633254 0.651446 0.385751
92 N10 RF_maintenance 100.00% 0.00% 25.04% 0.00% 32.923530 35.491033 0.762074 1.450845 6.244354 6.461012 -0.817020 4.254730 0.288841 0.240142 0.088827
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.727768 -0.179948 2.456761 -1.312776 0.764951 0.634390 1.870494 -0.896669 0.619946 0.641259 0.397311
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.559158 11.973903 10.522523 10.698993 12.006775 14.542291 -0.270958 -0.466942 0.032983 0.026387 0.002609
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.261064 -0.067759 -0.936332 1.232136 -0.371945 1.031405 -1.116295 0.197002 0.588808 0.618623 0.397645
96 N11 not_connected 100.00% 0.00% 0.00% 100.00% 12.650076 6.393314 3.708449 5.492918 4.404587 11.622742 -2.359957 -3.106683 0.252756 0.203913 -0.253928
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.692050 5.225307 -1.116364 1.097442 -1.095932 2.889364 1.628606 5.388063 0.573828 0.525503 0.381048
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.722810 8.345289 -0.393711 1.146240 -0.013058 1.512026 -0.240233 -0.425718 0.630307 0.642532 0.383644
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.554573 1.159710 -1.527217 -1.027949 1.453996 0.909217 -0.794506 7.099274 0.641466 0.654119 0.381098
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.166531 4.914588 5.690187 -1.321809 0.632539 0.515990 7.125755 8.058394 0.600478 0.658864 0.385275
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.347619 56.849951 -1.096351 7.426030 2.830014 0.491026 0.085532 0.643049 0.649391 0.627662 0.372473
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.690909 0.096689 -0.342657 0.048263 0.492835 -1.012059 -1.034503 -0.962763 0.643254 0.656144 0.366412
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.742847 1.533077 -1.458402 -0.781100 0.869486 -0.645137 -0.414205 -0.339405 0.645710 0.658496 0.366713
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.899167 0.850136 -0.765272 -1.284225 0.215841 -0.103373 2.448924 2.010710 0.644790 0.662649 0.373697
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.730078 39.866747 10.320071 0.872949 11.940988 6.160886 -0.079293 2.596603 0.035675 0.286439 0.169972
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 3.608925 11.587325 8.088120 10.546428 4.543678 14.634147 -1.287431 0.084377 0.499446 0.029693 0.342684
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 23.894183 23.532688 13.894643 14.086675 11.971882 14.389674 1.484671 1.625939 0.026541 0.026341 0.001752
111 N10 digital_ok 100.00% 0.00% 83.67% 0.00% -0.013952 10.582733 -0.419780 10.471587 -0.424333 13.772749 1.872549 0.097256 0.635066 0.174249 0.471921
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.426761 -0.225457 0.329742 0.204574 0.276732 2.968960 -0.601930 -1.359598 0.621731 0.634967 0.398332
113 N11 not_connected 100.00% 0.00% 100.00% 0.00% 3.835015 12.860986 4.101868 4.693195 4.587474 14.325931 -2.686536 -0.647541 0.607320 0.065933 0.475940
114 N11 not_connected 100.00% 45.05% 100.00% 0.00% 52.804696 12.427021 61.734533 12.838087 416.168301 17.459683 2921.915030 83.210001 0.352148 0.024766 0.200751
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.834581 -0.764823 -1.023019 -0.267143 -0.327480 -1.214963 -0.922351 -0.513067 0.563029 0.589774 0.394819
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.499141 13.011868 10.471225 11.197938 11.812081 14.534937 0.854920 2.374143 0.029688 0.031167 0.002739
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.051771 1.262335 -0.197178 0.436979 -0.683600 -0.174423 -0.310142 0.334511 0.607199 0.627838 0.395124
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.393043 1.880271 2.863342 -1.168063 0.898556 1.712878 6.533406 5.069667 0.617941 0.652596 0.385406
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.434699 3.221990 -1.278480 6.131507 0.636733 -0.631776 6.881216 10.228946 0.642800 0.628496 0.368609
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.332363 6.477716 0.251606 0.826132 0.812432 1.895648 -0.645222 -0.941648 0.634777 0.658921 0.374323
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.665794 8.671196 0.869978 0.890703 0.247944 -0.601059 -0.837551 -0.711857 0.651835 0.665400 0.377275
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.133830 0.115680 0.031867 0.510259 -0.628386 0.084701 -0.184692 -0.622943 0.650436 0.664052 0.376664
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.978451 -0.569709 -0.370050 0.630131 0.574326 -1.006547 -0.201322 -0.954469 0.645048 0.655410 0.373126
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.460950 -0.939134 -1.336746 0.864844 3.683624 -0.763829 0.867216 -1.270367 0.648971 0.648667 0.376773
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.163958 -0.007166 0.692097 0.274244 2.468989 0.846656 -0.418869 0.590223 0.643192 0.656860 0.386634
128 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 1.510058 11.144545 7.676205 10.816285 3.265814 14.426074 -1.438952 -0.684768 0.534967 0.031794 0.378099
131 N11 not_connected 100.00% 0.00% 5.90% 0.00% -0.771330 11.340877 0.030828 4.504212 -1.285057 12.771432 -1.378057 -0.860387 0.607332 0.289147 0.433177
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.014561 2.455764 -0.927885 -1.427185 -0.888830 -0.567220 0.390097 -0.455311 0.580621 0.587539 0.376210
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.682926 0.363921 -0.850375 2.264982 -0.922628 2.289153 -1.009208 -0.804588 0.575499 0.610597 0.407855
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.642675 -0.973979 -0.922316 -1.442710 3.621005 1.235467 8.331819 -0.124047 0.581377 0.609810 0.410409
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 8.902339 -0.052592 9.914862 -0.930185 12.066066 0.320061 0.303306 -0.852688 0.040091 0.609725 0.465154
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.041308 -0.350575 0.332491 -1.260671 3.463113 -0.454924 0.540872 0.178196 0.586568 0.622450 0.400250
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.806252 -0.191396 1.769757 -0.670489 0.998346 -0.713788 -1.017669 -0.234579 0.616724 0.622864 0.377177
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.257261 -0.663234 -1.036939 0.092785 -0.559183 -0.086347 3.256837 1.865116 0.634040 0.654413 0.379780
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.473444 -0.598929 -0.161226 1.005220 2.637460 -0.709154 0.338335 -1.023378 0.635044 0.660808 0.377376
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.668466 11.559952 -0.532233 10.844717 5.329375 14.655838 24.468925 0.508518 0.632263 0.042322 0.512629
143 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -1.543826 0.166096 -0.712424 1.977574 0.063037 10.791993 -0.804739 -1.422671 0.652775 0.659258 0.376102
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.112405 -0.753038 -1.199859 4.536319 0.568482 0.232866 -0.946012 -0.795791 0.651568 0.630149 0.378917
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.904628 11.771793 10.349754 10.882005 11.701302 14.674502 0.535211 2.118834 0.066801 0.030511 0.025603
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.357139 -0.165488 1.705135 -0.678492 1.541519 -0.257696 -0.483265 0.966643 0.639197 0.638831 0.375569
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.435703 -1.575852 1.250559 2.370227 -0.539061 -1.121781 1.632913 0.257650 0.634074 0.639451 0.379985
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.241198 -0.014757 -0.508743 -0.710536 2.298649 1.752093 -0.930816 -0.941523 0.636382 0.651076 0.392672
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.399491 -1.145985 -1.157411 -1.264801 -0.518717 1.714064 0.178976 0.433638 0.628537 0.644514 0.397431
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.430770 -0.649420 -1.146146 -1.132662 -0.804807 1.037508 1.180006 0.527078 0.626711 0.639465 0.398601
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 20.945039 1.075749 0.017096 0.334442 6.087209 0.145217 6.754969 1.065847 0.497952 0.568157 0.350184
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.256139 -0.643075 10.076994 -1.594535 12.105632 0.199970 0.683628 1.200038 0.041814 0.610364 0.479469
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.513213 11.239098 8.401467 10.559624 5.251086 14.624747 0.668648 0.298363 0.420462 0.037189 0.324724
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.030201 -0.240055 0.027502 0.631294 -0.490423 0.200083 -0.341044 -0.087749 0.595702 0.619859 0.397103
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.200992 0.136423 -0.040237 -0.615016 3.502015 2.968956 1.878926 10.210356 0.612245 0.635541 0.398629
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.523204 16.800770 -1.502490 -1.036709 -0.260388 6.427683 -0.923355 46.805899 0.582233 0.548590 0.362064
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.635772 -1.016408 -0.259061 -0.772740 -0.658827 2.266686 0.341785 0.026998 0.625730 0.643370 0.383572
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.844138 27.276182 0.091991 -0.591378 0.315357 2.270238 -0.819958 -0.417888 0.631782 0.517533 0.344841
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 2.307298 -1.123978 -0.904804 -1.079664 2.082806 1.771286 1.371745 -0.247032 0.633819 0.659245 0.383178
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.532229 1.206993 -0.165836 0.356336 -0.151400 1.415642 -0.644892 0.265712 0.646230 0.656969 0.383346
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.804190 0.203020 0.672517 1.509790 5.547034 2.518955 0.485526 0.245485 0.640458 0.651149 0.372006
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 31.745046 0.010785 -0.420825 -1.187622 5.931431 0.213765 1.852119 0.203662 0.507802 0.657365 0.374574
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.597666 2.808544 -0.351006 3.689532 0.177844 6.229336 2.432617 0.494247 0.638604 0.647396 0.378391
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.715223 -0.965615 -1.360976 -0.244124 2.329284 -0.054000 0.361334 3.443352 0.645368 0.652563 0.386167
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.758465 -1.231855 0.406011 -0.474972 2.226186 0.750196 0.019088 2.099080 0.635759 0.647441 0.391485
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.703195 -0.964523 -0.869691 -1.332836 0.704758 0.799361 -0.545154 -0.506413 0.635854 0.649381 0.394891
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.544282 -0.577173 10.688049 -1.163271 11.812752 -0.243123 1.111965 4.934976 0.040825 0.644598 0.514258
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.785015 2.560020 -1.226312 0.561949 -0.616718 3.142839 -0.293762 0.626403 0.571483 0.551793 0.365453
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 11.746116 12.024941 3.786921 4.270670 12.106572 14.607111 1.752036 3.266676 0.040304 0.042776 0.004017
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.587260 -0.335975 0.034856 -1.417649 -0.681115 2.822916 -0.973021 1.528238 0.578434 0.632756 0.398617
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.307200 12.219839 -1.584100 10.999834 1.204313 14.507900 14.797961 1.334652 0.626701 0.048936 0.525527
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.393016 -0.220529 0.472774 0.399612 -0.266037 -0.246899 -0.114079 2.453352 0.631346 0.643010 0.387795
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.302551 11.215575 -0.978614 10.526135 -0.504977 14.682141 8.307907 0.717372 0.639518 0.043466 0.491110
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.795261 0.238833 -0.745965 -0.119184 2.048871 -0.234981 0.772149 -0.235278 0.631249 0.645380 0.375319
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.955892 -0.481371 -1.455436 -0.552737 -0.283819 -0.023154 1.634313 -0.470302 0.641056 0.657103 0.372036
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 32.849503 0.020476 -0.431100 -1.564988 13.009525 0.856798 8.674496 1.049602 0.522683 0.654365 0.377982
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.957559 -0.461605 0.484997 0.035034 -0.353864 -0.316731 -0.142954 1.902194 0.647782 0.660306 0.384993
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.972548 0.589197 -0.405786 2.171953 1.229669 0.121759 0.377400 -1.518077 0.634292 0.649487 0.379067
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 8.758183 11.093246 9.878840 10.665661 12.165811 14.763466 3.428550 1.532927 0.030047 0.030910 0.001523
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.057752 -1.186197 -0.662390 0.754177 -0.552182 0.631832 -0.386778 -0.766694 0.628753 0.649641 0.402831
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.455150 0.609439 1.431731 -0.514841 0.753247 0.493269 7.164609 1.157565 0.613677 0.632325 0.397516
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.764820 6.498962 5.286781 5.491434 8.479459 11.345362 -2.870974 -2.959195 0.577782 0.591733 0.388631
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.693850 0.302614 5.530418 1.672718 9.132831 3.153544 -2.826588 -0.426376 0.559922 0.599133 0.414327
200 N18 RF_maintenance 100.00% 100.00% 80.04% 0.00% 11.311171 31.129731 4.235059 1.261013 12.173240 8.374082 0.898542 14.693366 0.040826 0.165429 0.104246
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.342331 4.709233 3.423518 4.854156 3.668956 9.546019 -0.252015 -2.133003 0.617294 0.615640 0.383997
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.660221 3.325596 1.901542 -1.378673 1.187200 -0.567679 -0.533260 16.683450 0.622932 0.604608 0.379658
205 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.184535 2.400681 0.148793 -0.358352 -1.210761 -0.802854 -1.259277 3.927581 0.618343 0.602270 0.374427
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.770486 2.758333 2.751478 -0.611026 7.800316 0.896448 -1.409027 2.888993 0.622555 0.604883 0.379461
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.725321 3.160342 1.591522 -1.380670 0.800746 -0.194737 -1.375356 -0.723846 0.603420 0.589781 0.359413
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.525307 12.154182 9.612626 10.709036 11.620787 12.531765 9.652265 35.662269 0.025217 0.024548 0.001102
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.499333 7.334054 9.559345 9.839174 10.858752 15.034765 10.341970 12.103915 0.029195 0.026360 0.001416
210 N20 dish_maintenance 100.00% 0.11% 0.81% 0.00% 11.843937 6.651628 -1.037344 -0.918638 -0.935137 -0.387650 -0.017805 1.701466 0.447553 0.422315 0.296209
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.082624 2.240130 -1.240059 0.311395 -0.665382 0.282977 2.325333 0.070827 0.569180 0.586803 0.377719
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.066524 -0.901386 0.591949 -0.030251 -0.852117 1.357929 2.667445 -0.997815 0.609297 0.617464 0.381555
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.134542 -0.197492 -1.362118 -0.406947 0.130615 -0.473574 3.453393 -0.266029 0.590021 0.622071 0.387509
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.629654 -0.138619 -0.246513 0.489303 -0.293492 -0.128666 2.570199 -0.859835 0.602220 0.630729 0.388120
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.809302 1.762264 -1.395972 0.982415 -0.042452 -0.286153 -0.320332 -0.285695 0.593711 0.629948 0.391268
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.978208 6.286778 5.720269 5.565465 9.368268 11.491767 -3.082191 -3.067504 0.591819 0.608635 0.380115
225 N19 RF_ok 100.00% 0.00% 91.24% 0.00% 1.372367 11.839363 0.984782 4.462139 -0.750028 14.291877 -0.939890 0.392181 0.615609 0.133292 0.515666
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.338805 2.561611 0.206366 1.834798 -1.054245 5.453691 -1.206757 -1.343240 0.609068 0.612616 0.386119
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.872915 0.392372 -1.515114 0.393446 0.949574 0.057267 8.381194 0.341620 0.570120 0.609459 0.377479
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.828763 19.830850 -0.881621 -0.036053 0.346404 4.872157 5.184440 8.531815 0.538771 0.504760 0.323581
229 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.508593 0.053762 1.665485 1.769217 0.025849 1.953240 7.262791 -1.412320 0.592857 0.609972 0.396221
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.962697 0.100027 -0.059104 -1.366422 0.015422 -1.147020 -0.602892 -0.861273 0.541252 0.596009 0.400759
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.065083 -0.173552 1.596306 1.154111 -0.182376 -0.941954 -1.479906 -1.642773 0.604148 0.616979 0.393302
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.449198 -0.676585 0.636294 0.868073 0.004026 -0.871913 -0.409494 -0.081702 0.601955 0.617895 0.389682
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 26.984043 49.547299 0.569135 0.964607 5.284983 10.859669 5.335759 7.422557 0.474166 0.412400 0.275854
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.932930 3.839550 -0.778914 0.393971 -0.155475 1.298524 5.365917 12.834662 0.590977 0.568923 0.384859
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 47.562763 1.308933 0.324845 1.741062 11.142442 1.799325 9.313509 1.275248 0.382593 0.622685 0.450633
243 N19 RF_ok 100.00% 17.41% 0.00% 0.00% 58.223342 2.315017 1.037628 -1.297369 8.235456 -0.219792 0.613006 1.315166 0.262211 0.594951 0.473903
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.750419 1.888718 1.458721 -0.980490 3.085010 2.307543 1.857367 4.504289 0.473089 0.571241 0.383731
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.431995 1.946569 0.278049 -0.753640 -0.775565 -0.582661 -1.174523 -0.334202 0.583482 0.588093 0.384558
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.053675 6.628038 -0.592325 0.471655 5.843502 6.157582 0.754114 -0.728786 0.315439 0.314848 0.158715
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.353176 1.519909 0.810218 -0.204380 -0.594839 -1.015878 -0.761474 1.784186 0.581719 0.585011 0.388055
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.147555 7.240182 9.353876 10.215039 11.346794 13.131954 5.679941 17.371456 0.033038 0.026960 0.003736
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 5.917781 11.923825 2.724578 6.938736 1.572956 14.730037 22.182158 1.797306 0.431806 0.044282 0.344014
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.215034 2.227678 1.312753 1.931854 1.328864 2.349475 1.731456 0.325931 0.490768 0.507458 0.380423
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.571290 -0.869027 1.463390 -1.081775 0.875389 -0.831904 -1.665204 -0.865905 0.521868 0.523389 0.394806
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.066231 -0.390095 1.343988 -0.793010 3.916263 -0.449410 1.971637 0.175167 0.406692 0.514637 0.384660
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.482748 1.992353 -0.570277 -1.416258 0.263558 -0.403187 0.178508 -0.545466 0.451653 0.495231 0.371428
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 7, 9, 10, 15, 16, 18, 27, 28, 29, 32, 34, 36, 40, 42, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 62, 63, 64, 66, 68, 71, 72, 77, 78, 79, 80, 81, 82, 84, 86, 87, 92, 94, 96, 97, 101, 102, 103, 104, 108, 109, 110, 111, 113, 114, 117, 120, 121, 122, 123, 128, 131, 135, 136, 142, 143, 144, 145, 151, 155, 156, 158, 159, 161, 164, 165, 166, 170, 173, 179, 180, 182, 185, 189, 191, 192, 193, 200, 201, 202, 206, 208, 209, 210, 224, 225, 226, 227, 228, 229, 240, 241, 242, 243, 244, 246, 262, 320, 329]

unflagged_ants: [5, 8, 17, 19, 20, 21, 22, 30, 31, 35, 37, 38, 41, 43, 44, 45, 46, 53, 61, 65, 67, 69, 70, 73, 74, 83, 85, 88, 89, 90, 91, 93, 95, 105, 106, 107, 112, 115, 118, 124, 125, 126, 127, 132, 133, 137, 139, 140, 141, 146, 147, 148, 149, 150, 157, 160, 162, 163, 167, 168, 169, 171, 181, 183, 184, 186, 187, 190, 205, 207, 211, 220, 221, 222, 223, 237, 238, 239, 245, 261, 324, 325, 333]

golden_ants: [5, 17, 19, 20, 21, 30, 31, 37, 38, 41, 44, 45, 53, 65, 67, 69, 70, 83, 85, 88, 91, 93, 105, 106, 107, 112, 118, 124, 127, 140, 141, 146, 147, 148, 149, 150, 157, 160, 162, 163, 167, 168, 169, 171, 181, 183, 184, 186, 187, 190]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459972.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

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