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 = "2459994"
data_path = "/mnt/sn1/2459994"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 2-18-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/2459994/zen.2459994.21270.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 1852 ant_metrics files matching glob /mnt/sn1/2459994/zen.2459994.?????.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/2459994/zen.2459994.?????.sum.known_good.omni.calfits. Skipping redcal chisq.

Figure out some general properties¶

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

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

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

Load a priori antenna statuses and node numbers¶

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

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

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

Summarize auto metrics¶

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

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

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

Summarize ant metrics¶

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

Summarize redcal chi^2 metrics¶

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

Get FEM switch states¶

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

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

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

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

Find X-engine Failures¶

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

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

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

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

Build Overall Health DataFrame¶

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

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

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

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

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

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

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

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

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

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

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

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

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

Table 1: Overall Array Health¶

In [18]:
HTML(table.render())
Out[18]:
JD 2459994
Date 2-18-2023
LST Range 4.426 -- 14.393 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1852
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 67 / 198 (33.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 121 / 198 (61.1%)
Redcal Done? ❌
Never Flagged Antennas 77 / 198 (38.9%)
A Priori Good Antennas Flagged 53 / 93 total a priori good antennas:
3, 7, 15, 16, 19, 29, 31, 40, 42, 45, 53, 54,
55, 56, 71, 72, 81, 85, 86, 93, 94, 101, 103,
107, 109, 111, 112, 121, 122, 123, 124, 127,
136, 140, 144, 147, 148, 151, 158, 161, 162,
165, 170, 173, 181, 182, 184, 187, 189, 191,
192, 193, 202
A Priori Bad Antennas Not Flagged 37 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 61, 62, 64, 73,
74, 82, 89, 90, 114, 115, 125, 126, 132, 133,
137, 139, 220, 222, 223, 228, 229, 237, 238,
239, 241, 245, 261, 324, 325, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459994.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.629772 14.156188 10.190057 11.027847 7.682337 9.491822 0.260149 0.600638 0.029651 0.031617 0.002721
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.330578 1.046338 2.108424 -0.112576 0.625979 0.442526 10.483480 0.084217 0.574485 0.603575 0.400671
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.408272 -0.250231 0.400618 0.380524 0.249282 1.564403 0.356436 0.111132 0.593189 0.601600 0.385840
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.031221 0.134606 -1.053322 -0.005939 -0.146641 0.596377 8.210915 9.172478 0.604297 0.619858 0.383892
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.111165 -1.156694 -0.387151 0.319984 -0.007929 0.790447 0.224285 0.874643 0.606120 0.618355 0.379309
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.055727 -0.343533 3.233152 -0.842271 0.990402 0.007929 1.054649 -0.750894 0.581658 0.619645 0.389447
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 2.295368 -0.639539 -1.080185 -1.145912 0.768568 0.915255 1.821553 1.422350 0.593823 0.612482 0.378239
15 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 11.065223 14.437431 10.130870 10.958963 7.730282 9.536814 0.023785 0.254260 0.026392 0.025640 0.001351
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.887296 -0.885233 10.157821 0.956839 7.696881 1.941122 0.210789 2.344336 0.031780 0.612779 0.485256
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.294024 2.088626 0.615795 0.692506 0.866257 1.075385 2.899362 2.705886 0.603160 0.620556 0.387062
18 N01 RF_maintenance 100.00% 100.00% 42.87% 0.00% 11.560768 18.103115 10.138308 -0.086286 7.817983 5.300102 0.187329 14.611171 0.029322 0.223707 0.167651
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.311395 -0.095395 -0.933688 0.368434 -0.216406 0.444809 0.750731 6.953438 0.612801 0.629501 0.377452
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.351503 -1.445357 1.830533 -0.772512 0.928512 0.184834 0.729243 -0.624695 0.606731 0.627124 0.377392
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.070946 0.327782 -0.508039 0.269521 -0.031044 0.619514 -0.397997 -0.438588 0.599654 0.609964 0.370162
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.602105 -0.448001 0.297346 -0.156930 0.845497 1.456776 -0.654729 -1.274482 0.579040 0.594111 0.373495
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.218498 13.189658 10.196691 10.831910 7.797618 9.578014 1.372835 0.981329 0.033722 0.037185 0.004408
28 N01 RF_maintenance 100.00% 0.00% 87.04% 0.00% 10.208322 26.683416 0.459083 3.388878 3.793535 6.459729 2.954766 15.132206 0.354394 0.151809 0.260992
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.934681 13.652973 9.800971 10.441341 7.784242 9.555188 0.191287 -0.168637 0.029375 0.034988 0.005821
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.932396 0.349896 1.976121 -1.188907 1.465560 0.346033 1.821167 -0.446256 0.599502 0.637838 0.389679
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.510327 -1.073547 1.152940 0.848517 1.054127 -0.169106 0.125219 4.847034 0.625221 0.633311 0.376223
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 20.877255 26.254941 1.135012 3.347232 4.193360 0.571626 18.494575 8.665229 0.523605 0.512918 0.250047
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 12.531660 14.880365 4.787701 5.310088 7.753132 9.518731 0.342834 0.037532 0.034467 0.045124 0.007154
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.740448 -0.737597 1.172862 -1.279351 1.500006 -1.187602 -0.942289 -0.334834 0.589432 0.586118 0.369196
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 27.201309 27.568368 13.353835 13.508881 7.813669 9.427208 2.953349 2.954699 0.031657 0.029442 0.001722
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.100401 0.577495 -1.205083 1.048031 0.834067 1.550464 -0.884207 1.900936 0.602082 0.609649 0.396250
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.239936 -0.133145 0.417373 0.811027 -0.168973 0.315070 2.951971 0.943238 0.603882 0.606054 0.390774
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 10.269017 0.749128 9.828079 0.834994 7.760575 -0.352301 0.157402 -0.137934 0.037209 0.608200 0.455810
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.438191 0.552576 0.002346 0.341334 1.428377 0.578946 0.006977 1.493125 0.602433 0.626629 0.381543
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.097498 2.701029 -0.899889 8.602331 0.790430 2.780563 -0.647275 -0.024863 0.625843 0.524372 0.416068
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.098762 -0.064966 -0.002346 0.903454 -0.803367 0.665386 -0.978397 1.240718 0.625410 0.635412 0.381196
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.466041 0.473945 -0.580390 -0.207112 -1.012617 0.627092 -1.082504 -0.778132 0.628460 0.644715 0.379359
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.009102 5.086458 0.410353 0.949313 -0.479245 1.682190 -0.334875 13.984786 0.620838 0.626301 0.367876
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.907880 0.091541 -0.581361 -1.088196 -0.610866 -0.219692 -0.688942 -0.952847 0.623611 0.645806 0.387026
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.480628 14.537915 4.691479 4.938408 7.740468 9.458645 1.554180 -0.158911 0.031306 0.053774 0.015162
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.124332 0.792943 -0.273037 1.516176 -1.108793 1.926993 -0.750606 -1.981585 0.589218 0.614565 0.379546
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.265544 -0.293863 -0.689296 -0.179737 0.053643 -0.708227 -0.297925 3.657036 0.550604 0.588699 0.373567
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.557565 2.891576 0.506393 1.321362 0.346335 1.987488 18.092441 41.266287 0.579220 0.577256 0.374273
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 8.936275 4.519721 -0.490373 1.334129 3.503706 3.801128 22.730507 2.077481 0.495881 0.502807 0.256057
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.987050 6.737810 -0.344580 0.811126 1.109871 0.963860 1.360307 1.370496 0.606465 0.618106 0.388877
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.197840 2.757149 -1.277406 -0.950523 1.040991 0.437397 1.266251 5.634871 0.616052 0.630363 0.395775
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 27.636954 -0.393527 4.751193 -0.449162 1.257893 0.087046 2.760322 0.531887 0.441075 0.629721 0.384384
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.187374 14.540710 10.220868 10.956216 7.751107 9.498493 0.232299 1.520210 0.027890 0.030785 0.002582
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 5.808617 0.852981 -0.474455 1.872057 -0.288007 0.489799 -0.357350 -0.225817 0.610231 0.635974 0.379516
57 N04 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.660979 -0.090319 10.501988 -0.914582 7.605432 1.557173 1.049951 1.345185 0.043125 0.638808 0.485911
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.222769 13.572315 10.095763 10.948410 7.692541 9.478325 0.599737 0.282605 0.035809 0.035478 0.001825
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.143145 0.960426 9.654149 0.845270 7.556681 1.897096 -0.166951 2.794987 0.046611 0.634114 0.488549
60 N05 RF_maintenance 100.00% 0.00% 99.41% 0.00% 0.503280 13.501913 -0.332286 10.976187 -0.009379 9.491582 4.524127 1.427616 0.624227 0.070489 0.499482
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.217413 -0.104049 -0.245504 -1.058476 1.047351 -1.366985 -0.800704 -0.040524 0.569581 0.604021 0.369139
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.093909 0.720233 -0.829114 0.937565 -0.916383 0.097191 0.315686 -0.930751 0.571091 0.611548 0.377021
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 1.562580 14.070424 -0.364373 5.338320 0.234197 9.592431 -0.431675 1.491933 0.584122 0.044920 0.460666
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.094144 -0.154208 -0.885418 -0.565475 -0.772352 -1.096523 1.199423 -0.659012 0.578512 0.574758 0.361963
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.682575 1.607135 0.683002 1.307043 -0.235262 0.865021 -0.378571 -0.456227 0.587451 0.603560 0.395747
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.442798 1.848814 -1.269593 -0.582097 2.076319 -0.153258 -0.556665 0.429122 0.604638 0.618619 0.395321
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.356302 -0.643000 0.019791 1.542305 -0.154117 0.506768 0.022045 2.400276 0.609506 0.615897 0.387035
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 19.655303 28.317270 1.078989 14.179707 4.280499 9.449687 -0.062248 6.783949 0.349813 0.028943 0.249457
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.678170 0.052797 0.580917 1.039288 -0.464226 1.283017 -0.531469 -0.570447 0.610897 0.627051 0.385266
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.740080 0.007685 -0.019294 0.293595 1.031134 1.290473 0.087211 -0.157052 0.612142 0.631017 0.380894
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.525329 -0.041141 0.796786 1.344667 -0.033133 0.220041 2.014249 0.520404 0.610817 0.639734 0.380697
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.239734 14.766943 10.564177 11.337631 7.602704 9.346812 0.180332 0.284310 0.034809 0.038330 0.005098
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.519873 1.060663 -1.180717 -0.651124 0.899137 -0.081661 -0.687491 -0.919574 0.636107 0.650207 0.377182
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.749562 -0.007685 0.428777 -0.865025 -0.572817 0.928103 -1.387774 1.461166 0.636598 0.647451 0.374163
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 56.667369 22.305237 0.557749 -0.511996 4.080003 2.372629 1.906752 -0.067582 0.322062 0.508844 0.305416
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 32.158663 0.510469 -0.352954 1.251250 1.855335 0.708492 0.801225 -0.005638 0.434298 0.619810 0.367508
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.373814 14.302254 -1.232283 5.353481 -0.709628 9.451715 1.241890 0.675751 0.580878 0.040258 0.445422
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.634732 15.183633 0.303872 5.259264 -0.471094 9.480039 0.136895 1.635063 0.595963 0.046429 0.459055
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.244582 14.384252 0.256828 9.614230 -0.003885 9.230381 -0.431876 0.789519 0.564782 0.038723 0.428404
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.262467 1.470859 -0.862610 -0.265584 -0.190787 -0.961806 -0.353400 -0.244566 0.593795 0.610370 0.388343
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.098390 0.354279 0.380879 0.687056 0.392855 0.314157 -0.357475 0.671136 0.594967 0.602331 0.379889
84 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
85 N08 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
86 N08 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
87 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 237.320086 237.269155 inf inf 2199.521214 2153.249109 5025.333078 4810.344655 nan nan nan
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.709992 -0.016304 0.545089 1.152392 -0.053457 -0.572365 2.195089 0.451284 0.618875 0.634278 0.369244
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.816994 0.590614 0.328917 1.178123 -0.683107 0.136574 -0.503040 -0.445164 0.623211 0.641413 0.367505
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.250197 -0.018190 -1.087437 -0.609777 -0.640577 -1.066010 -0.289026 1.665918 0.631735 0.652786 0.372139
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.347970 0.130511 0.648384 0.647840 -0.631282 -0.076838 -0.229603 -0.289749 0.618404 0.644748 0.374068
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.759189 0.464463 10.084639 0.442809 7.825026 1.554491 -0.037287 0.196612 0.036168 0.647608 0.440335
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.057310 13.779566 10.224050 11.050328 7.670580 9.450352 1.425911 0.914928 0.030328 0.025033 0.002401
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.704813 14.001316 10.330556 10.847731 7.691476 9.506831 1.107857 0.351718 0.025263 0.025439 0.001019
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 6.656896 3.872540 -0.805814 0.650020 0.340547 0.585740 0.410663 0.395701 0.538860 0.581252 0.338624
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 4.619897 20.118194 3.535531 1.483888 3.510631 3.158496 -1.963203 -1.309265 0.595024 0.501459 0.351495
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.585638 4.461683 0.061554 1.266001 -0.100839 1.346550 2.409769 8.052153 0.549110 0.544044 0.348396
101 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 218.370094 218.539198 inf inf 2298.702013 2312.765251 4955.660547 4953.350180 nan nan nan
102 N08 RF_maintenance 100.00% 99.95% 99.95% 0.00% 191.102119 191.816394 inf inf 2160.813404 2143.288926 4934.384369 4935.735050 0.496978 0.437912 0.356353
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 250.840334 250.858728 inf inf 1827.543569 1819.374529 5283.676115 5223.234803 nan nan nan
104 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 238.419207 237.393747 inf inf 2250.161604 2334.088004 4860.106765 5330.502673 nan nan nan
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.050605 0.142456 0.369644 1.219185 0.660256 0.024239 -0.492482 -0.380595 0.622631 0.634863 0.371222
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.329089 -0.931101 -0.760854 -0.110143 0.226578 -0.724195 0.133172 0.247039 0.624211 0.631807 0.360371
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 6.306691 2.790902 0.072932 -0.259697 1.029734 0.376379 8.954888 6.149374 0.622461 0.649772 0.361425
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.792701 42.566793 10.139645 1.300625 7.745029 3.525234 0.903349 5.625566 0.033820 0.291249 0.166245
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.582700 13.594487 10.175303 10.715619 7.840562 9.581409 0.773749 1.739334 0.043736 0.033708 0.005856
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.730623 14.178445 6.715836 0.154181 6.694004 -0.194629 0.087302 -0.744506 0.559848 0.601225 0.341499
111 N10 digital_ok 100.00% 0.00% 99.57% 0.00% 34.150538 13.454299 1.152565 10.825094 1.755214 9.575229 3.974764 1.873463 0.488506 0.060414 0.333567
112 N10 digital_ok 100.00% 52.48% 99.24% 0.16% 3.100488 13.306106 7.475811 10.905418 1.162406 9.375905 -0.009215 0.452888 0.203602 0.070230 -0.093182
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.742580 14.922684 4.433418 5.349150 7.660528 9.428578 2.382808 1.657301 0.035426 0.031199 0.002166
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 3.889060 0.707352 0.608528 -0.281664 2.379240 -0.739207 -0.331637 0.114083 0.567240 0.597655 0.369464
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.097709 -0.953339 -1.075795 0.034487 -0.543591 -0.621276 0.075973 -0.433056 0.562196 0.591572 0.382666
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.628822 15.109225 10.263202 11.304263 7.671774 9.501037 1.880654 3.785806 0.027607 0.031317 0.002453
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.440141 1.740464 0.116013 0.858210 -0.363979 0.614491 0.806152 1.512526 0.594827 0.609994 0.388567
120 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 225.445404 224.552825 inf inf 1994.120024 1894.341342 5447.499594 5377.843041 nan nan nan
121 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 228.918570 228.360246 inf inf 2883.828783 2735.244933 5729.761441 6544.869011 nan nan nan
122 N08 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
123 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 254.132292 254.124689 inf inf 1455.804164 1480.403619 4809.751324 4752.318502 nan nan nan
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 10.897811 0.118799 10.409491 0.934326 7.616419 0.633014 0.070847 0.328494 0.041090 0.648007 0.468832
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.484813 1.795845 0.209450 1.125424 0.753989 2.933354 1.262238 2.057053 0.633802 0.639276 0.363003
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.245185 -0.148636 -0.734695 1.296761 0.939719 0.050238 0.947134 -0.653607 0.637258 0.644623 0.368792
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 10.385596 0.537157 10.075545 0.692446 7.835632 1.140984 0.575044 2.282303 0.034260 0.655813 0.445307
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.082881 -0.471526 -1.347395 -0.412961 -0.129981 -0.091973 0.418287 3.865053 0.641661 0.655065 0.381184
131 N11 not_connected 100.00% 0.00% 7.78% 0.00% -0.594554 13.311429 -0.023634 5.209502 -0.717521 8.432241 -0.157448 0.637326 0.599572 0.272088 0.423668
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.801687 0.310606 -0.169004 -1.208889 -0.473073 -0.665875 -0.080085 0.163766 0.587036 0.594045 0.369790
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.374348 -1.455124 -1.350591 -0.562906 -0.981628 -0.764049 0.066524 1.630194 0.566400 0.596488 0.386537
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.869288 14.892230 4.571169 5.313470 7.660020 9.455510 0.870127 1.200013 0.040240 0.033704 0.003479
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.755531 -1.077657 -0.902253 -1.367895 2.004601 0.589279 8.708363 0.922095 0.560108 0.596284 0.399507
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.898905 -0.391281 9.774185 -0.508261 7.846616 0.796701 2.077243 0.594847 0.039622 0.597796 0.440191
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.232993 -0.632608 0.279596 -1.380975 1.292545 -0.247425 0.664909 1.135779 0.577802 0.607336 0.389525
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.331711 1.511766 1.416321 -1.067755 0.611539 -0.284747 -0.171244 0.601544 0.598013 0.596294 0.377039
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.293222 -1.053711 -0.725186 -0.373744 -0.136403 -0.534638 4.759839 3.385018 0.611871 0.630133 0.383415
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.942344 -0.834616 -0.105790 0.436808 0.846414 -0.453078 1.632839 -0.280759 0.613038 0.636755 0.382351
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.545508 13.574923 -0.579602 10.984796 2.199245 9.547638 13.833971 1.845404 0.620913 0.046102 0.498752
143 N14 RF_maintenance 100.00% 99.95% 100.00% 0.00% 11.490903 13.527284 10.043758 10.955631 7.330095 9.559735 0.283020 1.143262 0.090339 0.030017 0.044324
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.153817 0.242716 -1.021444 5.395554 0.514747 3.801694 -0.272091 0.225559 0.638215 0.615456 0.378316
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.582585 -0.193137 1.758510 0.843022 0.226138 2.226270 0.123485 -0.815658 0.628569 0.650503 0.368171
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.426853 0.533334 -0.879751 0.118112 -0.713995 -0.274824 -0.576965 -1.193986 0.616154 0.640073 0.367245
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.071883 2.251181 1.682867 0.741213 1.403533 2.677339 1.810445 43.886437 0.627732 0.530850 0.399443
148 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.378838 0.395821 -0.623593 -0.290032 2.870851 1.618957 6.532442 -0.400867 0.629840 0.652547 0.385654
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.170248 -1.089495 -0.665979 -1.342722 -0.543256 0.734036 0.215014 -0.260732 0.628858 0.644181 0.387595
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.393884 2.766637 -1.096290 -1.293629 -0.349011 -0.399069 0.336008 0.574256 0.627009 0.622178 0.380666
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 18.089342 0.912343 -0.042394 0.830280 2.622304 -0.923919 2.283317 -0.270998 0.506325 0.568908 0.344959
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.264821 -1.025920 9.926354 -0.953263 7.855814 0.261827 1.595959 1.234874 0.041272 0.598656 0.450240
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.594158 13.310118 8.324571 10.760014 3.767107 9.609324 2.229789 2.237169 0.415019 0.038260 0.315123
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.497007 -0.047178 0.171907 0.947308 0.051464 1.250180 0.809525 0.994339 0.585614 0.607218 0.390532
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.419119 -0.153836 -0.040662 0.085213 2.017724 1.725953 3.382096 14.055231 0.596958 0.619007 0.393042
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.405009 25.488056 -1.316010 -0.594154 -0.315255 4.734707 0.952347 19.301957 0.568335 0.490494 0.352219
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.126018 -0.740243 -0.323281 -0.406484 -0.147360 1.470602 -0.141127 1.132406 0.608398 0.630906 0.383077
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.687936 30.549682 0.208448 -0.123848 0.802851 1.340269 2.244956 3.561609 0.615398 0.500539 0.344240
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.334480 -1.305434 -0.039036 -1.221627 0.569161 1.030813 7.300717 0.552419 0.632734 0.649449 0.377624
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.815116 1.745342 0.009335 0.721840 0.157135 1.239736 -0.190218 1.252235 0.635586 0.650930 0.377777
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.912541 0.162045 -0.089155 1.682803 1.393977 1.176234 0.571684 0.953000 0.635414 0.642136 0.367011
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 24.367538 0.482794 -0.569688 -0.552708 3.427665 0.278905 9.857414 0.750313 0.529375 0.652419 0.366851
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.891207 0.135339 0.791363 0.573582 0.700531 -0.195737 -0.100941 -1.240564 0.635157 0.654927 0.363685
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.825823 -0.872469 -1.261308 -0.696095 1.401797 0.602167 0.207382 1.063944 0.639849 0.654145 0.376656
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.906938 -1.047347 0.383896 -0.058096 1.372290 0.542720 -0.307062 0.542855 0.633710 0.646171 0.382744
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.505769 -0.926993 -0.724660 -1.380188 0.883076 0.477584 -0.432837 -0.404335 0.632465 0.647319 0.387014
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 11.588388 -0.287456 10.458350 -0.270321 7.642366 0.304267 1.786724 5.492341 0.040467 0.638986 0.494016
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.757323 1.461425 -0.906681 0.415915 -0.956595 0.016412 -0.006977 1.856745 0.571417 0.567221 0.356015
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 12.912104 13.983725 4.168075 4.968011 7.867663 9.588283 2.910235 5.106389 0.035436 0.041632 0.004316
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.678405 -0.808297 -0.957896 -0.592994 -0.449972 10.014687 0.267119 2.394929 0.594157 0.617737 0.391410
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.336897 14.214648 -1.314553 11.119530 1.011314 9.435589 12.503814 1.879693 0.613183 0.052353 0.502692
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.781563 0.207386 1.162258 0.838617 -0.135499 0.844938 0.425992 4.319789 0.616203 0.634978 0.385308
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.157897 13.259359 -1.166283 10.703074 -0.001583 9.611869 3.588806 2.565900 0.628459 0.047051 0.475272
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.074869 0.840817 0.192957 1.040802 1.103013 0.345666 1.664126 1.023544 0.620482 0.638918 0.367400
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 25.827923 -0.087639 5.607679 -1.043973 8.449291 0.597552 5.416403 0.079198 0.467888 0.650374 0.381249
185 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.729406 -0.544355 3.672985 0.714654 4.106423 -0.143877 -0.953928 0.166125 0.604730 0.651215 0.378336
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 3.047656 -0.801816 0.440156 -0.363733 -0.333028 -0.806690 -0.030074 -0.329528 0.621836 0.656341 0.375491
187 N14 digital_ok 100.00% 19.60% 0.00% 0.00% 9.379187 -0.935975 9.604977 -0.361936 6.522252 0.935381 0.864131 0.164481 0.249416 0.648735 0.452742
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 8.963219 13.112143 9.635104 10.827045 7.929045 9.639651 16.324842 2.343619 0.028766 0.031669 0.001330
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.908181 -1.459413 -0.476964 0.169170 0.091276 -0.483147 -0.022074 -0.853198 0.621294 0.640564 0.391362
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 0.753321 0.102872 1.460098 -0.153707 0.311519 1.015103 6.310128 0.717342 0.597618 0.617241 0.383813
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.511642 6.705662 3.126631 4.325285 4.416053 7.748787 -0.969129 -3.053127 0.582148 0.564825 0.382347
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 7.500779 0.678702 4.707015 1.331473 6.183479 1.985151 -2.952358 -0.210210 0.546605 0.581465 0.397887
200 N18 RF_maintenance 100.00% 100.00% 61.50% 0.00% 12.509677 39.380844 4.569022 -0.071928 7.848981 4.489037 1.118426 6.975358 0.041361 0.208752 0.135446
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.926190 4.785822 2.957404 3.703590 3.126011 6.315637 -0.845341 -2.284493 0.600273 0.604864 0.373459
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.686631 3.347646 1.517296 -1.276174 1.047824 -0.504910 -0.536657 21.352535 0.614991 0.608014 0.367877
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.949441 15.831723 1.337040 -0.909357 -0.345002 1.112052 13.731795 1.222212 0.619782 0.648417 0.377599
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 8.930022 0.644544 3.127909 -0.788292 5.068320 -0.708706 17.742199 3.914376 0.388055 0.622595 0.436232
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.682793 6.109840 -1.263588 2.632031 8.687942 3.005220 -0.339625 0.088087 0.589498 0.510322 0.376163
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.628010 1.396798 -0.678376 -0.465567 -0.866281 1.038215 5.741839 -0.626113 0.605265 0.601014 0.363058
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 253.936510 254.127915 inf inf 2366.226616 2332.766546 4920.812003 5173.680120 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% 263.376410 263.341590 inf inf 3185.981044 3263.952989 6255.470262 6713.762311 nan nan nan
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.185852 14.041003 -1.310598 5.373743 -0.953330 9.418589 -0.365287 0.439380 0.566986 0.039470 0.480949
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.371996 -1.240488 0.448843 -0.516203 -0.721297 -0.723693 2.730496 -1.266759 0.604817 0.609923 0.371991
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 2.439419 -0.554449 -1.177042 -0.869833 1.352204 -0.791803 8.822561 -0.609752 0.586115 0.618750 0.374481
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.071388 -0.371247 -0.168082 -0.046858 -0.902734 -0.370531 2.942181 -0.953471 0.602551 0.626649 0.373759
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.670811 -0.359243 -1.268094 0.344936 -0.631572 -0.394147 0.849953 0.088593 0.587768 0.627186 0.377255
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.602532 5.940608 4.875237 4.201237 6.446501 7.393978 -2.970641 -2.457682 0.578105 0.600207 0.368071
225 N19 RF_ok 100.00% 0.00% 89.90% 0.00% -0.505806 13.667947 0.714949 5.123507 -0.852212 9.265966 -1.216207 0.762569 0.610791 0.140409 0.499280
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.478240 22.955043 -0.480862 0.394969 -1.078383 3.543245 -0.779049 -0.453519 0.600453 0.503311 0.356334
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 4.234744 0.153361 2.113484 -1.340486 1.410052 0.614824 4.489014 2.952727 0.486727 0.596915 0.404582
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.941922 -0.092650 0.997480 -1.368646 0.236689 -0.791726 -0.197156 0.904074 0.580748 0.583843 0.369461
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.242184 0.484408 0.708538 1.207460 -0.410356 1.086508 1.270874 -1.825336 0.581845 0.593982 0.391145
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.641011 -0.382063 0.122915 -1.325729 -0.363322 -0.754767 -0.443295 -0.813873 0.538830 0.592166 0.386496
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.086389 -0.535189 0.903191 0.266146 -0.392966 -0.939831 -1.246499 -1.434619 0.596036 0.611706 0.380699
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.924608 -1.426886 -0.078189 -0.055125 -0.533066 -0.787934 0.548342 2.101214 0.599536 0.614577 0.379794
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.330401 -0.157492 0.065601 -0.518934 -0.579266 -0.947539 7.737826 4.472321 0.592312 0.611030 0.378206
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.663222 -1.132763 -0.340714 0.017318 -1.065751 -0.721104 0.677846 -0.751023 0.591399 0.617488 0.387481
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 19.616193 0.237606 0.091797 1.011892 4.844461 1.100857 12.647280 -0.386418 0.495086 0.613946 0.385550
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 21.785811 -0.990931 1.042544 -1.237249 2.784365 -0.934426 -1.075764 -0.223917 0.460097 0.594091 0.377937
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.201838 -1.191698 -0.792163 -1.100212 -0.862071 -0.578922 1.703700 5.452429 0.551742 0.599698 0.385962
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.883085 0.271693 0.634583 -1.227726 -0.550830 -1.186369 -1.446702 0.103965 0.581184 0.591309 0.381093
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.210357 14.679000 -0.761695 4.862047 -0.657047 9.550857 -0.608567 -0.281128 0.567000 0.038342 0.478910
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.260049 1.928628 0.262311 -0.386333 -0.459774 -0.685930 3.784444 0.471651 0.574467 0.567924 0.375579
262 N20 dish_maintenance 100.00% 2.05% 11.88% 0.00% 11.925018 13.194439 5.280098 5.685274 3.757548 5.143888 -0.057387 1.599418 0.275087 0.253141 0.125288
320 N03 dish_maintenance 100.00% 100.00% 100.00% 0.00% 15.118485 14.118389 6.903186 7.411040 7.800207 9.587453 0.455301 1.693101 0.056040 0.047376 0.007308
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 2.572179 2.647292 1.032586 1.237634 0.760569 1.406670 -0.101387 -1.313952 0.475486 0.497599 0.363280
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 1.387334 -1.015127 1.116924 -1.341640 0.541958 -1.175687 -1.433631 -0.234665 0.511017 0.515010 0.379045
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.912891 -0.405405 -0.507428 -1.120782 -0.252870 -0.616113 5.049263 0.902619 0.458688 0.503823 0.367592
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.848720 3.918036 -0.929384 -1.239115 -0.607036 -0.693955 1.625446 1.461197 0.458935 0.480761 0.348391
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 7, 15, 16, 18, 19, 27, 28, 29, 31, 32, 34, 36, 40, 42, 45, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 77, 78, 79, 80, 81, 84, 85, 86, 87, 92, 93, 94, 95, 96, 97, 101, 102, 103, 104, 107, 108, 109, 110, 111, 112, 113, 117, 120, 121, 122, 123, 124, 127, 131, 134, 135, 136, 140, 142, 143, 144, 147, 148, 151, 155, 156, 158, 159, 161, 162, 165, 170, 173, 179, 180, 181, 182, 184, 185, 187, 189, 191, 192, 193, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 221, 224, 225, 226, 227, 240, 242, 243, 244, 246, 262, 320, 329]

unflagged_ants: [5, 8, 9, 10, 17, 20, 21, 22, 30, 35, 37, 38, 41, 43, 44, 46, 48, 49, 61, 62, 64, 65, 66, 67, 69, 70, 73, 74, 82, 83, 88, 89, 90, 91, 105, 106, 114, 115, 118, 125, 126, 128, 132, 133, 137, 139, 141, 145, 146, 149, 150, 157, 160, 163, 164, 166, 167, 168, 169, 171, 183, 186, 190, 220, 222, 223, 228, 229, 237, 238, 239, 241, 245, 261, 324, 325, 333]

golden_ants: [5, 9, 10, 17, 20, 21, 30, 37, 38, 41, 44, 65, 66, 67, 69, 70, 83, 88, 91, 105, 106, 118, 128, 141, 145, 146, 149, 150, 157, 160, 163, 164, 166, 167, 168, 169, 171, 183, 186, 190]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459994.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.0.5.dev13+gd6c757c
3.2.1
In [ ]: