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 = "2460070"
data_path = "/mnt/sn1/2460070"
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-5-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/2460070/zen.2460070.42102.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 362 ant_metrics files matching glob /mnt/sn1/2460070/zen.2460070.?????.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/2460070/zen.2460070.?????.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 2460070
Date 5-5-2023
LST Range 14.433 -- 16.379 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 362
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 104 / 198 (52.5%)
Redcal Done? ❌
Never Flagged Antennas 92 / 198 (46.5%)
A Priori Good Antennas Flagged 51 / 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, 164, 165,
167, 168, 169, 170, 181, 182, 184, 189, 190,
191, 202
A Priori Bad Antennas Not Flagged 49 / 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, 125, 126, 132, 133, 135, 139, 185, 201,
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_2460070.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.147864 8.309517 -1.034812 -0.651504 -0.375895 1.238393 -0.793208 4.755420 0.459154 0.363526 0.300539
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.182791 0.475357 0.580038 3.185476 0.720146 0.687527 -0.138766 0.948149 0.471448 0.451520 0.307009
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.731577 -0.110538 -0.371652 0.194246 -0.092550 0.560907 0.323394 8.671571 0.476395 0.466692 0.301719
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.461666 1.666287 1.123396 1.129553 0.146714 0.199813 -1.714838 -1.272959 0.439824 0.434569 0.278179
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.693645 -0.375877 3.155326 -0.312888 1.452731 0.336278 2.292313 -0.090029 0.447021 0.457431 0.289315
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.694795 -0.520140 -0.413008 -0.439318 -1.168701 0.224429 -0.907874 0.686449 0.448519 0.441592 0.289190
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 9.721938 -0.027283 -0.357066 -0.088346 -0.425459 0.521477 -0.101804 1.729153 0.365186 0.466977 0.298712
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.034903 1.321191 0.261320 0.891792 -0.801687 -0.008239 -1.354070 -1.482478 0.467088 0.453010 0.301019
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.130607 2.379481 0.988028 8.319114 1.129073 -0.684109 0.216187 4.810858 0.482935 0.356569 0.338511
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.549380 3.455194 0.972679 1.605948 0.444585 0.658521 8.309705 12.655328 0.455893 0.286770 0.334185
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.328429 0.223858 -0.137843 3.665735 0.262486 1.247807 -0.316893 9.576790 0.486481 0.476379 0.302717
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.549841 -0.951728 1.869458 -0.346270 1.807145 0.127181 1.438179 0.036530 0.471200 0.478082 0.293700
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.300211 0.178401 0.057458 0.425449 0.739111 1.017055 0.382065 0.727152 0.466609 0.470252 0.293120
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.924195 -0.954658 -0.555819 -0.955676 -0.505255 -0.339576 -0.392929 -0.305687 0.431485 0.431527 0.283009
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.824729 16.308268 9.502741 6.147940 1.415911 1.043151 2.882002 43.289388 0.058615 0.059393 -0.023138
28 N01 RF_maintenance 100.00% 100.00% 37.57% 0.00% 6.573366 9.586895 9.690099 4.082788 1.562182 -0.040713 1.492378 10.725557 0.028762 0.209264 0.157684
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.686628 -0.000601 -0.028765 0.131495 0.854374 0.367012 1.713810 1.690468 0.492401 0.494429 0.303514
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.023837 -0.820169 0.209883 -0.576746 0.408199 -0.300066 0.841714 -0.004303 0.498205 0.501035 0.304287
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.454838 0.125591 1.165413 2.807512 1.079453 0.963716 0.354364 22.580910 0.502413 0.492996 0.306246
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.209653 11.783036 0.085762 0.000690 -0.899182 -0.098877 0.119637 1.683207 0.390159 0.420422 0.168918
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.480431 -0.522213 5.637902 -0.709413 1.547045 -0.900624 0.890715 -0.056246 0.038805 0.455846 0.320217
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.636236 -0.632515 -0.328659 -0.348544 -1.278709 -0.238158 -1.238524 0.251539 0.448903 0.443280 0.289172
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.990610 3.305433 1.065026 0.826722 0.877230 0.700709 0.169848 0.926694 0.456258 0.441818 0.294758
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.877233 13.685464 -0.748838 11.791013 -0.980800 1.289575 -1.032437 2.677778 0.460161 0.030224 0.367130
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.047549 -0.299233 -0.008582 0.510196 0.314648 0.292613 3.951118 9.162993 0.468326 0.463655 0.295166
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.241849 0.389051 0.256930 -0.266966 -0.204593 1.021234 24.314086 0.895688 0.197932 0.191416 -0.259560
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.541511 1.092840 1.315923 2.018283 0.978217 1.129052 0.111923 0.576879 0.493558 0.494971 0.308142
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.275396 0.843102 -0.190096 -0.520605 -0.608441 0.673423 -0.111033 1.905100 0.216509 0.205587 -0.260423
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.171309 0.000601 -1.025484 0.844937 -0.593728 0.476606 -0.891558 0.804876 0.509549 0.509702 0.312298
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.732011 0.493473 -0.596114 0.543026 -0.216563 0.474388 -0.557486 0.215150 0.507373 0.514825 0.312753
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.561836 0.717927 0.934212 0.733293 0.675559 0.681556 0.200334 2.134462 0.501420 0.505300 0.308925
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.216869 -0.794834 0.243409 -0.933468 0.604390 -0.179415 0.228340 -0.151541 0.491999 0.502062 0.307345
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 7.017185 8.417683 5.562436 5.537275 1.610758 1.355660 2.532846 1.504711 0.030711 0.049411 0.013144
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.571627 0.141690 -0.964541 0.093161 -0.843655 -0.665948 -0.771988 -0.994815 0.456321 0.458172 0.283587
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.519538 -0.388668 0.274290 -0.647702 0.139967 -0.922716 -0.089360 0.674531 0.430991 0.444006 0.281406
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.174942 0.283403 0.605489 1.551712 0.975426 1.322667 -0.001260 0.451958 0.447622 0.437517 0.289778
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.285474 0.358395 -0.009700 -0.109505 1.265225 0.200344 91.747647 0.252677 0.458694 0.456738 0.292881
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.913268 2.260415 0.672430 0.387365 0.891320 0.418714 2.611460 0.498892 0.484168 0.473916 0.300993
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.199700 -0.225497 0.036818 -0.790110 0.139929 -0.554377 6.579177 4.562392 0.490893 0.484762 0.305520
54 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.521674 1.359127 0.941537 -0.531503 0.693736 0.514533 -1.280098 -0.250714 0.290334 0.329560 0.151747
55 N04 digital_ok 100.00% 69.61% 100.00% 0.00% -0.149753 28.284138 -0.123532 7.122629 -0.691418 1.251477 1.354246 0.808064 0.198532 0.036339 0.065111
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.302725 1.301741 -0.998811 2.184819 -0.680084 0.482840 -0.674450 0.819727 0.508078 0.499323 0.304694
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.819547 1.458567 -0.917187 -0.285899 -0.432281 0.588281 -0.070487 0.629292 0.508504 0.507011 0.301612
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.254983 7.966272 9.705441 10.160630 1.553890 1.307546 1.068534 1.353884 0.034480 0.034268 0.002838
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.904874 0.865797 9.723098 1.125508 1.542077 0.959634 0.596886 10.553172 0.041077 0.510238 0.368089
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.712553 7.860754 0.294131 10.186648 0.234221 1.290523 0.414692 2.430080 0.485293 0.061870 0.377004
61 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.364793 -0.893670 5.340135 -0.403791 1.547098 -0.440251 0.172874 0.314247 0.033152 0.475443 0.321534
62 N06 digital_ok 0.00% 0.00% 0.00% 0.00% -0.529248 0.210653 0.446173 -0.028328 0.006732 -0.790064 0.808671 -0.966121 0.443727 0.466082 0.282602
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.648391 8.108601 -1.043022 5.877450 -0.700174 1.319253 -0.612233 2.422764 0.462119 0.041484 0.349428
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.677329 -0.537253 -0.762372 0.070774 -0.028558 -0.160367 -0.265180 0.700890 0.450280 0.438544 0.284399
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 14.494579 13.651618 12.161428 12.144031 1.527675 1.313852 3.398593 4.687327 0.023701 0.028177 0.005439
66 N03 digital_ok 100.00% 86.74% 100.00% 0.00% 1.125436 14.049450 0.830459 12.273091 0.263783 1.275495 -1.598679 4.707004 0.168473 0.039343 0.081572
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.853758 -0.045901 -0.502764 0.984302 -0.397698 0.429319 3.599074 2.033074 0.482268 0.475944 0.300168
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 15.309948 -0.303059 12.207648 -0.331076 1.512883 -1.024121 3.740863 -0.582697 0.029155 0.485107 0.377990
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.846522 2.472613 1.405632 -0.489660 0.592870 0.241525 1.809193 0.578174 0.505828 0.501846 0.299388
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% 0.074346 1.355586 1.195552 2.585407 0.049479 1.629165 3.421743 1.111975 0.222637 0.205942 -0.259452
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.584797 0.022259 -0.133311 0.438291 0.040772 0.655705 -0.485716 0.948697 0.517831 0.521678 0.311282
72 N04 digital_ok 100.00% 29.83% 100.00% 0.00% 0.258681 8.231541 2.305778 10.323350 0.287669 1.137313 9.760474 1.387522 0.218060 0.068275 0.023500
73 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.717406 1.061900 -0.502339 0.954176 0.243415 1.849721 -0.203199 4.460613 0.524541 0.525495 0.317753
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.839499 -0.063389 -0.816665 -0.011235 -0.696752 0.485085 -0.821475 1.236665 0.512679 0.523269 0.316136
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 17.607995 5.998624 -0.157695 -0.757896 5.288122 -0.374301 4.120552 0.085895 0.319192 0.394789 0.187701
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 12.248782 0.030839 0.182652 0.056649 -0.459746 -0.702121 -0.139436 -0.784497 0.339687 0.471685 0.283375
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.887677 -0.717153 0.852509 -0.677375 -0.703316 -0.551049 3.649190 0.236107 0.446523 0.460228 0.286095
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.718626 1.307817 -0.703360 0.945173 -1.154228 0.196467 -1.001802 -1.308918 0.456631 0.438261 0.294621
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 84.723877 33.858649 33.132624 26.872236 27.949698 19.179455 733.837221 501.922662 0.017254 0.016224 0.001455
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 15.748831 21.187555 19.532019 18.752837 6.932609 7.829440 215.265952 238.263689 0.016736 0.016702 0.000829
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 17.399478 28.606886 20.771110 21.313903 13.673490 12.293361 377.726296 286.033008 0.016527 0.016365 0.000865
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.313728 14.552443 2.798147 12.358444 0.972336 1.255936 0.191698 4.055425 0.488680 0.040586 0.371524
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.491366 0.188513 -0.643938 -0.583865 -1.245452 -0.115194 -1.116287 0.113893 0.498806 0.499622 0.298747
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.344531 0.243773 0.830281 0.213753 1.084147 0.422630 0.445127 8.830506 0.509988 0.509243 0.298385
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.769165 1.653167 3.279777 -0.803489 1.171037 -0.894063 18.905686 0.191203 0.421199 0.524842 0.297787
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.192965 0.881679 0.853580 1.376521 0.722805 0.592725 0.209810 0.487697 0.521788 0.522048 0.303196
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.387373 0.276614 0.803702 1.157247 0.795134 0.732876 -0.164965 0.372246 0.520589 0.523292 0.310112
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.529444 -0.964437 -0.000142 -0.942271 0.276379 -0.551046 -0.056258 0.150756 0.517495 0.522786 0.312464
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.016859 0.140354 0.944009 0.706989 1.195031 0.715896 0.178378 0.347100 0.503294 0.516742 0.313687
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.573161 0.217854 9.729571 0.510784 1.551438 0.743127 0.523483 0.884169 0.032350 0.507015 0.353866
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.770002 8.077989 9.790463 10.228104 1.555467 1.309685 1.814889 2.038556 0.028667 0.024989 0.002021
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 7.126266 1.426396 9.891589 7.411509 1.435742 -0.224672 0.870237 1.356653 0.026804 0.402573 0.269270
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.853798 -0.455545 -0.021638 -0.472784 -0.456417 -1.025760 0.495434 -0.679462 0.450904 0.468197 0.288926
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.093757 10.262509 0.085345 -0.565444 -1.048769 -0.394562 -1.449141 -0.038968 0.459598 0.375243 0.274895
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.024668 0.867305 -0.833549 0.441674 -0.691181 -0.187575 0.514531 8.375599 0.453261 0.437075 0.285541
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.200490 3.546800 0.263031 1.140060 0.893841 0.999424 -0.162076 0.493199 0.483334 0.480135 0.298925
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.984264 0.039041 -1.043223 -0.564312 -0.189807 -0.474558 -0.815499 5.162055 0.501983 0.500144 0.298971
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% -0.351217 1.574459 -0.776003 -0.490382 -0.774741 -0.007218 1.445903 14.855196 0.504948 0.512163 0.298238
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.475600 29.129636 1.184033 6.016618 1.339894 1.021960 1.392867 1.443243 0.507403 0.498525 0.296805
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.050808 0.388012 0.597365 1.207078 0.231866 0.440408 0.183288 0.503595 0.522382 0.522102 0.305426
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.032196 0.527777 0.288309 0.353298 0.518045 0.341157 0.508165 0.235627 0.522126 0.527993 0.307327
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.302629 -0.187628 0.019832 -0.531499 0.058301 -0.188634 0.659574 1.736284 0.519563 0.522184 0.306017
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.298669 1.743490 1.331284 2.311398 0.533241 1.014502 10.957660 0.678893 0.509205 0.518097 0.309584
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.443090 8.004086 9.793668 10.010980 1.522446 1.311161 0.607574 1.833575 0.055709 0.033468 0.016322
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.836218 -0.214957 0.478734 0.048356 -0.537368 -0.013451 -0.024545 0.041437 0.392622 0.499914 0.297713
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 5.690634 7.967363 1.122567 10.078035 3.557605 1.284084 1.644606 2.221685 0.436647 0.052482 0.326490
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% 0.361417 3.100877 1.465245 8.589312 0.035959 -0.862135 0.774598 0.918820 0.193649 0.136705 -0.212065
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.427227 2.383787 1.618205 1.595375 0.839178 0.793664 -2.155588 -1.765146 0.440031 0.432513 0.277897
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.930663 2.456952 1.335098 3.625664 0.489518 -0.129147 -1.597579 1.538370 0.434093 0.370393 0.275995
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.112353 -0.870209 -0.652393 -0.649752 -0.014270 -0.929196 -0.334823 -0.568739 0.436994 0.434892 0.278158
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 22.809256 23.683280 23.099062 21.998471 12.298620 8.145021 382.864421 271.476568 0.017130 0.016294 0.001070
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 16.245753 24.032701 19.819776 20.499780 6.676444 8.740164 231.441712 259.339477 0.016523 0.016410 0.000755
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.393859 0.379486 2.617732 -0.390708 1.765955 0.329671 1.871728 -0.084508 0.484398 0.494370 0.296568
121 N08 digital_ok 100.00% 0.28% 0.00% 0.00% -0.082001 1.683242 -0.704386 5.153527 -0.067111 1.023881 1.253964 7.806687 0.501245 0.492198 0.299045
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.694865 1.992822 -0.119906 -0.726791 -0.463662 -0.333863 -0.315107 -0.313083 0.515313 0.518693 0.302462
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.953428 0.879737 1.438779 0.300180 0.614120 -0.456128 -2.056937 -1.135667 0.490260 0.514631 0.304041
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 6.644645 0.016339 9.908488 0.826646 1.551239 0.572606 0.646286 0.838780 0.038466 0.530625 0.360254
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.014373 0.239630 2.868690 1.286316 0.470790 0.475678 0.772807 0.415654 0.512117 0.524221 0.309732
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.290623 0.342718 0.486228 1.080935 0.873567 1.058533 1.406168 0.368556 0.514612 0.519767 0.310870
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.390660 -1.074394 9.732015 -0.968018 1.551719 -0.517734 0.466402 -0.076599 0.032355 0.505607 0.352692
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.182940 -0.430499 -0.325820 -0.689192 -0.006732 -0.960233 1.569349 1.532961 0.492395 0.494981 0.311055
131 N11 not_connected 100.00% 0.00% 82.60% 0.00% -1.039712 7.494209 -0.827755 5.708079 -1.357823 0.893975 -0.951340 0.967657 0.470743 0.184520 0.339549
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.084947 -0.441094 -1.016556 -0.557874 -0.349950 -0.541552 0.144845 0.029407 0.463984 0.452524 0.288177
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.373544 -0.980200 -0.547943 -0.978976 -0.655449 -1.009296 -0.227466 -0.039682 0.448341 0.446631 0.285615
134 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.971559 1.662770 2.531429 1.093404 -0.101730 0.259885 6.796858 -1.474937 0.372585 0.409471 0.272158
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.456989 -0.911524 -0.463149 -0.805139 2.068247 0.058337 0.124027 0.193115 0.413858 0.416690 0.282803
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 6.073449 -0.610141 9.504734 -0.086163 1.552221 0.150484 1.043139 0.635931 0.034821 0.430226 0.299496
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 20.445682 27.399606 23.313402 19.715323 22.331294 7.138408 517.188793 211.533740 0.016374 0.016521 0.000825
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.135770 -0.327743 -0.010613 -0.838531 -1.140780 -0.683499 -1.397789 0.555904 0.463641 0.466527 0.288349
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.364502 -1.174945 0.171066 -0.986876 1.961624 -0.628292 6.612535 2.349427 0.491622 0.498764 0.294975
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.241853 -0.625765 0.256164 -0.432212 0.590220 -1.088566 -0.074646 -0.803125 0.506514 0.503285 0.297389
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.212442 7.998623 -0.152918 10.198510 0.132775 1.303027 16.191007 1.931029 0.516105 0.041784 0.416556
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.810950 7.939424 9.567674 10.168322 1.409232 1.293817 0.453243 1.671198 0.105669 0.030282 0.064290
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.298947 -0.770739 -0.317529 -0.241490 0.160926 -1.035016 -0.427915 -0.748132 0.523596 0.519809 0.309548
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.056850 0.373440 0.225175 0.751724 0.382040 0.474742 0.220435 0.940865 0.520313 0.515626 0.305626
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.577353 -0.959930 -0.667667 -1.040116 -0.799124 -0.806450 -0.597628 -0.266369 0.490069 0.496235 0.305271
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.822297 -0.561141 -0.630028 1.127051 -0.623237 0.112886 -0.516922 6.134641 0.370258 0.436984 0.266017
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.353359 -0.761230 9.632128 -0.220949 1.554989 0.515333 1.519506 0.624091 0.036426 0.419968 0.304775
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.187537 7.907727 6.726414 10.055668 0.404854 1.303359 4.622168 2.025169 0.353452 0.035899 0.263445
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.379617 0.150200 0.692770 0.953494 0.402559 0.912316 -0.062017 0.435484 0.438696 0.443274 0.291532
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.661195 -0.880427 -0.858418 -0.914985 -0.420165 -0.338100 2.708896 8.626402 0.460343 0.462358 0.298513
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.027867 9.481253 0.085681 0.033703 -0.293778 -0.228824 -0.207719 1.360565 0.446083 0.366369 0.273030
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 6.930061 -0.512652 9.709233 -0.192185 1.545071 0.379206 0.688470 0.106680 0.042255 0.492218 0.386250
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.504911 15.890345 0.526478 0.573289 0.991235 -0.540158 -0.095052 0.188127 0.499609 0.398579 0.285441
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.776957 -1.095062 -0.633490 -1.037667 -0.834273 -0.193877 3.107184 -0.259625 0.505382 0.509856 0.306270
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.292134 0.819657 0.478376 0.654110 0.760518 0.798256 -0.073148 0.819751 0.516404 0.517237 0.310080
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.648444 1.016256 1.543955 1.184657 1.060109 0.672824 7.576333 1.941262 0.509800 0.510831 0.300944
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 10.173473 -0.150185 0.694045 -0.152063 -0.172655 0.253124 0.646306 0.058797 0.418911 0.510328 0.293791
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.113175 -0.427359 1.084099 -0.286687 1.145530 -0.937102 0.119462 -0.890049 0.502869 0.498842 0.299673
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.323962 -1.365485 1.099083 -0.747529 -0.283407 -0.703617 0.001260 -0.012334 0.438145 0.449502 0.288951
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.644863 0.390452 1.128400 0.075643 0.302462 -0.535940 -1.915195 -0.628571 0.443246 0.438134 0.289884
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.435278 2.487433 1.655419 1.651114 0.915150 0.853524 -2.165497 -1.571585 0.408377 0.393633 0.268946
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.310617 -0.123022 0.523551 0.535041 0.389088 0.317115 -0.163021 8.842547 0.459217 0.463842 0.300898
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.411651 8.333433 -0.550609 10.278340 0.133202 1.304018 12.624576 1.982541 0.472224 0.048072 0.382574
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.102435 0.693575 1.454972 1.117364 1.051842 0.705073 0.107938 5.493216 0.488671 0.489551 0.307136
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.748273 7.867867 -0.742785 9.992092 -0.962754 1.298999 1.655343 2.197722 0.502313 0.043806 0.373839
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.289804 0.657089 0.670684 1.049366 0.693713 0.684510 0.324526 0.594540 0.505115 0.499351 0.300843
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 8.071640 -0.261295 8.296439 -0.008052 0.708699 -0.409740 0.430374 0.116503 0.272845 0.507309 0.338095
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.498328 -0.058298 -0.849896 0.097606 -0.264664 0.037870 -0.561167 0.195598 0.509262 0.504325 0.309340
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.064115 -1.081192 -0.531840 -0.984891 -1.264082 -0.716345 -1.039438 -0.390217 0.498480 0.495183 0.302713
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.098765 -0.726962 -0.084110 -0.553728 0.016341 -0.843449 1.764297 -0.476229 0.493477 0.485547 0.301865
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.097702 2.725376 1.430178 1.789480 0.697712 0.996741 -2.027722 -1.910028 0.425042 0.398015 0.278047
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.724397 2.362784 1.825762 1.591830 1.082930 0.829185 -2.220136 -1.835676 0.404037 0.394695 0.266565
200 N18 RF_maintenance 100.00% 100.00% 1.38% 0.00% 7.474993 17.856355 5.507207 0.328254 1.549599 0.340780 1.409159 5.438209 0.037512 0.224780 0.149204
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.043682 2.028856 0.786984 1.446038 0.281099 0.682646 -1.600612 -1.749076 0.460342 0.439633 0.293730
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.044528 -0.297667 0.038695 -0.316468 -0.941072 0.198169 -1.360025 40.543792 0.475888 0.469549 0.289347
204 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
205 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
206 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.981752 -0.886686 -0.847966 -1.021567 -0.890917 -0.775414 3.540022 -0.380258 0.456457 0.468145 0.292769
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.260268 8.210306 -0.532167 5.862674 -0.752264 1.300438 0.007287 1.353404 0.444720 0.036280 0.362555
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.822974 -0.952881 -0.556389 -1.016240 -1.245995 -0.156103 -0.123500 -0.253344 0.461509 0.452477 0.288999
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.887505 -0.725091 -0.836562 -1.000568 -0.809120 -0.731254 2.330113 -0.345286 0.466845 0.465177 0.293852
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.608964 -0.641319 -0.882994 -0.676552 -1.267129 -1.088171 1.650898 -0.654960 0.470211 0.469674 0.294711
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.936239 0.051392 -0.203632 1.590234 -0.302507 -0.020816 -0.189674 12.514292 0.465297 0.436275 0.292058
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.869455 2.517287 1.956412 1.709148 1.238024 0.933908 -2.241634 -1.801813 0.424599 0.423670 0.271431
225 N19 RF_ok 100.00% 0.00% 100.00% 0.00% -0.310362 7.718777 -0.285041 5.660841 -1.321722 1.121408 -1.200318 1.697924 0.469278 0.117440 0.371591
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.114467 7.374161 -1.033125 -0.589184 -0.903062 -0.303833 -0.732634 -0.349123 0.464795 0.376293 0.285374
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 0.952248 -0.508746 2.404042 -0.496805 -0.633695 -0.229619 11.979724 5.136008 0.400769 0.441257 0.290263
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.279240 -0.524028 -0.313909 -0.543219 -1.310461 -0.169431 -0.203117 0.654962 0.449914 0.435429 0.280105
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.061289 0.040809 -0.330913 0.051538 -1.077045 -0.712665 -0.733894 -1.076224 0.446860 0.432192 0.288825
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.571649 -0.847126 0.736427 -0.667432 0.225730 -0.207291 1.749882 -0.230670 0.414748 0.433529 0.288260
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.322962 -0.533994 -0.223500 -0.290621 -1.213543 -0.836698 -1.197458 -0.899987 0.456537 0.447275 0.300447
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.932830 -0.554023 -0.724003 -0.491843 -1.356938 -0.642926 -0.836038 0.761698 0.457527 0.449618 0.296609
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.671652 -0.432855 1.264239 -0.934730 -0.482752 -0.502063 1.753032 0.454916 0.429638 0.454966 0.297357
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.310184 -0.983240 -0.989032 -0.708706 -1.170688 -1.005084 -0.283391 -0.608248 0.459611 0.451617 0.296171
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.434828 -0.115231 -0.678317 -0.085808 -0.587022 -0.717938 0.017720 -0.805985 0.352276 0.445047 0.281620
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.013090 -0.929194 -0.291394 -0.615478 -0.273805 -0.433976 -0.675023 -0.006790 0.370054 0.443953 0.281154
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.471091 -0.689063 0.185102 -0.012812 -0.400868 -0.450279 1.191643 2.323008 0.444141 0.439884 0.278784
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.586271 -0.515967 -0.451546 -0.806463 -1.326110 -0.742230 -1.232657 0.690045 0.453452 0.439042 0.285705
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.753171 8.522796 -0.981959 5.502979 -0.203510 1.291640 -0.411660 0.832463 0.442338 0.035676 0.355472
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.686750 -0.577556 -0.667626 -0.903831 -1.132978 -1.066949 2.054551 -0.422398 0.446131 0.431169 0.286107
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.000068 6.784947 0.383311 0.612873 0.583841 1.288936 -0.029699 1.414847 0.447324 0.432940 0.293626
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.190120 0.167944 0.678923 0.000142 -0.152047 -0.527207 -1.625788 0.021280 0.352963 0.328136 0.246521
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.793053 0.949272 -0.057705 0.119237 -0.961535 -0.563810 -1.121086 -0.973772 0.340536 0.319563 0.236225
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.061719 -0.906382 -0.169213 -0.473161 -1.229352 -0.246226 -1.156955 0.407891 0.373540 0.350435 0.260149
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 7.336148 8.182403 5.429300 5.986955 1.546518 1.301719 0.599432 0.800550 0.037304 0.035844 0.001894
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.901549 0.042048 0.079999 -0.458535 -0.054886 -0.046527 2.728523 0.466842 0.330486 0.326134 0.235517
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, 73, 77, 78, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 102, 103, 104, 108, 109, 110, 111, 112, 117, 118, 121, 124, 127, 131, 134, 136, 137, 140, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 164, 165, 167, 168, 169, 170, 179, 180, 181, 182, 184, 189, 190, 191, 200, 202, 204, 205, 206, 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, 74, 79, 80, 85, 88, 89, 90, 91, 95, 101, 105, 106, 107, 113, 114, 115, 120, 122, 123, 125, 126, 128, 132, 133, 135, 139, 141, 144, 145, 146, 157, 162, 163, 166, 171, 172, 173, 183, 185, 186, 187, 192, 193, 201, 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, 166, 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_2460070.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 [ ]: