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 = "2459955"
data_path = "/mnt/sn1/2459955"
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: 1-10-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/2459955/zen.2459955.21278.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 1851 ant_metrics files matching glob /mnt/sn1/2459955/zen.2459955.?????.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/2459955/zen.2459955.?????.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 2459955
Date 1-10-2023
LST Range 1.865 -- 11.827 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
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
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 57 / 196 (29.1%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 120 / 196 (61.2%)
Redcal Done? ❌
Never Flagged Antennas 76 / 196 (38.8%)
A Priori Good Antennas Flagged 49 / 93 total a priori good antennas:
3, 5, 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, 140, 143,
146, 151, 158, 161, 165, 167, 168, 170, 173,
182, 185, 186, 187, 189, 191, 192, 193, 202
A Priori Bad Antennas Not Flagged 32 / 103 total a priori bad antennas:
22, 35, 43, 46, 48, 61, 62, 73, 82, 89, 90,
95, 115, 125, 126, 132, 137, 139, 205, 207,
211, 220, 221, 222, 226, 237, 238, 239, 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_2459955.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.039719 11.510990 9.103650 -1.040804 10.229760 5.555357 0.014518 9.352700 0.031526 0.345956 0.274952
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.372940 1.764939 6.667529 3.667292 1.479432 15.309970 9.891132 49.016561 0.505673 0.603601 0.420167
5 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.465947 -0.391984 0.941022 0.689486 35.344708 31.932621 10.999984 9.058605 0.584927 0.622560 0.406810
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.217783 -0.052071 -1.238535 -0.470312 -0.003412 0.891743 11.526190 9.765554 0.621901 0.640033 0.392070
8 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.203599 -1.391242 -0.686787 -0.120627 -0.389831 0.315281 4.779406 1.096677 0.622236 0.637021 0.388365
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 4.038367 -1.034193 7.575213 -0.602261 6.186494 -0.032466 -0.179757 -0.646589 0.443754 0.635608 0.465778
10 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.595615 -0.462495 -1.070330 -1.380863 -0.134170 1.229332 0.929123 8.124124 0.614307 0.635945 0.396569
15 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.384332 15.028968 9.036645 -0.492448 10.265844 5.138047 -0.298841 1.099131 0.030176 0.345672 0.265518
16 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 9.226785 -0.868898 9.069735 0.729755 10.235276 1.188092 0.034599 1.823058 0.029972 0.641003 0.517554
17 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.436310 1.110174 0.388476 0.189914 -0.281882 -0.003601 1.055089 2.040378 0.626658 0.644057 0.397498
18 N01 RF_maintenance 100.00% 100.00% 50.35% 0.00% 9.804703 15.944183 9.035978 -0.863810 10.372315 7.292024 -0.068083 14.778156 0.029396 0.226416 0.173756
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.102438 -0.859780 -1.206001 -0.915517 -0.600723 2.356761 0.772559 2.382918 0.629960 0.648957 0.388099
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.526324 -1.280756 2.286887 -1.152086 0.155709 1.353326 0.688930 -0.519339 0.621146 0.646798 0.394236
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.903702 0.076782 -0.679097 -0.004956 0.325031 2.195542 0.491190 0.482290 0.612598 0.626086 0.383241
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.795830 -0.388539 0.720363 0.598330 1.148018 0.667105 -0.293317 -1.034292 0.577540 0.597819 0.385133
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.634432 10.092306 9.096023 9.421371 10.373046 11.762812 1.368805 0.826439 0.033684 0.036650 0.004908
28 N01 RF_maintenance 100.00% 0.00% 85.09% 0.00% 10.497134 23.131869 -0.830044 0.657509 7.397615 7.384605 5.897491 15.623982 0.356160 0.156255 0.270438
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 9.285266 10.515317 8.700717 9.029296 10.330171 11.715569 -0.074717 -0.336592 0.029212 0.033183 0.004456
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.291582 -0.316398 -0.218071 0.399830 0.814336 -0.184982 2.121412 0.404274 0.634009 0.651885 0.388545
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.401915 -0.359907 1.144888 0.779449 1.369387 0.258326 0.854658 1.615361 0.642273 0.643749 0.382884
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.499159 16.391625 -0.252509 2.140246 -0.111469 6.183193 3.400363 67.570672 0.628794 0.558403 0.375724
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.600651 11.543280 3.718735 3.927535 10.305157 11.695305 0.506103 0.283154 0.031064 0.039795 0.006177
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.291787 0.045118 1.174125 -0.972974 -0.079658 -1.077833 1.769628 -0.067551 0.586841 0.582056 0.377497
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 22.996421 22.597211 12.207113 12.063949 10.411223 11.606120 2.896385 2.893801 0.029424 0.027414 0.001852
37 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.778660 0.312564 -1.318792 0.593140 0.522095 0.756915 -0.646334 2.711424 0.629639 0.638334 0.403567
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.089207 0.132433 -0.022868 0.406083 0.174087 0.663452 4.978395 0.524787 0.632244 0.647018 0.404140
40 N04 digital_ok 100.00% 100.00% 0.00% 0.00% 8.711703 0.113968 8.734088 0.294764 10.305544 -0.451796 0.203347 -0.065694 0.034462 0.641170 0.506858
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.397717 -0.180561 -0.024718 -0.172931 1.927138 -0.505894 0.138612 2.238583 0.632507 0.650456 0.383750
42 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.770875 10.949059 9.377246 9.926591 10.058329 11.464991 -0.113656 0.576511 0.026555 0.025845 0.001294
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.100939 0.042927 -0.290318 0.489023 -0.743860 0.271238 -0.293392 0.483476 0.630882 0.639562 0.380438
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.982896 -0.315468 -0.261047 -0.699294 -0.476409 0.176269 -1.068840 -0.674348 0.633072 0.649034 0.380037
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.078862 1.188166 0.043924 0.500846 -0.550609 1.258014 -0.112542 2.543700 0.625514 0.635352 0.374679
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.150554 0.208775 -0.990009 -0.802367 -0.448058 -0.215194 -0.654631 -0.990555 0.626462 0.651291 0.396181
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.017096 11.281635 3.551487 3.572017 10.257737 11.631008 0.599883 -0.064409 0.029288 0.043000 0.009803
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.084630 0.820708 0.688180 2.211133 -0.932879 2.214281 -0.254352 -1.914663 0.597174 0.622618 0.391852
49 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.204741 -0.129590 -1.200874 -0.050647 0.909274 -0.307048 0.513283 7.409215 0.541926 0.589297 0.386888
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.365576 15.413059 0.056662 1.069789 1.504626 5.467237 11.198587 43.131212 0.605885 0.558232 0.378295
51 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 20.291433 3.904850 11.697511 -0.554672 10.493679 5.107898 6.287527 1.471695 0.034909 0.528921 0.405473
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.089491 5.599887 -0.408933 0.345187 1.651074 0.403058 0.975656 1.745696 0.635979 0.647392 0.393340
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.703291 2.581733 0.079139 0.276996 1.504686 1.572862 2.120626 2.722942 0.642190 0.655359 0.397035
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 8.996231 10.625375 9.117166 9.649113 10.294009 11.674481 1.174657 0.442171 0.026473 0.025690 0.001225
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.453560 11.235551 9.122241 9.545834 10.344580 11.709821 0.701106 2.133681 0.027193 0.028992 0.001942
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% -0.488782 11.358631 0.336921 9.776659 -0.457817 11.560597 0.809714 0.150780 0.641414 0.034155 0.526144
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 20.244046 -0.747115 6.448659 0.424439 7.078222 0.400130 27.838011 1.317745 0.424036 0.660819 0.418806
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.694632 10.421183 9.009944 9.547116 10.248349 11.685123 1.102108 0.842793 0.030626 0.031070 0.001841
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.455410 0.618981 8.586891 1.658552 10.054156 1.386253 -0.047000 7.596724 0.040580 0.630709 0.510071
60 N05 RF_maintenance 100.00% 0.00% 99.89% 0.00% 0.559557 10.310047 -0.447815 9.573547 -0.276801 11.718485 1.539676 1.713934 0.625396 0.056412 0.516288
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 2.501265 0.138855 -0.924151 -1.445834 1.022772 -1.117413 -0.796977 -0.214276 0.567360 0.603273 0.377555
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.884510 0.828613 -1.424732 1.867751 -0.351876 0.645511 2.737108 -0.987412 0.558942 0.617364 0.393748
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.101736 10.720844 0.023911 3.950397 0.322734 11.792500 -0.453325 1.557486 0.587574 0.039977 0.471563
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% 0.348145 0.403703 -0.601391 -1.123475 -0.696900 -0.514554 4.941531 5.360631 0.568943 0.564475 0.367237
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.286105 0.904767 0.227803 0.930585 0.246305 0.263405 0.673345 -0.225908 0.613021 0.633191 0.408712
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 1.075568 1.466197 -1.174444 -1.357778 3.298795 -0.034982 -0.782477 -0.434575 0.629737 0.648818 0.403731
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.511358 -0.779557 -0.348231 1.175688 -0.176463 0.310316 -0.155939 1.430276 0.637818 0.648842 0.394858
68 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 18.381002 22.972983 1.106810 12.747214 5.905990 11.714894 -0.482967 6.874429 0.358725 0.027129 0.260459
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.401311 -0.805101 0.060851 0.650330 -0.457429 1.117752 -0.768839 -0.535358 0.637202 0.653285 0.379199
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.019821 -0.430778 -0.178937 0.004956 0.878294 1.307837 0.718672 0.227303 0.642147 0.659848 0.380229
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 7.069535 -0.106395 0.591129 0.670492 0.600417 -0.618180 -0.168962 -0.412631 0.656520 0.656907 0.373354
72 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 9.526345 11.417037 9.487561 9.945007 10.104385 11.504592 0.437243 0.663068 0.026473 0.025050 0.001498
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.715936 0.688431 -1.324051 -1.237661 0.761154 0.821482 -0.384646 -0.535427 0.643984 0.657111 0.377264
74 N05 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.003270 0.629553 0.072357 -0.669913 0.532352 1.281638 -0.470141 4.166643 0.642652 0.650248 0.372045
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 48.813965 0.690823 0.419111 0.084724 7.579577 -0.271713 27.847206 -1.025565 0.326782 0.608186 0.421777
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 31.138488 -0.266581 -0.396490 1.394547 2.557699 -0.021278 1.016707 0.868975 0.410091 0.619502 0.383110
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 1.438462 11.057715 -1.378684 3.981173 -0.898267 11.607184 2.833508 -0.728447 0.586031 0.037506 0.456611
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% -1.016748 11.785291 0.095059 3.884450 1.522279 11.637561 11.186579 0.636838 0.584864 0.041762 0.462719
81 N07 digital_ok 100.00% 0.00% 100.00% 0.00% -0.511353 11.170952 0.038541 8.242202 -0.522816 11.330371 -0.157858 0.686869 0.587710 0.034839 0.457913
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.055067 -0.285687 0.298084 1.862810 -0.567587 -1.067883 -0.524924 0.752121 0.607735 0.614305 0.386054
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.727773 -0.208215 0.096375 0.191138 0.573479 -0.914160 -0.744526 -0.025923 0.618759 0.639752 0.391724
84 N08 RF_maintenance 100.00% 78.39% 100.00% 0.00% 17.947030 20.262412 11.902482 12.305253 8.874054 11.637365 2.568735 2.995488 0.182902 0.031697 0.114336
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.389500 0.329154 0.593843 1.198021 -0.534502 -0.877159 -0.078421 -0.260729 0.639007 0.651196 0.383202
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.029194 -0.375853 0.956066 1.358414 3.375286 -0.714538 -0.145154 17.039237 0.627364 0.639866 0.362280
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.415706 6.292412 -0.714509 -0.470286 -0.245044 0.943707 0.447726 3.369137 0.655302 0.673335 0.372777
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.277670 0.380110 0.360009 0.448183 0.077631 -0.601982 1.863209 0.459088 0.643882 0.661577 0.368072
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.740743 0.224838 -0.149543 0.588708 -0.490510 -0.927184 -0.795757 -0.674633 0.650400 0.662207 0.370621
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.363578 -0.623733 0.861383 1.057227 -0.753383 -1.102140 0.065964 1.790234 0.641577 0.656186 0.373545
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.420896 -0.447024 0.282900 0.028214 -1.069677 -0.855526 0.526468 -0.058493 0.640129 0.663236 0.385866
92 N10 RF_maintenance 100.00% 0.00% 35.01% 0.00% 31.423350 37.094814 0.462023 1.053271 6.654954 6.047504 0.473302 7.094494 0.274194 0.231792 0.086532
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 2.039802 0.179232 1.251244 -1.245808 1.332413 0.140543 2.418387 0.309245 0.623067 0.649031 0.389529
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.038351 10.745884 9.214225 9.442232 10.202446 11.691202 0.985386 0.053085 0.028836 0.025301 0.001913
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.588677 -0.358794 -0.791263 1.162882 -0.857997 0.254528 0.245028 2.481207 0.598096 0.635189 0.399763
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.203301 11.427906 3.591705 4.085424 10.103240 11.503017 0.060584 0.250526 0.032543 0.035955 0.002039
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.828179 4.740116 -1.174068 0.771697 -0.920512 2.624975 6.087638 6.690008 0.578447 0.541537 0.381670
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.852909 7.807364 -0.522055 1.043412 0.227722 1.140514 0.661878 0.844179 0.641726 0.653254 0.384220
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.730596 1.294775 -1.389002 -0.927629 1.226412 0.448368 -0.042165 11.968106 0.647832 0.661565 0.382438
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.670061 4.766456 4.522193 -1.294556 0.206111 0.837885 9.224559 9.564898 0.614061 0.667064 0.386224
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.313452 53.280920 -1.194764 6.576558 0.637199 -0.399445 0.318328 1.139385 0.657387 0.634110 0.373764
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.604470 -0.457354 0.185315 0.571427 0.193496 -0.693954 -0.636700 -0.368393 0.651991 0.661252 0.364509
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.438024 1.214872 1.658549 -0.816607 0.369474 -0.299960 0.228300 0.590576 0.629361 0.665400 0.369224
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 4.042652 1.079977 -0.241903 -0.525967 0.603578 0.235202 4.471167 2.749019 0.651108 0.671823 0.371398
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.115581 34.958417 9.045923 0.562433 10.304799 5.667598 0.696126 3.561116 0.032405 0.278852 0.157576
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 8.823257 10.119379 8.562292 8.790674 10.361558 11.736145 -0.345237 0.731093 0.026720 0.026609 0.001304
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 22.342514 21.699279 12.280072 12.509164 10.267140 11.551430 2.793954 2.935881 0.022987 0.024497 0.000892
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.195658 10.358679 0.366071 9.420703 -0.563933 11.771291 2.045735 1.118048 0.631869 0.032178 0.449547
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.928538 -0.699030 0.146146 0.173400 0.583571 2.425366 0.359111 -0.810738 0.624940 0.640296 0.394788
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.840494 11.543945 3.374549 3.974984 10.155498 11.580572 0.683973 -0.003519 0.033062 0.030457 0.001585
114 N11 not_connected 100.00% 100.00% 100.00% 0.00% 24.393585 13.270076 22.250415 12.017696 65.473732 10.982374 1063.162998 133.891206 0.016686 0.022993 0.003695
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.973511 -0.736077 -0.706138 -0.228037 0.195853 -1.038561 -0.570867 0.767211 0.571702 0.601209 0.397213
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.876508 11.637955 9.181604 9.896558 10.140804 11.662056 0.285607 2.300671 0.027329 0.029624 0.001814
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.706823 0.924626 -0.374044 0.373439 -0.579768 -0.138302 -0.186080 0.535693 0.608270 0.637788 0.396148
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.083025 1.017451 2.421723 -1.071078 0.848952 0.984614 12.010597 6.121042 0.622176 0.658679 0.380980
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.184911 3.073250 -1.306510 5.297321 0.680492 -0.636060 7.963838 12.805413 0.651290 0.638533 0.368726
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.318872 6.046734 0.064048 0.773939 1.554219 1.493460 0.207294 -0.732178 0.656591 0.667836 0.374079
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.248105 8.213747 0.661200 0.734907 0.082778 -0.175971 -0.712498 -0.565126 0.661941 0.675218 0.377567
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.755403 0.009959 -0.161343 0.469166 -0.627422 -0.145500 0.268948 -0.135971 0.661908 0.669986 0.372919
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.875688 -0.544302 -0.502967 0.474678 -0.282200 -0.807362 -0.025487 -0.526156 0.654163 0.668180 0.373547
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.304481 0.300144 -1.402151 0.741710 2.049494 -0.337687 2.022508 -0.656072 0.657893 0.664684 0.377893
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.030015 -0.099811 0.542942 0.332819 1.188150 1.037788 -0.164062 0.034460 0.642401 0.662538 0.386512
128 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 8.575312 10.003590 9.174502 9.550895 10.246969 11.599996 -0.313281 0.009878 0.027813 0.026672 0.000934
131 N11 not_connected 100.00% 0.00% 4.27% 0.00% -0.697161 10.264068 0.132792 3.805751 -0.282874 10.189844 -0.738175 -0.348572 0.615721 0.299643 0.435252
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.120720 1.856765 -0.786595 -1.283301 -0.817176 -0.717716 2.135448 -0.016579 0.586916 0.600988 0.379540
133 N11 not_connected 100.00% 100.00% 0.00% 0.00% 10.476828 -0.206508 3.342605 -1.385472 10.251605 -0.592027 0.705400 -0.917625 0.063842 0.598729 0.474159
135 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.777663 -0.878132 -0.244831 -1.330639 4.494743 0.843936 12.862677 0.324170 0.589699 0.622539 0.411764
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 8.352816 0.301880 8.676964 -0.288521 10.368477 3.102800 0.790987 -0.448466 0.035757 0.616349 0.459305
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.439062 -0.660551 0.239790 -1.294491 1.745943 -0.260764 0.432734 -0.303437 0.589725 0.632337 0.403729
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.192703 -0.525171 1.751493 -0.574580 0.880381 -0.784459 -1.141217 -0.265249 0.626133 0.633050 0.379003
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.103876 -0.200994 -1.090136 0.132917 -0.345131 -0.364476 5.187499 3.854336 0.641231 0.666776 0.381543
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.423231 -0.726812 -0.233036 0.981657 2.139244 -0.963441 0.000702 -0.922573 0.644063 0.670453 0.377728
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.158482 10.273632 -0.499272 9.574688 4.558312 11.741262 37.559649 0.694930 0.648953 0.041034 0.524501
143 N14 digital_ok 100.00% 0.00% 100.00% 0.00% -0.962371 10.727577 0.881252 9.658341 1.786188 11.485924 0.140587 1.453080 0.650250 0.036260 0.532570
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.344948 -0.009959 -1.124845 0.172575 0.265855 0.178560 -0.860979 -0.906391 0.661288 0.671166 0.373203
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.119585 0.600595 -1.055504 3.598633 0.172138 7.079006 -0.351683 -0.067254 0.659282 0.645311 0.379747
146 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 10.302228 -1.032649 3.352303 0.021880 10.286920 -0.762126 -0.531407 -1.047552 0.036868 0.655004 0.512405
147 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.945650 -1.542159 0.998749 2.018237 -0.681877 -1.013616 -0.370193 0.860968 0.627114 0.639800 0.376431
148 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.333011 -0.022935 -0.520455 -0.618543 2.303426 1.184691 -0.433337 -0.614288 0.631884 0.651567 0.388060
149 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.323833 -1.146334 -1.189806 -1.189078 -0.415239 1.527692 2.104358 2.649505 0.625345 0.645853 0.392170
150 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.155351 -0.719038 -0.931491 -1.075229 -1.054686 0.338472 -0.409125 -0.000702 0.618097 0.634653 0.392258
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 24.550293 1.008852 0.084729 0.241998 4.745241 -0.133637 2.397473 -0.321736 0.479131 0.578607 0.347578
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 8.709737 -0.714106 8.827543 -1.474270 10.408871 0.328564 1.134721 3.733960 0.037439 0.620025 0.478291
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 5.585351 10.170653 8.216983 9.316825 7.635672 11.757112 0.453076 0.957082 0.327885 0.035513 0.244267
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.088150 -0.404584 -0.118565 0.585257 0.031133 -0.028034 -0.493143 -0.085925 0.605771 0.629897 0.399212
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.897479 0.178154 -0.090731 -0.413897 1.932309 1.789959 1.793291 17.057836 0.620268 0.646183 0.401217
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.202633 16.777396 -1.233386 -0.915380 -0.046882 6.562984 -0.675327 59.248589 0.590991 0.555873 0.360036
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.583673 -1.156872 -0.369726 -0.669885 -0.742092 1.276148 1.024675 0.590997 0.635902 0.655261 0.385328
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.048391 24.401918 -0.119272 -0.634128 0.116363 2.039240 -0.243188 1.357723 0.640705 0.517726 0.339664
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.230525 -1.012047 -0.778365 -1.078083 2.123737 1.376296 2.723915 0.617022 0.655928 0.671599 0.380340
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.329910 0.986941 -0.277330 0.309466 -0.275893 1.257883 -0.419977 0.771523 0.657586 0.668342 0.382374
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.112209 0.353750 0.477383 -0.098251 2.736243 2.355036 1.262856 1.272711 0.651476 0.669439 0.375579
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 30.331661 -0.108874 -0.438630 -1.137844 4.974203 0.288368 2.352329 -0.141556 0.512348 0.668990 0.373772
166 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.091999 1.468899 -0.992460 0.452918 0.220271 1.434413 7.528447 9.261913 0.655757 0.665188 0.381739
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.745868 -1.224879 -1.322545 -0.270263 1.630292 -0.177496 0.671306 4.969690 0.633987 0.647287 0.380230
168 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.898747 -1.557197 0.246381 -0.429323 1.613571 10.813665 -0.588537 3.053426 0.626301 0.633744 0.388921
169 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.620912 -1.049575 -0.894849 -1.254636 0.332187 1.425349 -0.724034 0.866531 0.629350 0.646757 0.388372
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 9.804045 -0.875924 9.378266 -1.446661 10.168292 -0.023032 1.536495 0.854504 0.035212 0.643139 0.501906
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.622371 2.486402 -1.172179 -0.262867 -0.722068 2.273960 -0.575440 0.885246 0.580273 0.564846 0.366911
173 N16 digital_ok 100.00% 100.00% 100.00% 0.00% 11.019502 11.290560 3.087226 3.590831 10.439181 11.788211 2.012361 3.667401 0.037836 0.040528 0.002953
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.135793 -0.619156 -0.314421 0.972175 -0.754737 1.925907 -0.023253 29.380073 0.614443 0.633503 0.391460
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.560490 11.000531 -1.430588 9.716923 1.515950 11.635284 18.079048 1.320033 0.636438 0.046702 0.528626
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.252125 -0.553788 -0.060378 0.128431 -0.074004 -0.296638 -0.461246 2.639359 0.642629 0.654939 0.388014
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.197290 10.105610 -1.377569 9.283504 -0.482715 11.772516 13.700017 0.925233 0.651590 0.042048 0.500861
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.161938 0.417491 -0.267632 0.487480 1.445109 -0.172103 1.829834 1.467518 0.642465 0.656671 0.374795
184 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.117826 -0.783781 -0.825500 -0.557116 0.224759 0.571219 1.095843 0.545632 0.651224 0.668805 0.373926
185 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 33.754083 -0.231330 -0.339668 -1.453604 9.481746 0.332968 6.153815 0.571552 0.519776 0.666195 0.377069
186 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.832034 -1.209139 -1.466486 -0.284367 1.762338 0.385304 0.700725 4.837391 0.658306 0.676821 0.391403
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.362691 1.511517 -1.300109 2.115407 0.440394 0.297346 1.964671 15.697530 0.653357 0.670741 0.383650
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 8.198834 9.086060 8.649028 9.109946 10.469334 10.592517 3.924507 16.018704 0.026963 0.027730 0.000628
190 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -1.289335 -1.146985 -0.758440 0.769470 -0.206280 0.115016 -0.599531 -1.330067 0.629247 0.654537 0.400231
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.580424 0.285349 1.173393 -0.469587 0.323133 0.581765 9.773954 0.919511 0.613559 0.637995 0.396478
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.731408 6.395994 5.222769 5.211145 7.678460 8.994230 -3.336291 -3.320647 0.583745 0.603707 0.389850
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 6.266977 0.057527 5.308997 1.617121 7.907814 2.234817 -3.305446 0.828864 0.570785 0.613857 0.415697
200 N18 RF_maintenance 100.00% 100.00% 61.32% 0.00% 10.673600 32.051675 3.489003 0.965402 10.410546 7.464107 0.525632 0.221055 0.039220 0.212561 0.144913
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.062933 4.689056 3.246919 4.610338 0.827178 7.374955 0.605624 -2.060091 0.627932 0.628876 0.385368
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.414715 1.683107 1.923239 -1.284733 0.666974 0.212827 -0.303267 20.505807 0.636406 0.620465 0.381825
205 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.031105 2.226247 0.803534 -1.058136 -0.799592 -0.434755 -1.058630 3.367237 0.627919 0.615238 0.375246
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.504543 1.108805 2.737283 -0.501000 7.303838 -0.313015 -0.775132 4.998274 0.633045 0.629976 0.377237
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.414100 3.343699 1.589265 -0.399314 0.707028 0.043633 -0.494528 -0.675818 0.613513 0.612225 0.354928
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 7.022341 11.476756 8.425657 10.572957 10.513330 9.777554 13.248209 75.963531 0.033077 0.033119 0.001309
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.269519 7.442913 8.314151 8.456329 8.997422 12.363957 13.181068 11.950803 0.040136 0.038432 0.001618
210 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 11.603955 10.590468 -0.994843 -1.012517 -0.856628 -0.196005 -0.842455 2.453609 0.628658 0.641810 0.390643
211 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.903181 -0.889323 -0.928106 0.332222 -0.557746 -0.779459 3.293322 0.925714 0.577727 0.614517 0.391010
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.887447 -0.786374 0.661958 -0.046370 -0.442048 1.034054 2.771184 -1.240592 0.618756 0.629449 0.383205
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.716777 -0.183858 -1.008882 -0.315919 0.094498 -0.802154 2.798174 -0.792722 0.601957 0.634189 0.388818
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.729724 0.568719 -0.116095 -1.430678 -0.217554 -0.778199 1.557710 -0.935586 0.611978 0.623399 0.379785
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.660929 0.887828 -1.104352 -1.082872 0.076207 -0.896850 0.477742 11.171624 0.604680 0.629378 0.380289
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.467689 6.156983 5.507262 5.278033 8.152126 9.232410 -3.412369 -3.268480 0.603043 0.624547 0.381701
225 N19 RF_ok 100.00% 0.00% 87.95% 0.00% 1.056293 10.563032 0.989013 3.762639 -0.777628 11.499238 -0.948986 0.591716 0.627031 0.134216 0.525539
226 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.012767 0.881651 0.327954 1.765692 -1.136261 1.963510 -0.445085 -0.289134 0.619333 0.644956 0.394235
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.826477 0.381839 -1.346925 0.418401 0.381215 -0.502414 11.315512 -0.346044 0.582195 0.626770 0.385366
228 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.249301 14.381617 -0.946316 0.118366 3.368683 5.030196 57.288657 79.160478 0.530883 0.538751 0.333954
229 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.262763 -0.052004 1.505773 1.703104 -0.296789 1.274367 7.370134 -1.374944 0.603342 0.624190 0.395853
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.353608 0.149796 -0.234564 -1.251478 0.005036 -0.818513 -0.587479 -0.948473 0.546981 0.607939 0.405042
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.245510 -0.414696 1.601190 1.070933 0.003601 -0.096103 -1.477849 -1.735028 0.615166 0.630219 0.395453
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.854575 -1.060098 0.645433 0.888421 -0.426722 -0.356766 0.850785 2.401680 0.612957 0.633130 0.392840
240 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 31.337054 48.520155 -0.276389 0.968673 3.264424 5.968355 24.874897 32.305402 0.457913 0.394715 0.229158
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.657959 3.536675 -0.627289 0.223664 -0.626354 0.774633 6.334552 16.992773 0.601040 0.581976 0.385345
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 37.762825 1.512347 0.390425 2.064886 12.281137 1.651042 39.148746 -0.605561 0.410776 0.636619 0.437082
243 N19 RF_ok 100.00% 22.04% 0.00% 0.00% 54.799857 2.155971 1.031593 -1.204635 6.912785 -0.740191 -1.505164 0.208704 0.262235 0.610340 0.488662
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.641320 1.845974 1.130396 -1.048528 4.098113 1.659994 2.590340 6.792205 0.478199 0.587716 0.390440
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.385669 2.194323 0.402208 -0.622754 -0.694155 -0.601966 -0.915537 0.274547 0.594251 0.601749 0.385079
246 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.960057 7.299335 -0.949181 -0.093896 5.909758 5.939973 3.473226 0.121575 0.311901 0.321938 0.158942
261 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.034522 1.189690 0.824607 -0.194384 -0.391755 -0.674964 -0.215608 14.041290 0.593291 0.602159 0.388301
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.928828 7.512805 8.215541 8.852819 10.095980 10.301727 9.389364 21.477483 0.030155 0.026565 0.003137
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 5.661607 10.860801 2.303576 6.011244 1.142018 11.776998 17.658389 1.764024 0.439326 0.042021 0.352684
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.774379 1.983848 1.374504 1.873696 0.373263 1.401701 1.042877 0.113693 0.496054 0.518793 0.378653
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.177344 -0.742348 1.487514 -0.920315 0.954166 -0.522214 -1.092768 0.032815 0.525844 0.529927 0.388307
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 4.562541 -0.792560 0.992376 -0.648204 3.017770 -0.903407 2.277852 0.294474 0.409449 0.527185 0.387311
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.987980 2.684700 -0.718804 -1.279343 -0.046761 -0.624387 0.587553 0.580433 0.455155 0.500697 0.370579
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, 5, 7, 8, 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, 64, 68, 71, 72, 74, 77, 78, 79, 80, 81, 84, 86, 87, 92, 94, 96, 97, 101, 102, 103, 104, 107, 108, 109, 110, 111, 113, 114, 117, 120, 121, 122, 123, 128, 131, 133, 135, 136, 140, 142, 143, 145, 146, 151, 155, 156, 158, 159, 161, 165, 166, 167, 168, 170, 173, 179, 180, 182, 185, 186, 187, 189, 191, 192, 193, 200, 201, 202, 206, 208, 209, 210, 223, 224, 225, 227, 228, 229, 240, 241, 242, 243, 244, 246, 261, 262, 320, 329]

unflagged_ants: [17, 19, 20, 21, 22, 30, 31, 35, 37, 41, 43, 44, 45, 46, 48, 53, 61, 62, 65, 66, 67, 69, 70, 73, 82, 83, 85, 88, 89, 90, 91, 93, 95, 105, 106, 112, 115, 118, 124, 125, 126, 127, 132, 137, 139, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 164, 169, 171, 181, 183, 184, 190, 205, 207, 211, 220, 221, 222, 226, 237, 238, 239, 245, 324, 325, 333]

golden_ants: [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, 141, 144, 147, 148, 149, 150, 157, 160, 162, 163, 164, 169, 171, 181, 183, 184, 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_2459955.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
In [ ]: