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 = "2460132"
data_path = "/mnt/sn1/2460132"
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: 7-6-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/2460132/zen.2460132.42105.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 360 ant_metrics files matching glob /mnt/sn1/2460132/zen.2460132.?????.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/2460132/zen.2460132.?????.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 2460132
Date 7-6-2023
LST Range 18.507 -- 20.443 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 360
Total Number of Antennas 205
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
RF_maintenance: 62
RF_ok: 18
digital_maintenance: 3
digital_ok: 83
not_connected: 30
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 205 (0.0%)
Antennas in Commanded State (observed) 0 / 205 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 19
Nodes Registering 0s N05, N09, N14, N18, N19
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 80 / 205 (39.0%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 116 / 205 (56.6%)
Redcal Done? ❌
Never Flagged Antennas 89 / 205 (43.4%)
A Priori Good Antennas Flagged 39 / 83 total a priori good antennas:
7, 15, 17, 20, 31, 37, 38, 40, 42, 44, 45,
51, 53, 86, 88, 91, 103, 105, 106, 107, 112,
121, 140, 141, 144, 145, 146, 151, 153, 158,
161, 163, 164, 165, 183, 186, 187, 202, 325
A Priori Bad Antennas Not Flagged 45 / 122 total a priori bad antennas:
4, 8, 16, 22, 35, 36, 48, 49, 50, 52, 57, 63,
64, 68, 79, 80, 84, 94, 95, 97, 113, 114, 115,
120, 127, 132, 133, 135, 136, 139, 155, 156,
159, 175, 179, 195, 228, 229, 244, 245, 261,
324, 332, 333, 340
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_2460132.csv

Build DataFrame¶

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

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

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

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

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

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

Table 2: RTP Per-Antenna Metrics Summary Table¶

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

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

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

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

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

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

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.401119 -0.269802 0.097472 -0.797116 0.629098 -0.080890 0.004071 -0.308664 0.804117 0.517902 0.583820
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.577244 2.369347 -1.330877 -1.020562 -1.474166 -0.834694 -0.834412 0.583023 0.802852 0.501165 0.579902
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.033326 0.604219 -0.030114 2.715953 0.558540 0.770857 -0.052176 0.507075 0.810957 0.511519 0.584136
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.040550 -0.164480 -0.974888 -0.420648 0.128669 0.390410 3.952601 7.243699 0.803038 0.529800 0.564773
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.792933 2.220118 0.862686 0.934710 0.099829 0.117474 -1.514309 -1.455475 0.789205 0.494873 0.568035
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.297321 0.297574 2.683823 0.230653 0.930902 0.305178 1.947966 -0.044847 0.802403 0.528730 0.574037
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.905451 -1.366955 -0.286762 -1.117865 0.459215 -0.649505 0.103686 -0.246627 0.800947 0.510731 0.579013
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 13.214707 4.721197 0.101324 -0.373730 -0.913281 -0.230943 1.152266 1.613320 0.667460 0.518450 0.434203
16 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.083135 -0.665671 -0.898267 -0.973982 -1.711662 -1.694166 -1.033551 -0.972142 0.808754 0.538614 0.566695
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.528666 0.888433 1.211626 3.303149 1.664456 1.134267 0.458745 8.679326 0.812034 0.518322 0.578900
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.347364 5.848691 0.357543 1.944478 0.663639 -0.088615 32.477537 24.222698 0.737322 0.297049 0.601035
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.870650 -0.477032 -0.756395 -0.128696 -0.004847 1.025632 -0.325869 3.213824 0.810602 0.542735 0.563379
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.182872 -0.239247 1.099349 0.319941 1.155696 0.324409 4.362416 0.327028 0.801412 0.538443 0.556164
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.188210 -0.324854 -0.499632 -0.229541 0.189049 0.629559 0.238148 0.034750 0.804968 0.528875 0.574301
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.600844 -1.411211 0.818818 -1.061830 -0.394947 -0.868237 0.218013 -0.318070 0.767255 0.491986 0.563901
27 N01 RF_ok 100.00% 100.00% 99.44% 0.00% 13.582554 15.965747 9.088663 3.120014 1.410610 0.243176 3.558415 33.406798 0.043511 0.179647 0.134606
28 N01 RF_ok 100.00% 0.00% 31.67% 0.00% -0.519541 12.276802 0.369979 4.366673 0.001912 -0.700816 0.160491 15.724171 0.810989 0.211369 0.704254
29 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.974891 8.968599 9.732549 9.926960 1.528946 1.340616 2.477789 1.713131 0.031686 0.039096 0.008298
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.032758 -1.358754 -0.300411 -1.235364 -1.567517 -0.719241 -0.591939 -0.397779 0.803245 0.545228 0.557039
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.034758 0.531664 -0.120089 0.954850 0.978626 1.325983 0.492670 9.863300 0.812517 0.546271 0.565679
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.382884 11.337567 0.108090 -0.262327 -0.776056 -0.556705 1.693852 1.662671 0.722316 0.499014 0.390320
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 9.030525 -0.238253 5.615627 -0.660080 1.523268 -1.715722 0.987929 -0.831235 0.042016 0.511387 0.380166
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.755059 -1.237291 -0.738053 -1.463563 -1.871159 -1.088816 -0.126066 -0.705522 0.795747 0.504482 0.578993
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.393109 3.458833 0.570957 0.320703 0.814556 0.492051 0.274014 0.614873 0.804422 0.514840 0.575025
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 7.892385 7.513682 4.160552 5.374522 0.843557 0.717427 0.675598 11.324292 0.810812 0.519353 0.576100
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.747442 -0.385550 -0.552653 0.488467 -0.063053 0.388116 2.526768 8.063340 0.812121 0.534060 0.570801
40 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.394825 1.150984 0.603416 0.502730 0.478372 0.721509 0.875313 31.832500 0.812065 0.545857 0.562535
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.144667 0.961365 0.104857 2.512863 0.310341 0.715435 0.012719 0.364042 0.812124 0.539966 0.563939
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.788989 1.662519 0.142473 4.700744 0.194283 0.733930 0.365213 2.555602 0.814278 0.529615 0.569748
43 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
44 N05 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
45 N05 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
46 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
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.744124 0.184387 -1.377972 -0.219679 -1.355636 -1.345524 0.060900 -1.227058 0.800606 0.510150 0.567148
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.299341 -0.292285 -0.239191 -0.857450 -0.478231 -1.777170 -0.060481 1.145738 0.787207 0.497529 0.568744
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.333159 -0.061252 0.861140 0.343499 1.148304 0.725321 1.863795 0.036864 0.809598 0.516991 0.579905
51 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.681449 0.622708 -0.464104 0.722455 0.230335 0.540459 56.854116 1.066845 0.807362 0.531169 0.561878
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.227473 2.309323 0.344557 -0.238872 0.386690 -0.025420 2.532493 0.144401 0.815385 0.536485 0.562531
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.189896 0.694306 -0.145684 -0.195003 0.267172 -0.111773 5.611286 5.780367 0.817329 0.554464 0.554206
54 N04 dish_maintenance 100.00% 0.00% 0.00% 0.00% 9.336648 3.185969 1.511554 2.236960 0.203520 0.007394 1.676494 1.313731 0.375917 0.397393 0.166020
55 N04 RF_maintenance 100.00% 100.00% 0.00% 0.00% 33.407756 -1.616919 6.734831 -1.392213 1.464726 -0.805758 0.486827 1.758495 0.040338 0.535399 0.394993
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.183113 0.353057 -0.694936 -0.357874 0.156481 0.025908 -0.200904 -0.032855 0.812277 0.550370 0.558514
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.738489 0.062147 -0.088899 -0.195011 0.218338 -0.050850 0.782746 0.486608 0.812039 0.550084 0.563558
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
59 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
60 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
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.977035 0.412363 0.320418 -0.247889 -0.634698 -1.297836 1.090646 -1.256195 0.784550 0.516448 0.545683
63 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.632292 3.380922 -1.166986 1.559579 -1.597471 0.842464 -0.499356 -1.801222 0.805007 0.480050 0.575617
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.855818 -1.211701 -1.048222 -0.549247 -0.895622 -0.690423 1.618466 -0.253334 0.793901 0.500119 0.559226
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.269452 -0.300341 0.160009 -0.588287 0.484657 -0.329063 -0.035221 -0.011751 0.807730 0.514734 0.584619
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.888500 0.209637 0.399931 0.525798 0.155137 0.752065 -0.005540 0.681013 0.792599 0.529571 0.552970
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.714534 -0.159545 -0.669369 0.778074 0.312185 0.994107 3.022474 1.271499 0.809384 0.546018 0.553107
68 N03 RF_ok 0.00% 0.00% 0.00% 0.00% 0.542276 -0.181927 1.006534 0.491008 0.888345 0.703689 0.580353 1.200202 0.813091 0.548003 0.550078
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.569555 -0.388725 0.193953 -0.119468 0.764841 0.275603 1.398681 0.589979 0.817538 0.552976 0.555551
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.592873 0.125043 1.676115 0.480327 0.762569 0.727659 0.461332 2.242664 0.805863 0.556622 0.546579
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.874609 -0.144928 -0.805206 -0.107693 -0.062964 0.189403 -0.423749 0.472610 0.813851 0.554375 0.557001
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.086162 0.403734 -0.304620 0.002123 0.589636 0.350349 1.276885 0.840056 0.810566 0.552350 0.564168
73 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
74 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
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% 13.461618 0.260433 -0.301152 -0.116654 -1.088110 -1.273114 -0.033863 -1.018282 0.650600 0.526553 0.388070
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.128315 -1.220539 0.241973 -1.426965 -0.068086 -0.909277 0.904113 -0.578679 0.794881 0.529417 0.546632
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.494644 1.767754 -0.997444 0.712928 -1.878643 -0.165894 -0.895303 -1.509830 0.798229 0.495631 0.566877
84 N08 RF_ok 0.00% 0.00% 0.00% 0.00% 0.543108 1.948139 0.345003 0.861619 -0.636939 -0.038069 -1.054482 -1.305448 0.799155 0.511582 0.544080
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.574934 1.886846 -1.018613 -1.297980 -1.519020 -0.238425 -0.886816 1.505946 0.811842 0.548917 0.534367
86 N08 digital_ok 100.00% 100.00% 0.00% 0.00% 8.032388 0.204214 8.715400 0.022405 1.524171 -0.019607 0.373908 7.579777 0.047419 0.550370 0.378339
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 22.987945 2.403533 2.025910 -1.170634 -0.822411 -0.503469 6.992676 -0.166800 0.685541 0.556082 0.407597
88 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
89 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
90 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
91 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
92 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.853682 8.733146 9.985784 10.208655 1.526497 1.345094 2.284385 1.973738 0.027898 0.033687 0.003897
93 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.297599 9.179358 -0.111726 10.338340 -1.019119 1.290886 -1.012051 2.505163 0.262918 0.056831 -0.054192
94 N10 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.136479 1.080728 0.444172 3.488093 0.188675 0.889792 1.100620 1.026839 0.820979 0.532830 0.561969
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.099053 -0.545553 -0.704047 -0.666479 -0.718053 -1.740812 -0.123969 -1.008618 0.790445 0.534960 0.537164
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.383664 12.882386 -0.180123 -0.225662 -1.215054 -1.084945 -1.291195 0.310089 0.806075 0.417539 0.539006
97 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.556709 -0.276262 -1.064057 -0.656291 -0.709402 -0.430424 1.532384 3.316937 0.796058 0.509291 0.558462
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.265185 3.770649 -0.339112 0.526061 0.004847 0.357080 -0.197176 0.078030 0.813734 0.534530 0.561151
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.395256 -0.042550 -1.367568 -0.785019 -1.035357 -0.416326 -0.574619 5.110494 0.817131 0.541687 0.554283
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% -0.144593 2.478233 -1.429843 0.279713 -0.979569 0.676125 1.318454 12.085130 0.807978 0.548781 0.538511
104 N08 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.568521 33.343817 1.964740 5.727564 1.542068 1.171094 1.226075 0.943791 0.815479 0.529162 0.573582
105 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
106 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
107 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
108 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
109 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 4.932048 8.962900 -1.242800 10.100371 0.216263 1.343432 -0.246289 1.435391 0.444923 0.040846 0.322566
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.569214 -0.446245 -0.710702 -0.691223 -1.315513 -0.399586 -0.999729 -0.343885 0.726882 0.552316 0.443745
111 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.038658 1.178584 0.757931 1.114515 0.690729 0.794382 6.813368 1.422671 0.760096 0.554363 0.493320
112 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 3.464126 -0.605365 8.416842 -0.602979 -1.206150 -1.614544 0.468808 -1.113013 0.662421 0.552294 0.441896
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.799243 3.217422 1.350109 1.462855 0.709686 0.703071 -1.755610 -1.779417 0.785729 0.506816 0.545917
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.352984 -0.689633 1.019220 -1.443199 0.270531 -0.967313 -1.617567 -0.475345 0.788702 0.530962 0.541749
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.721765 -1.003032 -1.179555 -0.912897 -1.137775 -1.733508 -0.266930 0.597112 0.794623 0.515656 0.556996
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.669111 0.536648 2.034094 -0.002123 1.211771 0.153381 2.226832 0.498218 0.808476 0.534764 0.549903
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.445424 1.705977 0.500053 4.849708 -0.393139 0.931373 -0.770968 6.839929 0.798611 0.524982 0.545396
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.122801 1.938928 -0.621276 -1.301036 -0.343751 -0.825566 -0.224822 -0.668931 0.810784 0.547873 0.552569
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.165919 1.053980 1.163971 0.120167 0.511776 -0.886145 -1.632212 -1.383418 0.792793 0.530204 0.560012
124 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
125 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
126 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
127 N10 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.033822 0.135303 0.711493 -0.083061 1.126761 0.521065 0.836463 0.627352 0.810859 0.550614 0.565706
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.212900 -0.250708 0.051242 -0.388770 0.572548 -0.040417 1.017849 3.266575 0.816740 0.556733 0.558133
131 N11 not_connected 100.00% 0.00% 36.39% 0.00% -1.226804 8.449485 -1.115308 5.647231 -1.672268 0.642005 -0.899413 0.634903 0.803130 0.219682 0.613474
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.035114 -1.193222 -1.082074 -1.188554 -1.732140 -0.793069 -0.925429 -0.405578 0.805133 0.537877 0.544428
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.166252 -1.296325 -1.103403 -1.248971 -1.094469 -1.432499 -0.297154 -0.409296 0.800291 0.531653 0.553023
134 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.473556 2.227511 2.059748 0.892403 -0.193690 -0.034236 7.082692 -1.624407 0.747131 0.496233 0.543288
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.588522 -0.073802 -1.297323 0.693607 -1.113314 0.544289 -0.680050 0.654286 0.783257 0.478108 0.577150
136 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.848675 1.916028 -1.382352 0.440972 -0.304868 0.439280 -0.462397 1.959476 0.797847 0.467993 0.579387
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.394208 -0.995710 -0.258184 -1.395452 -1.480714 -1.043908 -1.232316 -0.324030 0.792667 0.498820 0.557023
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 5.984692 0.966436 -0.214078 0.056020 0.980047 0.541066 47.834979 9.785960 0.760178 0.524849 0.508094
141 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 8.284087 -0.164897 9.972201 0.050967 1.524601 0.661256 0.769286 -0.032078 0.060183 0.529402 0.430029
142 N13 RF_ok 100.00% 0.00% 0.00% 0.00% -0.398387 0.058521 0.095296 -0.216942 0.528491 -0.049765 11.768751 1.876501 0.805284 0.532093 0.563343
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
144 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
145 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
146 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.927897 0.009597 1.104863 0.679613 0.705819 0.898692 0.428280 0.111359 0.816097 0.548807 0.565176
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.247162 0.101025 -0.138098 0.424000 0.342976 0.697237 -0.024666 0.087086 0.819448 0.551755 0.561923
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.072268 -0.004880 0.452976 0.005370 0.814168 0.329420 0.214062 0.307910 0.816663 0.558144 0.551642
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.004880 -0.184557 0.064779 0.022117 0.738630 0.223206 0.497952 -0.103565 0.820253 0.558958 0.549528
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 9.145466 -0.815157 -1.053774 0.620225 -0.969794 -0.155608 -0.395793 5.056683 0.690047 0.531199 0.424873
152 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -1.085375 -1.368744 -1.160840 -1.083000 -1.306796 -1.097862 1.433098 -0.418217 0.807413 0.530086 0.554442
153 N16 digital_ok 100.00% 100.00% 0.00% 0.00% 8.127297 -0.649284 5.406917 -0.771056 1.531930 -0.548090 0.920120 0.038778 0.042353 0.526010 0.364984
154 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -1.079426 -1.287271 -1.078397 -1.481584 -1.648113 -1.257411 -0.725234 -0.414797 0.792961 0.503824 0.570371
155 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.628457 -1.598730 0.297210 -1.185445 -0.584679 -0.638252 -1.310858 -0.038839 0.796502 0.473322 0.601187
156 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.838049 0.135774 3.283924 0.362342 0.580957 0.353606 2.401707 0.031704 0.790950 0.485695 0.581975
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.524745 0.167134 0.010077 0.346845 0.675455 0.635935 0.013214 0.081434 0.799331 0.498391 0.576594
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.504400 -0.539818 -0.102081 0.078525 0.693172 0.309704 2.458310 8.927085 0.805373 0.503130 0.577333
159 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.187602 2.921126 0.429478 -0.572257 -0.368981 -1.014029 0.057105 -0.219800 0.776256 0.452090 0.562225
160 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.379094 0.099974 0.617849 4.377375 -0.259233 0.586703 -1.578590 6.077118 0.794598 0.496139 0.569478
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.067991 18.219057 0.294619 -0.165138 0.705384 -0.574163 0.058665 -0.290628 0.803110 0.402900 0.547315
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.004647 0.049228 -0.797403 0.232277 -0.272057 0.388757 2.819918 0.169492 0.808304 0.527777 0.576477
163 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
164 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
165 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
166 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.346274 0.366769 0.340345 0.318639 0.769900 0.571269 0.228647 1.272393 0.807098 0.542218 0.570395
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.583468 -0.263970 0.470619 0.052934 0.769648 0.410706 0.302133 0.304754 0.812076 0.550616 0.560657
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.129572 -0.481947 0.339972 -0.325341 0.632153 0.118885 -0.019394 -0.199086 0.819851 0.551111 0.557311
170 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 1.940170 -0.060911 2.336952 0.540051 2.327878 0.641883 3.575716 0.332734 0.802658 0.550588 0.544039
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -1.013824 -0.670800 0.301926 0.573866 -0.236942 -0.173170 0.030037 1.622046 0.789925 0.514047 0.538276
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.508483 -0.378120 -0.745030 -0.248802 -1.871560 -0.354411 -0.883205 0.557758 0.803792 0.521161 0.557584
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.765144 3.167940 1.344282 1.431049 0.764294 0.711500 -1.742081 -1.588698 0.778269 0.492685 0.561347
174 N16 digital_maintenance 100.00% 100.00% 100.00% 0.00% 9.072240 9.784243 5.338352 5.418623 1.522254 1.339578 0.887596 0.431614 0.030721 0.031010 0.001485
175 N21 not_connected 0.00% 0.00% 0.00% 0.00% 1.697205 2.852961 0.627172 1.120083 -0.316765 0.287161 -1.564953 -1.757870 0.779045 0.459008 0.589277
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.100062 0.526752 0.457502 1.583103 0.913165 1.280242 0.343158 1.388276 0.797019 0.496762 0.577380
180 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.702634 6.752353 0.996547 0.104528 0.767301 -0.364416 8.110553 -0.873349 0.800045 0.443874 0.565226
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.454125 0.292015 -0.113357 0.044158 0.454485 0.248878 -0.004071 1.650351 0.806248 0.510479 0.576674
182 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.961835 8.804369 -1.105553 10.113769 -1.579044 1.343085 2.419209 1.839574 0.803745 0.047208 0.692648
183 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.864540 9.477973 0.086913 10.195419 0.470098 1.352450 0.240980 1.749104 0.802812 0.040214 0.679132
184 N14 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
185 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
186 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
187 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
189 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 1.060367 2.086704 0.514978 0.891169 -0.375958 0.038847 -1.570202 -1.684544 0.786607 0.495803 0.560294
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.386903 -0.619046 0.066816 -0.409861 0.653498 -0.056370 0.177659 -0.149373 0.814062 0.548331 0.553457
191 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.421695 -0.014260 0.390968 1.020014 0.953737 0.811342 1.945445 0.274431 0.812913 0.539810 0.556089
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.082119 3.523630 1.522477 1.617387 0.957319 0.916467 -1.759270 -1.823353 0.770866 0.483319 0.546902
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.114848 3.068116 1.550909 1.393685 0.990159 0.658753 -1.768067 -1.799768 0.768772 0.481334 0.555894
194 N16 digital_maintenance 100.00% 100.00% 0.00% 0.00% 8.127442 -1.660189 5.324267 -1.402439 1.517385 -1.338650 0.490583 -0.583315 0.036467 0.507630 0.410581
195 N21 not_connected 0.00% 0.00% 0.00% 0.00% 2.056221 0.243384 0.797976 -0.401641 -0.104443 -1.562616 -1.659700 -0.769172 0.774668 0.490132 0.579480
200 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
201 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
202 N18 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
204 N19 RF_maintenance 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_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
208 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% 3.906644 5.233585 5.709231 10.000630 0.484950 1.600865 1.150007 37.194391 0.783128 0.037180 0.682641
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 3.695303 4.378938 9.247629 9.722703 1.560578 1.090125 8.023986 17.334654 0.031864 0.033838 0.001519
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.952855 5.705962 -0.089051 0.254806 0.219198 0.118405 0.035259 0.072636 0.811465 0.522305 0.556344
211 N20 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.425260 8.932523 -0.403657 5.794002 -0.343291 1.350157 0.214189 1.946898 0.791018 0.038895 0.680567
213 N16 digital_maintenance 100.00% 0.00% 100.00% 0.00% 2.617569 9.859073 1.274856 5.541214 0.695406 1.241494 4.447149 1.198345 0.773414 0.090866 0.688563
214 N21 not_connected 100.00% 100.00% 0.00% 0.00% 8.603761 0.296070 5.442253 -1.185903 1.523524 -1.038524 0.730222 0.823051 0.045439 0.480086 0.416179
220 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
221 N18 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
222 N18 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
223 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
224 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
225 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 0.317688 -1.133640 0.535033 -1.298023 -0.082872 -1.248928 13.280508 6.850072 0.776067 0.500706 0.556856
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.231235 -0.919694 -0.932811 -0.897491 -1.797149 -0.991679 0.253766 0.419095 0.797096 0.499144 0.564118
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.091642 0.227116 -0.572113 -0.145388 -1.724048 -1.273949 -1.014118 -1.356213 0.798719 0.497975 0.570172
237 N18 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
238 N18 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
239 N18 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
241 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
242 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
243 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.281674 -0.694434 -0.504513 0.245197 -0.213035 0.063296 0.845996 2.490562 0.787886 0.473120 0.576280
245 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.301974 -1.116087 -0.725401 -1.374874 -1.835707 -1.207975 -1.110722 0.579095 0.801488 0.491476 0.575605
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% 2.129878 9.131845 3.091754 5.410366 0.533270 1.343433 1.322369 1.179798 0.698691 0.036964 0.596766
261 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.557792 -0.782980 -0.823570 -1.110751 -1.852885 -1.471846 2.198547 -0.800619 0.792651 0.475099 0.582991
262 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.347884 7.528091 -0.596151 0.069733 -0.082927 1.078714 -0.144426 0.816299 0.796048 0.486079 0.584824
320 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.730134 -0.678182 -1.230864 -0.931224 -0.661111 -0.534100 -0.389302 3.423061 0.770446 0.388734 0.611420
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.092976 1.309829 -0.278390 -0.066299 -1.337500 -1.013314 -1.082832 -1.318092 0.756456 0.373916 0.593745
325 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 8.893073 9.017534 5.430215 5.842159 1.529702 1.349055 1.160971 1.424391 0.039080 0.036938 0.002396
332 N21 not_connected 0.00% 0.00% 0.00% 0.00% 1.587742 1.882068 0.397479 0.468868 -0.673527 -0.617661 -1.230318 -1.373254 0.741396 0.374978 0.602512
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% -0.226175 0.105466 0.718237 -0.769136 -0.043391 -0.470990 1.404772 0.010186 0.722449 0.367375 0.576200
336 N21 not_connected 100.00% 0.00% 0.00% 0.00% 1.593529 4.629077 -0.344925 -0.753238 -1.296055 -0.979996 0.519221 -0.734963 0.735646 0.276802 0.591612
340 N21 not_connected 0.00% 0.00% 0.00% 0.00% 2.945189 2.586354 1.226019 0.841720 0.537972 -0.077220 -1.676975 -1.593240 0.713107 0.354994 0.568924
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: [7, 15, 17, 18, 20, 27, 28, 29, 31, 32, 34, 37, 38, 40, 42, 43, 44, 45, 46, 47, 51, 53, 54, 55, 58, 59, 60, 61, 73, 74, 77, 78, 86, 87, 88, 89, 90, 91, 92, 93, 96, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 121, 124, 125, 126, 131, 134, 140, 141, 142, 143, 144, 145, 146, 151, 153, 158, 160, 161, 163, 164, 165, 166, 174, 180, 182, 183, 184, 185, 186, 187, 194, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 213, 214, 220, 221, 222, 223, 224, 225, 226, 227, 237, 238, 239, 240, 241, 242, 243, 246, 262, 325, 329, 336]

unflagged_ants: [3, 4, 5, 8, 9, 10, 16, 19, 21, 22, 30, 35, 36, 41, 48, 49, 50, 52, 56, 57, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 79, 80, 84, 85, 94, 95, 97, 101, 113, 114, 115, 120, 122, 123, 127, 128, 132, 133, 135, 136, 139, 147, 148, 149, 150, 152, 154, 155, 156, 157, 159, 162, 167, 168, 169, 170, 171, 172, 173, 175, 179, 181, 189, 190, 191, 192, 193, 195, 228, 229, 244, 245, 261, 320, 324, 332, 333, 340]

golden_ants: [3, 5, 9, 10, 19, 21, 30, 41, 56, 62, 65, 66, 67, 69, 70, 71, 72, 85, 101, 122, 123, 128, 147, 148, 149, 150, 152, 154, 157, 162, 167, 168, 169, 170, 171, 172, 173, 181, 189, 190, 191, 192, 193, 320]
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_2460132.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 [ ]: