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 = "2459936"
data_path = "/mnt/sn1/2459936"
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: 12-22-2022
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/2459936/zen.2459936.26623.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 1612 ant_metrics files matching glob /mnt/sn1/2459936/zen.2459936.?????.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/2459936/zen.2459936.?????.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 2459936
Date 12-22-2022
LST Range 1.903 -- 10.578 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1612
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 94
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 201 (0.0%)
Antennas in Commanded State (observed) 0 / 201 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 18
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 69 / 201 (34.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 114 / 201 (56.7%)
Redcal Done? ❌
Never Flagged Antennas 87 / 201 (43.3%)
A Priori Good Antennas Flagged 43 / 94 total a priori good antennas:
3, 9, 15, 16, 17, 20, 21, 29, 40, 42, 54, 55,
56, 71, 72, 81, 86, 94, 100, 101, 103, 109,
111, 121, 122, 123, 128, 129, 130, 136, 143,
146, 147, 148, 149, 161, 164, 165, 170, 182,
183, 185, 189
A Priori Bad Antennas Not Flagged 36 / 107 total a priori bad antennas:
8, 22, 35, 43, 46, 61, 64, 73, 74, 77, 79,
89, 90, 95, 102, 115, 120, 125, 137, 139, 205,
211, 220, 221, 222, 227, 229, 237, 238, 239,
241, 245, 261, 324, 325, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459936.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% 9.412118 13.442218 11.583188 0.678996 8.664990 2.787624 6.768801 3.783532 0.034287 0.529162 0.433961
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.059198 -0.120662 0.627911 2.033531 9.755186 -0.010152 -0.365748 1.063671 0.776154 0.769006 0.229516
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.418517 0.228277 -0.069693 -0.169846 -0.261452 2.148155 -0.170939 -0.164671 0.782665 0.776992 0.215959
7 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.042358 -1.024601 1.157990 3.704381 -0.527632 0.696865 1.108312 3.764883 0.765447 0.756957 0.217539
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.106482 -1.366783 -0.931125 -0.446472 -0.493523 0.670070 -0.498614 0.244300 0.763453 0.757987 0.223107
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.338618 -0.902756 9.442298 -0.067915 7.986444 -0.274362 1.091944 1.393477 0.651028 0.752190 0.288798
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.452139 -0.886847 -0.258615 -1.152462 -0.018998 0.725501 0.867206 1.650849 0.741987 0.743563 0.232753
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.558581 15.701018 10.863164 1.907778 8.692696 3.183910 6.776075 3.579342 0.032543 0.545886 0.436883
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.617888 -0.456621 11.539868 0.531376 8.670107 1.982971 6.757404 0.327677 0.032808 0.786361 0.646137
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.916436 1.789812 0.512372 0.131427 2.243586 4.575501 0.642228 1.750651 0.782536 0.780000 0.212982
18 N01 RF_maintenance 100.00% 100.00% 18.42% 0.00% 10.315475 14.708293 11.506656 -0.222163 8.881700 7.608285 6.748287 5.593465 0.030357 0.390174 0.313541
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 2.207385 -1.347404 -0.679019 3.750336 1.667296 2.100479 -0.551451 3.719824 0.771877 0.762790 0.214561
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.848880 -0.739433 4.461897 -1.021733 1.051715 0.809436 4.104647 -2.067586 0.759395 0.763926 0.221393
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.221899 -0.413293 -0.107048 4.942866 0.350017 1.175282 1.328299 5.693934 0.750828 0.736132 0.224893
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.079120 -0.439722 0.291768 0.311738 0.692029 1.187240 -0.158095 -0.827648 0.724762 0.730090 0.235425
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.027050 10.371080 11.582559 11.787127 8.840169 9.490267 6.826111 6.415916 0.035793 0.039451 0.005122
28 N01 RF_maintenance 100.00% 0.00% 39.45% 0.00% 12.720785 21.696015 -1.444297 0.686140 4.174983 7.859980 4.364263 6.189478 0.550973 0.297639 0.348168
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 9.637300 10.934564 11.089608 11.307397 8.819545 9.470413 6.774286 6.335622 0.030393 0.036170 0.005998
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.170639 -0.116572 -0.009842 0.259728 3.788574 -0.083464 1.295754 -0.178527 0.784030 0.786420 0.205906
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.076896 -1.834774 1.192404 0.770746 1.200594 0.997248 1.504051 0.750115 0.788668 0.785497 0.206216
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.231930 13.708898 0.256106 2.293050 11.526618 6.523950 0.863552 12.209055 0.737611 0.736364 0.168378
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.149751 12.289235 4.863571 4.942712 8.799572 9.462051 6.799832 6.370672 0.035563 0.042227 0.004517
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.381562 -0.118560 0.095143 -2.112983 -0.394138 0.231897 0.090834 1.171521 0.729959 0.735741 0.230911
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.966530 7.662859 0.301806 0.150124 0.406827 1.905605 1.031098 0.401913 0.797099 0.800527 0.192239
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.624188 0.134799 -2.030819 0.454536 1.654932 0.589223 -1.702552 0.623282 0.802287 0.805364 0.193395
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.292639 0.059533 -0.035703 0.269872 -0.086730 0.318755 0.663914 0.368167 0.805286 0.807328 0.190401
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 8.932381 -0.508953 11.131588 0.135734 8.795773 -0.167128 6.900479 -0.552253 0.038619 0.798200 0.610251
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.678161 -0.306049 -0.224914 -0.365925 2.452863 -0.069356 -0.108629 -0.494796 0.800618 0.800432 0.194796
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.259322 11.552617 11.912825 12.409692 8.476700 9.163412 6.780556 6.376368 0.032198 0.029897 0.002401
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.025195 -0.353375 -0.643413 0.315157 -0.793826 0.802707 -0.675414 -0.015361 0.798447 0.796095 0.199018
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.667243 -0.038506 -1.658526 -0.354185 -1.001593 0.261969 -2.176036 -0.302579 0.789652 0.797531 0.206848
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.247715 0.894484 -0.009977 0.309378 -0.662302 1.450766 -0.146582 0.342231 0.784799 0.786401 0.203901
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.143033 1.045114 1.500237 2.336403 0.396484 0.052307 1.572313 1.358077 0.774367 0.769910 0.226459
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.338102 11.883244 4.661616 4.499254 8.717507 9.348124 6.779510 6.323395 0.031240 0.053487 0.015039
48 N06 not_connected 100.00% 100.00% 100.00% 0.00% 193.828446 193.875199 inf inf 3740.480006 3780.872480 902.697246 916.120651 nan nan nan
49 N06 not_connected 100.00% 100.00% 100.00% 0.00% 181.210336 179.459333 inf inf 4574.327730 4372.510001 1056.831570 995.115999 nan nan nan
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.008242 5.900390 0.041056 0.791868 3.783227 6.953136 4.595198 2.690758 0.779761 0.781027 0.185820
51 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 20.234115 3.979140 14.685000 -0.841161 9.033597 8.467943 6.936505 0.471198 0.044079 0.718560 0.571924
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.157918 7.049678 -0.615976 0.270399 1.258496 0.653225 -0.055282 -0.081227 0.804285 0.807189 0.188762
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.393781 2.429140 -0.086106 0.016453 1.459425 2.022981 0.502493 0.213879 0.810963 0.811828 0.189395
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.272798 11.140959 11.597347 12.071232 8.719139 9.376512 6.808622 6.338160 0.031633 0.030153 0.001272
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.854447 11.829983 11.606167 11.940895 8.782396 9.428848 6.805407 6.425960 0.028399 0.032036 0.003256
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.073723 11.959493 0.300199 12.226308 0.589362 9.282014 0.387851 6.295337 0.802902 0.039012 0.629478
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.715075 -0.191876 10.184863 0.239884 6.309613 0.078112 4.710322 0.279581 0.557922 0.806096 0.322502
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.976279 10.846811 11.470728 11.946464 8.665554 9.376456 6.848485 6.382807 0.036560 0.036256 0.001542
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.127042 -0.187085 11.556405 1.478756 8.493243 2.706774 6.815368 1.871155 0.062055 0.797311 0.597230
60 N05 RF_maintenance 100.00% 0.00% 53.29% 0.00% 0.632673 10.684234 -0.639260 11.973248 -0.775017 9.458835 -0.308184 6.354827 0.783551 0.178752 0.544465
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.925013 1.266819 -1.107533 -2.070586 1.947233 -1.128218 -1.570653 -1.922665 0.740795 0.759242 0.215334
62 N06 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 0.383189 11.292697 -0.640711 4.979894 0.633851 9.555136 -1.145789 6.489802 0.737477 0.046041 0.514788
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.975095 0.719333 -1.118417 -1.688221 -0.239629 0.597768 -0.406145 0.902224 0.729713 0.739633 0.221442
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.724666 0.745806 0.253406 0.904974 -0.140724 0.446481 0.956331 1.178220 0.789205 0.801227 0.197947
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.235706 0.770845 3.069467 1.978718 2.753445 -0.263827 3.009173 2.087876 0.796350 0.807535 0.194837
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.410648 -0.635078 2.374710 2.008478 0.004246 0.646522 2.867289 2.677583 0.806578 0.811794 0.185798
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 20.401181 23.238414 1.359419 15.804540 2.817870 9.558282 4.093534 6.591602 0.590840 0.031233 0.448687
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.096132 -0.895360 0.067554 0.554416 0.251972 1.136655 0.226613 0.195792 0.807992 0.811098 0.182425
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.484644 -0.358145 -0.386737 -0.312397 0.525579 1.385827 -0.822285 -0.355656 0.807302 0.812416 0.188278
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 8.280024 -0.175228 0.680834 0.691956 0.110132 -0.317582 1.224384 0.453945 0.813794 0.812965 0.185019
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 2.508797 11.961125 0.680752 12.428068 0.289354 9.222480 1.351049 6.414494 0.807430 0.036351 0.623773
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.097912 0.960870 -1.749844 1.151367 1.355985 -0.126001 -2.121947 1.011391 0.806328 0.809113 0.196199
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.028191 -0.094787 -0.487494 -1.081665 1.481837 1.963653 -1.621258 -0.939035 0.796982 0.805488 0.199359
77 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.937423 -0.457237 0.101274 -0.330960 -0.719332 -1.041101 -0.532824 -1.340923 0.757892 0.764349 0.220463
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 23.551264 -0.769880 -0.634809 1.236681 2.190554 -0.970056 2.245000 -0.126076 0.615599 0.761948 0.240187
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.000852 -0.167495 -2.036726 -0.108342 -0.487291 -1.502201 -1.442927 -2.006874 0.736113 0.759421 0.226707
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.026599 12.424186 3.276442 4.854232 2.336348 9.356486 2.674468 6.349844 0.720834 0.049614 0.502536
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.366353 11.564326 -0.065083 10.301954 -0.430427 9.033641 0.645363 6.503019 0.771880 0.038828 0.552776
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.710647 -0.190251 0.197493 5.242733 -0.718852 66.982255 -0.135984 0.282638 0.785884 0.698517 0.266521
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.393161 0.054358 0.078281 0.021512 -0.741215 -1.009860 0.013680 0.047456 0.796515 0.804428 0.187353
84 N08 RF_maintenance 100.00% 10.17% 100.00% 0.00% 17.785287 20.832231 14.874596 15.242077 7.861071 9.410497 4.535812 6.393146 0.498866 0.036784 0.303694
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.472189 0.170694 -0.099153 0.417048 -0.936124 -0.328251 -0.228395 0.043344 0.809855 0.811140 0.181623
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.831180 1.154171 0.520996 0.626603 6.305669 -0.664928 -0.147471 1.035701 0.803242 0.797458 0.173515
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.861918 8.575678 -0.893280 -0.455237 -0.057821 0.591323 -0.615329 -0.496282 0.815428 0.817351 0.176410
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.097067 0.746455 0.293107 0.395592 -0.622370 0.213762 -0.015743 -0.106225 0.807953 0.813305 0.177002
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.305012 0.276255 -0.173966 0.555823 0.167932 -0.651294 -0.206508 -0.108092 0.812747 0.811489 0.181518
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.006041 -0.521337 1.164703 1.069153 -0.476256 0.723817 0.875789 0.808512 0.804110 0.807472 0.182077
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.070190 -0.092108 0.307156 -0.120073 -0.705114 -0.946067 0.151481 -0.267924 0.795112 0.804209 0.192622
92 N10 RF_maintenance 100.00% 0.00% 0.06% 0.00% 30.244724 33.609964 0.382410 0.768504 3.718198 3.349831 4.454752 4.456736 0.492656 0.433111 0.088436
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.054446 -0.146375 2.215931 0.091801 1.132037 -0.062023 2.224049 0.071471 0.778920 0.791874 0.205031
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.333134 11.342628 11.760780 11.813136 8.734500 9.399216 6.751136 6.314373 0.031485 0.026587 0.002494
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.340409 -0.497542 -1.453719 0.952682 -0.418439 -0.615627 -1.784152 -0.285406 0.745174 0.766608 0.227933
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.674427 11.983070 4.692752 5.106180 8.547937 9.221043 6.799875 6.365882 0.034758 0.039088 0.002505
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.770389 6.098061 -0.167426 2.523636 3.717639 8.458810 1.214997 1.536545 0.722042 0.700531 0.209105
98 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.559563 -0.130430 -0.121850 -0.413843 -0.160868 -0.322968 1.156762 -0.040534 0.759067 0.772254 0.201275
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 2.177723 -0.215556 1.075167 -0.216921 -0.944905 2.324976 0.431746 -0.408143 0.755168 0.784378 0.208194
100 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 209.014251 209.896853 inf inf 4238.678911 3993.762118 862.979361 838.203740 nan nan nan
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.333257 8.957379 -0.610903 1.043982 -0.325673 1.010141 -0.071074 0.892878 0.799355 0.804960 0.190980
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.810980 0.809407 -1.487592 2.325584 1.597865 -0.412008 -2.073952 1.732644 0.804363 0.804525 0.185581
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.504026 5.098731 -1.674478 -0.640227 8.898298 1.545528 -0.627422 -0.413759 0.809590 0.812393 0.180804
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.465626 44.968851 7.755826 7.021371 6.122633 2.339145 3.512715 4.526105 0.786763 0.808967 0.180881
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.181962 0.138582 0.159156 0.511552 0.013940 -0.438029 0.316229 0.114793 0.817790 0.815248 0.175028
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.670821 0.997886 0.807820 0.669963 0.738362 0.813390 0.500255 -0.013680 0.812597 0.812820 0.173730
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.852886 0.146194 -1.167734 -1.498218 0.846220 0.563691 -0.312033 -1.271478 0.812667 0.813346 0.177562
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.381272 31.989861 11.515683 0.567147 8.773828 3.990849 6.803129 3.799011 0.036803 0.506693 0.237443
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.319842 10.819668 11.552567 11.643430 8.878832 9.505778 6.789856 6.388285 0.026168 0.027173 0.001271
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 22.884883 22.139218 15.404374 15.517443 8.765047 9.345998 6.543281 6.182744 0.025007 0.027685 0.001248
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.124185 10.658860 0.283424 11.757334 -0.499359 9.523838 1.023753 6.411780 0.782204 0.039100 0.468660
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -1.277207 -0.922217 0.038162 -0.093162 -0.046883 1.837098 0.301182 0.189228 0.772008 0.790637 0.212815
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.510548 12.173125 4.416882 4.966329 8.605611 9.290238 6.741747 6.330574 0.036207 0.031029 0.002823
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.458504 7.030217 36.213421 14.176431 136.939329 12.229825 249.628091 18.593933 0.016211 0.026388 0.004643
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.822071 0.390765 1.438160 2.644342 0.799385 1.156442 0.041596 0.533944 0.735316 0.756645 0.235971
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.882888 0.123279 -1.103316 -0.364104 -0.582452 -0.219609 0.786331 0.977741 0.744593 0.762894 0.214060
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.399848 12.399455 11.676958 12.377215 8.606856 9.443972 6.775179 6.414148 0.027403 0.032602 0.003213
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.170634 0.993583 -0.423399 0.308163 0.511555 -0.661706 0.115570 0.123933 0.775186 0.787890 0.203328
119 N07 RF_maintenance 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.507613 0.576541 2.942287 2.616066 0.692958 0.670551 2.978217 1.939702 0.792007 0.783589 0.195256
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.892553 4.963578 -1.732649 6.799299 1.675147 6.695100 -0.365334 6.542259 0.806721 0.797001 0.180434
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.583513 6.630662 0.244288 0.756241 1.684784 0.985033 0.813599 0.843133 0.815758 0.814338 0.173105
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.841712 8.831412 0.743574 0.818254 -0.399048 -0.610347 1.406380 1.019631 0.822034 0.819725 0.173846
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.720036 -0.040022 -0.334462 0.332254 -0.880328 -0.381199 0.249300 0.238990 0.821335 0.818746 0.175034
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.172984 -0.442841 -0.832137 0.433802 -0.447731 -0.043621 -0.561950 0.107579 0.816188 0.817483 0.174540
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.980993 -0.097599 -1.610811 0.773108 8.996599 -0.053802 3.326147 0.871606 0.770778 0.810820 0.183713
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.381827 0.088516 0.461516 0.131648 1.757296 1.015083 0.531045 0.155359 0.803093 0.812893 0.191636
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 8.719822 9.947456 11.027756 11.300569 8.570765 9.233476 6.755964 6.349817 0.031773 0.027255 0.002371
129 N10 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
130 N10 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
131 N11 not_connected 100.00% 0.00% 0.12% 0.00% 0.067299 10.920625 -0.375214 4.830179 -0.862735 9.020506 -1.364543 3.923712 0.758709 0.543372 0.293678
132 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.064085 0.688793 -1.443676 -1.997482 14.370134 -0.941152 -1.878940 -2.005849 0.747986 0.772931 0.220220
133 N11 not_connected 100.00% 100.00% 0.00% 0.00% 10.998698 0.080664 4.402033 -2.076179 8.741706 -0.603137 6.757446 -1.507069 0.062437 0.766463 0.512336
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.777572 -0.565051 0.116789 -2.046790 5.762372 1.797416 3.787171 -0.829708 0.738400 0.758198 0.234693
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 8.502751 0.242181 11.064357 0.094965 8.836453 14.908569 6.826669 0.464479 0.042207 0.765738 0.470113
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.054223 -0.678549 0.096324 -2.119854 1.925200 -1.201665 0.673568 -1.828808 0.759351 0.774473 0.213599
138 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 193.847903 193.605796 inf inf 4118.388558 4179.802715 892.783790 911.150566 nan nan nan
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.069385 -0.314228 1.505052 -1.167118 -0.107498 -1.127831 0.714804 -1.869255 0.771068 0.779080 0.209266
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.538286 -0.225969 -1.481853 -0.306178 -0.838716 -0.873239 -0.562741 -1.516083 0.797244 0.798795 0.193332
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.294532 -1.089628 -0.522701 0.720814 1.996212 -0.948971 0.239576 -0.495693 0.806910 0.799232 0.188622
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.791408 10.582408 -0.854441 11.977262 4.357182 9.508598 2.608187 6.427072 0.810889 0.054366 0.552594
143 N14 digital_ok 100.00% 0.00% 100.00% 0.00% 0.982259 11.237187 7.375491 11.994177 2.362654 9.140720 2.685160 6.348573 0.785163 0.037536 0.568591
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.589861 0.032713 -0.581648 0.658791 -0.179852 0.313395 0.077377 0.943408 0.819986 0.819387 0.176827
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.091023 0.480462 -0.448454 4.464345 -0.178128 10.785836 0.396830 4.097092 0.817355 0.804542 0.177255
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 10.694216 -0.774041 4.411939 -0.320741 8.711926 0.018216 6.765252 -1.901887 0.039793 0.805689 0.601353
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 163.297108 163.280913 inf inf 4335.817386 4369.893585 826.283523 821.633294 nan nan nan
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
149 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 193.406983 193.150902 inf inf 4593.093968 4792.010370 992.762705 1098.490212 nan nan nan
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.397146 -0.494792 1.533908 0.783319 -0.262811 -0.585414 0.648104 -0.594022 0.772772 0.791504 0.220740
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.031686 -0.939655 11.167709 -2.105349 8.859623 0.071833 6.789508 0.190513 0.037510 0.745219 0.465989
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.371595 10.433769 9.414789 11.656855 7.505203 9.488505 1.461077 6.429293 0.630876 0.039358 0.405258
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.303920 -0.644987 -0.282574 0.351118 -0.675511 0.091105 1.193210 0.893446 0.752057 0.765368 0.221425
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -1.116284 -0.441723 -0.373823 -1.538393 1.941933 2.350595 0.772944 -0.580708 0.768587 0.775772 0.216742
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.685913 18.316855 -2.076886 -1.254949 -0.515029 4.092884 -1.608795 8.832568 0.754331 0.708813 0.208246
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.104385 -1.077285 -0.517684 -1.178409 -0.823818 2.481097 0.171957 -0.859992 0.789913 0.791426 0.198139
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.340651 21.538859 -0.227976 -1.263830 -0.072812 1.333876 0.377955 0.815067 0.798090 0.720677 0.175908
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.791392 -0.481162 2.331769 1.506356 -0.254011 -0.432181 1.652869 0.333613 0.789921 0.793927 0.204699
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.510959 0.997690 -0.412206 0.171280 -0.528574 0.628578 -0.016946 0.316757 0.815696 0.812766 0.183585
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -1.346427 -0.077300 1.043998 -0.371050 6.762050 2.213017 1.499944 -0.049994 0.814246 0.812938 0.178149
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 21.633823 0.394682 2.014130 0.220402 8.186155 -0.351524 2.377696 1.008693 0.724979 0.817059 0.186120
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.009317 0.952266 0.524424 1.974993 -0.356268 13.625817 0.915212 2.587860 0.813265 0.810271 0.183353
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.259064 -0.940149 -1.710978 3.905612 2.648950 1.980261 -1.780096 3.526942 0.809821 0.808864 0.186420
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.400464 -0.966067 0.122872 -0.862403 1.006353 0.160953 0.923005 -0.486055 0.805618 0.811971 0.192011
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.241563 -0.867698 -1.250570 -1.923610 0.256987 1.107108 -0.458120 -2.130293 0.800405 0.807218 0.196688
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.165854 -0.772309 11.830219 -1.766874 8.563779 0.281002 6.779223 -0.904965 0.040690 0.807016 0.617938
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.673260 -0.451985 1.907240 4.402518 0.089071 29.563941 2.588279 2.499699 0.761157 0.755856 0.212364
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.019614 11.420592 -0.192893 12.142922 0.959170 9.386199 1.000885 6.402614 0.774337 0.057391 0.548478
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.051336 -0.837201 -0.288684 -0.080441 -0.152908 -0.282879 0.402358 0.246083 0.789515 0.788518 0.201788
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.209740 10.450338 -0.935751 11.625313 -0.341518 9.552834 0.372412 6.396090 0.802447 0.052574 0.524014
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.216384 -0.260256 2.295398 6.154772 -0.271043 3.143337 1.985777 3.643408 0.793529 0.775058 0.183398
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.953578 -0.996265 0.768193 3.650359 -0.489642 1.281478 2.111595 3.867384 0.815268 0.812033 0.174596
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 15.181994 -0.711152 8.811586 4.916939 11.417445 1.459276 2.624797 3.868978 0.655064 0.794440 0.224332
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.683531 -1.391326 -2.093697 -0.757790 2.602915 1.219219 -1.284493 -2.043068 0.813668 0.809252 0.191626
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.198156 -0.528756 -1.264188 -0.108644 -0.004246 1.846089 -1.818824 1.583993 0.809852 0.815877 0.189458
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 8.436872 10.317578 10.975579 11.698088 8.946418 9.501439 6.909591 6.426221 0.029173 0.032574 0.001354
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.235004 -1.320086 -1.033494 0.414396 -0.855880 -0.446899 -0.176974 -1.168465 0.800343 0.802777 0.202232
191 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.418682 -0.235417 1.290530 -0.940885 0.120372 0.574196 2.890757 -0.281230 0.792963 0.804827 0.195793
200 N18 RF_maintenance 100.00% 100.00% 8.31% 0.00% 11.098677 29.085668 4.570574 0.620632 8.943336 5.064998 6.799480 4.823559 0.042500 0.390528 0.276372
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.930696 2.659532 3.313215 5.063964 1.243998 5.396096 2.693472 4.729664 0.764105 0.744239 0.236378
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% -0.070397 1.728866 1.692535 -1.766751 0.169085 -0.094478 0.711261 0.650752 0.781495 0.776061 0.210343
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 206.574284 206.524469 inf inf 4692.310471 4678.810743 1092.477167 1093.090722 nan nan nan
205 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.714557 3.101425 -0.271033 -0.771745 -0.773558 -0.099272 -0.518337 -0.584131 0.788079 0.776815 0.191828
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.994236 0.665470 2.463991 -1.056305 11.926049 -1.022656 2.678473 -1.278666 0.789223 0.787820 0.200579
207 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 4.126255 8.843533 10.519094 12.873141 8.310882 6.784916 7.373778 11.531183 0.033299 0.032547 0.001513
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 3.979625 5.960354 10.647890 10.712769 8.472747 9.472271 7.519475 7.596510 0.039912 0.037493 0.001045
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 10.790496 11.034792 2.402930 4.149014 1.906156 0.677185 3.628315 4.765860 0.796257 0.800840 0.184132
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.180905 -0.542607 -1.618482 0.009842 -0.847907 -1.081277 -1.599945 -1.726878 0.771928 0.789106 0.199966
219 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.576101 -0.811832 0.204748 -0.522443 -0.869387 0.104067 -0.810647 -1.698048 0.771345 0.765065 0.217373
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.983994 0.424132 -1.852810 -0.887429 -0.625678 -0.673470 -1.906503 -1.961237 0.775227 0.773324 0.208394
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.977645 -0.250122 -0.665719 0.137610 -0.093495 -1.361370 -1.650966 -1.328849 0.783254 0.780345 0.206751
223 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
224 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
225 N19 RF_ok 100.00% 0.00% 37.16% 0.00% 0.735017 11.257863 0.675529 4.696825 -0.414533 9.378413 -0.379415 6.007658 0.790180 0.317255 0.531215
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.385054 5.635932 -0.146012 1.690814 -1.165771 3.879622 -1.162135 1.349823 0.793072 0.767131 0.198446
227 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 2.612365 0.748461 -2.020633 0.064395 0.657457 -0.659706 -0.538727 -1.020904 0.778148 0.787208 0.190141
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.465327 15.957976 -1.297164 -0.212749 2.767237 3.220703 6.662743 4.014297 0.742566 0.734837 0.158897
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.145736 -0.906665 1.397740 1.593055 -0.665595 0.141575 0.128026 -0.178700 0.780386 0.790722 0.200239
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.723426 0.503542 -0.312020 -1.929183 -0.120815 -1.022824 -1.300133 -2.226640 0.735593 0.744925 0.226087
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.795098 0.346615 0.793411 0.332681 -1.077821 -0.349136 -0.643988 -1.309292 0.767184 0.759719 0.225907
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.874292 -1.390774 -0.358435 0.171239 -1.076581 -0.223204 -1.499997 -1.235339 0.774154 0.766979 0.219246
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.044185 44.888028 2.962168 1.911127 3.917104 6.263676 3.637842 3.705044 0.673608 0.603659 0.144180
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.072464 3.798846 -1.331947 0.102492 -0.531198 0.693429 -0.661072 0.218238 0.773413 0.749421 0.209237
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 20.774488 0.406545 0.161484 1.554935 4.855083 -0.051451 3.230458 0.332766 0.711327 0.777263 0.206446
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 49.551941 2.501075 1.231730 -1.872487 12.964618 -0.198197 4.846979 -1.292421 0.558601 0.772964 0.327829
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.770598 1.607634 1.342875 -1.569408 4.689307 1.360192 -0.281824 -1.016625 0.741546 0.778375 0.202581
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 1.394236 1.147047 3.433877 1.010004 2.064543 -0.271116 2.913839 -0.236194 0.774260 0.784829 0.213664
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.658163 8.331371 -0.643109 -0.092118 3.442898 4.104694 4.458068 4.134013 0.563027 0.554754 0.116874
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.930948 1.181100 0.444766 -0.599339 -0.706858 -0.781415 -0.535278 -1.047764 0.781144 0.777822 0.200140
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 3.976715 6.075857 10.772423 11.208835 7.682807 8.169802 7.624769 7.925029 0.032855 0.028289 0.004050
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 9.556720 11.371266 5.801201 7.528579 3.993859 9.515691 4.787110 6.460189 0.591116 0.045720 0.479495
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.208736 1.557371 1.153530 1.907456 1.688310 1.219517 -0.220935 -0.509518 0.720423 0.724202 0.213599
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% -0.156848 0.006041 1.293665 -1.394044 1.545029 2.232453 -0.908563 2.370646 0.718519 0.709934 0.229621
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.794168 -0.446392 -0.760223 -1.020149 3.767700 1.315418 5.038272 1.734944 0.693223 0.750701 0.224063
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.104255 2.040949 -1.202070 -1.708493 2.677988 0.484947 3.497794 1.949402 0.591309 0.652974 0.291331
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, 9, 15, 16, 17, 18, 20, 21, 27, 28, 29, 32, 34, 36, 40, 42, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 62, 63, 68, 71, 72, 78, 80, 81, 82, 84, 86, 87, 92, 94, 96, 97, 100, 101, 103, 104, 108, 109, 110, 111, 113, 114, 117, 119, 121, 122, 123, 126, 128, 129, 130, 131, 132, 133, 135, 136, 138, 142, 143, 145, 146, 147, 148, 149, 155, 156, 159, 161, 164, 165, 166, 170, 179, 180, 182, 183, 185, 189, 200, 201, 203, 206, 207, 208, 209, 210, 219, 223, 224, 225, 226, 228, 240, 242, 243, 244, 246, 262, 320, 329]

unflagged_ants: [5, 7, 8, 10, 19, 22, 30, 31, 35, 37, 38, 41, 43, 44, 45, 46, 53, 61, 64, 65, 66, 67, 69, 70, 73, 74, 77, 79, 83, 85, 88, 89, 90, 91, 93, 95, 98, 99, 102, 105, 106, 107, 112, 115, 116, 118, 120, 124, 125, 127, 137, 139, 140, 141, 144, 150, 157, 158, 160, 162, 163, 167, 168, 169, 181, 184, 186, 187, 190, 191, 202, 205, 211, 220, 221, 222, 227, 229, 237, 238, 239, 241, 245, 261, 324, 325, 333]

golden_ants: [5, 7, 10, 19, 30, 31, 37, 38, 41, 44, 45, 53, 65, 66, 67, 69, 70, 83, 85, 88, 91, 93, 98, 99, 105, 106, 107, 112, 116, 118, 124, 127, 140, 141, 144, 150, 157, 158, 160, 162, 163, 167, 168, 169, 181, 184, 186, 187, 190, 191, 202]
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_2459936.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.dev11+g87299d5
3.1.5.dev197+g9b7c3f4
In [ ]: