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 = "2460068"
data_path = "/mnt/sn1/2460068"
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-3-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/2460068/zen.2460068.42135.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 360 ant_metrics files matching glob /mnt/sn1/2460068/zen.2460068.?????.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/2460068/zen.2460068.?????.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 2460068
Date 5-3-2023
LST Range 14.309 -- 16.245 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 360
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 N15
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 67 / 198 (33.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 109 / 198 (55.1%)
Redcal Done? ❌
Never Flagged Antennas 87 / 198 (43.9%)
A Priori Good Antennas Flagged 57 / 94 total a priori good antennas:
7, 15, 17, 19, 20, 31, 37, 38, 40, 42, 53,
55, 56, 65, 66, 70, 72, 81, 83, 86, 93, 94,
101, 103, 109, 111, 112, 118, 121, 124, 127,
136, 140, 147, 148, 149, 150, 151, 158, 160,
161, 164, 165, 167, 168, 169, 170, 173, 181,
182, 184, 189, 190, 191, 192, 193, 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, 73, 74, 79, 80, 89, 90, 95, 113, 114, 115,
120, 125, 126, 132, 133, 135, 139, 185, 201,
206, 207, 220, 221, 222, 224, 228, 229, 237,
238, 239, 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_2460068.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.122449 9.615256 -0.942350 -0.607254 -0.417919 0.635315 -0.860876 3.897608 0.470376 0.371274 0.307044
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.108417 0.547586 0.491245 3.276088 0.968593 1.325008 -0.222777 0.860241 0.483053 0.466664 0.314421
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.845566 -0.083423 -0.489662 0.138812 -0.357795 0.004002 0.434182 9.889805 0.488842 0.481288 0.308417
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.748844 2.004197 1.447421 1.487502 0.753211 0.673510 -2.029544 -1.685012 0.452868 0.449229 0.284364
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.853850 -0.410700 3.339499 -0.418559 2.556115 0.212630 2.080034 -0.279166 0.459065 0.471544 0.297019
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.669428 -0.739588 -0.195215 -0.675580 -1.209774 0.193906 -1.219449 0.303739 0.463837 0.459842 0.298553
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 11.084777 -0.084859 -0.243420 -0.168549 0.048623 0.178667 0.730035 2.288171 0.376113 0.480396 0.308403
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.200299 1.645255 0.527536 1.242103 -0.468130 0.346809 -1.603361 -1.901234 0.478988 0.467433 0.308002
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.120227 2.601580 0.979791 8.961345 1.546615 -0.726224 0.197833 5.093004 0.493845 0.372511 0.342222
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.664290 5.253690 0.966195 1.838504 1.387252 0.728192 4.543595 17.279292 0.466132 0.288888 0.341566
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.368090 0.278996 -0.249625 3.943002 -0.129792 1.311547 -0.117391 11.365466 0.497606 0.489197 0.309253
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 5.080992 -0.976275 1.908374 -0.470772 3.330581 0.466230 1.914717 -0.061485 0.480266 0.494311 0.297002
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.295620 0.032483 -0.012159 0.211632 0.438973 1.078816 0.376456 0.366769 0.477178 0.484132 0.298666
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.902225 -0.910186 -0.443357 -0.785860 -0.877642 -0.326029 -0.332719 -0.403212 0.444810 0.446321 0.289218
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.288769 18.422677 10.310237 6.509860 1.557877 1.007929 2.985834 37.342311 0.063788 0.059242 -0.012429
28 N01 RF_maintenance 100.00% 100.00% 30.83% 0.00% 7.311998 11.036717 10.540234 4.428189 2.403474 1.256795 1.528978 14.356117 0.029954 0.213232 0.160402
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.732147 -0.118070 -0.133505 0.044337 0.878796 0.595897 0.529921 1.345678 0.504504 0.508661 0.310744
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.099397 -0.819769 0.137697 -0.722743 0.419975 -0.278358 0.594484 -0.086327 0.511156 0.515587 0.311848
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.502681 0.088693 1.169692 3.143070 1.090796 0.230749 0.228849 25.731952 0.513921 0.506101 0.312215
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.525613 13.186665 0.015915 -0.126358 -0.665364 -0.205300 0.771929 2.610337 0.401373 0.430967 0.169222
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 8.268029 -0.356650 6.116617 -0.494151 2.364532 -0.982825 1.123804 -0.091056 0.041543 0.471246 0.330020
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.464068 -0.782983 -0.128744 -0.554004 -0.933899 -0.021275 -0.679321 0.581494 0.463399 0.458620 0.296998
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.460574 3.742867 1.066790 0.733699 1.418082 1.686013 0.475344 1.297970 0.468156 0.456739 0.304311
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.763957 15.334986 -0.541178 12.810814 -0.620061 1.876511 -1.072478 2.828467 0.471268 0.032633 0.373987
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.009122 -0.305778 -0.054912 0.495822 0.977982 0.707876 2.695119 12.147478 0.478404 0.476554 0.302633
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.191535 0.655760 0.292778 -0.348432 -0.252047 1.151323 32.493283 0.482900 0.200365 0.193866 -0.263728
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.650833 1.161782 1.258148 2.273783 1.053151 0.385516 0.396172 0.726187 0.505400 0.507235 0.315079
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.257935 0.898332 -0.246638 -0.727027 -0.415732 1.086066 0.327916 2.060837 0.220177 0.208985 -0.264960
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.207216 0.039118 -0.881196 0.807503 -0.563145 0.380740 -0.970294 0.811544 0.521543 0.523860 0.320034
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.758501 0.550763 -0.690485 0.524150 -0.196925 -0.174991 -0.535238 0.158837 0.519170 0.527928 0.319228
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.790890 1.027643 0.990771 0.622408 0.902673 0.667303 0.119976 2.563181 0.510730 0.516773 0.312790
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.197318 -0.884913 0.214206 -1.049379 0.503499 -0.205759 0.442586 -0.004981 0.503325 0.515156 0.313162
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 7.779279 9.345822 6.034242 5.980827 2.445601 1.929762 2.739878 1.493405 0.031340 0.050862 0.013214
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.522825 0.243315 -0.793942 0.314365 -0.900164 -0.222988 -0.781705 -1.119965 0.469172 0.473533 0.290290
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.595930 -0.207029 0.189878 -0.411327 -0.410924 -0.915787 -0.140946 -0.046895 0.446882 0.460242 0.289936
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.279866 0.645801 0.638387 1.516842 1.348678 1.890065 0.471785 0.767525 0.459849 0.453479 0.299057
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.214032 0.532280 -0.076531 -0.199890 1.731218 0.542922 78.211229 0.484562 0.470830 0.472071 0.302031
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.355354 2.581604 0.589327 0.262599 1.768258 1.327284 2.299428 0.904089 0.495590 0.488938 0.308860
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.174778 -0.011049 -0.093168 -0.596311 2.761268 -0.445077 5.812266 5.174645 0.502919 0.498651 0.312271
54 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.261239 1.448236 1.227662 -0.287036 1.033667 0.564873 -1.637478 -0.686745 0.299667 0.341144 0.149451
55 N04 digital_ok 100.00% 59.44% 100.00% 0.00% 0.072608 31.155807 0.122240 7.802012 -0.144647 1.835698 1.012300 0.671825 0.204341 0.039520 0.064274
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.150524 1.336425 -1.014218 2.351796 -0.563457 5.167028 0.522444 1.987707 0.520429 0.518955 0.315427
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.914928 3.873945 -0.740457 -0.456195 -0.219931 0.919263 -0.008069 1.366758 0.521299 0.513579 0.305623
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.913460 8.827080 10.550426 11.020563 2.361213 1.856736 1.188500 1.375353 0.036689 0.036374 0.002338
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.629758 0.864791 10.564909 1.026671 2.463775 0.619557 2.407199 14.871667 0.043391 0.524335 0.378797
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.820313 8.715732 0.225461 11.051779 0.339076 1.931752 0.501697 3.262122 0.496676 0.066515 0.383572
61 N06 not_connected 100.00% 100.00% 0.00% 0.00% 8.134135 -0.922803 5.790987 -0.521387 2.355640 -0.648423 0.203733 0.419542 0.035143 0.489383 0.332672
62 N06 digital_ok 0.00% 0.00% 0.00% 0.00% -0.529246 0.438558 0.501283 0.243328 -0.691597 -0.490893 0.651906 -1.252650 0.455791 0.480025 0.290283
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.578125 9.039830 -1.028422 6.354681 -0.923195 1.902720 -0.664115 2.441736 0.475848 0.044194 0.358734
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.656480 -0.613206 -0.923573 -0.054357 -0.769851 -0.005252 -0.582372 0.448198 0.464064 0.454942 0.291114
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 16.198760 15.315820 13.244355 13.198056 2.398738 1.927339 3.977839 5.384048 0.023692 0.030699 0.007612
66 N03 digital_ok 100.00% 82.50% 100.00% 0.00% 1.404527 15.740231 1.117604 13.337769 0.836026 1.892921 -1.390688 5.702736 0.175863 0.042998 0.082170
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.769357 -0.019281 -0.537814 0.964406 -0.189188 0.884673 3.187603 2.150266 0.494876 0.490375 0.309029
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 17.080837 -0.078229 13.286198 -0.069155 2.399931 -0.603317 4.934425 -0.132165 0.032576 0.499348 0.390993
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.826952 2.878742 1.525294 -0.664042 1.005463 0.878934 1.646487 0.472703 0.516741 0.513841 0.306582
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% 0.085837 1.672219 1.195069 2.651454 0.173729 2.137872 3.800977 0.684166 0.224497 0.207965 -0.263406
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.026576 0.011641 -0.241663 0.432982 0.343945 0.191051 -0.282256 1.192007 0.529872 0.534559 0.318780
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.287262 9.038254 2.248180 11.171950 0.220659 1.516315 8.860953 2.231824 0.225568 0.077273 0.012166
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.784248 1.332713 -0.659582 1.386577 -0.159784 1.446899 0.039679 1.974848 0.537336 0.537710 0.325318
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.800675 -0.173006 -0.616760 -0.174877 -0.414095 1.059441 -0.378717 1.512936 0.524389 0.536092 0.322633
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 22.652009 6.855682 0.098057 -0.705013 3.029538 -0.183988 7.941266 0.415299 0.306775 0.405325 0.195596
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 13.063195 0.202793 0.085902 0.325442 0.036057 -0.446899 -0.278365 -0.938615 0.351829 0.486884 0.291566
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.001867 -0.725889 0.890123 -0.881263 0.672618 -0.571444 1.447490 0.106774 0.458235 0.475019 0.295095
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.630246 1.568908 -0.525304 1.259115 -1.098381 0.652699 -1.132333 -1.704258 0.470411 0.454075 0.301566
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 57.909947 34.554877 26.943551 27.972478 22.392370 22.954069 466.647778 488.227252 0.017643 0.016196 0.001305
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 29.387166 28.365872 27.675308 23.256748 26.211453 13.262634 634.503484 338.887482 0.016281 0.016358 0.000767
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 24.935607 24.627491 24.505150 21.831471 14.209751 9.707597 396.193940 253.328411 0.016266 0.016504 0.000760
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.910307 17.044195 0.814144 13.393306 -0.162676 1.729439 -1.855136 4.259873 0.490016 0.048832 0.369581
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.629939 0.380452 -0.848704 -0.376240 -1.123269 0.063548 -0.963391 0.238615 0.513460 0.514114 0.307199
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.049272 -0.003103 1.066889 0.059744 2.032874 0.966352 3.037054 13.181487 0.520258 0.521946 0.303979
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.150620 1.733974 3.042351 -0.684715 16.379322 0.421121 73.132831 2.520740 0.415238 0.535846 0.303616
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.412350 0.985882 0.851749 1.495606 0.874165 0.716225 0.010539 0.326620 0.534135 0.534431 0.309949
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.535473 0.350423 0.856412 1.129680 0.756322 0.278347 -0.174332 0.244485 0.532179 0.535968 0.316240
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.537058 -0.766875 -0.061321 -0.716377 0.330152 -0.883778 0.096761 -0.193619 0.528396 0.535213 0.317919
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.049311 0.262832 0.984888 0.685405 0.877215 0.912107 -0.002685 0.114741 0.515518 0.530050 0.321250
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.260482 0.191127 10.583753 0.387174 2.399941 0.274641 0.590292 0.886521 0.034747 0.519863 0.362626
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 7.509479 8.954558 10.641056 11.092016 2.350860 1.854734 1.988260 2.128116 0.030998 0.025244 0.002887
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 7.873947 2.231479 10.750439 8.415740 2.363028 1.012127 0.941125 1.895158 0.028559 0.398668 0.265274
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.685378 -0.298618 -0.156991 -0.242489 -0.378579 -0.944989 0.132773 -0.910011 0.463149 0.482082 0.297391
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.323312 10.495896 0.353947 -0.581750 -0.869265 0.307368 -1.585173 3.143704 0.471673 0.395892 0.283185
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.035926 1.097776 -0.962577 0.451069 -0.802594 0.175384 -0.272521 6.259088 0.463197 0.448808 0.290387
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.709029 3.979169 0.231053 1.074706 1.287950 1.206879 0.006138 0.758406 0.495750 0.495766 0.307445
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.839495 0.425648 -0.952273 -0.248368 -0.126912 0.175065 -0.693974 7.417198 0.516567 0.515730 0.308120
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% -0.221234 2.034441 -0.546964 -0.659579 -0.792095 -0.059530 1.152601 14.015104 0.517782 0.525690 0.306154
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.726899 32.411589 1.920503 6.652567 1.165607 0.514244 2.005025 1.943903 0.516024 0.510338 0.301607
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.026501 0.544916 0.489010 1.188753 0.508529 0.958820 0.271945 0.331030 0.534841 0.534653 0.312606
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.292406 0.661959 0.397266 0.336097 0.608643 0.647571 0.734853 0.081824 0.533442 0.540702 0.314289
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.691819 -0.476431 -0.055131 -0.677772 0.138164 -0.100159 1.346100 1.488696 0.527494 0.534929 0.313887
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.205397 1.956097 1.467700 2.351561 0.611540 1.132222 7.300030 0.603764 0.519875 0.531224 0.316998
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 7.118929 8.891079 10.652364 10.863588 2.360808 1.896899 0.671848 1.768594 0.060881 0.035926 0.018319
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.878256 -0.133484 0.336640 0.011538 -0.194624 0.262804 0.660617 -0.076897 0.401642 0.512374 0.305451
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 10.258233 8.837429 1.363168 10.935955 3.072012 1.859631 18.145563 2.298424 0.424228 0.057227 0.306495
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% 0.321420 3.500724 1.446022 9.279757 0.096787 -0.640718 1.049026 0.852454 0.196010 0.141704 -0.219523
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.821237 2.759080 1.986949 1.987168 1.520759 1.279557 -2.600722 -2.273351 0.450730 0.444682 0.283394
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.301790 2.672733 1.698420 3.779503 1.014825 -0.111359 -2.262589 1.368920 0.442609 0.386303 0.279261
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.161473 -0.754028 -0.739644 -0.421533 -0.231937 -0.978353 -0.363434 -0.853499 0.445051 0.445483 0.283391
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 20.983471 37.424224 22.340977 27.704973 17.012623 15.961111 280.347742 468.481925 0.017401 0.016244 0.001281
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 18.074710 18.361972 21.591566 19.976796 12.493020 9.048597 341.774430 180.582017 0.016525 0.016707 0.000725
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.634381 0.512850 2.751750 -0.572906 1.459703 0.005252 2.845258 -0.245418 0.498106 0.509880 0.306767
121 N08 digital_ok 100.00% 1.67% 0.00% 0.00% 1.692913 1.875159 1.230644 5.541624 0.420723 1.210795 -0.413295 7.497056 0.470662 0.505762 0.303483
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.022149 2.364091 -0.071696 -0.859400 -0.128396 -0.031991 -0.236815 -0.484217 0.526551 0.532556 0.309943
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.345802 1.157091 1.792023 0.580948 1.378625 -0.214493 -2.360856 -1.411360 0.498165 0.528441 0.312785
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 7.327637 0.056084 10.767599 0.781438 2.332745 0.722973 0.687456 1.020586 0.040805 0.543107 0.369664
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.037103 1.066342 3.595671 1.343490 0.468931 0.336164 0.584073 0.398876 0.517631 0.536683 0.316804
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.408461 0.205184 0.696267 1.008690 1.536499 1.174681 1.736671 0.288235 0.524872 0.533604 0.318575
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 7.072140 -1.046200 10.582759 -0.704172 2.392012 -0.106895 0.504631 -0.288544 0.034833 0.518854 0.361933
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.074021 -0.504965 -0.401609 -0.416242 0.569299 -0.611925 0.905673 1.905545 0.502725 0.507796 0.318704
131 N11 not_connected 100.00% 0.00% 76.94% 0.00% -0.933883 8.355775 -0.651253 6.173756 -1.209113 1.035105 -1.029778 0.817563 0.478455 0.190760 0.340621
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.041415 -0.358963 -0.766425 -0.677511 -0.675333 -0.176796 0.015940 -0.025505 0.468437 0.456570 0.292819
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.367093 -1.010370 -0.628850 -0.849963 -0.632215 -0.714658 -0.282920 -0.340623 0.453876 0.454699 0.291168
134 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.051186 2.172627 2.126734 1.561021 -0.554850 0.878226 6.393789 -1.988095 0.383905 0.415839 0.277320
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.735137 -0.967151 -0.674257 -1.042332 1.659277 -0.104005 -0.022302 0.133859 0.432621 0.436597 0.292516
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 6.718374 -0.234392 10.337995 -0.121467 2.396162 -0.222592 1.106018 0.841346 0.037756 0.443899 0.311036
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 21.511565 36.411413 23.921791 25.162064 22.846375 13.567881 485.822768 323.046484 0.016333 0.016217 0.000779
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.416631 -0.214914 0.216304 -0.946769 -0.792011 -0.673648 -1.504878 0.844504 0.478120 0.483074 0.296530
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.886217 -1.189538 0.179423 -0.845156 0.021337 -0.866917 7.543320 2.141060 0.502290 0.514438 0.303640
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.249914 -0.567896 0.146120 -0.255517 0.997473 -0.788410 -0.094770 -1.025422 0.519510 0.519510 0.305108
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.316137 8.886850 -0.379537 11.065501 0.316774 1.875092 14.171615 2.019957 0.528300 0.043127 0.422823
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.570438 8.709640 10.386646 11.031616 2.036023 1.871597 0.478096 1.711607 0.116281 0.032410 0.071001
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.455961 -0.818873 -0.323102 -0.150057 0.812565 -0.553110 -0.298880 -0.741894 0.535316 0.535215 0.316706
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.131314 0.526851 0.257691 1.221344 -0.532457 0.383545 0.002685 0.839323 0.531178 0.528508 0.315298
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.540318 -0.930070 -0.775918 -1.057136 -0.958155 -0.810415 -0.622120 -0.425023 0.500727 0.509844 0.312768
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
149 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
150 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 8.785137 -0.602187 -0.633029 1.078280 -0.321046 0.177289 -0.440379 4.825521 0.371797 0.442616 0.273384
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.030331 -0.803908 10.478440 -0.276801 2.406878 0.615970 1.833252 0.642073 0.038525 0.437345 0.317004
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.229690 8.803267 7.187444 10.915160 -0.125818 1.897695 6.190064 2.051416 0.373944 0.038054 0.277666
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.432418 0.125516 0.672380 0.897135 0.671339 0.767139 -0.108873 0.346428 0.454649 0.462033 0.300434
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.745987 -1.023486 -1.044883 -1.038602 -0.373647 -0.435307 0.892253 10.863330 0.475161 0.479372 0.306829
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.105099 10.302125 0.194296 -0.078983 -0.929831 0.712977 -0.082219 4.542421 0.459903 0.379613 0.279054
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 7.654606 -0.662430 10.557770 -0.385141 2.371572 -0.071175 0.786735 -0.063529 0.044991 0.508184 0.399379
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.564609 17.689298 0.529917 0.510472 0.542107 -0.422170 -0.091531 -0.031116 0.511421 0.414291 0.290871
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.704633 -1.171762 -0.391439 -0.949319 -0.740138 -0.248445 2.203047 -0.532574 0.518403 0.525321 0.313333
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.310836 0.917045 0.447294 0.584762 0.696363 0.283172 -0.149794 0.669661 0.529946 0.533566 0.317785
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.769230 1.021858 2.188479 1.167525 0.900729 1.526188 4.591493 1.882923 0.521873 0.528214 0.309154
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 11.335424 -0.196197 0.788081 -0.262471 -0.055048 0.466285 1.014390 0.036350 0.428907 0.527377 0.301895
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.065067 -0.282559 1.134666 -0.043243 1.199968 -0.669449 0.115945 -1.126054 0.514751 0.513865 0.307740
167 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
168 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
169 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
170 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.369945 -1.359310 1.129964 -0.862517 0.079633 -0.757368 0.021201 0.014020 0.440600 0.453742 0.298041
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.967810 0.713825 1.448199 0.408385 0.781516 -0.471675 -2.206215 -1.012882 0.445110 0.441114 0.299890
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.297454 -0.102873 0.709965 0.641831 0.044906 0.285431 -0.043672 8.623908 0.474129 0.481022 0.309152
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.468852 9.253627 -0.708188 11.148206 0.175015 1.849196 7.983514 2.078864 0.487710 0.051140 0.394213
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.238332 0.568608 1.625103 1.125680 0.613902 1.115792 0.112109 3.938130 0.501761 0.506045 0.314432
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.620311 8.740191 -0.549613 10.846583 -1.013121 1.888066 0.625459 2.275562 0.515390 0.046299 0.381488
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.457065 0.827719 0.620849 0.991378 1.057835 1.413852 0.085253 0.646804 0.517363 0.516402 0.307393
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 8.444475 -0.128031 9.054201 0.071394 3.555696 -0.061484 2.835166 0.052542 0.289698 0.525047 0.347868
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.441702 -0.038409 -0.973361 0.081554 -0.151403 0.324560 -0.551984 0.171513 0.523015 0.522405 0.313412
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.931314 -1.021430 -0.334058 -0.891533 -1.079703 -0.804189 -1.169761 -0.584956 0.511871 0.513830 0.308198
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.083704 -0.432941 -0.177536 -0.253090 0.427638 -0.725528 1.035127 -0.797750 0.503642 0.499990 0.308844
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
190 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
191 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 134.282801 134.213863 inf inf 1654.395267 1627.837744 4868.380416 4742.104157 nan nan nan
192 N16 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
193 N16 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
200 N18 RF_maintenance 100.00% 100.00% 0.00% 0.00% 8.242405 19.965830 5.980157 0.266744 2.397425 0.299097 1.360176 2.513725 0.040938 0.235110 0.155863
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.375602 2.376369 1.114544 1.823617 0.153690 1.163515 -1.947303 -2.266005 0.475118 0.457692 0.301368
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.153517 -0.375565 0.269430 -0.527897 -1.028775 0.735128 -1.470137 44.331885 0.490872 0.488515 0.298875
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.284160 6.321159 1.841652 -0.681802 1.176584 0.484458 13.640878 0.614899 0.504482 0.504178 0.304327
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.091255 -0.784339 4.905960 -0.651056 0.158614 -0.290674 1.825985 9.275105 0.308888 0.495740 0.347875
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.961306 2.303730 1.795362 3.316147 -0.314422 -0.736864 0.342856 1.055645 0.444053 0.411876 0.274215
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.128056 -0.975675 -0.988287 -0.987774 -0.904231 -0.696456 3.186655 -0.505863 0.462937 0.481007 0.298711
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.331405 9.086071 -0.652192 6.332519 -0.324052 1.846924 0.012057 1.328371 0.444205 0.038768 0.359409
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.746563 -0.905252 -0.387771 -1.082179 -1.248146 -0.243359 -0.334155 -0.474543 0.475173 0.469569 0.297257
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.880689 -0.679554 -1.063224 -1.050812 -0.117974 -0.519236 2.189377 -0.295377 0.477568 0.480750 0.300028
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.535917 -0.471776 -0.650557 -0.482143 -1.131869 -1.009453 1.578597 -0.813639 0.481832 0.485457 0.300816
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.997732 -0.029524 -0.271245 1.685060 -0.223039 -0.094563 -0.279635 12.385528 0.475841 0.452283 0.296964
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.286344 2.898306 2.352945 2.111233 1.947019 1.341313 -2.822905 -2.364698 0.438732 0.439860 0.277181
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.285412 -0.359668 2.503120 -0.615143 -0.280611 -0.342540 10.294868 6.233918 0.408572 0.451520 0.300228
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.011641 -0.513517 -0.095355 -0.735629 -1.072634 -0.134213 -0.267435 0.399061 0.452889 0.441476 0.286133
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.021159 0.225177 -0.141652 0.315932 -0.984580 -0.276090 -0.989326 -1.359061 0.447418 0.435882 0.294353
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.620729 -0.882632 0.674725 -0.863918 0.133386 0.033156 2.588566 -0.232959 0.429234 0.449615 0.297080
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.137562 -0.389269 0.007559 -0.007559 -1.134610 -0.829200 -1.263690 -1.167944 0.468109 0.461078 0.306838
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.091689 -0.712453 -0.955232 -0.548956 -0.988624 -0.801540 -0.761841 0.276932 0.469871 0.466479 0.303539
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.238590 -0.928946 -0.815896 -0.525095 -1.060985 -0.943615 -0.234790 -0.897172 0.469363 0.466424 0.304391
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.148266 0.079851 -0.645951 0.138101 -0.428864 -0.619801 -0.618554 -1.095573 0.357311 0.458368 0.291401
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.419447 -0.969915 0.207659 -0.793767 1.447249 -0.329613 6.099343 -0.233566 0.411827 0.455040 0.294489
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.573153 -0.597514 0.160533 0.225191 -0.275812 -0.410066 0.873509 1.386029 0.446619 0.445404 0.283656
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.045960 -0.562076 0.055231 -0.912414 -1.056581 -0.816100 -1.496753 0.313598 0.453183 0.444601 0.289984
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.718526 9.436488 -1.049466 5.948852 -0.470679 1.877714 -0.183958 0.771184 0.446047 0.038215 0.356826
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.511914 -0.447958 -0.436974 -0.699173 -1.227528 -0.950075 0.755247 -0.707748 0.448051 0.437889 0.291636
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.765925 7.679968 0.319061 0.575129 0.329971 -0.181412 -0.065580 0.987186 0.451536 0.441132 0.299821
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.548454 0.402708 0.999667 0.285100 0.570349 0.068953 -1.703784 -0.033159 0.355897 0.337422 0.255375
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.130266 1.205072 0.193570 0.377854 -0.085960 0.319563 -1.084191 -1.060826 0.348903 0.331953 0.245831
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.314241 -0.881412 0.060852 -0.618252 -0.565938 -0.562031 -1.376014 -0.027873 0.376109 0.358964 0.269534
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 8.296160 9.316441 5.388009 5.984135 2.315368 1.810867 0.640200 0.734157 0.039975 0.038418 0.001898
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.010990 0.119172 -0.033598 -0.621624 -0.431927 0.384235 2.675410 0.245979 0.350636 0.346279 0.247512
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, 20, 27, 28, 31, 32, 34, 37, 38, 40, 42, 47, 51, 53, 55, 56, 58, 59, 60, 61, 63, 65, 66, 68, 70, 72, 77, 78, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 101, 102, 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, 173, 179, 180, 181, 182, 184, 189, 190, 191, 192, 193, 200, 202, 204, 205, 208, 209, 210, 211, 223, 225, 226, 227, 240, 242, 243, 246, 262, 329]

unflagged_ants: [5, 8, 9, 10, 16, 21, 22, 29, 30, 35, 36, 41, 43, 44, 45, 46, 48, 49, 50, 52, 54, 57, 62, 64, 67, 69, 71, 73, 74, 79, 80, 85, 88, 89, 90, 91, 95, 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, 183, 185, 186, 187, 201, 206, 207, 220, 221, 222, 224, 228, 229, 237, 238, 239, 241, 244, 245, 261, 320, 324, 325, 333]

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