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 = "2460085"
data_path = "/mnt/sn1/2460085"
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: 5-20-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/2460085/zen.2460085.42112.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 361 ant_metrics files matching glob /mnt/sn1/2460085/zen.2460085.?????.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/2460085/zen.2460085.?????.sum.known_good.omni.calfits. Skipping redcal chisq.

Figure out some general properties¶

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

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

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

Load a priori antenna statuses and node numbers¶

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

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

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

Summarize auto metrics¶

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

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

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

Summarize ant metrics¶

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

Summarize redcal chi^2 metrics¶

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

Get FEM switch states¶

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

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

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

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

Find X-engine Failures¶

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

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

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

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

Build Overall Health DataFrame¶

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

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

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

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

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

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

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

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

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

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

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

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

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

Table 1: Overall Array Health¶

In [18]:
HTML(table.render())
Out[18]:
JD 2460085
Date 5-20-2023
LST Range 15.421 -- 17.361 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 361
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: 94
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas 40, 42, 70, 112
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 68 / 198 (34.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 107 / 198 (54.0%)
Redcal Done? ❌
Never Flagged Antennas 90 / 198 (45.5%)
A Priori Good Antennas Flagged 52 / 94 total a priori good antennas:
7, 15, 16, 17, 29, 31, 37, 38, 40, 41, 42,
45, 53, 55, 56, 65, 66, 70, 72, 81, 83, 86,
93, 94, 109, 111, 112, 118, 121, 124, 127,
136, 147, 148, 149, 150, 151, 160, 161, 164,
165, 166, 167, 168, 169, 170, 182, 184, 189,
190, 191, 202
A Priori Bad Antennas Not Flagged 48 / 104 total a priori bad antennas:
8, 22, 35, 36, 43, 46, 48, 49, 50, 52, 57,
64, 74, 79, 80, 89, 90, 95, 113, 115, 120,
126, 132, 133, 135, 139, 185, 201, 207, 220,
221, 222, 223, 224, 228, 229, 237, 238, 239,
240, 241, 244, 245, 261, 320, 324, 325, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2460085.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.108410 8.082034 -0.921405 -0.377826 -0.620503 -0.386788 -1.066057 -0.454069 0.484699 0.379623 0.298846
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.337479 1.871834 0.582341 3.710206 0.760809 2.127972 -0.401766 0.770373 0.500496 0.487677 0.310767
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.893536 0.044412 -0.357597 0.371549 -0.181516 0.174999 -0.130286 6.987341 0.502883 0.494735 0.301026
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.983332 2.055439 1.339615 1.379419 0.510926 0.641570 -1.417853 -1.220059 0.473923 0.463778 0.285627
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 2.226502 -0.467703 3.553843 -0.302752 2.426478 0.293522 1.924198 -0.614239 0.494474 0.494080 0.297523
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.103859 -0.532704 -0.918465 -0.432864 -0.763013 -0.209356 -0.969275 -0.209521 0.486444 0.476347 0.293676
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 7.141001 0.010229 0.120360 -0.079009 -0.326136 0.396604 0.020806 0.781090 0.419390 0.500841 0.301454
16 N01 digital_ok 100.00% 100.00% 57.62% 0.00% 6.185621 1.498231 13.447420 1.022031 1.498789 0.165138 0.653359 -1.393623 0.075224 0.205575 0.081138
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.774927 1.850550 1.095295 10.675454 1.246830 0.074189 0.156214 4.209706 0.519535 0.427375 0.347551
18 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.333937 7.977614 10.985596 14.054127 0.127707 1.619699 14.933684 0.914798 0.116568 0.051066 0.059269
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.453470 -0.551326 -0.115742 -0.287724 -0.022258 0.013683 -0.459723 0.881324 0.518055 0.519981 0.304834
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.937327 -0.486922 2.172579 -0.014073 1.990294 0.180161 2.017390 0.670871 0.520754 0.513518 0.304028
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.314204 0.323816 0.061777 0.365434 0.448926 0.511050 -0.054533 -0.130013 0.504317 0.501620 0.295964
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.024634 -0.614331 0.951342 -0.014623 0.290873 -0.150649 1.507607 1.410929 0.465929 0.467173 0.292786
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.442896 14.520436 13.187420 8.527228 1.331112 0.356658 3.536928 25.337913 0.074558 0.053545 0.020126
28 N01 RF_maintenance 100.00% 100.00% 48.75% 0.00% 6.397453 9.377848 13.495711 6.070843 1.671501 0.424944 1.052636 19.644096 0.028667 0.230912 0.175826
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 6.357305 7.475187 13.238283 13.528120 1.665472 1.623256 1.085150 0.722974 0.029582 0.038820 0.009774
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.309463 -0.838745 0.497914 -0.550042 0.331975 -0.204981 1.295546 -0.456738 0.525906 0.530415 0.312232
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.584523 1.404334 1.202662 4.921266 1.190870 1.541169 0.299978 0.789120 0.536447 0.520400 0.307743
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.077886 -0.745400 0.429525 -0.989855 -0.819278 -0.727074 0.859246 -0.033375 0.453857 0.521854 0.280205
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.109519 -0.359554 8.314751 -0.551815 1.677326 -0.895638 1.765915 0.303497 0.046017 0.485754 0.333365
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.117202 -1.037147 -0.157816 -0.388680 -0.616016 -0.036850 1.959864 2.592248 0.481748 0.478805 0.291399
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.879373 2.476618 1.238145 0.934459 1.111119 0.985210 0.095900 0.229129 0.474999 0.463171 0.283360
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.930959 14.401771 -0.826897 16.843796 -0.653734 1.657311 -1.038608 2.512330 0.489537 0.034340 0.379481
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.173614 0.291318 0.211229 1.327349 0.557801 1.239125 3.866725 6.707669 0.501559 0.498029 0.297959
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.498713 0.257466 0.680103 -0.247321 0.297487 0.520094 16.914816 0.482075 0.229791 0.225956 -0.256063
41 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.744664 2.386293 1.280422 4.128260 1.516253 1.977744 0.157365 0.795721 0.535335 0.529142 0.317281
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.059918 0.156062 -0.001520 -0.681103 -0.065313 0.407919 1.440704 1.980972 0.245296 0.239321 -0.258016
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.156484 0.455596 -0.943555 1.027874 -0.682043 1.051807 -0.893071 0.456931 0.547762 0.546300 0.321642
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.918991 0.786480 -0.444297 0.759547 -0.250871 0.649196 -0.217162 0.524747 0.541093 0.547980 0.314797
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 1.165772 1.120501 1.177034 0.835305 1.316385 0.969974 5.635729 6.371529 0.543920 0.542117 0.317365
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.021562 -1.009213 0.385238 -0.962478 0.677686 -0.349293 1.135825 0.496274 0.533116 0.534094 0.319950
47 N06 not_connected 100.00% 91.97% 93.91% 0.00% 61.115635 63.361386 inf inf 378.601665 385.219355 3725.329340 3690.941235 0.371197 0.356922 0.290036
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.578720 0.423396 -0.799795 0.120497 -0.737318 -0.281529 1.238164 1.123342 0.490943 0.486523 0.292636
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.579577 -0.294136 0.438231 -0.538117 0.284532 -0.982826 -0.340569 -0.896202 0.477445 0.473082 0.294118
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.345916 0.882189 0.093726 1.738362 0.344652 1.388377 -0.309583 0.339003 0.473851 0.464919 0.286485
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 0.831653 -0.162784 0.199798 0.271432 0.865578 0.875453 60.431072 3.787585 0.488738 0.487415 0.294333
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.947927 1.098831 0.238092 -0.089481 0.681986 0.375932 3.345937 1.468121 0.511399 0.503181 0.298931
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.391240 -0.479681 -0.224180 -0.562978 0.671148 -0.265925 7.412144 6.953170 0.526536 0.517456 0.310750
54 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.287319 1.563756 0.735482 -0.602271 1.035488 1.362441 -0.260410 -0.161197 0.286359 0.337938 0.157703
55 N04 digital_ok 100.00% 44.32% 100.00% 0.00% 0.237809 26.180773 0.031912 10.410061 -0.440741 1.855300 0.772237 1.307135 0.230533 0.043931 0.089343
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.956503 3.860391 -0.975595 2.175552 -0.479953 3.059845 2.344516 4.745203 0.550240 0.534438 0.306600
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.896230 -0.624369 -0.683992 -0.472168 -0.663018 0.076669 0.933191 1.413381 0.556122 0.552310 0.315004
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.983278 7.390227 13.473320 13.977809 1.657881 1.618311 0.959226 0.968895 0.039698 0.039364 0.002565
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.536161 1.069937 13.475921 1.014728 1.668465 1.013619 1.390075 2.795626 0.054670 0.553303 0.404627
60 N05 RF_maintenance 100.00% 0.00% 98.61% 0.00% -0.102948 7.252321 0.408201 14.013493 0.302315 1.558201 0.001211 2.226233 0.528765 0.093588 0.407329
61 N06 not_connected 100.00% 93.35% 94.18% 0.28% 115.122275 115.121104 inf inf 673.939005 673.993803 3743.455582 3770.830173 0.317966 0.289874 0.213060
62 N06 digital_ok 0.00% 0.00% 0.00% 0.00% 0.088995 0.476429 1.463960 0.130605 0.793339 -0.490163 1.759823 -0.731839 0.483432 0.496559 0.295202
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.725151 7.492955 -0.974739 8.555865 -0.629752 1.660949 0.752968 3.596780 0.498601 0.045913 0.360444
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.806049 -0.537270 -0.725379 0.209246 -0.347716 0.287995 0.415265 0.130667 0.488260 0.476015 0.290830
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 14.281388 13.313937 16.707306 16.600573 1.699370 1.662082 2.851778 3.859315 0.023554 0.033928 0.010775
66 N03 digital_ok 100.00% 60.94% 100.00% 0.00% 1.417467 13.689673 0.928393 16.736168 0.243377 1.585302 -1.214212 4.333462 0.197763 0.055659 0.091826
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.440996 0.678859 0.137165 1.658438 0.311953 1.380611 3.533182 2.776769 0.515111 0.509205 0.299899
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 14.930355 0.279739 16.717207 -0.049802 1.685653 -0.643720 3.153127 -1.127680 0.035607 0.513364 0.396475
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.341107 -0.286571 1.788454 -0.522136 1.321314 -0.041107 2.205053 0.874913 0.542364 0.537332 0.306204
70 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.749641 2.005374 1.502269 2.786461 0.841169 2.169219 6.615334 5.265026 0.260035 0.247968 -0.254458
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.745170 0.418217 -0.113446 0.654445 0.199370 0.671295 2.134795 3.006540 0.562150 0.562544 0.319028
72 N04 digital_ok 100.00% 0.28% 93.07% 6.93% 1.329687 6.739696 2.672655 13.916288 1.743910 0.995717 10.780544 0.935927 0.258939 0.112993 -0.041006
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.775147 2.284072 -0.619116 2.447362 -0.085294 2.594012 1.799640 5.599568 0.565745 0.565021 0.321176
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.670122 -0.629551 -0.370254 -0.355338 -0.878985 -0.093464 -0.911186 0.523487 0.547183 0.558041 0.320087
77 N06 not_connected 100.00% 92.80% 93.63% 0.00% 109.200839 109.299740 inf inf 498.212575 502.732329 3561.134652 3633.730256 0.358625 0.350580 0.272025
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 8.804441 0.397934 0.652559 0.231982 -0.417924 -0.391800 0.259738 -0.920868 0.393873 0.502251 0.280569
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.145701 -0.927556 0.986044 -0.724420 0.105640 -0.550445 0.881908 -0.083497 0.491301 0.494987 0.292150
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.504658 1.726074 -0.508224 1.188876 -1.139065 0.422520 -1.217047 -1.469584 0.489575 0.462568 0.296285
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 43.952973 32.923516 32.306370 35.452685 5.306069 10.851266 294.829893 397.125341 0.017752 0.016188 0.001508
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 16.739346 26.142367 28.379023 28.135905 36.101322 4.313224 520.535851 280.075693 0.016516 0.016362 0.000789
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 39.821340 22.155562 38.014716 31.103976 20.856397 8.465441 578.075198 388.086881 0.016261 0.016372 0.000762
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.673544 15.039316 0.589349 16.780432 -0.200554 1.505248 -1.031016 3.596164 0.513402 0.058397 0.362979
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.319049 -0.433366 -0.607958 -0.499607 -1.201774 -0.224878 -1.219207 -0.364404 0.541352 0.542638 0.308214
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.621094 -0.001365 1.567959 0.326947 1.184604 0.559844 0.818395 5.210375 0.558483 0.557498 0.311608
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 19.126618 0.794138 3.493702 -0.755045 1.911892 -0.526545 17.009113 2.682353 0.504265 0.566948 0.296340
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.533996 1.106548 1.046318 1.957215 0.768337 1.031926 -0.073781 0.177706 0.570432 0.565646 0.314926
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.681278 0.633807 1.024342 1.357891 1.012485 1.306719 -0.279034 0.039468 0.574868 0.573667 0.326392
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.493187 -0.896644 -0.667879 -0.761845 -0.958374 -0.793846 0.189197 0.584714 0.561870 0.567231 0.323337
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.422741 0.427158 1.069372 0.884471 1.270415 0.985940 0.651244 0.734440 0.556778 0.562640 0.332635
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.305087 0.288081 13.545898 0.620185 1.667096 0.599618 0.496409 0.108339 0.036937 0.544517 0.366834
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.456623 7.492983 13.578193 14.056489 1.661239 1.619852 1.405220 1.472254 0.031759 0.024958 0.003309
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.858693 4.636946 13.748595 12.825886 1.668588 0.584177 1.105134 0.664293 0.027293 0.295732 0.183135
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.030296 -0.302456 0.020269 -0.301431 -0.073092 -0.689432 0.556754 -0.198093 0.493454 0.500927 0.296580
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.607664 8.013512 0.326322 -0.386958 -0.527064 -0.628298 -1.461570 -0.416595 0.493896 0.419022 0.267758
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.012994 0.632620 -0.469836 0.556407 -0.248328 0.267278 1.008454 4.561751 0.487356 0.475288 0.286231
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.276978 2.671351 0.276703 1.173019 0.689342 1.266392 -0.434305 0.154956 0.526312 0.520837 0.304397
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.072501 0.139366 -0.937493 -0.219828 -0.313564 0.112120 -0.311790 4.282868 0.544162 0.540605 0.306984
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.172705 1.127688 1.351714 -0.648287 0.565336 -0.114381 -0.637783 1.341376 0.527008 0.552903 0.307803
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.407386 27.235749 3.385896 7.725719 1.988918 2.028930 2.022888 1.269077 0.560153 0.550835 0.312494
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.121607 0.583870 0.480923 1.492540 0.332212 0.960691 -0.145601 0.009224 0.567526 0.567128 0.310358
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.474178 0.090877 0.980625 0.633535 0.522171 0.351789 0.876211 0.312816 0.569569 0.574148 0.319785
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.874272 1.054199 -0.021976 -0.476563 0.069414 -0.341414 0.898972 0.508480 0.565146 0.565056 0.315715
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.902787 2.488343 1.701559 2.749305 1.065532 1.523250 5.673218 2.174659 0.557246 0.565253 0.325608
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.179297 7.452023 13.619957 13.818702 1.633871 1.633382 1.638108 2.336397 0.080542 0.038017 0.031956
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 14.967657 -0.338558 0.933047 0.150370 -0.412883 0.585635 1.473436 0.409035 0.453406 0.543302 0.300813
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 6.756028 7.407860 1.840368 13.892184 1.263427 1.581428 10.721176 1.753365 0.469065 0.078676 0.331029
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% 1.054279 1.859474 1.676894 11.114065 0.731400 -0.189602 0.432750 0.489582 0.224615 0.174636 -0.226672
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.821200 2.917607 1.835585 1.935792 1.033422 1.161900 -1.671109 -1.538864 0.472526 0.462476 0.281610
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 2.467347 1.187667 1.571498 4.398111 0.818219 -0.125750 -0.880559 2.101396 0.462657 0.434322 0.266320
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.984524 -0.713199 -0.558672 -0.520776 -0.169018 -0.936973 -0.509102 -0.646085 0.474964 0.468078 0.284187
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 16.960947 30.619793 27.005155 31.945875 4.260060 5.352928 232.627021 279.274406 0.017446 0.016234 0.001273
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 16.351737 16.582744 27.953715 26.194202 4.579477 4.569673 345.762457 233.452648 0.016461 0.016500 0.000739
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.350660 -0.302202 2.926114 -0.774488 2.381381 -0.692848 2.045460 -0.842125 0.533473 0.531775 0.304711
121 N08 digital_ok 100.00% 4.99% 0.00% 0.00% -0.089529 2.921839 -0.389678 6.735587 0.161569 2.254016 9.838049 7.001085 0.450288 0.539752 0.319927
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.799846 1.098736 -0.159981 -0.767884 0.108905 -0.401499 -0.545096 -0.782542 0.562086 0.561082 0.312494
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.319159 0.641253 1.639828 0.490237 0.932293 -0.004579 0.571792 0.825150 0.539238 0.559411 0.314216
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 6.330358 0.135048 13.725353 0.908007 1.699083 0.983460 1.840139 1.970727 0.045148 0.578996 0.377488
125 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.335446 0.818817 7.931885 1.876728 0.772646 1.021379 0.870287 0.124621 0.510736 0.570776 0.329214
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.808075 0.579391 1.141558 1.109652 0.785878 0.892156 0.688078 0.346953 0.564632 0.571316 0.330512
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.345527 -0.893997 13.544328 -0.677766 1.667293 -0.811013 0.598035 -0.574613 0.038127 0.546382 0.367462
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.298060 -0.300381 -0.341904 -0.380494 -0.052534 -0.921904 1.187265 0.102625 0.540717 0.539752 0.330227
131 N11 not_connected 100.00% 0.00% 46.26% 0.00% -0.825192 6.603586 -0.808446 8.227968 -1.123799 0.880485 -1.129939 0.654513 0.499000 0.228934 0.337351
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.733631 -0.699859 -0.732960 -0.540034 -1.144347 -0.310698 -0.870514 -0.498356 0.498817 0.491523 0.289784
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.653445 -0.879635 -0.541181 -0.984119 -0.503459 -0.775281 -0.322614 -0.373409 0.481955 0.476136 0.284405
134 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.033477 1.999009 3.296838 1.286406 0.847891 0.586375 6.113165 -0.511035 0.420872 0.432824 0.271899
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.184337 -0.971038 -0.584562 -0.942907 -0.951866 -0.394994 -0.256474 -0.326894 0.437953 0.436734 0.280446
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 5.868284 -0.105640 13.262454 0.120492 1.694764 0.309325 2.650410 2.222741 0.042686 0.460440 0.317802
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 14.899374 28.446532 26.464710 30.580886 4.339478 3.656438 271.410690 284.834609 0.016462 0.016263 0.000726
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.551319 -0.341870 0.142631 -0.691880 -0.535222 -0.547227 -0.603057 0.906820 0.503841 0.503435 0.293857
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.526334 -1.242006 0.620607 -0.984904 0.603194 -0.870952 0.099606 0.595233 0.542149 0.534449 0.303287
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.121193 -0.537654 0.310899 -0.455856 0.326592 -0.853777 -0.387334 -1.124767 0.552526 0.543869 0.307551
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.432370 7.455303 -0.351889 14.037778 0.213697 1.683599 8.350496 5.293977 0.560338 0.050920 0.438319
143 N14 RF_maintenance 100.00% 96.68% 100.00% 0.00% 6.333118 7.416373 13.241034 14.007680 1.614218 1.668540 3.044188 3.875399 0.139623 0.034085 0.087954
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.448697 -0.894216 -0.195693 -0.413059 0.456687 -0.929013 -0.583916 -0.765955 0.575986 0.568574 0.326346
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.940735 1.539109 0.988746 1.886790 0.943515 1.753340 -0.067317 0.393104 0.572095 0.567996 0.319331
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.716024 -0.902478 -0.475444 -0.823646 -0.512980 -0.679259 -0.678111 -0.174932 0.538919 0.546411 0.321673
147 N15 digital_ok 100.00% 89.20% 89.20% 0.00% 87.021960 86.934520 inf inf 500.854564 506.568071 2588.919836 2655.324349 0.332056 0.319263 0.277003
148 N15 digital_ok 100.00% 88.37% 86.70% 0.00% 102.072945 102.025351 inf inf 520.129115 514.642986 3845.431342 3740.259336 0.331896 0.349253 0.247223
149 N15 digital_ok 100.00% 89.47% 88.92% 0.00% nan nan inf inf nan nan nan nan 0.321360 0.330221 0.270975
150 N15 digital_ok 100.00% 89.47% 90.03% 0.00% nan nan inf inf nan nan nan nan 0.318945 0.306901 0.283356
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.375017 0.140976 -0.411307 1.360296 -0.424583 0.741707 1.783962 5.738850 0.428558 0.485252 0.273412
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.099177 -0.363690 13.428555 0.126662 1.675216 0.598266 2.112474 0.643853 0.043662 0.450514 0.319873
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.485177 7.384950 6.805132 13.888465 2.069480 1.624085 4.614095 1.604165 0.439795 0.042181 0.319891
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.697454 0.690071 0.815995 1.041005 0.719232 0.906892 -0.335161 -0.108633 0.477102 0.480861 0.290786
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -1.099099 -1.118030 -1.000299 -0.978039 -0.591916 -0.605747 1.027749 3.558538 0.496119 0.494440 0.297740
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.267110 6.804580 0.669435 0.546558 0.360396 -0.415311 -0.349984 -0.254935 0.490008 0.408327 0.267749
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 6.606085 -0.612797 13.498238 -0.296584 1.672666 0.264881 1.257902 0.041735 0.047380 0.535277 0.406925
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.713353 14.788037 0.654284 0.935756 0.754554 -0.344074 -0.214642 -0.249543 0.547291 0.452743 0.278408
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.131548 -0.842615 -0.220694 -0.883060 -0.982748 -0.464543 -1.152720 -0.940759 0.549811 0.552956 0.316531
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.358179 1.064251 0.578200 0.768238 0.975507 0.860142 1.573047 2.004975 0.566091 0.566766 0.319956
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 1.752954 1.424996 3.940697 1.259515 2.592428 0.935182 4.260515 2.885993 0.554848 0.562765 0.313200
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 7.685168 -0.098695 1.511536 0.025612 0.087515 0.125976 1.045047 -0.059440 0.484905 0.563069 0.290853
166 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 6.424150 -0.282862 13.697933 -0.148096 1.663950 -0.522568 0.632508 -1.156132 0.036325 0.541916 0.371291
167 N15 digital_ok 100.00% 88.92% 90.03% 0.00% nan nan inf inf nan nan nan nan 0.356973 0.316650 0.299036
168 N15 digital_ok 100.00% 89.75% 90.86% 0.00% nan nan inf inf nan nan nan nan 0.302125 0.296866 0.284769
169 N15 digital_ok 100.00% 91.69% 91.14% 0.00% nan nan inf inf nan nan nan nan 0.317624 0.323974 0.235087
170 N15 digital_ok 100.00% 89.75% 90.58% 0.28% 98.671337 98.855576 inf inf 596.110280 602.056313 4695.641992 4774.337219 0.325041 0.289181 0.257683
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.008707 -1.222647 1.539541 -0.484570 0.535488 -0.452681 0.313817 -0.009224 0.486358 0.491078 0.297538
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.044326 0.875623 1.308954 0.355691 0.552069 -0.298678 -1.617893 -1.165012 0.468162 0.465907 0.285123
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.737625 2.804844 1.809605 1.868676 1.021697 1.088531 -1.525720 -1.333886 0.440468 0.425245 0.268580
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.205548 0.700232 1.004783 1.259816 0.489683 0.857145 -0.194339 8.113635 0.504821 0.502430 0.305017
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.577863 7.738585 -0.668835 14.123068 -0.037965 1.636698 6.372345 2.554750 0.510161 0.056984 0.403686
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 2.147273 2.097416 2.706212 3.092643 1.652572 1.703166 0.302239 3.816451 0.530207 0.527421 0.313616
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.647968 7.363662 -0.537986 13.804561 -0.966430 1.640349 4.007801 2.276444 0.544999 0.053301 0.392166
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.255320 1.492660 0.614001 1.277788 0.884617 0.854069 0.148080 0.603802 0.554231 0.548861 0.309337
184 N14 digital_ok 100.00% 22.71% 0.00% 0.00% 6.193915 0.279986 12.549782 0.617135 0.755130 0.695551 0.443242 -0.257930 0.275311 0.557755 0.358408
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.717620 0.117638 -0.822813 0.387350 -0.489011 0.434604 -0.655503 -0.265523 0.557070 0.558008 0.314096
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.651386 -1.121822 -0.397276 -0.998389 -0.960849 -0.644297 -0.224763 0.077151 0.545432 0.546809 0.309625
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.571404 -0.117809 -0.462320 -0.217559 -0.094172 -0.637463 0.959226 -0.129989 0.541402 0.534815 0.314940
189 N15 digital_ok 100.00% 89.20% 91.97% 0.28% nan nan inf inf nan nan nan nan 0.312560 0.254725 0.261485
190 N15 digital_ok 100.00% 88.92% 88.92% 0.28% 69.563392 69.968434 inf inf 472.910641 469.912450 3751.941765 3715.588314 0.322579 0.342763 0.260275
191 N15 digital_ok 100.00% 89.47% 91.14% 0.00% nan nan inf inf nan nan nan nan 0.305339 0.273408 0.218286
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.800129 3.141043 1.819894 2.069171 1.068099 1.295291 -0.363029 -0.249598 0.454801 0.434868 0.276781
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.091415 2.719521 2.037906 1.807729 1.232726 1.087322 -1.516182 -1.412074 0.437896 0.426869 0.267664
200 N18 RF_maintenance 100.00% 100.00% 57.34% 0.00% 7.087703 -0.660199 8.173486 -0.908874 1.666852 -0.225926 1.139632 -0.393207 0.048081 0.206660 0.068144
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.477656 2.446670 0.971249 1.683343 0.098141 0.925676 -1.051988 -0.996802 0.504627 0.483248 0.300327
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.222854 -0.894347 0.124246 -0.931247 -0.753967 -0.581162 -1.380280 4.469632 0.527793 0.526468 0.306503
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.858924 3.772902 2.210737 -0.536519 1.762144 -0.046102 6.887425 -0.561751 0.539713 0.536174 0.305310
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.847503 -0.726079 6.501574 -0.513631 -0.630177 -0.238528 1.476059 1.145888 0.384674 0.538388 0.351811
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.860937 1.286616 3.579107 4.251088 0.040603 0.216626 0.142325 0.601143 0.479671 0.469986 0.269469
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.147611 -0.490675 -0.883927 0.042501 -0.794660 0.037985 2.695064 0.178252 0.511792 0.519917 0.308945
208 N20 dish_maintenance 100.00% 87.26% 88.37% 0.28% 95.843833 95.982633 inf inf 553.312781 548.269493 4845.859545 4889.711543 0.340551 0.312718 0.242658
209 N20 dish_maintenance 100.00% 90.03% 89.47% 0.55% nan nan inf inf nan nan nan nan 0.315422 0.370005 0.251354
210 N20 dish_maintenance 100.00% 88.37% 88.09% 0.28% nan nan inf inf nan nan nan nan 0.416896 0.426442 0.235090
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.508727 7.607594 -0.353455 8.501223 -0.305591 1.622928 0.579373 1.577406 0.487147 0.039606 0.385749
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.523873 -0.917166 -0.447761 -0.798350 -1.043311 -0.351297 -0.421009 -0.468657 0.513997 0.507674 0.302193
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.712320 -0.744890 -0.851628 -0.987396 -0.873111 -0.617196 1.999337 -0.877574 0.519058 0.515279 0.303236
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.429255 -0.484154 -0.625233 -0.626587 -1.130099 -0.997551 0.365839 -1.047334 0.521147 0.519339 0.301694
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.687484 0.581279 0.001520 1.960332 -0.076932 0.784250 -0.609794 0.936396 0.522205 0.502809 0.298944
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.250503 2.950674 2.188573 1.982366 1.357000 1.179773 -1.639524 -1.523931 0.480013 0.476806 0.283470
225 N19 RF_ok 100.00% 0.00% 79.22% 0.00% 0.168446 7.018250 -0.030533 8.223327 -0.909343 1.282089 -1.195114 1.327747 0.517324 0.168972 0.398769
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.035392 4.901948 -1.015544 -0.569256 -0.806278 -0.383472 -0.744447 -0.672287 0.511863 0.438937 0.291424
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.075180 -0.082095 3.038378 0.131164 0.730422 0.027975 14.036236 8.049456 0.468132 0.491521 0.301690
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.220179 -0.588405 -0.136179 -0.498378 -0.981585 -0.130202 0.048271 0.205560 0.493448 0.484239 0.290761
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.255282 0.404089 -0.247110 0.220677 -0.876185 -0.272678 -1.289228 -1.310164 0.483505 0.465175 0.294320
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.014666 -0.902124 0.771192 -0.701548 0.403232 -0.198456 1.891672 0.062176 0.477567 0.482701 0.299202
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.145119 -0.008707 -0.022854 -0.011147 -0.826027 -0.686886 -1.072396 -1.011121 0.501294 0.494248 0.304834
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.060294 -0.372890 -0.927888 -0.506908 -0.767645 -0.905950 -0.767425 0.863482 0.508853 0.500097 0.306002
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.173340 -0.394909 -0.092378 -0.856147 -0.809469 -0.910260 -1.152226 -0.611258 0.507411 0.503337 0.302529
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.045158 -0.815022 -0.856928 -0.641516 -0.881123 -0.945147 -0.739337 -0.917398 0.512561 0.505285 0.308492
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.967606 0.250243 -0.603900 0.022909 -0.619301 -0.565624 -0.714904 -1.186273 0.432283 0.495575 0.290228
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.165515 -0.905969 -0.180286 -0.575751 -0.295083 -0.238384 -0.369210 -0.346751 0.443666 0.494406 0.292631
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.061305 0.172887 0.524442 1.217188 0.112655 0.407606 0.714499 1.573553 0.490025 0.481414 0.287656
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.197907 -0.573933 -0.308132 -0.746173 -1.040647 -0.536831 -1.082132 0.667320 0.491826 0.481122 0.291446
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.674847 7.896931 -1.022552 8.079631 -0.705208 1.629209 -0.178007 0.894153 0.478181 0.040048 0.376053
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.607003 -0.498815 -0.833921 -0.854940 -1.039733 -0.900922 1.751594 -0.323126 0.483930 0.470696 0.288849
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 4.039662 5.455994 0.510753 0.812232 0.770778 0.671726 0.796994 1.188109 0.477838 0.464207 0.294678
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.673468 1.225286 0.919917 0.715409 0.216674 0.221293 -0.403827 -0.113286 0.371046 0.324150 0.219846
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.027398 1.198566 0.116631 0.290895 -0.534228 -0.202844 0.522495 0.508997 0.363957 0.323704 0.218844
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.323075 -0.974945 0.017292 -0.331078 -0.744286 0.004579 -0.384015 0.606142 0.403070 0.368901 0.244861
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.954860 7.586377 8.010575 8.639200 1.663235 1.620215 0.745721 0.846753 0.041910 0.040269 0.002296
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.539757 -0.132362 0.127671 -0.430864 -0.173655 -0.417738 1.015873 0.236111 0.364805 0.336914 0.215378
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [4, 7, 15, 16, 17, 18, 27, 28, 29, 31, 32, 34, 37, 38, 40, 41, 42, 45, 47, 51, 53, 55, 56, 58, 59, 60, 61, 63, 65, 66, 68, 70, 72, 73, 77, 78, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 102, 104, 108, 109, 110, 111, 112, 114, 117, 118, 121, 124, 125, 127, 131, 134, 136, 137, 142, 143, 147, 148, 149, 150, 151, 155, 156, 159, 160, 161, 164, 165, 166, 167, 168, 169, 170, 179, 180, 182, 184, 189, 190, 191, 200, 202, 204, 205, 206, 208, 209, 210, 211, 225, 226, 227, 242, 243, 246, 262, 329]

unflagged_ants: [5, 8, 9, 10, 19, 20, 21, 22, 30, 35, 36, 43, 44, 46, 48, 49, 50, 52, 54, 57, 62, 64, 67, 69, 71, 74, 79, 80, 85, 88, 89, 90, 91, 95, 101, 103, 105, 106, 107, 113, 115, 120, 122, 123, 126, 128, 132, 133, 135, 139, 140, 141, 144, 145, 146, 157, 158, 162, 163, 171, 172, 173, 181, 183, 185, 186, 187, 192, 193, 201, 207, 220, 221, 222, 223, 224, 228, 229, 237, 238, 239, 240, 241, 244, 245, 261, 320, 324, 325, 333]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

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