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 = "2459882"
data_path = "/mnt/sn1/2459882"
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: 10-29-2022
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/2459882/zen.2459882.25274.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 1850 ant_metrics files matching glob /mnt/sn1/2459882/zen.2459882.?????.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/2459882/zen.2459882.?????.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 'command_res' 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 2459882
Date 10-29-2022
LST Range 22.029 -- 7.986 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 7
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 96
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 201 (0.0%)
Antennas in Commanded State (observed) 0 / 201 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 18
Nodes Registering 0s N20
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 78 / 201 (38.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 178 / 201 (88.6%)
Redcal Done? ❌
Never Flagged Antennas 23 / 201 (11.4%)
A Priori Good Antennas Flagged 76 / 96 total a priori good antennas:
3, 7, 10, 15, 17, 19, 20, 21, 30, 31, 37, 38,
42, 44, 45, 51, 53, 54, 55, 56, 59, 66, 67,
68, 71, 72, 81, 84, 86, 88, 93, 94, 98, 99,
101, 103, 106, 107, 108, 109, 111, 116, 117,
118, 121, 122, 123, 128, 130, 136, 140, 141,
142, 143, 144, 146, 147, 158, 160, 161, 162,
164, 165, 167, 169, 170, 181, 183, 184, 185,
186, 187, 189, 190, 191, 202
A Priori Bad Antennas Not Flagged 3 / 105 total a priori bad antennas:
4, 89, 168
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_2459882.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 100.00% 100.00% 0.00% 0.00% 24.293433 -1.043423 62.291867 -0.159990 11.159739 0.009758 1.522161 3.654140 0.034433 0.677295 0.543243
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.010457 3.513635 2.774662 -0.277634 1.028227 0.862415 0.586680 1.290280 0.686353 0.676121 0.387693
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.669708 0.893650 -0.814024 1.386790 -0.215854 1.082717 2.079092 0.142956 0.690200 0.679219 0.383194
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -2.914603 -2.391522 0.804210 0.167479 -0.047623 0.154848 7.016259 12.847687 0.684482 0.680669 0.382853
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.120921 -1.165080 0.530127 -0.009709 -0.279599 -0.501412 5.579721 1.451499 0.674467 0.669984 0.374310
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.506611 -2.527221 -0.046273 0.549297 0.869660 -0.242872 -0.201909 -0.205415 0.678347 0.673491 0.384836
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 6.633331 -1.212802 6.681615 5.977043 0.390068 3.177848 1.383449 1.144524 0.668505 0.669450 0.391237
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 1.827742 0.731178 5.705774 2.442443 -0.071367 0.064973 2.869105 11.340066 0.686289 0.684169 0.384070
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.100867 0.597719 -0.411331 -0.187579 0.573192 1.030793 3.606399 2.019492 0.690154 0.682531 0.378873
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.610360 1.370829 -0.221884 -0.001831 0.829416 -0.053554 17.140504 5.236426 0.691751 0.689426 0.376370
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.343332 25.399152 1.526703 2.028128 0.252859 9.227847 11.185659 35.638060 0.681507 0.476293 0.472300
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.337081 1.314083 0.311625 26.174878 2.006251 2.182582 11.359530 14.193377 0.683599 0.657716 0.385586
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.617476 6.367039 -0.150574 18.671946 0.591772 1.036476 8.125555 -0.371167 0.688621 0.679108 0.378378
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.292493 1.678626 -0.568459 9.727842 0.749548 1.500142 3.106745 33.170262 0.673094 0.663400 0.380712
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% 67.214582 19.132272 8.084922 21.427426 8.907576 6.958143 35.519310 60.331609 0.467392 0.611659 0.315021
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 24.331899 26.127096 62.431367 63.385246 11.224834 15.200050 3.383645 2.594479 0.034579 0.039223 0.004868
28 N01 RF_maintenance 100.00% 0.00% 85.08% 0.00% 28.986582 55.266331 8.313780 5.078862 8.898855 16.421135 5.668985 22.824401 0.367035 0.166677 0.262299
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -2.487885 -0.480423 -1.088536 0.163515 -0.997752 -0.322121 -0.389531 3.351063 0.695042 0.687163 0.372901
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 2.362246 -2.008446 3.360087 -0.849047 0.115214 -0.665057 20.278175 1.307743 0.690962 0.692970 0.369591
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.307127 2.627648 1.228088 -0.627596 0.038654 2.584520 4.629519 5.896410 0.704253 0.691318 0.379711
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.534416 45.417459 2.862887 4.982901 1.878383 9.411089 9.367119 73.330551 0.648703 0.605544 0.322332
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 27.822668 6.190643 25.792226 24.841640 11.160743 5.263963 1.693805 -0.765974 0.046501 0.666519 0.500167
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 10.514323 3.043683 47.512875 12.931833 7.111759 2.458743 -2.581515 1.586273 0.655044 0.641433 0.383729
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.966731 17.483578 1.008243 0.842746 0.491361 1.827756 1.040309 0.850104 0.678445 0.680307 0.389516
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.116505 1.934069 4.285956 5.202876 -0.899460 0.733630 0.801685 8.116975 0.685635 0.687491 0.392309
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.501752 0.909607 -0.825014 -0.758408 1.288696 0.038116 6.096891 1.731077 0.691803 0.694944 0.392133
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.114178 0.288930 -0.843811 -0.713331 1.438126 -0.106852 -0.254113 0.039755 0.689989 0.688145 0.378570
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.220031 0.699501 1.557340 1.388824 1.443061 -0.619745 -0.348095 1.325629 0.696381 0.688438 0.366957
42 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 0.836367 3.214297 28.348902 26.595156 1.585467 1.985157 -0.971184 -1.502133 0.705221 0.701064 0.378743
43 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 22.857063 5.361948 61.747363 -0.349078 11.222498 0.872462 3.193616 11.281567 0.044426 0.695528 0.489202
44 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 31.577039 4.116087 2.203395 -0.142857 7.671338 1.132169 204.436155 29.278046 0.655764 0.693769 0.360418
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -1.714335 4.235266 -0.857796 0.321153 -0.118384 3.102577 0.304480 19.309401 0.695376 0.681025 0.370641
46 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.501535 27.082167 -0.940147 63.613210 -0.113873 15.178687 1.780593 3.560485 0.687302 0.040322 0.502512
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 26.154194 6.252304 24.603237 14.366340 11.160181 1.638022 1.833028 7.456115 0.040326 0.659372 0.480767
48 N06 not_connected 100.00% 0.00% 0.00% 0.00% 5.074253 5.413494 27.501212 33.405374 2.551647 4.205706 1.325455 -1.741175 0.659889 0.672856 0.388857
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 3.670478 4.654847 13.252087 31.711614 1.576740 4.945423 0.716198 -0.511132 0.629047 0.657874 0.385878
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 53.883651 2.585980 4.431234 1.539610 10.743625 1.637437 157.797314 16.244056 0.596160 0.670575 0.367745
51 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 352.855579 355.321666 inf inf 6769.165261 6719.287534 8949.421287 9005.841952 nan nan nan
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.646783 14.611287 1.339257 0.575259 0.134981 -0.232638 0.620894 -0.001346 0.694253 0.696662 0.379834
53 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 527.199746 527.332215 inf inf 8920.907507 8922.782148 12221.186764 12228.222636 nan nan nan
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 25.731853 27.329439 32.116737 34.612884 11.218660 15.216266 2.831118 0.942704 0.053551 0.053915 0.001540
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 3.859215 29.104718 -0.444836 64.288046 12.700181 15.165337 3.650040 3.607637 0.694292 0.037031 0.513102
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.413384 29.217888 0.595221 65.711615 0.332806 15.253840 2.398437 2.147945 0.700416 0.041077 0.529659
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 71.446382 0.824550 25.215595 -0.255889 6.810220 1.031586 8.503820 1.327801 0.536729 0.702986 0.363600
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 23.517616 27.324839 62.194035 64.658601 11.217645 15.264794 4.251075 3.603478 0.039107 0.035945 0.001877
59 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 50.104761 8.776363 4.122672 3.381076 4.224181 1.580711 40.671375 39.920529 0.629737 0.688551 0.358013
60 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.339995 26.802437 62.340844 64.488897 11.188870 15.209887 2.876242 3.517388 0.027943 0.027979 0.001576
61 N06 not_connected 100.00% 0.00% 0.00% 0.00% 8.380411 8.133055 7.610962 0.200091 2.338616 4.093038 1.307571 3.429041 0.649422 0.637376 0.366796
62 N06 not_connected 100.00% 0.00% 0.00% 0.00% 3.175303 5.176395 22.184282 30.877988 1.561804 5.138572 2.148411 -1.096177 0.667064 0.678413 0.377394
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 19.452638 27.539923 22.682979 26.273814 2.660030 15.190528 0.561114 3.791542 0.613206 0.046053 0.444727
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 5.274175 3.353008 13.850427 25.599172 1.229473 2.810013 1.332448 -1.001822 0.618867 0.644731 0.386399
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.969458 2.497855 0.707738 2.478076 2.511173 2.067524 2.717830 0.814998 0.668711 0.682985 0.398411
66 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.178641 3.433038 14.047336 8.462577 2.906516 0.209093 -0.239354 0.539352 0.673217 0.686593 0.390283
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.693050 -0.075952 11.790336 8.914332 0.223322 -0.013164 0.842509 1.656737 0.680273 0.689965 0.381717
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 4.841501 56.474601 1.837795 86.197660 -0.207968 14.685250 3.053251 11.672724 0.687545 0.034537 0.535240
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.156608 -1.388743 -0.279624 0.220044 1.736987 2.003559 -0.193196 -0.617417 0.693692 0.701796 0.371470
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 1.223629 -0.557222 0.719274 1.449206 0.477887 0.236454 1.039627 2.369714 0.701657 0.708060 0.366813
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 14.791454 -0.543288 2.689286 2.493257 0.189934 1.374785 1.605796 1.155669 0.713143 0.707409 0.363224
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 3.014237 0.696523 26.675332 26.774326 2.453361 2.598393 6.905499 0.337017 0.696219 0.701338 0.354492
73 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 22.668041 25.206673 61.294228 62.546419 11.214655 15.188584 4.043053 1.439558 0.027204 0.027523 0.001334
74 N05 RF_maintenance 100.00% 100.00% 0.11% 0.00% 25.121895 23.184636 64.337643 62.618785 11.189893 13.244996 3.616404 23.684208 0.032689 0.327889 0.213400
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 50.229670 53.055206 23.143836 18.389560 6.178323 9.997470 25.499213 17.390016 0.558867 0.528366 0.202007
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 70.511584 1.620955 17.108801 22.593115 6.935117 1.976010 9.149451 0.343175 0.480832 0.659436 0.357268
79 N11 not_connected 100.00% 0.00% 0.00% 0.00% 6.479226 7.727831 40.761546 41.602499 5.393095 7.944029 -1.213309 -1.925330 0.657804 0.671054 0.386230
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 22.321905 30.007941 38.287251 25.554463 9.484453 15.186092 16.027490 1.953696 0.313988 0.040998 0.206872
81 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 0.017626 0.356486 -0.587542 15.447348 -0.010406 29.127167 0.311410 1.212158 0.643701 0.640781 0.387599
82 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.096141 0.845650 0.161601 8.966019 -0.133666 0.097986 0.456526 -0.019287 0.660248 0.667407 0.386389
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.447161 -0.120059 -0.886859 0.019721 -0.791647 -0.293456 -0.641906 1.410755 0.674143 0.684685 0.381238
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 3.400254 50.444139 34.199915 83.331689 2.417550 14.668431 27.065706 6.495900 0.652629 0.039384 0.428709
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.997466 0.545803 -0.286869 -0.181797 -1.184085 -0.295585 -0.729408 -0.718918 0.688923 0.694455 0.370197
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.023479 12.171184 4.145144 2.201016 7.943141 2.704181 2.180510 19.944681 0.681146 0.671418 0.353081
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.027780 14.983247 0.414704 1.066769 2.497017 3.286943 1.147720 3.154081 0.708299 0.716462 0.360466
88 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 3.604933 0.858119 0.831275 0.685903 0.024040 2.408647 10.748363 4.134213 0.695537 0.702365 0.353549
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.148415 0.215858 -0.671824 0.607681 0.506809 -0.289827 -0.707075 -0.829979 0.703104 0.703333 0.361185
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.074445 -0.215597 0.262297 2.218306 -0.386112 0.017487 0.637428 4.697042 0.699997 0.700200 0.360520
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.879543 0.004673 0.135769 -0.019721 -0.673015 -0.103026 1.325936 -0.439101 0.696331 0.707965 0.372831
92 N10 RF_maintenance 100.00% 0.00% 15.08% 0.00% 79.599520 89.575323 7.602430 8.968238 10.368113 14.781710 1.598120 7.502826 0.305609 0.258611 0.090641
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 5.262764 0.148717 6.592793 3.571313 2.931550 -0.388488 5.039262 0.508414 0.684747 0.697283 0.375574
94 N10 digital_ok 100.00% 0.00% 0.00% 0.00% -1.434571 -0.119080 2.167847 0.347056 1.986155 2.876633 19.931276 10.793883 0.681992 0.682756 0.377113
95 N11 not_connected 100.00% 0.00% 0.00% 97.95% 10.148774 9.274650 47.467838 46.182966 6.600504 12.001650 -1.943426 -1.835854 0.284086 0.284946 -0.293905
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 26.813255 29.225252 24.655558 26.770205 11.135148 15.250633 1.627256 1.261407 0.034407 0.039811 0.003564
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% 8.534966 8.990288 45.269301 3.399874 6.547182 1.963317 -2.367317 12.556101 0.638543 0.618931 0.388405
98 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 443.893486 442.444318 inf inf 6907.544564 7103.570148 8093.830864 8619.281433 nan nan nan
99 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 294.021051 307.819110 inf inf 6255.625386 6216.400202 8226.171677 7874.905450 nan nan nan
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.026262 -1.192256 1.522380 -1.000996 1.971978 -0.489217 0.776248 0.111108 0.665405 0.674293 0.383358
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 15.194492 19.084652 2.755766 2.886867 -0.656352 -0.106947 1.690349 0.863404 0.691638 0.694915 0.375931
102 N08 RF_maintenance 100.00% 87.78% 100.00% 0.00% 26.906046 27.393833 56.076161 61.092302 11.627695 15.268745 1.586254 5.596900 0.164185 0.043222 0.080032
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 49.683992 51.901621 72.041397 73.917807 11.298632 15.138173 11.879519 10.988815 0.027497 0.029682 0.002574
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.751242 123.095753 39.693967 41.927329 1.852196 2.168453 0.092276 0.260826 0.654510 0.680365 0.361810
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.000517 -0.000517 -0.295826 0.958979 -0.390679 0.819122 -0.259489 -0.152448 0.701637 0.703100 0.350773
106 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.711715 1.845157 4.303112 2.122087 3.261550 1.657306 0.144778 0.506580 0.692806 0.699724 0.355136
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 5.067413 3.700902 1.010548 0.914597 0.038756 -0.034478 5.280782 6.555746 0.697469 0.700307 0.352176
108 N09 digital_ok 100.00% 39.41% 0.00% 0.00% 22.631798 6.100208 60.716727 0.339327 10.767883 0.777489 2.251903 1.687238 0.246409 0.705866 0.467843
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.629916 27.040676 1.770586 62.592841 -0.384337 15.187954 3.734258 2.818559 0.699523 0.038616 0.466460
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.243502 53.497655 -0.561744 84.458734 -0.502574 14.703192 2.444559 5.593995 0.706444 0.035287 0.468706
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.220069 26.792388 1.564154 63.393374 0.113168 15.165523 8.462072 2.923448 0.689574 0.037908 0.460359
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.008058 -0.850915 -0.749785 0.523466 -0.114391 0.955452 1.298484 -0.149397 0.677277 0.690319 0.386002
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 28.426633 29.320604 23.203504 26.044085 11.125822 15.221884 2.306541 1.112326 0.040177 0.031968 0.005032
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 27.338095 25.018311 81.495557 70.271359 19.122523 20.006650 221.294779 191.664211 0.025676 0.029098 0.002499
115 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.613895 17.273327 38.327970 35.387094 4.060487 6.822425 -1.858989 -0.490139 0.639146 0.604366 0.389077
116 N07 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.623055 4.552945 8.174074 16.660823 -0.995408 10.773863 0.986727 3.465970 0.682539 0.653770 0.381067
120 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 35.107275 50.639316 31.947630 82.967160 9.365806 14.856164 -1.399217 10.549876 0.353654 0.041244 0.219395
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.764766 11.319679 -0.145479 0.848039 1.054838 0.190081 39.443990 22.062652 0.698758 0.704117 0.369358
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 16.370748 15.029644 4.693961 1.536973 3.015627 -0.099590 2.285943 -0.787014 0.706477 0.709275 0.366980
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 12.918355 19.304515 1.968048 2.285691 -1.051027 0.577845 -0.024340 0.359844 0.709409 0.714232 0.362513
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.679273 2.333519 0.109769 0.022635 -0.614961 -0.882474 1.550328 1.122583 0.707294 0.708671 0.358361
125 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.680953 4.755181 -0.257186 0.175928 0.418606 3.754814 0.478632 0.933840 0.696096 0.702625 0.354418
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.455977 -0.554872 6.066064 1.217979 17.303597 0.197008 84.057145 0.096679 0.677555 0.701022 0.365347
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.356803 -0.665698 -0.503394 -0.565730 0.675966 -0.171041 1.607854 0.776328 0.703036 0.709415 0.371545
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% -0.718252 0.209607 8.126354 3.697368 -0.147372 1.193113 -0.208327 -0.275227 0.693937 0.702836 0.371331
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.931308 -2.332178 -0.728642 -0.847745 -0.299376 0.431489 -0.086555 -0.039755 0.692669 0.700442 0.380366
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 4.915875 0.618879 -0.290238 -0.592930 -0.079564 0.211832 3.546388 3.578313 0.670015 0.689252 0.381920
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 26.453431 29.460134 24.817993 27.524725 11.162442 15.143978 4.271235 0.093442 0.034744 0.041163 0.002373
132 N11 not_connected 100.00% 0.00% 0.00% 0.00% 8.189172 1.559742 44.736062 33.596541 6.435111 5.460615 -0.968199 -0.914982 0.644998 0.665584 0.402500
133 N11 not_connected 100.00% 100.00% 84.05% 0.00% 27.425136 36.052055 23.189424 18.022716 11.158776 14.527050 2.350919 1.340259 0.042881 0.180724 0.101837
135 N12 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
136 N12 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
138 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.509251 -0.040901 -0.302278 2.111694 -0.659685 -0.279526 9.634224 1.323862 0.668700 0.676741 0.393192
139 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.603717 6.462622 48.706503 41.679123 7.465988 7.432229 -2.407451 -0.488427 0.666535 0.680087 0.382740
140 N13 digital_ok 100.00% 0.00% 98.76% 0.00% 8.855709 28.483772 45.092325 63.843897 5.986283 15.098563 0.133540 3.379640 0.679477 0.057396 0.545953
141 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.544721 11.169758 2.057995 49.567376 1.929350 10.741160 2.074752 -2.938955 0.691319 0.684323 0.362180
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 2.590751 26.724402 1.618834 64.437429 2.269452 15.208450 1.516288 2.587249 0.691460 0.050753 0.543660
143 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 24.763869 -1.956218 63.248784 -1.017591 11.133320 1.329162 0.770256 -0.765663 0.040972 0.710044 0.555784
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -1.414119 -1.167843 0.256593 13.788626 0.250216 -0.237838 -0.135737 0.151902 0.704148 0.697495 0.366095
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -2.657911 5.329696 0.659390 35.359567 -0.303498 17.250670 0.235187 0.634373 0.702506 0.651635 0.385257
146 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 1.535877 12.043612 19.204940 48.558674 2.383712 10.541547 1.593897 -2.773263 0.688361 0.695763 0.369211
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.884865 -0.455189 6.090749 10.254607 1.075355 -0.753687 3.118611 -0.012792 0.694093 0.696593 0.365770
148 N15 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.039883 -0.480438 19.685671 8.091400 1.191706 0.625792 0.197298 -0.407932 0.677811 0.699714 0.380210
149 N15 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.613602 3.351013 13.156858 35.544675 -0.666603 5.227305 -0.144615 -1.677501 0.691219 0.700014 0.383616
150 N15 RF_maintenance 100.00% 99.95% 0.76% 0.00% 25.881238 8.007690 62.388975 44.616946 11.165268 10.470220 3.098674 -2.238581 0.053559 0.308394 0.162484
155 N12 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
156 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.609185 -0.547771 56.727308 1.580015 8.467783 0.063655 2.116905 0.788673 0.369697 0.659659 0.474964
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.816789 -1.258874 0.254377 0.097825 -0.836775 0.103026 -0.164455 -0.328166 0.650988 0.664904 0.396931
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.084237 -0.179346 0.858952 3.875641 2.239535 0.347039 4.541654 20.116866 0.668034 0.678741 0.402193
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.069873 51.362316 34.488373 29.457915 2.795653 9.327820 -1.135393 11.850156 0.666827 0.533785 0.372222
160 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.456793 -1.899497 1.582429 4.913103 -0.864044 1.257572 1.819735 1.312176 0.682824 0.689847 0.373003
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.800748 58.118641 -0.078788 8.315502 -0.968100 5.139108 0.001371 1.933028 0.686684 0.566483 0.339254
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 2.694112 1.162393 7.437335 10.907789 8.984932 3.689578 2.186428 4.344230 0.699821 0.703769 0.368312
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.848989 0.072294 0.917651 -0.807349 -1.428498 1.021787 -0.141047 0.930329 0.701711 0.701623 0.372718
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.438139 -0.079132 4.276998 2.760692 9.126672 1.128349 0.956978 1.207066 0.696133 0.704330 0.367689
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 40.403810 0.016399 46.084079 3.384466 8.138601 -0.784354 0.627233 -0.554687 0.426650 0.702494 0.418595
166 N14 RF_maintenance 100.00% 0.00% 94.92% 0.00% 58.706869 25.127387 10.169286 61.421658 9.274996 15.091805 46.537526 0.780331 0.566629 0.106016 0.409645
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.494276 -1.975021 14.219308 2.798482 0.410502 2.437020 -0.538757 5.211296 0.709729 0.701921 0.374215
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.257615 -1.790574 -0.677157 1.530225 0.971445 -0.140644 -0.586543 -0.339240 0.697511 0.704418 0.374786
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 3.690974 22.914729 32.947354 40.136893 2.070311 10.489266 -1.810437 21.666459 0.696201 0.611876 0.376812
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 25.903695 -1.423009 63.612342 7.089489 11.152136 0.652047 1.520810 0.406039 0.044230 0.695010 0.570643
179 N12 RF_maintenance 100.00% 100.00% 98.00% 0.00% 26.245977 29.017770 63.674724 67.595773 11.162574 15.141767 1.345913 1.831938 0.058506 0.102800 0.041316
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.037489 28.405865 63.044341 65.306216 11.146891 15.213505 1.123277 3.086303 0.051608 0.054641 0.004209
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.020867 -2.104162 0.705279 -1.049775 -0.617527 2.279188 0.063712 4.812787 0.691403 0.689014 0.376304
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.833108 9.302026 35.664898 45.673827 1.466553 8.911268 5.178331 -1.112550 0.635043 0.686354 0.389034
183 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 24.920750 -0.431576 57.915283 5.004013 11.158880 1.025249 0.390540 -0.266116 0.048651 0.690044 0.506275
184 N14 digital_ok 100.00% 98.27% 98.32% 0.00% 24.428097 27.604598 62.747081 64.456169 11.114407 15.134063 1.357699 1.496888 0.115818 0.062703 0.054153
185 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 23.292917 -1.304698 62.628065 19.409811 11.163839 -0.195182 0.996173 -0.535320 0.039890 0.681111 0.501536
186 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 2.023501 2.986899 15.574384 13.806444 10.191222 0.963908 3.682586 2.661516 0.684312 0.701518 0.375501
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 6.368519 3.308728 4.814176 31.697952 35.693266 3.386050 2.004510 3.992735 0.692031 0.702935 0.372386
189 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 2.586224 4.012878 6.121958 0.327731 -0.001464 2.521735 1.675009 4.309441 0.675526 0.687065 0.379949
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 95.090609 27.240273 8.956902 65.097071 8.354762 15.305543 59.186788 3.831743 0.475372 0.038122 0.361140
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 0.814347 1.243679 23.075893 0.513291 0.551958 -0.608314 15.575817 0.653111 0.645062 0.676354 0.411050
200 N18 RF_maintenance 100.00% 100.00% 53.51% 0.00% 27.831634 74.828530 24.340242 25.633978 11.176840 15.220137 2.624296 0.010373 0.049448 0.215981 0.147897
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.106973 13.476583 55.088189 52.355465 9.486003 12.030216 -3.511125 -3.054884 0.644208 0.649295 0.378458
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 4.148112 7.340719 26.025201 1.778353 1.277629 3.683174 2.671727 3.575451 0.672670 0.630896 0.387857
203 N18 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% 0.00% 0.00% 0.00% 6.025699 10.865906 25.301545 3.237942 1.641388 5.771982 -0.323029 3.346633 0.676711 0.600194 0.405435
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.117422 5.503314 28.322809 17.674069 7.197707 2.033303 1.355901 7.157440 0.677296 0.656003 0.371320
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.194607 6.956952 30.687032 23.437951 3.097582 4.885400 0.203631 -0.845990 0.660240 0.653861 0.356860
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% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
219 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
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% 0.00% 0.00% 0.00% 7.256494 4.707967 11.801986 17.474381 2.009584 1.606922 1.462044 6.539836 0.645237 0.658877 0.373105
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 15.155830 14.512723 56.254670 55.666851 9.930461 13.607432 -3.344229 -3.714294 0.658770 0.647693 0.376148
225 N19 RF_ok 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% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
228 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
229 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
237 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 8.506821 5.563490 1.231550 15.093073 2.434964 1.916445 1.104570 0.348796 0.606807 0.633406 0.400189
238 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 2.094339 1.505651 29.045358 27.756370 1.982166 4.074097 -0.857734 -0.934526 0.666140 0.656506 0.397387
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 2.184470 7.616637 17.451668 41.359892 0.954645 7.814587 5.821592 5.133526 0.658066 0.656872 0.391699
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% 0.00% 0.00% 0.00% 5.346970 10.174646 16.282219 0.056470 1.249884 3.453848 9.779482 25.689357 0.657200 0.604834 0.399149
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 69.622633 5.867951 23.793179 35.175486 17.782608 4.791924 47.422597 -0.984626 0.493833 0.662490 0.404514
243 N19 RF_ok 100.00% 1.19% 0.00% 0.00% 123.983422 6.716626 21.030133 13.787316 10.119913 2.315532 -0.779697 0.098488 0.312506 0.640456 0.495697
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
245 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
246 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
261 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
320 N03 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
324 N04 not_connected 100.00% 0.00% 0.00% 0.00% 3.702412 6.240947 29.322050 34.017066 2.135893 4.899225 2.932448 -0.102124 0.570801 0.568613 0.381050
325 N09 dish_ok 100.00% 0.00% 0.00% 0.00% 1.510933 -0.182664 29.903116 15.168074 2.394820 1.662242 -0.540832 0.783110 0.606071 0.582336 0.389274
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 9.124094 0.029543 0.121529 17.705665 1.580365 1.377884 10.136261 2.263586 0.523063 0.577175 0.392196
333 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 8.489885 4.054913 4.512771 13.697407 1.720660 1.610963 2.556797 2.120604 0.532026 0.560003 0.382668
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: [3, 7, 8, 10, 15, 17, 18, 19, 20, 21, 22, 27, 28, 30, 31, 32, 34, 35, 36, 37, 38, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 71, 72, 73, 74, 77, 78, 79, 80, 81, 82, 84, 86, 87, 88, 90, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 103, 104, 106, 107, 108, 109, 110, 111, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 125, 126, 128, 130, 131, 132, 133, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 155, 156, 158, 159, 160, 161, 162, 164, 165, 166, 167, 169, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 202, 203, 205, 206, 207, 208, 209, 210, 211, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 324, 325, 329, 333]

unflagged_ants: [4, 5, 9, 16, 29, 40, 41, 65, 69, 70, 83, 85, 89, 91, 100, 105, 112, 124, 127, 129, 157, 163, 168]

golden_ants: [5, 9, 16, 29, 40, 41, 65, 69, 70, 83, 85, 91, 100, 105, 112, 124, 127, 129, 157, 163]
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_2459882.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.0.4.dev44+g3962204
3.1.5.dev171+gc8e6162
In [ ]: