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 = "2459970"
data_path = "/mnt/sn1/2459970"
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-25-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/2459970/zen.2459970.21288.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1851 ant_metrics files matching glob /mnt/sn1/2459970/zen.2459970.?????.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/2459970/zen.2459970.?????.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 2459970
Date 1-25-2023
LST Range 2.853 -- 12.815 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
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 54 / 196 (27.6%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 114 / 196 (58.2%)
Redcal Done? ❌
Never Flagged Antennas 82 / 196 (41.8%)
A Priori Good Antennas Flagged 45 / 93 total a priori good antennas:
3, 7, 9, 15, 16, 29, 38, 40, 42, 45, 53, 54,
55, 56, 71, 72, 81, 86, 94, 101, 103, 109,
111, 121, 122, 123, 128, 136, 143, 144, 146,
151, 158, 161, 165, 170, 173, 182, 185, 187,
189, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 34 / 103 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 61, 62, 64, 73,
74, 82, 89, 95, 114, 115, 125, 132, 133, 137,
139, 211, 220, 221, 222, 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_2459970.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% 10.370540 13.468064 10.205720 -1.036907 10.523041 4.484674 -0.020522 5.723524 0.031728 0.344952 0.276977
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.599142 0.145044 2.488792 1.241137 3.356022 2.303336 9.022834 1.477673 0.597816 0.630007 0.406439
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.120923 0.001751 0.643568 0.206586 1.394043 2.508450 0.230537 -0.767365 0.614689 0.630263 0.395016
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.855509 -0.122774 -1.209019 -0.246209 -0.283985 -0.165580 11.892741 11.095833 0.621944 0.636760 0.389044
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.422212 -1.344015 -0.601427 0.028417 -0.712664 0.647355 2.639524 0.654677 0.619966 0.631955 0.384644
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.648003 -0.988026 8.486506 -0.445746 6.390672 0.022393 0.283411 -0.538873 0.446930 0.632608 0.461697
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.198524 -0.470200 0.392865 -1.462474 2.755477 1.593462 1.376309 -0.152980 0.605621 0.631258 0.395526
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.577211 18.031099 9.587412 0.022524 10.520011 4.734562 -0.736131 2.403218 0.031393 0.346315 0.268441
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.599240 -0.746200 10.169899 0.795168 10.518668 2.236178 -0.004972 2.067283 0.030458 0.637478 0.520264
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.754879 1.621092 0.414119 0.377698 -0.243531 0.140386 0.254788 0.011464 0.624773 0.641407 0.392928
18 N01 RF_maintenance 100.00% 100.00% 44.57% 0.00% 11.260218 18.124987 10.144732 -0.648283 10.694122 7.983350 -0.441479 15.365767 0.029461 0.230626 0.179528
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.942713 -0.742592 -1.198085 -0.908969 -0.604721 1.284608 0.265904 2.014939 0.626625 0.646811 0.386394
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.509845 -0.826211 2.590483 -1.119024 -0.413039 0.925747 0.571758 -0.344883 0.619476 0.645214 0.394726
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.113477 -0.341542 -0.670386 0.041498 0.020915 1.688462 0.641821 0.533925 0.614834 0.628526 0.385584
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.541989 -0.206174 0.682413 0.358343 1.101827 1.659333 0.106543 -0.460506 0.586061 0.601456 0.385566
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.965025 12.259131 10.208865 10.678655 10.685068 12.413769 1.066881 0.729205 0.032634 0.035226 0.003793
28 N01 RF_maintenance 100.00% 0.00% 88.28% 0.00% 11.570161 26.010879 -0.245763 2.661632 6.343057 10.671444 4.336178 18.350094 0.363258 0.159727 0.271299
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.618386 12.717140 9.784923 10.260219 10.643275 12.389885 -0.455610 -0.716157 0.029750 0.033764 0.004525
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.094921 0.153584 -0.743863 0.540404 1.849617 0.357758 0.494915 -0.606711 0.634165 0.651316 0.384938
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.736439 -1.311861 1.170360 1.104848 1.313093 -0.508897 0.096328 1.678166 0.639589 0.647113 0.381256
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.672710 25.144884 -0.169107 2.885838 -0.368574 1.692673 0.975552 6.254219 0.631133 0.541402 0.367607
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 12.155567 13.905173 4.455943 4.805399 10.649490 12.389864 0.762937 0.569374 0.032934 0.042841 0.007085
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.750597 -0.421433 1.643234 -0.995979 0.226155 -1.117844 -0.816472 -0.268594 0.597995 0.592241 0.380448
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 26.496640 26.597492 13.550986 13.514902 10.770351 12.292554 4.779916 4.717284 0.029492 0.027333 0.001721
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.436842 0.559144 -1.147990 0.836940 0.650427 1.265481 -0.106006 3.893814 0.620097 0.629912 0.401625
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.196520 -0.009189 0.221582 0.612268 0.112788 1.223661 6.857597 3.992816 0.626378 0.638529 0.400523
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 9.976120 2.344684 9.818031 0.486924 10.684903 0.058605 2.132131 1.726921 0.034934 0.626170 0.484726
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.908472 0.191501 -0.111034 0.076426 1.963838 0.273314 0.564594 1.759868 0.631282 0.649121 0.378492
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.621099 -0.060903 4.940037 6.157690 -0.894482 0.150678 0.333250 0.200679 0.609722 0.615832 0.369579
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.057996 0.740226 0.097103 0.669584 -0.840675 0.046367 -0.733159 0.904485 0.641857 0.644444 0.379126
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.941003 -0.002553 -0.345545 -0.552504 0.127653 0.494678 0.456913 0.782307 0.634403 0.651173 0.379666
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -0.638326 3.978131 0.202951 0.555313 -0.661519 1.927254 0.703485 3.167032 0.624433 0.632663 0.370361
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.149229 0.198887 -0.849214 -0.853847 -0.304400 -0.311784 0.247012 0.057795 0.628595 0.649491 0.394770
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.349667 13.612829 4.273159 4.421618 10.607705 12.326348 1.269637 0.623712 0.029843 0.045656 0.011209
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.080161 1.025867 0.753779 2.147058 -0.597581 2.975060 0.830391 -1.403972 0.601124 0.618089 0.389356
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.061585 -0.002405 -1.057191 0.535776 1.059912 -0.461093 0.286342 3.082838 0.551093 0.598220 0.392708
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.670466 2.154507 0.698136 1.059022 3.452584 2.271229 27.831378 26.892377 0.575684 0.606561 0.373040
51 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 21.051239 4.326656 12.272553 -1.170073 10.800561 5.107687 7.613659 3.520346 0.038429 0.520909 0.402195
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.245800 6.749743 -0.416760 0.549132 1.195537 0.602794 1.550136 0.996398 0.631135 0.641943 0.393071
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.101952 3.227726 0.093312 0.359964 1.237929 1.882401 3.733631 4.859391 0.639609 0.651414 0.396348
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 27.694547 -0.884421 5.298067 3.277681 2.187013 -1.054644 2.759160 1.272475 0.445689 0.636815 0.376667
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.893545 13.595728 10.233120 10.809842 10.638687 12.354142 1.507386 2.824717 0.027557 0.029514 0.002108
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.082846 2.245250 5.822579 8.012702 2.094247 5.263443 2.520229 3.490476 0.596141 0.566947 0.357739
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 21.374061 0.482670 7.786989 1.201028 7.909284 2.180103 21.848777 5.580010 0.433062 0.656283 0.418380
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.993116 12.636847 10.105630 10.804961 10.512882 12.288482 0.565372 0.353721 0.032775 0.032615 0.001702
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.880982 0.700902 9.642133 0.987723 10.366661 1.601794 0.744364 5.067421 0.044417 0.639421 0.513599
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.511047 12.553989 -0.453680 10.836165 -0.832960 12.360859 1.325702 2.448804 0.626175 0.064124 0.509737
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.549823 0.205725 -0.730573 -1.464186 1.766140 -0.647727 1.496973 2.250753 0.577040 0.607636 0.379695
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.590894 0.828271 -0.789396 1.430555 0.074293 0.081575 1.617728 -0.670999 0.568041 0.618055 0.394014
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.202225 13.041518 -0.056406 4.832305 0.811848 12.492194 -0.247764 1.850360 0.597262 0.041241 0.483530
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.196112 0.348348 -0.689454 -1.013223 0.491968 -0.850204 2.467644 0.920121 0.580080 0.574087 0.370095
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.711570 1.418864 0.482095 1.148796 0.072816 0.896215 0.145124 -0.021303 0.608916 0.625231 0.405940
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.854558 1.624589 -1.421527 -1.257588 2.858517 -0.754782 -0.222514 0.040178 0.622921 0.642187 0.403104
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.372479 2.271228 -0.216866 1.371420 -0.604727 0.051780 0.637430 2.978362 0.634589 0.633163 0.388925
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 20.427397 27.082976 1.117034 14.234662 5.467533 12.289654 0.407198 7.786730 0.366106 0.027474 0.273965
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.806933 -0.001751 0.331863 0.819413 -0.382972 1.226345 0.109717 0.249717 0.634063 0.653496 0.377611
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.840106 -0.345251 -0.157342 0.069007 0.851634 1.500186 1.732378 1.710583 0.645892 0.661501 0.377642
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 8.284966 -0.268824 0.688800 1.026518 0.491632 -0.062539 1.450134 1.740936 0.655333 0.665490 0.368861
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.388615 13.820974 10.598810 11.224373 10.394514 12.130522 0.854653 1.084447 0.030413 0.032122 0.002412
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.558161 1.084832 -1.425707 -1.050866 0.848000 -0.074031 0.306692 0.205717 0.646064 0.658809 0.375898
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.154847 -0.005524 0.176360 -0.593419 -0.260253 1.079551 -1.016690 2.882431 0.647636 0.657158 0.376216
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 59.831139 1.077106 0.740910 -0.157257 8.810439 -0.207564 16.141581 0.411520 0.313594 0.610824 0.440708
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 34.112566 0.033574 -0.294176 1.374728 2.490367 0.355604 1.105199 1.117711 0.429010 0.623301 0.381132
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.727717 13.355519 -1.422570 4.854632 -0.927187 12.254824 0.773243 -0.367491 0.591465 0.037753 0.470383
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.534040 14.199704 0.561499 4.751642 -0.687619 12.297407 -0.491231 0.817526 0.600165 0.044741 0.477600
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.120340 13.475828 0.089928 9.396948 -0.638537 11.983817 -0.272981 1.064766 0.584706 0.035370 0.456191
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.923820 -0.054696 0.428220 2.208222 -0.889651 -0.924752 -0.820214 -0.501943 0.605882 0.612383 0.386488
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.330133 -0.046746 0.207024 0.495568 0.158734 -0.581199 -0.587007 0.340763 0.618150 0.634914 0.389469
84 N08 RF_maintenance 100.00% 75.36% 100.00% 0.00% 20.065058 24.046466 13.159416 13.774322 8.914759 12.238648 2.312498 2.792913 0.197386 0.032934 0.127866
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.013485 0.466498 1.803832 1.451924 1.016246 -0.122607 -0.852374 -0.928158 0.629786 0.648864 0.382131
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.392347 -0.063247 1.536550 1.711833 4.490125 -0.579480 0.737463 15.117746 0.623950 0.645788 0.365236
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.607007 7.454455 -0.600105 -0.240911 0.733834 -0.235936 -0.164485 1.038392 0.649323 0.671003 0.369731
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.793308 0.421087 0.376270 0.818525 -0.655068 -0.184319 1.722858 0.180690 0.645598 0.660692 0.366631
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.694730 0.477872 0.088510 0.886644 -0.551876 -0.726784 -0.785883 -0.484246 0.650656 0.660774 0.369731
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.102784 -0.065322 0.968046 4.272033 -1.229648 9.393922 0.132284 5.757661 0.641251 0.618750 0.370739
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.085484 -0.100341 0.415453 0.308959 -1.282094 -1.108139 -0.323148 -0.458936 0.641823 0.659873 0.385686
92 N10 RF_maintenance 100.00% 0.00% 18.85% 0.00% 35.073335 39.595125 0.541084 1.424446 6.019776 6.832627 11.979040 7.575495 0.285754 0.244910 0.076237
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.810541 -0.254508 2.345333 -1.161087 0.616924 0.132875 1.682740 -1.165911 0.628131 0.648694 0.391955
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.394836 13.045440 10.356857 10.696646 10.576425 12.305090 -0.125438 -0.356170 0.029781 0.025863 0.002035
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.674190 -0.388998 -0.681652 1.122791 -1.089526 0.468136 -0.580090 -0.018074 0.603928 0.630632 0.394681
96 N11 not_connected 100.00% 0.00% 0.00% 100.00% 12.764748 6.941809 3.748659 5.240118 4.098597 9.733001 -2.809479 -3.747774 0.268951 0.218771 -0.251446
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.802454 6.180774 -1.003250 1.431294 0.503406 4.967998 3.592240 6.216736 0.585264 0.534685 0.378708
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.382898 8.982191 -0.403859 1.228683 -0.456020 1.259085 -0.054976 0.161412 0.638091 0.648777 0.384394
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.625915 1.125286 -1.304326 -0.900959 0.508179 1.524814 -0.021929 7.811629 0.646912 0.658098 0.379384
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.129564 5.759433 2.081430 -1.242772 22.492563 0.904796 11.622207 4.115750 0.636392 0.664523 0.375850
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.764864 60.523249 -0.893764 7.323825 1.492395 -0.303991 -0.053144 1.037878 0.656518 0.635526 0.372168
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.461966 0.040900 0.243222 0.925156 -0.275201 -0.973656 -0.947117 -0.798798 0.650775 0.661189 0.365055
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.613049 1.530665 -1.345891 -0.512298 0.916052 -0.540520 -0.678176 -0.467468 0.652993 0.664959 0.366948
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.658539 -0.020057 -0.193120 -0.413339 -0.231472 -0.419421 3.385369 2.396034 0.648897 0.666055 0.373039
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.476320 42.157944 10.149650 0.866106 10.613010 5.916565 0.567613 2.940359 0.032499 0.292647 0.170910
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 3.390646 12.627792 7.968336 10.552287 3.942943 12.385204 -0.998952 0.722442 0.506168 0.028713 0.348236
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.621916 25.608119 13.610417 13.980948 10.518003 12.088408 2.723903 2.893637 0.023670 0.025160 0.000958
111 N10 digital_ok 100.00% 0.00% 80.82% 0.00% 0.071004 11.519502 -0.382398 10.470958 -0.277370 11.586934 1.946872 1.342752 0.640588 0.185386 0.466865
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.857738 -0.411920 0.231306 0.234853 0.542295 3.547836 -0.187698 -1.201764 0.628141 0.641332 0.395713
113 N11 not_connected 100.00% 0.00% 100.00% 0.00% 4.392907 13.961810 4.120235 4.837166 4.309474 12.172739 -3.169862 -0.353755 0.615602 0.070966 0.480860
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.476970 0.882837 1.086010 0.064196 1.472103 -1.200285 -1.234517 -0.494035 0.599109 0.614417 0.385082
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.019295 -0.615822 -0.862722 -0.303823 -0.183648 -1.301702 -1.098425 -0.654750 0.574557 0.598741 0.390561
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.332748 14.132414 10.284522 11.181863 10.468865 12.324223 0.321184 2.394342 0.027772 0.030160 0.001975
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.014191 1.593610 -0.177206 0.590143 -0.632782 -0.585541 -0.761273 -0.049469 0.613513 0.633705 0.394126
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.342710 1.823722 2.745375 -1.040481 0.645058 1.228572 6.879257 5.107844 0.624658 0.657584 0.384774
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.887090 3.534071 -1.347262 6.235974 0.874630 0.473820 15.822176 14.494645 0.649229 0.635473 0.367321
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.978673 6.778703 0.246470 0.945360 1.361142 0.789998 -0.771275 -1.056695 0.642110 0.665318 0.374307
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.365162 9.144050 0.802816 1.065345 -0.358704 -0.469765 -0.539403 0.050714 0.659661 0.670898 0.376625
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.031182 -0.096437 -0.005370 0.645372 -0.751479 0.135562 0.225984 0.029120 0.659371 0.670866 0.377251
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.549692 -0.265295 -0.294354 0.847476 -0.298945 -0.359856 -0.060611 -1.051889 0.653082 0.659041 0.371198
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.087000 0.242210 -1.058723 1.311705 7.263330 9.303207 3.855237 3.559144 0.638267 0.652844 0.376899
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.936606 0.107088 0.495993 0.420943 1.395083 0.272389 -0.208835 -0.709677 0.646154 0.661463 0.385140
128 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 1.477497 12.154684 7.557416 10.807972 3.515794 12.241404 -0.959918 0.051203 0.539475 0.030598 0.378907
131 N11 not_connected 100.00% 0.00% 2.22% 0.00% -0.662887 12.437545 0.222006 4.681928 -0.669630 10.777278 -0.917365 -0.064546 0.617743 0.295626 0.433264
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.382157 2.697135 0.001225 -1.347228 0.401189 -0.626667 -0.831208 -0.303668 0.598632 0.598422 0.376207
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.915054 0.674791 -0.630474 2.144147 -0.938193 1.649592 -0.855929 -0.252543 0.586777 0.618482 0.404130
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.555074 -0.989730 -0.993503 -1.370523 2.608258 0.643212 7.599892 0.276371 0.587609 0.617388 0.410813
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.566433 0.050969 9.756295 -0.813831 10.710473 0.247272 0.750365 -0.257687 0.037158 0.615857 0.464749
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.036127 -0.485449 0.150068 -1.268690 1.444446 -0.689393 0.244268 0.441874 0.595881 0.629456 0.400213
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.153176 -0.120620 1.838022 -0.714445 1.247626 -0.489997 -1.812092 -0.677983 0.624231 0.630556 0.378049
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.645697 -0.702046 -1.033113 -0.001225 -0.795784 -0.376276 3.631276 3.002749 0.640223 0.659450 0.378533
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.386338 -0.607387 -0.273075 0.917962 1.503464 -0.499603 0.114130 -1.094792 0.642900 0.665922 0.376048
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.900746 12.524526 -0.685557 10.843429 2.343774 12.378398 20.029846 0.772085 0.640717 0.042116 0.526087
143 N14 digital_ok 100.00% 0.00% 100.00% 0.00% -1.341412 13.017386 0.969585 10.914626 0.758484 12.163227 0.471850 2.112364 0.651087 0.036907 0.542828
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.574146 0.004038 -1.164250 2.347147 -0.513894 23.138716 -0.679680 -0.489558 0.658495 0.654981 0.373980
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.805616 1.216795 -1.062366 4.243482 -0.045761 5.165755 -0.392337 0.220652 0.657481 0.640002 0.379601
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 11.783195 -1.054645 4.061233 0.046280 10.607379 -1.320554 -0.571603 -1.094643 0.037338 0.651764 0.511285
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.543297 -1.651889 1.224328 2.471981 -0.961629 -0.851083 0.596356 0.574619 0.634992 0.641517 0.376620
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.322965 0.157248 -0.618169 -0.587459 1.619725 1.533603 -0.993563 -0.903023 0.638739 0.653262 0.389447
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.158258 -1.272978 -1.110870 -1.176965 -0.604152 1.120522 -0.424088 -0.470824 0.631855 0.647133 0.392916
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.133901 -0.539437 -0.998499 -1.101370 -0.636358 0.405499 0.484417 1.312113 0.624449 0.635751 0.391528
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 26.767332 1.177679 -0.067390 0.444682 3.650414 -0.510265 1.213244 -0.377660 0.471402 0.581594 0.344814
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.919632 -0.709086 9.916864 -1.422871 10.754692 -0.133551 1.407317 1.153759 0.038613 0.617085 0.479251
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 4.042618 12.291015 8.372594 10.565848 6.481628 12.472262 0.791427 1.189391 0.422311 0.036333 0.330162
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.233491 -0.250360 -0.018287 0.729444 -0.798817 0.647278 0.097899 0.388772 0.602978 0.626379 0.396767
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.425331 0.104433 -0.166252 -0.515280 1.479855 2.022352 3.470444 15.211269 0.619082 0.642450 0.398614
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.355009 25.570569 -1.334501 -0.699250 -0.039233 6.469160 -0.709834 30.451231 0.591852 0.518641 0.356024
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.625030 -0.969084 -0.278382 -0.697742 -0.909492 1.548745 0.464103 1.146752 0.632466 0.649085 0.382615
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.975149 29.165304 0.026636 -0.497147 -0.288096 1.904813 0.230529 0.996346 0.638682 0.523180 0.343223
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 2.332273 -1.125219 -0.584620 -1.037428 1.033890 0.883186 2.039960 -0.152755 0.641691 0.665183 0.382263
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.737558 1.249592 -0.198958 0.496015 -0.675551 0.532525 -0.352273 1.124039 0.654352 0.663245 0.382777
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.117168 0.656931 0.639483 -0.002897 2.356989 1.619991 0.829068 0.734137 0.648372 0.664027 0.375385
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 32.617912 0.318410 -0.383503 -0.983647 3.703582 -0.260481 1.467012 -0.804548 0.510865 0.664042 0.373815
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.808283 2.053150 -0.996532 0.162740 -0.202688 26.778726 5.065663 5.810359 0.652921 0.659995 0.381530
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.590155 -0.779904 -1.456437 -0.044814 1.472975 0.074223 -0.246276 3.798864 0.640639 0.648060 0.381328
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.912275 -1.178426 0.281553 -0.345910 0.876034 0.694088 -0.188050 1.095519 0.637170 0.650388 0.389969
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.537966 -0.841155 -0.920244 -1.300733 0.135337 0.337477 -0.877061 -0.990180 0.636935 0.650701 0.391683
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 11.267744 -0.482098 10.494936 -0.826604 10.457209 0.911172 2.383919 6.520727 0.037084 0.644951 0.510613
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.872928 2.720867 -1.232547 0.757459 -0.777843 2.306088 -0.605525 0.305940 0.581636 0.561447 0.366583
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 12.600664 13.460064 3.787091 4.440816 10.765476 12.441364 1.995784 4.005389 0.037850 0.041355 0.003228
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.131066 -0.547235 -0.235588 -1.353986 0.978270 2.114287 -0.769205 1.087773 0.584788 0.639399 0.398509
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.326988 13.256785 -1.401992 10.987184 0.333943 12.258238 16.641911 0.939606 0.633329 0.048545 0.531256
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.512266 -0.206123 0.488962 0.599675 -0.266035 -0.868061 -0.735298 3.319663 0.637729 0.650037 0.387506
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.427438 12.267880 -1.162758 10.536594 -0.197533 12.455892 8.641977 0.822213 0.647565 0.042993 0.503035
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.215158 0.437662 -0.814743 0.071783 0.673431 -0.606332 1.279212 0.019284 0.637866 0.650831 0.373333
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.028090 -0.648661 -1.317589 -0.384032 -0.785961 -0.013544 -0.273413 -0.078874 0.648192 0.662788 0.371349
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 37.024137 -0.194976 -0.226674 -1.404601 7.067303 0.263167 3.416887 0.586270 0.517968 0.659908 0.377023
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.620670 -1.265020 -1.453521 -0.214300 1.284447 -0.415048 -0.011464 -0.939838 0.655170 0.669046 0.389653
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.097712 2.309755 -1.283909 2.667703 -0.161968 2.337456 1.226186 5.934286 0.650500 0.658844 0.379566
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 9.093902 12.125744 9.690452 10.668779 11.223213 12.482819 17.901351 2.215060 0.027482 0.029687 0.001067
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.291045 -1.263175 -0.678596 0.633805 -0.842923 0.293596 -0.435133 -1.239228 0.628394 0.648533 0.399520
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.638934 0.565988 1.348552 -0.411176 -0.081181 0.387037 9.443053 0.799984 0.613721 0.631507 0.395123
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.143190 7.042090 5.189839 5.234909 7.773460 9.671251 -3.694359 -3.661739 0.583742 0.596628 0.387562
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 7.197177 0.394939 5.448392 1.501610 8.210541 2.571823 -3.615913 -0.392758 0.567662 0.605921 0.413766
200 N18 RF_maintenance 100.00% 100.00% 52.24% 0.00% 12.191809 36.051730 4.217352 0.962045 10.733521 8.008157 0.452772 -0.920372 0.038170 0.220937 0.150080
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.882235 5.173882 3.447627 4.621264 2.763686 7.931562 -1.170015 -2.869710 0.623608 0.621583 0.383568
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.670296 3.266126 1.968063 -1.256714 0.887728 0.279348 -0.836318 21.093773 0.632490 0.614395 0.380629
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.729972 2.801871 0.876918 -1.015529 -0.527025 -0.503381 -0.575412 6.835218 0.623710 0.613894 0.371437
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.007007 3.206529 2.636992 -0.620854 8.802728 0.331935 -1.586451 3.085308 0.627473 0.609488 0.377368
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.105863 2.954871 1.695356 -0.948874 1.204100 7.479160 -1.269664 -0.740180 0.609477 0.606330 0.358093
208 N20 dish_maintenance 100.00% 94.06% 94.38% 0.00% 248.673328 249.015315 inf inf 4392.907460 4421.486048 6820.522688 6818.635113 0.420630 0.352765 0.362437
209 N20 dish_maintenance 100.00% 93.63% 94.22% 0.00% 257.108732 256.962643 inf inf 5044.476185 5039.091905 8326.420346 8300.179142 0.403339 0.365034 0.361351
210 N20 dish_maintenance 100.00% 93.14% 94.65% 0.00% 215.970711 216.118766 inf inf 4137.324618 4154.320604 5431.830517 5458.049986 0.396194 0.331677 0.335049
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.788560 2.593641 -0.913152 0.297498 -0.982850 0.268033 1.179558 -0.804130 0.578645 0.591865 0.376562
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.272960 -0.993397 0.724568 -0.173969 -0.830002 -0.371947 2.243121 -1.800675 0.616717 0.624076 0.382349
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.888715 -0.062320 -1.074677 -0.490196 0.227772 -0.812263 2.759249 -1.209882 0.599553 0.628510 0.387227
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.549979 0.068619 -0.007664 0.426463 -0.163914 -0.260646 2.054089 -1.446445 0.611239 0.637219 0.388842
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.272225 1.553018 -1.236100 -0.329849 0.281707 26.813655 1.039344 5.799238 0.599087 0.621191 0.384149
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.472093 6.760214 5.650674 5.302127 8.292610 9.813106 -3.898025 -3.651923 0.597225 0.613816 0.379915
225 N19 RF_ok 100.00% 0.00% 89.74% 0.00% 1.624574 12.779377 1.185255 4.619026 -1.025721 12.091286 -1.411959 0.522795 0.622990 0.141618 0.517275
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.301647 1.961636 0.380758 1.680934 -0.833002 4.169325 -1.192719 -1.384880 0.615859 0.624167 0.386293
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 2.227847 0.816896 -1.306433 0.330045 -0.528758 -0.219032 11.902307 0.337412 0.579467 0.615314 0.379348
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.244520 20.652612 -0.825892 -0.051117 2.798491 5.481291 61.833071 40.895508 0.524019 0.504791 0.311142
229 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.933394 0.125010 1.836896 1.654622 0.319907 1.543160 7.378126 -1.950388 0.598958 0.613957 0.394927
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.677469 0.018382 -0.108233 -1.329606 -0.398522 -0.287304 -0.484125 -0.815165 0.552245 0.604477 0.401762
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.169967 -0.248733 1.234269 0.629430 -0.629027 -0.171256 -1.697714 -1.776000 0.612105 0.624524 0.394415
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.894749 -1.318479 0.206153 0.347273 -0.494009 -0.344595 -0.572706 0.282546 0.610273 0.627546 0.392259
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 27.488384 51.386897 1.058664 1.153679 5.059057 6.847046 18.475524 13.043664 0.468804 0.402943 0.249962
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.154287 3.801008 -0.536634 0.561922 -1.101770 0.852996 4.513179 14.568018 0.598596 0.577714 0.384425
242 N19 RF_ok 100.00% 4.92% 0.00% 0.00% 55.949439 1.639053 0.535145 1.632274 11.766912 1.276114 4.835130 -0.844339 0.307143 0.628208 0.470983
243 N19 RF_ok 100.00% 16.32% 0.00% 0.00% 60.827590 2.522837 1.100285 -1.265157 7.448109 -0.985682 -1.756360 -0.549092 0.257054 0.603398 0.477897
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.713169 2.141325 1.376350 -0.756748 3.027840 1.028393 1.494592 5.628123 0.485848 0.578271 0.383803
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.718860 2.001537 0.451807 -0.742127 -0.410887 -0.613694 -1.798506 -0.731064 0.589959 0.594778 0.386110
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.657970 7.283263 -0.443670 0.421809 4.817461 5.778934 0.827688 -1.281945 0.320719 0.321662 0.159386
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.651030 1.669260 0.978755 -0.241228 -0.789130 -0.862859 -0.312310 0.507011 0.588972 0.592239 0.389028
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.698688 7.913301 9.197060 9.979690 10.096071 11.653437 7.306801 14.112939 0.030658 0.027097 0.003282
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 6.490281 13.119710 2.642953 7.040018 1.242264 12.526137 33.146183 3.516145 0.441081 0.043162 0.355960
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.607723 2.647683 1.405003 1.826893 0.777007 1.620442 0.752727 -0.281167 0.497189 0.511403 0.378043
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.779818 -0.828403 1.564874 -1.116166 1.085687 -0.804964 -0.760163 -0.228207 0.528864 0.530713 0.394651
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.664248 -0.476117 0.252245 -0.785035 0.810446 -0.449993 4.599254 0.867421 0.452999 0.523576 0.380974
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.326388 2.291138 -0.614077 -1.330422 0.013544 -0.867187 0.698830 0.041705 0.463588 0.502481 0.372152
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, 15, 16, 18, 27, 28, 29, 32, 34, 36, 38, 40, 42, 45, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 77, 78, 79, 80, 81, 84, 86, 87, 90, 92, 94, 96, 97, 101, 102, 103, 104, 108, 109, 110, 111, 113, 117, 120, 121, 122, 123, 126, 128, 131, 135, 136, 142, 143, 144, 145, 146, 151, 155, 156, 158, 159, 161, 165, 166, 170, 173, 179, 180, 182, 185, 187, 189, 191, 192, 193, 200, 201, 202, 205, 206, 207, 208, 209, 210, 223, 224, 225, 226, 227, 228, 229, 240, 241, 242, 243, 244, 246, 262, 320, 329]

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

golden_ants: [5, 10, 17, 19, 20, 21, 30, 31, 37, 41, 44, 65, 66, 67, 69, 70, 83, 85, 88, 91, 93, 105, 106, 107, 112, 118, 124, 127, 140, 141, 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_2459970.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 [ ]: