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 = "2459960"
data_path = "/mnt/sn1/2459960"
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-15-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/2459960/zen.2459960.21319.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/2459960/zen.2459960.?????.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/2459960/zen.2459960.?????.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 2459960
Date 1-15-2023
LST Range 2.203 -- 12.154 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 70 / 196 (35.7%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 120 / 196 (61.2%)
Redcal Done? ❌
Never Flagged Antennas 76 / 196 (38.8%)
A Priori Good Antennas Flagged 54 / 93 total a priori good antennas:
3, 7, 9, 10, 15, 16, 29, 40, 41, 42, 54, 55,
56, 71, 72, 81, 86, 94, 101, 103, 106, 109,
111, 121, 122, 123, 128, 136, 143, 144, 146,
147, 148, 149, 151, 158, 161, 163, 164, 165,
168, 169, 170, 173, 182, 184, 185, 186, 187,
189, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 37 / 103 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 61, 62, 64, 74,
89, 90, 95, 115, 120, 125, 132, 135, 137, 139,
179, 205, 211, 220, 221, 222, 223, 229, 237,
238, 239, 245, 261, 324, 325, 329
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_2459960.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% 10.660652 12.934956 9.539315 -0.843890 10.195603 5.785427 2.336102 2.599637 0.035490 0.390951 0.290783
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.809027 0.106697 -0.313264 2.080423 8.599461 1.487575 3.612275 -0.017276 0.641209 0.652061 0.347233
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.177296 0.663537 0.331400 0.238399 0.525239 2.255539 0.683303 1.001733 0.643497 0.652199 0.329704
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.488300 0.332573 -1.181905 -0.367342 0.129246 1.673709 3.030281 2.793295 0.653844 0.662645 0.324824
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.174610 -1.078600 -0.664046 -0.012996 0.273619 1.060180 0.844897 0.704464 0.656312 0.660473 0.319102
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.404971 -0.688783 8.340769 -0.562330 8.100135 0.950129 4.573567 -0.227762 0.501278 0.659014 0.384924
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.046117 0.016192 -1.508027 -1.365072 0.095860 1.306840 0.019250 3.164069 0.650160 0.659063 0.326224
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 11.106413 17.498178 9.466662 -0.233722 10.241273 5.609284 2.232217 1.310557 0.033976 0.395148 0.283402
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 11.059698 -1.057724 10.064939 0.932596 10.243971 0.561180 2.423474 1.866326 0.034143 0.657754 0.492451
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.523658 1.288167 0.557195 0.357513 -0.179881 -0.275776 0.638356 0.862341 0.654054 0.659308 0.329325
18 N01 RF_maintenance 100.00% 100.00% 30.45% 0.00% 11.764337 20.949209 10.023244 -0.939616 10.405673 9.237510 2.380727 7.452642 0.030645 0.299462 0.217349
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.307529 -0.763060 -1.332878 -0.555629 1.336093 1.264745 -0.681039 0.239367 0.656257 0.670316 0.320207
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.496309 -1.362450 2.523907 -1.088463 0.152937 0.492514 2.479489 -0.899367 0.656505 0.668776 0.323378
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.649089 -0.374953 -0.649864 0.116200 0.407675 0.394292 -0.010106 0.632440 0.651106 0.653061 0.316261
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.967258 -0.449310 0.788296 0.578413 0.926293 0.212489 0.088728 -0.328172 0.630205 0.636606 0.323432
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.578829 12.833227 10.090683 10.533200 10.324054 11.981038 2.952457 3.040111 0.034928 0.041081 0.004260
28 N01 RF_maintenance 100.00% 0.00% 76.53% 0.00% 12.378325 27.465375 -1.023538 1.449750 7.601135 12.176179 1.933846 10.508946 0.419553 0.225228 0.251815
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 11.137962 13.337617 9.655918 10.107582 10.355203 11.940035 2.393094 2.572992 0.030243 0.038876 0.005953
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.632229 -0.066411 0.221311 0.597423 0.363224 -0.367380 0.700759 0.506889 0.661667 0.670358 0.320422
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.887026 0.354775 1.330710 0.821682 0.920174 -0.282723 1.205321 1.538451 0.674077 0.664947 0.315026
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.738445 22.372612 -0.180610 2.774088 -0.374861 5.646112 -0.046287 6.240428 0.666176 0.582298 0.311620
34 N06 not_connected 100.00% 100.00% 99.46% 0.00% 12.789799 14.707405 4.208379 4.527846 10.387952 11.960843 2.827361 3.006676 0.035961 0.054075 0.010314
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.383340 -0.193890 1.710258 -1.175767 -0.513277 -1.322403 -0.155360 -0.673298 0.640880 0.626012 0.320673
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 26.764911 26.920326 13.471309 13.413431 10.497581 11.849567 3.456728 3.758753 0.033561 0.035622 0.001573
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.921521 0.200129 -1.340251 0.821682 0.661242 1.221087 -1.317506 1.495690 0.651551 0.650116 0.345402
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.182261 0.736310 0.035502 0.519021 0.749622 0.361069 1.035342 0.721952 0.657613 0.659849 0.342311
40 N04 digital_ok 100.00% 99.84% 0.00% 0.00% 10.483648 0.112739 9.683264 0.421274 10.337701 0.167563 2.970651 0.612147 0.041593 0.655122 0.458209
41 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.782055 -0.051813 0.040725 0.516763 1.664967 0.086551 0.390180 4.884597 0.661901 0.665985 0.318767
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.759890 13.957444 10.410928 11.098796 10.035858 11.643876 2.326767 2.886933 0.026727 0.028982 0.001385
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.070470 -0.270114 -0.288690 0.692404 -0.741750 -0.272729 -0.274308 0.815929 0.674274 0.673310 0.317017
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.738092 -0.250027 -0.297890 -0.610851 -0.559737 -0.302145 -0.794947 -0.511224 0.677119 0.682573 0.320953
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.340159 0.366456 0.095803 0.697473 -0.292799 0.756717 0.153972 1.954976 0.671059 0.671005 0.314990
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.203859 0.379058 -1.055220 -0.934085 0.125374 -0.039551 -0.769257 -1.443255 0.671325 0.682705 0.332420
47 N06 not_connected 100.00% 100.00% 96.76% 0.00% 11.980358 14.318276 4.028728 4.143034 10.350602 11.908638 3.127674 3.130672 0.030867 0.065850 0.020976
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.007133 0.816113 0.730253 2.315330 -0.972786 1.430249 -0.731286 -0.075661 0.642128 0.651160 0.331605
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.032980 -0.313103 -1.233688 -0.133718 1.258261 -0.972852 -0.546838 1.132212 0.599145 0.626883 0.324062
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.904526 14.335332 0.165324 1.196143 1.806206 8.243911 4.183389 30.557985 0.632561 0.582007 0.322171
51 N03 dish_maintenance 100.00% 96.54% 0.00% 0.00% 21.667990 4.580065 12.182189 -1.144996 10.489760 4.895076 4.312278 0.506712 0.053985 0.548515 0.371957
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.747201 7.456356 -0.352755 0.489912 0.561190 0.851687 -0.083781 0.453510 0.660571 0.662333 0.333160
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.065881 3.026275 0.232914 0.413962 0.167835 0.573533 0.804159 1.375447 0.668560 0.670274 0.332705
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.800157 13.503286 10.106406 10.779667 10.335186 11.914678 3.086897 3.073917 0.026716 0.028894 0.001287
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.135663 13.672488 9.514592 10.057369 10.363308 11.935945 2.871509 3.623769 0.029120 0.035744 0.003375
56 N04 digital_ok 100.00% 0.00% 99.89% 0.00% -0.498906 14.447700 0.528737 10.926294 -0.438688 11.781148 0.540589 2.799979 0.670305 0.044848 0.509603
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 23.635980 4.262063 6.411563 0.555674 7.592656 1.663212 14.890640 1.357213 0.517229 0.671950 0.338265
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.420026 13.280774 9.997911 10.675289 10.265704 11.896981 2.885016 2.999123 0.036303 0.039288 0.000966
59 N05 RF_maintenance 100.00% 97.13% 0.00% 0.00% 11.370604 0.517273 9.547570 2.056704 10.092955 0.849546 2.817724 6.063141 0.061667 0.666415 0.475209
60 N05 RF_maintenance 100.00% 0.00% 80.21% 0.00% 0.607585 13.149665 -0.411374 10.698501 -0.366210 11.965717 0.075943 3.408101 0.668541 0.133484 0.459083
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.641665 0.307352 -0.934333 -1.543147 0.976617 -0.990152 -0.948349 -1.104044 0.619453 0.639207 0.316221
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.752824 0.146746 -0.793264 1.407869 -0.262950 -0.415900 -0.099906 0.067841 0.607636 0.647142 0.331788
63 N06 not_connected 100.00% 0.00% 99.08% 0.00% -0.181496 13.750951 0.002945 4.548223 0.265592 12.063568 -0.288176 3.688896 0.639005 0.053676 0.449189
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.136281 0.270984 -0.834937 -1.113188 -1.215606 -0.739809 0.747530 0.231628 0.623864 0.609059 0.308978
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.194082 1.584068 0.263837 1.085190 1.411509 2.928267 0.269975 1.091520 0.639362 0.647524 0.346329
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.202323 1.806602 -1.204489 -1.386693 3.164079 0.523939 -0.732814 -1.036298 0.656727 0.663517 0.342974
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.708398 -1.066801 -0.354189 1.380495 -0.095816 1.422963 -0.307328 2.316890 0.664543 0.664772 0.330671
68 N03 dish_maintenance 100.00% 0.00% 99.78% 0.00% 21.132393 27.951915 1.240982 14.148432 6.696874 11.940689 1.730842 5.378298 0.424502 0.037468 0.295763
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.564873 -0.974564 0.116432 0.876061 0.164589 1.561133 0.203729 1.023908 0.667900 0.673007 0.316612
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.220421 -0.607572 -0.067396 0.159494 0.241837 0.678440 0.335633 0.698191 0.672891 0.677705 0.314597
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 8.703042 -0.291176 0.700646 0.845535 0.667204 0.096355 0.969484 0.881203 0.685634 0.676341 0.311099
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 11.393544 14.505950 10.527548 11.116297 10.111087 11.683925 2.469229 2.823470 0.026519 0.028053 0.001400
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.618726 1.148203 -1.396724 -1.491380 1.228329 5.630431 -0.760124 -1.110658 0.684774 0.688069 0.317600
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.901126 0.685444 0.041528 -0.573490 1.135513 1.120922 -0.720348 1.171280 0.681896 0.679386 0.316777
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 65.737789 0.687306 0.759165 -0.022264 6.413719 -0.218187 6.362663 0.161021 0.380345 0.640516 0.381270
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 36.343380 -0.552256 -0.383989 1.436615 2.539967 -0.244553 0.195373 0.627750 0.480076 0.649969 0.328603
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.687203 14.108344 -1.508042 4.592418 -1.258634 11.818130 -0.692159 2.438056 0.623758 0.044580 0.439541
80 N11 not_connected 100.00% 0.00% 95.19% 0.00% -0.923907 15.004217 0.017051 4.484278 1.292809 11.854477 2.836484 2.876607 0.622292 0.075090 0.430207
81 N07 digital_ok 100.00% 0.00% 97.35% 0.00% -0.415572 14.161402 0.183032 9.273123 0.333174 11.538968 0.504769 3.364157 0.617088 0.047964 0.424124
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.584638 9.975407 0.430920 8.510660 0.087035 10.387733 0.618688 3.669513 0.637559 0.375923 0.375669
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.728975 -0.014585 0.251576 0.326362 -0.283636 0.017990 0.092264 0.488156 0.649197 0.658800 0.325936
84 N08 RF_maintenance 100.00% 100.00% 4.81% 0.00% 91.829377 157.769025 43.837989 71.674475 262.214633 3831.532366 472.539572 2350.339741 0.016258 0.494364 0.270491
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.511895 0.385854 1.845080 0.788493 -0.299780 -0.639467 1.443903 0.584770 0.656416 0.670859 0.318665
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 4.642170 -0.231758 0.384972 0.959313 4.979016 -0.381293 0.221336 8.346248 0.657250 0.660496 0.295317
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.198640 7.753901 -0.718442 -0.436930 -0.019920 0.779395 -0.332530 0.085943 0.682763 0.689688 0.310665
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.192040 0.548929 0.490560 0.619073 -0.281131 -0.216994 0.664092 0.280809 0.672129 0.680524 0.306054
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.206550 0.308721 -0.085556 0.788453 -0.470055 -0.730522 -0.569877 0.280787 0.676525 0.679144 0.307426
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.235586 -0.784124 0.827700 1.281068 -1.141334 -0.431474 0.595901 1.510906 0.667559 0.669590 0.308962
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.598814 -0.442288 -0.277581 -0.492068 -1.104661 -1.294507 0.029617 -0.623614 0.661745 0.674587 0.323279
92 N10 RF_maintenance 100.00% 0.00% 17.96% 0.00% 36.804512 44.208305 0.660323 1.453038 7.484663 6.214740 1.340123 3.290766 0.360658 0.312879 0.068935
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.844116 -0.036503 2.146350 -1.169621 1.109222 -0.461307 2.272242 -1.308871 0.657499 0.667467 0.327889
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.910899 13.682103 10.265808 10.559138 10.377239 11.895573 2.489302 2.679722 0.032940 0.029087 0.003356
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.869885 -1.279549 -0.979804 1.167214 -0.976833 -0.496126 -1.309313 -0.109365 0.631757 0.649836 0.337455
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.313267 14.542956 4.081311 4.712507 10.106561 11.706716 2.394128 2.749698 0.034046 0.041658 0.002935
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.088138 5.995916 -0.174323 1.299810 0.787199 4.322312 -0.016071 3.180180 0.589169 0.563155 0.296485
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.654456 9.381541 -0.489686 1.288570 -0.200888 0.596809 -0.467977 1.234345 0.670543 0.671534 0.318007
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.190125 1.040241 -0.933737 -1.521735 0.694535 0.604485 -0.484461 3.324287 0.675839 0.677756 0.316447
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.851164 5.580761 4.886018 -1.376714 0.997498 -0.211401 6.235681 1.706210 0.649038 0.683378 0.318237
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.844674 62.731323 -1.235320 7.383141 0.547133 3.057966 -0.883428 7.712628 0.684112 0.658115 0.310864
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.599648 -0.260322 -0.357013 0.075938 0.024039 -0.776168 -0.541663 -0.408067 0.678623 0.679709 0.305077
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 1.206735 0.437101 0.635265 -0.746689 5.277230 -0.347000 0.445978 -1.113272 0.666529 0.677105 0.305457
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 2.093418 0.312234 -0.138939 -0.468057 -0.047867 -0.561197 0.779043 -0.020229 0.672648 0.681661 0.313636
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.982867 43.527744 10.036257 0.994312 10.335474 6.982149 2.673312 2.208659 0.036162 0.352213 0.158718
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.600040 12.910179 9.502014 9.844719 10.365918 11.945328 2.242718 2.979602 0.027872 0.030780 0.001424
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 26.617192 26.607797 13.577919 13.917593 10.353209 11.773498 3.408560 3.746185 0.024995 0.030936 0.001377
111 N10 digital_ok 100.00% 0.00% 98.92% 0.00% 0.076264 13.119842 0.422558 10.530670 -0.608323 11.975151 1.740591 3.116930 0.665635 0.045016 0.435516
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -1.358249 -0.923166 0.248937 0.335299 -0.023107 1.425448 0.269037 0.167887 0.659720 0.660116 0.332602
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 13.054923 14.703864 3.842271 4.587347 10.174310 11.796592 2.642892 2.640563 0.036466 0.033451 0.003179
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 24.426010 14.348784 25.996051 13.628527 135.665910 15.983208 443.031672 66.653646 0.019118 0.028805 0.005113
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.974432 -0.966761 -0.809495 -0.330584 -0.158353 -1.313400 -0.812680 -0.875900 0.606173 0.622070 0.329637
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.891467 14.831821 10.195892 11.062210 10.196444 11.928564 2.931023 3.989673 0.028212 0.035654 0.002938
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.939730 0.960260 -0.316676 0.582454 -0.008128 0.046466 -0.073284 0.999185 0.640566 0.657596 0.328538
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.667861 1.522849 2.816442 -0.942137 0.405611 0.671871 3.119632 -0.818131 0.657939 0.678146 0.316689
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.534167 4.319375 -0.488114 5.857750 0.915225 3.202594 6.804970 12.939375 0.680940 0.658269 0.305415
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 10.079787 7.505940 0.068177 1.046655 0.509330 0.574630 -0.053686 0.750304 0.685031 0.683319 0.309061
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.777659 9.988305 0.852408 0.932813 -0.226305 -0.287335 0.602144 0.717155 0.684702 0.687547 0.313459
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.782388 -0.175873 -0.070435 0.654265 -0.960284 -0.715283 0.010106 0.445467 0.680745 0.680432 0.314768
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.726743 0.140172 -0.535788 0.662872 0.773106 0.383150 -0.615937 0.224248 0.671520 0.673454 0.316783
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.676545 7.591529 -1.497082 1.474782 1.694968 -0.602673 0.007354 1.142322 0.670922 0.666784 0.323636
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.037661 0.048264 0.684936 0.442287 0.757466 -0.367830 0.696166 0.259702 0.667357 0.673415 0.331557
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.455799 12.308032 9.615543 10.104636 10.168667 11.765423 2.172991 2.567838 0.032245 0.032808 0.001377
131 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.999109 12.617905 0.093775 4.337066 -0.263865 10.641137 -1.054902 0.781497 0.642923 0.366225 0.372243
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.454062 2.377839 -0.756390 -1.448972 0.075761 -0.857185 -0.738913 -1.264241 0.620742 0.618278 0.314574
133 N11 not_connected 100.00% 86.97% 0.00% 0.00% 12.660082 -0.227412 3.808612 -1.566019 10.338900 -1.345108 2.583176 -1.323863 0.108441 0.618132 0.409675
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.643606 -1.049830 -0.386370 -1.536935 2.591001 0.879414 1.645715 -1.092374 0.620401 0.638808 0.344423
136 N12 digital_ok 100.00% 96.59% 0.00% 0.00% 10.043073 0.205493 9.624300 -0.502248 10.371793 1.163400 2.734209 -0.621013 0.051979 0.639857 0.423212
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.388382 -0.742761 0.434445 -1.452943 1.205574 -0.871738 0.600535 -1.291577 0.628745 0.652059 0.331977
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.029821 -0.592841 1.887448 -0.753554 0.191434 -1.138145 -0.265795 -1.204187 0.655788 0.652711 0.314962
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.243106 -0.312732 -1.102673 0.075662 -0.483344 -1.028620 0.104986 0.610656 0.671782 0.681203 0.314978
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.602185 -0.809819 -0.121371 0.981910 1.743119 -1.436921 -0.048543 -0.511426 0.673961 0.682641 0.314137
142 N13 RF_maintenance 100.00% 0.00% 96.86% 0.00% 1.152421 13.141349 -0.388762 10.705200 3.949546 12.009439 13.535529 3.267682 0.672813 0.057219 0.506815
143 N14 digital_ok 100.00% 99.68% 99.73% 0.00% 10.131298 13.756609 2.091633 10.934971 10.233981 11.583316 0.817024 1.064375 0.072370 0.035203 0.047505
144 N14 digital_ok 100.00% 99.68% 99.68% 0.00% 9.679499 39.081857 -0.441992 0.829091 10.266327 12.352034 0.769609 1.218555 0.065628 0.069197 0.001775
145 N14 RF_maintenance 100.00% 99.68% 99.68% 0.00% 9.668894 30.910487 -0.168601 2.535607 10.254148 12.193101 0.786310 1.242235 0.067500 0.076979 0.001599
146 N14 digital_ok 100.00% 100.00% 99.68% 0.00% 12.369705 22.953839 3.895024 -0.492118 10.022936 12.107793 0.781938 1.129749 0.032148 0.068412 0.055931
147 N15 digital_ok 100.00% 98.11% 97.89% 0.00% nan nan inf inf nan nan nan nan 0.364542 0.366944 0.244311
148 N15 digital_ok 100.00% 98.11% 98.27% 0.00% 181.379226 181.789353 inf inf 3779.743056 3752.595145 1562.749448 1481.519614 0.381668 0.355483 0.281162
149 N15 digital_ok 100.00% 97.89% 98.00% 0.00% 201.668486 201.695566 inf inf 3542.188805 3369.218072 2187.592127 2099.432828 0.373508 0.397893 0.287056
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.090963 -0.864369 -0.994315 -1.283515 -1.303350 0.040964 -1.429752 -1.557500 0.665294 0.667019 0.338604
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 25.543511 1.388952 0.066066 0.439102 5.511368 0.113963 1.149377 -0.047451 0.523452 0.597209 0.288188
155 N12 RF_maintenance 100.00% 96.43% 0.00% 0.00% 10.775700 -0.312597 9.789498 -1.565436 10.406737 1.540610 2.851109 0.114056 0.057519 0.639792 0.433689
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 6.410818 12.901075 9.085384 10.417241 8.693482 11.954123 3.196883 3.110213 0.397977 0.043207 0.269753
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.288504 -0.255593 -0.030677 0.728607 -0.115606 0.189818 -0.177119 0.574781 0.640663 0.651857 0.325638
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.297327 -0.002806 0.067880 -0.504562 1.421875 1.765280 0.396106 6.080401 0.654933 0.667159 0.327130
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.323792 21.114546 -1.385304 -0.952675 -0.310339 6.831329 -1.220955 21.532861 0.627159 0.578449 0.299524
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.518034 -1.130782 -0.352235 -0.582638 -0.612323 0.749783 -0.203399 -0.203168 0.668356 0.673020 0.315666
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.230751 29.745215 -0.023034 -0.583532 -0.664038 2.048079 -0.151136 0.004656 0.670009 0.551040 0.291306
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.969008 -1.198144 -0.921779 -1.273723 1.687236 1.045552 -0.222362 -1.268506 0.675716 0.678568 0.320097
163 N14 digital_ok 100.00% 99.68% 99.68% 0.00% 14.106573 43.618636 0.469657 0.769463 10.335054 12.441951 0.889592 1.295079 0.065292 0.070541 0.001663
164 N14 digital_ok 100.00% 99.68% 99.68% 0.00% 12.728216 34.549176 0.790299 0.531698 10.300168 12.311972 0.815278 1.219054 0.067582 0.070986 0.001595
165 N14 digital_ok 100.00% 99.68% 99.68% 0.00% 33.129324 34.819758 -0.453791 -0.417099 10.179283 12.291971 0.455382 1.219360 0.069886 0.067999 0.001892
166 N14 RF_maintenance 100.00% 99.68% 99.68% 0.00% 10.150664 33.537744 -0.256602 0.552673 10.271724 12.287493 1.006392 1.363493 0.062856 0.067656 0.001585
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.328210 -1.181628 -1.347805 -0.228870 1.515438 0.014996 -0.439381 0.963675 0.670218 0.668073 0.335417
168 N15 digital_ok 100.00% 0.00% 1.08% 0.00% -1.125853 -1.422088 -0.292878 -1.017261 1.169632 7.758963 -0.280192 -0.765995 0.664157 0.643547 0.348136
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.372629 3.386772 -0.887273 -1.397909 -0.276171 6.141830 -0.840260 6.467093 0.668068 0.650356 0.334571
170 N15 digital_ok 100.00% 96.76% 0.00% 0.00% 11.834031 -0.966306 10.409185 -1.344384 10.144924 -0.587384 2.906760 -0.480283 0.052604 0.669532 0.459533
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.658037 2.813342 -1.298525 0.552533 -0.683617 2.561111 -0.662948 0.620985 0.607347 0.583940 0.307201
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 13.325960 14.337184 3.512171 4.156785 10.483326 11.979393 3.477449 4.379970 0.040985 0.048949 0.004321
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.006425 -0.389035 -0.426745 -0.083769 -0.580383 3.318229 -0.359953 1.038990 0.650324 0.658083 0.321718
180 N13 RF_maintenance 100.00% 0.00% 96.43% 0.00% -0.711180 13.955845 -1.579983 10.863266 1.630342 11.850396 2.392096 3.304153 0.667201 0.069787 0.500716
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.493606 -0.568455 0.012996 0.217594 -0.112279 -0.023202 -0.073738 1.571017 0.670700 0.669935 0.321625
182 N13 digital_ok 100.00% 0.00% 96.70% 0.00% 0.242328 12.880571 -0.752698 10.384823 -0.859301 11.999986 1.072291 3.035422 0.676546 0.060669 0.478445
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.538685 0.800348 -0.190669 0.605347 0.752022 0.014943 0.219018 0.285676 0.660301 0.661131 0.318675
184 N14 digital_ok 100.00% 99.68% 99.68% 0.00% 9.953461 32.913904 -0.135765 -0.145014 10.270198 12.285244 0.881490 1.232187 0.066067 0.066789 0.001517
185 N14 digital_ok 100.00% 99.68% 99.68% 0.00% 35.954213 33.417221 -0.404562 -0.646195 10.103294 12.254075 0.468916 1.154946 0.074564 0.070450 0.001842
186 N14 digital_ok 100.00% 99.68% 99.68% 0.00% 10.161706 28.119530 -0.381683 -0.711215 10.265719 12.171461 0.787836 1.122337 0.059290 0.066855 0.001586
187 N14 digital_ok 100.00% 99.68% 99.68% 0.00% 11.483018 21.697616 -0.515632 1.805239 10.305816 12.150590 0.835016 1.314003 0.063821 0.072930 0.001521
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 9.926298 12.720636 9.597555 10.519461 10.514179 12.027770 3.969520 3.467947 0.029042 0.035748 0.001893
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.368938 -1.249121 -0.737861 0.765757 -0.801735 -0.677110 -0.744626 -0.598373 0.661083 0.671166 0.344464
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.892617 -0.021699 1.339565 -0.385752 0.497646 0.247142 4.804134 0.496841 0.649702 0.659117 0.335250
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.561730 7.266798 5.635247 5.530995 7.398859 8.829731 0.810109 1.101409 0.605750 0.610372 0.339661
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 7.241600 0.180450 5.730159 1.640541 7.600189 0.806345 0.897686 0.327409 0.590913 0.623539 0.361008
200 N18 RF_maintenance 100.00% 100.00% 49.70% 0.00% 12.885613 39.836022 3.951780 0.878586 10.487356 7.466332 2.794770 1.225216 0.043063 0.284699 0.174656
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.359000 5.203859 3.512588 4.880823 1.676243 7.522919 0.829474 1.273390 0.651272 0.637311 0.335826
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.279268 1.913795 2.020954 -1.182199 0.901365 -0.731270 -0.093552 7.479295 0.655184 0.631520 0.331183
205 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.358600 2.617378 0.861131 -1.140892 -0.708680 -0.370958 -0.566717 0.085874 0.639572 0.621699 0.324583
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.353700 1.172154 3.245468 -0.600393 10.293293 -0.979633 1.160499 0.832857 0.644709 0.635899 0.332062
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.838261 5.371517 1.707491 -1.301646 0.820042 1.684463 -0.036348 -0.270342 0.628180 0.604056 0.309837
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 8.099604 13.683138 9.249432 10.455793 10.003386 10.055239 6.103771 23.820172 0.035374 0.040566 0.000651
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 7.239922 8.548946 9.118434 9.638372 9.473632 11.726013 5.066381 9.564033 0.043436 0.046110 0.003152
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 13.915687 12.151771 -1.061670 -1.057462 -1.123102 -0.890498 -1.147210 -0.558650 0.652255 0.649855 0.329999
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.984591 -1.156537 -1.192160 0.246322 -1.162117 -0.955983 -0.647442 -0.460514 0.604813 0.624911 0.329418
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.344165 -1.279270 0.660848 0.064109 -0.627568 1.209051 1.135898 -1.076421 0.642316 0.641896 0.327087
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.187111 -0.187128 -1.423545 -0.464470 -0.482884 -0.718832 1.967553 -1.180537 0.621154 0.642981 0.331831
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.733421 -0.232567 -0.190542 0.371752 0.100822 2.806120 -0.721763 -1.564605 0.631345 0.649228 0.333484
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.886769 1.124170 -1.192256 -0.958565 -0.186089 -0.134704 -0.520148 0.875331 0.618745 0.620808 0.316097
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.486055 7.027574 5.961221 5.613768 7.914732 8.999142 0.997741 1.174219 0.614373 0.626712 0.339486
225 N19 RF_ok 100.00% 0.00% 76.74% 0.00% 1.156262 13.503040 1.025018 4.338896 -0.552377 11.797710 -0.582835 2.263945 0.642485 0.207906 0.458278
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.096220 20.524143 0.320519 1.537645 -1.234051 4.519604 -0.802405 0.249907 0.638137 0.572843 0.323243
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 2.198139 0.391819 -1.487454 0.353966 0.455478 -0.838731 4.097886 -0.634824 0.604584 0.632616 0.323631
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.647597 16.947730 -0.991257 -0.111945 1.654586 6.920766 16.483055 22.908697 0.566860 0.559099 0.291296
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.482958 -0.171076 1.877011 1.755837 0.008128 0.102444 0.052131 -0.405212 0.625870 0.634061 0.341591
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.227078 -0.024871 -0.087354 -1.460744 0.578859 -1.387620 -0.769100 -1.767865 0.579368 0.622072 0.336863
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.096869 -0.006425 1.161508 0.456042 -0.287191 -0.268639 -0.704755 -1.244318 0.636382 0.638932 0.338538
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.214923 -1.715812 0.039672 0.301141 -0.995899 -0.319232 0.020033 -0.084885 0.632515 0.642396 0.337190
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 35.212560 59.195044 -0.502753 1.019211 3.133593 5.644352 5.605543 5.160649 0.487079 0.424894 0.198555
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.908990 4.333669 -0.762820 0.419976 -0.362751 1.285663 0.850236 6.761517 0.622189 0.596179 0.328580
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 41.446300 1.221892 0.034712 1.626749 7.261430 0.508155 3.854681 0.282364 0.468462 0.644844 0.353935
243 N19 RF_ok 100.00% 23.74% 0.00% 0.00% 66.604098 2.570957 1.098695 -1.420153 7.329006 -0.764963 0.541308 -0.857910 0.311150 0.620537 0.423782
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.338650 2.176573 1.330004 -0.973772 4.366560 1.086376 1.083473 1.511722 0.516210 0.601932 0.327297
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.542522 2.935599 -0.238902 -1.433976 -1.229982 -0.759928 -1.027867 -1.210845 0.616710 0.611285 0.327076
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.061604 8.324986 -1.071372 -0.005236 6.213454 6.130225 1.134631 0.610267 0.369356 0.366729 0.130070
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.101507 1.403259 0.856760 -0.272172 0.128440 -0.763591 -0.625396 1.662033 0.614580 0.612463 0.334380
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.936236 8.969982 9.412733 9.489564 10.359373 11.356942 8.841982 8.056436 0.032595 0.030920 0.003921
320 N03 dish_maintenance 100.00% 0.00% 99.78% 0.00% 6.591706 13.737070 2.753805 6.797241 1.489362 12.010732 10.700512 3.383718 0.472922 0.052972 0.340394
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.313406 2.378373 1.452727 1.930769 0.915970 1.270493 0.091451 0.111831 0.517012 0.530522 0.338687
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.377417 -1.339178 1.568896 -1.083505 0.927033 0.940985 -0.284631 -0.675684 0.553542 0.547535 0.345431
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.280829 -0.876550 -1.389968 -0.808543 1.172397 0.412786 0.943626 -0.630531 0.507213 0.538220 0.334001
333 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.849769 6.517839 -0.648159 -1.362432 0.920326 0.826831 0.000977 -0.583666 0.490727 0.511639 0.312144
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, 27, 28, 29, 32, 34, 36, 40, 41, 42, 47, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 73, 77, 78, 79, 80, 81, 82, 84, 86, 87, 92, 94, 96, 97, 101, 102, 103, 104, 106, 108, 109, 110, 111, 113, 114, 117, 121, 122, 123, 126, 128, 131, 133, 136, 142, 143, 144, 145, 146, 147, 148, 149, 151, 155, 156, 158, 159, 161, 163, 164, 165, 166, 168, 169, 170, 173, 180, 182, 184, 185, 186, 187, 189, 191, 192, 193, 200, 201, 202, 206, 207, 208, 209, 210, 224, 225, 226, 227, 228, 240, 241, 242, 243, 244, 246, 262, 320, 333]

unflagged_ants: [5, 8, 17, 19, 20, 21, 22, 30, 31, 35, 37, 38, 43, 44, 45, 46, 48, 49, 53, 61, 62, 64, 65, 66, 67, 69, 70, 74, 83, 85, 88, 89, 90, 91, 93, 95, 105, 107, 112, 115, 118, 120, 124, 125, 127, 132, 135, 137, 139, 140, 141, 150, 157, 160, 162, 167, 171, 179, 181, 183, 190, 205, 211, 220, 221, 222, 223, 229, 237, 238, 239, 245, 261, 324, 325, 329]

golden_ants: [5, 17, 19, 20, 21, 30, 31, 37, 38, 44, 45, 53, 65, 66, 67, 69, 70, 83, 85, 88, 91, 93, 105, 107, 112, 118, 124, 127, 140, 141, 150, 157, 160, 162, 167, 171, 181, 183, 190]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459960.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 [ ]: