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 = "2459984"
data_path = "/mnt/sn1/2459984"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 2-8-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/2459984/zen.2459984.21324.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/2459984/zen.2459984.?????.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/2459984/zen.2459984.?????.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 2459984
Date 2-8-2023
LST Range 3.782 -- 13.733 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1849
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
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 54 / 198 (27.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 116 / 198 (58.6%)
Redcal Done? ❌
Never Flagged Antennas 82 / 198 (41.4%)
A Priori Good Antennas Flagged 47 / 93 total a priori good antennas:
3, 5, 7, 10, 15, 16, 21, 29, 38, 40, 42, 44,
53, 54, 55, 66, 71, 72, 81, 86, 94, 101, 103,
105, 109, 111, 121, 122, 123, 127, 136, 140,
144, 151, 158, 161, 165, 170, 173, 182, 185,
187, 189, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 36 / 105 total a priori bad antennas:
4, 22, 35, 43, 46, 49, 61, 62, 64, 73, 74,
89, 114, 115, 120, 125, 132, 133, 137, 139,
179, 220, 222, 226, 228, 229, 237, 238, 239,
240, 241, 244, 245, 261, 324, 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_2459984.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.726023 14.401620 10.321377 11.101668 9.391122 12.064181 2.367805 2.960199 0.029991 0.032847 0.003493
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.252688 -0.206033 2.389492 -0.287189 -0.891889 -0.864039 0.748082 -1.225930 0.598080 0.627781 0.383017
5 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 2.156387 -0.715514 0.199978 -0.023005 5.517122 1.177252 -0.374289 -0.523027 0.622912 0.626758 0.368867
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.209220 -0.862740 -1.384338 -0.273433 -0.135950 7.469842 9.151951 2.145322 0.628428 0.643673 0.365846
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.893230 3.944741 3.550513 2.816864 5.246720 30.278917 -0.109630 2.594602 0.609338 0.623554 0.358829
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.176601 -0.656724 3.373500 -0.998789 -0.951005 0.219908 1.250393 -0.700529 0.604375 0.642496 0.373111
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.177277 -0.573955 -1.360920 -1.358505 81.754315 0.023802 1.612069 0.009778 0.613683 0.638443 0.367299
15 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 11.027892 14.130848 9.755739 10.499861 9.381529 12.069178 1.621726 1.997947 0.027163 0.026779 0.001439
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 11.086540 -0.571643 10.304240 0.612398 9.384578 1.290409 1.962227 1.204743 0.034150 0.637884 0.521385
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.026028 2.457453 0.353868 0.487848 0.176208 1.019027 -0.301678 -0.227776 0.631184 0.642979 0.368054
18 N01 RF_maintenance 100.00% 100.00% 53.70% 0.00% 11.810517 20.618816 10.309659 0.078739 9.415445 8.140085 2.023155 16.749410 0.029187 0.228719 0.175237
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.782090 0.491089 -1.405581 0.982376 -0.653386 0.953150 -0.787704 -0.647326 0.639410 0.651649 0.364378
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.253564 -1.274419 0.607421 -0.747898 0.769561 0.110581 0.223052 -0.727750 0.635049 0.644468 0.356849
21 N02 digital_ok 100.00% 1.14% 0.00% 0.00% 1.089038 0.059707 -0.766085 0.082379 22.668473 4.148904 1.958216 0.793404 0.616801 0.632056 0.357140
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.961198 -0.728946 0.047846 -0.361253 0.512134 -0.312134 0.935849 0.236597 0.580800 0.596616 0.346555
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.408308 13.454309 10.357270 10.909519 9.440773 12.104785 3.167326 2.906987 0.035315 0.038735 0.004812
28 N01 RF_maintenance 100.00% 0.00% 83.61% 0.00% 10.154441 27.285524 -0.425236 4.015087 9.298397 16.900102 0.872628 18.392528 0.381798 0.167953 0.270086
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 11.065185 13.883228 9.963977 10.519435 9.401187 12.084102 2.007096 1.935960 0.030219 0.037884 0.007853
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.344922 0.450173 0.221085 -1.382928 1.340130 -0.021840 0.407963 -1.108253 0.633611 0.656921 0.364522
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 3.650245 1.452855 0.519885 0.714967 0.791753 0.003513 -0.490581 -0.050355 0.646979 0.645643 0.351818
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 24.403511 27.258824 1.231374 1.033424 0.731835 1.852401 0.389193 0.141460 0.527376 0.547568 0.209899
34 N06 not_connected 100.00% 100.00% 98.05% 0.00% 12.680803 15.114718 4.919522 5.311053 9.632841 12.111157 5.124549 5.102676 0.035316 0.084502 0.035035
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.964689 -1.037666 1.358449 -1.124299 1.401420 -0.719394 1.133341 1.655765 0.592420 0.594622 0.345830
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 28.420057 28.528233 13.591203 13.644808 9.394766 11.802545 5.612791 5.849313 0.033933 0.031440 0.001498
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.717707 0.527682 -1.315392 0.812507 0.307563 1.636533 -0.571450 2.844369 0.625370 0.632576 0.379523
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.327538 0.416729 0.498445 0.709575 1.286902 1.054821 4.254054 1.129675 0.632457 0.630161 0.373500
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 10.408194 0.827301 9.992239 0.706984 9.605698 0.333771 4.206071 1.935483 0.040007 0.635771 0.484686
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.417096 0.404466 -0.338120 0.115603 -0.116090 -0.028410 -0.291210 -0.155727 0.635058 0.650915 0.355391
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.115084 2.374336 -1.385580 8.478657 0.112834 2.124424 -0.595501 0.978075 0.653177 0.559580 0.391203
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.099135 0.255954 -0.285288 0.713755 2.973647 0.635964 0.063410 0.995880 0.644719 0.651105 0.355357
44 N05 digital_ok 100.00% 98.54% 98.00% 0.05% 225.037816 224.481261 inf inf 4434.335152 4383.889511 5471.482761 5322.175669 0.264170 0.322668 0.234231
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.116993 1.070145 0.397513 0.605968 -0.163393 0.407666 0.009701 1.584857 0.637570 0.647680 0.354012
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.250072 0.239958 -0.596529 -0.966830 0.538169 -0.408055 0.787634 -0.231919 0.639350 0.657708 0.364901
47 N06 not_connected 100.00% 100.00% 99.08% 0.00% 12.040574 14.687224 4.822874 4.974057 9.579906 12.154149 5.155234 3.860397 0.030239 0.058260 0.019446
48 N06 not_connected 100.00% 100.00% 0.00% 0.00% 12.980854 7.045926 4.346316 1.340158 9.593825 2.800261 4.548056 1.711592 0.040208 0.597016 0.450987
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.986794 -0.297783 -1.308679 0.153845 0.508198 0.440683 1.464603 1.991001 0.568819 0.598044 0.349622
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.947172 3.435474 0.588819 1.050975 1.401912 2.236106 4.957280 7.420705 0.602765 0.609122 0.359122
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 12.434703 4.298193 -0.162113 1.777812 5.193511 4.189214 28.167482 0.344776 0.511031 0.525020 0.245050
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.269347 6.606657 -0.489463 0.594511 0.965701 1.742284 1.158035 1.022830 0.635235 0.644033 0.370136
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 5.306628 14.865301 -1.250884 -0.974986 -0.583678 -0.974359 0.098839 -0.305900 0.640572 0.633365 0.363114
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 28.177361 -0.433386 4.709529 -0.592168 2.774893 0.307975 2.578896 -0.018656 0.480924 0.657800 0.360216
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.418535 14.834575 10.386710 11.038270 9.516811 12.164896 3.373939 4.882826 0.028114 0.032567 0.003869
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.522700 0.798480 -0.514017 1.537949 -0.587043 1.988330 0.082978 1.036250 0.644814 0.663980 0.355219
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 31.434782 1.112166 5.189623 -0.992873 15.865778 0.252637 0.915406 0.828341 0.482394 0.670819 0.359402
58 N05 RF_maintenance 100.00% 98.11% 98.05% 0.05% 154.029562 184.098756 inf inf 3625.234117 4103.439951 2934.623843 2883.844642 0.296495 0.275966 0.245507
59 N05 RF_maintenance 100.00% 97.46% 97.84% 0.00% 148.523663 144.524644 inf inf 2678.966306 2557.196103 4895.067604 4822.578202 0.355465 0.363703 0.330246
60 N05 RF_maintenance 100.00% 0.00% 96.54% 0.00% -0.039342 13.696569 -1.050339 11.049341 0.261141 12.128400 1.285173 5.192158 0.642173 0.094446 0.503579
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.531207 -0.312967 0.031071 -1.244119 0.757020 -1.043787 0.978356 1.927399 0.577360 0.616468 0.350294
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.893571 0.985380 0.921159 1.092942 -0.153515 0.889767 -0.268266 -0.254708 0.609629 0.618039 0.350290
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 1.578614 14.167483 -0.465839 5.390905 -0.333460 12.133528 -0.241904 3.992269 0.592777 0.046602 0.474245
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.375081 -0.220681 -0.695054 -0.724944 -1.178910 -1.342349 -0.359591 0.214625 0.590879 0.588604 0.341307
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.216354 1.229729 0.684656 0.271609 0.247861 1.913884 0.534503 0.690749 0.612087 0.627872 0.382589
66 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.728089 1.757630 -1.322643 -0.765321 -0.510202 12.723418 -0.605465 1.197284 0.626285 0.644537 0.380755
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.462018 -0.854437 -0.581609 0.667361 -0.003670 1.849383 0.272004 1.470701 0.639369 0.644429 0.366720
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 18.768121 29.607294 1.088168 14.320372 7.494556 11.818663 0.816425 7.997760 0.380872 0.032158 0.290033
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.366727 -0.639630 0.554411 0.771907 0.241076 1.448870 0.687752 0.671023 0.641129 0.658815 0.354347
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.658395 -0.185269 -0.784609 -0.004984 0.004539 1.207359 0.511618 0.826067 0.654028 0.666615 0.353918
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.291557 0.692786 0.686047 1.343086 0.806512 0.797979 0.662182 1.554253 0.646662 0.666422 0.348249
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.560591 15.027025 10.704545 11.392325 9.388184 12.024185 2.214942 2.591855 0.036350 0.040349 0.005341
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.825907 1.078638 -1.400811 -0.321175 -0.003513 1.128740 0.207371 0.310635 0.655318 0.661644 0.350553
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.265699 0.447142 -0.005243 -0.514688 -0.431358 1.891020 0.739570 2.237432 0.653641 0.660100 0.351906
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 58.945225 26.679514 0.574541 -0.570484 6.002112 5.367520 3.379624 2.665035 0.332835 0.496203 0.268863
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 31.843441 0.795673 -0.391064 1.313570 3.404819 1.774430 2.104639 1.327276 0.452271 0.630895 0.351192
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.144726 14.490447 -0.672347 5.381731 -0.918269 12.035968 -0.928425 1.587933 0.615256 0.042605 0.469840
80 N11 not_connected 100.00% 0.00% 98.43% 0.00% -0.743549 15.407205 0.347131 5.294042 -0.551854 12.023976 -1.162679 2.428144 0.616107 0.059480 0.463670
81 N07 digital_ok 100.00% 0.00% 99.35% 0.00% -0.230132 14.598592 0.097942 9.647678 0.514212 12.190992 3.243135 6.173817 0.591395 0.041844 0.454481
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.906245 11.259165 0.567548 3.588182 -0.301044 -0.483934 -0.530823 0.181316 0.606277 0.587386 0.352694
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.280151 0.699897 0.258452 0.568310 0.227659 -0.110202 1.052225 1.792851 0.626571 0.634072 0.360418
84 N08 RF_maintenance 100.00% 53.38% 100.00% 0.00% 19.947623 26.004481 13.080919 13.871656 6.843278 11.775939 3.343727 4.980789 0.234537 0.038213 0.149218
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.290987 0.048371 0.145565 0.806152 -0.575651 0.047870 -0.697640 -0.285438 0.643944 0.657714 0.355858
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.592313 -0.298762 1.539186 2.060642 -1.072574 7.800336 -0.266593 11.357686 0.628721 0.646447 0.335454
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 28.610653 7.741712 1.257220 0.097762 1.755182 -0.151613 1.987626 0.620954 0.538018 0.676023 0.330622
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.828785 0.671079 0.373718 1.122473 -0.600356 -0.563662 3.383055 0.878111 0.654142 0.665413 0.343880
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.414591 0.495282 0.347305 1.011727 -0.370298 0.368806 -0.231097 0.119402 0.651629 0.667176 0.346415
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.594459 0.091458 0.761218 -1.247730 -0.615869 4.502212 -1.383814 1.546181 0.662280 0.672338 0.353205
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.471815 0.955129 0.551925 0.624789 0.024786 0.743591 -0.622285 -0.615615 0.643115 0.662700 0.355825
92 N10 RF_maintenance 100.00% 0.00% 4.38% 0.00% 35.444619 44.363303 0.644535 0.606764 7.839015 6.979963 1.263903 1.979031 0.312779 0.277693 0.064932
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.626251 -0.677902 2.403695 -1.041679 1.149476 0.218618 1.538518 -0.931408 0.638434 0.661914 0.364236
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.992098 14.257713 10.455013 10.916058 9.445148 12.085571 2.227708 2.283510 0.033456 0.026201 0.003255
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 7.002553 3.754353 -0.655235 0.688850 0.780676 0.775610 -0.045713 0.816573 0.566650 0.609738 0.334156
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 4.713998 18.014385 3.547655 1.694252 4.928443 4.766650 -1.012766 -0.578888 0.612137 0.535558 0.339449
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.291401 4.954732 -0.570543 1.709156 -1.191589 7.427568 -0.661599 6.914275 0.602533 0.554013 0.356879
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.127702 7.743737 -0.228220 1.165947 0.400923 0.942917 -0.302600 0.048096 0.642874 0.650572 0.355346
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.710936 1.410376 -0.557740 -1.255173 9.859419 -0.384503 0.129986 1.043895 0.645309 0.663159 0.356766
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.513323 4.304693 3.335726 -1.216700 4.471373 -1.417560 -0.532338 0.727201 0.638812 0.656441 0.346334
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.669874 61.458419 -0.448707 7.787141 1.775766 -0.061968 0.239374 4.263568 0.659017 0.638592 0.347567
105 N09 digital_ok 100.00% 0.00% 0.00% 0.00% -0.152444 0.201151 -1.203905 1.068951 4.252853 0.443034 -0.913383 -0.318311 0.664287 0.667516 0.342760
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.826522 -0.396639 -0.811482 -0.111283 -0.815890 -1.122809 -0.588350 -0.643365 0.659047 0.655801 0.339156
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.881038 -0.102726 -1.356273 -0.898084 -0.651962 -0.282586 -0.780999 0.677959 0.657007 0.672605 0.348867
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.994953 44.958909 10.298232 1.156448 9.456326 6.923939 2.981381 2.082549 0.035685 0.307323 0.170907
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.759539 13.805812 10.342540 10.793222 9.441090 12.122993 1.849621 2.911624 0.026599 0.029316 0.002005
110 N10 RF_maintenance 100.00% 54.14% 0.00% 38.94% 17.385786 28.892854 11.315183 6.289829 4.097454 2.767764 2.072405 0.408682 0.199574 0.337687 -0.122866
111 N10 digital_ok 100.00% 0.00% 96.92% 0.00% 33.802738 13.670705 1.419952 10.885485 2.035136 12.064654 -0.029231 3.225242 0.507056 0.082348 0.315370
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -1.138702 -0.766256 0.241746 0.105320 0.549193 0.879656 -0.150972 -0.500379 0.640765 0.651371 0.363618
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.922209 15.105341 4.539905 5.375088 9.371786 12.024830 2.577092 2.146315 0.037319 0.031491 0.002961
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.715744 0.939496 0.414143 0.000553 1.654467 -0.540703 -1.097157 -1.161329 0.586946 0.622224 0.359619
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.238056 -1.155000 -1.056502 0.123198 -1.181835 -0.834114 -0.443233 -1.095105 0.585563 0.616299 0.370820
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.861993 15.406020 10.405421 11.377213 9.521369 12.196134 4.474443 6.378700 0.028493 0.033852 0.003597
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.458358 1.707179 0.139546 0.746756 0.072994 0.777748 -0.273192 0.083341 0.622766 0.640986 0.369130
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.463950 1.538891 2.858246 -0.764485 -0.476992 -1.421958 0.880660 -1.447386 0.636097 0.663158 0.359101
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.607669 5.236911 -1.160394 1.594611 0.152292 1.271674 1.979724 12.035173 0.659710 0.668432 0.351495
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.295119 7.051523 -0.955837 -1.173639 3.149929 -0.052028 -0.399212 -0.972942 0.658639 0.676248 0.350738
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.177123 8.657505 0.784430 1.182922 0.660957 1.107596 -0.223566 0.532799 0.665931 0.673843 0.348466
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.433938 0.635109 0.281079 0.874114 0.039125 0.078375 0.397759 0.357201 0.665881 0.667266 0.347285
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.056470 -0.288907 0.450817 1.302518 -0.349712 -0.547824 -0.530438 -0.348994 0.661808 0.668327 0.349957
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 28.245025 1.171223 0.089878 1.156184 2.479431 6.954134 2.597129 -0.032540 0.556716 0.665802 0.340377
127 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 2.016670 0.694455 0.377703 0.441014 6.098390 1.764132 -0.231706 -0.144691 0.658151 0.675491 0.359502
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.600568 -0.388858 -1.181775 -0.089611 -0.690780 -1.833241 -0.702336 1.371700 0.658982 0.672530 0.362505
131 N11 not_connected 100.00% 0.00% 4.92% 0.00% -0.314482 13.582089 0.063718 5.269751 -0.977349 10.211850 -1.119237 1.065217 0.620294 0.299752 0.409159
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.631730 0.031208 -0.866793 -1.378836 0.418826 -0.962083 -1.272424 -0.984932 0.601935 0.618926 0.357241
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.043089 -1.142583 -1.309070 -0.582733 -1.703455 -1.730350 -1.035079 -0.365583 0.588705 0.618683 0.372841
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.930607 16.186780 4.101000 4.785822 9.357514 12.024315 1.752539 2.173601 0.042540 0.036116 0.003267
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.451681 -0.580964 -1.299288 0.518610 3.246230 48.665972 2.190451 4.934166 0.596983 0.617240 0.376834
136 N12 digital_ok 100.00% 98.65% 0.00% 0.00% 9.979405 8.050072 9.933745 -0.423625 9.420960 -0.427381 2.664149 -0.367228 0.045148 0.606902 0.441883
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.033596 -0.584922 -0.067962 -1.340704 -0.261462 -0.863933 1.335169 1.501247 0.608342 0.636816 0.371099
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.782731 1.551550 1.414890 -0.832248 0.941467 -0.589018 -0.745238 -0.518754 0.631002 0.632292 0.350716
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.384358 -0.899974 -0.317842 -0.407446 16.423680 -1.428476 3.212782 1.061794 0.644741 0.663105 0.352237
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.054588 -0.365295 -0.294978 0.708768 0.723385 -0.372924 -0.141303 -1.185117 0.650481 0.668262 0.350375
142 N13 RF_maintenance 100.00% 0.00% 98.27% 0.00% 1.296920 13.785705 -0.921792 11.057506 0.426138 12.123729 12.238915 3.592015 0.657859 0.053064 0.526559
143 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.048267 -0.505061 -1.014882 1.060399 -0.016512 0.730838 0.421292 1.217806 0.661688 0.664833 0.345014
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.220775 0.844095 -1.107133 5.753545 -0.189608 23.378928 -0.011383 3.162965 0.665838 0.636338 0.356996
145 N14 RF_maintenance 100.00% 62.74% 100.00% 0.00% 15.774145 14.028727 9.087682 11.091909 7.622572 12.140309 2.170073 4.785875 0.214457 0.032500 0.145303
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.561478 0.779873 -0.961059 0.323493 -0.764992 0.159158 -0.693965 -0.966644 0.639491 0.659382 0.350390
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.014408 -0.433393 2.049705 2.507631 -0.292592 -0.271546 0.620776 0.810165 0.643533 0.651551 0.346583
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.930575 0.316064 -0.562117 -0.663152 0.887924 0.902779 -0.407560 -0.691141 0.648835 0.667490 0.364390
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.122120 -1.059245 -1.166509 -1.134757 -0.268264 0.003721 -0.607126 -0.397540 0.645084 0.660140 0.368404
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.187731 3.171749 -0.016703 -1.181626 -1.318498 -1.112390 -0.561706 0.079373 0.638505 0.635669 0.361824
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 24.216554 0.744913 -0.333532 0.512522 3.325751 -0.850408 0.675238 0.998490 0.487972 0.599663 0.331855
155 N12 RF_maintenance 100.00% 98.32% 0.00% 0.00% 10.801976 -1.224987 10.097112 -1.411951 9.492571 11.634578 3.795294 2.562359 0.049867 0.624867 0.471119
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.407261 13.493964 7.901097 10.805990 2.625487 12.109887 1.093452 3.170391 0.481113 0.041126 0.370209
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.580429 -0.169114 0.115377 0.744909 -0.129690 1.059552 1.073419 1.289383 0.611493 0.635682 0.368419
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.272726 -0.500275 -0.344963 -0.849345 -0.225249 0.584866 2.401017 7.932037 0.627969 0.650297 0.369546
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.565746 26.432240 -1.323198 -0.656373 -1.259579 3.814309 -0.655422 0.027284 0.602015 0.525590 0.333207
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.954159 -1.005117 -0.144443 -0.840261 -0.324742 0.214345 0.297166 1.222702 0.641631 0.658813 0.357505
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.725061 31.874529 -0.425881 -0.289909 0.370080 2.200087 1.342922 2.625696 0.649344 0.539948 0.323739
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.865532 -1.333101 0.253306 -0.681621 -1.236691 -1.174973 -0.565388 -0.925734 0.659598 0.672526 0.355533
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 1.307294 1.737404 -0.136724 0.524166 2.250583 1.858010 0.108319 0.221877 0.661828 0.673085 0.355876
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.602563 0.307619 0.895409 0.696153 2.284984 1.863656 0.865494 0.827041 0.656000 0.665398 0.346979
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 29.525694 0.515110 -0.187638 -0.996280 3.059809 -0.200185 0.311672 -0.751772 0.526078 0.673693 0.342704
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.185640 3.062204 -1.323022 2.813364 -0.714361 5.362321 -0.663342 -0.567754 0.643591 0.657123 0.350988
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.773042 -0.635753 -1.411486 -0.435076 0.379001 1.327660 -0.303297 0.772214 0.651958 0.667453 0.357120
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.631696 -1.072315 0.159651 -0.245147 1.108883 1.170906 0.524782 0.432212 0.650133 0.663478 0.363245
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.039636 1.299300 -0.940738 -1.346004 0.998421 0.418790 0.492227 0.027877 0.646499 0.661077 0.365005
170 N15 digital_ok 100.00% 99.03% 0.00% 0.00% 11.788309 -0.446062 10.596327 -0.632140 9.426842 1.091928 3.648700 2.519562 0.045912 0.656053 0.509673
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.242703 3.351871 -0.952060 0.589345 -0.658201 0.140287 0.505395 0.720944 0.587521 0.568595 0.329278
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 13.251489 14.857078 4.306914 5.026430 9.491630 12.110749 3.972101 6.357414 0.040623 0.045243 0.003626
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.042413 0.988487 -0.481177 -1.121816 -0.268226 -0.437687 -0.367822 -0.670005 0.622985 0.644211 0.364633
180 N13 RF_maintenance 100.00% 0.00% 98.27% 0.00% 0.505360 14.504414 -0.973804 11.184698 1.800512 12.089798 2.308120 4.299921 0.641237 0.059343 0.520721
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.482596 -0.152337 1.124875 0.464500 0.985912 0.559428 0.310436 3.277841 0.643440 0.656465 0.358817
182 N13 digital_ok 100.00% 0.00% 98.32% 0.00% 0.250117 13.486348 0.263684 10.784678 3.021609 12.121424 -0.904084 3.598452 0.655934 0.055124 0.491368
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.157471 1.354537 -0.100754 1.017279 -0.215033 0.175720 -0.009701 -0.244180 0.644632 0.657718 0.342902
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.089436 -0.660862 -0.879053 -0.269588 -0.286724 0.757618 -0.773258 -0.151626 0.661809 0.670640 0.343159
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 35.833774 0.106478 1.100227 -1.265024 4.690301 -0.843340 0.069213 -1.029453 0.529087 0.670310 0.346885
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.732447 -1.086917 0.414360 -0.448247 0.022166 -1.129130 -0.778014 -0.829807 0.637190 0.672780 0.359056
187 N14 digital_ok 100.00% 19.09% 0.00% 0.00% 9.712101 -0.838292 9.805079 -0.015853 7.437726 -1.683724 1.773330 -0.638425 0.266622 0.666276 0.452248
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 9.221506 13.395248 9.844261 10.911747 9.940088 12.160367 19.744460 4.409950 0.028535 0.032747 0.002035
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.095650 -1.329463 -0.551635 0.146387 0.408466 -1.243570 0.314910 -0.648109 0.636596 0.656809 0.374688
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 1.112500 0.108664 1.455163 -0.393919 0.640297 1.012206 10.164873 1.546351 0.614493 0.643093 0.373930
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.472251 6.801872 4.334032 4.352519 6.734701 10.302959 -0.824120 -0.785601 0.582327 0.586579 0.361864
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.832471 0.906732 4.293076 1.349666 18.210752 1.944512 2.195187 -0.499372 0.572062 0.604347 0.387392
200 N18 RF_maintenance 100.00% 100.00% 54.52% 0.00% 12.705522 39.122061 4.711912 -0.080235 9.556535 7.584600 4.041964 5.494849 0.041085 0.230050 0.154050
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.042391 4.955724 2.925919 3.745971 5.018492 8.572818 -0.592324 -0.830624 0.623274 0.625966 0.356239
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.392458 3.199609 1.447020 -1.155738 1.124725 -0.526351 -0.686512 21.125962 0.639003 0.632580 0.349849
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.195449 15.918147 1.451734 -0.955345 -0.094204 0.267634 14.464194 0.800021 0.637208 0.665970 0.359425
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 9.595345 1.389908 3.420845 -1.265851 6.980988 -0.901519 1.257132 4.689664 0.387451 0.637687 0.429539
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.131554 6.010283 -0.280913 2.524857 0.060005 3.210702 -0.458938 0.042762 0.597532 0.542780 0.344417
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.863854 -0.514742 -0.646775 -0.187887 -1.149880 -1.175455 4.235805 -1.230087 0.627277 0.643063 0.354710
208 N20 dish_maintenance 100.00% 92.97% 93.73% 0.00% 180.475746 179.143094 inf inf 4005.222490 3813.229423 5480.841172 5201.287383 0.394728 0.381988 0.348642
209 N20 dish_maintenance 100.00% 93.73% 93.89% 0.00% 185.149306 184.895650 inf inf 4228.707023 4161.569110 4731.039381 4633.292214 0.376426 0.403444 0.341717
210 N20 dish_maintenance 100.00% 93.46% 93.89% 0.00% 191.183952 190.028844 inf inf 4881.846553 4881.034544 4958.822734 4925.992172 0.413835 0.381425 0.345910
211 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 0.251414 6.328070 -1.350556 -0.193234 -1.594968 0.389311 -1.074282 -1.301436 0.588024 0.586254 0.350503
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.490062 -1.549202 0.465774 -0.463928 -0.794510 -0.769239 1.240078 -1.400270 0.628794 0.634294 0.355048
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.770946 -0.524640 -0.076944 -0.842040 5.795831 -1.367137 1.329111 -1.083911 0.620916 0.640564 0.355759
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.368998 -0.689880 -0.000553 0.027332 -1.061359 -1.178449 0.117963 -1.398931 0.628049 0.648139 0.358196
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.960050 -0.506773 -1.251943 -0.036578 -1.306700 18.598146 -0.448319 0.542642 0.612320 0.645908 0.360741
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.618035 6.186250 4.816014 4.241310 8.031875 9.884554 -0.807268 -0.540066 0.596220 0.617710 0.357702
225 N19 RF_ok 100.00% 0.00% 81.67% 0.00% -0.368139 13.784398 0.827147 5.159750 -0.198687 11.781676 -0.084885 3.775051 0.631374 0.171291 0.496262
226 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.544709 0.209577 -0.522301 0.997787 -1.163400 1.046865 -0.651758 -0.378735 0.619919 0.642345 0.366114
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 3.900299 0.635615 2.041919 -1.181360 1.840583 10.232791 4.033852 2.755186 0.522048 0.615929 0.385327
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.679849 -0.468267 1.072851 -1.345977 0.382808 -1.667010 0.191038 -0.629326 0.600020 0.608742 0.356450
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.074990 0.461123 0.573920 1.270788 -0.582108 1.653205 -1.460821 -1.507004 0.600345 0.616133 0.376405
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.582988 -0.591610 -0.038173 -1.366949 -0.505945 -1.551733 -0.598966 -1.080545 0.573198 0.618971 0.368848
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.014408 -0.617758 0.960035 0.499233 0.127176 -0.426640 -0.819017 -0.970808 0.619511 0.634343 0.364484
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.851311 -1.097001 -0.197644 0.233814 -0.705016 -0.532129 0.257540 0.717469 0.621516 0.637703 0.363738
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.474974 -0.225048 -0.035115 -0.423656 -0.221248 -1.597118 1.993057 0.727779 0.609723 0.632763 0.362548
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.373530 -0.910886 -0.305733 0.034325 -1.126134 -1.352200 0.159142 -1.461503 0.613052 0.638251 0.371525
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 23.951829 0.105990 -0.135022 0.997401 3.087513 0.284456 -0.736498 -0.829674 0.479609 0.633449 0.364464
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 36.515554 -0.839168 0.640040 -1.432858 12.636936 -1.705085 5.398249 -0.768421 0.414847 0.617456 0.379299
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.506404 -1.231579 -0.763837 -1.093164 -0.655182 -1.834456 0.170512 1.996682 0.574042 0.620745 0.369684
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.356316 0.102003 1.099233 -0.681841 0.764391 -1.523677 -1.428930 -0.723039 0.595823 0.612332 0.367775
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.325397 14.910039 -0.667381 4.915423 -0.111494 12.087065 -0.608584 1.995096 0.588393 0.040724 0.514162
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.242015 2.024998 0.389897 -0.322417 -0.231943 0.307805 -0.567795 -0.595667 0.596486 0.590688 0.361796
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.679913 7.915764 9.631536 10.411977 9.310335 12.700458 13.431223 25.512787 0.034578 0.028717 0.005295
320 N03 dish_maintenance 100.00% 99.51% 100.00% 0.00% 15.576137 14.507321 7.064502 7.477574 9.475072 12.177867 3.397445 4.658011 0.059605 0.051272 0.007169
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 2.067631 3.210835 0.987964 1.234048 1.102378 2.226959 0.832473 -0.038465 0.501144 0.522354 0.357953
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 2.272658 0.007147 1.107066 -0.674310 1.213715 10.996184 -1.146852 0.342104 0.535743 0.547802 0.374599
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.293128 -0.307284 -0.173841 -0.939338 11.795635 0.112100 5.091965 0.307098 0.510521 0.533215 0.365230
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.462085 3.284846 -1.117251 -0.683183 0.711760 0.027351 0.983110 -0.566425 0.491476 0.518169 0.353289
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, 5, 7, 8, 10, 15, 16, 18, 21, 27, 28, 29, 32, 34, 36, 38, 40, 42, 44, 47, 48, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 63, 66, 68, 71, 72, 77, 78, 79, 80, 81, 82, 84, 86, 87, 90, 92, 94, 95, 96, 97, 101, 102, 103, 104, 105, 108, 109, 110, 111, 113, 117, 121, 122, 123, 126, 127, 131, 134, 135, 136, 140, 142, 144, 145, 151, 155, 156, 158, 159, 161, 165, 166, 170, 173, 180, 182, 185, 187, 189, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 221, 223, 224, 225, 227, 242, 243, 246, 262, 320, 325, 329]

unflagged_ants: [4, 9, 17, 19, 20, 22, 30, 31, 35, 37, 41, 43, 45, 46, 49, 56, 61, 62, 64, 65, 67, 69, 70, 73, 74, 83, 85, 88, 89, 91, 93, 106, 107, 112, 114, 115, 118, 120, 124, 125, 128, 132, 133, 137, 139, 141, 143, 146, 147, 148, 149, 150, 157, 160, 162, 163, 164, 167, 168, 169, 171, 179, 181, 183, 184, 186, 190, 220, 222, 226, 228, 229, 237, 238, 239, 240, 241, 244, 245, 261, 324, 333]

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