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 = "2459963"
data_path = "/mnt/sn1/2459963"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 1-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/2459963/zen.2459963.21326.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 1849 ant_metrics files matching glob /mnt/sn1/2459963/zen.2459963.?????.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/2459963/zen.2459963.?????.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 2459963
Date 1-18-2023
LST Range 2.402 -- 12.353 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1849
Total Number of Antennas 196
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 196 (0.0%)
Antennas in Commanded State (observed) 0 / 196 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 67 / 196 (34.2%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 116 / 196 (59.2%)
Redcal Done? ❌
Never Flagged Antennas 79 / 196 (40.3%)
A Priori Good Antennas Flagged 52 / 93 total a priori good antennas:
3, 7, 9, 10, 15, 16, 19, 21, 29, 37, 40, 41,
42, 53, 54, 55, 56, 67, 71, 72, 81, 83, 94,
101, 103, 105, 109, 111, 121, 122, 123, 128,
136, 140, 143, 144, 146, 147, 148, 149, 151,
161, 165, 169, 170, 173, 182, 185, 189, 192,
193, 202
A Priori Bad Antennas Not Flagged 38 / 103 total a priori bad antennas:
8, 22, 35, 46, 48, 61, 64, 73, 74, 89, 90,
95, 102, 114, 115, 120, 125, 132, 135, 137,
139, 179, 205, 206, 211, 220, 221, 222, 229,
237, 238, 239, 241, 244, 245, 261, 324, 325
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_2459963.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 11.235189 11.830886 11.847695 0.150293 3.083583 2.084529 3.125095 1.488762 0.035469 0.465950 0.374458
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.139427 0.206304 2.714883 0.019882 5.450284 -0.368727 3.448644 -0.309118 0.693045 0.698521 0.270618
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.361401 0.463027 0.333746 0.015679 0.547530 0.282867 0.698640 0.598797 0.707907 0.704235 0.258612
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.037245 -1.120060 -1.297889 -1.204725 -1.149065 8.298082 -0.623137 -0.048102 0.711001 0.710153 0.256259
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.083471 -1.192641 -0.446834 -0.019957 -0.243652 0.237847 -0.045032 0.625336 0.710618 0.707341 0.248567
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 2.083467 -0.978728 9.244449 -0.426097 8.315450 -0.130983 7.748436 0.231274 0.586071 0.705489 0.307403
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.853963 -0.554663 -0.725282 -1.575229 9.324900 -0.761126 -0.446772 -0.597256 0.704204 0.702701 0.254607
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 11.426739 22.864663 11.179536 0.655422 3.080722 2.125951 3.118836 1.723405 0.035257 0.463201 0.361366
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 11.437136 -0.575728 11.809801 0.680838 3.080669 0.719124 3.121745 1.111343 0.036363 0.710971 0.578352
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.744051 1.412396 0.576594 0.525847 0.081008 0.596726 0.702329 0.800838 0.713359 0.712010 0.258233
18 N01 RF_maintenance 100.00% 100.00% 35.10% 0.00% 12.085951 18.848816 11.799861 -0.339224 3.053881 2.809939 3.122510 2.495607 0.031771 0.358554 0.285140
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.833934 -0.345536 -1.064409 1.325361 8.444054 2.236770 -0.616504 0.639123 0.718610 0.715010 0.257126
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.282571 -0.959963 0.788552 -0.979257 1.379246 -0.641649 1.208289 -0.513258 0.718365 0.716854 0.249549
21 N02 digital_ok 100.00% 3.57% 0.00% 0.00% 0.430430 -0.498663 -0.004011 0.115317 22.489028 7.610303 0.499053 0.755579 0.667521 0.700512 0.269248
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.158274 -1.151736 0.297764 0.030896 -0.815330 -0.824050 -0.140939 -0.340477 0.684057 0.683049 0.254331
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.836284 11.945673 11.853798 12.157065 3.078411 3.498036 3.173140 3.438792 0.036888 0.039140 0.003487
28 N01 RF_maintenance 100.00% 0.22% 60.47% 0.00% 9.983260 25.570050 -0.533378 3.228290 8.271292 6.600751 1.098768 3.648422 0.494930 0.273447 0.292074
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 11.428708 12.336621 11.404530 11.713312 3.068355 3.488373 3.136819 3.406730 0.032278 0.040375 0.008339
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.387008 0.003472 -1.041210 0.522330 -0.153922 0.422474 -0.880191 0.775394 0.721962 0.721703 0.250088
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.921951 -1.256277 0.545136 1.310294 0.930780 1.876325 0.887273 1.852998 0.730371 0.722546 0.244283
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.371713 19.258812 -0.086381 3.116647 -0.173592 5.131786 0.197715 3.967419 0.722907 0.653145 0.237655
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 12.969442 13.479475 5.611888 5.783074 3.087985 3.484726 3.145859 3.419005 0.038724 0.060642 0.015203
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.067504 -0.133397 0.993021 -1.565679 0.223139 -1.171011 0.196028 -0.542305 0.690322 0.681803 0.253348
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.404834 23.839660 15.529716 15.271806 2.944582 3.392886 3.170656 3.458829 0.036510 0.033934 0.001347
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 6.533666 0.847809 -0.890253 1.456173 3.926111 1.946019 -0.367731 2.372971 0.701461 0.696785 0.267798
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.177442 0.562808 0.401840 0.635345 0.698192 1.245175 0.903972 1.197576 0.709170 0.706976 0.265170
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 10.816309 0.484200 11.424000 0.551074 3.075378 0.516313 3.143470 0.793711 0.044265 0.708468 0.529627
41 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 2.614695 7.202371 -0.189041 0.249249 -0.022047 0.610602 -0.036448 0.366526 0.716969 0.704631 0.241705
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 12.045797 12.908444 12.146900 12.712102 3.108779 3.497572 3.104606 3.398879 0.026712 0.026057 0.001312
43 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.290344 -0.541266 -1.209422 0.650734 16.138007 0.824491 -0.512927 0.964921 0.733200 0.726615 0.244370
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.615507 -0.741973 -0.734547 -0.532720 -0.830092 -0.278703 -0.992115 -0.300256 0.729416 0.730179 0.245744
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.533423 0.905167 0.369332 0.581337 0.181164 0.822749 0.566889 0.962631 0.728545 0.724848 0.241560
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.742693 -0.089799 -0.709896 -0.953356 -0.445406 -0.366273 -0.340339 -1.023140 0.726537 0.729919 0.253440
47 N06 not_connected 100.00% 100.00% 99.30% 0.00% 12.143832 13.133708 5.408593 5.361080 3.104945 3.487397 3.147838 3.397296 0.030830 0.073928 0.029449
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.355757 -0.100411 0.664817 2.053081 -0.399444 0.491977 -0.007020 1.080591 0.695180 0.694535 0.260120
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.048939 -0.517169 -0.678515 0.381042 4.693195 -0.375498 -0.248801 -0.031121 0.659942 0.682838 0.262726
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.251667 10.957566 0.531474 1.329517 0.759332 3.253598 1.379064 2.550246 0.681249 0.644952 0.255149
51 N03 dish_maintenance 100.00% 99.84% 0.00% 0.00% 23.320887 3.394798 14.907847 -0.620004 2.931623 1.102298 3.186894 -0.132041 0.055945 0.598366 0.443694
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.766935 6.471823 -0.324256 0.559192 -0.052130 0.466189 -0.095279 0.954157 0.711656 0.707854 0.261001
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.474693 8.776501 0.138939 -0.197399 0.398740 2.790598 0.484271 0.039528 0.720628 0.709521 0.257233
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.281755 12.550983 11.864599 12.413400 3.087521 3.495038 3.165248 3.421907 0.026644 0.025913 0.001279
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.739770 13.141410 11.878269 12.296540 3.082919 3.502597 3.170639 3.479591 0.029349 0.034285 0.004342
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.291551 13.339889 0.855761 12.558696 0.960161 3.484997 1.145868 3.401798 0.726341 0.045284 0.563187
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 27.902348 0.047554 3.887416 1.295296 8.481761 1.647395 2.726286 1.983082 0.619961 0.731416 0.233170
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.767938 12.280154 11.739879 12.295891 3.122148 3.514923 3.190349 3.454154 0.041370 0.040820 0.000622
59 N05 RF_maintenance 100.00% 88.64% 0.00% 0.00% 11.676817 -0.117126 11.231196 0.499764 3.130568 0.631691 3.143472 0.907496 0.090093 0.729343 0.546416
60 N05 RF_maintenance 100.00% 0.00% 62.95% 0.00% 0.334492 11.976770 -1.098047 12.304427 -0.448270 3.274719 -0.585014 3.199442 0.726751 0.215486 0.478133
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.801997 0.024253 -0.204126 -1.423112 -0.071432 -1.057762 -0.444430 -1.123289 0.683138 0.698485 0.247021
62 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.371742 -0.324345 -0.163737 1.421388 16.735590 0.126426 -0.066163 0.725162 0.657335 0.695103 0.260798
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.489919 12.761084 -0.453422 5.815032 -1.052345 3.491621 -0.738231 3.445868 0.692281 0.054116 0.492796
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.009104 -0.173676 -0.816837 -1.018354 -1.322888 -0.687355 -0.739850 -0.210013 0.678324 0.666816 0.250125
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.573455 0.948470 0.703829 1.107620 1.219246 1.569424 1.425299 2.092854 0.686944 0.689420 0.271593
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.388741 0.998307 -1.555263 -1.192916 -1.036687 -0.788828 -1.164396 -0.860664 0.701176 0.704551 0.273970
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 5.248242 13.337555 -0.529269 1.055691 -0.342235 1.690465 -0.354313 1.245876 0.706892 0.686904 0.256486
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 18.921080 25.596606 1.603048 16.037926 2.656150 3.403408 1.950592 3.488855 0.496477 0.036810 0.368555
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.336196 -0.291880 0.534135 0.760791 0.521632 1.131696 0.841711 1.188252 0.722449 0.722305 0.245044
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.425451 -0.541739 -0.161834 -0.077839 -0.184121 -0.158152 0.007020 0.326680 0.731359 0.730836 0.243731
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.026406 0.230259 0.742246 1.130594 0.924792 1.427817 1.067407 1.635046 0.738696 0.734983 0.239051
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.807651 13.346786 12.280717 12.740417 3.101619 3.502824 3.138302 3.410714 0.026633 0.025227 0.001567
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.798949 0.777492 -1.429669 -0.997967 -1.108006 -0.747768 -1.153022 -0.766084 0.741333 0.739591 0.240754
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.737728 -0.211166 -0.067203 -0.619401 -0.252784 0.391161 -0.527955 -0.274071 0.736211 0.736764 0.242111
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 54.395445 0.006689 0.810090 -0.232344 1.780953 -0.982498 1.384584 -0.282427 0.495162 0.699094 0.324456
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 28.188717 -0.589311 -0.438031 1.720691 0.250806 0.363107 0.345693 0.966128 0.567969 0.700828 0.260874
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.151515 12.964451 -0.876743 5.829561 0.641778 3.482107 -0.934456 3.378697 0.688615 0.045164 0.460976
80 N11 not_connected 100.00% 0.00% 99.95% 0.00% -0.238209 13.784635 -0.174670 5.723789 -0.593053 3.471561 -0.414736 3.395281 0.673884 0.061453 0.456298
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 117.892435 115.372187 inf inf 2005.722542 2054.090785 248.847294 254.256704 nan nan nan
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 126.416578 187.556507 inf inf 2030.060257 2156.200588 270.067151 262.443877 nan nan nan
84 N08 RF_maintenance 100.00% 47.32% 100.00% 0.00% 14.741429 22.222296 14.712383 15.545280 3.261831 3.386882 4.049591 3.436896 0.392799 0.042573 0.222803
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.855752 0.706695 0.128268 0.790999 -0.034365 0.755997 0.369872 1.220077 0.726805 0.722440 0.244535
86 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.671569 -0.192734 1.402625 1.230452 1.505412 1.925521 1.529104 1.718083 0.718065 0.720760 0.231337
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.749793 6.202416 -0.170507 -0.227215 3.851968 0.043467 0.016702 0.100024 0.727249 0.740476 0.235381
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.673634 0.905279 0.478870 0.952214 0.267960 0.714966 0.685914 1.386035 0.736850 0.736453 0.232646
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.008337 0.636755 0.342996 0.941303 0.202608 0.719828 0.521359 1.351589 0.739844 0.737033 0.233576
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.143563 -0.259333 -1.509238 0.913938 1.861276 2.565450 -1.094449 1.254538 0.738614 0.733053 0.236026
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.143370 -0.314988 0.625049 0.425158 0.227389 0.259619 0.742841 0.748762 0.729203 0.733050 0.241919
92 N10 RF_maintenance 100.00% 0.00% 2.87% 0.00% 31.305792 36.604758 0.948571 0.623540 2.513554 3.414171 2.132431 2.070934 0.439610 0.404032 0.049142
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.794470 -0.066079 1.838310 -1.435148 2.275180 -0.844749 2.266147 -1.279516 0.718079 0.720796 0.252143
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 12.201146 12.682348 12.049506 12.174263 3.064840 3.483884 3.117823 3.398389 0.035694 0.027836 0.003756
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.731944 -0.177979 -0.918075 1.015473 -1.376772 -0.107300 -1.044269 0.390504 0.690527 0.696297 0.264046
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.475112 13.417032 5.438184 5.944353 3.100288 3.492513 3.120773 3.392107 0.036439 0.043391 0.003420
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.588564 2.303756 -0.712419 -0.990559 -1.403612 16.575825 -0.803864 1.285951 0.675383 0.662268 0.261397
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.414333 13.495107 -0.183270 1.406339 -0.405133 1.723921 0.159417 1.905698 0.715673 0.707342 0.248518
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.900188 0.906531 -0.935509 -1.538937 -1.014584 -0.699761 -1.139506 -1.178130 0.726224 0.724437 0.247694
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.451797 4.029589 3.806500 -1.247395 4.549689 -1.203649 1.974139 -1.065703 0.709548 0.731490 0.254735
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.093333 46.796593 -0.439463 7.824424 0.001753 9.478572 -0.379977 9.773221 0.741468 0.717222 0.236992
105 N09 digital_ok 100.00% 0.00% 0.00% 0.00% -0.566160 0.953486 -0.804471 0.986440 4.820551 0.869802 -0.022562 1.398150 0.743600 0.735277 0.231634
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.962716 1.122135 -1.079885 -0.375340 -1.131635 -0.703786 -0.811949 -0.151601 0.739102 0.738581 0.232022
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.056808 0.526578 0.005350 -0.445083 -0.080958 -0.316013 0.228035 -0.167386 0.739123 0.738325 0.234266
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 11.401045 36.806297 11.797208 1.212561 3.086563 2.133538 3.166799 1.958268 0.039332 0.433093 0.211068
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.135582 12.286196 11.832965 12.022709 3.065617 3.491331 3.129161 3.434192 0.026660 0.027845 0.001403
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.282524 24.298166 15.565229 15.759107 2.972558 3.384279 3.058048 3.351930 0.026377 0.029399 0.001525
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.305467 12.165823 0.746545 12.136926 0.969621 3.485428 1.015554 3.438907 0.719092 0.045542 0.437367
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -1.492678 -0.482770 0.343992 0.104280 0.320182 0.259989 0.570966 0.478447 0.712782 0.714673 0.260686
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.122387 13.519557 5.196197 5.824007 3.083328 3.482104 3.123366 3.386608 0.039470 0.031643 0.004088
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.222677 0.778756 -1.528598 -0.005350 -1.107698 -0.934543 -1.100061 -0.359597 0.669315 0.684331 0.262396
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.532838 -0.829538 -1.130817 -0.387277 -1.490657 -1.308612 -0.890398 -0.642716 0.661701 0.674065 0.267721
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.177382 13.771986 11.938112 12.712413 3.098190 3.504991 3.135764 3.463050 0.029614 0.035648 0.004042
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.071092 0.876465 0.156210 0.615804 0.163331 0.650709 0.477504 1.140723 0.693427 0.701673 0.263467
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.033040 1.164078 3.008966 -1.044387 3.926068 -0.838138 3.923464 -0.655785 0.712698 0.724040 0.247012
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.008638 4.603771 -1.298677 2.072747 -1.158005 6.715221 -0.819400 3.195244 0.734916 0.730148 0.239736
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.682555 6.226803 0.556883 0.967457 0.766732 1.195692 0.936057 1.528376 0.740008 0.735934 0.234009
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.513633 11.669870 0.937043 1.250417 1.266252 1.465635 1.314835 1.737305 0.744904 0.737489 0.233211
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.600450 0.646290 0.260093 0.775546 0.365379 1.449000 0.592079 1.272813 0.745934 0.743072 0.238079
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.290622 -0.064743 0.187247 1.096070 0.235175 1.205867 0.335082 1.535681 0.741665 0.739198 0.236035
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 22.065082 4.549164 -0.276333 1.339334 0.897219 1.428784 0.306684 1.807951 0.663747 0.736417 0.237228
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.398717 -0.057477 0.538881 0.423680 0.664869 0.487140 0.719691 0.810680 0.732321 0.736067 0.248122
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.584712 11.826063 11.920346 12.291570 3.107611 3.497558 3.120782 3.408275 0.034457 0.031421 0.001630
131 N11 not_connected 100.00% 0.00% 0.11% 0.00% 0.369872 9.446063 -0.031709 5.381109 -0.655397 2.769295 -0.527187 2.206631 0.694430 0.455283 0.313764
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.344811 0.476314 -0.688601 -1.556219 -1.196940 -1.081038 -0.966931 -1.233850 0.681211 0.683278 0.256260
133 N11 not_connected 100.00% 93.83% 0.00% 0.00% 12.816892 -0.110995 5.180873 -1.532808 3.053036 -1.214391 3.114179 -1.012774 0.082805 0.672187 0.443373
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.636710 -1.156810 -0.878190 -1.095572 1.301833 -0.962027 0.432791 -0.506549 0.670552 0.681439 0.279006
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 10.401941 -0.110549 11.363279 -0.750052 3.068129 -0.671719 3.156964 -0.084667 0.053958 0.684600 0.453101
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.195389 -0.510956 0.100351 -1.398527 0.399084 -1.519332 0.515494 -1.077514 0.683176 0.695952 0.264477
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.268845 -0.460182 1.600326 -0.695377 0.163418 -0.592178 0.673814 -0.638940 0.702945 0.701768 0.250558
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.147469 -0.846871 0.234886 -0.167644 20.375338 -0.809143 0.453572 -0.470577 0.701794 0.727562 0.252533
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.256348 -1.226870 -0.226728 0.718036 0.132272 2.007842 0.085677 0.336440 0.731975 0.730614 0.242740
142 N13 RF_maintenance 100.00% 0.00% 98.59% 0.00% 1.143480 12.319220 -0.804070 12.334891 -0.784125 3.465610 -0.238660 3.403216 0.736888 0.070766 0.522100
143 N14 digital_ok 100.00% 0.00% 100.00% 0.00% -0.129206 12.776075 1.100946 12.409168 1.534625 3.483872 1.444244 3.421284 0.739875 0.053384 0.559535
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.127335 3.549892 -1.076739 9.136088 -1.119126 27.708371 -0.695573 14.708884 0.744165 0.535097 0.309911
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.848816 0.121231 -0.993954 4.721525 -1.156235 6.737102 -0.583373 6.613364 0.743577 0.721802 0.241277
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 12.550383 3.803961 5.176734 -0.046539 3.067697 -0.851295 3.098825 -0.230104 0.045755 0.714099 0.529759
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% 219.858210 219.817604 inf inf 2057.287313 2057.369955 197.903024 197.701405 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 0.00% 0.00% 0.00% 0.00% -0.894531 -0.720314 -0.103681 -1.259933 0.120979 -1.434836 -0.698211 -1.272685 0.714870 0.716726 0.266300
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 23.465505 0.398625 -0.330765 0.438483 0.440410 0.197991 0.315042 0.361787 0.581763 0.667068 0.234223
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.910964 -0.991928 11.536557 -1.446806 3.068198 6.423869 3.172117 -0.016772 0.056570 0.683031 0.463589
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.093000 11.959700 9.940307 12.035306 5.563542 3.502208 5.665008 3.447581 0.511243 0.044907 0.343815
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.277963 0.029134 0.102345 0.645276 0.483770 0.939840 0.756910 1.443583 0.687669 0.697392 0.262348
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.212351 -0.675802 -0.148665 -1.041035 0.263846 -0.412374 0.419384 -0.395402 0.703425 0.711673 0.260210
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.482224 27.241138 -1.565593 -0.541107 -1.490374 0.681153 -1.152444 0.340760 0.685640 0.584759 0.233407
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.490990 -1.140733 -0.108301 -0.874086 -0.126406 -0.686932 0.287599 -0.452161 0.720924 0.722770 0.246065
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.814435 25.428215 0.108289 -0.522080 0.207186 0.655760 0.465298 0.197464 0.728367 0.634006 0.227202
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.209848 -0.635338 -0.183845 -1.155183 0.947804 0.648334 -0.513813 -1.213091 0.733935 0.733315 0.244807
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.788473 1.189118 -0.100520 0.489162 -0.052667 0.797456 0.182841 0.898583 0.740257 0.735472 0.242253
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.972879 0.297709 1.814808 -0.121001 2.828019 0.058392 2.317148 0.315532 0.732947 0.734888 0.239474
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 25.363088 0.080675 -0.269995 -1.220477 0.634161 -0.563967 0.603784 -0.768152 0.631370 0.734719 0.237957
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.391410 8.792745 1.010253 1.766121 3.323346 2.121909 1.418345 1.226910 0.728749 0.709886 0.247977
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.454710 -0.919462 -1.481069 -0.530475 -0.997696 -0.015627 -1.055268 -0.244107 0.732884 0.731114 0.252015
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.496511 -0.619033 0.370362 -0.362203 0.352040 -0.006163 0.736642 0.050822 0.724232 0.724408 0.255586
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 1.219912 7.511525 -0.863723 -1.295816 -0.993662 -1.218143 -0.564449 -1.187569 0.720029 0.709893 0.255990
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 12.204562 -0.558502 12.155661 -1.082519 3.102527 -0.457933 3.134185 -0.501232 0.056652 0.719136 0.534909
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.675348 1.896735 -1.548168 0.248084 -1.421028 0.248736 -1.104156 0.037846 0.673240 0.652503 0.247497
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 13.472913 12.968936 4.887882 5.384016 3.068536 3.503820 3.203263 3.553741 0.042927 0.049395 0.004499
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.309232 -0.623329 -0.747737 -1.516800 -0.715524 0.180533 -0.213315 -0.902837 0.704629 0.710022 0.259976
180 N13 RF_maintenance 100.00% 0.00% 98.54% 0.00% -0.037049 12.929037 -1.199124 12.487856 12.523046 3.476323 -0.365004 3.435217 0.715404 0.077237 0.519340
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.584966 -0.481611 0.519855 0.263026 0.667436 0.274347 0.991200 0.901168 0.723865 0.722168 0.248501
182 N13 digital_ok 100.00% 0.00% 99.24% 0.00% 0.064679 12.037273 0.370592 12.012438 1.876868 3.468736 -0.513569 3.423773 0.731212 0.072402 0.487074
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.003472 0.596240 -0.899685 0.222735 -0.861342 0.262799 -0.504021 0.452164 0.723204 0.722828 0.237775
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.677247 -0.647003 -1.548110 -0.407542 -1.241376 -0.481999 -0.978423 0.062170 0.733828 0.731326 0.239287
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 30.265958 -0.467471 -0.152243 -1.370938 1.922889 2.651717 0.560107 -1.137588 0.638401 0.729985 0.241333
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.662444 -1.635080 -1.591979 -0.309803 -1.238546 -1.106927 -1.219712 -0.571952 0.734157 0.730246 0.252525
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.515459 1.001194 -1.295872 2.519117 0.979979 3.056678 -1.136595 1.416152 0.729567 0.719912 0.257342
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 10.299833 11.832288 11.346378 12.150729 3.090786 3.506212 3.231923 3.464524 0.030289 0.035201 0.002284
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.110415 -1.426648 -0.570958 0.436812 -0.778944 -0.352955 -0.223749 -0.067440 0.717100 0.718032 0.267066
191 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.048620 -0.454429 1.487984 -0.529851 1.865448 -0.513295 2.250585 -0.078836 0.706125 0.708329 0.260187
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.136948 4.661706 4.687342 5.267446 6.057639 2.976192 3.072564 3.105750 0.662003 0.651627 0.278492
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.231529 0.273472 5.288155 1.371729 2.676534 0.041584 2.757060 0.701518 0.639625 0.673092 0.296146
200 N18 RF_maintenance 100.00% 100.00% 32.07% 0.00% 12.998205 32.759496 5.355997 0.756343 3.055026 2.638185 3.144900 2.306173 0.046268 0.361228 0.252694
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.384491 2.991665 3.288201 4.625508 1.463977 2.518379 1.573953 2.710024 0.705700 0.688299 0.259253
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.338310 1.042318 1.687833 -1.355737 0.443240 -1.234892 0.615242 -0.180137 0.716585 0.702387 0.247731
205 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.590255 1.879091 0.056620 -0.061845 -0.401725 0.038408 -0.258425 0.080675 0.705842 0.685309 0.243926
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.190359 0.871341 2.012705 0.144868 0.333897 0.805163 1.155020 -0.101782 0.707399 0.701959 0.255745
207 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 219.859837 219.788213 inf inf 2189.222567 2176.591951 260.494996 257.503491 nan nan nan
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 4.801285 7.429770 11.066713 13.975378 3.164000 3.711068 3.517628 6.113009 0.037958 0.037301 0.001274
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 4.543227 5.965126 10.781497 11.193809 3.298955 3.584658 3.456942 4.135759 0.048231 0.048083 0.002658
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 10.553982 10.801998 -0.840549 -1.006814 -0.696610 -0.665063 -0.538270 -0.726849 0.709228 0.706713 0.259152
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.059259 1.488985 -1.016251 0.190255 -1.560790 -0.648738 -1.176608 -0.189009 0.676018 0.675579 0.256442
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.692909 -0.887265 0.446790 -0.349516 -0.319506 -1.027664 -0.193317 -0.689238 0.706479 0.701557 0.248926
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.110748 0.071054 -0.065583 -0.684164 1.146062 -1.212568 -0.565994 -0.951811 0.706629 0.705085 0.248604
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.977087 -0.305914 -0.151137 0.249059 -0.658476 -0.624767 -0.673850 -0.240268 0.705367 0.707740 0.251857
223 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 195.031973 195.049054 inf inf 2266.155907 2279.027302 253.742015 260.160843 nan nan nan
224 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 219.194323 219.092904 inf inf 2832.210074 2779.877727 377.263948 367.110554 nan nan nan
225 N19 RF_ok 100.00% 0.00% 57.65% 0.00% 0.930195 11.414683 1.051349 5.472256 -0.112946 2.667754 0.287348 2.425254 0.703528 0.318496 0.435683
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.059740 17.177063 0.116785 1.242516 -0.752003 0.818405 -0.403479 1.077996 0.700861 0.625081 0.260708
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.492468 0.775754 -0.660281 0.162270 7.060333 -0.613691 -0.008377 -0.153583 0.681972 0.688204 0.249517
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.643381 19.906016 -0.446295 -0.294139 1.106016 5.853310 1.829184 0.804084 0.620050 0.589297 0.185451
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.284809 -0.616653 1.774091 1.586682 0.464909 0.243878 0.599780 0.705928 0.683981 0.684743 0.268898
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.812523 0.011053 0.008965 -1.424436 -0.298249 -1.497639 -0.068536 -1.253463 0.666494 0.686191 0.255645
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.418022 0.332966 1.005671 0.629967 0.006163 -0.288648 0.091203 -0.052156 0.700873 0.697577 0.257942
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.668448 -1.357561 -0.127789 0.371441 -1.015372 -0.512573 -0.659591 -0.139086 0.701265 0.699627 0.257837
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 19.413008 46.689303 1.990939 0.956105 3.513874 2.085233 1.185650 1.351161 0.598947 0.524414 0.188963
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.368243 2.144060 -0.718234 0.727486 -1.104556 0.519544 -0.675131 0.824949 0.690931 0.662042 0.258025
242 N19 RF_ok 100.00% 34.78% 0.00% 0.00% 56.539371 1.050106 0.873022 1.935827 2.101046 0.546721 1.636981 1.032989 0.416609 0.693618 0.378837
243 N19 RF_ok 100.00% 6.17% 0.00% 0.00% 55.682681 1.669368 1.063180 -1.443332 1.887322 -1.283535 1.699907 -0.954611 0.427877 0.678705 0.363438
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.150736 1.315380 1.918929 -0.645791 2.896464 0.200528 0.932575 -0.420240 0.614886 0.668214 0.253029
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.707735 1.800218 0.180055 -0.696021 -0.681545 1.512648 -0.291181 -0.471068 0.683889 0.675760 0.258126
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.772704 5.955629 -0.897931 0.449385 2.836389 2.466069 1.311570 1.781686 0.455158 0.450734 0.121405
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.768197 0.974719 0.755278 -0.333286 -0.141790 -1.119523 0.183823 -0.474244 0.682729 0.673390 0.261763
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 4.444163 5.773713 10.774630 11.671354 3.271984 3.641791 3.417013 4.227381 0.036640 0.029676 0.006231
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 5.141048 12.876865 3.029636 8.205649 1.382683 3.492246 3.897048 3.459769 0.553044 0.054876 0.428204
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.962558 1.468380 1.245353 1.781428 -0.238111 0.215510 0.186813 0.737177 0.585139 0.580407 0.282302
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% -0.857803 -0.718199 1.363331 -1.185213 -0.286680 -0.707714 0.182202 -0.239710 0.627618 0.609439 0.277901
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.522314 -0.455121 -1.530762 -0.735963 4.067213 -1.068380 0.596336 -0.300256 0.561388 0.580165 0.289644
333 N12 dish_maintenance 0.00% 0.00% 0.27% 0.00% 2.202616 1.249077 -0.638535 -0.718417 0.929740 2.849058 0.900314 -0.218763 0.532313 0.563828 0.301800
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 7, 9, 10, 15, 16, 18, 19, 21, 27, 28, 29, 32, 34, 36, 37, 40, 41, 42, 43, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 62, 63, 67, 68, 71, 72, 77, 78, 79, 80, 81, 82, 83, 84, 87, 92, 94, 96, 97, 101, 103, 104, 105, 108, 109, 110, 111, 113, 117, 121, 122, 123, 126, 128, 131, 133, 136, 140, 142, 143, 144, 145, 146, 147, 148, 149, 151, 155, 156, 159, 161, 165, 166, 169, 170, 173, 180, 182, 185, 189, 192, 193, 200, 201, 202, 207, 208, 209, 210, 223, 224, 225, 226, 227, 228, 240, 242, 243, 246, 262, 320, 329, 333]

unflagged_ants: [5, 8, 17, 20, 22, 30, 31, 35, 38, 44, 45, 46, 48, 61, 64, 65, 66, 69, 70, 73, 74, 85, 86, 88, 89, 90, 91, 93, 95, 102, 106, 107, 112, 114, 115, 118, 120, 124, 125, 127, 132, 135, 137, 139, 141, 150, 157, 158, 160, 162, 163, 164, 167, 168, 171, 179, 181, 183, 184, 186, 187, 190, 191, 205, 206, 211, 220, 221, 222, 229, 237, 238, 239, 241, 244, 245, 261, 324, 325]

golden_ants: [5, 17, 20, 30, 31, 38, 44, 45, 65, 66, 69, 70, 85, 86, 88, 91, 93, 106, 107, 112, 118, 124, 127, 141, 150, 157, 158, 160, 162, 163, 164, 167, 168, 171, 181, 183, 184, 186, 187, 190, 191]
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_2459963.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.3.dev3+gb08b74d
In [ ]: