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 = "2460094"
data_path = "/mnt/sn1/2460094"
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: 5-29-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/2460094/zen.2460094.42108.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/2460094/zen.2460094.?????.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/2460094/zen.2460094.?????.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 2460094
Date 5-29-2023
LST Range 16.011 -- 17.952 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: 94
not_connected: 24
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 N01
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 79 / 198 (39.9%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 108 / 198 (54.5%)
Redcal Done? ❌
Never Flagged Antennas 88 / 198 (44.4%)
A Priori Good Antennas Flagged 52 / 94 total a priori good antennas:
5, 7, 15, 16, 17, 29, 30, 37, 38, 40, 42, 53,
54, 55, 62, 66, 70, 81, 83, 86, 93, 94, 109,
111, 112, 118, 121, 124, 127, 136, 147, 148,
149, 150, 151, 160, 161, 164, 165, 166, 167,
168, 169, 170, 182, 184, 187, 189, 190, 191,
193, 202
A Priori Bad Antennas Not Flagged 46 / 104 total a priori bad antennas:
8, 22, 35, 36, 43, 46, 48, 49, 50, 52, 57,
63, 64, 73, 74, 79, 80, 89, 95, 102, 113, 115,
120, 132, 133, 135, 139, 179, 185, 201, 206,
220, 221, 222, 223, 226, 237, 238, 239, 240,
241, 242, 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_2460094.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% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
5 N01 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.627210 -0.764592 -1.270783 -0.311061 -0.740487 -0.083578 1.653268 5.404785 0.596340 0.587393 0.422107
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.633022 2.713376 2.033061 2.034657 1.162291 1.041750 -0.623911 -0.939147 0.567967 0.559671 0.404980
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 2.795584 0.357210 3.962401 0.355690 2.307382 0.372319 3.350868 0.350738 0.600499 0.598370 0.413966
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.222606 -1.381516 -0.011035 -1.255241 -0.777206 -1.027379 -1.230452 -0.302074 0.588773 0.582788 0.411045
15 N01 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
16 N01 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
17 N01 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
18 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
19 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.067531 0.872356 -0.668481 0.687200 -0.408056 -0.061467 -0.213675 -1.441108 0.619994 0.604867 0.422465
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.469824 0.123733 0.403897 0.691903 0.448548 0.658287 0.533489 0.563925 0.623618 0.617767 0.413713
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.487032 -0.321333 -0.777371 -0.172392 -0.559353 0.154427 -0.269203 0.057300 0.613970 0.607051 0.411540
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.002283 -1.218094 1.020985 -0.645470 0.212200 -0.832456 0.906277 0.063014 0.579906 0.581631 0.416155
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
28 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
29 N01 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
30 N01 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
31 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.790709 0.835227 -0.113432 1.464665 0.322643 0.964891 0.382847 0.915733 0.638464 0.635845 0.420860
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 11.589045 1.122718 0.940039 -0.140694 -0.576616 0.939366 2.338880 4.383575 0.578286 0.613404 0.347114
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 5.985433 0.233848 11.890516 -0.111790 2.413551 -0.696704 3.540689 -1.105269 0.035577 0.595128 0.449933
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.504596 -1.278014 0.368426 -1.178164 -0.352711 -0.975395 -1.396449 -0.315004 0.589034 0.592600 0.415686
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.005835 1.356274 0.910911 0.380761 0.933977 0.406774 0.851613 0.620148 0.576285 0.564021 0.395810
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.245302 12.491073 -0.150459 23.756755 0.100776 2.305183 -0.031105 6.037176 0.598108 0.028300 0.478922
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.697894 0.129973 -0.594965 0.907910 -0.365264 0.687881 1.714320 6.448295 0.609792 0.603189 0.412047
40 N04 digital_ok 100.00% 0.00% 0.00% 100.00% 0.538919 -0.230227 0.792635 -0.418307 0.707210 -0.145102 18.319632 1.393541 0.220490 0.216156 -0.347022
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.669141 2.119461 -0.103249 2.399435 -0.025295 1.767541 -0.027231 1.448344 0.642517 0.641341 0.429005
42 N04 digital_ok 0.00% 0.00% 0.00% 100.00% -0.861299 -1.006325 -0.852176 -1.025353 -0.420196 -1.017316 0.256736 -0.286887 0.230791 0.222622 -0.349646
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.332306 0.202156 -1.228656 0.468456 -0.690695 0.435528 -0.835639 0.871545 0.654770 0.651734 0.423706
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.578384 -0.002034 -1.247476 0.137014 -0.827562 0.200182 -0.764700 0.072254 0.644773 0.652072 0.420597
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.413514 0.074113 0.633571 0.104764 0.723859 0.150711 0.514280 0.197633 0.651726 0.650860 0.426177
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.833385 -1.178498 -0.335321 -0.824389 -0.033758 -1.239281 0.321257 -0.930754 0.643889 0.641484 0.433035
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.369266 0.874715 -0.411913 0.587488 -0.852257 -0.150258 -1.206597 -1.537805 0.602546 0.597736 0.410088
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.563968 0.204898 0.430243 -0.079834 0.093866 -0.835288 0.497213 -1.327791 0.589599 0.585618 0.416746
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.425653 0.006258 0.027806 0.514845 0.349838 0.493697 0.141690 0.210259 0.581712 0.571316 0.401689
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 0.404234 0.021941 -0.415958 0.915103 -0.124038 0.634751 50.951065 0.882519 0.596898 0.596656 0.402176
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.474540 0.679840 0.122741 -0.221231 0.430556 -0.093858 2.321279 -0.081621 0.619862 0.607032 0.409843
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.371701 -0.624654 -0.292677 -0.432514 -0.442054 -0.103401 4.346442 5.621984 0.637161 0.629396 0.417441
54 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 4.152962 5.009817 -0.168707 2.006286 1.681726 1.936338 2.548068 1.712466 0.321305 0.371127 0.208349
55 N04 digital_ok 100.00% 27.98% 100.00% 0.00% -1.180740 21.209444 -0.705904 16.257953 -0.236269 2.435540 3.339729 2.895991 0.245663 0.036369 0.091455
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.076975 1.520107 -0.075947 1.119840 0.283806 1.215971 0.142378 0.965604 0.664797 0.661230 0.422435
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.152299 -0.222792 -0.147350 0.001734 -0.114948 0.275843 0.578931 0.900655 0.672537 0.668664 0.423047
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.241771 5.891483 19.019526 19.777563 2.394535 2.178920 3.815737 3.394760 0.035222 0.035700 0.002762
59 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.514169 0.578330 19.019368 0.594254 2.396766 0.370469 3.165396 0.821576 0.061344 0.663659 0.544939
60 N05 RF_maintenance 100.00% 0.00% 68.70% 0.00% -0.279982 5.620726 -0.117472 19.797914 -0.425031 2.053599 0.675200 4.840609 0.646816 0.162277 0.537122
61 N06 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
62 N06 digital_ok 100.00% 0.00% 100.00% 0.00% 0.573406 6.366150 1.964075 11.125009 0.056536 2.182980 1.422071 2.871118 0.598565 0.065485 0.501742
63 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.130744 3.696470 -0.512257 2.755625 -0.956014 1.646462 -1.085353 -0.745198 0.604987 0.564478 0.423209
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.698922 -1.033385 -0.931684 -0.395429 -1.191643 -0.550881 -0.935583 0.192037 0.595075 0.591726 0.412715
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.123098 -1.027798 0.140107 -1.108956 0.440098 -0.754578 0.176416 -0.264935 0.582832 0.572385 0.410075
66 N03 digital_ok 100.00% 35.73% 100.00% 0.00% -1.185505 11.643050 -1.055165 23.600188 -0.986021 2.222825 0.204458 8.192163 0.213370 0.045839 0.091608
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.234971 -0.167463 -1.149113 0.574696 -0.594439 0.628941 1.102386 0.830586 0.621329 0.614792 0.406482
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 13.326843 -1.254275 23.515633 -0.832714 2.554300 -0.005806 7.506780 -0.049869 0.029918 0.630609 0.520757
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.450675 -0.266823 0.564206 0.073847 0.728723 0.082735 1.823230 0.368284 0.656365 0.646674 0.412242
70 N04 digital_ok 0.00% 0.00% 0.00% 100.00% 0.457713 1.909202 0.960818 2.565587 0.731558 1.785569 2.285367 2.464357 0.266241 0.252086 -0.337166
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.810035 -0.107816 -0.939610 0.210478 -0.398154 0.412214 -0.570741 0.435731 0.674377 0.675076 0.414088
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.104830 -0.400104 -0.191468 -0.185958 0.112772 0.046585 0.055542 -0.239622 0.679893 0.684588 0.419132
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.362312 1.793487 -0.237138 1.890447 0.001994 1.992092 0.230875 2.471484 0.678748 0.681519 0.422438
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.005298 -1.650511 0.154791 -1.226325 -0.473290 -0.592936 -1.245459 -0.378724 0.659267 0.672992 0.429645
77 N06 not_connected 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 7.869211 1.075566 0.501972 0.726613 -0.192409 -0.108296 0.603379 -1.008559 0.527901 0.612788 0.379016
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.167416 -1.069634 0.422956 -1.124893 0.046910 -1.294429 0.575992 -0.841595 0.605904 0.610549 0.413225
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.141583 2.305284 -0.093360 1.779698 -0.656383 0.779442 -1.295980 -1.426129 0.592930 0.574599 0.417910
81 N07 digital_ok 100.00% 99.72% 99.72% 0.00% 82.363801 82.379662 inf inf 7.737542 3.935259 758.871287 421.788814 0.814836 0.884595 0.739584
82 N07 RF_maintenance 100.00% 99.17% 99.45% 0.00% 82.424725 82.334629 inf inf 7.614847 3.506129 830.705392 339.775901 0.388734 0.311061 0.343533
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 82.562712 82.364979 inf inf 38.542850 5.981549 1352.807696 486.108114 nan nan nan
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 1.546858 14.890110 1.237724 23.609825 0.368196 1.970719 -1.106547 6.653329 0.627274 0.051553 0.450295
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.293357 -0.877627 -0.021653 -1.240595 -0.737474 -0.975547 -0.751522 -0.259546 0.656656 0.654379 0.414265
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.764814 -0.727441 1.393112 -0.283982 1.355411 -0.154540 1.144348 8.226074 0.677777 0.673099 0.408763
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.856940 1.095785 4.053798 0.289013 0.971357 0.308055 6.556669 0.491824 0.654579 0.686279 0.379568
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.299004 0.932717 0.511206 1.777015 0.591203 1.392332 0.447180 1.049290 0.686528 0.685786 0.411520
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.052634 0.449086 0.539710 0.922421 0.705714 0.959225 0.374060 0.522313 0.690508 0.693251 0.426770
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.775970 2.007731 -0.208164 5.492647 -0.005844 3.970684 -0.089846 11.811007 0.679233 0.679829 0.421171
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.115656 0.034327 0.578927 0.475437 0.816257 0.553190 0.405932 0.191289 0.673445 0.676630 0.444546
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.414804 -0.488596 19.133300 -0.027693 2.454276 0.092725 5.844477 2.936069 0.032000 0.657833 0.486698
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 5.420415 5.934241 19.164631 19.890172 2.404276 2.182617 4.541016 4.077505 0.030045 0.028780 0.000899
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 5.700487 2.232949 19.390632 14.752214 2.418528 0.034274 4.242883 2.893604 0.029566 0.560191 0.410552
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.812350 0.067845 -0.732776 0.053750 -0.808036 -0.635549 -0.268236 -1.370337 0.607269 0.612816 0.414665
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.166572 7.605010 0.901287 -0.470518 0.231226 -0.615021 -1.257574 -0.081521 0.597365 0.540378 0.379025
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% -1.006926 1.415068 -0.878691 1.623258 -1.235769 0.575156 -0.859637 4.972649 0.590216 0.588719 0.411143
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.249788 1.615956 -0.393740 0.692294 0.009722 0.514751 -0.145987 0.556740 0.643588 0.636084 0.415822
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.841042 -0.533378 -0.843558 -0.821628 -1.159868 -0.441544 -1.104615 3.199103 0.657744 0.655061 0.412885
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.049337 0.482871 -0.353160 0.122921 -0.924563 0.357188 -1.014244 0.658406 0.669363 0.671750 0.403555
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.194202 27.796449 3.814015 9.643589 2.533383 3.493471 3.032867 3.087674 0.682706 0.669193 0.415787
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.961918 0.308946 -0.085082 1.165713 0.144201 0.777193 0.333394 0.665446 0.680235 0.685704 0.406765
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.310574 -0.896850 -0.001734 0.273505 0.416746 0.249703 0.321280 0.027231 0.688086 0.688118 0.417385
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.116675 0.180391 0.107767 -0.685340 0.195971 -0.580326 1.725357 0.562585 0.682109 0.681491 0.413119
108 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.951865 2.247088 1.554034 2.568015 1.328028 1.695249 5.370420 1.491419 0.672133 0.681666 0.429058
109 N10 digital_ok 100.00% 69.25% 100.00% 0.00% 5.199515 5.886474 19.186949 19.562536 2.337718 2.192604 3.467847 4.155025 0.147805 0.034435 0.106034
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.213605 -0.301744 0.769089 0.244374 -0.795147 0.165616 1.093231 0.250264 0.591393 0.657811 0.375684
111 N10 digital_ok 100.00% 31.30% 70.91% 29.09% 3.027963 5.957372 4.612690 19.449285 2.561855 1.920887 3.062753 4.223027 0.229471 0.070606 -0.141977
112 N10 digital_ok 100.00% 0.00% 0.00% 100.00% 0.015379 2.031881 0.406600 14.628410 0.365263 0.160702 1.377163 2.794833 0.221388 0.184669 -0.330270
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 3.509091 3.541738 2.624980 2.636012 1.671479 1.548212 -0.497126 -0.799855 0.579534 0.577946 0.405380
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 3.135855 1.673708 2.318855 5.622540 1.420962 0.614605 -0.667298 2.612682 0.562347 0.558704 0.385142
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.570066 -0.155606 -1.251287 -0.078103 -0.979779 -0.824495 -0.739340 -1.428106 0.573842 0.578132 0.405875
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 81.416152 76.972172 inf inf 4.388499 15.039977 391.959629 729.255458 nan nan nan
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 82.370190 82.494828 inf inf 3.973205 7.340099 331.097075 689.020657 nan nan nan
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.706349 -0.434257 2.788930 0.031574 1.771772 0.201859 2.478870 0.138824 0.656385 0.655761 0.416453
121 N08 digital_ok 100.00% 2.77% 0.00% 0.00% 2.276429 3.874710 1.747836 8.034965 0.894135 2.296812 0.640102 8.537330 0.548853 0.666146 0.431099
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.689993 0.657398 -0.784313 -1.007624 -0.524341 -1.093485 -0.465428 -1.040989 0.678619 0.676777 0.413736
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 3.168476 1.445864 2.401771 1.017132 1.483803 0.114010 -0.403809 -1.390551 0.656748 0.674444 0.418542
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 5.309204 -0.412299 19.381001 0.531914 2.396342 0.471522 3.289678 0.833484 0.040392 0.691547 0.495725
125 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.072847 0.128073 8.744621 0.842127 1.560058 0.729790 3.187578 0.462709 0.660398 0.686592 0.423336
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.822798 -0.226184 2.471774 0.645279 0.060630 0.753714 1.612292 0.358055 0.638032 0.685249 0.413065
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 5.245260 -0.201376 19.105251 0.066680 2.405341 0.152932 3.129359 0.195011 0.031728 0.667110 0.489506
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.349070 -0.475560 0.265813 -0.579535 0.652850 -0.278262 3.098494 2.742879 0.656609 0.662409 0.451142
131 N11 not_connected 100.00% 0.00% 26.87% 0.00% -0.361402 4.883792 -0.475042 11.612500 -0.803226 0.950522 -1.148252 1.913207 0.597550 0.350346 0.451200
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.562217 -1.352912 -0.554985 -1.240547 -0.977388 -0.930267 -1.206836 -0.848354 0.597221 0.602084 0.406148
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.391016 -0.695941 -1.232133 -0.700384 -1.096331 -1.221427 -0.781495 -1.117179 0.575893 0.579886 0.397465
134 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.498791 2.655449 3.510352 1.948938 0.617603 0.979706 5.777050 -1.239027 0.526630 0.531301 0.391527
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.119694 -1.178196 -0.838815 -0.979892 -0.951014 -1.204088 -0.429575 -0.561973 0.540053 0.542037 0.408704
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 5.139178 0.095734 18.722374 -0.408069 2.395290 -0.289345 3.549608 0.716890 0.033569 0.562880 0.417861
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 82.363179 88.064560 inf inf 3.914823 7.279519 475.453788 745.603394 nan nan nan
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.194514 -0.442839 0.719438 -1.215948 -0.001994 -1.263663 -1.210509 -0.560991 0.625720 0.622560 0.410095
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.639841 0.193668 0.680501 0.587620 0.588285 0.557341 0.970688 2.309865 0.664374 0.657603 0.408895
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.289535 -0.273321 0.242390 0.438275 0.199670 0.297963 0.303910 0.140967 0.674060 0.668374 0.411737
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.918678 5.896719 -1.217789 19.851347 -0.809189 2.161262 4.702987 4.056091 0.677336 0.038638 0.524178
143 N14 RF_maintenance 100.00% 69.25% 100.00% 0.00% 5.646552 5.822415 18.669612 19.822885 2.385202 2.184117 2.997129 3.666578 0.160324 0.031058 0.114520
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.302739 -0.880909 -1.110940 -0.465649 -0.793460 -1.104003 -0.683536 -0.634326 0.689199 0.680317 0.426306
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.075675 1.707079 -0.076779 1.959438 0.186587 1.502309 0.147288 1.640923 0.687287 0.678994 0.417280
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -1.202702 -0.923686 -1.261605 -0.954209 -1.152590 -1.308652 -0.732707 -0.663678 0.656213 0.662166 0.435888
147 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
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% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
150 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
151 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 4.762112 0.001113 -0.725042 0.956296 -0.279788 0.340193 -0.307069 4.701093 0.522993 0.598740 0.382572
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.182594 -1.044112 18.957367 -0.562492 2.400081 -0.290449 4.485872 -0.037620 0.032575 0.553034 0.422345
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.992442 5.964762 8.694385 19.653243 2.209559 2.186190 5.657448 4.114312 0.558840 0.035366 0.446894
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.140759 0.265998 0.184394 0.497082 0.330831 0.332525 0.437441 0.204192 0.587706 0.591656 0.417493
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.719450 -1.065556 -0.634801 -0.695207 -1.148897 -1.230813 0.198943 2.914604 0.609066 0.604845 0.418937
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.204435 6.715761 0.697268 1.065646 0.080387 -0.822671 0.388785 0.682123 0.615346 0.528451 0.391018
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 5.599609 -1.353390 19.048400 -1.110129 2.410140 -0.679778 3.318690 -0.728639 0.044751 0.649405 0.532172
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.034807 13.583740 -0.022085 0.810295 0.233604 -0.933324 0.137852 0.179879 0.667400 0.585989 0.372329
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.434994 -0.406222 -0.928107 -0.331184 -0.534184 -0.199239 -0.356278 -0.373465 0.673179 0.668408 0.413674
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.353089 0.247834 -0.116401 0.220906 0.229282 0.267493 0.401652 0.518812 0.679047 0.675312 0.419345
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 3.129541 0.508169 5.325215 0.775398 2.355433 0.471668 3.265777 1.205528 0.668924 0.670249 0.410698
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 7.127679 -0.065574 1.473436 -0.006480 -0.332115 0.052943 1.435614 0.219284 0.600498 0.672874 0.385139
166 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 5.498901 0.138598 19.330232 0.248234 2.406281 -0.417534 3.401742 -1.421972 0.031511 0.653338 0.486565
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% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
169 N15 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.998044 0.902328 0.239388
170 N15 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.993958 0.549088 0.307286
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.065925 -0.857651 1.122621 -0.038582 0.304363 -0.347585 0.733256 -0.105979 0.583650 0.594341 0.411437
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 0.366475 -0.781458 0.080111 -0.885043 -0.548006 -0.968353 -1.169003 -0.313659 0.568021 0.568913 0.398552
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 3.436693 3.520701 2.572498 2.592182 1.620371 1.512677 -0.569477 -0.825669 0.519418 0.515099 0.377461
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.546786 0.059319 1.284147 0.491364 1.071350 0.225777 1.072814 0.372317 0.621224 0.615033 0.429958
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.865462 6.167623 -1.090694 19.973500 -1.146440 2.167342 4.465291 4.336895 0.628123 0.051767 0.525259
181 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 1.578446 0.974280 1.599446 1.001411 1.215112 0.719297 1.172928 1.059437 0.649341 0.642987 0.422662
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.328306 6.000494 0.430685 19.540808 -0.296272 2.160467 -1.153198 4.601389 0.654763 0.045332 0.495469
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.887505 0.830319 -0.037155 1.006728 0.177555 0.709439 0.195596 0.773487 0.664010 0.658156 0.403806
184 N14 digital_ok 100.00% 25.48% 0.00% 0.00% 5.476430 -0.346272 17.934943 0.105439 1.483866 -0.015245 2.814625 -0.046602 0.359020 0.663200 0.461149
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.703293 0.052437 -0.412749 0.451953 -0.129972 0.455638 -0.213535 0.228806 0.665200 0.665433 0.414952
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.103450 -0.927957 0.155370 -0.725741 -0.490645 -1.194311 -1.316023 -1.248047 0.646517 0.651600 0.411532
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 1.836505 -1.460100 5.889651 -0.884840 4.016917 -0.688679 12.561127 -0.407908 0.646715 0.656078 0.433651
189 N15 digital_ok 100.00% 99.72% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.993530 0.969370 0.805601
190 N15 digital_ok 100.00% 100.00% 99.72% 0.00% nan nan inf inf nan nan nan nan 0.179540 0.355074 0.173282
191 N15 digital_ok 100.00% 99.72% 99.45% 0.00% nan nan inf inf nan nan nan nan 0.532164 0.711565 0.612294
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.788991 3.841982 2.191095 2.828468 2.145691 1.691662 0.076336 -0.522940 0.542775 0.525622 0.400059
193 N16 digital_ok 100.00% 0.00% 0.00% 0.00% 3.795797 3.391587 2.863369 2.525710 1.846664 1.450323 -0.384814 -0.907976 0.514714 0.515288 0.376709
200 N18 RF_maintenance 100.00% 100.00% 42.94% 0.00% 5.964676 -0.187866 11.696894 -0.931293 2.421558 -1.136142 3.996423 -0.100960 0.045223 0.201497 0.066355
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.063806 3.149283 1.543786 2.377334 0.754755 1.300911 -0.995572 -0.911033 0.619279 0.597768 0.420952
202 N18 digital_ok 100.00% 0.00% 0.00% 0.00% 0.768690 -0.419148 0.647403 -0.216668 -0.030174 -0.298367 -0.770219 12.361618 0.639729 0.637824 0.411425
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.586793 3.788149 2.029806 0.008637 1.350910 0.102102 12.853356 0.372684 0.650355 0.645802 0.409078
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.368363 -0.357368 6.628508 0.048034 -0.077786 -0.190064 5.014646 1.840191 0.580849 0.641693 0.421794
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 0.602530 0.656057 2.359905 2.425716 0.556726 1.014217 1.369931 1.674781 0.618282 0.615863 0.401915
207 N19 RF_ok 100.00% 100.00% 0.00% 0.00% 5.982125 -1.420741 11.216931 -1.265322 2.417954 -0.785182 2.903257 0.144366 0.044183 0.630069 0.538330
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% 100.00% 100.00% 0.00% 107.227654 107.245858 inf inf 499.394225 507.506103 7132.976032 7280.634480 nan nan nan
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.594185 -0.998307 -0.421936 -1.194154 -0.867644 -1.096595 -0.459259 -0.617528 0.627604 0.619755 0.417361
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.371994 -0.764897 0.116264 -0.960439 -0.452904 -1.192479 0.079920 -0.182754 0.628822 0.623154 0.412574
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.482220 0.002034 -0.588559 -0.275557 -1.020197 -0.940936 -0.064009 -1.359932 0.629831 0.622191 0.407746
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -1.254812 0.938003 -0.652426 2.193818 -0.770467 1.376622 -0.417385 2.387973 0.626158 0.611528 0.407188
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 4.004892 3.627608 3.034491 2.724488 1.995174 1.607327 -0.238995 -0.728614 0.579709 0.575260 0.397462
225 N19 RF_ok 100.00% 0.00% 53.74% 0.00% 0.685937 5.196333 0.546431 11.667622 -0.195888 1.599103 -1.388317 3.171616 0.613247 0.261525 0.527939
226 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.658398 3.700491 -0.702275 -0.529265 -1.123638 -0.186461 -1.069548 -0.859301 0.606477 0.548675 0.416573
227 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
228 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
229 N20 RF_maintenance 100.00% 99.45% 99.45% 0.00% nan nan inf inf nan nan nan nan 0.859586 0.881991 0.761172
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.358459 -1.236148 0.355012 -1.146095 -0.039538 -1.121879 0.344943 -1.056966 0.595857 0.592259 0.418216
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.722111 0.566003 0.496157 0.471362 -0.274763 -0.356237 -1.337643 -1.515312 0.610288 0.600441 0.420903
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.925419 0.338239 -0.836750 -0.013130 -1.209929 -0.658196 -1.063719 -1.203059 0.616345 0.601438 0.418616
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.236991 -0.714043 -1.245769 -0.907026 3.262165 -1.285024 3.121235 -0.328432 0.615834 0.607250 0.412696
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.523223 -0.351756 -0.431345 -0.249015 -0.953515 -0.889220 -0.994052 -1.425059 0.613758 0.601999 0.418968
242 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.618757 0.636507 -0.833952 0.313096 -0.183588 -0.455205 -0.317328 -1.482846 0.530691 0.590225 0.396925
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.785404 -1.318835 0.759902 -1.247134 0.400369 -1.027197 6.791323 -0.585449 0.567605 0.586088 0.418908
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% 112.989782 112.966582 inf inf 438.777535 448.999520 5535.244995 5808.847301 nan nan nan
245 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
246 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
261 N20 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
262 N20 dish_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
320 N03 dish_maintenance 0.00% 0.00% 0.00% 0.00% -0.457160 -0.392155 -1.072176 -0.889387 -1.123470 -1.169264 0.837830 0.441447 0.444936 0.374231 0.304153
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.585388 1.782693 0.730355 0.823133 0.164394 0.133114 -1.266499 -1.566004 0.422744 0.377040 0.298200
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.916272 -1.412287 0.567024 -0.819744 -0.114214 1.401670 -1.501178 2.729048 0.479234 0.436590 0.337482
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 5.895712 6.054135 11.448905 12.381576 2.406607 2.174595 3.117606 2.641256 0.036194 0.036058 0.002269
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.021523 -0.270127 -0.033067 -1.220792 -0.105834 -1.031981 1.969488 0.342863 0.392268 0.351404 0.282854
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, 5, 7, 15, 16, 17, 18, 27, 28, 29, 30, 32, 34, 37, 38, 40, 42, 47, 51, 53, 54, 55, 58, 59, 60, 61, 62, 66, 68, 70, 77, 78, 81, 82, 83, 84, 86, 87, 90, 92, 93, 94, 96, 97, 104, 108, 109, 110, 111, 112, 114, 117, 118, 121, 124, 125, 126, 127, 131, 134, 136, 137, 142, 143, 147, 148, 149, 150, 151, 155, 156, 159, 160, 161, 164, 165, 166, 167, 168, 169, 170, 180, 182, 184, 187, 189, 190, 191, 193, 200, 202, 204, 205, 207, 208, 209, 210, 211, 224, 225, 227, 228, 229, 243, 244, 245, 246, 261, 262, 329]

unflagged_ants: [8, 9, 10, 19, 20, 21, 22, 31, 35, 36, 41, 43, 44, 45, 46, 48, 49, 50, 52, 56, 57, 63, 64, 65, 67, 69, 71, 72, 73, 74, 79, 80, 85, 88, 89, 91, 95, 101, 102, 103, 105, 106, 107, 113, 115, 120, 122, 123, 128, 132, 133, 135, 139, 140, 141, 144, 145, 146, 157, 158, 162, 163, 171, 172, 173, 179, 181, 183, 185, 186, 192, 201, 206, 220, 221, 222, 223, 226, 237, 238, 239, 240, 241, 242, 320, 324, 325, 333]

golden_ants: [9, 10, 19, 20, 21, 31, 41, 44, 45, 56, 65, 67, 69, 71, 72, 85, 88, 91, 101, 103, 105, 106, 107, 122, 123, 128, 140, 141, 144, 145, 146, 157, 158, 162, 163, 171, 172, 173, 181, 183, 186, 192]
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_2460094.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 [ ]: