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 = "2460110"
data_path = "/mnt/sn1/2460110"
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: 6-14-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/2460110/zen.2460110.42111.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

# get a list of all ant_metrics files
glob_str = os.path.join(data_path, f'zen.{JD}.?????.sum{ant_metrics_ext}')
ant_metrics_files = sorted(glob.glob(glob_str))

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 361 ant_metrics files matching glob /mnt/sn1/2460110/zen.2460110.?????.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/2460110/zen.2460110.?????.sum.known_good.omni.calfits. Skipping redcal chisq.

Figure out some general properties¶

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

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

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

Load a priori antenna statuses and node numbers¶

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

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

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

Summarize auto metrics¶

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

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

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

Summarize ant metrics¶

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

Summarize redcal chi^2 metrics¶

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

Get FEM switch states¶

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

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

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

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

Find X-engine Failures¶

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

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

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

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

Build Overall Health DataFrame¶

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

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

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

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

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

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

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

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

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

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

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

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

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

Table 1: Overall Array Health¶

In [18]:
HTML(table.render())
Out[18]:
JD 2460110
Date 6-14-2023
LST Range 17.063 -- 19.004 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 361
Total Number of Antennas 202
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
RF_maintenance: 67
RF_ok: 18
digital_ok: 84
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 202 (0.0%)
Antennas in Commanded State (observed) 0 / 202 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s N07, N13, N14
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 57 / 202 (28.2%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 84 / 202 (41.6%)
Redcal Done? ❌
Never Flagged Antennas 118 / 202 (58.4%)
A Priori Good Antennas Flagged 29 / 84 total a priori good antennas:
5, 10, 15, 17, 37, 40, 42, 51, 86, 107, 112,
118, 121, 140, 141, 144, 145, 146, 153, 161,
162, 163, 164, 165, 181, 183, 186, 187, 202
A Priori Bad Antennas Not Flagged 63 / 118 total a priori bad antennas:
8, 22, 35, 36, 43, 46, 48, 49, 50, 52, 57,
58, 60, 63, 64, 68, 73, 74, 77, 79, 80, 84,
89, 90, 94, 95, 96, 97, 102, 108, 113, 114,
115, 120, 132, 133, 134, 135, 136, 155, 179,
204, 206, 210, 220, 221, 222, 223, 224, 228,
229, 237, 238, 239, 241, 242, 243, 244, 245,
261, 262, 324, 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_2460110.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 0.00% 0.00% 0.00% 0.00% -0.788366 -1.168729 -0.609111 -1.065987 -0.157668 -0.583130 -0.405037 -0.442839 0.722498 0.642962 0.493230
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.250119 5.251853 -0.858613 -0.601243 -1.090890 -0.376071 -0.992685 1.731742 0.727182 0.584530 0.484285
5 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.158511 3.656617 0.095911 4.318832 0.302327 1.580312 0.241316 1.889888 0.744656 0.665009 0.495475
7 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.589601 -0.653362 -1.314379 -0.376911 -0.782533 -0.545237 0.979146 -0.524687 0.749444 0.672767 0.495344
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.962072 2.270374 1.534268 1.688343 0.747105 0.817901 -0.868240 -0.638674 0.724766 0.648239 0.489128
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 2.317324 -0.025784 3.939863 0.303022 2.447498 0.686838 2.211288 0.275763 0.754981 0.678228 0.498210
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.096557 -1.432757 -0.432325 -1.298343 16.343171 -1.100878 8.606903 -0.740413 0.749461 0.669247 0.510589
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 4.973287 -1.005426 0.254430 -0.818292 -0.314000 -0.325666 0.107786 -0.276418 0.666101 0.672058 0.423843
16 N01 RF_maintenance 100.00% 100.00% 57.06% 0.00% 4.105465 4.736408 19.771953 20.236440 2.058799 1.949438 1.977890 2.239709 0.029276 0.194824 0.144951
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 1.653923 3.334476 1.690662 3.791466 1.293444 2.011217 0.820428 4.153237 0.768907 0.693612 0.471628
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.178667 1.228161 -0.293866 0.307921 -0.042815 -0.620881 60.101887 22.267973 0.743495 0.540534 0.565408
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.443949 0.529417 -1.284220 0.471739 -0.781493 -0.284277 -0.637923 -1.153440 0.773648 0.693776 0.497639
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.369120 0.026724 0.412720 0.358189 0.715995 0.608940 0.248662 0.075049 0.776662 0.701998 0.495126
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.300124 1.040311 -1.293072 -0.078337 -0.839382 -0.007643 -0.696882 -0.104000 0.766568 0.684656 0.506504
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.133533 0.222282 1.399397 -1.005543 0.664453 -0.680535 0.998037 -0.347138 0.698875 0.613057 0.494180
27 N01 RF_ok 100.00% 100.00% 38.50% 0.00% 7.510873 9.530183 18.379680 6.523467 2.133352 2.600938 4.874032 42.664235 0.049121 0.221701 0.175763
28 N01 RF_ok 100.00% 0.00% 0.00% 0.00% -0.007362 6.617870 0.685928 7.671111 1.129689 0.559443 0.329628 34.867464 0.768246 0.432759 0.631823
29 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.110898 4.978049 19.468716 19.772096 2.055257 2.130525 3.606046 2.955768 0.030847 0.037915 0.007382
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.427066 -1.202850 0.341449 -1.306705 -0.325681 -1.022118 0.086040 -0.376684 0.775830 0.718813 0.484581
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.902669 0.575750 -0.638364 0.566665 -0.191734 0.579335 -0.271722 0.725986 0.785318 0.719433 0.487681
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.001129 -0.343810 0.781967 -0.441199 0.087293 -0.341401 1.396619 7.412126 0.742860 0.714098 0.449738
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 4.665206 0.004333 12.451847 -0.149827 2.068677 -0.904508 2.377748 0.646447 0.034119 0.634049 0.499232
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.029918 -1.019089 0.016413 -0.997610 -0.565489 -1.339958 -0.832469 -0.441615 0.704219 0.621494 0.491824
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.398266 0.928449 0.672419 0.324618 0.646786 0.329999 0.779595 0.281356 0.706388 0.611719 0.469562
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 5.227341 4.674597 6.063932 8.204757 2.858927 3.002825 2.261715 9.114259 0.727343 0.633148 0.473443
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.968379 -0.192865 -0.759714 0.306096 -0.217121 0.494787 0.368763 1.494051 0.735449 0.656466 0.473600
40 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.378713 0.860997 0.735063 0.551643 0.914416 0.595600 1.700868 17.226315 0.764864 0.695064 0.478312
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.228981 2.273879 0.023779 3.262933 0.162710 1.978623 -0.075507 1.443943 0.775293 0.711025 0.473235
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.488263 3.999213 0.273624 7.235130 0.421703 2.589241 0.378632 2.276285 0.790403 0.719408 0.486318
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.056792 0.120606 -0.969038 0.355316 -1.166927 0.475088 -0.651327 0.555985 0.757124 0.692696 0.474325
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.544711 -0.173963 -1.312210 -0.218800 -0.884903 -0.015523 -0.459993 0.048307 0.764388 0.698341 0.485360
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.237274 -0.019880 0.566725 0.102364 0.631282 0.170339 0.534612 0.649183 0.770059 0.701163 0.488952
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.485394 -1.161789 -0.147305 -0.980125 0.236015 -1.151808 1.368527 -0.402288 0.767609 0.687747 0.498783
47 N06 not_connected 100.00% 0.83% 100.00% 0.00% 3.704881 5.148544 11.890921 12.043795 1.492542 2.116506 2.799143 1.908627 0.360629 0.099602 0.296904
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.805926 0.684937 -0.793147 0.430528 -1.141141 -0.315723 -0.401493 -0.829338 0.719324 0.622780 0.475427
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.119088 -0.656311 1.333709 -0.705045 1.373904 -1.322858 1.793726 -0.622470 0.697685 0.609637 0.480345
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.466172 -0.101347 -0.087974 0.427187 0.229595 0.550585 -0.139315 0.181058 0.710187 0.612076 0.471895
51 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.443013 -0.321755 -0.179463 0.547786 0.163665 0.740861 38.631647 0.768110 0.720164 0.637170 0.459825
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.583938 0.327758 1.833219 -0.266183 1.390691 -0.060862 2.921580 0.468022 0.742433 0.656335 0.466688
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.448184 -0.702891 -0.238497 -0.394922 0.171715 0.199717 3.548556 0.246926 0.754623 0.680668 0.458546
54 N04 dish_maintenance 100.00% 0.00% 0.00% 0.00% 12.308742 1.967512 6.031822 5.789926 2.284847 1.651037 3.698695 1.745892 0.390269 0.469195 0.218747
55 N04 RF_maintenance 100.00% 100.00% 0.00% 0.00% 21.305988 -0.998059 14.468735 -0.853025 2.464015 -1.125997 1.831900 0.207842 0.037621 0.700957 0.549517
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.472654 0.463191 -0.625127 0.400256 -0.316062 0.189929 -0.401063 1.565469 0.793031 0.729234 0.473990
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.361787 0.261297 -0.040861 0.143362 0.426530 0.561325 0.492089 0.396859 0.801788 0.731384 0.463663
58 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.210557 2.048228 1.761668 1.612652 0.947199 0.791653 -0.787768 -0.813619 0.745789 0.676070 0.488236
59 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.101544 4.940998 0.407319 20.394022 0.491285 2.136793 0.601237 2.705645 0.769877 0.045347 0.616663
60 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.193932 -0.043460 -1.059190 0.261941 -0.792972 0.453195 -0.139069 2.124001 0.759038 0.687140 0.500269
61 N06 not_connected 100.00% 100.00% 0.00% 0.00% 4.602489 -1.169151 11.909988 -0.881183 2.068695 -0.713035 1.608731 0.443953 0.028891 0.671615 0.519618
62 N06 digital_ok 0.00% 0.00% 0.00% 0.00% 0.080072 0.747746 1.690621 0.374357 0.774779 -0.383758 1.758120 -0.766193 0.713296 0.634318 0.475597
63 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.615683 3.074993 -0.761149 2.422478 -1.174415 1.546367 -0.634147 -0.522323 0.725273 0.603351 0.490970
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.971266 -0.998514 -1.293349 -0.490657 -1.020963 -0.511768 -0.325501 0.238814 0.711387 0.620980 0.478887
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.000824 -1.079785 0.194944 -1.155573 0.690154 -0.270795 -0.045925 -0.373341 0.712875 0.605645 0.481618
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.079868 -0.281169 0.250082 0.305344 0.330438 0.484189 0.074749 0.421496 0.718237 0.637045 0.462492
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.169942 0.347691 -0.822319 0.771764 -0.349430 0.732860 1.378464 0.823740 0.743342 0.664634 0.467691
68 N03 RF_ok 0.00% 0.00% 0.00% 0.00% 1.071862 0.582924 1.286110 1.015618 1.034721 0.780102 0.853681 1.570378 0.761362 0.682546 0.470333
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.655530 -0.189378 0.439649 0.109171 0.379700 -0.037143 1.859657 -0.118315 0.773870 0.701119 0.469701
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.743862 0.295581 2.320771 0.447763 1.374368 0.372934 1.329739 0.927133 0.785464 0.719942 0.466740
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.309514 -0.253994 -0.984578 -0.105739 -0.544125 0.022928 -0.359665 0.331659 0.794800 0.730322 0.471629
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.114545 -0.037153 -0.136580 -0.158644 0.079076 0.133464 -0.067934 -0.130512 0.802629 0.737087 0.481331
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.204522 2.473602 -0.159170 2.768643 0.119883 1.840509 0.236203 1.517996 0.778086 0.710612 0.485616
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.059680 -1.497281 -0.566811 -1.302330 -0.746187 -0.928216 -0.802218 -0.253344 0.760644 0.693376 0.482513
77 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.838108 1.714240 -1.023408 -1.017782 0.007643 -0.541563 1.392871 0.664589 0.687163 0.615178 0.294009
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 5.632364 1.078744 0.753315 0.412283 0.186834 -0.338596 5.081081 -0.675281 0.644572 0.639365 0.376379
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.492279 -1.291064 -0.333312 -1.180769 -0.314075 -1.322923 2.357749 -0.161661 0.759951 0.674794 0.476456
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.531051 1.822950 -0.420396 1.497879 -1.001797 0.674511 -1.045841 -0.932237 0.742108 0.634335 0.488907
81 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 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 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
84 N08 RF_ok 0.00% 0.00% 0.00% 0.00% 1.291959 2.084174 1.044536 1.623809 0.252721 0.809988 -1.229644 -0.883084 0.736845 0.649211 0.464998
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.059234 -1.249463 -0.226773 -1.338957 -0.904804 -0.961192 -1.158461 -0.718168 0.765619 0.694762 0.473092
86 N08 digital_ok 100.00% 100.00% 0.00% 0.00% 4.168712 -0.536492 17.754964 -0.199931 2.058686 0.244230 1.378467 6.131715 0.048887 0.708626 0.516530
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.885956 0.208866 1.299758 -1.163408 1.748348 -0.616792 4.417793 0.775041 0.774841 0.723121 0.453386
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.060706 0.655068 0.393972 1.263028 0.504881 0.896807 1.463285 1.024105 0.797498 0.733203 0.475986
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.000824 0.372671 0.476415 0.786992 0.640686 0.808307 0.218116 0.297058 0.805166 0.736421 0.486814
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.112119 0.247436 -0.144002 0.885957 -0.801765 0.695738 -1.119048 1.303899 0.798499 0.736236 0.481456
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.162671 0.069962 0.670606 0.355669 0.765748 0.563223 0.792962 0.534572 0.802980 0.732219 0.503885
92 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 3.944916 4.665879 19.894656 20.243254 2.054037 2.138118 3.164706 3.295129 0.025299 0.024094 0.001431
93 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.146664 4.914961 19.835315 20.517299 2.063487 2.149204 3.007522 3.953997 0.025255 0.027559 0.000978
94 N10 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.151593 2.155456 0.611450 2.474105 0.920242 1.748450 0.951747 1.392968 0.775471 0.689820 0.467366
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.003389 -0.185796 -0.608122 -0.148302 -0.711214 -0.839029 -0.421119 -1.012824 0.761833 0.680881 0.474944
96 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.575767 3.724989 0.457496 -0.710583 -0.239493 -0.510373 -1.127560 3.251871 0.748655 0.613798 0.432055
97 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.226251 1.882501 -1.117416 1.445782 -1.137455 1.059840 -0.790389 0.102748 0.739009 0.630870 0.482401
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.832147 1.438209 -0.237014 0.676562 0.280613 0.782528 -0.088634 0.868412 0.752877 0.665615 0.479182
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.508059 -0.570169 -0.524386 -1.013600 -1.110297 -0.674497 -1.077052 0.884957 0.757398 0.683214 0.473664
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.533674 -0.045813 -1.055053 0.048720 -0.889095 0.215827 0.572375 2.414917 0.767050 0.700151 0.462514
104 N08 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.118856 23.962119 2.898810 8.802078 1.940398 3.498914 2.358094 2.890582 0.784850 0.705014 0.488940
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.852916 0.174953 -0.260583 0.960001 -0.138880 0.769777 0.545157 1.393448 0.788819 0.719953 0.482232
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.629090 -1.032710 -0.352175 -0.032580 -0.075992 -0.040657 -0.168856 -0.000106 0.795267 0.725507 0.489171
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.891700 0.274371 -0.793123 -0.811400 -0.498318 -0.611839 4.394376 2.851120 0.797037 0.726632 0.477260
108 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.167684 0.584488 -1.071485 0.350879 -1.019780 0.335289 -0.765977 0.144214 0.793964 0.730977 0.499733
109 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.212954 4.858310 -0.142585 20.054194 1.712193 2.136525 0.949042 2.894383 0.465558 0.035517 0.351398
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.551263 -0.307143 5.865186 0.205012 1.400681 0.457345 1.859745 0.054317 0.728146 0.701096 0.407645
111 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.332194 1.404288 2.658142 1.603181 0.235315 1.334394 3.093226 0.807029 0.714112 0.695618 0.406459
112 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 1.357027 0.029495 16.374474 0.011048 -0.605921 -0.627847 1.068920 -1.055372 0.641741 0.669584 0.438553
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.727471 2.935146 2.152951 2.314439 1.293125 1.455473 -0.832608 -0.608628 0.734322 0.650193 0.467861
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.396792 -0.872492 1.865758 -1.213574 1.072320 -1.344579 -0.919723 -0.799149 0.723726 0.661881 0.454965
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.575119 -0.345018 -1.197251 -0.329230 -0.533993 -0.952902 -0.591378 -0.972954 0.728576 0.634143 0.471126
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.047009 -0.464018 2.880167 -0.048250 2.018298 0.361989 1.565019 -0.070445 0.750902 0.669258 0.475874
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.733631 1.928089 1.291545 13.806465 0.448955 2.467839 0.352997 6.817638 0.696826 0.654733 0.471267
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.546372 0.456715 -0.946738 -1.162750 -0.378089 -0.943103 -0.315127 -0.768760 0.770162 0.691037 0.487734
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.560144 1.949598 1.941705 0.689086 1.104527 -0.168691 -0.633492 -0.664786 0.750444 0.682448 0.491547
124 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.050303 5.113534 20.180486 20.659139 2.063360 2.152738 2.341283 5.008826 0.040944 0.042254 0.000862
125 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.037802 -0.124899 4.571750 0.386180 1.969222 0.365216 3.214115 1.345367 0.784785 0.720384 0.501218
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.012517 1.859302 0.377159 0.619021 0.960328 0.686471 15.893806 0.834665 0.791687 0.720622 0.511975
127 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 4.053390 2.377089 19.871771 3.158361 2.055497 1.746655 2.058989 3.636673 0.031706 0.434484 0.306666
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.345146 -0.440657 0.173041 -0.650411 0.284473 -0.347775 1.654353 0.869882 0.777734 0.705388 0.498208
131 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.936049 4.020881 -0.713111 12.053741 -0.721166 0.936599 -0.974685 1.370281 0.760162 0.435675 0.533932
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.093899 -1.394136 -0.984426 -1.217272 -1.241630 -1.122396 1.173872 0.014275 0.751165 0.670346 0.456268
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.339329 -0.948375 -1.255710 -0.774457 -0.992565 -1.335739 -0.733945 -0.844144 0.737631 0.648036 0.465661
134 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.657599 2.219848 3.418824 1.705340 1.042096 0.881936 1.730706 -0.889266 0.692571 0.598552 0.468638
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.728551 0.280681 -0.648548 0.531319 -1.095944 0.642296 -0.259685 0.459957 0.678747 0.582162 0.475247
136 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.164465 1.999779 -1.300715 0.808170 -0.886264 0.627810 -0.406353 1.465874 0.703118 0.592023 0.481186
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
139 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
140 N13 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
141 N13 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
142 N13 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
144 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
145 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
146 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 1.344635 0.058900 1.612807 0.698382 1.399489 0.628854 0.914727 0.457142 0.793634 0.721536 0.503432
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.297486 0.133995 -0.079904 0.546665 0.202537 0.424002 0.615123 1.090344 0.788630 0.715976 0.488256
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.852009 -0.198133 -0.734417 -0.091014 -0.083544 0.250331 0.413713 0.725061 0.781146 0.709016 0.478629
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.279056 -0.158276 0.093580 0.025054 0.403889 0.326700 2.292778 0.869946 0.775739 0.697627 0.467976
151 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.710242 0.225261 -0.691262 0.976665 -0.323392 0.752028 -0.005645 2.582325 0.689492 0.674350 0.384928
152 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -1.443055 -1.380021 -1.180516 -1.140935 -0.674484 -0.933099 0.423412 -0.688641 0.741828 0.650639 0.461174
153 N16 digital_ok 100.00% 100.00% 0.00% 0.00% 4.067683 -1.274718 12.094288 -1.206433 2.058985 -0.950191 1.988781 -0.502169 0.040894 0.626993 0.469944
154 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.716735 -1.079241 -0.537766 -1.127442 -1.063966 -1.360936 -1.018944 -0.841785 0.700179 0.596764 0.466828
155 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.664045 1.027780 0.551647 -1.049686 -0.300005 -0.850156 -1.142605 -0.776813 0.676255 0.568345 0.482072
156 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.973205 0.007561 5.930676 0.508902 2.802135 0.689313 2.281244 0.249079 0.701408 0.592914 0.483277
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.051563 0.175922 -0.016413 0.446642 0.038813 0.402324 0.000106 0.059152 0.712092 0.613150 0.482119
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.543463 -0.533665 -0.234136 -0.262812 -0.064102 -0.164191 0.353591 3.581989 0.727605 0.628805 0.495521
159 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
160 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
161 N13 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
162 N13 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
163 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
164 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
165 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
166 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.173003 0.526329 0.363203 0.805058 0.663153 0.914671 0.259775 0.550355 0.784342 0.714959 0.500795
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.016435 -0.328620 0.610020 0.067144 0.736433 0.249345 0.190092 0.091943 0.782809 0.712971 0.486594
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.200156 3.537598 0.507454 1.147315 0.675122 -0.683689 0.282893 0.858900 0.780015 0.663170 0.452029
170 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.803026 0.908278 0.730291 0.757554 0.631120 0.729926 0.693938 0.363603 0.772840 0.698574 0.467723
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.160903 -0.458761 1.024118 0.116751 0.292209 -0.204883 0.602758 0.835435 0.747997 0.671236 0.459177
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.155624 -0.449425 -0.200020 -0.298309 -0.650405 -0.400311 -1.011906 -0.052316 0.732704 0.650462 0.463554
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.742409 2.927408 2.144697 2.265936 1.275456 1.387698 -0.826027 -0.613021 0.688898 0.591167 0.461984
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.652532 0.153991 1.129880 0.481680 0.813989 0.467912 0.488109 0.267280 0.726508 0.626991 0.504018
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
181 N13 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
182 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
183 N13 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
184 N14 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
185 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
186 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
187 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
189 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 1.480611 2.149512 1.257766 1.687350 0.437470 0.817884 -1.077882 -0.804639 0.738823 0.655810 0.481019
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.228740 -0.546097 0.147717 -0.208564 0.577281 0.023448 0.266120 -0.199759 0.767441 0.685628 0.470143
191 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.315752 0.408703 0.472930 0.758716 0.603058 0.701268 1.191438 0.284757 0.757447 0.674326 0.464721
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.050813 3.184110 2.416258 2.490426 1.526996 1.615025 -0.684196 -0.498005 0.697110 0.611074 0.455219
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.939567 2.716497 2.334661 2.154544 1.445204 1.316305 -0.743754 -0.707833 0.685612 0.593527 0.455899
200 N18 RF_maintenance 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.997703 0.995529 0.306452
201 N18 RF_maintenance 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.995701 0.992585 0.362939
202 N18 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.994143 0.991417 0.465030
204 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.973927 2.287455 0.057151 -0.543388 0.191806 -0.329439 1.175813 0.131997 0.754043 0.678211 0.497438
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.798469 0.920556 6.913641 1.558684 0.376702 0.760991 3.140806 1.252168 0.705357 0.677223 0.486618
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.284550 0.847652 2.770272 1.989817 0.793498 0.684765 1.156485 1.555299 0.746680 0.678678 0.478529
207 N19 RF_maintenance 100.00% 100.00% 0.00% 0.00% 4.602387 8.696476 11.882623 4.961406 2.068925 2.120209 2.116741 2.994256 0.043053 0.362838 0.294305
208 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% 2.239277 4.537347 9.802169 20.045399 1.882681 1.771457 1.965984 44.653538 0.753358 0.032299 0.660212
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 3.328387 3.681827 18.638267 19.663196 1.880046 1.984837 13.362566 21.101116 0.030913 0.030861 0.000537
210 N20 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.682704 1.361481 -0.119386 0.296101 0.225950 0.502173 0.002594 0.199668 0.755506 0.666204 0.470684
211 N20 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.537462 4.865864 -0.228148 12.726003 -0.396928 2.137334 0.385662 3.078862 0.731389 0.036015 0.628048
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.839647 -1.130033 -0.753088 -1.221986 -0.844333 -0.833914 -0.003824 -0.844964 0.724828 0.635032 0.503500
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.263138 -1.103600 -0.261638 -1.121730 -0.868485 -1.313709 -0.371036 -0.913357 0.732296 0.651989 0.503787
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.067386 -0.335996 -0.864686 -0.390907 -1.077876 -1.023156 -0.381355 -1.081361 0.742884 0.660853 0.502332
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.111012 -1.165371 -0.584468 -0.635478 -0.455019 -0.509086 -0.086623 0.951511 0.745307 0.668617 0.494354
224 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.192180 3.030560 2.536528 2.394329 1.627982 1.522431 -0.569770 -0.545415 0.711572 0.635413 0.485525
225 N19 RF_maintenance 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.774942 0.794174 0.642881
226 N19 RF_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.695487 0.604442 0.572962
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 0.455519 -0.618416 1.043244 -0.712690 0.281616 -1.264698 5.293358 1.764968 0.740006 0.658092 0.474931
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.174142 -1.308848 -0.454984 -1.011220 -0.887486 -0.661516 0.536176 -0.327813 0.734754 0.647852 0.465440
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.128577 0.513696 0.067801 0.477841 -0.381094 -0.195536 -1.160562 -1.024004 0.722343 0.627582 0.477884
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.163833 -1.476107 0.527240 -1.327559 0.064738 -0.955512 0.166341 -0.829500 0.710301 0.622572 0.499316
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.165299 0.183839 0.147221 0.201617 -0.524495 -0.577806 -1.007687 -1.070323 0.722527 0.631614 0.503144
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.943110 -0.197734 -0.947204 -0.286165 -1.158524 -1.037348 0.314401 1.174821 0.733341 0.641928 0.505350
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.817436 -0.425450 -0.705476 -0.329622 -1.201340 -1.068828 -0.285616 -0.570254 0.739272 0.651427 0.501286
242 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.001528 -0.141741 -1.042114 -0.144187 -0.348063 -0.843360 -0.511754 -1.100164 0.670205 0.646241 0.425572
243 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.519118 -1.389387 -0.157114 -1.323183 0.141465 -1.107727 0.686054 -0.722066 0.674122 0.646942 0.432804
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.543761 -0.519497 -0.382935 -0.184028 -0.423288 -0.228654 0.276030 1.126587 0.735944 0.649725 0.483012
245 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.110064 -1.059563 -0.114034 -1.218312 -0.735142 -1.264395 -1.057481 -0.299355 0.727218 0.639544 0.482078
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% 1.786435 5.038377 6.291386 12.066437 0.422899 2.135544 2.786698 2.326956 0.661826 0.034131 0.567801
261 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.069368 -0.599246 -0.227703 -0.564910 -0.639408 -1.056864 -1.046109 -1.072843 0.712530 0.622308 0.484126
262 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.136383 2.432977 -0.800966 0.156853 -0.375132 0.287289 -0.366051 0.109502 0.712105 0.621618 0.491327
320 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.080319 -0.581785 -1.319968 -1.256451 -1.017518 -1.128371 -0.475237 -0.427290 0.555103 0.384787 0.386535
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.985782 1.361819 0.357353 0.628975 -0.242540 -0.075026 0.696262 -0.773065 0.537835 0.376433 0.382363
325 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.169081 -0.685757 0.202272 -0.780040 -0.498909 -1.259701 -0.969539 -0.917282 0.591761 0.448089 0.414134
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 4.533383 4.898147 12.125569 12.802050 2.071855 2.140902 2.366668 2.592509 0.037565 0.036325 0.002864
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.107086 -0.221618 0.714711 -0.830782 0.136780 -1.145291 0.744366 0.061215 0.505696 0.332560 0.343864
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [4, 5, 10, 15, 16, 17, 18, 27, 28, 29, 32, 34, 37, 40, 42, 47, 51, 54, 55, 59, 61, 78, 81, 82, 83, 86, 87, 92, 93, 104, 107, 109, 110, 111, 112, 117, 118, 121, 124, 125, 126, 127, 131, 137, 139, 140, 141, 142, 143, 144, 145, 146, 153, 156, 159, 160, 161, 162, 163, 164, 165, 166, 180, 181, 182, 183, 184, 185, 186, 187, 200, 201, 202, 205, 207, 208, 209, 211, 225, 226, 227, 240, 246, 329]

unflagged_ants: [3, 7, 8, 9, 19, 20, 21, 22, 30, 31, 35, 36, 38, 41, 43, 44, 45, 46, 48, 49, 50, 52, 53, 56, 57, 58, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 77, 79, 80, 84, 85, 88, 89, 90, 91, 94, 95, 96, 97, 101, 102, 103, 105, 106, 108, 113, 114, 115, 120, 122, 123, 128, 132, 133, 134, 135, 136, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 167, 168, 169, 170, 171, 172, 173, 179, 189, 190, 191, 192, 193, 204, 206, 210, 220, 221, 222, 223, 224, 228, 229, 237, 238, 239, 241, 242, 243, 244, 245, 261, 262, 320, 324, 325, 333]

golden_ants: [3, 7, 9, 19, 20, 21, 30, 31, 38, 41, 44, 45, 53, 56, 62, 65, 66, 67, 69, 70, 71, 72, 85, 88, 91, 101, 103, 105, 106, 122, 123, 128, 147, 148, 149, 150, 151, 152, 154, 157, 158, 167, 168, 169, 170, 171, 172, 173, 189, 190, 191, 192, 193, 320, 325]
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_2460110.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

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