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 = "2459920"
data_path = "/mnt/sn1/2459920"
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: 12-6-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/2459920/zen.2459920.25259.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 1673 ant_metrics files matching glob /mnt/sn1/2459920/zen.2459920.?????.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/2459920/zen.2459920.?????.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 2459920
Date 12-6-2022
LST Range 0.523 -- 9.527 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1673
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 N09, N14, N20
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 88 / 201 (43.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 146 / 201 (72.6%)
Redcal Done? ❌
Never Flagged Antennas 55 / 201 (27.4%)
A Priori Good Antennas Flagged 64 / 96 total a priori good antennas:
3, 7, 9, 15, 16, 19, 29, 30, 31, 37, 38, 42,
45, 51, 53, 54, 55, 56, 68, 71, 72, 81, 86,
88, 91, 93, 94, 100, 101, 103, 105, 106, 107,
109, 111, 118, 121, 122, 123, 124, 127, 128,
130, 136, 140, 143, 144, 146, 148, 158, 161,
163, 164, 165, 170, 181, 182, 183, 184, 185,
186, 187, 189, 191
A Priori Bad Antennas Not Flagged 23 / 105 total a priori bad antennas:
22, 35, 43, 46, 48, 61, 62, 73, 79, 82, 95,
114, 115, 120, 132, 137, 139, 179, 207, 221,
238, 324, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459920.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% 9.483005 -0.136369 7.337376 0.460723 7.035780 1.158946 1.493733 4.775191 0.033360 0.664909 0.549154
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.247215 2.396876 2.996839 0.053938 8.367766 4.175736 46.199439 39.040088 0.617998 0.659918 0.434723
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.386383 0.383343 -0.161950 -0.049375 0.110505 1.400240 -0.149572 -0.254062 0.651836 0.668526 0.422472
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.303883 -1.113546 0.593198 2.570044 0.289850 0.265747 21.471205 19.570493 0.649405 0.656829 0.418521
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.331985 -1.398340 -0.767671 -0.024635 0.122457 1.020477 4.981980 4.129400 0.654913 0.669359 0.418128
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.592518 -0.509022 6.020087 0.235044 3.321926 0.924209 0.337223 -0.301930 0.487346 0.665840 0.488781
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.088148 -0.669220 -1.090862 -0.579227 -0.079705 1.047360 -0.422962 1.488887 0.643941 0.657136 0.425272
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.697915 0.165325 6.880413 0.314787 7.031089 1.110269 0.622413 2.145228 0.034990 0.671164 0.548215
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.750950 -1.507970 7.311788 0.428591 7.034107 1.658323 1.397232 3.062777 0.033637 0.672312 0.539599
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.650944 0.679761 -0.136342 0.095255 0.648411 0.786467 0.532081 0.877784 0.657743 0.676756 0.422075
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.380433 11.627286 7.307653 0.671245 7.105259 2.138785 1.380444 34.251361 0.029051 0.450027 0.354660
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.064994 -1.627293 -0.623878 3.001505 1.497607 0.805745 3.125328 4.703328 0.651797 0.656608 0.412208
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.686791 -1.043443 2.679750 -1.318560 -0.281006 -0.476102 1.904280 -0.523202 0.641190 0.684165 0.432636
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.255539 -0.105873 -0.263374 3.407843 1.152256 0.628520 0.604914 0.219302 0.647825 0.633939 0.423910
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.784250 -0.852072 0.032022 -0.491276 0.551578 -0.144558 -0.734974 -1.295443 0.623403 0.641358 0.418217
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.044078 9.900940 7.350802 7.895389 7.098041 7.217007 3.852874 3.106086 0.037267 0.040888 0.005307
28 N01 RF_maintenance 100.00% 0.00% 86.61% 0.00% 11.562252 25.686422 -1.197214 0.823634 3.091747 5.523666 8.083338 22.617201 0.357351 0.153659 0.269715
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 9.741365 10.360077 7.036950 7.584401 7.088641 7.199859 1.396705 0.774125 0.029615 0.035535 0.006093
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.974037 -0.252829 0.532743 0.342547 0.837283 1.078523 17.533777 0.429867 0.652825 0.681154 0.418781
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.242781 -0.991999 0.604479 0.944230 1.205996 0.187626 1.237653 5.172714 0.668953 0.679738 0.417968
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.001690 25.565995 -0.279134 1.924394 4.850146 0.357712 0.797165 4.689283 0.623532 0.565359 0.366576
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 11.194321 -0.896394 3.086437 -0.227177 7.071048 -0.136238 1.647005 -1.186234 0.044082 0.660071 0.512942
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.563610 -0.689241 0.673636 -1.406687 -0.740437 -0.946178 -1.598582 -0.207528 0.632931 0.633451 0.414850
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.711534 7.508538 -0.097461 0.256535 1.028869 2.023149 -0.001532 1.946202 0.653797 0.662876 0.417846
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 1.006616 0.133444 -1.258230 1.056223 1.133936 1.629713 -0.273606 11.119287 0.666750 0.673373 0.427013
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.000158 0.039222 -0.115413 0.317909 0.291894 1.157028 7.911226 2.209379 0.667685 0.680376 0.430474
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.027400 0.357320 -0.163325 0.390607 -0.666969 0.411149 -0.345911 0.233873 0.660132 0.670901 0.420448
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.365348 0.071334 -0.573691 -0.070786 0.933093 0.354504 -0.472307 0.854408 0.663686 0.675122 0.411554
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.296507 10.855369 7.531031 8.259072 6.983380 7.115508 0.992753 2.112329 0.031458 0.029597 0.002325
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.391253 0.304902 -0.291769 0.386277 -1.028715 0.771888 -1.633813 0.584129 0.672833 0.681226 0.421959
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.412789 0.220854 -1.235831 0.002521 -0.682013 1.235662 -0.744158 -0.213080 0.670229 0.691164 0.421330
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -0.322538 3.264946 -0.063283 0.285395 -0.150668 2.207333 0.100031 5.896030 0.662128 0.666300 0.409953
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.429175 1.871426 0.903411 1.012559 -0.128034 -0.011732 -0.078234 -2.568431 0.654963 0.690659 0.434997
47 N06 not_connected 100.00% 100.00% 0.00% 0.00% 10.491505 0.816733 2.947433 -1.417761 7.052535 -1.379233 1.573176 2.933240 0.039700 0.645834 0.492792
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.505833 0.402996 0.216116 0.802156 -0.946357 0.453728 -1.607661 -2.794547 0.637456 0.662613 0.417734
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.428592 -0.672658 -1.121718 -1.092536 -0.681831 -1.044767 -0.087853 17.046423 0.588788 0.629771 0.409940
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.504403 13.465467 -0.064712 0.921208 1.054814 6.631223 23.013780 34.441980 0.644581 0.615366 0.393818
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 23.116838 0.675990 9.449943 0.187523 7.185945 2.643618 12.886797 5.857303 0.039509 0.678880 0.544781
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.139427 6.463772 -0.642465 0.350267 0.542721 1.440815 2.122338 1.632508 0.672158 0.683855 0.416836
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.610716 2.510880 -0.280625 0.075826 1.447659 1.779922 3.754803 9.795879 0.677245 0.687276 0.423543
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.500245 10.547878 7.359613 8.072813 7.069157 7.180315 2.991107 1.620921 0.031298 0.029837 0.001416
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.008877 11.210611 7.373843 7.997623 7.084343 7.198334 1.601963 4.382399 0.028031 0.031437 0.003024
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.227657 11.302994 0.032367 8.160189 -0.191780 7.151427 1.482515 1.731847 0.663784 0.038606 0.543230
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 27.777928 0.092797 4.462530 0.401311 2.975570 0.992110 5.436111 2.106012 0.448716 0.679197 0.432221
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.072165 10.236281 7.262310 7.981119 7.048620 7.186797 2.537976 2.027496 0.037003 0.036478 0.001966
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.188557 0.389654 7.304394 1.109616 6.971671 2.545376 0.980431 8.265573 0.047415 0.676143 0.528450
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.359758 10.114134 -0.503970 8.008709 0.060600 7.193273 1.308269 4.154010 0.661016 0.068957 0.524566
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.375487 -0.053664 -0.736820 -0.525157 0.806824 -1.426096 -0.520218 1.552858 0.610709 0.640067 0.405041
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.164535 0.730209 -0.886661 0.414725 -1.108750 -0.719031 1.092160 -1.075495 0.607601 0.663119 0.419689
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.140458 10.509144 -0.530588 3.569213 -0.889072 7.244072 -0.336263 4.604434 0.617479 0.043292 0.477616
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.199903 -0.022193 -1.034020 -0.428893 -0.120889 -1.247315 4.426586 -0.088857 0.601590 0.597748 0.394700
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.172203 0.140099 0.079161 0.729369 -0.050187 1.453915 2.282725 1.396807 0.645497 0.667520 0.421815
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.296146 1.558478 1.574479 1.478031 1.526693 0.866939 -0.044370 2.093926 0.657704 0.676052 0.417694
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.982344 -1.005434 1.394205 1.518722 -0.433467 0.961639 0.801613 2.281190 0.662457 0.679150 0.412197
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.031616 25.352155 0.208275 10.553446 0.155312 7.145277 1.025648 13.575606 0.673705 0.031304 0.527427
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.102088 -0.464619 -0.002521 0.478501 -0.404286 1.918111 0.191967 0.307629 0.671516 0.686219 0.408908
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.579334 -0.172445 -0.528348 -0.095569 0.805298 1.372343 0.070569 0.029550 0.674828 0.688142 0.412986
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 6.488007 -0.024455 0.164846 0.811331 0.900713 0.472463 1.902387 1.614140 0.676634 0.686368 0.414097
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 1.784593 11.334741 0.214917 8.277569 0.406171 7.117556 6.892677 1.706543 0.660801 0.035844 0.533619
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.183641 1.060921 -1.023700 1.184774 0.148887 0.847141 -0.208579 0.211450 0.673359 0.676068 0.424677
74 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.919039 1.909093 -0.244813 -0.596728 -0.620498 2.328275 -1.157802 4.845746 0.669019 0.677900 0.420878
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.592900 -0.208640 0.064941 -1.042025 -1.150601 -0.968821 5.410374 -0.530898 0.650798 0.631268 0.412347
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 32.021646 -0.033829 -0.634422 0.386878 2.320838 -0.817309 0.454043 1.086819 0.430183 0.653606 0.401502
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.820403 -1.111136 -1.352731 -0.564759 -1.092724 -1.505822 0.553375 -1.627610 0.618617 0.652954 0.417823
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 7.277409 11.717914 1.681390 3.482476 5.032583 7.160143 19.483723 1.764566 0.303468 0.040004 0.214363
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.756315 10.998691 -0.391380 6.904654 -0.316377 7.071365 0.275718 2.985079 0.628686 0.037475 0.479497
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.417427 -0.548031 -0.063503 1.531682 0.036235 0.171726 -0.069040 0.377402 0.648215 0.654434 0.407727
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.579558 -0.013831 -0.245267 0.181260 0.128925 -0.292650 -0.279289 1.176843 0.658638 0.672357 0.406102
84 N08 RF_maintenance 100.00% 37.54% 100.00% 0.00% 19.499887 22.299152 9.534793 10.211490 5.741426 7.119556 6.124381 8.204081 0.228464 0.036165 0.157415
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.013831 0.123636 0.986494 0.958002 -0.708890 0.432655 -0.258899 -0.220346 0.666281 0.678197 0.404789
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% -0.117979 -0.383765 1.120477 1.161380 0.578029 -0.036512 1.002555 21.891688 0.657836 0.673720 0.397030
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.874889 6.812810 -0.407340 -0.105188 9.322733 1.426858 1.476794 2.529457 0.656071 0.690402 0.401670
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% 239.798192 239.795797 inf inf 3759.872973 3675.563806 10179.817512 9635.712022 nan nan nan
91 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 245.175524 245.201524 inf inf 4117.984565 4096.576559 11563.726520 11496.722582 nan nan nan
92 N10 RF_maintenance 100.00% 0.00% 27.62% 0.00% 36.443609 43.413623 0.165748 0.691936 4.990825 5.234699 4.727502 24.031221 0.281604 0.229251 0.102973
93 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 1.662180 0.120729 1.467495 0.236750 0.017457 1.087910 6.933209 0.039302 0.653366 0.675445 0.417050
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.578390 10.629015 7.467685 7.901450 7.075519 7.189844 1.604069 1.321512 0.031755 0.026625 0.002774
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.629031 -1.450660 -1.112760 0.107920 -0.905708 -1.015589 -0.717642 0.137629 0.625291 0.663785 0.419360
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.698863 11.328049 2.949997 3.624111 6.993146 7.113999 1.808543 1.460139 0.033668 0.040044 0.003121
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.426181 2.049552 -0.069720 -0.242814 -0.260602 -0.524967 5.582653 13.232515 0.565510 0.604989 0.410260
98 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.908755 0.199924 -0.189817 0.092569 -0.664119 0.184495 1.370134 2.423241 0.627214 0.644791 0.409974
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.446852 -0.747509 0.419724 0.367336 -0.528674 0.289333 2.700009 -0.304762 0.633554 0.660318 0.415175
100 N07 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.885609 7.380158 -0.617981 0.768365 0.308773 1.400211 0.011435 0.046953 0.677575 0.682004 0.403650
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.872156 0.458344 -1.315338 2.190365 0.618549 0.292764 -0.397691 7.108226 0.683884 0.675490 0.399069
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.785452 5.274094 3.540596 -0.266170 2.016842 1.599790 9.791625 15.045248 0.645174 0.687499 0.402939
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.902130 58.946214 5.011801 5.487102 0.742442 0.893476 0.922604 5.690606 0.614604 0.651769 0.403464
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% 228.858284 228.609858 inf inf 2761.207302 2767.468495 8794.398705 8780.962802 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 digital_ok 100.00% 100.00% 100.00% 0.00% 9.414835 10.192939 7.337783 7.803126 7.127540 7.238375 0.998864 2.922443 0.029437 0.034565 0.002462
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.886131 23.831844 -0.202207 10.346108 2.802030 7.079574 5.244198 6.548309 0.668048 0.032466 0.468148
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 0.037820 10.171713 0.096046 7.882451 0.199729 7.237093 5.222636 3.138901 0.662668 0.035323 0.476925
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.486479 1.321887 -0.134448 0.004808 0.414282 0.849636 0.657493 -0.251678 0.653379 0.662683 0.417247
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.463575 11.360076 2.782362 3.541466 7.006421 7.130410 2.604109 1.242250 0.036031 0.030705 0.003015
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.944179 0.487490 -0.702383 -0.581018 0.891235 -1.398707 1.438007 -0.127477 0.572835 0.638294 0.428715
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.035196 1.558149 0.604738 1.217012 0.073506 0.734429 -2.093779 -2.548348 0.609474 0.635426 0.438295
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.512645 -0.335310 -0.929416 -0.055584 -0.690694 0.121287 0.113463 0.037641 0.623960 0.641770 0.409908
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.416607 11.669639 7.389148 8.260046 7.028847 7.218111 2.584940 5.987044 0.027597 0.032422 0.002898
118 N07 digital_ok 100.00% 0.00% 0.00% 0.00% -0.073178 1.227244 -0.382844 0.412938 0.017307 -0.046661 2.533580 5.340736 0.651894 0.670642 0.408842
119 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.663496 2.580107 1.770759 1.212827 -0.125690 0.539443 1.716122 -2.940359 0.662120 0.685672 0.391325
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.106620 4.484940 -1.276639 0.422964 0.326612 5.208550 19.733447 23.799648 0.684342 0.690554 0.398084
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.814334 6.258003 0.884166 0.542975 3.424509 1.276008 0.503968 -0.251906 0.679777 0.686818 0.403034
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.787925 8.812980 0.177961 0.734636 0.585041 1.231831 -0.245924 0.514856 0.680016 0.687355 0.415779
124 N09 digital_ok 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 digital_ok 100.00% 0.00% 0.00% 0.00% -0.018061 0.129400 -0.082193 0.254847 1.465020 1.596190 3.928233 10.880182 0.662214 0.679213 0.432546
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 8.796243 9.757597 7.386873 7.975038 7.054948 7.160540 0.718162 1.249083 0.031409 0.026522 0.002721
129 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.741615 -1.464315 0.303640 0.769244 -0.161580 0.533079 0.621194 1.595002 0.660792 0.675515 0.426503
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.030365 0.767965 -0.217318 0.274644 -0.358720 0.852872 1.010322 4.379744 0.645084 0.666881 0.411984
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.511954 11.463342 2.974973 3.717213 7.066313 7.182692 4.452733 0.069437 0.033776 0.039448 0.002472
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.379232 1.041782 -1.471859 -1.288173 3.034540 -1.113200 0.604664 -0.271538 0.595154 0.621559 0.414123
133 N11 not_connected 100.00% 100.00% 84.88% 0.00% 10.983624 15.170119 2.784009 2.579904 7.060782 5.820760 2.494227 1.343722 0.042435 0.173608 0.097842
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.827532 -0.719892 0.156060 -1.367931 1.939903 0.588122 10.071710 0.487296 0.623672 0.652294 0.428408
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 3.146440 -0.461856 4.673378 2.409855 7.019616 9.408631 0.941148 1.299509 0.535221 0.633978 0.421614
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.244329 -0.613589 -0.363685 -0.767790 0.765357 -0.427106 1.468920 2.426029 0.635972 0.662295 0.417909
138 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.725320 -0.546379 0.881786 -1.240546 -0.217883 -1.092660 -1.607671 0.448419 0.663240 0.664209 0.401434
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.480984 -0.533089 -1.118141 -0.765801 -0.291242 -1.116424 6.286295 3.910800 0.675438 0.693766 0.399923
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.406183 -0.876467 -0.686332 0.025819 1.391441 -1.507687 0.691488 -1.666290 0.675047 0.690528 0.400420
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.484698 10.092905 -0.976459 8.011796 1.255643 7.210564 23.862648 2.760448 0.672834 0.046482 0.573275
143 N14 digital_ok 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% 258.835944 259.005153 inf inf 4742.594821 4743.680833 14309.186798 14321.811209 nan nan nan
145 N14 RF_maintenance 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.615723 -1.648688 0.710022 1.744490 -0.259812 0.011732 -0.171114 0.241752 0.654263 0.665985 0.419456
148 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 9.402795 -0.035623 7.241834 1.302487 7.119285 1.660823 0.658747 -0.192173 0.032827 0.674740 0.505572
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.855538 0.899308 -1.269421 0.909796 -0.320929 -0.225512 2.609922 -1.009811 0.659238 0.675879 0.424107
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.974206 -0.077708 0.864916 0.126926 0.302970 -1.152268 -2.084847 -0.739519 0.653091 0.670260 0.435141
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.289690 -0.537144 7.096203 -0.743083 7.106416 1.485780 1.222980 1.585165 0.035957 0.652980 0.495216
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.689539 9.893271 2.693885 7.790125 -0.812571 7.209149 1.608779 1.092779 0.600801 0.039761 0.488374
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.024340 -0.165748 -0.347545 0.471881 -0.192587 1.257871 -0.273726 0.334527 0.642907 0.659421 0.418641
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.224746 0.141264 -0.625055 -0.551039 1.154832 1.835023 5.931502 23.655923 0.659363 0.673728 0.418041
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.199641 18.035253 -1.436644 -1.054604 -1.228932 4.384653 0.050785 101.911895 0.633928 0.585817 0.392185
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.553141 -0.901181 -0.536007 -0.636880 -0.079379 1.633886 0.526957 1.711927 0.670368 0.682032 0.405094
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.055210 27.268778 -0.394926 -0.551293 0.163217 0.389156 -0.283762 1.370659 0.670368 0.552610 0.368945
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.290420 -0.235792 1.518810 0.518010 0.326120 -1.167444 -1.239451 -1.776461 0.673386 0.687141 0.409451
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.310350 -1.492682 -1.035542 2.924549 0.856181 -0.305227 -1.046295 3.656464 0.668475 0.653229 0.435590
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.065332 -0.944443 -0.206198 -0.374348 1.094135 1.318013 -0.061920 2.318664 0.660072 0.677746 0.429311
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.695934 1.889695 -1.020636 -1.409565 0.282993 -0.404098 -0.599622 -0.243467 0.661468 0.662275 0.426732
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.239157 -0.444141 7.486622 -0.777289 6.996344 0.544839 1.561279 1.293730 0.038711 0.671662 0.548476
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.418430 -0.382484 1.211436 1.800195 -0.451510 0.649142 0.287116 -0.265034 0.642883 0.658707 0.413880
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.101508 10.968565 -0.466666 8.114350 1.646148 7.163140 28.836510 3.501412 0.666511 0.053617 0.577051
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.486214 0.006204 -0.417062 0.260825 0.712616 0.710388 -0.247691 7.402995 0.674043 0.681266 0.413872
182 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.159210 4.107905 -0.672109 2.053103 -0.808086 2.907769 18.126207 -1.896413 0.677737 0.675673 0.419987
183 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.608336 1.251187 1.079962 4.214620 0.518674 -1.028332 0.823466 0.071757 0.650562 0.618862 0.409307
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
185 N14 digital_ok 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 100.00% 0.00% 0.00% 0.00% 9.107453 8.525315 0.525253 -0.452450 1.996891 3.954077 2.220930 2.986342 0.347469 0.369212 0.181979
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.326158 -1.590995 -0.795648 -0.269826 0.073052 -1.310987 -0.128320 -1.591771 0.650415 0.669584 0.443010
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.852538 0.363175 0.629114 -0.399497 0.690916 0.992772 21.157769 1.501640 0.631547 0.654822 0.442932
200 N18 RF_maintenance 100.00% 100.00% 37.00% 0.00% 11.208823 34.896519 2.921470 0.112606 7.124743 5.745514 2.688430 0.092834 0.048466 0.219193 0.152507
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.148812 6.146371 3.586280 2.831446 5.646800 4.734248 -4.777417 -4.188549 0.626376 0.645498 0.406423
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% 0.565390 1.510911 0.325433 -0.091291 -0.604065 -0.896105 -0.288009 2.721615 0.649700 0.622577 0.416706
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.714848 12.191200 2.741320 3.367277 7.094257 7.213450 3.817415 4.640126 0.033919 0.042813 0.001572
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.128468 2.202687 0.210987 -0.832502 -0.836003 -0.234814 -1.161904 22.150459 0.633233 0.628756 0.416224
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.022741 0.506836 0.462178 -1.186536 4.112667 -1.283472 -0.940172 5.719615 0.634573 0.637027 0.421341
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.367899 2.931547 0.791340 -1.018099 0.545756 -0.908334 -1.418416 0.036286 0.619823 0.612498 0.405448
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 249.739676 249.927521 inf inf 4746.620498 4746.978748 14336.897399 14335.174807 nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 237.161401 237.330682 inf inf 3548.458647 3585.577961 9154.737636 9486.115558 nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 231.287982 231.357625 inf inf 3680.251568 3684.443368 9728.747206 9595.644934 nan nan nan
211 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 214.549801 214.472595 inf inf 3626.714163 3631.445828 9512.170018 9572.157019 nan nan nan
219 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.269504 4.314430 3.686457 2.200218 5.857061 3.265228 -5.078059 -2.891034 0.619177 0.652731 0.427886
220 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.119289 -0.038323 -0.288192 -0.684311 -0.648249 -1.173824 9.453311 3.130241 0.642386 0.651255 0.414776
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.442077 -0.216241 -0.675346 -0.808793 -0.807438 -1.367176 2.851568 -0.223497 0.604452 0.655519 0.434947
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.603064 0.319259 0.195107 -1.190892 -0.929272 36.131660 5.420067 0.545658 0.635592 0.627367 0.429318
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.617971 1.573773 -1.425748 -0.092764 -1.001196 -0.428600 1.088410 48.785908 0.615451 0.612631 0.408898
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.217672 6.764019 3.691775 3.219837 5.792845 5.653363 -5.030359 -4.983905 0.610492 0.627307 0.418438
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 207.057765 207.134825 inf inf 3663.040106 3656.077233 9715.260254 9558.827589 nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% 245.514178 245.469218 inf inf 4219.339266 4156.281201 12163.131827 11801.122040 nan nan nan
227 N20 RF_ok 100.00% 100.00% 100.00% 0.00% 244.997317 245.075690 inf inf 4742.169345 4742.125626 14287.262181 14290.329228 nan nan nan
228 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 248.831872 248.443454 inf inf 3543.521421 3519.092337 8289.508276 8582.599665 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% 5.492109 1.556464 1.028875 -1.406892 1.592913 -0.356932 5.157528 0.665491 0.515418 0.633869 0.458364
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.255995 -0.803788 0.642228 0.062578 -0.688673 -1.026339 -2.055198 -0.029550 0.640111 0.647308 0.428694
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.617594 -0.734828 -0.610798 -0.599651 0.139328 -1.098844 1.223736 16.911341 0.629023 0.647868 0.424473
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% 218.820671 219.132932 inf inf 3727.353883 3683.107990 10007.927092 9764.993133 nan nan nan
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 223.262790 222.975060 inf inf 3872.982470 3853.703498 10542.442292 10452.247927 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% 224.461499 224.685232 inf inf 3541.074885 3555.068418 9083.968428 9286.228581 nan nan nan
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.469580 11.301997 -0.507524 5.205009 -0.299873 7.210402 11.527597 4.242200 0.640646 0.049665 0.544849
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.978784 2.001286 0.627840 0.686872 0.404714 0.256423 3.401736 0.145359 0.527257 0.549807 0.410041
325 N09 dish_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% 0.00% 0.00% 0.00% 2.265735 -0.959336 -1.260226 -0.780991 7.337908 -0.874171 5.433752 0.398859 0.484671 0.548458 0.413314
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.697847 0.503783 -0.845843 -1.421703 -0.450742 -0.848190 1.864874 0.851490 0.487876 0.538938 0.409991
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, 4, 7, 8, 9, 15, 16, 18, 19, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 42, 45, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 64, 68, 71, 72, 74, 77, 78, 80, 81, 84, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96, 97, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 113, 117, 118, 119, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 135, 136, 138, 140, 142, 143, 144, 145, 146, 148, 155, 156, 158, 159, 161, 163, 164, 165, 166, 170, 180, 181, 182, 183, 184, 185, 186, 187, 189, 191, 200, 201, 203, 205, 206, 208, 209, 210, 211, 219, 220, 222, 223, 224, 225, 226, 227, 228, 229, 237, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 325, 329]

unflagged_ants: [5, 10, 17, 20, 21, 22, 35, 40, 41, 43, 44, 46, 48, 61, 62, 65, 66, 67, 69, 70, 73, 79, 82, 83, 85, 95, 98, 99, 112, 114, 115, 116, 120, 129, 132, 137, 139, 141, 147, 149, 150, 157, 160, 162, 167, 168, 169, 179, 190, 202, 207, 221, 238, 324, 333]

golden_ants: [5, 10, 17, 20, 21, 40, 41, 44, 65, 66, 67, 69, 70, 83, 85, 98, 99, 112, 116, 129, 141, 147, 149, 150, 157, 160, 162, 167, 168, 169, 190, 202]
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_2459920.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.5.dev11+g87299d5
3.1.5.dev171+gc8e6162
In [ ]: