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 = "2460060"
data_path = "/mnt/sn1/2460060"
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: 4-25-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/2460060/zen.2460060.42112.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 361 ant_metrics files matching glob /mnt/sn1/2460060/zen.2460060.?????.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/2460060/zen.2460060.?????.sum.known_good.omni.calfits. Skipping redcal chisq.

Figure out some general properties¶

In [9]:
# Parse some general array properties, taking into account the fact that we might be missing some of the metrics
ants = []
pols = []
antpol_pairs = []

if use_auto_metrics:
    ants = sorted(set(bl[0] for bl in auto_metrics['modzs']['r2_shape_modzs']))
    pols = sorted(set(bl[2] for bl in auto_metrics['modzs']['r2_shape_modzs']))
if use_ant_metrics:
    antpol_pairs = sorted(set([antpol for dms in ant_metrics_dead_metrics.values() for antpol in dms.keys()]))
    antpols = sorted(set(antpol[1] for antpol in antpol_pairs))
    ants = sorted(set(antpol[0] for antpol in antpol_pairs) | set(ants))
    pols = sorted(set(utils.join_pol(ap, ap) for ap in antpols) | set(pols))
if use_redcal:
    antpol_pairs = sorted(set([ant for cspa in cspa_med_dict.values() for ant in cspa.keys()]) | set(antpol_pairs))
    antpols = sorted(set(antpol[1] for antpol in antpol_pairs))
    ants = sorted(set(antpol[0] for antpol in antpol_pairs) | set(ants))
    pols = sorted(set(utils.join_pol(ap, ap) for ap in antpols) | set(pols))

# Figure out remaining antennas not in data and also LST range
data_files = sorted(glob.glob(os.path.join(data_path, 'zen.*.sum.uvh5')))
hd = io.HERAData(data_files[0])
unused_ants = [ant for ant in hd.antpos if ant not in ants]    
hd_last = io.HERAData(data_files[-1])

Load a priori antenna statuses and node numbers¶

In [10]:
# try to load a priori antenna statusesm but fail gracefully if this doesn't work.
a_priori_statuses = {ant: 'Not Found' for ant in ants}
nodes = {ant: np.nan for ant in ants + unused_ants}
try:
    from hera_mc import cm_hookup

    # get node numbers
    hookup = cm_hookup.get_hookup('default')
    for ant_name in hookup:
        ant = int("".join(filter(str.isdigit, ant_name)))
        if ant in nodes:
            if hookup[ant_name].get_part_from_type('node')['E<ground'] is not None:
                nodes[ant] = int(hookup[ant_name].get_part_from_type('node')['E<ground'][1:])
    
    # get apriori antenna status
    for ant_name, data in hookup.items():
        ant = int("".join(filter(str.isdigit, ant_name)))
        if ant in a_priori_statuses:
            a_priori_statuses[ant] = data.apriori

except Exception as err:
    print(f'Could not load node numbers and a priori antenna statuses.\nEncountered {type(err)} with message: {err}')

Summarize auto metrics¶

In [11]:
if use_auto_metrics:
    # Parse modzs
    modzs_to_check = {'Shape': 'r2_shape_modzs', 'Power': 'r2_power_modzs', 
                      'Temporal Variability': 'r2_temp_var_modzs', 'Temporal Discontinuties': 'r2_temp_diff_modzs'}
    worst_metrics = []
    worst_zs = []
    all_modzs = {}
    binary_flags = {rationale: [] for rationale in modzs_to_check}

    for ant in ants:
        # parse modzs and figure out flag counts
        modzs = {f'{pol} {rationale}': auto_metrics['modzs'][dict_name][(ant, ant, pol)] 
                 for rationale, dict_name in modzs_to_check.items() for pol in pols}
        for pol in pols:
            for rationale, dict_name in modzs_to_check.items():
                binary_flags[rationale].append(auto_metrics['modzs'][dict_name][(ant, ant, pol)] > mean_round_modz_cut)

        # parse out all metrics for dataframe
        for k in modzs:
            col_label = k + ' Modified Z-Score'
            if col_label in all_modzs:
                all_modzs[col_label].append(modzs[k])
            else:
                all_modzs[col_label] = [modzs[k]]
                
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
else:
    mean_round_modz_cut = 0

Summarize ant metrics¶

In [12]:
if use_ant_metrics:
    a_priori_flag_frac = {ant: np.mean([ant in apxa for apxa in ant_metrics_apriori_exants.values()]) for ant in ants}
    dead_ant_frac = {ap: {ant: np.mean([(ant, ap) in das for das in ant_metrics_dead_ants_dict.values()])
                                 for ant in ants} for ap in antpols}
    crossed_ant_frac = {ant: np.mean([np.any([(ant, ap) in cas for ap in antpols])
                                      for cas in ant_metrics_crossed_ants_dict.values()]) for ant in ants}
    ant_metrics_xants_frac_by_antpol = {antpol: np.mean([antpol in amx for amx in ant_metrics_xants_dict.values()]) for antpol in antpol_pairs}
    ant_metrics_xants_frac_by_ant = {ant: np.mean([np.any([(ant, ap) in amx for ap in antpols])
                                     for amx in ant_metrics_xants_dict.values()]) for ant in ants}
    average_dead_metrics = {ap: {ant: np.nanmean([dm.get((ant, ap), np.nan) for dm in ant_metrics_dead_metrics.values()]) 
                                 for ant in ants} for ap in antpols}
    average_crossed_metrics = {ant: np.nanmean([cm.get((ant, ap), np.nan) for ap in antpols 
                                                for cm in ant_metrics_crossed_metrics.values()]) for ant in ants}
else:
    dead_cut = 0.4
    crossed_cut = 0.0

Summarize redcal chi^2 metrics¶

In [13]:
if use_redcal:
    cspa = {ant: np.nanmedian(np.hstack([cspa_med_dict[cal][ant] for cal in redcal_files])) for ant in antpol_pairs}
    redcal_prior_flag_frac = {ant: np.mean([np.any([afd[ant, ap] and not ant in flagged_by_redcal_dict[cal] for ap in antpols])
                                            for cal, afd in post_redcal_ant_flags_dict.items()]) for ant in ants}
    redcal_flagged_frac = {ant: np.mean([ant in fbr for fbr in flagged_by_redcal_dict.values()]) for ant in ants}

Get FEM switch states¶

In [14]:
HHautos = sorted(glob.glob(f"{data_path}/zen.{JD}.*.sum.autos.uvh5"))
diffautos = sorted(glob.glob(f"{data_path}/zen.{JD}.*.diff.autos.uvh5"))

try:
    db = mc.connect_to_mc_db(None)
    session = db.sessionmaker()
    startJD = float(HHautos[0].split('zen.')[1].split('.sum')[0])
    stopJD = float(HHautos[-1].split('zen.')[1].split('.sum')[0])
    start_time = Time(startJD,format='jd')
    stop_time = Time(stopJD,format='jd')

    # get initial state by looking for commands up to 3 hours before the starttime
    # this logic can be improved after an upcoming hera_mc PR
    # which will return the most recent command before a particular time.
    search_start_time = start_time - TimeDelta(3*3600, format="sec")
    initial_command_res = session.get_array_signal_source(starttime=search_start_time, stoptime=start_time)
    if len(initial_command_res) == 0:
        initial_source = "Unknown"
    elif len(command_res) == 1:
        initial_source = initial_command_res[0].source
    else:
        # multiple commands
        times = []
        sources = []
        for obj in command_res:
            times.append(obj.time)
            sources.append(obj.source)
        initial_source = sources[np.argmax(times)]
    
    # check for any changes during observing
    command_res = session.get_array_signal_source(starttime=start_time, stoptime=stop_time)
    if len(command_res) == 0:
        # still nothing, set it to None
        obs_source = None
    else:
        obs_source_times = []
        obs_source = []
        for obj in command_res:
            obs_source_times.append(obj.time)
            obs_source.append(obj.source)

    if obs_source is not None:
        command_source = [initial_source] + obs_source
    else:
        command_source = initial_source
    
    res = session.get_antenna_status(starttime=startTime, stoptime=stopTime)
    fem_switches = {}
    right_rep_ant = []
    if len(res) > 0:
        for obj in res:
            if obj.antenna_number not in fem_switches.keys():
                fem_switches[obj.antenna_number] = {}
            fem_switches[obj.antenna_number][obj.antenna_feed_pol] = obj.fem_switch
        for ant, pol_dict in fem_switches.items():
            if pol_dict['e'] == initial_source and pol_dict['n'] == initial_source:
                right_rep_ant.append(ant)
except Exception as e:
    print(e)
    initial_source = None
    command_source = None
    right_rep_ant = []
name 'startTime' is not defined

Find X-engine Failures¶

In [15]:
read_inds = [1, len(HHautos)//2, -2]
x_status = [1,1,1,1,1,1,1,1]
s = UVData()
s.read(HHautos[1])

nants = len(s.get_ants())
freqs = s.freq_array[0]*1e-6
nfreqs = len(freqs)

antCon = {a: None for a in ants}
rightAnts = []
for i in read_inds:
    s = UVData()
    d = UVData()
    s.read(HHautos[i])
    d.read(diffautos[i])
    for pol in [0,1]:
        sm = np.abs(s.data_array[:,0,:,pol])
        df = np.abs(d.data_array[:,0,:,pol])
        sm = np.r_[sm, np.nan + np.zeros((-len(sm) % nants,len(freqs)))]
        sm = np.nanmean(sm.reshape(-1,nants,nfreqs),axis=1)
        df = np.r_[df, np.nan + np.zeros((-len(df) % nants,len(freqs)))]
        df = np.nanmean(df.reshape(-1,nants,nfreqs),axis=1)

        evens = (sm + df)/2
        odds = (sm - df)/2
        rat = np.divide(evens,odds)
        rat = np.nan_to_num(rat)
        for xbox in range(0,8):
            xavg = np.nanmean(rat[:,xbox*192:(xbox+1)*192],axis=1)
            if np.nanmax(xavg)>1.5 or np.nanmin(xavg)<0.5:
                x_status[xbox] = 0
    for ant in ants:
        for pol in ["xx", "yy"]:
            if antCon[ant] is False:
                continue
            spectrum = s.get_data(ant, ant, pol)
            stdev = np.std(spectrum)
            med = np.median(np.abs(spectrum))
            if (initial_source == 'digital_noise_same' or initial_source == 'digital_noise_different') and med < 10:
                antCon[ant] = True
            elif (initial_source == "load" or initial_source == 'noise') and 80000 < stdev <= 4000000 and antCon[ant] is not False:
                antCon[ant] = True
            elif initial_source == "antenna" and stdev > 500000 and med > 950000 and antCon[ant] is not False:
                antCon[ant] = True
            else:
                antCon[ant] = False
            if np.min(np.abs(spectrum)) < 100000:
                antCon[ant] = False
for ant in ants:
    if antCon[ant] is True:
        rightAnts.append(ant)
            
x_status_str = ''
for i,x in enumerate(x_status):
    if x==0:
        x_status_str += '\u274C '
    else:
        x_status_str += '\u2705 '

Build Overall Health DataFrame¶

In [16]:
def comma_sep_paragraph(vals, chars_per_line=40):
    outstrs = []
    for val in vals:
        if (len(outstrs) == 0) or (len(outstrs[-1]) > chars_per_line):
            outstrs.append(str(val))
        else:
            outstrs[-1] += ', ' + str(val)
    return ',<br>'.join(outstrs)
In [17]:
# Time data
to_show = {'JD': [JD]}
to_show['Date'] = f'{utc.month}-{utc.day}-{utc.year}'
to_show['LST Range'] = f'{hd.lsts[0] * 12 / np.pi:.3f} -- {hd_last.lsts[-1] * 12 / np.pi:.3f} hours'

# X-engine status
to_show['X-Engine Status'] = x_status_str

# Files
to_show['Number of Files'] = len(data_files)

# Antenna Calculations
to_show['Total Number of Antennas'] = len(ants)

to_show[' '] = ''
to_show['OPERATIONAL STATUS SUMMARY'] = ''

status_count = {status: 0 for status in status_colors}
for ant, status in a_priori_statuses.items():
    if status in status_count:
        status_count[status] = status_count[status] + 1
    else:
        status_count[status] = 1
to_show['Antenna A Priori Status Count'] = '<br>'.join([f'{status}: {status_count[status]}' for status in status_colors if status in status_count and status_count[status] > 0])

to_show['Commanded Signal Source'] = ', '.join(command_source if hasattr(command_source, '__iter__') else [str(command_source)])
to_show['Antennas in Commanded State (reported)'] = f'{len(right_rep_ant)} / {len(ants)} ({len(right_rep_ant) / len(ants):.1%})'
to_show['Antennas in Commanded State (observed)'] = f'{len(rightAnts)} / {len(ants)} ({len(rightAnts) / len(ants):.1%})'

if use_ant_metrics:
    to_show['Cross-Polarized Antennas'] = ', '.join([str(ant) for ant in ants if (np.max([dead_ant_frac[ap][ant] for ap in antpols]) + crossed_ant_frac[ant] == 1) 
                                                                                 and (crossed_ant_frac[ant] > .5)])

# Node calculations
nodes_used = set([nodes[ant] for ant in ants if np.isfinite(nodes[ant])])
to_show['Total Number of Nodes'] = len(nodes_used)
if use_ant_metrics:
    node_off = {node: True for node in nodes_used}
    not_correlating = {node: True for node in nodes_used}
    for ant in ants:
        for ap in antpols:
            if np.isfinite(nodes[ant]):
                if np.isfinite(average_dead_metrics[ap][ant]):
                    node_off[nodes[ant]] = False
                if dead_ant_frac[ap][ant] < 1:
                    not_correlating[nodes[ant]] = False
    to_show['Nodes Registering 0s'] = ', '.join([f'N{n:02}' for n in sorted([node for node in node_off if node_off[node]])])
    to_show['Nodes Not Correlating'] = ', '.join([f'N{n:02}' for n in sorted([node for node in not_correlating if not_correlating[node] and not node_off[node]])])

# Pipeline calculations    
to_show['  '] = ''
to_show['NIGHTLY ANALYSIS SUMMARY'] = ''
    
all_flagged_ants = []
if use_ant_metrics:
    to_show['Ant Metrics Done?'] = '\u2705'
    ant_metrics_flagged_ants = [ant for ant in ants if ant_metrics_xants_frac_by_ant[ant] > 0]
    all_flagged_ants.extend(ant_metrics_flagged_ants)
    to_show['Ant Metrics Flagged Antennas'] = f'{len(ant_metrics_flagged_ants)} / {len(ants)} ({len(ant_metrics_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Ant Metrics Done?'] = '\u274C'
if use_auto_metrics:
    to_show['Auto Metrics Done?'] = '\u2705'
    auto_metrics_flagged_ants = [ant for ant in ants if ant in auto_ex_ants]
    all_flagged_ants.extend(auto_metrics_flagged_ants)    
    to_show['Auto Metrics Flagged Antennas'] = f'{len(auto_metrics_flagged_ants)} / {len(ants)} ({len(auto_metrics_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Auto Metrics Done?'] = '\u274C'
if use_redcal:
    to_show['Redcal Done?'] = '\u2705'    
    redcal_flagged_ants = [ant for ant in ants if redcal_flagged_frac[ant] > 0]
    all_flagged_ants.extend(redcal_flagged_ants)    
    to_show['Redcal Flagged Antennas'] = f'{len(redcal_flagged_ants)} / {len(ants)} ({len(redcal_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Redcal Done?'] = '\u274C' 
to_show['Never Flagged Antennas'] = f'{len(ants) - len(set(all_flagged_ants))} / {len(ants)} ({(len(ants) - len(set(all_flagged_ants))) / len(ants):.1%})'

# Count bad antennas with good statuses and vice versa
n_apriori_good = len([ant for ant in ants if a_priori_statuses[ant] in good_statuses.split(',')])
apriori_good_flagged = []
aprior_bad_unflagged = []
for ant in ants:
    if ant in set(all_flagged_ants) and a_priori_statuses[ant] in good_statuses.split(','):
        apriori_good_flagged.append(ant)
    elif ant not in set(all_flagged_ants) and a_priori_statuses[ant] not in good_statuses.split(','):
        aprior_bad_unflagged.append(ant)
to_show['A Priori Good Antennas Flagged'] = f'{len(apriori_good_flagged)} / {n_apriori_good} total a priori good antennas:<br>' + \
                                            comma_sep_paragraph(apriori_good_flagged)
to_show['A Priori Bad Antennas Not Flagged'] = f'{len(aprior_bad_unflagged)} / {len(ants) - n_apriori_good} total a priori bad antennas:<br>' + \
                                            comma_sep_paragraph(aprior_bad_unflagged)

# Apply Styling
df = pd.DataFrame(to_show)
divider_cols = [df.columns.get_loc(col) for col in ['NIGHTLY ANALYSIS SUMMARY', 'OPERATIONAL STATUS SUMMARY']]
try:
    to_red_columns = [df.columns.get_loc(col) for col in ['Cross-Polarized Antennas', 'Nodes Registering 0s', 
                                                          'Nodes Not Correlating', 'A Priori Good Antennas Flagged']]
except:
    to_red_columns = []
def red_specific_cells(x):
    df1 = pd.DataFrame('', index=x.index, columns=x.columns)
    for col in to_red_columns:
        df1.iloc[col] = 'color: red'
    return df1

df = df.T
table = df.style.hide_columns().apply(red_specific_cells, axis=None)
for col in divider_cols:
    table = table.set_table_styles([{"selector":f"tr:nth-child({col+1})", "props": [("background-color", "black"), ("color", "white")]}], overwrite=False)

Table 1: Overall Array Health¶

In [18]:
HTML(table.render())
Out[18]:
JD 2460060
Date 4-25-2023
LST Range 13.778 -- 15.719 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 361
Total Number of Antennas 198
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 10
dish_ok: 1
RF_maintenance: 50
RF_ok: 19
digital_ok: 93
not_connected: 25
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 198 (0.0%)
Antennas in Commanded State (observed) 0 / 198 (0.0%)
Cross-Polarized Antennas 40, 42, 70, 112
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 62 / 198 (31.3%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 98 / 198 (49.5%)
Redcal Done? ❌
Never Flagged Antennas 98 / 198 (49.5%)
A Priori Good Antennas Flagged 49 / 93 total a priori good antennas:
7, 15, 17, 19, 20, 31, 37, 38, 40, 42, 53,
55, 65, 66, 70, 72, 81, 83, 86, 93, 94, 103,
109, 111, 112, 118, 121, 124, 127, 136, 147,
148, 149, 150, 151, 158, 160, 161, 165, 167,
168, 169, 170, 182, 184, 189, 190, 191, 202
A Priori Bad Antennas Not Flagged 54 / 105 total a priori bad antennas:
8, 22, 35, 36, 43, 46, 48, 49, 50, 52, 57,
62, 64, 73, 74, 79, 80, 89, 90, 95, 102, 113,
114, 115, 120, 125, 126, 132, 133, 135, 139,
179, 185, 201, 206, 207, 220, 221, 222, 224,
228, 229, 237, 238, 239, 240, 241, 244, 245,
261, 320, 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_2460060.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
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.048621 11.200433 -1.077138 -0.602659 -1.040491 0.021230 -0.750046 -0.132571 0.523822 0.405854 0.340179
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.084064 0.212926 0.343590 2.956630 0.734147 2.127904 -0.325021 0.470398 0.531610 0.513782 0.345499
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.724910 -0.168834 -0.446745 0.126925 -0.214130 -0.090015 1.612001 7.698682 0.541528 0.529629 0.341415
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.448327 1.530982 1.076550 1.084044 0.213938 0.206651 -1.609819 -1.476612 0.510997 0.503179 0.320798
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.664413 -0.564535 2.926630 -0.412357 0.273710 0.070901 1.750859 -0.365704 0.512987 0.526395 0.330309
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.818781 -0.605844 -0.541062 -0.552141 -1.343751 0.496152 -1.032324 0.386271 0.522692 0.511736 0.334316
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 10.484640 -0.488273 -0.625341 -0.564789 -0.270677 0.075573 -0.104356 1.096842 0.425199 0.533784 0.335807
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.098290 1.126134 0.229791 0.838141 -1.006953 -0.338394 -1.260789 -1.604342 0.533046 0.522140 0.339605
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.116231 2.469324 0.844653 7.546285 0.732604 -0.006374 1.003747 4.274095 0.537063 0.406118 0.373622
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.291953 4.018218 0.827863 1.272881 0.351744 0.780525 6.172831 11.735766 0.514706 0.344057 0.375000
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.368733 -0.119677 -0.218697 2.926992 0.040625 1.436546 -0.445307 7.395406 0.548212 0.536186 0.339970
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 5.927085 -0.901581 1.744370 -0.427164 1.496770 0.433890 2.547449 0.519440 0.532357 0.547531 0.324645
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.194191 0.186068 0.010158 0.278899 0.664217 -0.226478 0.476704 0.547574 0.528940 0.530402 0.327132
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.021142 -0.865544 -0.899479 -1.103156 -0.661308 -0.693245 -0.315490 -0.414627 0.506221 0.504702 0.325016
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.565921 17.791327 8.560393 5.408234 1.701584 1.156163 2.476092 35.718695 0.072935 0.075116 -0.033550
28 N01 RF_maintenance 100.00% 100.00% 1.66% 0.00% 6.425798 10.016662 8.722200 3.519359 2.132260 0.718718 0.862521 11.523705 0.030713 0.256065 0.197066
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.809469 -0.204856 -0.140637 -0.004964 1.155761 0.036673 1.045495 1.795416 0.554874 0.554711 0.337349
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.021478 -0.898962 0.326048 -0.706128 1.491233 -0.627557 1.455084 -0.318860 0.553430 0.560612 0.334453
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.305254 -0.302119 1.041430 2.514232 0.584910 1.412418 0.743689 19.398210 0.564593 0.550668 0.343556
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 12.343215 12.845877 -0.037490 -0.063495 1.402364 1.980775 5.053630 6.505749 0.453340 0.477353 0.179670
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.325683 -0.588598 4.942001 -0.715339 2.105089 -1.210447 0.739346 -0.064362 0.046994 0.522181 0.369800
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.752474 -0.624986 -0.501472 -0.463185 -0.896617 0.124225 0.431392 0.576777 0.518716 0.508960 0.331106
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.194277 3.589798 1.027019 0.727969 2.646747 1.733869 0.783918 1.298898 0.525705 0.515984 0.341222
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.666706 15.104905 -1.072378 11.218765 0.669224 2.259034 0.935680 4.194554 0.530638 0.034074 0.424091
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.503589 -0.306927 -0.105463 0.339160 0.491752 0.607269 1.985076 7.591553 0.541055 0.532963 0.342425
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.125339 0.753728 0.115958 -0.321401 0.010815 1.514107 20.621401 0.464533 0.214374 0.209815 -0.275654
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.447810 0.606884 1.216524 1.786449 2.260161 0.799519 1.399102 1.631477 0.555643 0.555182 0.340735
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.295736 1.296065 -0.315251 -0.626653 -0.455873 1.035232 0.150868 0.687274 0.235467 0.222807 -0.276228
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.938798 -0.077283 -1.027499 0.696186 -0.801390 0.729569 0.375847 1.777408 0.565142 0.566219 0.342751
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -0.691290 0.242737 -0.692936 0.395304 -0.568782 0.910160 -0.028328 0.422633 0.571162 0.573899 0.346055
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.535901 0.950917 0.779295 0.659373 0.990214 1.965334 2.281893 3.649859 0.557796 0.557288 0.336167
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.328091 -0.757188 0.076306 -1.033307 0.531465 0.001913 1.077444 0.779823 0.550499 0.561314 0.338160
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 6.791014 8.527131 4.872185 4.874935 2.283524 1.688279 1.960606 1.029776 0.030971 0.058277 0.018356
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.488124 0.023502 -0.999474 0.062723 -0.596366 -0.565148 -0.114259 -0.443849 0.525057 0.527342 0.323089
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.322719 -0.715276 0.548845 -1.029257 -0.001913 -0.716307 0.453228 1.804324 0.495756 0.510155 0.318787
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.114660 0.244116 0.451880 1.391189 0.630961 0.635433 -0.152964 0.045821 0.514614 0.507644 0.331507
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 1.614750 0.446350 0.164682 -0.276720 3.080940 0.650940 79.309717 0.919858 0.525479 0.525907 0.332399
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.250335 2.525935 0.586841 0.269646 2.095711 1.140683 3.312538 2.823113 0.548318 0.540614 0.339791
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.082955 0.076516 -0.035379 -0.870980 1.439618 0.339256 8.091181 5.627404 0.555625 0.549748 0.342209
54 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 3.888344 1.249150 0.714210 -0.563329 0.342735 1.906346 -0.833356 -0.403099 0.316951 0.368925 0.159366
55 N04 digital_ok 100.00% 27.42% 100.00% 0.00% 0.135795 29.420441 -0.110787 6.348065 0.867080 3.206984 4.290782 4.541884 0.227217 0.043903 0.075706
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.880396 3.109550 -1.008362 1.404059 -0.924613 2.566147 -0.744964 0.628246 0.563944 0.547957 0.327272
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.455635 1.506568 -0.944494 -0.453743 -0.046657 0.472171 1.359266 1.539676 0.568106 0.564661 0.336147
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.070040 8.039993 8.741364 9.189626 2.195874 1.670869 1.521311 1.459943 0.039810 0.038735 0.002152
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.721034 0.566248 8.759704 0.996495 2.032535 1.982585 0.277865 4.815175 0.050171 0.566625 0.410703
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.083575 7.983831 0.186158 9.215175 0.579053 1.667525 0.889713 2.219454 0.546799 0.076671 0.423059
61 N06 not_connected 100.00% 100.00% 0.00% 0.00% 7.220564 -0.672782 4.666083 -0.493244 2.155120 -0.092731 0.280463 0.457971 0.036139 0.533676 0.370391
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.324518 0.071292 0.368598 -0.069081 0.442174 -0.482534 1.630797 -0.111235 0.509091 0.531835 0.320348
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.609112 8.292192 -1.088923 5.188251 -0.302605 2.001229 0.761005 3.118850 0.528301 0.047931 0.401398
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.549146 -0.422826 -0.780853 0.037248 0.193690 -0.194337 0.323665 3.974509 0.514883 0.503770 0.323371
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 14.493363 13.832240 11.018168 11.025494 2.080518 1.578027 2.635386 3.534528 0.024171 0.034422 0.010412
66 N03 digital_ok 100.00% 55.68% 100.00% 0.00% 1.321847 14.225328 0.793878 11.147446 0.402293 1.534377 -1.575025 3.959534 0.200867 0.051882 0.092060
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.841244 -0.260424 -0.602884 0.759515 -0.697339 1.454232 3.276213 1.272050 0.543099 0.538166 0.334914
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 15.343999 -0.221564 11.065199 -0.253685 2.250901 -0.757178 4.498489 0.382832 0.036636 0.549597 0.433999
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.665857 2.401388 1.246031 -0.553895 0.226364 2.926367 1.717148 0.830145 0.565125 0.564308 0.336280
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.261327 1.574785 1.009930 2.400239 0.177736 1.466922 2.640140 0.590665 0.239292 0.221037 -0.270786
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.867915 -0.302888 -0.233887 0.309385 0.892112 -0.131164 0.034793 1.287046 0.577953 0.577178 0.341735
72 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.255986 8.087450 2.066031 9.292476 0.703523 1.837340 13.042179 3.026585 0.246086 0.091760 -0.004165
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.644816 1.014400 -0.557899 1.131789 0.685711 3.912224 0.664644 2.558472 0.583665 0.579254 0.350483
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.751795 -0.212696 -0.836108 -0.169862 -0.466785 1.637292 -0.684337 0.946966 0.577406 0.578841 0.348029
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 25.394093 6.970564 0.146428 -0.786840 0.822479 0.475041 4.338549 1.826528 0.344871 0.463913 0.249838
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 13.414190 -0.036170 0.007293 0.051196 -0.495725 -0.952213 -0.436249 -0.923660 0.398444 0.536799 0.314871
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.083056 -0.685872 0.772078 -0.793006 -0.099260 -0.556840 1.950212 -0.123450 0.506311 0.524005 0.325671
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.691038 1.135664 -0.754793 0.883964 -1.362138 -0.025356 -0.930834 -1.410982 0.524810 0.509919 0.335070
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 52.520814 24.747334 26.533299 17.992301 59.904178 13.124961 656.193759 183.207614 0.016905 0.016642 0.000770
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 19.937238 45.642908 19.903114 26.375108 25.307007 39.624994 231.380820 553.945432 0.016398 0.016189 0.000727
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 30.280750 19.764159 23.917422 18.530772 44.223191 24.972057 536.472060 246.341078 0.016295 0.016447 0.000789
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.026223 15.373905 0.450277 11.218615 -0.892619 1.388798 -1.519992 2.946073 0.540334 0.056141 0.407009
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.443727 0.010284 -0.612816 -0.701780 -1.638196 0.670794 -1.015799 0.113870 0.560953 0.558792 0.333485
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.235209 0.273417 0.176338 -0.306978 -0.902168 0.193235 -0.258448 7.445330 0.568676 0.563402 0.328923
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.520399 1.787932 2.455793 -0.807206 23.094766 0.024079 66.229077 1.821963 0.453194 0.579275 0.321616
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.144589 0.972887 0.702486 1.118341 0.141005 -0.641224 -0.270146 -0.014698 0.578005 0.575325 0.329930
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.422007 0.155355 0.674693 0.987837 0.250688 0.734347 -0.309270 0.001183 0.575883 0.574320 0.336544
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.503424 -0.798321 0.039246 -0.923244 0.032060 -1.229812 -0.001249 -0.132285 0.572968 0.578842 0.340356
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.096563 0.340719 0.837218 0.590331 0.192281 0.208458 -0.228875 -0.106902 0.560700 0.570423 0.340338
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.386315 0.009078 8.763360 0.400648 2.121406 1.645236 0.209558 0.508129 0.037603 0.566472 0.394800
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.585792 8.168868 8.821134 9.253498 2.074847 1.488275 1.492380 1.313086 0.031677 0.025081 0.003220
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.953092 1.480475 8.917239 6.619773 1.743012 0.522817 1.125227 1.100131 0.029089 0.466419 0.314858
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.660524 -0.690989 -0.052678 -0.478320 -0.477596 -1.262141 0.598937 -0.640341 0.513745 0.536490 0.330971
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.053381 11.086526 0.030913 -0.630912 -1.550895 -0.406724 -1.305737 0.249639 0.526414 0.447234 0.315263
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -0.990285 1.144568 -0.755350 0.418704 -0.582871 -0.414934 0.973435 5.139741 0.516102 0.499111 0.326440
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.624023 3.765852 0.209394 0.962045 0.950492 0.700096 -0.264453 0.034239 0.548055 0.546666 0.336480
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.014931 0.022427 -1.086804 -0.637466 -0.065623 -0.677497 -0.788051 3.855484 0.564178 0.561376 0.332538
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.480119 2.110423 0.610180 -0.249152 1.531259 0.555719 6.995115 7.098664 0.564134 0.568699 0.326258
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.086664 30.773243 0.855202 5.479093 1.796678 0.544528 1.055016 0.492156 0.564099 0.554580 0.329946
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.237969 0.367485 0.472817 1.012197 0.658213 0.050091 -0.001183 -0.041618 0.580785 0.579101 0.335742
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.120557 0.573137 0.159828 0.192830 -0.682329 -0.532441 0.255254 -0.197013 0.576259 0.579782 0.332801
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 1.085191 1.272384 0.282595 -0.212065 0.778909 0.067871 0.626337 1.110020 0.572402 0.573074 0.327061
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.261073 1.359884 1.151244 2.073341 -0.544959 -0.329866 6.017428 0.208774 0.564993 0.573105 0.337369
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.246410 8.094046 8.818162 9.046338 2.087718 1.538968 0.284633 1.112880 0.072608 0.037422 0.023973
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.515617 -0.323482 0.556115 -0.059180 -0.040049 1.128738 -0.103867 -0.234213 0.459236 0.565382 0.320915
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 11.469672 8.021259 1.270798 9.108742 9.650086 1.519541 10.541184 1.594822 0.465869 0.066759 0.320771
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% -0.163774 3.450581 1.262900 7.846559 0.354175 -0.629736 0.758022 0.466420 0.217885 0.151721 -0.227966
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.514319 2.216526 1.575801 1.541984 1.086330 0.847065 -2.149518 -1.962018 0.511377 0.501200 0.320479
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.959630 3.096231 1.277695 3.339621 0.516625 -0.375916 -1.619954 1.385607 0.501505 0.426230 0.321694
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.073826 -0.874265 -0.676910 -0.653795 -0.075159 -0.654226 -0.193730 -0.832337 0.504583 0.505191 0.319897
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 21.457721 26.546527 20.361666 22.133418 18.116969 33.335551 258.292945 400.909112 0.017068 0.016258 0.001024
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 19.186094 30.443073 19.858358 22.701431 20.458341 32.441038 292.037383 419.101182 0.016358 0.016134 0.000680
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.475588 0.551919 2.410411 -0.487782 0.636668 0.085410 1.608199 -0.105337 0.547617 0.557768 0.333230
121 N08 digital_ok 100.00% 6.65% 0.00% 0.00% 1.038862 1.704764 0.843964 4.756699 -0.033718 0.732416 3.796972 7.039278 0.467408 0.548297 0.337091
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.188219 2.272883 -0.301041 -0.788359 1.039841 -0.125921 -0.373293 -0.487499 0.576061 0.577289 0.335157
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.135635 1.216033 1.398456 0.281496 0.913861 -0.417112 -1.905208 -1.226912 0.549125 0.574621 0.335860
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 6.457958 0.009873 8.940718 0.709587 2.041987 0.438819 0.334668 0.416552 0.044760 0.583778 0.396449
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.056789 0.178858 2.374496 1.114398 1.997093 -0.415478 0.222744 -0.055612 0.569941 0.577972 0.338332
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.240833 0.601775 0.258490 0.937487 -0.709195 0.618407 0.709386 0.207443 0.573069 0.574724 0.342256
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.206878 -1.045419 8.756299 -1.028088 2.120948 -0.015031 0.159839 -0.380628 0.038896 0.569602 0.398937
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.046421 -0.721712 -0.397194 -0.710436 0.411052 -0.730948 0.775587 1.292678 0.554978 0.558390 0.344135
131 N11 not_connected 100.00% 0.00% 47.09% 0.00% -1.082214 7.761525 -0.873049 5.059737 -1.242976 0.985772 -0.836886 0.329613 0.543150 0.230831 0.387395
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.107579 -0.309006 -0.950251 -0.590604 -0.813396 -0.057174 -0.211592 0.104682 0.526475 0.514517 0.328679
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.237345 -1.034984 -0.571410 -0.989001 0.428875 -0.981095 -0.181067 -0.175260 0.514289 0.515521 0.326146
134 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.343005 1.452053 2.261516 1.038032 -0.164443 0.413628 6.730000 -1.574330 0.437545 0.484364 0.321502
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.507992 -1.007453 -0.406881 -0.888004 2.790203 -0.214847 -0.027028 -0.125567 0.490487 0.498355 0.323721
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 5.851473 2.169608 8.544896 -0.044545 2.127922 1.805549 0.710112 1.917622 0.042547 0.497047 0.355180
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 19.450305 38.197145 20.302916 20.509590 32.331662 23.331749 424.895737 309.377282 0.016367 0.016343 0.000824
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.161542 -0.425714 -0.043562 -0.946466 -1.059370 -0.747615 -1.111047 0.280763 0.532298 0.533145 0.324728
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.109708 -1.112069 0.092385 -0.970902 0.146491 -1.125647 1.602979 1.471021 0.554503 0.559180 0.326799
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.322622 -0.592342 0.113454 -0.412681 1.502636 -1.009999 0.241550 -0.469954 0.565824 0.561900 0.327997
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.118730 8.075835 -0.215927 9.225442 1.741390 2.171917 15.908376 3.342028 0.572347 0.050606 0.462392
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.711481 7.898355 8.627187 9.197550 2.080156 1.728568 0.976591 1.722826 0.124367 0.034142 0.076155
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.099584 -0.720733 -0.303892 -0.184662 0.523861 -0.450354 -0.154571 -0.684344 0.578108 0.573752 0.338146
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.110057 0.028436 -0.031646 0.415129 0.696252 0.625857 -0.061210 0.431317 0.570828 0.568581 0.332791
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.456108 -0.893344 -0.743470 -1.114971 -1.281380 -1.062453 -0.315209 -0.304312 0.551492 0.560072 0.339709
147 N15 digital_ok 100.00% 96.40% 95.29% 0.00% 120.057614 120.400628 inf inf 2729.942302 2713.333326 4866.991429 4801.545905 0.395206 0.479132 0.425226
148 N15 digital_ok 100.00% 97.23% 96.95% 0.00% nan nan inf inf nan nan nan nan 0.525341 0.505782 0.354124
149 N15 digital_ok 100.00% 97.23% 96.68% 0.00% nan nan inf inf nan nan nan nan 0.436709 0.483884 0.420201
150 N15 digital_ok 100.00% 96.40% 96.40% 0.00% 128.478094 128.570405 inf inf 2344.457554 2394.811271 3764.124532 3965.367474 0.564893 0.533851 0.415092
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 8.815405 -0.616462 -0.695869 0.932016 -0.536441 0.940543 -0.398187 5.421284 0.429603 0.501927 0.296755
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 6.158482 -0.916623 8.661796 -0.400530 2.455145 0.707470 2.731743 1.675711 0.045031 0.500068 0.369185
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.315240 7.956498 6.176419 9.085051 0.664205 1.679201 4.053531 1.700175 0.425000 0.041643 0.320607
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.315985 -0.105500 0.527139 0.741371 0.220346 0.459936 -0.216897 0.019935 0.513816 0.519041 0.333500
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.319130 -0.834839 -0.884189 -0.979130 -0.212852 -0.211469 2.153047 9.761560 0.530267 0.534153 0.336687
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.062956 11.166280 0.002656 -0.026531 -0.048829 0.103721 0.900085 1.208062 0.509988 0.422058 0.305603
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 6.744119 -0.692509 8.740696 -0.301206 2.087414 0.229554 0.315870 -0.210037 0.047996 0.554107 0.426328
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.200326 16.754075 0.458285 0.370332 0.493686 -0.639975 -0.216880 0.038929 0.555549 0.453331 0.308646
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.425348 -0.990108 -0.674289 -1.090893 -0.457603 -0.266958 0.093807 -0.520045 0.567985 0.571937 0.331928
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.016486 0.643691 0.355579 0.583388 1.028841 2.628570 0.964017 1.581168 0.574079 0.577337 0.340393
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.262736 0.631626 1.007508 1.055162 0.468749 0.687950 0.561799 1.422731 0.572134 0.573535 0.331702
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 11.958623 -0.318117 0.522472 -0.249987 0.037127 -0.044678 1.415979 -0.246980 0.466304 0.571961 0.320025
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.266688 -0.529829 0.953015 -0.308314 0.904212 -1.118545 0.090071 -1.032479 0.568581 0.565135 0.332769
167 N15 digital_ok 100.00% 96.12% 96.12% 0.00% nan nan inf inf nan nan nan nan 0.442461 0.435193 0.360361
168 N15 digital_ok 100.00% 95.01% 94.74% 0.28% nan nan inf inf nan nan nan nan 0.453784 0.501093 0.407910
169 N15 digital_ok 100.00% 96.68% 96.12% 0.28% 114.682291 115.043893 inf inf 2281.636404 2383.475212 4643.729187 4724.489463 0.387590 0.426333 0.365024
170 N15 digital_ok 100.00% 95.29% 95.29% 0.00% 108.680377 109.085189 inf inf 2546.117442 2577.481305 4411.877460 4503.792208 0.438883 0.457129 0.383838
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.355972 -1.178193 0.466280 -1.096308 0.125181 -0.559109 1.053432 0.935503 0.500112 0.514324 0.329324
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.702380 0.307717 1.097714 0.058652 0.291119 -0.897597 -1.454854 -0.284964 0.512683 0.509033 0.333728
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.559162 2.350929 1.616475 1.601552 1.341448 0.987155 -2.079940 -1.531851 0.480526 0.465238 0.317796
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.543113 -0.935122 0.004964 -0.599863 -0.715387 -0.578201 -0.428534 -0.408002 0.529638 0.530981 0.339121
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.363468 8.454481 -0.618565 9.302985 1.230402 1.970630 11.599744 2.915724 0.544882 0.057209 0.438404
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.866862 0.290177 1.292401 0.936321 1.178604 0.416698 0.428241 3.477342 0.557145 0.556270 0.340226
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.663497 7.932333 -0.850309 9.034898 -1.474293 1.535762 0.407135 1.507949 0.563342 0.052655 0.418306
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.636376 0.437876 0.131595 0.431369 0.549791 0.089301 0.392065 0.636910 0.566845 0.563329 0.330049
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 8.912053 -0.344370 7.267455 -0.160688 1.616377 0.175057 1.100632 0.255155 0.331296 0.571236 0.365960
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.234382 -0.251045 -0.582737 0.011041 0.049217 -0.300754 2.680701 0.038674 0.573423 0.568361 0.337795
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.055802 -1.021789 -0.552828 -0.981022 -1.143201 -1.010818 -0.476444 -0.229662 0.569216 0.568473 0.336739
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.010284 -0.801060 -0.200899 -0.623997 0.726547 -0.645447 1.807045 -0.385221 0.557769 0.551963 0.335337
189 N15 digital_ok 100.00% 95.01% 94.74% 0.00% nan nan inf inf nan nan nan nan 0.499724 0.554854 0.492430
190 N15 digital_ok 100.00% 95.29% 95.57% 0.00% 128.715707 128.785614 inf inf 3057.192215 3055.452301 5723.267070 5712.168193 0.427267 0.413631 0.369686
191 N15 digital_ok 100.00% 95.29% 95.29% 0.00% 99.822094 99.416651 inf inf 2310.070359 2297.797943 3496.004023 3453.027149 0.511296 0.466345 0.419185
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.257882 2.551756 1.478208 1.733592 1.135526 1.227046 -1.783432 -1.852264 0.486248 0.467254 0.317919
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.838572 2.186584 1.783222 1.541944 1.578698 0.942783 -2.134045 -1.884402 0.471876 0.463791 0.313611
200 N18 RF_maintenance 100.00% 100.00% 0.00% 0.00% 7.326246 18.530757 4.816183 0.125975 2.203805 0.693185 1.211733 1.216077 0.041435 0.250339 0.165601
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.144934 1.822014 0.827054 1.378611 -0.679222 0.608229 -1.371348 -1.835710 0.529710 0.509275 0.333200
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% -0.081120 -0.170820 -0.009963 -0.382737 -1.004713 1.357146 -0.531427 30.613911 0.543053 0.534192 0.325457
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.293601 6.306135 1.473756 -0.593378 1.007753 0.358747 10.182625 1.262096 0.558839 0.557476 0.331715
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.681228 -0.671313 3.943435 -0.592003 -0.002684 0.200592 1.195929 1.868200 0.359242 0.547199 0.379775
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.558591 2.150077 1.142254 2.707801 -0.825663 -0.927707 0.289921 0.772565 0.499986 0.458070 0.308769
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.229312 -0.903302 -0.938946 -1.104975 -0.968623 -0.463049 3.655367 -0.382326 0.519477 0.534362 0.325754
208 N20 dish_maintenance 100.00% 95.84% 96.12% 0.00% nan nan inf inf nan nan nan nan 0.482596 0.363323 0.380286
209 N20 dish_maintenance 100.00% 96.68% 96.68% 0.00% nan nan inf inf nan nan nan nan 0.313097 0.329882 0.293635
210 N20 dish_maintenance 100.00% 96.12% 95.84% 0.00% nan nan inf inf nan nan nan nan 0.550937 0.553660 0.299793
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% -0.181529 8.307174 -0.583966 5.179316 -0.451848 1.481446 -0.149852 0.760050 0.504526 0.040412 0.415071
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.821419 -0.965070 -0.604466 -1.116137 -1.155224 -0.561529 0.713836 -0.324073 0.530435 0.519357 0.329794
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.839446 -0.708259 -0.861706 -1.081904 0.054616 -0.446622 3.068482 -0.546504 0.531056 0.532952 0.328556
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.554565 -0.597098 -0.889483 -0.673742 -0.671484 -1.057064 2.278234 -0.298399 0.537639 0.537782 0.328485
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.891393 -0.338424 -0.307242 1.105610 -0.558014 0.362820 -0.272883 11.098456 0.532488 0.508940 0.325263
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.009875 2.339373 1.913615 1.654712 1.677714 0.931909 -2.279481 -1.998826 0.499809 0.500054 0.310092
225 N19 RF_ok 100.00% 0.00% 92.24% 0.00% -0.369508 7.902148 -0.324021 4.989032 -1.549039 1.390499 -1.081680 1.072179 0.536644 0.150182 0.424531
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.060471 8.247757 -1.106868 -0.580162 -0.550113 0.031894 -0.701250 -0.443560 0.531392 0.448162 0.322582
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 1.152206 -0.501734 2.176044 -0.846950 -0.184910 -0.701505 8.838858 0.243318 0.457898 0.512161 0.338459
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.207630 -0.399470 -0.343479 -0.613047 -1.368524 0.562629 -0.199437 0.216827 0.513778 0.503269 0.320960
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.075752 0.010449 -0.412847 0.021912 -1.168306 -0.734764 -0.643173 -1.204202 0.507476 0.499213 0.328868
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.995463 -0.784115 0.551654 -0.731287 -0.261120 -0.535894 1.029302 -0.472757 0.483905 0.506198 0.333848
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.374809 -0.616900 -0.272419 -0.356737 -1.622551 -1.076037 -1.099991 -1.037229 0.524851 0.514402 0.338968
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.961058 -0.810832 -1.007023 -0.764916 -1.214985 -0.741513 -0.585251 1.229974 0.526693 0.520370 0.333837
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.683125 -0.457677 0.590618 -0.978212 -0.551327 -0.871646 1.425661 0.148247 0.494193 0.520617 0.334916
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.211399 -1.017277 -1.006020 -0.699368 -1.160955 -1.324714 -0.004921 -0.847283 0.525845 0.519896 0.332541
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 9.105711 -0.197611 -0.683127 -0.116154 -0.581114 -1.099713 0.887806 -0.910221 0.423914 0.516063 0.319613
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 7.230704 -0.867146 -0.255400 -0.692033 1.572379 -0.607512 3.838878 -0.183623 0.436238 0.511218 0.322117
244 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.221988 -0.692410 0.075962 -0.376059 -0.488137 -0.528990 1.454293 2.072654 0.502428 0.507566 0.317106
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.634387 -0.355246 -0.480455 -0.840550 -1.497487 -0.915877 -1.113720 0.266167 0.514758 0.503271 0.325241
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.488044 8.621117 -1.026955 4.840299 -0.819945 1.518509 -0.386316 0.261153 0.501777 0.039893 0.409448
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.594940 -0.599490 -0.638430 -0.934758 -1.372354 -1.089553 2.302720 -0.601314 0.502246 0.491785 0.324095
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.533698 7.228656 0.341564 0.375445 1.516482 0.209722 -0.116455 0.763768 0.510865 0.499341 0.335267
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.318735 0.101752 0.646817 0.016244 -0.163761 -0.401116 -1.067957 0.131122 0.405391 0.391189 0.296374
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.861669 0.921470 -0.087853 0.081971 -0.620480 -0.400256 -0.879286 -0.911255 0.392997 0.380210 0.279456
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.153042 -0.849529 -0.200091 -0.620494 -1.170011 -0.107336 -1.172960 -0.101756 0.427330 0.411786 0.307102
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 7.171187 8.265530 4.745061 5.292392 2.031035 1.450849 0.291247 0.309116 0.043161 0.040273 0.003160
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.002620 0.134531 -0.105978 -0.563868 0.212610 0.200881 1.281320 -0.041745 0.398193 0.396909 0.281430
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: [4, 7, 15, 17, 18, 19, 20, 27, 28, 31, 32, 34, 37, 38, 40, 42, 47, 51, 53, 55, 58, 59, 60, 61, 63, 65, 66, 68, 70, 72, 77, 78, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 103, 104, 108, 109, 110, 111, 112, 117, 118, 121, 124, 127, 131, 134, 136, 137, 142, 143, 147, 148, 149, 150, 151, 155, 156, 158, 159, 160, 161, 165, 167, 168, 169, 170, 180, 182, 184, 189, 190, 191, 200, 202, 204, 205, 208, 209, 210, 211, 223, 225, 226, 227, 242, 243, 246, 262, 329]

unflagged_ants: [5, 8, 9, 10, 16, 21, 22, 29, 30, 35, 36, 41, 43, 44, 45, 46, 48, 49, 50, 52, 54, 56, 57, 62, 64, 67, 69, 71, 73, 74, 79, 80, 85, 88, 89, 90, 91, 95, 101, 102, 105, 106, 107, 113, 114, 115, 120, 122, 123, 125, 126, 128, 132, 133, 135, 139, 140, 141, 144, 145, 146, 157, 162, 163, 164, 166, 171, 172, 173, 179, 181, 183, 185, 186, 187, 192, 193, 201, 206, 207, 220, 221, 222, 224, 228, 229, 237, 238, 239, 240, 241, 244, 245, 261, 320, 324, 325, 333]

golden_ants: [5, 9, 10, 16, 21, 29, 30, 41, 44, 45, 54, 56, 67, 69, 71, 85, 88, 91, 101, 105, 106, 107, 122, 123, 128, 140, 141, 144, 145, 146, 157, 162, 163, 164, 166, 171, 172, 173, 181, 183, 186, 187, 192, 193]
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_2460060.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

# Figure out where to draw the nodes
node_centers = {}
for node in sorted(set(list(nodes.values()))):
    if np.isfinite(node):
        this_node_ants = [ant for ant in ants + unused_ants if nodes[ant] == node]
        if len(this_node_ants) == 1:
            # put the node label just to the west of the lone antenna 
            node_centers[node] = hd.antpos[ant][node] + np.array([-14.6 / 2, 0, 0])
        else:
            # put the node label between the two antennas closest to the node center
            node_centers[node] = np.mean([hd.antpos[ant] for ant in this_node_ants], axis=0)
            closest_two_pos = sorted([hd.antpos[ant] for ant in this_node_ants], 
                                     key=lambda pos: np.linalg.norm(pos - node_centers[node]))[0:2]
            node_centers[node] = np.mean(closest_two_pos, axis=0)
In [25]:
def Plot_Array(ants, unused_ants, outriggers):
    plt.figure(figsize=(16,16))
    
    plt.scatter(np.array([hd.antpos[ant][0] for ant in hd.data_ants if ant in ants]), 
                np.array([hd.antpos[ant][1] for ant in hd.data_ants if ant in ants]), c='w', s=0)

    # connect every antenna to their node
    for ant in ants:
        if nodes[ant] in node_centers:
            plt.plot([hd.antpos[ant][0], node_centers[nodes[ant]][0]], 
                     [hd.antpos[ant][1], node_centers[nodes[ant]][1]], 'k', zorder=0)

    rc_color = '#0000ff'
    antm_color = '#ffa500'
    autom_color = '#ff1493'

    # Plot 
    unflagged_ants = []
    for i, ant in enumerate(ants):
        ant_has_flag = False
        # plot large blue annuli for redcal flags
        if use_redcal:
            if redcal_flagged_frac[ant] > 0:
                ant_has_flag = True
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=7 * (2 - 1 * float(not outriggers)), fill=True, lw=0,
                                                color=rc_color, alpha=redcal_flagged_frac[ant]))
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=6 * (2 - 1 * float(not outriggers)), fill=True, color='w'))
        
        # plot medium green annuli for ant_metrics flags
        if use_ant_metrics: 
            if ant_metrics_xants_frac_by_ant[ant] > 0:
                ant_has_flag = True
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=6 * (2 - 1 * float(not outriggers)), fill=True, lw=0,
                                                color=antm_color, alpha=ant_metrics_xants_frac_by_ant[ant]))
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=5 * (2 - 1 * float(not outriggers)), fill=True, color='w'))
        
        # plot small red annuli for auto_metrics
        if use_auto_metrics:
            if ant in auto_ex_ants:
                ant_has_flag = True                
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=5 * (2 - 1 * float(not outriggers)), fill=True, lw=0, color=autom_color)) 
        
        # plot black/white circles with black outlines for antennas
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4 * (2 - 1 * float(not outriggers)), fill=True, color=['w', 'k'][ant_has_flag], ec='k'))
        if not ant_has_flag:
            unflagged_ants.append(ant)

        # label antennas, using apriori statuses if available
        try:
            bgc = matplotlib.colors.to_rgb(status_colors[a_priori_statuses[ant]])
            c = 'black' if (bgc[0]*0.299 + bgc[1]*0.587 + bgc[2]*0.114) > 186 / 256 else 'white'
        except:
            c = 'k'
            bgc='white'
        plt.text(hd.antpos[ant][0], hd.antpos[ant][1], str(ant), va='center', ha='center', color=c, backgroundcolor=bgc)

    # label nodes
    for node in sorted(set(list(nodes.values()))):
        if not np.isnan(node) and not np.all(np.isnan(node_centers[node])):
            plt.text(node_centers[node][0], node_centers[node][1], str(node), va='center', ha='center', bbox={'color': 'w', 'ec': 'k'})
    
    # build legend 
    legend_objs = []
    legend_labels = []
    
    # use circles for annuli 
    legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgecolor='k', markerfacecolor='w', markersize=13))
    legend_labels.append(f'{len(unflagged_ants)} / {len(ants)} Total {["Core", "Outrigger"][outriggers]} Antennas Never Flagged')
    legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markerfacecolor='k', markersize=15))
    legend_labels.append(f'{len(ants) - len(unflagged_ants)} Antennas {["Core", "Outrigger"][outriggers]} Flagged for Any Reason')

    if use_auto_metrics:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=autom_color, markersize=15))
        legend_labels.append(f'{len([ant for ant in auto_ex_ants if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas Flagged by Auto Metrics')
    if use_ant_metrics: 
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=antm_color, markersize=15))
        legend_labels.append(f'{np.round(np.sum([frac for ant, frac in ant_metrics_xants_frac_by_ant.items() if ant in ants]), 2)} Antenna-Nights on' 
                             f'\n{np.sum([frac > 0 for ant, frac in ant_metrics_xants_frac_by_ant.items() if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas '
                             'Flagged by Ant Metrics\n(alpha indicates fraction of time)')        
    if use_redcal:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=rc_color, markersize=15))
        legend_labels.append(f'{np.round(np.sum(list(redcal_flagged_frac.values())), 2)} Antenna-Nights on' 
                             f'\n{np.sum([frac > 0 for ant, frac in redcal_flagged_frac.items() if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas '
                             'Flagged by Redcal\n(alpha indicates fraction of time)')

    # use rectangular patches for a priori statuses that appear in the array
    for aps in sorted(list(set(list(a_priori_statuses.values())))):
        if aps != 'Not Found':
            legend_objs.append(plt.Circle((0, 0), radius=7, fill=True, color=status_colors[aps]))
            legend_labels.append(f'A Priori Status:\n{aps} ({[status for ant, status in a_priori_statuses.items() if ant in ants].count(aps)} {["Core", "Outrigger"][outriggers]} Antennas)')

    # label nodes as a white box with black outline
    if len(node_centers) > 0:
        legend_objs.append(matplotlib.patches.Patch(facecolor='w', edgecolor='k'))
        legend_labels.append('Node Number')

    if len(unused_ants) > 0:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markerfacecolor='grey', markersize=15, alpha=.2))
        legend_labels.append(f'Anntenna Not In Data')
        
    
    plt.legend(legend_objs, legend_labels, ncol=2, fontsize='large', framealpha=1)
    
    if outriggers:
        pass
    else:
        plt.xlim([-200, 150])
        plt.ylim([-150, 150])        
       
    # set axis equal and label everything
    plt.axis('equal')
    plt.tight_layout()
    plt.title(f'Summary of {["Core", "Outrigger"][outriggers]} Antenna Statuses and Metrics on {JD}', size=20)    
    plt.xlabel("Antenna East-West Position (meters)", size=12)
    plt.ylabel("Antenna North-South Position (meters)", size=12)
    plt.xticks(fontsize=12)
    plt.yticks(fontsize=12)
    xlim = plt.gca().get_xlim()
    ylim = plt.gca().get_ylim()    
        
    # plot unused antennas
    plt.autoscale(False)    
    for ant in unused_ants:
        if nodes[ant] in node_centers:
            plt.plot([hd.antpos[ant][0], node_centers[nodes[ant]][0]], 
                     [hd.antpos[ant][1], node_centers[nodes[ant]][1]], 'k', alpha=.2, zorder=0)
        
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4, fill=True, color='w', ec=None, alpha=1, zorder=0))
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4, fill=True, color='grey', ec=None, alpha=.2, zorder=0))
        if hd.antpos[ant][0] < xlim[1] and hd.antpos[ant][0] > xlim[0]:
            if hd.antpos[ant][1] < ylim[1] and hd.antpos[ant][1] > ylim[0]:
                plt.text(hd.antpos[ant][0], hd.antpos[ant][1], str(ant), va='center', ha='center', color='k', alpha=.2) 

Figure 1: Array Plot of Flags and A Priori Statuses¶

This plot shows all antennas, which nodes they are connected to, and their a priori statuses (as the highlight text of their antenna numbers). It may also show (depending on what is finished running):

  • Whether they were flagged by auto_metrics (red circle) for bandpass shape, overall power, temporal variability, or temporal discontinuities. This is done in a binary fashion for the whole night.
  • Whether they were flagged by ant_metrics (green circle) as either dead (on either polarization) or crossed, with the transparency indicating the fraction of the night (i.e. number of files) that were flagged.
  • Whether they were flagged by redcal (blue circle) for high chi^2, with the transparency indicating the fraction of the night (i.e. number of files) that were flagged.

Note that the last fraction does not include antennas that were flagged before going into redcal due to their a priori status, for example.

In [26]:
core_ants = [ant for ant in ants if ant < 320]
outrigger_ants = [ant for ant in ants if ant >= 320]
Plot_Array(ants=core_ants, unused_ants=unused_ants, outriggers=False)
if len(outrigger_ants) > 0:
    Plot_Array(ants=outrigger_ants, unused_ants=sorted(set(unused_ants + core_ants)), outriggers=True)

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.1.1.dev3+gb291d34
3.2.3.dev158+gd5cadd5
In [ ]: