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 = "2460076"
data_path = "/mnt/sn1/2460076"
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: 5-11-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/2460076/zen.2460076.42115.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 361 ant_metrics files matching glob /mnt/sn1/2460076/zen.2460076.?????.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/2460076/zen.2460076.?????.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 2460076
Date 5-11-2023
LST Range 14.830 -- 16.771 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 361
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 94
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas 40, 42, 70, 112
Total Number of Nodes 19
Nodes Registering 0s N15
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 65 / 198 (32.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 101 / 198 (51.0%)
Redcal Done? ❌
Never Flagged Antennas 95 / 198 (48.0%)
A Priori Good Antennas Flagged 50 / 94 total a priori good antennas:
7, 15, 17, 19, 31, 37, 38, 40, 42, 53, 55,
65, 66, 70, 72, 81, 83, 86, 93, 94, 103, 109,
111, 112, 118, 121, 124, 127, 136, 140, 147,
148, 149, 150, 151, 158, 160, 161, 165, 166,
167, 168, 169, 170, 182, 184, 189, 190, 191,
202
A Priori Bad Antennas Not Flagged 51 / 104 total a priori bad antennas:
8, 22, 35, 36, 43, 46, 48, 49, 50, 52, 57,
64, 73, 74, 80, 89, 90, 102, 114, 115, 120,
125, 126, 132, 133, 134, 135, 139, 179, 185,
201, 206, 207, 220, 221, 222, 224, 228, 229,
237, 238, 239, 240, 241, 244, 245, 261, 320,
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_2460076.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
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.222356 6.817068 -0.909618 -0.668079 -0.485835 1.023866 -0.878288 22.017324 0.447287 0.370093 0.278885
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.122973 0.687604 0.452962 2.992431 0.993357 1.520391 0.043571 0.742769 0.459206 0.446617 0.286470
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.981392 -0.263561 -0.506617 0.068021 -0.005656 0.271188 1.451287 4.924388 0.464190 0.461220 0.281036
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.732176 1.976560 1.181377 1.205172 0.456105 0.370227 -1.927105 -1.944686 0.431036 0.429434 0.258988
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.856765 -0.519858 2.908788 -0.432844 1.223741 0.260992 1.623583 -0.250278 0.440058 0.453137 0.273247
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.660802 -0.553005 -0.257313 -0.547255 -1.201561 0.180337 -0.954129 -0.081964 0.435096 0.433497 0.266290
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 9.154866 -0.110178 -0.387415 -0.223552 -0.293637 0.476048 -0.229392 0.546216 0.365044 0.461392 0.284059
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.191148 1.641299 0.367356 0.982081 -0.619410 0.083873 -1.670632 -1.915942 0.456974 0.449626 0.280928
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.202233 2.058722 0.837045 8.174449 1.112099 -0.757802 0.356366 2.927285 0.474886 0.368756 0.316581
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.284765 5.264326 0.841546 1.458995 1.048027 0.156505 9.050300 17.938480 0.448378 0.287658 0.316867
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.473065 0.633675 -0.256532 3.519380 0.313425 2.227821 -0.120531 6.143273 0.475945 0.471324 0.282888
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.117693 -1.055196 1.776602 -0.469481 2.329628 0.066757 2.889634 0.355985 0.464271 0.473138 0.279108
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.143383 0.141029 -0.060432 0.285127 0.866726 1.607194 0.135389 0.211643 0.454887 0.461616 0.274137
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.962025 -0.988583 -0.535320 -0.983350 -0.240371 0.352741 0.114765 -0.536751 0.418884 0.424605 0.262422
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.981614 16.864293 9.536427 6.043112 1.726219 0.872180 5.086254 64.808380 0.074445 0.074171 -0.022737
28 N01 RF_maintenance 100.00% 100.00% 2.49% 0.00% 6.818702 9.719040 9.772867 3.884203 1.889826 0.462758 1.760625 20.569227 0.032921 0.217254 0.161863
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.857644 -0.148643 -0.172285 -0.012371 0.882997 0.694816 0.225399 1.499823 0.481301 0.490044 0.288138
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.257101 -0.914340 0.048967 -0.676777 0.606304 -0.300648 -0.044316 -0.369176 0.489181 0.496294 0.287436
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.511246 0.363621 0.960648 2.906075 1.426562 -0.315400 0.463729 13.549823 0.490662 0.487244 0.284085
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.291925 12.017574 0.035330 -0.073332 -0.753424 -0.225142 1.389037 3.190308 0.386911 0.419790 0.163840
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.808527 -0.414101 5.739323 -0.544726 1.851794 -0.962520 1.359433 -0.241491 0.049041 0.445341 0.299702
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.416934 -0.896009 -0.204273 -0.467960 -1.117394 -0.211928 -1.334537 -0.171969 0.433096 0.434954 0.264508
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.022443 3.171009 0.960454 0.686022 0.679778 0.626087 0.279578 0.906765 0.436124 0.427808 0.268166
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.914170 14.991591 -0.859272 12.393369 -0.610539 1.547148 -0.875494 3.942190 0.445117 0.035846 0.343454
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.184132 -0.280356 -0.136433 0.431958 -0.083387 -0.203492 1.673028 5.780440 0.454078 0.455814 0.276823
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.215937 0.204329 0.194766 -0.376384 -0.527394 0.763444 24.286618 0.702796 0.208411 0.201237 -0.248268
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.569969 1.317046 1.123352 1.943057 1.323206 -0.249141 0.234714 0.536041 0.486332 0.490641 0.293602
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.304272 0.511807 -0.284132 -0.601367 -0.303023 1.229110 -0.287650 0.790430 0.227459 0.215621 -0.248915
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.248030 -0.052913 -0.829977 0.701597 -1.102475 0.754861 -1.021077 0.800606 0.501271 0.505311 0.296530
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.927072 0.421558 -0.687420 0.399241 -0.312490 0.471731 -0.345415 0.334738 0.496654 0.508119 0.294845
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.608071 0.904489 0.774756 0.595793 0.743071 1.094516 0.396736 1.868496 0.491294 0.497389 0.290393
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.298882 -1.009193 0.091454 -0.975839 0.415986 -0.294401 0.149105 -0.416048 0.481282 0.493437 0.291823
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 7.303341 8.628615 5.662987 5.609151 1.880333 1.522273 3.234759 1.942421 0.031315 0.061397 0.020309
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.592949 0.365889 -0.799913 0.213551 -0.817733 -0.366570 -0.970243 -1.440482 0.436418 0.443717 0.261788
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.581799 -0.619527 0.620234 -0.778979 0.313443 -0.786710 0.222306 0.489200 0.415232 0.430553 0.260091
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.034854 0.164518 0.467870 1.368361 0.745208 1.476098 0.124269 0.470920 0.430195 0.425341 0.265251
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 0.845670 0.226766 0.053238 -0.265695 0.970548 0.016101 53.695530 0.912004 0.443541 0.446378 0.273878
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.492802 1.771944 0.066496 -0.178151 0.514293 0.218550 0.821283 0.270407 0.468744 0.464275 0.279636
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.321460 -0.327354 -0.147002 -0.553549 1.092905 -0.702096 4.467456 2.821913 0.479245 0.476580 0.288192
54 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.229684 1.516412 0.927678 -0.448528 0.830132 0.700464 -1.409730 -0.713264 0.284699 0.333856 0.148403
55 N04 digital_ok 100.00% 50.69% 100.00% 0.00% 0.012004 28.477302 0.001711 7.219804 -0.422052 1.914364 1.153854 1.287266 0.205747 0.046496 0.063155
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.027464 3.236463 -0.930520 1.942882 -0.427314 0.367167 -0.815529 1.683157 0.502295 0.490688 0.282225
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.869492 -0.098119 -0.702308 -0.444214 -0.445709 0.202494 -0.306776 0.225068 0.504113 0.509882 0.292913
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.563055 8.142295 9.790257 10.214875 1.845421 1.501259 1.547301 1.498583 0.042787 0.041473 0.002716
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.217659 0.735786 9.807924 0.840631 1.801828 0.893559 0.895721 7.975083 0.052685 0.505925 0.353490
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.406267 8.030844 0.158826 10.238680 0.406825 1.471744 0.055224 2.890973 0.475122 0.077852 0.355213
61 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.684774 -1.007488 5.442067 -0.491647 1.838022 -0.231856 0.348966 0.226082 0.038023 0.465996 0.308609
62 N06 digital_ok 0.00% 0.00% 0.00% 0.00% -0.551298 0.351312 0.321161 0.106410 -0.038400 -0.787581 0.333240 -1.336794 0.429462 0.451277 0.264385
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.710730 8.314325 -0.963492 5.948615 -0.899390 1.529723 -0.688500 2.576122 0.440417 0.049731 0.313495
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.731534 -0.683633 -0.844372 -0.040190 0.012498 -0.095590 -0.586007 0.232268 0.429261 0.422734 0.261093
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 14.818668 13.828799 12.239695 12.193387 1.899443 1.573385 4.180082 5.520606 0.024116 0.036466 0.012053
66 N03 digital_ok 100.00% 90.58% 100.00% 0.00% 1.322445 14.181890 0.889688 12.317528 0.537454 1.516795 -1.845909 5.580972 0.176791 0.053400 0.078702
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.977138 -0.114022 -0.595145 0.804665 -0.493401 0.298286 1.599997 1.150047 0.468213 0.466454 0.279956
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 15.649898 0.287582 12.283514 0.044090 1.840968 -0.883202 4.613190 -0.967926 0.039164 0.473944 0.365777
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.822757 3.225258 1.280257 -0.574901 0.673569 -0.163899 2.790216 0.101290 0.495490 0.494451 0.278892
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% 0.278721 1.245717 1.065598 2.357807 0.186455 1.548713 1.663491 0.882652 0.233354 0.215579 -0.248020
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.435270 -0.044226 -0.284527 0.284551 -0.001032 0.088844 -0.463654 0.700633 0.510279 0.517352 0.297233
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.472824 8.328035 2.091472 10.365404 2.574275 1.212432 10.205874 1.488365 0.227144 0.085313 0.014744
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.821772 1.185226 -0.631627 1.004594 0.218754 0.707320 0.307063 2.451766 0.516031 0.520303 0.300459
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.914500 -0.201351 -0.617970 -0.172287 -0.805222 0.276272 -1.081698 0.310043 0.501318 0.515647 0.298403
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 24.648475 5.240428 0.396653 -0.711801 0.383087 -0.505639 1.047331 -0.450121 0.276718 0.396266 0.204468
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 11.482729 0.189012 0.134006 0.177791 -0.228447 -0.629937 0.326326 0.057517 0.327798 0.453327 0.264643
79 N11 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.638192 1.551806 -0.515141 1.005395 -1.143648 0.164055 -1.103121 -1.861781 0.435425 0.418454 0.272121
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 32.861144 24.723877 20.656019 21.639535 4.356320 5.998763 279.947168 226.300554 0.018284 0.016389 0.001575
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 21.631552 25.535768 22.438739 22.113520 8.355854 11.757365 423.482335 544.984514 0.016457 0.016288 0.000830
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 17.826917 19.867830 19.878651 17.449820 9.090058 5.336109 382.280540 196.815010 0.016565 0.016913 0.000827
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.607766 15.490348 0.607115 12.374599 -0.170448 1.409107 -1.835673 4.566771 0.464226 0.058241 0.339153
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.417966 -0.274986 -0.565626 -0.709089 -1.154731 -0.132100 -0.890737 -0.225966 0.489814 0.494908 0.283018
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.383968 0.137994 0.787861 0.092553 0.134301 0.497260 0.206382 12.454399 0.503617 0.508896 0.286074
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 18.543253 1.385159 3.097123 -0.687580 2.052937 -0.789033 52.798413 0.944211 0.428311 0.521067 0.284623
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.441349 0.854276 0.715138 1.279321 0.800989 0.401535 0.474064 0.461070 0.516665 0.518535 0.290158
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.465463 0.318712 0.679849 1.036931 0.925998 0.878956 -0.003446 0.311272 0.516211 0.520742 0.296937
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.605974 -0.901209 -0.092308 -0.765450 0.001032 -0.632739 -0.138810 0.042281 0.509702 0.519396 0.296256
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.009398 0.189869 0.827139 0.583204 1.588074 0.758014 0.487240 0.249693 0.496284 0.511586 0.299165
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.887411 0.136134 9.817618 0.334170 1.892779 0.877918 0.766734 1.030404 0.040183 0.496957 0.341081
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 7.074850 8.260262 9.875668 10.283208 1.836289 1.490547 2.275368 2.185611 0.034190 0.025221 0.004612
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 7.454494 1.545536 9.998413 7.504323 1.798875 1.986423 1.267680 1.329149 0.030332 0.386469 0.257468
95 N11 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.329016 9.438759 0.210947 -0.553550 -0.790460 -0.125131 -1.616203 -0.134178 0.435336 0.360384 0.254413
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.121600 0.763952 -0.891535 0.450858 -0.546349 -0.201440 -0.390298 5.189435 0.435155 0.419268 0.263875
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.090795 3.462002 0.146492 0.945008 0.933452 1.132285 -0.139425 0.509207 0.473471 0.475363 0.281401
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.015591 -0.098759 -0.886980 -0.681091 -0.395702 -0.448536 -0.987937 2.963583 0.491263 0.493327 0.281487
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% -0.305399 1.441504 -0.561934 -0.632363 -0.849742 0.088076 -0.082000 9.886689 0.497256 0.505822 0.283605
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.785904 29.384777 1.120394 5.821288 1.635795 0.765683 1.706675 2.713139 0.503463 0.498979 0.283256
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.288143 0.295336 0.426737 1.058858 0.649684 0.603630 0.182214 0.295291 0.515517 0.519395 0.290957
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.029675 0.341331 0.240414 0.272832 -0.253126 0.176205 0.241177 0.084319 0.515523 0.524486 0.294136
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.105669 0.292885 -0.140302 -0.617246 0.445696 -0.341771 0.225942 1.078404 0.511856 0.517597 0.289550
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.228293 1.875705 1.223087 2.163450 0.205537 1.364568 10.247817 0.652993 0.501382 0.514524 0.295765
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.748162 8.181976 9.878607 10.066684 1.857137 1.545274 0.908718 2.109489 0.070356 0.040152 0.020164
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.997659 -0.424021 0.432826 -0.102424 0.024134 -0.220731 -0.016254 -0.148403 0.385420 0.489597 0.282510
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 4.162965 8.153316 0.987112 10.133670 3.638687 1.521139 24.957769 2.547879 0.427777 0.066359 0.312693
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% 0.498845 2.808255 1.302872 8.502660 0.239361 -0.832000 0.623359 0.960815 0.190957 0.140662 -0.202841
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.249484 1.868069 1.382233 3.354828 0.719982 1.172224 -2.199701 1.182609 0.411482 0.364880 0.247322
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.201049 -0.808677 -0.718268 -0.512518 -0.171489 -0.931109 -0.468149 -0.991506 0.419725 0.419989 0.255851
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 18.868308 27.468238 20.640758 24.134776 5.899573 7.721639 309.880382 423.811912 0.017248 0.016205 0.001121
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 23.398237 24.320343 24.875842 22.542623 14.640965 8.442859 715.282345 346.671396 0.016203 0.016308 0.000730
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.488483 0.130600 2.412218 -0.528561 1.851690 0.224728 1.645896 0.180991 0.476245 0.488468 0.280120
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.587835 1.581085 1.014240 4.999588 0.374637 1.028192 -1.943336 9.207088 0.473648 0.487159 0.274711
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.412487 1.743892 -0.360763 -0.793408 -0.424477 -0.255124 -0.417593 -0.572038 0.507876 0.514092 0.286589
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.225636 0.791754 1.478666 0.436031 0.938039 -0.331563 -1.910606 -1.524524 0.482354 0.511230 0.291613
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 6.965027 -0.187205 9.995616 0.703593 1.821236 0.827667 0.933941 1.010707 0.047370 0.526333 0.347956
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.019826 -0.089403 2.972589 1.192943 1.440205 0.461040 1.300565 0.440694 0.501610 0.519403 0.295681
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.295509 0.433938 0.434312 0.932474 -0.032076 0.967994 1.231959 0.329015 0.507564 0.517948 0.298604
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.696684 -1.086939 9.815986 -0.743115 1.890624 -0.292068 0.737680 0.377854 0.041849 0.499374 0.343342
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.208335 -0.481489 -0.430342 -0.498007 -0.063258 -0.849743 0.296541 1.398969 0.478933 0.487176 0.295430
131 N11 not_connected 100.00% 0.00% 84.76% 0.00% -0.948142 7.518765 -0.674746 5.748283 -1.036453 1.074979 -1.081164 0.810877 0.446689 0.187570 0.311330
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.853860 -0.454871 -0.742328 -0.605367 -1.131661 -0.154771 -0.449280 -0.216721 0.440966 0.431302 0.262795
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.517604 -0.928150 -0.603304 -0.834579 -0.899546 -1.025041 -0.478345 -0.665660 0.429886 0.429392 0.262204
134 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.628438 1.990302 2.498236 1.173730 -0.190383 0.451341 2.848372 -2.002572 0.358218 0.392431 0.247938
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.312274 -0.996818 -0.672204 -0.908204 0.566489 -0.078362 -0.156877 0.014007 0.398489 0.402313 0.258821
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 6.395597 -0.476376 9.591570 -0.209355 1.875409 -0.125166 1.428924 0.385382 0.046523 0.420493 0.290571
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 15.502495 37.578901 19.707520 22.189721 6.724524 7.205816 329.785204 351.007123 0.016552 0.016235 0.000776
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.351419 -0.363400 0.121009 -0.950847 -0.803476 -0.744481 -1.452783 0.431272 0.453424 0.459054 0.268847
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.293270 -1.187930 0.016605 -0.789460 0.862917 -0.899973 12.170889 2.622838 0.481002 0.491826 0.277605
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.342945 -0.463627 0.093624 -0.267807 0.220557 -0.891428 -0.181429 -1.158513 0.498695 0.499038 0.280558
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.481299 8.184875 -0.350953 10.251831 0.979041 1.516813 15.431107 2.360981 0.508925 0.051922 0.399896
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.120590 8.047268 9.640843 10.226478 1.639441 1.507075 0.708440 1.979864 0.120910 0.036446 0.070317
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.393708 -0.629042 -0.400867 -0.109337 0.359188 0.044821 -0.479473 -1.138846 0.518646 0.518471 0.296480
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.027889 0.555928 0.119823 0.764252 -0.272375 -0.421369 -0.023785 0.955319 0.512439 0.513441 0.292963
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.690096 -0.935545 -0.707561 -0.986541 -0.530883 -0.977005 -0.636774 -0.578257 0.478733 0.493838 0.292882
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% 7.240904 -0.558896 -0.623498 0.947765 -0.517954 0.481235 -0.396350 3.665292 0.361460 0.426232 0.250037
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.686639 -0.904689 9.717917 -0.368814 1.882896 0.076371 1.992415 -0.054762 0.047822 0.412557 0.291345
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.259648 8.096218 6.588346 10.113091 0.790686 1.528433 2.967625 2.451229 0.352869 0.044812 0.252825
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.324350 0.292887 0.518344 0.804997 0.727121 0.952722 0.071569 0.286636 0.428313 0.438072 0.268633
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.986928 -1.039350 -0.955720 -0.980023 -0.226804 -0.058448 0.290801 4.589205 0.449657 0.455676 0.275924
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.031916 5.411011 0.043491 -0.357717 -0.438310 0.749115 -0.070223 2.775788 0.438197 0.391084 0.254748
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 7.254495 -0.680576 9.793822 -0.347076 1.857830 0.548230 0.932174 -0.212501 0.050229 0.488306 0.368638
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.466143 15.745726 0.364875 0.482390 0.761363 -0.308547 -0.041671 0.071332 0.492434 0.400252 0.264992
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.509091 -1.139844 -0.423235 -0.951248 -0.647399 -0.168142 0.760793 -0.710624 0.499327 0.507620 0.291464
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.179862 0.885388 0.324164 0.527334 0.790059 0.772983 0.202013 0.281783 0.511759 0.518323 0.295631
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.732866 1.118768 1.585310 1.003315 0.505921 0.863795 3.717790 1.058496 0.505167 0.513216 0.288454
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 7.853054 -0.259750 0.444783 -0.264683 0.412011 0.299905 3.488636 -0.160252 0.437850 0.513255 0.289358
166 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 7.020008 -0.297813 9.952547 -0.129147 1.849316 -0.956646 1.044690 -1.189404 0.039963 0.495350 0.339456
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.516108 -1.153948 0.505602 -0.944394 -0.094879 -1.038628 0.003446 -0.535311 0.425878 0.437864 0.269134
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.940244 0.729499 1.192270 0.249426 0.549888 -0.652124 -2.158911 -1.210951 0.424871 0.422852 0.263735
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.719105 2.834910 1.679005 1.702579 1.246930 1.053544 -2.444357 -2.226413 0.393402 0.383365 0.243866
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.561593 -0.681946 0.302437 -0.235572 0.384962 0.313081 -0.051532 1.158557 0.451993 0.459693 0.281648
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.569920 8.521960 -0.686772 10.332096 0.413108 1.487605 5.174560 2.194749 0.463436 0.058749 0.363837
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.135602 0.573933 1.334146 0.931466 0.887890 0.723731 0.240998 3.518967 0.480528 0.485867 0.290589
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.663959 8.071126 -0.550772 10.047977 -1.014401 1.530613 -0.561064 2.632595 0.494338 0.054804 0.354951
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.223129 0.804878 0.513047 0.926702 1.563883 0.933460 0.254772 0.418131 0.499256 0.500872 0.284828
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 5.991946 -0.408172 8.258539 -0.113876 2.915786 -0.408744 4.277003 -0.032801 0.316153 0.509465 0.319773
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.639279 -0.121040 -0.923424 0.012371 -0.316414 -0.193805 -0.650009 0.054318 0.505714 0.509446 0.290846
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.857361 -1.150064 -0.352556 -0.798327 -1.081232 -0.906886 -1.262967 -0.804868 0.493468 0.497302 0.283684
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.205993 -0.465953 -0.127961 -0.346702 0.384704 -0.914639 1.083476 -0.976471 0.483814 0.485546 0.284078
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% 2.251523 3.016026 1.384770 1.795136 0.891559 1.085476 -2.239713 -2.377134 0.413354 0.392042 0.253936
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.950685 2.599973 1.800319 1.581286 1.283055 0.944430 -2.494668 -2.256192 0.391770 0.386759 0.243580
200 N18 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.795972 17.855485 5.609166 0.332027 1.883274 0.614756 1.526140 3.577060 0.043781 0.231457 0.146719
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.297443 2.351146 0.872581 1.496680 1.029379 0.769327 -1.843721 -2.229365 0.452849 0.438956 0.273468
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.243524 -0.675752 0.163728 -0.439432 -0.678275 -0.011513 -1.534609 22.228228 0.470072 0.472431 0.273654
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.403831 5.284904 1.607104 -0.608365 1.213867 -0.191883 12.109647 0.089181 0.486591 0.490201 0.281777
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.676034 -0.972729 4.111934 -0.849684 -0.202211 -0.403522 1.387864 6.389395 0.309415 0.483981 0.322739
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.692356 1.781535 1.725916 3.012806 -0.830105 -0.675413 0.430045 0.795315 0.434069 0.408307 0.248541
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.697935 -0.911126 -0.916833 -1.000548 -0.734939 -0.485634 2.180124 -0.690031 0.450143 0.468154 0.278735
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.431510 8.397873 -0.570081 5.933192 -0.512272 1.482300 -0.179107 1.476080 0.431991 0.043227 0.338889
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.667035 -1.016903 -0.393235 -1.006013 -1.238090 -0.723417 0.088646 -0.567541 0.456850 0.455243 0.271814
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.943357 -0.760754 -0.986903 -1.008014 -0.532936 -0.718189 2.079026 -0.648503 0.463492 0.468054 0.277317
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.688109 -0.541848 -0.687193 -0.516970 -1.053817 -1.063512 0.529377 -0.947249 0.468211 0.473119 0.278083
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.910630 -0.073812 -0.288233 1.626280 -0.176250 0.160334 0.016568 8.367967 0.463971 0.441106 0.272740
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.169252 2.873791 1.966024 1.754714 1.494947 1.042792 -2.552704 -2.334804 0.426693 0.428882 0.254270
225 N19 RF_ok 100.00% 0.00% 100.00% 0.00% -0.061598 7.855412 -0.116030 5.718900 -1.205171 1.312954 -1.390656 1.934933 0.463565 0.137639 0.350953
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.982083 7.003670 -0.970647 -0.503821 -0.990733 -0.393834 -0.845971 -0.016466 0.456188 0.382233 0.263850
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 0.899150 -0.655665 2.295657 -0.581726 0.012828 -0.443007 13.175526 3.457105 0.397128 0.439041 0.277442
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.036745 -0.602799 -0.162351 -0.615203 -1.130140 -0.047560 -0.626344 0.032710 0.438735 0.432019 0.262769
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.014072 0.243870 -0.211796 0.174362 -0.827025 -0.665930 -1.047779 -1.435590 0.435167 0.424123 0.270126
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.234784 -0.939424 0.612815 -0.757203 0.109204 -0.108925 1.478501 -0.483373 0.412527 0.432843 0.272342
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.140275 -0.335325 -0.090309 -0.136772 -1.049881 -0.976991 -1.388723 -1.255565 0.449631 0.447508 0.280493
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.049601 -0.689554 -0.854239 -0.562495 -0.981149 -0.905320 -0.830810 0.236938 0.456184 0.453198 0.279982
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.331745 -0.429732 0.718238 -0.788244 -0.236681 -0.869764 1.851156 -0.386432 0.430609 0.456096 0.281943
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.181542 -0.829181 -0.787819 -0.523694 -0.879575 -1.070545 -0.321142 -0.984387 0.457510 0.455010 0.280614
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.760632 0.122760 -0.644510 0.038596 -0.578641 -0.553511 -0.539378 -1.253580 0.358603 0.447213 0.271780
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.710543 -1.029090 -0.078502 -0.700261 -0.079692 -0.418725 0.239600 -0.336393 0.386868 0.443061 0.272593
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.339904 -0.646975 0.084964 -0.026684 -0.373601 0.423884 0.737658 1.302351 0.435032 0.436299 0.261830
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.046757 -0.584079 -0.041537 -0.897628 -1.014366 -0.794743 -1.505843 -0.151088 0.439895 0.432400 0.265281
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.775397 8.706983 -1.013722 5.575676 -0.577385 1.516503 -0.581803 0.846566 0.431073 0.043107 0.334992
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.466750 -0.482280 -0.464901 -0.741736 -1.149927 -0.930358 1.958102 -0.801960 0.436194 0.426298 0.265786
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 4.834742 6.498755 0.255096 0.449222 1.243289 0.661592 0.129275 0.622043 0.433441 0.425881 0.272950
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.431251 0.420004 0.785980 0.148346 -0.031327 -0.560065 -1.820971 -0.970946 0.340616 0.318775 0.216063
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.007089 1.189699 0.109219 0.258929 -0.834717 -0.630145 -0.683322 -1.326600 0.331464 0.312279 0.209172
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.214226 -0.992456 -0.017075 -0.599157 -1.051979 -0.373767 -1.390432 -0.307053 0.364404 0.346240 0.237168
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 7.652366 8.369882 5.527389 6.054178 1.809637 1.458477 0.821525 0.863064 0.046140 0.043258 0.002920
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.698466 -0.009398 -0.105200 -0.578816 -0.160446 0.095058 0.610493 0.160834 0.331510 0.322181 0.210477
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, 7, 15, 17, 18, 19, 27, 28, 31, 32, 34, 37, 38, 40, 42, 47, 51, 53, 55, 58, 59, 60, 61, 63, 65, 66, 68, 70, 72, 77, 78, 79, 81, 82, 83, 84, 86, 87, 92, 93, 94, 95, 96, 97, 103, 104, 108, 109, 110, 111, 112, 113, 117, 118, 121, 124, 127, 131, 136, 137, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 165, 166, 167, 168, 169, 170, 180, 182, 184, 189, 190, 191, 200, 202, 204, 205, 208, 209, 210, 211, 223, 225, 226, 227, 242, 243, 246, 262, 329]

unflagged_ants: [5, 8, 9, 10, 16, 20, 21, 22, 29, 30, 35, 36, 41, 43, 44, 45, 46, 48, 49, 50, 52, 54, 56, 57, 62, 64, 67, 69, 71, 73, 74, 80, 85, 88, 89, 90, 91, 101, 102, 105, 106, 107, 114, 115, 120, 122, 123, 125, 126, 128, 132, 133, 134, 135, 139, 141, 144, 145, 146, 157, 162, 163, 164, 171, 172, 173, 179, 181, 183, 185, 186, 187, 192, 193, 201, 206, 207, 220, 221, 222, 224, 228, 229, 237, 238, 239, 240, 241, 244, 245, 261, 320, 324, 325, 333]

golden_ants: [5, 9, 10, 16, 20, 21, 29, 30, 41, 44, 45, 54, 56, 62, 67, 69, 71, 85, 88, 91, 101, 105, 106, 107, 122, 123, 128, 141, 144, 145, 146, 157, 162, 163, 164, 171, 172, 173, 181, 183, 186, 187, 192, 193]
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_2460076.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 [ ]: