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

Load Auto Metrics¶

In [6]:
use_auto_metrics = False

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

# if it exists, load and extract relevant information
if len(auto_metrics_file) > 0:
    auto_metrics_file = auto_metrics_file[0]
    print(f'Found auto_metrics results file at {auto_metrics_file}.')
    
    auto_metrics = load_metric_file(auto_metrics_file)
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
    auto_ex_ants = auto_metrics['ex_ants']['r2_ex_ants']
    
    use_auto_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping auto_metrics.')
Found auto_metrics results file at /mnt/sn1/2459979/zen.2459979.21329.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 1849 ant_metrics files matching glob /mnt/sn1/2459979/zen.2459979.?????.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/2459979/zen.2459979.?????.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 2459979
Date 2-3-2023
LST Range 3.454 -- 13.405 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1849
Total Number of Antennas 196
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 9
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 196 (0.0%)
Antennas in Commanded State (observed) 0 / 196 (0.0%)
Cross-Polarized Antennas 96
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 51 / 196 (26.0%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 109 / 196 (55.6%)
Redcal Done? ❌
Never Flagged Antennas 87 / 196 (44.4%)
A Priori Good Antennas Flagged 43 / 93 total a priori good antennas:
3, 7, 9, 10, 15, 16, 29, 38, 40, 42, 54, 55,
56, 71, 72, 81, 86, 94, 101, 103, 107, 109,
111, 121, 122, 123, 128, 136, 143, 144, 151,
158, 161, 165, 170, 173, 182, 185, 189, 191,
192, 193, 202
A Priori Bad Antennas Not Flagged 37 / 103 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 61, 62, 64, 73, 74,
82, 89, 90, 95, 114, 115, 120, 125, 126, 132,
133, 137, 139, 166, 211, 220, 223, 229, 237,
238, 240, 241, 245, 324, 325, 333
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459979.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% 100.00% 0.00% 10.071969 13.079559 8.801147 9.572651 8.862525 10.085197 0.372038 0.801409 0.031355 0.031829 0.002781
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.156614 1.757184 1.806463 -0.147296 4.994696 0.639447 2.749833 0.309839 0.584030 0.612778 0.398972
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.907929 -0.325226 0.176786 0.182607 0.155562 1.860071 0.389659 0.189798 0.599893 0.613237 0.387742
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.109472 0.190631 -1.183478 -0.123136 -0.026189 0.070362 10.221141 9.762846 0.608222 0.625521 0.382372
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.305810 -1.394548 -0.690217 0.017375 -0.323034 0.653638 3.532186 0.826051 0.607347 0.621097 0.377141
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.566928 -0.651692 7.268616 -0.420275 4.743921 -0.010637 -0.299582 -0.638588 0.431997 0.619460 0.448952
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 3.129635 -0.632718 6.363802 -1.293895 3.974676 0.898256 -0.607123 -0.490355 0.485868 0.622087 0.432184
15 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.300930 12.811025 8.252923 9.008725 8.857904 10.067708 -0.514027 -0.305832 0.028704 0.026404 0.001396
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.274167 -0.974578 8.768679 0.751454 8.857285 1.700243 0.422406 2.202666 0.033466 0.619393 0.510371
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.582548 1.497543 0.243588 0.320337 0.065530 0.509067 1.287089 1.162412 0.610208 0.627523 0.388892
18 N01 RF_maintenance 100.00% 100.00% 49.16% 0.00% 10.903191 17.573031 8.738774 -0.699440 8.992758 5.798804 -0.098845 15.713573 0.031210 0.222916 0.173268
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.102764 -0.959261 -1.235423 -0.781559 -0.597661 0.757138 -0.217551 1.507856 0.616556 0.636418 0.379748
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.105573 -1.266949 2.069077 -1.041651 0.255545 1.238962 1.190757 -0.795385 0.604806 0.635795 0.385856
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.085590 0.573511 -0.755393 0.040820 0.518691 1.029724 -0.095179 -0.012320 0.604238 0.614293 0.374685
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.702384 -0.455426 0.394654 0.014759 0.637465 -0.092888 -0.564291 -1.169937 0.571634 0.590706 0.373710
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.742740 12.136962 8.796780 9.386124 8.965994 10.125302 1.208057 0.791152 0.035611 0.037173 0.004342
28 N01 RF_maintenance 100.00% 0.00% 89.02% 0.00% 10.507884 24.774204 -0.375265 2.309288 6.111122 8.303455 4.806075 19.073640 0.355338 0.147632 0.268520
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.342276 12.602418 8.422282 9.016451 8.964361 10.126014 0.351468 0.046165 0.030580 0.033668 0.004898
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 1.138114 -0.010457 3.628372 -0.146314 -0.717883 0.027313 0.837844 -0.022933 0.579925 0.640635 0.399693
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.306035 -1.350029 0.906042 0.868981 1.143129 -0.851218 0.143897 2.623929 0.629717 0.636411 0.376405
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.673447 24.975387 -0.292530 2.625160 -0.255332 0.193608 0.156270 5.833249 0.619891 0.522100 0.364821
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.830318 13.776774 3.710456 4.191490 8.965606 10.112572 1.658678 1.394811 0.035898 0.043914 0.006807
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.399447 -0.114550 1.226782 -1.355234 0.489041 -1.203919 -0.615278 0.220646 0.583259 0.578171 0.368614
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.167496 25.390291 11.738379 11.884480 9.069760 10.028516 4.745504 4.876806 0.033676 0.029347 0.001793
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.029143 0.352388 -1.347708 0.717129 0.566065 0.910293 -0.682293 2.034258 0.604900 0.616648 0.395407
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.420854 -0.232172 -0.046775 0.474453 -0.281477 0.738807 4.870564 1.052139 0.608971 0.621709 0.390650
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 9.721907 3.637955 8.446949 0.390354 8.922463 -0.259681 0.330876 0.406799 0.038158 0.606840 0.470854
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.355803 0.054023 -0.166489 -0.008350 1.405556 0.361133 -0.692817 0.537963 0.616699 0.635937 0.373518
42 N04 digital_ok 100.00% 0.00% 40.51% 0.00% -0.647250 11.047962 3.167424 9.568557 -0.495662 8.749097 -0.379102 0.577783 0.607046 0.234857 0.474321
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.216500 0.602984 -0.116439 0.586733 -0.783337 0.251184 -0.076848 1.128584 0.624248 0.628373 0.371598
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -2.101846 -0.172146 -0.521849 -0.525350 -0.864811 0.210000 -1.162935 -0.748578 0.622977 0.643173 0.374237
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.627124 3.235619 -0.036062 0.559355 -0.717126 1.466547 0.270634 1.574564 0.610229 0.623109 0.367144
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.324455 -0.119931 -0.976926 -1.176639 -0.416703 -0.151709 -0.538188 -0.765184 0.615762 0.640277 0.386327
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.980093 13.489564 3.550119 3.854167 8.925348 10.060514 1.289001 0.541748 0.031889 0.046266 0.011268
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.081518 0.724425 0.363546 1.514790 -0.889184 1.518431 -1.134690 -2.151575 0.587511 0.610746 0.381199
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.216289 -0.332584 -1.125536 -0.510577 0.847097 -0.848817 0.753817 8.394044 0.538543 0.583833 0.378186
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.574787 3.411288 0.073217 0.928959 1.553633 2.192751 15.365674 30.725182 0.580086 0.581050 0.371223
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 11.426451 4.067262 0.025435 1.594152 3.991882 4.208104 52.654837 1.391457 0.488819 0.502846 0.250787
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.395383 5.857302 -0.504030 0.456278 0.952236 0.559918 2.011809 1.921762 0.615517 0.628329 0.386233
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.794487 2.648086 -0.038322 0.322597 1.101088 1.714517 1.607068 2.438359 0.625384 0.639351 0.390739
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 27.612189 -0.472423 4.079671 4.092516 1.783630 -0.968999 4.127522 1.863465 0.447450 0.610930 0.363323
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.530393 13.392725 8.815400 9.499190 8.981336 10.109899 1.394665 2.668562 0.029713 0.031113 0.002897
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -1.044390 1.514667 2.630908 6.620516 -0.040600 2.766673 0.418615 0.684718 0.616340 0.565847 0.378617
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.032795 -0.209391 6.382285 0.491780 5.178716 1.358503 13.332628 1.396698 0.475537 0.644785 0.412666
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.724041 12.552857 8.712403 9.503468 8.857301 10.039588 1.090183 0.749185 0.036590 0.034931 0.001752
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.537305 0.693859 8.311117 0.902485 8.702979 1.220412 0.119576 4.519364 0.045591 0.630870 0.502012
60 N05 RF_maintenance 100.00% 0.00% 99.89% 0.00% 2.090236 12.446188 -0.575956 9.527936 -0.294312 10.076490 1.396286 2.841625 0.609214 0.061113 0.498035
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.395112 0.295881 -0.844489 -1.346364 1.038312 -1.313345 -0.459104 0.229057 0.564396 0.598118 0.370282
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.014399 0.263726 -0.820887 0.824601 -0.266818 -0.644575 2.476623 -0.635105 0.550099 0.606915 0.385257
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.002150 12.990248 -0.285543 4.213132 0.616772 10.197803 0.157157 2.284642 0.585871 0.043077 0.469013
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.080937 0.405570 -0.754490 -0.917646 -1.099648 -1.191760 1.280771 -0.447190 0.569105 0.563540 0.360759
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.431720 1.040773 0.173485 0.981616 -0.328303 0.707848 1.664765 0.389584 0.592521 0.612869 0.400407
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.478320 1.203975 -1.332878 -1.159263 2.212114 -0.285851 -0.812032 -0.530970 0.608754 0.630791 0.398343
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.693597 1.995637 -0.411653 1.189281 -0.351288 0.402760 0.197771 2.099168 0.620319 0.621375 0.382399
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 19.228393 26.100498 0.712252 12.524640 4.844377 9.998497 -0.332672 7.184169 0.359437 0.028949 0.268398
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.082238 -0.739628 0.008350 0.746806 -0.520968 1.005577 -0.110048 0.057856 0.618980 0.642098 0.371327
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.354246 -0.256541 -0.275841 0.095875 0.596076 1.169940 1.244814 0.815503 0.630408 0.647675 0.371221
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.387201 -0.412262 0.432048 0.816025 0.411326 -0.285633 1.393839 0.604867 0.639790 0.653909 0.367439
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.734069 13.654342 9.167516 9.878423 8.757155 9.910948 0.559963 0.717381 0.033006 0.033198 0.002581
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.769262 0.783892 -1.402773 -1.050023 0.666622 0.318768 -0.626173 -0.744014 0.633714 0.648699 0.370536
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.346506 -0.050870 -0.157316 -0.496528 0.232185 1.157927 -0.608923 2.854996 0.630983 0.642566 0.369636
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 59.679678 0.695916 0.493422 -0.609698 6.015690 -0.958360 17.305420 0.199391 0.279191 0.601625 0.445360
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 32.362634 -0.488438 -0.516431 0.778595 2.137016 -0.525827 1.397140 0.721322 0.419634 0.614585 0.375769
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.867213 13.253018 -1.464825 4.240531 -0.574157 10.015000 0.868844 -0.382447 0.576446 0.039538 0.448352
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -0.547724 14.058280 0.212164 4.147000 -0.744223 10.038485 -0.752068 0.451362 0.591617 0.045289 0.466215
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.336781 13.318875 -0.033308 8.272299 -0.222764 9.801176 0.550303 1.721816 0.569677 0.036934 0.440961
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.549313 -0.409226 0.232250 1.947758 -0.584487 -1.065712 -0.467846 0.626313 0.590834 0.598631 0.378336
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.499773 0.041383 0.026747 0.288230 0.201305 0.572588 -0.392462 0.278686 0.603948 0.624072 0.383769
84 N08 RF_maintenance 100.00% 41.64% 100.00% 0.00% 176.837058 65.200172 56.843756 31.296281 2434.526363 59.868625 4886.835906 807.986881 0.266944 0.016117 0.141604
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.240617 0.388018 1.145004 1.280826 -1.118679 -0.238426 -0.533527 -0.549467 0.617400 0.637401 0.374433
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.355483 -0.312970 1.002614 1.503344 2.446654 -0.975117 0.285911 17.344495 0.609651 0.632789 0.357487
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.438050 4.419866 -0.927922 -0.474934 1.752035 1.754408 27.874733 23.956720 0.628482 0.654253 0.357408
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.211595 -0.213986 0.221833 0.627369 -0.268725 -0.983642 1.008276 0.208365 0.630918 0.648096 0.361012
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.189188 0.145730 -0.148993 0.735190 -0.673428 -0.767922 -0.590625 -0.505577 0.636455 0.650060 0.364385
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.278468 -0.424536 0.641574 3.011341 -0.821879 -0.998014 -0.194901 2.215905 0.627256 0.622481 0.362493
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.340740 -0.275878 0.222615 0.209825 -0.669813 -0.706204 0.337247 0.401457 0.625894 0.647359 0.377580
92 N10 RF_maintenance 100.00% 0.00% 20.77% 0.00% 33.409435 36.599523 0.203972 1.295104 5.073811 4.189802 0.411030 7.376461 0.281375 0.244968 0.064829
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.692392 -0.366507 1.857719 -1.026741 0.686085 0.014313 1.888361 -0.358692 0.616406 0.639036 0.384999
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 11.045356 12.910595 8.917486 9.406827 8.962055 10.093082 1.345984 1.099203 0.033537 0.026638 0.002689
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.489144 0.825086 -0.951196 0.574301 -0.569436 -0.261471 -0.059360 0.529873 0.582941 0.617249 0.385734
96 N11 not_connected 100.00% 0.00% 0.00% 100.00% 11.826610 6.286600 3.090504 4.239420 3.827698 7.941063 -1.688729 -3.426442 0.249374 0.210856 -0.253928
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.866848 5.853644 -1.146660 1.194606 -0.798112 2.920175 2.029750 6.291716 0.570374 0.523406 0.370582
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.206736 8.340725 -0.525093 1.101163 -0.001324 1.389430 0.435085 0.654771 0.622625 0.637177 0.376374
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.848411 1.102938 -1.430616 -0.775865 0.477301 0.871071 0.011150 8.454932 0.631995 0.646554 0.372845
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.170317 4.997489 2.647563 -1.104606 3.770865 0.831571 8.968462 7.361165 0.617885 0.653296 0.373053
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.384453 57.929381 -1.073415 6.451733 1.372709 -0.781788 1.240520 2.287713 0.636588 0.623412 0.360527
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.685036 -0.335051 0.118686 0.770075 -0.196148 -0.868972 -0.772538 -0.666688 0.635809 0.649626 0.360838
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.531807 1.232865 -1.440125 -0.561788 -0.140263 -1.151958 -0.285026 -0.250284 0.639353 0.654614 0.361879
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 1.539534 0.611778 -0.838316 -0.978070 0.036344 -0.023295 5.342711 4.039703 0.635982 0.657359 0.366774
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.175792 40.495929 8.745526 0.903922 8.940644 4.277334 0.819913 11.842813 0.036047 0.277696 0.160928
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.995669 12.526124 8.773113 9.275485 9.005878 10.138899 0.312308 1.327067 0.030049 0.026229 0.001887
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 24.487587 24.764298 11.811516 12.306909 8.868857 9.875810 2.652706 2.808945 0.025066 0.024670 0.000995
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 27.879608 12.582020 2.244326 9.223745 4.691529 9.824220 2.043451 1.085674 0.296530 0.077092 0.174144
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.572237 -0.328140 0.063255 0.242674 0.426146 2.391633 0.501455 -0.751572 0.616380 0.632549 0.388110
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.030447 13.787157 3.385654 4.236896 8.831035 10.001747 2.043265 1.249894 0.036929 0.031595 0.002367
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.404947 0.612085 0.918231 -0.405693 0.584392 -1.284337 -1.037717 -0.367795 0.585477 0.603198 0.374721
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.844971 -0.749411 -1.023356 -0.679344 0.025680 -1.600642 -0.822316 -0.599973 0.558744 0.588920 0.383123
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.980890 13.953821 8.875239 9.835986 8.852905 10.087037 2.098516 4.280702 0.030005 0.031929 0.002552
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.295737 1.354679 -0.362391 0.477576 -0.289105 0.327040 0.819119 1.848526 0.601940 0.623588 0.389329
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.874718 1.953896 2.328604 -0.844751 -0.174544 0.890634 2.865390 1.407034 0.612891 0.649535 0.381737
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.105035 2.975515 -1.337240 5.434649 0.650191 -0.836614 4.791517 13.955330 0.635572 0.623249 0.364179
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 3.291400 6.149683 -0.064956 0.849497 1.176106 0.901371 -0.606931 -0.772334 0.627792 0.653700 0.369458
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.784191 8.534449 0.560275 0.875769 0.011546 0.100742 -0.306551 -0.021516 0.644899 0.660114 0.371465
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.031740 -0.196408 -0.186615 0.577990 -0.609087 0.182369 1.125081 0.812557 0.644120 0.660026 0.372061
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.614954 0.034477 -0.465654 0.669638 0.019333 -0.014313 0.130716 0.090589 0.638323 0.649974 0.365563
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.133620 0.449485 -1.356398 1.005270 1.287119 0.546884 0.748064 0.045532 0.641288 0.643928 0.370337
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.327417 0.251979 0.396085 0.374391 0.716967 0.609128 0.162826 -0.026910 0.635016 0.654488 0.381033
128 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 1.530340 11.637786 5.854013 9.005740 0.875382 9.979532 -0.919246 -0.215722 0.532900 0.033313 0.382544
131 N11 not_connected 100.00% 0.00% 6.33% 0.00% -0.882284 12.230984 -0.119066 4.066393 -0.721420 8.651858 -0.821435 -0.038513 0.601939 0.283105 0.426743
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.513202 2.793822 -0.344473 -1.431536 1.363825 -1.202497 -0.151974 -0.132233 0.581482 0.581930 0.364387
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.949556 0.163860 -0.859946 1.496635 -0.755465 0.697944 -0.821967 -0.607414 0.570825 0.608464 0.395553
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.082462 -1.054120 -0.987747 -1.506493 2.169215 0.913250 4.469243 -0.522142 0.567499 0.605314 0.406128
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 9.344687 -0.460309 8.394099 -0.724959 8.981478 0.489372 0.980294 -0.580309 0.040440 0.606442 0.460964
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.255153 -0.799521 0.074226 -1.508781 1.377304 -0.226287 0.590792 0.096646 0.581926 0.619156 0.392579
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.726490 -0.141128 1.384920 -1.029709 0.695672 -1.397232 -1.231275 -0.288140 0.611403 0.619133 0.371551
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.261105 -0.967996 -1.088020 -0.370139 -0.743257 -1.255924 3.016182 2.548787 0.628406 0.650679 0.374798
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.453780 -1.009868 -0.356266 0.405661 1.410351 -1.395931 0.543816 -0.949438 0.630732 0.657096 0.372013
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.489029 12.473747 -0.677673 9.529898 2.501544 10.095289 26.795730 0.915068 0.627531 0.043482 0.511810
143 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -1.349526 -0.238584 -0.710680 1.091391 -0.452390 4.930280 -0.862361 -1.523604 0.646873 0.659201 0.372394
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.532612 0.038574 -1.261470 5.894521 -0.058396 7.533715 -0.906446 -0.650581 0.644438 0.578080 0.393856
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.418660 12.618478 8.766793 9.562992 8.766196 10.159245 -0.001840 2.148855 0.066302 0.031279 0.025515
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.144974 -0.663946 1.335732 0.363795 0.542703 -0.766009 -1.524118 -1.747732 0.632042 0.647710 0.372585
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.613313 -1.582758 0.830617 2.135375 -0.663159 -0.689834 -0.404372 0.350562 0.623867 0.632495 0.370730
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.345601 0.086394 -0.658422 -0.543500 1.346943 1.674861 -0.948679 -0.988439 0.627824 0.645532 0.384656
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.022867 -1.368657 -1.224353 -1.505109 -0.412151 1.054610 0.308893 0.706327 0.620482 0.639102 0.389039
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.527899 -0.616914 -1.111940 -1.397053 -0.718950 0.712866 0.549643 1.282650 0.618740 0.634338 0.390194
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 14.889994 1.267927 0.079186 0.401310 5.231337 -0.930548 4.005401 -0.117320 0.523423 0.565220 0.349869
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.660020 -0.988508 8.534873 -1.327349 9.013399 0.042096 1.357850 1.636462 0.041544 0.606044 0.470215
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 3.830079 12.191898 7.130735 9.285540 4.903373 10.160338 1.729278 1.999588 0.412558 0.038209 0.320011
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.010457 -0.331176 -0.187679 0.639228 -0.541153 0.360159 -0.790624 -0.365852 0.589101 0.616614 0.389592
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.453224 0.011352 -0.216738 -0.413406 1.087095 1.946019 1.511003 11.661172 0.604828 0.632646 0.391614
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.424194 20.755041 -1.440371 -0.943238 0.028616 5.092987 -0.762241 43.558260 0.576354 0.529171 0.352352
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.776120 -1.125424 -0.443020 -0.583557 -0.623623 1.384093 0.248836 0.121782 0.620067 0.640132 0.377795
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.033837 28.237109 -0.142308 -0.526050 -0.077863 1.001467 -0.467111 0.184193 0.626077 0.510943 0.343041
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 2.388875 -0.952775 -0.869638 -1.379113 0.877277 0.927940 2.347951 0.012320 0.628106 0.655565 0.377345
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.462743 0.904597 -0.360251 0.456819 -0.249137 0.202649 -0.508792 0.518256 0.639214 0.653536 0.377459
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.068001 0.145947 0.157919 1.365947 -0.117389 1.279433 0.772603 0.722506 0.633072 0.647330 0.366872
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 30.818602 -0.256372 -0.608020 -0.910949 3.501991 0.037801 3.878977 0.239087 0.508083 0.652908 0.372777
166 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.146086 2.586785 -0.544770 2.738916 0.445073 3.695155 3.734591 0.270983 0.632106 0.642391 0.371971
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.996905 -1.086631 -1.402030 -0.112260 1.145699 0.129699 0.369146 3.070883 0.632440 0.643535 0.375646
168 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.975646 -1.436487 0.126051 -0.331649 0.920896 1.079940 -0.543731 0.844048 0.625435 0.640516 0.382185
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.864839 -1.176357 -0.964942 -1.535429 0.332050 0.461944 -0.728114 -0.476183 0.625992 0.643228 0.386497
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 10.930492 -0.480518 9.060320 -0.693523 8.800369 0.063042 1.994423 5.539871 0.040485 0.637679 0.503725
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.784231 2.794848 -1.357164 0.014925 -0.592700 1.066294 -0.395313 0.496640 0.564983 0.549184 0.358479
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 12.191394 12.966230 3.113923 3.865897 9.061666 10.147491 2.805748 4.129467 0.041012 0.043377 0.003550
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.127390 -0.654424 -0.181874 -0.449258 -0.358582 11.299279 -0.940936 3.469687 0.581156 0.626414 0.389748
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.420400 13.207076 -1.519445 9.665449 0.484007 10.006501 13.173167 1.200686 0.620745 0.049968 0.519937
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.325858 -0.311546 0.235588 0.408910 -0.096277 -0.077825 -0.566350 3.017050 0.624051 0.639225 0.381231
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.131346 12.170079 -1.154140 9.257439 -0.326416 10.156395 6.903089 0.769786 0.633625 0.044087 0.487100
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.492676 0.130557 -0.822368 0.013493 0.992928 -0.714046 1.096699 0.811806 0.624566 0.641269 0.369611
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.095760 -0.663579 -1.443897 -0.380032 -0.610449 -0.100098 -0.189446 -0.267284 0.636969 0.652889 0.365613
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 32.508556 -0.270378 -0.571965 -1.303999 7.477958 0.424348 14.293119 0.244265 0.517352 0.650454 0.376449
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.219721 -0.750594 0.330639 -0.402299 -0.208934 -1.238710 -0.167969 0.699444 0.641014 0.655697 0.376294
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.773307 0.391944 -0.593635 1.421209 0.718254 0.055492 0.267904 -1.499912 0.627892 0.645984 0.373185
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 9.196617 12.058066 8.371010 9.376396 9.036958 10.176652 4.254026 2.196397 0.029850 0.031616 0.001636
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.310582 -1.500502 -0.787564 0.185623 -0.590903 -0.699108 -0.895297 -1.377779 0.618224 0.642441 0.395355
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.754853 0.569680 1.025414 -0.370775 0.393358 0.394079 8.862295 0.387297 0.602680 0.621627 0.388329
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.108223 6.546218 4.479565 4.301007 6.723012 7.984046 -3.343092 -3.452403 0.564810 0.582297 0.378561
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.937092 0.446901 4.668455 1.341847 7.043330 1.551431 -3.084867 -0.083237 0.550037 0.591780 0.403599
200 N18 RF_maintenance 100.00% 100.00% 76.85% 0.00% 11.838536 34.683840 3.495060 0.662452 9.043919 4.886131 1.120561 21.369942 0.042195 0.176936 0.113800
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.523127 4.506531 2.842590 3.675149 2.418527 6.339035 -0.713483 -2.463139 0.609972 0.610981 0.376367
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.560632 3.450426 1.475943 -1.042069 0.657754 -0.548040 -0.814350 18.965356 0.616065 0.600544 0.374190
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 10.005409 1.015862 3.237861 0.418780 7.733412 -0.701481 -0.435489 5.395488 0.273217 0.593107 0.450354
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.192807 7.338532 -0.516016 1.831706 0.314414 3.433725 -0.375676 0.639598 0.600167 0.497071 0.396563
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.265047 2.787114 -0.700376 0.261031 -0.554413 -0.387649 5.922497 0.686792 0.600157 0.578015 0.370100
208 N20 dish_maintenance 100.00% 97.57% 98.00% 0.00% 175.857831 175.918261 inf inf 3607.934012 3628.419909 5652.408486 5712.538678 0.355461 0.321426 0.285860
209 N20 dish_maintenance 100.00% 97.78% 98.05% 0.05% 254.845076 177.985441 inf inf 4285.255475 2933.254702 8117.933578 5358.841593 0.358258 0.308785 0.293564
210 N20 dish_maintenance 100.00% 97.89% 97.78% 0.00% 194.849189 194.554481 inf inf 3324.753911 3355.558308 5216.380471 5332.360564 0.337970 0.333461 0.286044
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.906984 2.252403 -1.190134 -0.176072 -0.612252 -0.663725 1.652630 -0.269889 0.561840 0.581317 0.368887
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.206888 -1.253988 0.365136 -0.540783 -0.738999 -0.786965 2.497206 -1.406737 0.602702 0.612300 0.374741
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 1.140343 0.021048 -1.308958 -0.839548 -0.446981 -1.375444 5.131902 -0.954037 0.583363 0.617261 0.379307
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 0.572213 -0.332203 -0.361116 -0.575190 -0.521614 15.998415 1.717768 -1.090410 0.595088 0.616079 0.375793
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.058385 -0.569053 -1.534641 0.188024 -0.674079 -1.150934 1.045293 2.247288 0.587456 0.627789 0.383876
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.272981 5.802386 4.832315 4.171685 7.215709 7.476755 -3.434072 -2.685134 0.582856 0.605466 0.374721
225 N19 RF_ok 100.00% 0.00% 93.51% 0.00% -0.871378 12.702381 0.536967 4.026978 -0.703798 9.843934 -1.288309 0.587711 0.608523 0.128090 0.509023
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.613544 19.325818 -0.548433 0.635855 -1.052850 5.066180 -0.778055 -0.055865 0.596534 0.531730 0.362103
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 2.001682 0.291315 -1.457719 -0.111188 -0.374903 -0.942467 10.360066 -0.368577 0.561201 0.601905 0.370634
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.281839 19.680941 -0.958817 -0.434204 1.227142 2.042108 44.493005 12.527510 0.517950 0.490245 0.311313
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.769815 -0.298459 1.416863 1.059648 0.034684 0.410483 -0.267300 -1.765269 0.583280 0.602790 0.388928
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.958126 0.192287 -0.224275 -1.511672 -0.017241 -1.136004 -0.978802 -1.234934 0.535438 0.591469 0.390614
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.589768 -0.019929 0.791927 0.046276 -0.581253 -0.996178 -1.589682 -1.770071 0.597675 0.611937 0.384554
239 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -1.002603 -1.510145 -0.116260 -0.167763 -0.479852 -0.850688 4.591060 1.290672 0.595325 0.614253 0.382769
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.559553 0.627850 1.279648 1.505788 0.363643 0.841883 2.988181 2.930400 0.602555 0.622237 0.388299
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.597203 -1.256095 -0.454654 0.497241 -0.674903 -0.939722 0.527431 -0.840245 0.593491 0.621835 0.394365
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 23.861946 0.529511 0.268733 1.365561 2.581894 0.948295 -0.448152 -0.096411 0.451096 0.614152 0.381474
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 52.370597 -0.507453 0.659828 -1.446666 6.989762 -1.133232 3.760459 0.088175 0.399035 0.590730 0.412790
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.706397 1.881074 1.078850 -0.769938 2.486509 -0.527201 2.146836 5.740685 0.463219 0.567306 0.377644
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.421110 2.124952 0.119536 -1.098435 -0.457670 -1.431491 -1.291139 -0.527423 0.574363 0.581130 0.378043
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.663753 6.740278 -0.593848 -0.002752 4.453238 4.277173 3.191473 -0.612220 0.312729 0.307767 0.155063
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.333944 1.451154 0.570756 -0.649189 -0.736722 -1.220855 -0.609981 5.185187 0.573871 0.578192 0.380561
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.493217 7.450041 8.049179 9.060161 8.782189 9.803271 10.338362 23.544947 0.033357 0.027302 0.004066
320 N03 dish_maintenance 100.00% 100.00% 100.00% 0.00% 13.975540 12.920347 5.690525 6.159135 9.015486 10.190139 1.262896 2.683869 0.053020 0.045021 0.006389
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.716443 2.294303 0.946576 1.151614 0.542243 0.546292 -0.165614 -1.191000 0.487469 0.506186 0.370518
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.606128 -0.890663 1.043187 -1.482612 0.687972 -1.251991 -1.616820 -0.524733 0.517539 0.522023 0.383159
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.167363 -0.382443 0.878487 -1.163174 1.672068 -1.233984 2.014179 -0.117411 0.407622 0.513532 0.378783
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 3.360327 2.249384 -0.696267 -1.447878 0.275818 -1.158739 0.417742 -0.217037 0.452425 0.496385 0.363256
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, 9, 10, 15, 16, 18, 27, 28, 29, 32, 34, 36, 38, 40, 42, 47, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 63, 68, 71, 72, 77, 78, 79, 80, 81, 84, 86, 87, 92, 94, 96, 97, 101, 102, 103, 104, 107, 108, 109, 110, 111, 113, 117, 121, 122, 123, 128, 131, 135, 136, 142, 143, 144, 145, 151, 155, 156, 158, 159, 161, 165, 170, 173, 179, 180, 182, 185, 189, 191, 192, 193, 200, 201, 202, 205, 206, 207, 208, 209, 210, 221, 222, 224, 225, 226, 227, 228, 239, 242, 243, 244, 246, 261, 262, 320, 329]

unflagged_ants: [5, 8, 17, 19, 20, 21, 22, 30, 31, 35, 37, 41, 43, 44, 45, 46, 48, 53, 61, 62, 64, 65, 66, 67, 69, 70, 73, 74, 82, 83, 85, 88, 89, 90, 91, 93, 95, 105, 106, 112, 114, 115, 118, 120, 124, 125, 126, 127, 132, 133, 137, 139, 140, 141, 146, 147, 148, 149, 150, 157, 160, 162, 163, 164, 166, 167, 168, 169, 171, 181, 183, 184, 186, 187, 190, 211, 220, 223, 229, 237, 238, 240, 241, 245, 324, 325, 333]

golden_ants: [5, 17, 19, 20, 21, 30, 31, 37, 41, 44, 45, 53, 65, 66, 67, 69, 70, 83, 85, 88, 91, 93, 105, 106, 112, 118, 124, 127, 140, 141, 146, 147, 148, 149, 150, 157, 160, 162, 163, 164, 167, 168, 169, 171, 181, 183, 184, 186, 187, 190]
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_2459979.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.dev13+gd6c757c
3.2.1
In [ ]: