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 = "2460080"
data_path = "/mnt/sn1/2460080"
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-15-2023
In [5]:
# Per-season options
def ant_to_report_url(ant):
    return f'https://htmlpreview.github.io/?https://github.com/HERA-Team/H6C_Notebooks/blob/main/antenna_report/antenna_{ant}_report.html'

Load Auto Metrics¶

In [6]:
use_auto_metrics = False

# find the auto_metrics file
glob_str = os.path.join(data_path, f'zen.{JD}*.auto_metrics.h5')
auto_metrics_file = sorted(glob.glob(glob_str))

# if it exists, load and extract relevant information
if len(auto_metrics_file) > 0:
    auto_metrics_file = auto_metrics_file[0]
    print(f'Found auto_metrics results file at {auto_metrics_file}.')
    
    auto_metrics = load_metric_file(auto_metrics_file)
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
    auto_ex_ants = auto_metrics['ex_ants']['r2_ex_ants']
    
    use_auto_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping auto_metrics.')
Found auto_metrics results file at /mnt/sn1/2460080/zen.2460080.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/2460080/zen.2460080.?????.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/2460080/zen.2460080.?????.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 2460080
Date 5-15-2023
LST Range 15.093 -- 17.034 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, 72, 112
Total Number of Nodes 19
Nodes Registering 0s N15
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 64 / 198 (32.3%)
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, 29, 37, 38, 40, 42, 45, 53,
55, 65, 66, 70, 72, 81, 83, 86, 93, 94, 109,
111, 112, 118, 121, 124, 127, 136, 147, 148,
149, 150, 151, 158, 160, 161, 165, 166, 167,
168, 169, 170, 181, 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, 74, 79, 80, 89, 90, 95, 113, 114, 115,
120, 126, 132, 133, 135, 139, 179, 185, 201,
206, 207, 220, 221, 222, 223, 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_2460080.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.144769 8.210558 -0.939442 -0.459875 -0.536368 -0.285651 -0.640528 -0.284013 0.450899 0.336767 0.284709
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.136532 0.893551 0.499982 3.050440 0.826293 1.461688 0.213229 1.216540 0.465417 0.449930 0.294018
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.922702 -0.187890 -0.395469 0.200345 -0.140077 0.331017 1.921785 6.356322 0.469674 0.462406 0.287906
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.656764 1.639305 1.195880 1.190515 0.477772 0.452740 -1.433377 -1.427492 0.434670 0.431893 0.268017
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.375827 -0.534011 3.113458 -0.425587 2.559101 0.391212 2.429235 -0.101597 0.451963 0.458549 0.283220
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.786839 -0.885046 -0.735590 -0.650841 -0.999596 -0.056577 -0.792394 0.131668 0.445262 0.440810 0.275818
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 7.016834 0.024537 -0.053227 -0.115816 -0.236423 0.621929 0.542119 1.475656 0.372719 0.464088 0.291881
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.134165 1.393876 0.276624 0.975908 -0.662032 0.189158 -1.262064 -1.578918 0.458928 0.447977 0.288017
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.255250 1.275035 0.919425 8.583498 1.097632 -0.387855 0.633277 5.287680 0.481842 0.382283 0.326939
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.330418 3.558713 0.939127 0.962425 0.609453 0.142245 5.739083 15.883507 0.453900 0.277419 0.330311
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.422655 0.552903 -0.174123 1.651896 -0.101742 6.564752 0.078508 15.183880 0.484844 0.485922 0.293225
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.050953 -0.848694 1.359375 -0.346445 2.698224 0.199821 1.946582 0.045631 0.479957 0.476558 0.287479
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.062727 0.096914 0.029426 0.278106 0.640955 0.718533 0.673054 0.498174 0.460508 0.463002 0.279315
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.787501 -0.864575 -0.099731 -0.495176 -0.275937 -0.149857 0.199157 -0.142975 0.426909 0.426970 0.271205
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.864913 13.307999 10.391932 6.649131 0.776108 0.563414 4.819499 51.548385 0.068274 0.060480 -0.006887
28 N01 RF_maintenance 100.00% 100.00% 45.43% 0.00% 5.690890 7.931197 10.682713 4.423629 1.544679 0.497255 2.050664 16.993274 0.030372 0.211118 0.158851
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 5.761668 6.837064 10.482986 10.677781 1.539986 1.409181 2.137236 1.437443 0.029763 0.038803 0.009422
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.277343 -0.886868 0.760856 -0.595536 0.797075 -0.246811 1.747526 -0.034510 0.495616 0.497743 0.297707
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.345995 0.517334 1.054666 3.454994 1.280922 0.878636 0.805558 1.438366 0.499131 0.489122 0.293831
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.238171 -0.880151 0.181883 -0.983610 -0.840392 -0.526869 1.537924 0.816789 0.407622 0.485372 0.273616
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 6.489580 -0.459560 6.419027 -0.549019 1.532307 -0.958933 1.656201 -0.283541 0.046007 0.447959 0.311393
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.422588 -0.979697 -0.250015 -0.495389 -1.006126 -0.226244 -1.093194 -0.164998 0.441190 0.439217 0.272839
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.505992 2.445547 1.169481 0.728427 0.836548 0.718591 0.646915 1.301981 0.439666 0.428861 0.272516
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.853848 11.796588 -0.606092 12.791563 -1.013441 1.415529 -0.840535 3.266042 0.449357 0.035333 0.350122
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.044867 -0.099107 0.046296 0.720997 0.313936 0.528501 1.225409 7.853944 0.462062 0.459673 0.283664
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.275716 0.042609 0.429972 -0.373873 -0.066981 0.708050 35.860481 0.644770 0.205633 0.200007 -0.253473
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.595740 1.492217 1.105707 3.067432 1.155458 1.132801 0.724425 1.140700 0.492623 0.489977 0.302085
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.229158 0.058260 -0.148558 -0.762198 -0.300523 0.259744 -0.014003 0.565816 0.221237 0.210310 -0.255512
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.976308 0.154900 -0.860788 0.789681 -0.878895 0.830516 -0.408882 0.951961 0.508038 0.508441 0.307869
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.914644 0.424993 -0.531866 0.470026 -0.194439 0.404579 -0.236802 0.451789 0.501615 0.511739 0.303597
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.715035 0.887438 0.914500 0.605135 1.072774 0.654986 0.707565 5.504184 0.501697 0.502791 0.300738
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.053241 -0.966990 0.186293 -0.967428 0.632533 -0.249197 0.745654 -0.186662 0.490355 0.495194 0.300927
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.635651 0.200388 -0.870258 0.135983 -0.951979 -0.511510 -0.724010 -1.106418 0.447820 0.448335 0.273457
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.584923 -0.620522 0.749559 -0.789647 0.209282 -0.814633 0.356172 -0.427784 0.431190 0.436289 0.272670
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.415662 0.484174 -0.039696 1.432447 0.316280 1.244771 -0.035504 0.667203 0.435049 0.428377 0.271441
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 0.688099 -0.176696 0.264304 -0.167095 0.284828 0.348295 38.771890 0.368394 0.450974 0.450514 0.281796
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.288119 1.642371 0.670383 0.260648 0.779426 0.604086 1.185150 0.773044 0.474239 0.468441 0.286410
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.255335 -0.448792 -0.118006 -0.606038 0.820966 -0.598713 5.061412 2.777843 0.486639 0.480144 0.295922
54 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.272359 1.091203 0.623758 -0.328488 0.951129 1.073113 -0.767921 -0.569438 0.265395 0.321732 0.148268
55 N04 digital_ok 100.00% 68.98% 100.00% 0.00% -0.077135 23.655227 -0.082815 8.004244 -0.521056 1.453462 0.974471 1.211726 0.199875 0.043076 0.064771
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.774992 2.889196 -0.964499 2.293235 -0.750606 1.059183 -0.479385 1.806410 0.507379 0.495784 0.294949
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.699129 0.338297 -0.732500 -0.612555 -0.454316 0.082866 -0.086787 1.244425 0.509914 0.512152 0.298344
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.423439 6.750472 10.681129 11.048014 1.531841 1.402252 1.815699 1.790137 0.040469 0.039948 0.002824
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.965899 0.605867 10.685622 0.767037 1.518698 0.921102 1.250907 1.513581 0.048902 0.512251 0.370751
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.097707 6.661401 -0.087469 11.076858 0.011165 1.367728 0.174108 3.181151 0.486604 0.075027 0.371602
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.251663 0.218437 1.229124 0.069123 0.396443 -0.676637 1.467994 -1.078564 0.432110 0.456488 0.275412
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.773706 6.915714 -0.961327 6.565893 -0.749852 1.416964 -0.423400 2.826050 0.455461 0.046393 0.334639
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.792541 -0.667910 -0.827613 -0.018473 -0.525746 0.048639 -0.399667 0.150591 0.445186 0.434999 0.269818
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 12.632603 11.726501 13.308629 13.177325 1.545195 1.435307 4.521534 5.835299 0.023702 0.033640 0.010193
66 N03 digital_ok 100.00% 83.10% 100.00% 0.00% 1.003701 12.137713 0.750940 13.300559 0.305866 1.384909 -1.116267 5.602476 0.171047 0.048785 0.078903
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.913881 -0.081810 -0.438808 0.769907 -0.261588 0.553970 2.155606 1.122974 0.474858 0.472587 0.286743
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 6.613609 0.019459 11.664660 -0.114109 2.985471 -0.837889 64.603106 -0.706124 0.040034 0.476382 0.373010
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.978393 -0.367888 1.448976 -0.574083 1.077387 -0.463767 2.443578 0.136280 0.502238 0.501555 0.293045
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% 0.344596 1.241749 1.214753 2.363579 0.209253 1.885308 2.637313 1.051380 0.232725 0.217375 -0.253230
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.668204 0.208816 -0.186238 0.436551 0.198870 0.587464 -0.115739 1.046365 0.517393 0.523464 0.308221
72 N04 digital_ok 100.00% 7.48% 14.13% 85.87% 0.678757 2.678336 2.342357 9.623561 1.684683 -0.381962 25.269441 1.718490 0.229071 0.163142 -0.179299
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.619527 1.296313 -0.593322 1.404284 -0.235858 1.627916 0.103197 5.711842 0.521546 0.526224 0.308766
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.159845 -0.396560 -0.705275 -0.164740 -0.846499 -0.295942 -0.258241 1.021432 0.508641 0.521129 0.307434
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% 8.691565 0.150704 0.335669 0.181411 -0.512556 -0.491822 0.286753 -0.962721 0.345521 0.463333 0.271083
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.143732 -0.847592 0.876222 -0.794950 0.122270 -0.577785 1.259505 -0.030863 0.444084 0.453716 0.273762
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.712241 1.261932 -0.619301 0.974741 -1.096075 0.290480 -0.830890 -1.426060 0.450487 0.427323 0.279443
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 19.483258 21.343701 21.246042 23.827562 3.578807 5.100193 278.034547 266.256935 0.018062 0.016303 0.001564
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.913369 24.842347 29.972079 27.086936 16.540026 11.622322 840.416310 646.366724 0.016219 0.016216 0.000733
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 18.041503 18.935399 23.586669 20.433849 6.572452 4.068509 464.724815 285.451775 0.016338 0.016564 0.000754
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.287366 13.122509 0.384056 13.372433 -0.380924 1.304076 -1.360706 4.636408 0.472499 0.052800 0.346928
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.287433 -0.549134 -0.505317 -0.640879 -1.241811 -0.180159 -0.975794 -0.199836 0.497776 0.501988 0.291699
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.377288 -0.071480 1.016268 0.147905 1.039966 0.711320 0.467212 9.101828 0.513267 0.516202 0.295180
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 14.318432 0.909990 2.635754 -0.730442 0.969635 -0.565913 16.130526 0.270518 0.429585 0.527531 0.283448
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.235283 0.710731 0.820095 1.384475 0.741506 0.777486 0.412945 0.617988 0.520764 0.523817 0.297273
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.478758 0.333278 0.803086 1.015806 0.971223 1.157246 0.296305 0.562691 0.525944 0.530563 0.309042
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.556335 -0.720838 -0.612695 -0.739322 -1.128822 -0.868824 -0.850461 -0.089121 0.515796 0.525965 0.306275
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.047539 0.156437 0.867689 0.619586 1.367881 0.888097 0.437430 0.404439 0.508884 0.519722 0.312988
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.704646 0.101478 10.735933 0.439766 1.541945 0.651847 1.420999 1.085670 0.036695 0.502882 0.345056
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 5.877945 6.837513 10.766828 11.116096 1.528163 1.400116 2.699828 2.482048 0.032372 0.025126 0.003552
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.224265 3.019510 10.882810 9.571855 1.537854 -0.098579 1.627965 0.955589 0.028727 0.312976 0.197695
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.130200 -0.480930 -0.063773 -0.320656 -0.232892 -0.952366 0.024196 -0.779633 0.448466 0.461579 0.279009
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.197365 7.957725 0.144061 -0.501511 -0.773100 -0.596530 -1.243760 0.151326 0.453459 0.375117 0.255764
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.084885 0.482753 -0.878301 0.430597 -0.679609 0.155525 -0.461037 5.679470 0.448636 0.433825 0.269816
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.368872 2.711401 0.223613 0.958162 0.904130 1.136403 0.113239 0.654454 0.482461 0.480841 0.288349
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.006168 0.145840 -0.834022 -0.198887 -0.021286 0.280818 -0.456604 5.866529 0.500275 0.500105 0.289411
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.662126 0.982531 1.121124 -0.882162 0.399078 -0.320188 -1.708666 0.241703 0.483152 0.512241 0.295558
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.533403 24.353839 2.250789 6.311053 2.511544 1.516364 2.602634 1.221477 0.514917 0.507233 0.295610
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.419144 -0.040451 -0.038114 0.636925 0.010662 0.440531 0.230866 0.314861 0.522791 0.527190 0.298027
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.064392 0.193840 0.213340 0.352933 0.141356 0.405021 0.732741 0.221060 0.526188 0.534150 0.304851
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.883438 1.464339 0.370712 -0.175617 0.795997 0.031310 0.618825 1.326074 0.523149 0.525017 0.296933
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.223937 1.763950 1.522907 2.260622 0.918215 1.195427 6.286656 0.943057 0.511738 0.522946 0.307660
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 5.589350 6.807323 10.791580 10.907229 1.510330 1.414315 1.298265 2.234779 0.065809 0.039008 0.019531
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.358043 -0.345672 0.567819 -0.052157 -0.301935 0.393474 0.178919 0.085667 0.398961 0.499146 0.292592
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 8.471732 6.773092 1.787736 10.975121 0.314187 1.383995 1.031840 2.761017 0.396351 0.064669 0.270216
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% 0.461805 1.825563 1.348541 9.051785 0.273619 -0.517412 1.312312 1.114144 0.199859 0.147027 -0.212409
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.203425 2.382821 1.541763 1.687638 0.897325 0.982833 -1.851792 -1.800649 0.431797 0.422717 0.261687
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.873077 1.114021 1.287811 3.480607 0.658753 -0.595741 -1.661664 1.532031 0.422526 0.386962 0.249715
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.928405 -0.719318 -0.593388 -0.473333 -0.114411 -0.911638 -0.276707 -0.789215 0.432986 0.430489 0.265266
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 14.780183 29.930946 21.317953 26.578188 4.076514 7.063246 253.469327 418.881853 0.017284 0.016178 0.001163
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 15.531476 17.331430 23.091189 22.481155 6.006086 3.692821 410.378205 274.880594 0.016364 0.016340 0.000715
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.699471 -0.334872 2.517520 -0.783555 2.198169 -0.556716 2.188236 -0.560109 0.486823 0.492661 0.286582
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.395290 1.686383 0.872321 1.235938 0.112591 1.223793 -1.493193 5.146860 0.483308 0.511834 0.296224
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.797979 1.117463 -0.235115 -0.792669 0.082975 -0.223017 -0.061087 -0.338472 0.518114 0.522951 0.296744
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.773151 0.459952 1.373360 0.400429 0.745760 -0.279531 -1.509499 -1.206900 0.492829 0.519723 0.300367
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 5.760368 -0.039971 10.898396 0.732900 1.522637 0.830646 1.319872 1.078727 0.044591 0.537529 0.358199
125 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.258936 0.215689 5.505130 1.397633 -0.068268 0.848784 1.456127 0.595947 0.482291 0.532345 0.313699
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.115931 0.189471 0.757033 0.853214 0.300570 0.913291 1.729569 0.477091 0.513407 0.529397 0.309929
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 5.526845 -1.061023 10.722911 -0.716493 1.534439 -0.680825 1.141591 -0.365740 0.039085 0.506647 0.347758
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.211584 -0.415327 -0.342016 -0.425933 0.003802 -0.945412 0.775704 1.236548 0.492766 0.496118 0.308342
131 N11 not_connected 100.00% 0.00% 65.93% 0.00% -0.935426 6.150924 -0.803334 6.320474 -1.177205 0.785029 -0.763060 1.278619 0.461248 0.196775 0.319379
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.025109 -0.576634 -0.907011 -0.562441 -1.031028 -0.137386 -0.542751 0.029977 0.457734 0.450115 0.272936
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.608871 -0.864009 -0.544527 -0.939657 -0.500899 -0.889881 -0.255959 -0.285182 0.442488 0.439274 0.269582
134 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.348745 1.612837 2.743409 1.131744 0.183700 0.433619 5.061978 -1.552987 0.371302 0.397849 0.253988
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.874064 -1.001046 -0.451033 -0.980920 0.060705 -0.297172 0.527138 -0.006731 0.402736 0.403283 0.264779
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 5.298053 -0.321771 10.491025 -0.150759 1.545656 -0.057765 1.649841 0.613744 0.042273 0.423635 0.295175
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 17.357127 42.410866 23.775560 30.039341 7.116249 9.231639 484.389227 647.571197 0.016322 0.016148 0.000750
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.289762 -0.434697 0.051997 -0.849490 -0.706936 -0.717914 -1.174949 0.822170 0.461781 0.465374 0.277400
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.243065 -1.153669 0.320638 -0.876411 0.572291 -0.765496 0.662693 1.271000 0.497838 0.497103 0.286390
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.361234 -0.616120 0.150191 -0.405098 0.130647 -0.872505 0.273408 -0.814961 0.509483 0.506121 0.290097
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.564899 6.816755 -0.312424 11.090221 0.204303 1.402426 10.899860 2.322169 0.516839 0.048363 0.408535
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.818726 6.764279 10.788258 11.070257 1.529077 1.403511 1.261747 2.221777 0.039668 0.034932 0.004970
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.356241 -0.645226 -0.284643 -0.161533 0.262398 -0.766691 -0.097532 -0.582558 0.531689 0.526322 0.307453
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.317137 0.752597 0.534996 1.371932 0.855721 0.672344 0.373170 1.496498 0.526942 0.525589 0.303650
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.669942 -0.873375 -0.559442 -0.997803 -0.549228 -0.705579 -0.323274 -0.035638 0.491260 0.503511 0.303668
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% 5.176633 -0.395228 -0.579119 1.022994 -0.555877 0.414681 -0.396261 5.518230 0.377883 0.441194 0.260904
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.628692 -0.527366 10.627147 -0.087983 1.539883 0.744391 2.486287 0.822337 0.042857 0.412455 0.295392
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.486451 6.741127 6.777356 10.960598 1.375450 1.417158 5.743952 2.464433 0.369853 0.041882 0.270465
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.369695 0.242667 0.587160 0.717469 0.584201 0.923177 0.264854 0.589908 0.435556 0.442919 0.276202
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -1.039801 -1.109943 -0.952896 -0.978472 -0.596757 -0.518913 0.830566 6.635622 0.455819 0.458676 0.282258
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.024098 6.855211 0.348918 0.223119 0.054054 -0.373909 0.237497 0.406980 0.446309 0.363337 0.253384
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 6.005797 -0.725513 10.694296 -0.403126 1.535296 0.142283 1.387460 0.044619 0.047716 0.496036 0.381037
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.444515 13.064728 0.468541 0.552830 0.814802 -0.236754 0.279336 0.201323 0.502876 0.408764 0.270410
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.443078 -1.043454 -0.366848 -0.913493 -1.096459 -0.234928 -0.856708 -0.515323 0.506837 0.513811 0.299949
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.319555 0.734457 0.432672 0.504949 0.755430 0.784196 0.359259 0.532452 0.524051 0.526400 0.305179
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.874174 0.968832 1.873070 1.019907 1.240222 0.994193 1.921105 1.972742 0.516337 0.522193 0.299694
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 6.891621 -0.456707 1.071245 -0.396369 0.016849 0.058242 1.387551 0.210234 0.426918 0.521188 0.280552
166 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 5.806566 -0.313399 10.859537 -0.147481 1.534895 -0.669446 1.421698 -0.907772 0.037026 0.501661 0.345719
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.340723 -1.275232 1.164905 -0.780288 0.233034 -0.430620 0.435035 0.023839 0.441023 0.449872 0.280898
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.576409 0.568684 1.093617 0.250823 0.428259 -0.357009 -1.655543 -1.026708 0.432546 0.430169 0.271876
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.178916 2.331123 1.544011 1.651781 0.931432 0.945673 -1.848985 -1.707170 0.402580 0.388209 0.251225
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.494475 -0.855306 0.528642 -0.441972 0.299981 -0.321495 0.418041 -0.077684 0.458819 0.464508 0.289761
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.510923 7.072719 -0.687639 11.168901 -0.258249 1.397415 5.288051 2.528558 0.469494 0.055008 0.371469
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.291011 1.166789 1.883836 2.372393 1.025601 1.420339 0.755720 8.431281 0.487643 0.489647 0.297858
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.602164 6.741021 -0.449310 10.900150 -1.136105 1.408332 0.572948 2.938838 0.502543 0.051777 0.365806
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.113031 1.100653 0.525699 0.958436 0.780427 0.960462 0.510900 0.861363 0.511262 0.509486 0.295095
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 6.011307 -0.254568 9.630118 0.081525 0.180522 0.398383 1.127469 0.206843 0.255686 0.518590 0.332880
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.544693 -0.102434 -0.872444 0.126933 -0.499073 0.260770 -0.529239 0.285448 0.515377 0.517695 0.299113
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.864931 -1.107705 -0.481506 -0.904022 -1.194570 -0.725732 -0.891108 -0.531119 0.503192 0.504760 0.292482
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.529126 -0.377354 -0.435360 -0.317511 -0.363483 -0.808124 0.440116 -0.689545 0.496162 0.493585 0.295868
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% 1.300936 2.575047 0.926952 1.807046 0.281374 1.089350 -1.471244 -1.851662 0.431202 0.395968 0.271902
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.479214 2.230518 1.735146 1.592058 1.114563 0.914961 -1.888393 -1.790764 0.397796 0.389874 0.250563
200 N18 RF_maintenance 100.00% 100.00% 0.83% 0.00% 6.488632 14.092726 6.296539 0.427836 1.545613 1.401333 2.168542 1.599761 0.041159 0.222789 0.141556
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.874342 1.981748 0.676329 1.471214 0.062931 0.755518 -1.481188 -1.757401 0.462484 0.444823 0.283128
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% -0.011121 -0.941712 0.032605 -0.947038 -0.929764 -0.398752 -1.157251 10.091764 0.483127 0.485712 0.287333
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.587713 4.089960 1.949409 -0.577063 1.128212 -0.202448 16.292307 0.370057 0.496339 0.497255 0.289454
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.486367 -0.823270 5.088777 -0.571682 -0.581210 0.003472 1.292153 0.891421 0.322520 0.495301 0.334643
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.420064 1.157672 2.272274 3.287174 -0.592440 -0.301128 0.583098 1.105319 0.441310 0.420182 0.253034
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.063411 -0.589898 -0.842400 -0.114935 -0.758045 0.035776 2.678212 0.298435 0.463644 0.475290 0.288020
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.467150 6.958964 -0.380521 6.533034 -0.382165 1.396547 0.234597 1.700316 0.444096 0.040978 0.350474
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.758843 -1.106756 -0.498126 -0.916060 -1.161747 -0.351266 -0.040020 -0.391204 0.467835 0.464547 0.282139
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.823093 -0.761013 -0.823037 -0.983535 -0.606918 -0.682982 0.804504 -0.438224 0.475983 0.475602 0.286329
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.643501 -0.549056 -0.672652 -0.584375 -1.175924 -1.015166 0.339708 -0.675927 0.479432 0.480780 0.286700
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.843075 0.062924 -0.108848 2.087945 -0.082017 0.459195 -0.026772 1.906297 0.475293 0.445711 0.282265
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.615424 2.414456 1.865993 1.733154 1.252676 1.013608 -1.911828 -1.788925 0.434102 0.435183 0.265892
225 N19 RF_ok 100.00% 0.00% 98.34% 0.00% -0.131212 6.479617 -0.164038 6.303329 -1.043109 1.169444 -1.096009 2.058418 0.473068 0.137333 0.363915
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.130180 4.962017 -1.011334 -0.532656 -0.935969 -0.512504 -0.518259 -0.428048 0.467734 0.399456 0.275908
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 0.736790 0.028138 2.506747 0.161316 0.020825 0.617136 12.867080 12.296036 0.415051 0.445835 0.283083
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.038743 -0.679039 -0.237057 -0.580664 -1.094541 -0.128208 -0.112963 0.037569 0.450137 0.440006 0.272112
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.038743 0.209743 -0.286228 0.166557 -0.882276 -0.383761 -1.035994 -1.089063 0.444822 0.428316 0.278813
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.135964 -0.939476 0.608924 -0.762076 0.583742 -0.387844 1.142834 -0.308291 0.427687 0.441534 0.281577
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.175782 -0.311556 -0.156583 -0.130780 -0.984427 -0.850198 -1.031690 -1.011342 0.458884 0.454947 0.288693
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.003459 -0.480769 -0.999854 -0.401234 -0.972261 -0.942048 -0.573277 0.396352 0.465972 0.460533 0.289231
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.477165 -0.428687 -0.221380 -0.815877 -1.030446 -0.804362 -0.946507 -0.130483 0.464717 0.462920 0.286267
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.149749 -0.921590 -0.894302 -0.571713 -0.934738 -0.924804 -0.271973 -0.746963 0.468364 0.463535 0.290046
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.958078 0.006308 -0.667291 -0.009041 -0.679135 -0.697322 -0.344084 -0.972065 0.376012 0.454139 0.277974
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.810553 -0.988621 -0.147278 -0.664744 0.035059 -0.184048 5.235839 -0.121594 0.400728 0.452159 0.282157
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.308715 -0.504961 0.241386 0.325187 -0.003802 -0.107128 0.922474 1.125035 0.446025 0.442221 0.270824
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.460432 -0.613129 -0.380921 -0.839981 -1.153614 -0.525954 -1.016290 0.369058 0.452025 0.441519 0.275517
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.780831 7.228366 -1.008373 6.174523 -0.933178 1.408195 -0.270408 1.170247 0.440146 0.040975 0.343674
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.776440 -0.542623 -0.886269 -0.786249 -1.005385 -0.972120 0.455190 -0.578860 0.444259 0.431907 0.273448
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.473538 5.194485 -0.157245 0.553288 0.302981 0.531585 -0.037799 0.489216 0.442970 0.429159 0.280816
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.151508 1.396225 0.703233 0.931890 -0.013431 0.313059 -1.470076 -1.431646 0.346239 0.302515 0.221627
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.786771 0.948299 0.018473 0.233374 -0.830338 -0.474718 -1.093907 -1.170137 0.335139 0.306627 0.212765
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.059874 -1.017393 -0.108310 -0.548559 -1.049799 -0.202064 -1.120946 0.006731 0.372254 0.346026 0.240629
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.343695 6.952334 6.170519 6.644918 1.518141 1.389140 1.237231 1.188234 0.044206 0.041848 0.003108
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.278038 -0.210091 -0.100171 -0.595930 -0.230867 -0.348106 1.600808 0.397474 0.337843 0.319939 0.213629
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, 29, 32, 34, 37, 38, 40, 42, 45, 47, 51, 53, 55, 58, 59, 60, 61, 63, 65, 66, 68, 70, 72, 73, 77, 78, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 102, 104, 108, 109, 110, 111, 112, 117, 118, 121, 124, 125, 127, 131, 134, 136, 137, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 165, 166, 167, 168, 169, 170, 180, 181, 182, 184, 189, 190, 191, 200, 202, 204, 205, 208, 209, 210, 211, 225, 226, 227, 242, 243, 246, 262, 329]

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

golden_ants: [5, 9, 10, 16, 20, 21, 30, 31, 41, 44, 54, 56, 62, 67, 69, 71, 85, 88, 91, 101, 103, 105, 106, 107, 122, 123, 128, 140, 141, 144, 145, 146, 157, 162, 163, 164, 171, 172, 173, 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_2460080.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 [ ]: