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

Figure out some general properties¶

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

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

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

Load a priori antenna statuses and node numbers¶

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

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

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

Summarize auto metrics¶

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

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

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

Summarize ant metrics¶

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

Summarize redcal chi^2 metrics¶

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

Get FEM switch states¶

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

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

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

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

Find X-engine Failures¶

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

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

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

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

Build Overall Health DataFrame¶

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

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

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

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

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

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

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

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

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

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

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

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

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

Table 1: Overall Array Health¶

In [18]:
HTML(table.render())
Out[18]:
JD 2460104
Date 6-8-2023
LST Range 9.402 -- 18.612 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ❌ ✅ ✅
Number of Files 379
Total Number of Antennas 202
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
RF_maintenance: 60
RF_ok: 24
digital_ok: 85
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 202 (0.0%)
Antennas in Commanded State (observed) 0 / 202 (0.0%)
Cross-Polarized Antennas 66
Total Number of Nodes 19
Nodes Registering 0s N07, N15
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 56 / 202 (27.7%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 92 / 202 (45.5%)
Redcal Done? ❌
Never Flagged Antennas 109 / 202 (54.0%)
A Priori Good Antennas Flagged 32 / 85 total a priori good antennas:
9, 15, 17, 37, 38, 40, 42, 51, 53, 55, 66,
72, 86, 112, 121, 136, 147, 148, 149, 150,
151, 153, 161, 165, 167, 168, 169, 170, 189,
190, 191, 202
A Priori Bad Antennas Not Flagged 56 / 117 total a priori bad antennas:
8, 22, 35, 36, 43, 46, 48, 49, 50, 52, 57,
60, 63, 64, 73, 74, 79, 80, 84, 89, 95, 97,
102, 108, 113, 114, 115, 132, 133, 135, 139,
179, 185, 204, 206, 210, 220, 221, 222, 223,
224, 226, 228, 229, 237, 238, 239, 240, 241,
242, 244, 245, 261, 262, 324, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2460104.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.125915 -0.859198 0.225776 -1.013796 0.359307 -0.674119 0.300429 -0.611964 0.655429 0.606729 0.433811
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.197187 4.903925 -0.787049 -0.598337 -1.019956 -0.123568 -0.870206 -0.085847 0.655546 0.553021 0.421787
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.015965 2.706450 0.155782 3.979637 0.385415 2.670010 0.226993 1.991094 0.670085 0.623208 0.432049
7 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.306933 -0.475500 -1.225014 -0.417046 -0.365753 0.168837 2.252682 3.236181 0.673057 0.628788 0.424863
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.224702 2.539527 1.721599 1.874901 0.999739 1.104334 -0.711279 -0.788939 0.649738 0.600692 0.420862
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 2.471804 0.281750 4.123424 0.318573 2.438766 0.452211 3.127266 0.172621 0.674569 0.627936 0.426328
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.403548 -1.372920 -0.105693 -1.270043 -0.839479 -0.922748 -1.063955 -0.684098 0.662286 0.615334 0.433701
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 4.591636 -0.831951 -0.079510 -0.729596 -0.184631 -0.515524 0.339514 0.070908 0.619350 0.628874 0.391802
16 N01 RF_ok 100.00% 100.00% 100.00% 0.00% 4.735969 5.334688 20.177870 20.729492 2.316448 2.403890 2.942480 3.129280 0.029511 0.091828 0.053942
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 1.049674 3.120189 1.411206 5.241211 1.292194 3.159665 1.084210 7.276340 0.691430 0.644866 0.426145
18 N01 RF_ok 100.00% 0.00% 0.00% 0.00% 0.519677 4.605430 0.336589 6.838701 -0.336717 2.865180 0.423238 24.143408 0.664033 0.478837 0.502188
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.957554 0.752424 -0.821669 0.580011 -0.402982 -0.202191 -0.305788 -1.202602 0.692064 0.638174 0.429424
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.554202 0.080866 0.623063 0.468609 0.632675 0.608656 0.798633 0.367038 0.691333 0.645732 0.425320
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.456336 -0.183361 -0.525909 -0.201282 -0.558172 -0.063163 -0.012821 0.079650 0.685020 0.637221 0.432938
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.066187 -1.258052 0.924643 -1.291916 0.471086 -0.478420 0.602130 -0.774893 0.660907 0.610247 0.437545
27 N01 RF_ok 100.00% 100.00% 40.28% 0.00% 7.655282 8.793738 18.776403 6.795114 2.520487 2.798255 7.601965 29.402139 0.053636 0.209275 0.166408
28 N01 RF_ok 100.00% 0.00% 0.00% 0.00% 0.926900 7.235419 1.421390 7.272679 1.169039 0.941021 1.096250 21.011840 0.693557 0.410824 0.562060
29 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.859107 5.402717 19.751264 20.040278 2.313904 2.419743 3.496779 2.571720 0.031341 0.038499 0.007538
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.572203 -1.019797 1.080394 -1.253153 0.301206 -0.899957 -0.805799 -0.764822 0.686401 0.660467 0.417306
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.215474 0.352678 -0.000556 0.488867 0.468963 0.984484 0.414638 0.460860 0.707267 0.666378 0.424042
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.906219 7.489443 0.975279 0.505062 0.141579 -0.314796 0.488367 0.923439 0.657252 0.627547 0.244383
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 5.017717 0.135218 12.731621 -0.113821 2.331012 -0.869797 3.091023 -1.029878 0.038764 0.625880 0.495789
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.163332 -0.771741 0.103724 -1.017745 -0.614694 -1.254446 -1.099907 -0.944562 0.666382 0.616736 0.432225
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.567869 1.073557 0.858463 0.427935 1.087768 0.606322 0.900738 0.916382 0.637847 0.580031 0.410035
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.026079 10.037353 0.095223 24.599501 0.196007 2.367109 0.240587 5.043949 0.655951 0.109951 0.572594
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.682207 -0.059119 -0.732689 0.334760 -0.511072 0.668508 1.006665 6.724418 0.666495 0.618503 0.418401
40 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.864345 0.748346 1.020447 0.515463 0.860439 0.601409 1.187752 17.815879 0.694648 0.649841 0.421718
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.082687 2.056005 0.275006 2.586352 0.298731 2.487685 0.263248 1.810104 0.703434 0.663092 0.418035
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.967700 0.450977 -1.182892 0.506331 -0.706832 0.591055 -0.340784 0.791320 0.719128 0.679825 0.422727
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.401032 0.075528 -1.262221 -0.034772 -0.849877 0.317533 -0.488013 -0.036800 0.715595 0.678778 0.426481
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.625790 0.571157 0.650833 0.310949 0.666016 0.609114 0.667511 2.235846 0.717810 0.675911 0.430306
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.533175 -1.167945 -0.296969 -0.879861 -0.165784 -1.428856 0.162646 -0.857267 0.712025 0.664491 0.443967
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.668433 0.824755 -0.716580 0.578915 -1.052442 -0.112033 -0.811245 -1.254812 0.680913 0.621665 0.429067
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.087637 -0.445938 0.741778 -0.559771 0.401331 -1.365296 0.525007 -1.097673 0.668282 0.610011 0.430000
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.236211 0.035681 -0.037434 0.480124 0.184071 0.614227 0.157647 0.224213 0.640494 0.580662 0.413150
51 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.528593 -0.007418 -0.069426 0.641178 0.072226 0.720556 44.767823 1.167576 0.653255 0.603671 0.406617
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.116901 0.430016 0.237508 -0.179156 0.267991 -0.068156 1.897208 0.178479 0.671523 0.618439 0.412727
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.243476 -0.429055 -0.089540 -0.220906 0.285762 -0.015451 5.125393 2.374528 0.686028 0.639908 0.408304
54 N04 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 1.242552 22.924068 1.747916 14.079428 2.169514 2.860389 4.619187 2.469269 0.294448 0.036967 0.103580
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.389529 0.319393 -0.388652 0.206085 -0.018940 0.824512 -0.091401 0.360761 0.721094 0.681806 0.424211
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.363503 -0.239231 -0.533239 -0.583481 -0.114459 -0.158847 0.244934 0.240020 0.727452 0.683581 0.421716
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.262251 4.955399 20.230938 20.812617 2.315218 2.434527 4.257598 4.026349 0.035730 0.033428 0.001789
59 N05 RF_ok 100.00% 0.00% 100.00% 0.00% 1.309817 5.126838 1.362438 20.811268 0.915148 2.435402 0.801081 3.164380 0.726418 0.031124 0.559869
60 N05 RF_ok 0.00% 0.00% 0.00% 0.00% 0.368766 -0.968536 0.701555 -1.161645 0.481353 -1.270625 0.754417 1.628116 0.717204 0.674893 0.437874
61 N06 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
62 N06 digital_ok 0.00% 0.00% 0.00% 0.00% -0.041202 0.926608 0.833447 0.508790 0.865216 -0.060271 1.456683 -1.219716 0.684325 0.630970 0.422733
63 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.404386 3.425482 -0.730805 2.585662 -1.206151 1.763073 -0.823235 -0.453602 0.678902 0.591094 0.437390
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.884975 -0.906520 -1.218968 -0.406685 -1.212105 -0.585134 -0.631313 -0.332946 0.666458 0.607903 0.424589
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.190798 -0.984895 0.200923 -0.868960 0.419470 -0.411490 0.304760 -0.109646 0.641297 0.578063 0.421046
66 N03 digital_ok 0.00% 0.00% 0.00% 100.00% 1.184642 0.237067 1.515633 0.899548 1.840693 0.321204 1.691440 1.231275 0.241487 0.242554 -0.329128
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.136151 0.296137 -0.782182 0.853281 -0.134006 1.180315 1.526598 1.170703 0.673462 0.626295 0.409568
68 N03 RF_ok 100.00% 0.00% 0.00% 0.00% 1.188976 1.308096 1.452566 2.062194 1.243471 1.583621 0.949052 5.133018 0.692350 0.645311 0.412322
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.680548 0.043986 0.504417 0.086014 0.719042 0.092433 2.135732 0.276811 0.706035 0.661145 0.411495
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.917722 0.445702 2.617708 0.678599 2.086873 0.698162 1.570562 1.531190 0.719094 0.678658 0.411073
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.314658 -0.261471 -0.874980 -0.005333 -0.510801 0.191482 -0.363205 0.320175 0.727862 0.688254 0.418899
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.185489 2.345383 0.131909 2.659631 0.227091 1.832302 0.611064 1.390928 0.736707 0.697265 0.430598
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.225312 -0.566746 -0.925787 -0.811260 -0.703676 0.183666 -0.679181 -0.056684 0.728859 0.691457 0.431041
77 N06 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 6.037002 0.848615 0.741004 0.652371 0.393018 -0.163496 1.294323 -1.145587 0.610415 0.630345 0.361187
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.193549 -1.241847 0.725204 -1.185832 0.141717 -1.269785 0.709630 -0.807177 0.676901 0.624156 0.413398
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.274811 2.252772 -0.325384 1.635328 -0.867093 0.844026 -1.007910 -0.952511 0.660201 0.586232 0.424678
81 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 94.807337 94.855186 inf inf 1.009242 2.048376 7.984770 68.262699 nan nan nan
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 94.808099 94.853891 inf inf 4.726328 4.843752 3.971610 4.229420 nan nan nan
83 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 94.808025 94.853894 inf inf 4.212499 4.706017 4.566321 4.694045 nan nan nan
84 N08 RF_ok 0.00% 0.00% 0.00% 0.00% 1.584104 2.536897 1.163898 1.796654 0.306901 0.959770 -1.058898 -0.925294 0.673024 0.618765 0.408447
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.557055 -1.228313 -0.833789 -1.016655 0.380655 -0.790867 -0.464847 -0.596811 0.704198 0.664361 0.415571
86 N08 digital_ok 100.00% 100.00% 0.00% 0.00% 4.823124 -0.571421 18.118040 -0.278133 2.311641 -0.048197 2.164997 6.811222 0.047747 0.675660 0.505487
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 14.356819 -0.032064 3.393392 -1.184977 2.200760 -0.918621 44.031406 1.109169 0.678961 0.688495 0.350783
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.083029 0.627207 0.508713 1.323789 0.625541 1.424005 0.551799 0.829928 0.736615 0.696792 0.421368
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.063192 0.484678 0.526588 0.844607 0.574855 0.888038 0.432157 0.505335 0.742980 0.702017 0.432328
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.636575 1.258168 0.811082 1.843559 14.630109 1.400126 5.554851 2.201590 0.737298 0.701850 0.428881
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.207294 0.035603 0.697144 0.408906 0.591056 0.458831 0.608854 0.251409 0.735625 0.696373 0.449740
92 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.352417 4.924046 20.298131 20.629474 2.316218 2.431532 4.381401 4.222733 0.027253 0.025445 0.001736
93 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.573677 5.176964 20.256104 20.922021 2.323898 2.437861 4.231493 4.931018 0.028332 0.033338 0.001080
94 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.272590 2.208774 1.811820 2.641712 1.127036 4.035680 -0.545118 2.960044 0.681943 0.658640 0.420292
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.725299 0.051508 -0.510184 0.000556 -0.682138 -0.750358 -0.235417 -1.101736 0.682974 0.631492 0.418762
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.832229 5.384929 0.554233 -0.431294 -0.012653 -0.529776 -1.066318 -0.098518 0.667105 0.569707 0.373880
97 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.167602 0.640373 -0.968129 1.114017 -1.395076 0.657996 -0.839222 2.705296 0.657589 0.597883 0.417732
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.808142 1.568726 -0.279379 0.782561 0.014318 0.633493 0.026847 0.448255 0.689517 0.641737 0.415390
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.160293 -0.627476 -1.161172 -0.967624 -1.077459 -0.732735 -0.727355 2.224580 0.700154 0.657882 0.410457
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.062313 0.139515 -0.564178 0.136857 -0.727245 0.281593 -0.943911 1.056388 0.708973 0.674584 0.397740
104 N08 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.329384 22.682350 2.579163 9.108025 2.171563 4.246240 2.267315 3.485884 0.727071 0.680208 0.416974
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.601937 0.224475 0.041865 0.937482 0.670172 1.184569 0.234596 0.539416 0.732156 0.696872 0.410475
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.395063 -0.869210 2.625129 -0.025295 0.622221 0.239024 1.805164 -0.023796 0.737613 0.700177 0.424530
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.888751 -0.703106 -0.528723 -1.226329 -0.054589 -0.909905 0.351271 0.307996 0.737698 0.700655 0.418056
108 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.013062 0.852985 -0.644246 0.653655 -0.319037 0.722996 -0.005089 0.407695 0.734447 0.699712 0.444081
109 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.844380 5.156909 -0.959443 20.437957 2.141436 2.434329 1.088901 3.515625 0.455860 0.038660 0.334190
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.484827 -0.279552 3.295325 0.203508 0.564602 0.233151 1.082661 0.068604 0.682378 0.678897 0.361983
111 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.005803 3.079990 2.854374 6.849117 0.784646 2.939822 4.330245 2.654543 0.679085 0.661446 0.376054
112 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 1.867466 2.606243 17.790347 1.974783 -0.500494 1.189403 1.536034 -0.779502 0.547897 0.624069 0.415576
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 3.134884 3.426486 2.301065 2.490958 1.489626 1.646677 -0.509505 -0.514451 0.653195 0.597923 0.410429
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.696384 -0.564952 1.918085 -1.157905 1.153196 -1.558613 -0.673216 -0.842952 0.643713 0.612158 0.401769
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.322535 -0.156919 -1.216995 -0.164898 -0.570295 -0.691403 -0.501971 -1.234178 0.647543 0.586650 0.410985
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 94.807679 94.853506 inf inf 1.541959 1.405265 6.255840 7.277749 nan nan nan
118 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 94.808070 94.853852 inf inf 4.873350 4.140590 5.979352 4.330876 nan nan nan
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.235851 -0.460188 3.034930 -0.041369 1.903838 0.047897 8.496857 4.893212 0.696180 0.652884 0.411810
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.000588 3.577318 1.480236 7.824443 0.766320 3.158191 -0.820741 8.174187 0.687788 0.665336 0.390819
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.265689 0.161478 -0.731569 -1.058708 -0.457771 -1.272332 -0.196796 -0.932867 0.719030 0.677311 0.411488
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.878788 1.472413 2.094210 0.972162 1.294618 0.118249 -0.503427 -1.285281 0.704370 0.677212 0.413253
124 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 4.621048 7.017925 20.584349 0.330619 2.319030 2.580108 3.385753 2.537853 0.040838 0.442121 0.291685
125 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.026938 -0.080293 4.729565 0.382987 2.989816 0.614352 3.554553 0.385036 0.734035 0.700188 0.429100
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.013154 0.563164 1.979127 0.610357 0.455859 0.640015 2.616893 0.353404 0.711633 0.701221 0.400792
127 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 4.366139 3.177990 20.280144 4.538025 2.313855 2.482043 2.777283 3.997438 0.037327 0.439048 0.304592
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.532139 -0.485664 0.310374 -0.374283 0.619880 -0.199206 1.418183 2.350596 0.729052 0.688184 0.451585
131 N11 not_connected 100.00% 0.00% 1.67% 0.00% -0.705242 4.024363 -0.697012 12.150530 -0.759184 0.752017 -0.854240 1.705699 0.680321 0.408415 0.483374
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.840078 -1.337265 -0.755259 -1.235319 -1.215846 -1.399257 -0.881398 -0.757316 0.673289 0.623213 0.409751
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.231077 -0.546405 -1.204221 -0.670383 -1.137948 -1.392814 -0.471827 -0.978372 0.655993 0.598296 0.409531
134 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.578939 2.639140 3.509535 1.853350 1.180606 1.042298 5.116720 -0.893273 0.616369 0.552728 0.408582
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.179197 -1.290097 -0.455169 -1.236160 -0.928655 -0.951137 -0.787150 -0.448346 0.607770 0.560023 0.420958
136 N12 digital_ok 100.00% 100.00% 0.83% 0.00% 4.320570 10.952716 19.867248 4.889698 2.304287 2.706467 4.249391 3.502027 0.035096 0.283648 0.188155
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 94.807962 94.853903 inf inf 6.631022 7.191473 7.369894 7.565073 nan nan nan
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.913439 -0.521012 0.484677 -1.163025 -0.253964 -1.258953 -1.029588 -0.686853 0.672742 0.634044 0.417766
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.184906 -0.017351 0.399275 0.235997 0.493611 0.576562 1.692933 1.462409 0.701723 0.659179 0.410399
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.001490 -0.438668 0.283060 0.002864 0.316501 0.239615 0.283590 -0.067944 0.711104 0.669988 0.414588
142 N13 RF_ok 100.00% 0.00% 0.00% 0.00% 0.026983 0.970631 0.277317 1.061593 0.233161 1.056942 9.565675 2.945875 0.719891 0.680041 0.421473
143 N14 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.131205 5.498996 0.772312 20.784713 2.227346 2.448619 0.533992 4.583308 0.403439 0.039484 0.330543
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.135398 0.603720 -1.059382 0.386528 -0.715535 0.728540 -0.220196 0.936733 0.733603 0.695108 0.431277
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.062176 1.159425 -0.024282 1.360978 0.258469 1.533452 0.185762 1.019498 0.738468 0.698028 0.436811
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.152173 -0.700879 -1.278907 -0.880827 -1.125145 -1.494848 -0.576488 -0.567296 0.727502 0.688623 0.452784
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
149 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
150 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.616042 0.188500 -0.688594 1.020215 0.033066 0.472426 0.498687 4.697785 0.631289 0.626927 0.363208
152 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -1.206405 -1.305956 -1.202830 -1.107771 -0.984150 -1.163815 0.919270 -0.673118 0.660568 0.602890 0.408085
153 N16 digital_ok 100.00% 100.00% 0.00% 0.00% 4.610860 -1.060937 12.353154 -1.110255 2.313814 -1.103181 2.917369 -0.691319 0.040205 0.581492 0.434715
154 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.613768 -0.830541 -0.506606 -1.040150 -1.186994 -1.495297 -0.920261 -0.855833 0.623984 0.556283 0.400629
155 N12 RF_maintenance 100.00% 100.00% 0.56% 0.00% 4.688981 5.559852 20.014719 5.355991 2.314391 2.516967 4.063182 2.598512 0.032560 0.285955 0.198997
156 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.241254 0.184572 6.753028 0.543035 3.199879 0.658574 4.155650 0.335389 0.635846 0.586799 0.424716
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.306699 0.411418 0.126932 0.503338 0.383069 0.428623 0.207853 0.190742 0.655068 0.607676 0.421730
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -1.001605 -1.136229 -0.927258 -0.890213 -0.822233 -1.318029 0.034633 2.668879 0.668167 0.620229 0.424331
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.238581 5.187695 0.675833 1.180161 0.252351 -0.547942 0.587419 0.445440 0.666251 0.564179 0.391227
160 N13 RF_maintenance 100.00% 100.00% 0.00% 0.00% 4.933448 5.757481 20.217939 4.253659 2.331839 2.468095 3.825665 3.210061 0.043261 0.392728 0.314404
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.270751 11.911565 0.381475 0.625030 0.446446 -0.362373 0.348727 -0.014273 0.706322 0.603002 0.369980
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.787103 -0.073549 -1.130527 0.104069 -0.805007 0.163990 -0.382206 0.064338 0.714861 0.673847 0.414448
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.087235 0.287535 -0.019422 0.228618 0.201361 0.361992 0.182905 0.233367 0.726530 0.686833 0.423950
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 1.417987 0.741311 1.748737 0.964185 1.469673 0.679617 1.308212 1.017797 0.728911 0.686884 0.429708
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 5.131475 -0.192024 1.497635 -0.087417 0.004514 0.027062 1.271723 0.041147 0.684138 0.690738 0.367797
166 N14 RF_maintenance 100.00% 100.00% 0.00% 0.00% 4.855499 13.831632 20.512444 6.818078 2.323883 2.872466 3.751331 2.353590 0.031138 0.348783 0.216730
167 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
168 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
169 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
170 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.287110 -0.457475 1.241969 0.176131 0.442095 -0.040908 1.078846 0.599590 0.670962 0.624999 0.420570
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.119162 -0.781501 -0.126709 -0.794521 -0.761429 -0.772797 -0.603281 0.290195 0.653507 0.604232 0.410560
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.206538 3.457178 2.312498 2.469162 1.482752 1.639171 -0.523791 -0.510524 0.610514 0.546346 0.400197
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.118747 -0.347009 0.028611 -0.232772 0.225327 0.170344 0.161046 -0.062987 0.676811 0.627571 0.430080
180 N13 RF_ok 100.00% 0.00% 0.00% 0.00% 1.050842 10.556507 1.506852 16.975785 1.018894 0.138268 6.669837 2.847640 0.681405 0.474684 0.410163
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.128315 0.191184 0.018428 0.129261 0.368118 0.087490 0.223742 2.590925 0.697576 0.652176 0.423542
182 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.178012 5.279869 -0.072492 20.410308 -0.303948 2.395846 -0.529924 4.075755 0.703804 0.047680 0.544224
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.396293 0.097328 0.243982 0.916124 0.049350 0.712984 0.675765 0.541904 0.713323 0.671725 0.421363
184 N14 dish_maintenance 100.00% 0.00% 0.00% 0.00% 12.710980 5.121285 14.172087 6.928771 2.934061 2.495756 2.791847 2.149022 0.304603 0.394257 0.212852
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.685156 0.043425 -0.332253 0.314021 -0.145353 0.389585 0.005089 0.277415 0.720672 0.681537 0.427708
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.012726 -0.616947 -0.058528 -0.562478 -0.664140 -1.164320 -1.043231 -1.141386 0.709968 0.672856 0.424244
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.548535 -0.265977 -0.642740 0.134760 0.726038 0.265395 0.510160 0.101539 0.721006 0.684514 0.437624
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
190 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
191 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.283876 3.691599 2.443347 2.668564 1.585503 1.803659 -0.424729 -0.403675 0.625305 0.569052 0.410258
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.439447 3.321508 2.541162 2.409056 1.670127 1.559380 -0.394883 -0.578903 0.608354 0.549588 0.399644
200 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
201 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
202 N18 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
204 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.779534 3.243599 -0.513313 0.313958 -0.393324 0.120899 1.036374 0.483646 0.702375 0.663745 0.418407
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.020109 0.966620 7.442994 1.747712 0.260131 0.738320 4.637312 2.584008 0.651773 0.657805 0.424880
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.120259 0.810470 2.757981 2.270193 1.771000 1.595705 1.327741 1.327304 0.688035 0.650643 0.410628
207 N19 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.145078 7.723046 12.138130 6.029427 2.330852 2.794740 3.119142 3.069668 0.041886 0.344911 0.267289
208 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% 0.560173 4.876879 17.093225 20.019796 -0.323905 2.525026 1.997265 45.242303 0.618861 0.033189 0.529215
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 3.455562 3.948306 19.438366 19.476427 2.075350 2.229292 17.628585 21.424176 0.027422 0.030575 0.000540
210 N20 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.640100 1.688580 -0.058838 0.360407 0.156540 0.459318 0.248242 0.255973 0.681965 0.627172 0.426957
211 N20 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.486259 5.392160 -0.123049 12.877297 -0.250854 2.424558 0.133635 3.020576 0.656811 0.035166 0.552653
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.686160 -1.116559 -0.642359 -1.162626 -0.530087 -0.815710 -0.470771 -0.886888 0.680082 0.631225 0.433533
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.705713 -0.830979 -0.757850 -0.981357 -0.814930 -1.425314 0.885041 -1.011737 0.685121 0.640205 0.430965
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.902938 -0.037758 -0.918646 -0.263663 -1.142430 -1.088098 0.333568 -1.143019 0.688535 0.644044 0.425679
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.937445 1.052148 -0.506627 2.983237 -0.682623 0.690894 -0.248073 2.506271 0.689542 0.635075 0.429090
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.623965 3.530720 2.687015 2.565343 1.822811 1.718711 -0.295172 -0.473826 0.654039 0.612471 0.417993
225 N19 RF_maintenance 100.00% 0.00% 10.28% 0.00% 0.367149 4.205866 0.207040 12.005327 -0.487118 1.262082 -1.092008 3.657701 0.681671 0.364422 0.539046
226 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.749298 2.435397 -0.901882 -0.470953 -1.371976 -0.106251 -0.797333 -0.706567 0.682762 0.602231 0.414896
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 0.672520 -0.368044 1.204839 -0.589516 0.498629 -1.147129 10.076089 -0.564065 0.671718 0.623412 0.420561
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.023889 -1.230772 -0.332219 -1.054569 -0.559172 -0.772151 0.127979 0.034777 0.664093 0.613134 0.411536
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.499267 0.890336 0.114305 0.609427 -0.627378 -0.218065 -1.095665 -1.310187 0.649714 0.590269 0.423208
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.001490 -1.340185 0.670307 -1.284350 -0.134708 -1.082701 0.764247 -0.825336 0.659300 0.612510 0.435311
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.377703 0.402373 0.225839 0.268085 -0.472926 -0.531497 -1.089423 -1.323442 0.668360 0.617953 0.436121
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.813555 -0.455612 -0.862440 -0.648691 -1.009407 -1.309266 -0.746826 0.071082 0.675507 0.626396 0.432863
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.294697 -0.358935 2.284683 -0.566664 0.674862 -1.326354 1.185342 -0.585896 0.663777 0.629372 0.422335
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.615243 -0.178881 -0.653249 -0.216153 -1.216748 -0.867657 -0.533446 -1.241746 0.677591 0.629525 0.429179
242 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.137413 0.807767 -0.969116 0.406779 0.000624 -0.353929 0.114483 -1.220617 0.632586 0.619975 0.381672
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.321950 -1.282563 0.524859 -1.286421 0.396060 -1.151907 4.563841 -0.726891 0.651058 0.619307 0.409658
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.460368 -0.622797 -0.244041 -0.109186 -0.341976 -0.123138 0.266183 0.783528 0.666483 0.618764 0.419044
245 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.056503 -0.823961 -0.036798 -1.100149 -0.660740 -1.466801 -1.087276 -0.348255 0.656267 0.605731 0.417837
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% 1.884889 5.632490 9.161572 12.228727 -0.216108 2.429893 1.946116 2.189619 0.532311 0.033875 0.442133
261 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.022473 -0.238212 -0.203890 -0.478408 -0.765495 -1.131016 -0.886338 -1.143166 0.642772 0.590897 0.417068
262 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.877697 2.781931 0.220347 0.191462 0.227520 0.245919 0.339125 0.399762 0.639357 0.583716 0.423443
320 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.016990 -0.272421 -1.286779 -0.777067 -0.992358 -1.236343 -0.510874 -0.701618 0.496590 0.366953 0.323876
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.166129 1.657054 0.472567 0.778777 -0.000624 0.167021 -0.900524 -1.192409 0.480058 0.360353 0.316294
325 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.403063 -1.246103 0.324012 -1.304529 -0.249238 -1.113926 -1.084442 -0.694340 0.528644 0.432972 0.345931
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.133381 5.287786 12.284792 13.043537 2.327206 2.425364 2.512606 3.237622 0.038305 0.036055 0.002926
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% -0.107676 -0.450762 0.140835 -1.224930 0.070798 -0.970642 0.690502 -0.483883 0.457534 0.329847 0.287847
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [4, 9, 15, 16, 17, 18, 27, 28, 29, 32, 34, 37, 38, 40, 42, 47, 51, 53, 54, 55, 58, 59, 61, 66, 68, 72, 77, 78, 81, 82, 83, 86, 87, 90, 92, 93, 94, 96, 104, 109, 110, 111, 112, 117, 118, 120, 121, 124, 125, 126, 127, 131, 134, 136, 137, 142, 143, 147, 148, 149, 150, 151, 153, 155, 156, 159, 160, 161, 165, 166, 167, 168, 169, 170, 180, 182, 184, 189, 190, 191, 200, 201, 202, 205, 207, 208, 209, 211, 225, 227, 243, 246, 329]

unflagged_ants: [3, 5, 7, 8, 10, 19, 20, 21, 22, 30, 31, 35, 36, 41, 43, 44, 45, 46, 48, 49, 50, 52, 56, 57, 60, 62, 63, 64, 65, 67, 69, 70, 71, 73, 74, 79, 80, 84, 85, 88, 89, 91, 95, 97, 101, 102, 103, 105, 106, 107, 108, 113, 114, 115, 122, 123, 128, 132, 133, 135, 139, 140, 141, 144, 145, 146, 152, 154, 157, 158, 162, 163, 164, 171, 172, 173, 179, 181, 183, 185, 186, 187, 192, 193, 204, 206, 210, 220, 221, 222, 223, 224, 226, 228, 229, 237, 238, 239, 240, 241, 242, 244, 245, 261, 262, 320, 324, 325, 333]

golden_ants: [3, 5, 7, 10, 19, 20, 21, 30, 31, 41, 44, 45, 56, 62, 65, 67, 69, 70, 71, 85, 88, 91, 101, 103, 105, 106, 107, 122, 123, 128, 140, 141, 144, 145, 146, 152, 154, 157, 158, 162, 163, 164, 171, 172, 173, 181, 183, 186, 187, 192, 193, 320, 325]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2460104.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Metadata¶

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