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 = "2460069"
data_path = "/mnt/sn1/2460069"
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-4-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/2460069/zen.2460069.42108.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/2460069/zen.2460069.?????.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/2460069/zen.2460069.?????.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 2460069
Date 5-4-2023
LST Range 14.369 -- 16.309 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 62 / 198 (31.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 102 / 198 (51.5%)
Redcal Done? ❌
Never Flagged Antennas 94 / 198 (47.5%)
A Priori Good Antennas Flagged 50 / 94 total a priori good antennas:
7, 15, 17, 19, 31, 37, 38, 40, 42, 53, 55,
65, 66, 70, 72, 81, 83, 86, 93, 94, 103, 109,
111, 112, 118, 121, 124, 127, 136, 140, 147,
148, 149, 150, 151, 158, 160, 161, 164, 165,
167, 168, 169, 170, 182, 184, 189, 190, 191,
202
A Priori Bad Antennas Not Flagged 50 / 104 total a priori bad antennas:
8, 22, 35, 36, 43, 46, 48, 49, 50, 52, 57,
64, 74, 79, 80, 89, 90, 95, 102, 113, 114,
115, 120, 125, 126, 132, 133, 135, 139, 185,
201, 206, 220, 221, 222, 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_2460069.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.179044 8.570876 -1.040490 -0.672118 -0.359339 0.865762 -0.781474 8.517555 0.459692 0.368608 0.300148
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.090246 0.275408 0.513214 3.069763 0.676390 1.376486 -0.155426 0.521183 0.471123 0.453126 0.307286
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.786696 -0.120921 -0.401100 0.149790 -0.140293 0.068519 1.249966 7.486325 0.477535 0.470564 0.302544
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.554709 1.653880 1.077011 1.076955 0.140370 0.043606 -1.816022 -1.757111 0.443241 0.439386 0.277777
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.470469 -0.446303 2.841362 -0.373886 0.943192 0.212204 1.726736 -0.407367 0.448060 0.461706 0.291689
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.764639 -0.720184 -0.420920 -0.507699 -1.340534 0.033314 -1.022718 -0.112140 0.452433 0.448244 0.291278
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 9.502685 -0.478716 -0.617941 -0.523306 -0.379652 0.128855 -0.342824 0.814295 0.362549 0.468859 0.302660
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.058974 1.275564 0.238343 0.829585 -0.988319 -0.213528 -1.364992 -1.821616 0.468044 0.458103 0.300656
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.121030 2.462897 0.871769 7.706558 0.658860 -0.741668 0.780700 3.924260 0.481776 0.353207 0.336327
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.286864 3.308952 0.862902 1.299980 0.486566 0.450437 3.422282 9.438577 0.458767 0.296257 0.331901
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.417533 0.059908 -0.176190 3.418295 -0.111287 1.389082 -0.250281 7.854120 0.485417 0.477136 0.302386
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.455547 -1.064370 1.762515 -0.476527 1.851428 -0.223192 1.217630 0.047142 0.472292 0.481597 0.295944
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.108520 0.192422 0.059012 0.286571 0.605738 -0.097514 0.335428 0.193994 0.466341 0.472742 0.293140
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.010487 -0.902252 -0.796493 -1.067377 0.201204 -0.498423 -0.183684 -0.670213 0.435312 0.437210 0.284758
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.730408 17.193126 8.720127 5.579253 1.249440 0.674497 2.558361 34.999638 0.064801 0.067265 -0.024533
28 N01 RF_maintenance 100.00% 100.00% 34.90% 0.00% 6.617912 9.617445 8.889651 3.706861 1.506503 0.282165 1.285348 9.458701 0.030596 0.212761 0.159413
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.734195 -0.013570 -0.106298 0.051681 0.589402 0.616961 0.512218 1.803882 0.492521 0.497515 0.304758
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.123381 -0.836756 0.211886 -0.629129 0.486401 -0.305275 0.467282 -0.230337 0.498266 0.504137 0.305387
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.344277 -0.041713 1.096835 2.601632 0.785519 0.395318 0.488986 16.207454 0.501792 0.492833 0.306174
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.932778 12.399393 0.035297 0.012921 -0.604262 -0.164359 7.304125 6.873087 0.388926 0.421024 0.170894
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.490735 -0.544793 5.093076 -0.691582 1.502869 -1.085003 0.845124 -0.222945 0.043912 0.460420 0.322114
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.676971 -0.638046 -0.344954 -0.388145 -1.341703 -0.410897 -1.173730 0.017662 0.452041 0.447031 0.290497
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.190335 3.420152 1.056588 0.784162 1.840254 0.961214 1.805857 2.135557 0.455654 0.445769 0.295777
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.946869 13.538799 -0.788083 10.862081 -0.795249 1.258068 0.344230 3.460218 0.459824 0.033436 0.363505
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.146948 -0.300290 -0.062217 0.404359 -0.134957 0.159526 1.602293 6.919375 0.466793 0.466236 0.297127
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.136290 0.528190 0.141713 -0.309797 -0.065708 1.625074 16.580540 2.617732 0.194459 0.189063 -0.259792
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.509354 0.943386 1.335649 1.794178 1.138353 0.435490 0.963739 1.130206 0.490769 0.496130 0.309689
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.385709 0.928807 -0.276727 -0.510254 -0.696827 1.021354 0.065426 1.024734 0.213762 0.203411 -0.261081
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.192245 0.020870 -0.984532 0.786627 -1.128886 0.470321 -0.829125 0.438246 0.508915 0.511337 0.313806
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.873719 0.343391 -0.680729 0.439122 -0.267771 0.682586 -0.389112 0.312630 0.506950 0.516664 0.313674
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.455338 0.689783 0.774007 0.711137 0.744417 0.313010 0.092803 1.611849 0.500031 0.506235 0.308839
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.304173 -0.807845 0.111674 -0.964079 0.301393 -0.184877 0.306943 -0.174109 0.491940 0.504644 0.308281
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 6.955535 8.434572 5.021620 5.004998 1.570566 1.174071 2.339067 0.907522 0.031474 0.053055 0.014899
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.562612 0.078847 -0.982356 0.087119 -0.906661 -0.736127 -0.678996 -1.235208 0.456952 0.463438 0.284583
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.575218 -0.471205 0.146100 -0.665650 -0.788614 -1.058510 -0.147855 0.493189 0.433087 0.449063 0.283744
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.082539 0.188594 0.433247 1.457980 1.008854 1.453639 -0.101784 0.195722 0.447536 0.441219 0.290960
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.261334 0.386910 0.050225 -0.164506 1.678294 0.321413 96.250066 0.700109 0.458335 0.461221 0.295874
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.990758 2.334029 0.630147 0.327679 0.661932 0.486533 1.079587 0.212622 0.482660 0.477126 0.301514
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.076790 -0.201882 0.084931 -0.799632 0.267962 -0.685415 5.905241 3.208207 0.490168 0.488057 0.306197
54 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.227182 1.430343 0.816414 -0.506459 0.655470 0.321246 -1.054736 -0.499525 0.286774 0.333214 0.147816
55 N04 digital_ok 100.00% 68.42% 100.00% 0.00% -0.167694 28.664686 -0.140301 6.430625 -0.788312 1.070842 0.891922 0.365839 0.196937 0.042025 0.060483
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.658059 0.814193 -1.013783 1.378668 -0.066414 -0.198699 1.305793 1.823502 0.506937 0.507423 0.308582
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.637853 1.386406 -0.922273 -0.368020 -0.064561 0.252747 1.084631 1.469743 0.508860 0.509105 0.304001
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.246170 7.953047 8.912996 9.345291 1.532272 1.168247 1.506564 1.289494 0.038150 0.037568 0.002134
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.904532 0.710800 8.934916 1.065809 1.495439 0.631064 0.504814 8.498438 0.044880 0.510820 0.365617
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.871326 7.876779 0.233610 9.369859 0.397369 1.275150 1.668012 3.183294 0.484804 0.065491 0.371684
61 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.371040 -0.904965 4.815322 -0.441753 1.500508 -0.496458 0.043524 0.132826 0.034977 0.477357 0.323912
62 N06 digital_ok 0.00% 0.00% 0.00% 0.00% -0.519424 0.115481 0.377819 -0.077731 -0.296708 -0.804062 0.423851 -1.160511 0.442701 0.469679 0.285392
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.700060 8.130947 -1.048619 5.318650 -0.788625 1.147257 -0.542138 1.823946 0.464528 0.044654 0.347193
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.669571 -0.519443 -0.782691 -0.009003 -0.614245 -0.254748 -0.202646 0.678769 0.452185 0.441984 0.284225
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 14.350089 13.499923 11.197608 11.186662 1.503242 1.188347 3.591679 4.398197 0.023861 0.032517 0.009228
66 N03 digital_ok 100.00% 91.14% 100.00% 0.00% 1.100481 13.858927 0.773326 11.314497 0.144295 1.116710 -1.675172 4.433730 0.170786 0.044451 0.079316
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.765229 0.031892 -0.199615 1.359430 -0.013357 0.688765 3.076913 1.618018 0.483189 0.478283 0.302560
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 15.210284 -0.122337 11.251627 -0.170834 1.534341 -0.736988 4.416192 -0.395163 0.034594 0.487545 0.380594
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.594033 3.253746 1.226343 -0.488941 0.820110 0.638960 3.182036 2.761721 0.503973 0.502140 0.300065
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.038488 1.274470 1.123523 2.495309 -0.212638 1.427809 3.125074 1.102093 0.217991 0.201785 -0.259540
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.528760 -0.044663 -0.188759 0.345188 0.013357 0.173208 -0.443196 0.407859 0.516326 0.522840 0.313087
72 N04 digital_ok 100.00% 27.70% 100.00% 0.00% 0.544365 8.154667 2.123483 9.485049 0.658071 1.199718 13.231586 2.792104 0.213239 0.076999 0.010025
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.664369 0.632643 -0.518985 0.251778 -0.005111 2.597949 -0.093395 4.687620 0.523459 0.527975 0.319398
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.955470 -0.216637 -0.817189 -0.136255 -0.995644 0.767131 -0.696101 1.615711 0.513848 0.525207 0.317881
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 22.373156 6.492312 0.069499 -0.754409 3.016596 -0.417054 6.013842 -0.453270 0.294730 0.398317 0.203024
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 12.905875 -0.072881 0.111086 0.045018 -0.088632 -0.742161 0.258986 -0.731594 0.339554 0.476689 0.286615
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.992814 -0.738081 0.798267 -0.703507 0.285013 -0.680903 1.287941 -0.207361 0.445007 0.464037 0.290040
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.707621 1.248847 -0.701103 0.877596 -1.313763 -0.034666 -0.910320 -1.612304 0.459128 0.444955 0.294522
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 44.258113 30.293543 21.395162 23.678524 13.206089 17.377244 356.748984 442.304324 0.018225 0.016280 0.001655
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 32.845404 36.066535 25.240830 21.890321 21.663532 14.649873 545.457145 373.581975 0.016253 0.016231 0.000716
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 16.214834 21.762490 18.443696 18.483344 11.137316 12.573098 279.162125 268.498759 0.016499 0.016419 0.000718
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.709229 15.004889 0.447703 11.371621 -0.500986 1.024085 -1.611460 3.226930 0.478407 0.050531 0.360420
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.745726 -0.043482 -0.921990 -0.239958 -0.905731 0.030195 -0.636939 0.639439 0.501260 0.503673 0.302644
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% -0.013702 0.046117 0.482234 0.123104 0.935026 0.775582 2.504534 9.208782 0.509009 0.510328 0.299653
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.814765 1.675871 2.756987 -0.781861 0.518616 -0.754357 4.439393 -0.564526 0.412840 0.526122 0.302086
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.019092 0.718508 0.732488 1.115427 0.562555 0.472378 0.719770 0.220985 0.519624 0.523576 0.305251
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.407384 0.151375 0.659866 1.003010 0.786704 0.253315 -0.163956 0.099076 0.520389 0.524843 0.312089
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.576567 -1.002590 -0.062967 -0.902064 -0.119050 -0.940348 -0.118091 -0.017662 0.517343 0.525729 0.314333
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.150450 0.033325 0.817782 0.577264 0.413932 0.758328 0.574816 0.366719 0.503553 0.519289 0.315920
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.566118 0.201848 8.929781 0.452775 1.576510 1.029313 1.101195 1.222854 0.035849 0.509455 0.353598
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.758025 8.082502 8.994184 9.410209 1.508068 1.135493 1.814889 1.509811 0.030992 0.025036 0.002922
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 7.123623 1.137549 9.097752 6.642806 1.500814 0.651621 0.898569 2.389692 0.028500 0.411003 0.274582
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.200049 -0.456231 -0.040563 -0.455080 -0.609211 -1.107367 0.452838 -0.901246 0.450679 0.472852 0.293044
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.051239 10.435749 0.037059 -0.597140 -0.913739 -0.249237 -1.373638 -0.002840 0.462514 0.384600 0.277058
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.065751 0.892978 -0.853073 0.317649 -0.875224 -0.229268 -0.200509 6.189350 0.454066 0.440480 0.285252
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.243564 3.619468 0.170371 1.047209 0.923374 1.292089 -0.166905 0.249054 0.483525 0.484363 0.301039
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.883364 0.335296 -0.764861 -0.205632 0.098855 0.745335 -0.361397 3.981007 0.503351 0.503934 0.301821
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% -0.384676 1.734191 -0.809478 -0.496353 -0.611716 0.346439 1.346525 12.609997 0.505646 0.514395 0.301291
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.548973 29.462600 0.774697 5.544133 0.125259 0.501690 1.616733 1.990916 0.507888 0.501310 0.299784
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.097161 0.284306 0.531675 1.031771 0.414244 0.872531 0.088257 0.288375 0.521527 0.523172 0.306924
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.031941 0.527546 0.053484 0.186304 0.271257 0.138409 0.265373 -0.136593 0.521003 0.529209 0.309093
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.260245 0.169361 0.384581 -0.201377 0.421748 0.223229 0.809019 1.355494 0.520028 0.524287 0.307031
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.213388 1.772512 1.072773 2.165621 0.262006 0.758073 11.354681 0.394517 0.509927 0.519204 0.311638
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.438186 7.990983 8.990888 9.199239 1.511676 1.189829 0.794078 1.679503 0.060987 0.036917 0.017269
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.543525 -0.365141 0.729920 -0.085999 -0.139503 -0.212050 0.051895 -0.284847 0.391652 0.503462 0.302043
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 4.026866 7.946117 0.836500 9.262983 3.212881 1.137656 11.292841 1.748944 0.447773 0.056769 0.332246
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% 0.184420 3.084275 1.373593 7.950057 -0.031872 -0.705010 1.178044 0.835305 0.191554 0.136094 -0.211081
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.493755 2.424113 1.553739 1.535249 0.801234 0.650837 -2.248717 -2.192331 0.443570 0.437936 0.279116
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.946985 2.701709 1.262794 3.383346 0.467018 -0.517539 -1.931734 1.694023 0.438032 0.367674 0.279301
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.087040 -0.945644 -0.674642 -0.645430 -0.139427 -1.116137 -0.276751 -0.859790 0.437591 0.439767 0.279423
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 19.762923 30.524992 19.824923 23.006885 10.502461 21.340664 253.212699 395.779793 0.017191 0.016218 0.001124
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 16.938899 34.401806 19.822384 25.094387 15.687999 23.385510 400.101208 572.421808 0.016464 0.016216 0.000815
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.338057 0.372556 2.397845 -0.418033 1.777284 0.419371 2.144700 -0.236705 0.484308 0.498424 0.301344
121 N08 digital_ok 100.00% 3.32% 0.00% 0.00% 1.379944 1.530946 0.874552 4.761112 -0.184727 0.960723 0.322034 7.642956 0.435335 0.493813 0.302121
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.658366 2.048117 -0.308514 -0.753465 1.074815 -0.114755 -0.370976 -0.596325 0.514599 0.521225 0.305162
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.018835 0.991765 1.377794 0.296136 0.589291 -0.602328 -2.070364 -1.189436 0.490340 0.517813 0.307894
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 6.646176 0.115120 9.106964 0.727280 1.503978 0.593519 0.536909 0.605734 0.042558 0.534316 0.361329
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.013570 0.439939 2.095454 1.077508 0.138708 0.473704 0.925597 0.410602 0.515900 0.525175 0.312127
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.156201 0.338686 0.209432 1.000783 0.612817 0.661274 0.480462 0.122658 0.516085 0.522825 0.314194
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.414898 -1.085101 8.930417 -0.992074 1.519059 -0.226676 0.376554 -0.423958 0.036431 0.511490 0.354833
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.181554 -0.633387 -0.431161 -0.731432 0.081125 -1.014137 0.109613 1.664511 0.493700 0.500627 0.314561
131 N11 not_connected 100.00% 0.00% 79.22% 0.00% -1.089680 7.517865 -0.824311 5.170042 -0.858619 0.631957 -0.849482 0.444965 0.472241 0.188504 0.335528
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.091932 -0.409852 -0.940020 -0.576927 -0.686405 -0.289127 -0.321549 -0.195774 0.464635 0.455154 0.289535
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.375502 -1.041536 -0.536056 -0.941786 -0.278856 -0.954122 0.048651 -0.163710 0.448024 0.450600 0.287176
134 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.095846 1.822064 1.917683 1.141688 -0.502350 0.195955 7.896931 -1.886754 0.369487 0.413432 0.275375
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.447722 -0.956518 -0.367656 -0.816151 1.057437 0.431159 0.460577 0.142113 0.420783 0.426014 0.285610
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 6.064619 -0.178308 8.714740 -0.065053 1.526089 0.638615 0.938611 2.514503 0.040029 0.432971 0.302010
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 16.356487 29.909493 18.870373 23.292141 12.022307 27.825112 342.750619 498.769587 0.016461 0.016233 0.000785
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.127355 -0.422999 -0.022729 -0.912347 -1.158917 -0.430384 -1.068972 0.597063 0.466775 0.471655 0.290743
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.452030 -1.214119 -0.057007 -0.922634 7.083082 -0.276173 33.844664 3.356054 0.483336 0.503052 0.297612
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.255574 -0.614221 0.210376 -0.392195 0.718600 -1.156718 0.129576 -1.102271 0.506660 0.507762 0.299156
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.139661 7.980029 -0.156527 9.375749 1.278757 1.155740 14.173774 1.463227 0.517107 0.046378 0.415481
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.788125 7.869587 8.794577 9.350290 1.380852 1.135875 0.420025 1.234553 0.109513 0.033996 0.064445
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.382670 -0.744898 -0.260493 -0.169847 0.895520 -0.116067 -0.286592 -1.057285 0.524613 0.524477 0.310878
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.052303 -0.075008 0.062898 0.140581 -0.129480 2.055986 0.041100 1.783788 0.521749 0.521144 0.309371
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.571059 -1.011582 -0.685924 -1.067613 -1.153736 -1.044429 -0.510943 -0.587245 0.491140 0.501562 0.308841
147 N15 digital_ok 100.00% 96.95% 95.57% 0.00% nan nan inf inf nan nan nan nan 0.256557 0.334292 0.240104
148 N15 digital_ok 100.00% 96.40% 96.68% 0.00% nan nan inf inf nan nan nan nan 0.315099 0.299739 0.294198
149 N15 digital_ok 100.00% 97.78% 97.51% 0.00% nan nan inf inf nan nan nan nan 0.258588 0.332177 0.275686
150 N15 digital_ok 100.00% 96.95% 97.23% 0.00% nan nan inf inf nan nan nan nan 0.288206 0.288285 0.204938
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 8.127383 -0.522676 -0.674717 1.015323 -0.494312 0.175002 0.138453 7.317788 0.368439 0.437539 0.268240
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.431908 -0.817172 8.833196 -0.354597 1.529966 0.532231 1.542458 0.530111 0.041395 0.428605 0.310154
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.137949 7.881652 6.179610 9.237505 0.146116 1.257592 4.000357 2.376849 0.357946 0.040423 0.263854
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.253807 0.081448 0.553269 0.842889 0.929853 1.288077 -0.072203 0.215686 0.444025 0.451220 0.293469
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.384765 -0.749813 -0.820652 -0.876706 0.037400 0.218624 1.641369 9.449133 0.465195 0.470084 0.300699
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.006077 5.333802 0.009929 -0.422733 -0.111393 -0.240010 -0.139805 0.172453 0.447000 0.409739 0.275105
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 6.932147 -0.495415 8.910591 -0.192181 1.534886 0.626615 0.803439 0.164036 0.046249 0.497677 0.385093
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.398159 15.767351 0.456248 0.456270 1.073655 -0.182211 -0.142501 0.139593 0.501211 0.404528 0.284815
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.799588 -1.201906 -0.688446 -1.033130 -0.283724 0.289895 3.044647 -0.488432 0.509450 0.516187 0.307614
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.048652 0.820520 0.378961 0.612296 0.826883 1.615516 -0.146912 0.728601 0.519257 0.523738 0.312526
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.358806 0.915769 1.020297 1.133927 0.590043 1.034749 6.822717 2.172058 0.515560 0.518478 0.304585
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 8.025139 -0.156609 0.277955 -0.214006 0.589134 0.733565 4.491529 1.857340 0.428126 0.519310 0.301461
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.256173 -0.450286 0.963858 -0.265616 0.636765 -1.044124 0.177438 -1.194778 0.506921 0.506636 0.303380
167 N15 digital_ok 100.00% 96.95% 96.40% 0.00% 100.421158 100.570727 inf inf 1148.866956 1147.548877 4283.222225 4399.017983 0.278786 0.297706 0.225205
168 N15 digital_ok 100.00% 96.95% 96.40% 0.00% 108.532701 108.352710 inf inf 1192.170105 1126.232805 4246.530768 3938.707982 0.331085 0.354484 0.276938
169 N15 digital_ok 100.00% 96.68% 96.40% 0.00% nan nan inf inf nan nan nan nan 0.377366 0.361300 0.282277
170 N15 digital_ok 100.00% 96.68% 96.68% 0.00% 115.610610 115.617781 inf inf 1408.103085 1403.754597 4357.216433 4392.591394 0.313959 0.322760 0.226229
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.440698 -1.257987 0.552063 -1.074355 -0.617826 -1.037005 -0.110418 -0.271140 0.434938 0.451825 0.292639
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.686707 0.297648 1.087599 0.020703 0.296435 -0.531869 -1.835557 -0.458293 0.446064 0.443863 0.292967
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.513851 2.532337 1.603554 1.592089 0.907480 0.801585 -2.031671 -1.612374 0.411633 0.400040 0.271306
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.505521 -0.216952 0.290357 0.417598 -0.345369 0.229512 -0.046493 7.100304 0.463467 0.470926 0.302794
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.473735 8.328200 -0.553444 9.454296 0.526049 1.149165 7.087620 1.682891 0.477909 0.052273 0.382710
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.890838 0.368011 1.324380 0.909160 0.970288 0.566642 0.175127 3.743553 0.491924 0.496013 0.308924
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.744053 7.851788 -0.707104 9.175134 -0.923215 1.146631 0.205645 1.669379 0.505911 0.048068 0.373935
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.321622 0.084546 0.626391 0.871383 1.028624 1.019277 0.425710 0.526130 0.507223 0.507636 0.302154
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 7.878530 -0.313219 7.522573 -0.067614 0.854964 0.279920 3.130599 0.250601 0.289790 0.516562 0.340460
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.708665 -0.065506 -0.853622 0.030345 -0.182123 -0.138793 0.495495 0.518477 0.514905 0.514898 0.308205
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.082082 -1.107848 -0.525915 -0.929942 -1.214955 -0.861330 -0.913806 -0.751081 0.507110 0.507323 0.302945
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.082718 -0.893371 -0.111424 -0.634358 0.213926 -0.723675 2.264837 -0.703392 0.498700 0.496536 0.303845
189 N15 digital_ok 100.00% 95.84% 96.12% 0.00% nan nan inf inf nan nan nan nan 0.342146 0.352834 0.215138
190 N15 digital_ok 100.00% 95.84% 95.84% 0.00% 89.785189 89.344913 inf inf 1357.959274 1357.886780 4326.652697 4332.919066 0.377040 0.389176 0.243564
191 N15 digital_ok 100.00% 96.12% 95.84% 0.00% 113.124610 112.920214 inf inf 1355.877667 1342.919375 5625.194195 5585.943412 0.386053 0.375202 0.166635
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.178913 2.771647 1.387013 1.717398 0.604343 0.828255 -2.099597 -2.361599 0.426776 0.403994 0.278286
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.802150 2.413864 1.757814 1.536954 1.075611 0.683036 -2.236700 -2.105055 0.406315 0.400057 0.268715
200 N18 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.504377 17.800173 4.965493 0.201610 1.788050 0.365600 3.533289 8.882469 0.041901 0.230153 0.148892
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.121768 2.016707 0.804885 1.376382 -0.158727 0.395382 -1.620476 -2.137830 0.465411 0.449567 0.293108
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.010041 -0.559989 0.023661 -0.296996 -1.126514 0.088305 -1.285332 23.792459 0.479652 0.476740 0.290038
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.678397 5.978825 1.462492 -0.530957 0.204664 -0.113261 10.320917 0.249841 0.499075 0.499479 0.301706
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.813219 -0.723030 4.118371 -0.485132 -0.250177 0.294823 1.725077 7.630083 0.299088 0.489952 0.342316
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.618403 2.075512 1.331213 2.799149 -0.803553 -0.809805 0.493511 0.776167 0.444405 0.406005 0.271626
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.079810 -0.795382 -0.867638 -0.982672 -0.921358 -0.587792 4.091758 -0.374558 0.459599 0.475572 0.294432
208 N20 dish_maintenance 100.00% 96.95% 97.23% 0.28% 124.168467 124.017625 inf inf 1778.916659 1779.062075 6466.096690 6464.555561 0.300817 0.320082 0.128002
209 N20 dish_maintenance 100.00% 96.95% 96.95% 0.28% nan nan inf inf nan nan nan nan 0.306355 0.335471 0.227270
210 N20 dish_maintenance 100.00% 96.40% 97.23% 0.83% nan nan inf inf nan nan nan nan 0.361328 0.290083 0.118431
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.241950 8.226026 -0.555861 5.313151 -0.473762 1.220592 0.870509 1.675278 0.441782 0.040110 0.355070
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.869450 -0.939329 -0.565072 -1.051258 -0.873238 -0.687058 0.644988 -0.269672 0.466552 0.462085 0.291075
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.928363 -0.824687 -0.800458 -1.061377 -0.440812 -0.593418 2.446520 -0.290143 0.469824 0.474912 0.295611
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.629667 -0.672011 -0.914385 -0.650525 -1.131977 -1.205372 1.267051 -0.960979 0.475856 0.480737 0.295903
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.022572 -0.016760 -0.282329 1.425971 -0.421608 -0.052633 -0.052368 13.348664 0.471368 0.445557 0.290656
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.948667 2.544954 1.885885 1.640686 1.202180 0.741829 -2.294792 -2.044296 0.436680 0.437946 0.272657
225 N19 RF_ok 100.00% 0.00% 100.00% 0.00% -0.411526 7.756173 -0.334437 5.121028 -1.367905 1.028085 -0.967412 1.433791 0.474302 0.125155 0.370295
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.188893 7.638052 -1.063784 -0.553084 -0.815051 -0.295229 -0.685302 -0.565989 0.467511 0.385446 0.284477
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.087149 -0.785418 2.234297 -0.585151 -0.628208 -0.198813 9.479430 3.726877 0.394864 0.446890 0.296677
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.310875 -0.548431 -0.308933 -0.570970 -1.329466 -0.295890 -0.342200 0.492678 0.449305 0.438486 0.281444
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.089440 0.028427 -0.342751 0.042649 -0.982620 -0.672592 -0.851479 -1.380440 0.445580 0.436501 0.290102
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.698074 -0.845231 0.675219 -0.650707 -0.361115 -0.116863 0.700545 -0.462353 0.416126 0.440877 0.292284
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.397327 -0.643563 -0.258186 -0.356464 -1.403771 -1.155452 -1.196466 -1.172057 0.461412 0.456063 0.302068
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.120048 -1.034186 -1.000098 -0.786168 -0.877765 -0.860708 -0.725990 0.857179 0.463973 0.461004 0.297897
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.644133 -0.430377 1.130651 -0.956398 -0.423659 -0.773132 1.359403 0.698602 0.432596 0.465684 0.304067
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.363355 -0.999224 -0.986164 -0.674339 -1.020951 -1.014237 0.085932 -0.364552 0.466168 0.461098 0.298702
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.461286 -0.154558 -0.661034 -0.085512 -0.312237 -0.819512 0.113145 -0.872223 0.362924 0.453709 0.286458
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.475474 -0.979419 -0.119524 -0.620361 1.022644 -0.557291 8.421311 0.087024 0.401316 0.449888 0.288603
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.291289 -0.763372 0.142005 -0.268822 -0.689414 0.463444 1.290481 2.432532 0.442256 0.446088 0.281075
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.345615 -0.522727 -0.185897 -1.049296 -1.176768 -0.720509 -1.137509 0.231889 0.450458 0.441489 0.286048
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.757218 8.525302 -0.970482 4.969786 -0.359768 1.163289 -0.250007 0.511278 0.440552 0.039360 0.350469
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.745040 -0.635960 -0.662777 -0.897421 -1.132266 -0.985840 2.812405 -0.535701 0.445324 0.434662 0.287243
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.084582 6.883138 0.322706 0.414222 1.061750 0.008767 0.092762 0.832184 0.445654 0.436684 0.294699
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.195792 0.150892 0.642171 0.009003 -0.378103 -0.728385 -1.647438 -0.517272 0.346384 0.327786 0.247825
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.852360 0.938314 -0.068256 0.107786 -1.069817 -0.739228 -0.642879 -1.301048 0.337748 0.322215 0.237023
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.025328 -0.954633 -0.183588 -0.552841 -1.346412 -0.304197 -1.260668 -0.208444 0.365597 0.348045 0.260849
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 7.329144 8.175583 4.904705 5.433039 1.500291 1.124177 0.541550 0.399605 0.041110 0.039419 0.001960
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.860023 0.025477 -0.051768 -0.514875 0.402796 0.605164 1.486792 -0.127301 0.338369 0.335223 0.238048
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, 17, 18, 19, 27, 28, 31, 32, 34, 37, 38, 40, 42, 47, 51, 53, 55, 58, 59, 60, 61, 63, 65, 66, 68, 70, 72, 73, 77, 78, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 103, 104, 108, 109, 110, 111, 112, 117, 118, 121, 124, 127, 131, 134, 136, 137, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 164, 165, 167, 168, 169, 170, 179, 180, 182, 184, 189, 190, 191, 200, 202, 204, 205, 207, 208, 209, 210, 211, 223, 225, 226, 227, 242, 243, 246, 262, 329]

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

golden_ants: [5, 9, 10, 16, 20, 21, 29, 30, 41, 44, 45, 54, 56, 62, 67, 69, 71, 85, 88, 91, 101, 105, 106, 107, 122, 123, 128, 141, 144, 145, 146, 157, 162, 163, 166, 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_2460069.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 [ ]: