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 = "2460024"
data_path = "/mnt/sn1/2460024"
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: 3-20-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/2460024/zen.2460024.21312.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

# get a list of all ant_metrics files
glob_str = os.path.join(data_path, f'zen.{JD}.?????.sum{ant_metrics_ext}')
ant_metrics_files = sorted(glob.glob(glob_str))

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1850 ant_metrics files matching glob /mnt/sn1/2460024/zen.2460024.?????.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/2460024/zen.2460024.?????.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 2460024
Date 3-20-2023
LST Range 6.407 -- 16.363 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
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, 72, 112
Total Number of Nodes 19
Nodes Registering 0s
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 72 / 198 (36.4%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 133 / 198 (67.2%)
Redcal Done? ❌
Never Flagged Antennas 64 / 198 (32.3%)
A Priori Good Antennas Flagged 70 / 93 total a priori good antennas:
3, 5, 7, 15, 16, 17, 20, 30, 31, 37, 38, 40,
42, 45, 53, 54, 55, 56, 65, 66, 67, 70, 71,
72, 81, 83, 86, 93, 94, 101, 103, 107, 109,
111, 112, 118, 121, 122, 123, 124, 127, 128,
136, 140, 144, 145, 147, 148, 149, 150, 151,
158, 161, 164, 165, 167, 168, 169, 170, 173,
181, 182, 184, 187, 189, 190, 191, 192, 193,
202
A Priori Bad Antennas Not Flagged 41 / 105 total a priori bad antennas:
8, 22, 35, 43, 46, 48, 49, 50, 57, 61, 62,
73, 74, 89, 90, 95, 115, 125, 132, 133, 139,
185, 201, 206, 220, 221, 222, 228, 229, 237,
238, 239, 240, 241, 245, 261, 320, 324, 325,
329, 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_2460024.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% 0.00% 100.00% 0.00% 0.617233 12.702849 0.344933 11.070606 0.631017 4.195381 -0.481062 2.306550 0.554242 0.048272 0.480845
4 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.221576 20.538121 -1.087966 -0.527409 -0.843952 0.750401 -1.200220 5.277933 0.566449 0.446480 0.347562
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 10.044616 12.519122 10.416538 10.823796 3.925464 4.266891 0.910878 1.095598 0.043704 0.036069 0.003347
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.805890 0.280244 -0.557620 0.276726 0.039498 0.916742 8.749626 12.837390 0.579194 0.588081 0.346078
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 3.043777 2.947996 2.055753 1.995881 1.829406 2.004878 -1.958514 -1.940032 0.557128 0.563397 0.327934
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.872615 -0.283250 3.504757 -0.363774 0.680300 0.302298 2.227700 -0.174162 0.557413 0.581667 0.343902
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.996279 -0.684648 -0.885326 -0.643311 -0.643715 0.400229 2.811663 0.235881 0.572480 0.575583 0.340414
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 23.296116 0.605634 1.196323 0.461094 1.908916 0.838529 1.030688 3.132015 0.441791 0.578687 0.351700
16 N01 digital_ok 100.00% 0.00% 100.00% 0.00% 0.411645 13.108955 -0.237500 11.071140 0.343317 4.175711 2.740771 3.563011 0.582307 0.046755 0.494133
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.199611 4.566633 1.094637 9.395951 0.721291 0.534429 0.088698 4.173566 0.583478 0.419722 0.400573
18 N01 RF_maintenance 100.00% 100.00% 0.00% 0.00% 10.247710 12.848912 10.439039 1.218467 3.902652 2.358614 1.166941 56.498034 0.042619 0.376999 0.295644
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.002732 -0.174879 -0.285558 0.266930 0.014636 -0.671581 0.193959 -1.060243 0.593099 0.599765 0.343586
20 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.434563 -0.781713 1.724046 -0.323603 5.875583 0.048379 1.104607 -0.161303 0.582837 0.599424 0.339550
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.374881 0.065950 0.010947 0.494722 0.670159 1.595549 0.033499 0.416616 0.575950 0.580249 0.334310
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -1.210724 -1.001302 -0.584431 -0.999144 -0.713981 1.360576 -0.689522 -0.242777 0.550880 0.559536 0.334876
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.992087 11.881078 10.489452 10.903155 3.884271 4.239877 2.938444 2.857113 0.034610 0.034114 0.001191
28 N01 RF_maintenance 100.00% 100.00% 3.24% 0.00% 9.520233 19.912083 10.342743 3.919007 3.918483 3.191652 2.268626 39.201945 0.034729 0.267096 0.199993
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.992013 -0.411615 -0.464558 -0.348684 0.122618 0.407829 2.144878 0.864667 0.598734 0.603823 0.346327
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.138734 -0.503650 0.800912 -0.726749 5.885285 0.601288 5.426809 0.217311 0.589347 0.610285 0.346608
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.857052 -0.048669 1.387115 2.001545 1.595848 0.541218 0.651370 9.325519 0.602435 0.605122 0.337076
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 17.931387 18.673701 -0.244516 -0.127379 1.673649 0.818244 10.240930 24.280767 0.498848 0.521707 0.218462
34 N06 not_connected 100.00% 100.00% 100.00% 0.00% 11.036708 13.350161 5.618932 5.923683 3.848199 4.205767 1.808575 3.830552 0.039228 0.058985 0.012193
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.041688 -1.072126 0.280734 -1.078506 1.173873 -0.153415 -1.498904 -0.080055 0.558802 0.558002 0.332242
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.512904 6.951622 1.309525 1.069071 1.172436 1.870683 0.141458 1.080230 0.555948 0.555353 0.358687
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 0.651484 20.960634 -0.657951 12.853243 -1.036339 4.251388 -1.403829 4.073012 0.551911 0.039532 0.443454
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.193731 2.078589 -0.128306 0.223194 -0.016433 -0.540657 3.918124 12.426147 0.578575 0.555907 0.355335
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.170996 1.266535 0.109130 -0.296164 0.622133 0.480868 10.775962 2.279115 0.248005 0.238180 -0.267932
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.849823 1.575748 1.491684 2.131213 2.262944 0.363505 -0.138725 0.382717 0.593657 0.597943 0.345607
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.577928 2.407379 -0.243761 -0.634475 0.631832 0.652927 -0.307591 1.577458 0.268241 0.256510 -0.266604
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.574701 0.206747 -0.808806 1.032775 -0.979698 1.311860 -1.547077 0.812015 0.604816 0.611157 0.337778
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.015707 0.501873 -1.192182 0.178355 -0.796475 0.620869 -1.171263 -0.070949 0.606350 0.619617 0.340341
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.530422 3.351295 1.015206 0.973483 0.102569 2.309894 0.779889 11.042964 0.596316 0.602639 0.330883
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.335155 -0.303750 0.122244 -1.195435 0.015709 0.000274 -0.216773 -0.552894 0.597031 0.616189 0.347399
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 10.181000 13.004225 5.529268 5.588060 3.843710 4.164043 3.282119 0.933677 0.032245 0.063149 0.019474
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.572154 0.377508 -0.807736 0.618814 -1.080020 0.689232 -1.290803 -2.160894 0.562196 0.576253 0.337359
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.584193 -0.519471 0.616514 -0.830543 -0.626899 -0.339683 -0.043861 1.674551 0.529533 0.557737 0.337675
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.664334 1.131835 0.633025 1.945658 0.074678 2.079362 0.090706 0.498293 0.554463 0.553038 0.355912
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 3.172893 1.614465 0.190179 -0.252933 1.706494 0.949709 86.145452 1.099342 0.565953 0.568244 0.354696
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.335030 5.167372 0.701569 0.518643 1.146072 1.392700 2.937297 1.187783 0.580632 0.582588 0.354593
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.357482 1.273441 0.062410 -0.682878 1.159185 -0.037249 8.915506 0.810180 0.586900 0.595622 0.356507
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 9.427384 3.083368 1.478212 -0.428199 1.688006 1.294546 -1.103733 0.544052 0.301850 0.357177 0.145966
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.242234 46.888843 0.294783 7.449124 -0.387867 4.802637 2.440121 0.719625 0.266487 0.048822 0.103973
56 N04 digital_ok 100.00% 0.00% 0.00% 0.00% -0.622758 1.312584 -1.155956 2.607097 -0.748931 2.818583 -1.223155 6.959652 0.604290 0.606230 0.336040
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.452375 1.841971 -0.809229 -0.210490 -0.485222 0.581849 -0.452898 2.115038 0.610975 0.611372 0.333297
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.908158 12.152384 10.382408 10.994975 3.817564 4.179403 2.198444 2.125208 0.044090 0.042627 0.002220
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.806096 0.778235 9.966008 0.774601 3.711055 2.672764 0.561270 3.760297 0.056805 0.610310 0.453698
60 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.399133 12.067720 0.204846 11.022948 0.514303 4.175101 0.299805 3.584857 0.596579 0.086646 0.462482
61 N06 not_connected 0.00% 0.00% 0.00% 0.00% 1.673172 -0.908352 0.934748 -0.576269 0.648381 -0.282582 -0.023738 0.605717 0.542944 0.581087 0.337637
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.390647 0.633446 0.229489 0.365844 0.310289 -0.677400 0.505486 -1.629559 0.538375 0.576395 0.337106
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% -0.547097 12.580684 -1.036018 5.967451 -0.810745 4.248884 -0.672287 3.464895 0.564635 0.053996 0.428898
64 N06 not_connected 100.00% 0.00% 0.00% 0.00% -0.739629 -0.485151 -1.209823 -0.050991 -0.464951 -0.278697 1.213810 4.729740 0.550550 0.544944 0.330243
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 21.947468 20.793018 13.183808 13.249750 3.970789 4.317981 5.873028 7.559616 0.024694 0.038480 0.013091
66 N03 digital_ok 100.00% 19.57% 100.00% 0.00% 2.380574 21.487395 1.631185 13.409570 1.102168 4.244161 -2.585482 8.142592 0.223614 0.059596 0.101448
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.677878 -0.306083 -0.796778 1.169606 -0.550112 1.310857 5.681470 2.647027 0.582827 0.580851 0.353009
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 23.552019 0.345802 13.279074 0.357234 3.827242 -0.720412 6.576696 -1.192553 0.042325 0.591282 0.450790
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.905370 1.637201 1.595249 -0.563134 0.047998 1.022339 2.192149 0.521389 0.595529 0.605639 0.344791
70 N04 digital_ok 100.00% 0.00% 0.00% 100.00% -0.224804 2.255349 1.374073 3.107460 1.719158 1.762718 4.532835 1.301741 0.269726 0.253151 -0.265558
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.598287 0.098082 -0.305479 0.544435 0.188401 -0.032615 -0.750043 1.055737 0.607690 0.620663 0.339435
72 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.327564 1.375334 2.816607 1.395572 0.992465 0.780152 14.511325 1.436147 0.280093 0.268970 -0.266067
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.529766 1.507719 -0.656682 0.509868 0.650701 1.009371 -0.165314 0.462973 0.616691 0.625271 0.338117
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.105279 0.196449 -0.618286 0.015420 -0.741886 1.027971 -1.430303 1.669282 0.612983 0.623353 0.340232
77 N06 not_connected 100.00% 0.00% 0.00% 0.00% 48.537663 16.346168 0.637070 -0.666682 1.919941 0.142910 2.013863 -0.127972 0.314524 0.485219 0.271631
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 23.089505 0.352749 -0.162233 0.515733 0.272807 -0.114156 1.184232 -0.532534 0.412713 0.583550 0.330935
79 N11 not_connected 100.00% 0.00% 100.00% 0.00% 0.515293 12.812445 -0.527392 5.953299 -0.608339 4.136659 0.186094 0.428130 0.553280 0.046961 0.433163
80 N11 not_connected 100.00% 0.00% 76.92% 0.00% -0.406258 13.082918 -0.344828 5.781142 -1.031837 3.130603 -1.540464 1.945797 0.556739 0.110249 0.420846
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 82.196904 36.587463 26.352256 21.062004 9.238628 7.142054 646.998486 376.063890 0.022779 0.017224 0.003808
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 29.485551 61.400400 23.466554 26.652412 5.668315 10.064192 532.902585 757.018260 0.021215 0.019084 0.001983
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 24.200355 43.318945 20.587517 21.424744 3.927216 7.595352 327.530014 446.166219 0.022967 0.021024 0.002124
84 N08 RF_maintenance 100.00% 54.32% 100.00% 0.00% 16.312952 22.652180 12.796256 13.550077 2.497532 4.189549 5.058119 6.211774 0.207752 0.042878 0.130303
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.598876 -0.162157 -0.379984 -0.707391 -0.856325 0.069610 -1.691164 -0.173348 0.602163 0.595860 0.340098
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.859493 0.741604 0.347480 -0.222313 1.253679 0.855906 1.228588 18.655659 0.599966 0.611443 0.333556
87 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 182.463541 182.912532 inf inf 1646.385899 1662.040959 7629.185036 7566.696487 nan nan nan
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.598343 0.908830 0.965494 1.696902 0.262862 -0.278720 1.556094 1.066317 0.607464 0.614155 0.326720
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.460467 0.649609 0.973011 1.411525 -0.049445 0.887307 -0.346885 0.235238 0.605575 0.622417 0.332272
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.189387 -0.635126 0.052605 -0.969061 0.532744 -0.833650 0.101040 1.489575 0.595122 0.626295 0.336285
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.086025 0.367325 1.142809 0.957541 0.377085 0.685133 0.566731 0.347710 0.593000 0.616959 0.341324
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.467046 0.357385 10.394691 0.612023 3.925190 1.818505 0.620813 1.323565 0.043884 0.613467 0.401790
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.797351 12.351835 10.492004 11.081818 3.783586 4.145092 2.944808 2.766971 0.035978 0.025264 0.005629
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 10.469145 12.616826 10.594964 10.910096 3.838218 4.190144 1.256834 1.451644 0.025504 0.025867 0.001149
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.278277 0.936069 -1.074355 0.068536 1.464072 0.659969 -0.968275 -0.198368 0.428115 0.425808 0.179951
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.218987 21.284786 0.547208 -0.514172 -0.532332 0.408142 -2.136429 0.118043 0.563830 0.466341 0.329334
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.448730 2.229730 -1.206649 0.460276 -0.369447 -0.549648 -0.725352 10.215856 0.547982 0.537199 0.335842
101 N08 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
102 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.807864 0.530806 -1.079308 -0.725429 0.084424 0.656010 -1.079855 6.422456 0.600545 0.603852 0.341842
103 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.051918 4.135199 0.738218 -0.973674 13.439037 0.779006 1.419741 2.265896 0.593832 0.611598 0.336525
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.496413 50.510863 0.793482 7.284613 2.974460 -0.037781 2.072688 2.370235 0.607026 0.591287 0.332767
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.156507 0.866748 0.663631 1.529596 1.309645 0.805890 0.023738 0.321738 0.609903 0.617398 0.329347
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.800390 1.280378 0.513088 0.425423 2.418984 -0.094534 0.344449 0.345461 0.610371 0.624493 0.330766
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 1.179354 0.654776 0.019554 -0.422154 0.278892 0.357442 6.916855 5.451788 0.608357 0.625754 0.331212
108 N09 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.517416 36.051837 10.424326 1.555531 3.846207 1.973696 2.232660 2.246640 0.041519 0.307388 0.154762
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 9.253828 12.169931 10.469087 10.800689 3.903122 4.258815 0.818262 2.668908 0.072885 0.041412 0.020926
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 21.253016 0.198740 0.615163 0.113697 4.316700 0.322229 3.817707 -0.141076 0.513642 0.609917 0.329620
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% 23.516222 12.100783 1.540976 10.881480 1.700537 4.239580 23.309121 3.255470 0.483853 0.072236 0.324970
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% 0.004417 6.247717 1.909285 9.694398 2.121236 1.745592 1.126828 1.462140 0.248790 0.159553 -0.219939
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.228996 13.363596 5.277508 5.945533 3.763075 4.121306 2.288314 1.535508 0.038081 0.031434 0.004153
114 N11 not_connected 100.00% 100.00% 0.00% 0.00% 11.990923 0.597886 5.426229 -0.609202 3.743701 -0.658957 0.498250 -0.085727 0.053749 0.560136 0.417536
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.267659 -0.966614 -0.958642 -0.446787 -0.933071 -1.056570 0.037087 -1.100530 0.531438 0.550194 0.342621
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 22.854687 53.623875 20.176150 28.098041 3.796319 24.601456 342.088931 985.116757 0.017924 0.016196 0.001494
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 24.379690 27.628909 21.249292 21.682724 5.510527 6.370018 481.124066 371.035067 0.029204 0.034309 0.003810
120 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.137749 0.731281 2.982837 -0.522503 1.350007 1.438728 6.777183 3.237750 0.580794 0.598868 0.340824
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 1.335527 2.787189 -1.039298 6.221670 -0.151565 -0.005572 9.208293 25.527122 0.604087 0.585950 0.329544
122 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 210.693797 210.269937 inf inf 1599.213534 1611.402941 7579.747315 7685.370766 nan nan nan
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 5.703213 7.262694 1.234361 1.514327 1.089448 0.975174 -0.065066 0.985623 0.617498 0.624227 0.333405
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 9.603415 0.446056 10.646684 1.110963 3.757641 1.328844 0.954863 1.889633 0.050032 0.629039 0.421739
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.002732 1.244980 1.574995 1.572865 -0.000274 0.145378 0.470334 0.908069 0.611929 0.621689 0.334182
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.574830 0.544011 0.897709 1.359427 3.959112 1.679643 60.620817 0.257059 0.538628 0.623098 0.333694
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 9.089681 0.859087 10.386791 3.906192 3.910693 4.542450 0.876378 6.973823 0.038782 0.601736 0.383860
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 0.416820 -0.982336 -0.456423 -0.611933 -0.292431 -0.039582 0.649715 4.663561 0.599439 0.608681 0.353172
131 N11 not_connected 100.00% 0.00% 29.73% 0.00% -1.268118 11.952368 -0.607331 5.861186 -0.927659 3.504806 -1.109480 1.297488 0.562701 0.236302 0.390238
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.296818 -0.268177 -0.813570 -0.710769 -0.781272 0.073473 -0.990441 -0.300702 0.552616 0.553950 0.338446
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.337130 -1.400763 -0.736355 -0.980825 -0.558762 -1.174310 -0.447833 0.436852 0.539008 0.554933 0.346476
134 N11 not_connected 100.00% 100.00% 100.00% 0.00% 10.966686 13.716454 4.872139 5.395537 3.754991 4.130129 0.695593 1.546011 0.047431 0.038614 0.004913
135 N12 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
136 N12 digital_ok 100.00% 99.95% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.185073 0.162735 0.094085
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 35.826292 60.958792 26.903662 25.086137 15.581632 6.891115 950.640809 535.513061 0.016219 0.016373 0.000731
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.864307 -0.180089 0.519883 -1.125512 -0.107895 -0.944030 -1.653755 0.553313 0.573886 0.575521 0.332332
140 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.524016 -1.100256 -0.047441 -0.900417 1.652754 -0.614493 46.527120 9.226608 0.587057 0.606894 0.336693
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.333038 -0.851066 0.177172 -0.156762 0.942858 -0.664266 0.083535 -1.482912 0.603124 0.612786 0.333611
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.202800 12.155216 -0.272125 11.034112 1.510933 4.210051 23.308642 2.596279 0.609531 0.056518 0.487259
143 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.258305 11.959388 10.274725 11.005028 3.367243 4.194701 0.655590 2.411924 0.116801 0.034744 0.065720
144 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.037636 1.258520 -0.394990 3.996605 0.371127 5.814727 -0.637997 0.787419 0.618761 0.613241 0.336537
145 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.083632 1.399599 0.157080 0.659050 -0.148500 5.840828 0.056723 1.095576 0.615724 0.617827 0.336131
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.493860 -0.962338 -1.062391 -1.189440 -0.957143 -1.121056 -0.360143 -0.033739 0.584782 0.604394 0.336107
147 N15 digital_ok 100.00% 99.95% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.166737 0.374593 0.323022
148 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
149 N15 digital_ok 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.096701 0.242900 0.168074
150 N15 digital_ok 100.00% 99.89% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.383407 0.330066 0.089849
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 17.469380 -0.604634 -0.616038 1.251579 0.199671 0.436546 0.373924 9.826160 0.436748 0.533605 0.303406
155 N12 RF_maintenance 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.234023 0.326064 0.292082
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.209425 12.011682 8.308950 10.845495 0.461798 4.268546 3.136626 2.954477 0.411075 0.047406 0.309695
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.872418 0.331790 0.703800 1.144983 0.392753 1.528441 -0.038015 0.391008 0.551145 0.564601 0.347493
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% -0.541458 -0.579522 -1.128285 -1.044602 0.773303 0.688259 3.372775 16.243815 0.570875 0.575760 0.342472
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.311427 19.817461 -0.311526 -0.333919 -0.590984 0.934224 -0.066770 10.470866 0.547430 0.459881 0.308218
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.396333 -0.803119 0.247162 -0.229621 0.456768 1.539737 -0.473456 0.226687 0.590898 0.600284 0.337962
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.306799 26.755959 0.599587 0.423168 0.729072 -0.286367 -0.268583 0.549036 0.600059 0.493228 0.309936
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -1.062949 -1.315113 -0.368177 -1.223394 -0.190991 0.670573 3.564319 -0.502780 0.610256 0.621339 0.337634
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.632534 1.616242 0.506511 0.870052 0.504480 1.728037 -0.205822 1.434972 0.614789 0.624748 0.340010
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.456665 1.318636 1.679199 1.525660 6.203787 2.596371 1.492275 1.545219 0.606459 0.618559 0.329746
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 18.797227 0.235071 0.341337 -0.160080 1.311010 0.620225 5.797975 -0.085886 0.503333 0.622557 0.330668
166 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.374046 -0.335637 1.257549 -0.010947 0.476735 -0.969425 0.173636 -1.523402 0.603852 0.614459 0.330718
167 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
168 N15 digital_ok 100.00% 99.95% 100.00% 0.00% nan nan inf inf nan nan nan nan 0.060482 0.037124 -0.029722
169 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
170 N15 digital_ok 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.063690 0.238857 0.134099
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.302046 -1.568953 1.104025 -1.245130 -0.840100 -1.094874 0.201539 -0.277769 0.517652 0.558390 0.349182
173 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.657238 4.555742 2.781612 2.758176 3.232422 3.388967 -3.965827 -2.514323 0.514993 0.510813 0.334216
179 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.311847 -0.912095 0.298290 -0.184202 -0.641056 9.291206 -0.212480 4.313300 0.571649 0.582255 0.346028
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.139162 12.809243 -0.775793 11.144069 0.459195 4.149383 14.589018 3.179290 0.587912 0.064413 0.474801
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.539767 0.698403 1.573970 1.172220 0.026151 0.427362 0.068210 5.110952 0.594796 0.604249 0.343615
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.017253 11.934838 -0.961666 10.788465 5.282765 4.271480 5.954328 3.174514 0.607850 0.057623 0.447409
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.224163 1.389277 0.685351 1.296868 1.296611 1.215578 0.234254 0.521733 0.599364 0.610433 0.328240
184 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 18.895087 -0.244071 7.378760 -0.436781 4.274431 0.292063 3.691361 -0.179363 0.416267 0.620127 0.353623
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.019422 0.033503 -1.170200 0.161279 -0.389088 0.009895 -0.296129 0.687592 0.613602 0.618526 0.337293
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.016501 -1.019633 -0.172835 -0.890253 -0.873694 -0.684156 -1.425531 -0.987105 0.608261 0.616794 0.338740
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.751825 -0.795965 0.202258 -0.446471 6.627774 0.293450 6.025628 -0.719795 0.596829 0.606150 0.340678
189 N15 digital_ok 100.00% 99.95% 99.89% 0.00% nan nan inf inf nan nan nan nan 0.178620 0.308700 0.201836
190 N15 digital_ok 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.222007 0.405553 0.344236
191 N15 digital_ok 100.00% 99.95% 99.95% 0.00% nan nan inf inf nan nan nan nan 0.117434 0.189856 0.075322
192 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 2.012517 4.942947 1.640449 2.935985 0.790465 3.381093 -0.952538 -3.621520 0.541462 0.518496 0.339418
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 5.270954 4.205286 3.079651 2.670930 3.107018 3.175956 -4.119305 -3.526229 0.509333 0.514942 0.334601
200 N18 RF_maintenance 100.00% 100.00% 40.70% 0.00% 11.033073 33.181679 5.443687 0.157596 3.916483 1.071664 2.211777 4.678986 0.047420 0.232398 0.145970
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.247506 3.549577 1.696034 2.431942 1.181982 2.675253 -2.254122 -3.455162 0.572018 0.568305 0.332652
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.230211 0.040884 0.562777 -0.434907 0.129390 0.922149 -1.931718 56.669534 0.589297 0.584623 0.331482
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 9.849723 11.478186 1.814943 -0.733878 0.137084 0.359739 21.607844 1.552906 0.598858 0.612367 0.340035
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.304305 -0.828007 3.875237 -0.522383 0.748251 0.653292 3.017265 5.195245 0.442833 0.595066 0.381958
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.204059 3.801955 0.757915 3.249619 -0.017899 -0.008269 -0.036130 0.876217 0.544828 0.493515 0.325904
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.235261 0.673883 -1.193710 -0.016235 -0.896081 -0.502361 5.333152 0.022179 0.572026 0.568780 0.333435
208 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
209 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
210 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
211 N20 RF_ok 100.00% 0.00% 100.00% 0.00% 0.097644 12.595336 -0.771807 5.975889 -0.752803 4.144309 0.025538 1.922547 0.534769 0.045559 0.444615
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.198255 -1.134674 -0.277366 -1.080069 -0.960104 -0.325490 1.071675 -0.832042 0.578352 0.579542 0.336344
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -1.136128 -0.808716 -0.990850 -1.211335 3.292223 -0.901472 3.575388 -0.786825 0.574481 0.586794 0.336072
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.601171 -0.605213 -0.639592 -0.525318 -0.755451 -0.291996 3.012019 -1.240109 0.577729 0.591423 0.336576
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.159506 -1.209668 -0.462132 -1.197082 -0.942252 1.342742 0.067885 9.386657 0.570023 0.588276 0.336955
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.552375 4.457646 3.232098 2.828982 3.235415 3.203268 -4.186431 -3.381373 0.529540 0.557759 0.329823
225 N19 RF_ok 100.00% 0.00% 81.51% 0.00% -0.520354 12.028216 0.091790 5.743124 -1.065340 3.990342 -1.925447 2.418348 0.578074 0.161565 0.453011
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -1.104610 16.753257 -1.051862 -0.346770 -1.082621 1.240465 -1.198342 0.233174 0.567074 0.477209 0.325337
227 N20 RF_ok 100.00% 0.00% 0.00% 0.00% 2.158394 0.113761 2.521808 -0.166217 -0.758201 1.163449 15.275105 9.956564 0.479625 0.554692 0.357199
228 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.008504 -0.351657 0.105282 -0.798337 -0.549314 -0.361322 0.563324 0.706999 0.550351 0.545776 0.334263
229 N20 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.061840 0.265180 0.080871 0.472689 -0.624278 -0.144830 -2.004907 -2.164730 0.546704 0.550060 0.348960
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.887184 -0.823623 0.637776 -0.866433 0.010314 0.107232 1.247814 -0.421351 0.524247 0.560208 0.345164
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.114708 -0.693422 0.127426 -0.070124 -0.876519 -0.789532 -1.865576 -1.790776 0.570531 0.574741 0.345384
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.857177 -0.404831 -0.380352 -0.150645 -0.344229 -0.872785 -0.668076 2.838390 0.568847 0.575396 0.341643
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.460151 -0.312023 0.441969 -1.177539 2.393120 -0.737757 3.864572 2.017717 0.542088 0.575549 0.349016
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.436196 -1.101372 -0.826626 -0.497034 -1.148633 -0.958570 0.180181 -1.213279 0.570675 0.578487 0.350499
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 15.678830 0.558036 -0.405661 0.634636 0.428191 0.453203 -0.749870 -1.401410 0.436974 0.570595 0.339802
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 15.762232 -1.362709 0.152836 -0.774938 0.848048 0.099784 -0.210875 -0.249355 0.450568 0.560165 0.340422
244 N20 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.041597 -0.794090 -0.045256 -0.657046 -0.621302 -0.229377 2.399182 5.381636 0.531289 0.558740 0.341084
245 N20 RF_ok 0.00% 0.00% 0.00% 0.00% 0.014932 -0.221658 0.281384 -1.043530 -0.470108 -1.053145 -2.253224 0.290549 0.554515 0.551973 0.342576
246 N20 dish_maintenance 100.00% 0.00% 100.00% 0.00% -0.809856 13.122933 -1.182235 5.534523 -0.592143 4.235971 -0.914270 0.841040 0.537778 0.045064 0.446705
261 N20 RF_ok 0.00% 0.00% 0.00% 0.00% -0.435189 -0.553750 -0.326374 -0.753093 -0.864657 -1.023961 0.274825 -0.680905 0.543109 0.544497 0.340328
262 N20 dish_maintenance 100.00% 0.00% 0.00% 0.00% 9.985516 12.647944 0.458231 0.626092 0.972765 0.560657 -0.141865 1.909039 0.554216 0.554564 0.359543
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.686564 0.750414 1.402138 0.457552 0.535452 -0.289500 -2.533611 -0.399997 0.462923 0.469653 0.331448
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.379111 2.176486 0.416015 0.640027 -0.255166 0.291241 -0.946356 -1.755683 0.450022 0.452627 0.318863
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.655690 -1.081235 0.274134 -0.751690 -0.420369 -0.680927 -1.961908 0.303646 0.480347 0.474447 0.336071
329 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 1.446733 -0.145298 0.380462 -0.952022 1.464761 -0.908728 1.798426 0.364867 0.453970 0.457566 0.322438
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.004314 2.453981 -0.159097 -0.640093 -0.774961 -0.355797 1.208977 1.029181 0.432928 0.435211 0.305307
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, 15, 16, 17, 18, 20, 27, 28, 30, 31, 32, 34, 36, 37, 38, 40, 42, 45, 47, 51, 52, 53, 54, 55, 56, 58, 59, 60, 63, 64, 65, 66, 67, 68, 70, 71, 72, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 92, 93, 94, 96, 97, 101, 102, 103, 104, 107, 108, 109, 110, 111, 112, 113, 114, 117, 118, 120, 121, 122, 123, 124, 126, 127, 128, 131, 134, 135, 136, 137, 140, 142, 143, 144, 145, 147, 148, 149, 150, 151, 155, 156, 158, 159, 161, 164, 165, 167, 168, 169, 170, 173, 179, 180, 181, 182, 184, 187, 189, 190, 191, 192, 193, 200, 202, 204, 205, 207, 208, 209, 210, 211, 223, 224, 225, 226, 227, 242, 243, 244, 246, 262]

unflagged_ants: [8, 9, 10, 19, 21, 22, 29, 35, 41, 43, 44, 46, 48, 49, 50, 57, 61, 62, 69, 73, 74, 85, 88, 89, 90, 91, 95, 105, 106, 115, 125, 132, 133, 139, 141, 146, 157, 160, 162, 163, 166, 171, 183, 185, 186, 201, 206, 220, 221, 222, 228, 229, 237, 238, 239, 240, 241, 245, 261, 320, 324, 325, 329, 333]

golden_ants: [9, 10, 19, 21, 29, 41, 44, 69, 85, 88, 91, 105, 106, 141, 146, 157, 160, 162, 163, 166, 171, 183, 186]
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_2460024.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.3.dev133+g7c00d5f
In [ ]: