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 = "2459884"
data_path = "/mnt/sn1/2459884"
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: 10-31-2022
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/2459884/zen.2459884.25262.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/2459884/zen.2459884.?????.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/2459884/zen.2459884.?????.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 2459884
Date 10-31-2022
LST Range 22.158 -- 8.115 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1850
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 7
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 96
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 201 (0.0%)
Antennas in Commanded State (observed) 0 / 201 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 18
Nodes Registering 0s N20
Nodes Not Correlating
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 76 / 201 (37.8%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 144 / 201 (71.6%)
Redcal Done? ❌
Never Flagged Antennas 57 / 201 (28.4%)
A Priori Good Antennas Flagged 60 / 96 total a priori good antennas:
3, 7, 15, 17, 19, 21, 31, 37, 38, 44, 45, 51,
53, 54, 55, 56, 59, 68, 71, 72, 81, 84, 86,
88, 91, 98, 101, 103, 105, 107, 108, 109, 111,
117, 121, 122, 123, 129, 130, 136, 140, 141,
142, 143, 146, 147, 158, 161, 164, 165, 169,
170, 181, 183, 184, 185, 186, 187, 190, 191
A Priori Bad Antennas Not Flagged 21 / 105 total a priori bad antennas:
4, 8, 48, 49, 62, 64, 79, 82, 89, 125, 137,
168, 205, 207, 221, 237, 238, 239, 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_2459884.csv

Build DataFrame¶

In [20]:
# build dataframe
to_show = {'Ant': [f'<a href="{ant_to_report_url(ant)}" target="_blank">{ant}</a>' for ant in ants],
           'Node': [f'N{nodes[ant]:02}' for ant in ants], 
           'A Priori Status': [a_priori_statuses[ant] for ant in ants]}
           #'Worst Metric': worst_metrics, 'Worst Modified Z-Score': worst_zs}
df = pd.DataFrame(to_show)

# create bar chart columns for flagging percentages:
bar_cols = {}
if use_auto_metrics:
    bar_cols['Auto Metrics Flags'] = [float(ant in auto_ex_ants) for ant in ants]
if use_ant_metrics:
    if np.sum(list(a_priori_flag_frac.values())) > 0:  # only include this col if there are any a priori flags
        bar_cols['A Priori Flag Fraction in Ant Metrics'] = [a_priori_flag_frac[ant] for ant in ants]
    for ap in antpols:
        bar_cols[f'Dead Fraction in Ant Metrics ({ap})'] = [dead_ant_frac[ap][ant] for ant in ants]
    bar_cols['Crossed Fraction in Ant Metrics'] = [crossed_ant_frac[ant] for ant in ants]
if use_redcal:
    bar_cols['Flag Fraction Before Redcal'] = [redcal_prior_flag_frac[ant] for ant in ants]
    bar_cols['Flagged By Redcal chi^2 Fraction'] = [redcal_flagged_frac[ant] for ant in ants]  
for col in bar_cols:
    df[col] = bar_cols[col]

# add auto_metrics
if use_auto_metrics:
    for label, modz in all_modzs.items():
        df[label] = modz
z_score_cols = [col for col in df.columns if 'Modified Z-Score' in col]        
        
# add ant_metrics
ant_metrics_cols = {}
if use_ant_metrics:
    for ap in antpols:
        ant_metrics_cols[f'Average Dead Ant Metric ({ap})'] = [average_dead_metrics[ap][ant] for ant in ants]
    ant_metrics_cols['Average Crossed Ant Metric'] = [average_crossed_metrics[ant] for ant in ants]
    for col in ant_metrics_cols:
        df[col] = ant_metrics_cols[col]   

# add redcal chisq
redcal_cols = []
if use_redcal:
    for ap in antpols:
        col_title = f'Median chi^2 Per Antenna ({ap})'
        df[col_title] = [cspa[ant, ap] for ant in ants]
        redcal_cols.append(col_title)

# sort by node number and then by antenna number within nodes
df.sort_values(['Node', 'Ant'], ascending=True)

# style dataframe
table = df.style.hide_index()\
          .applymap(lambda val: f'background-color: {status_colors[val]}' if val in status_colors else '', subset=['A Priori Status']) \
          .background_gradient(cmap='viridis', vmax=mean_round_modz_cut * 3, vmin=0, axis=None, subset=z_score_cols) \
          .background_gradient(cmap='bwr_r', vmin=dead_cut-.25, vmax=dead_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .background_gradient(cmap='bwr_r', vmin=crossed_cut-.25, vmax=crossed_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .background_gradient(cmap='plasma', vmax=4, vmin=1, axis=None, subset=redcal_cols) \
          .applymap(lambda val: 'font-weight: bold' if val < dead_cut else '', subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val < crossed_cut else '', subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .applymap(lambda val: 'color: red' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .bar(subset=list(bar_cols.keys()), vmin=0, vmax=1) \
          .format({col: '{:,.4f}'.format for col in z_score_cols}) \
          .format({col: '{:,.4f}'.format for col in ant_metrics_cols}) \
          .format({col: '{:,.2%}'.format for col in bar_cols}) \
          .applymap(lambda val: 'font-weight: bold', subset=['Ant']) \
          .set_table_styles([dict(selector="th",props=[('max-width', f'70pt')])])

Table 2: RTP Per-Antenna Metrics Summary Table¶

This admittedly very busy table incorporates summary information about all antennas in the array. Its columns depend on what information is available when the notebook is run (i.e. whether auto_metrics, ant_metrics, and/or redcal is done). These can be divided into 5 sections:

Basic Antenna Info: antenna number, node, and its a priori status.

Flag Fractions: Fraction of the night that an antenna was flagged for various reasons. Note that auto_metrics flags antennas for the whole night, so it'll be 0% or 100%.

auto_metrics Details: If auto_metrics is included, this section shows the modified Z-score signifying how much of an outlier each antenna and polarization is in each of four categories: bandpass shape, overall power, temporal variability, and temporal discontinuities. Bold red text indicates that this is a reason for flagging the antenna. It is reproduced from the auto_metrics_inspect.ipynb nightly notebook, so check that out for more details on the precise metrics.

ant_metrics Details: If ant_metrics is included, this section shows the average correlation-based metrics for antennas over the whole night. Low "dead ant" metrics (nominally below 0.4) indicate antennas not correlating with the rest of the array. Negative "crossed ant" metrics indicate antennas that show stronger correlations in their cross-pols than their same-pols, indicating that the two polarizations are probably swapped. Bold text indicates that the average is below the threshold for flagging.

redcal chi^2 Details: If redcal is included, this shows the median chi^2 per antenna. This would be 1 in an ideal array. Antennas are thrown out when they they are outliers in their median chi^2, usually greater than 4-sigma outliers in modified Z-score.

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 100.00% 100.00% 0.00% 0.00% 10.262653 -0.699996 11.579230 0.082355 7.928766 0.332268 0.714643 1.521050 0.032242 0.670601 0.545369
4 N01 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.339623 2.408546 0.456655 0.001448 -0.390131 1.552346 2.746069 0.106241 0.683013 0.668905 0.401378
5 N01 digital_ok 0.00% 0.00% 0.00% 0.00% 0.150864 -0.100571 -0.414111 -0.750902 -0.184502 0.392836 2.785549 -0.380192 0.686958 0.673043 0.397012
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.900948 -0.836927 0.003613 -0.392403 -0.079946 2.371880 6.830528 10.629103 0.679379 0.672468 0.394819
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.062851 -1.220034 -0.688185 -0.358868 -0.381460 -0.037948 3.844695 0.737258 0.668959 0.662188 0.385477
9 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.237506 -0.853335 0.028537 0.307092 0.281857 0.962071 -0.068834 0.973283 0.670490 0.664579 0.396211
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 3.819889 -0.983134 -1.777510 -1.587588 -0.072033 0.319158 -0.254199 -0.690032 0.660516 0.661807 0.402077
15 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.631935 -0.247757 0.257862 -0.136971 0.078514 0.410946 8.826754 8.556019 0.683187 0.677796 0.396248
16 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.086229 -1.401084 -0.635068 -0.001448 -0.474856 0.029429 3.009651 2.977671 0.685216 0.678873 0.392046
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% -0.703057 0.135895 -0.181136 -0.381231 1.881013 0.743999 14.157446 4.237726 0.687222 0.682112 0.391203
18 N01 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.933826 9.622167 0.139915 -0.086363 1.330984 1.615835 16.284899 23.619792 0.664687 0.457190 0.476337
19 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.026425 -1.630656 0.289993 1.867207 -0.334278 0.780078 4.542201 1.459932 0.675809 0.673004 0.390706
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -1.403057 1.670931 -0.588220 -0.490185 1.257600 -2.046719 3.064976 -1.290120 0.681864 0.669071 0.391926
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 0.132820 0.472877 -0.495012 1.352815 0.177926 -0.209000 0.327388 24.042806 0.667187 0.656144 0.393525
22 N06 not_connected 100.00% 0.00% 0.00% 0.00% 32.056590 8.807109 -0.855205 -0.627625 6.960682 2.638075 15.050712 3.882994 0.453623 0.610093 0.322789
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.302135 11.372805 11.617892 12.046579 7.936628 9.828826 2.432357 1.618538 0.031956 0.036130 0.004683
28 N01 RF_maintenance 100.00% 0.00% 86.27% 0.00% 13.286732 27.380493 1.341731 0.763481 6.080542 10.965009 4.171922 14.652801 0.356368 0.155963 0.261547
29 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -1.369830 -0.036685 -0.450996 0.209142 0.004178 0.359638 -0.453007 2.614684 0.690419 0.679740 0.387744
30 N01 digital_ok 0.00% 0.00% 0.00% 0.00% -0.765981 -1.093978 -1.276554 -0.002008 -0.241023 -0.444470 0.485772 0.200826 0.690738 0.685182 0.386863
31 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -0.177481 0.364689 0.175095 0.223400 1.085260 3.051411 2.769820 4.895320 0.696798 0.680697 0.393706
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.235266 23.854867 0.332242 -0.434851 -0.768814 4.543396 1.981354 30.831295 0.647574 0.593858 0.342684
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 11.996512 1.163548 4.940704 -0.031014 7.917632 3.195564 0.704878 -1.169716 0.040655 0.653746 0.492587
35 N06 not_connected 100.00% 0.00% 0.00% 0.00% 4.444426 -0.063887 4.709306 -1.575739 4.224971 -2.338288 -3.017966 0.656171 0.647238 0.634894 0.398507
36 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 8.873059 8.155867 -0.183563 -0.084809 1.395180 1.610202 0.345126 2.015938 0.684993 0.678337 0.394639
37 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.245121 0.318664 -0.266426 0.280878 0.485780 1.207736 -0.441812 8.216100 0.691395 0.686422 0.398855
38 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.082466 0.265273 -0.170991 0.085808 0.993111 2.371578 5.180467 1.568065 0.695370 0.691893 0.398123
40 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.158865 0.293220 -0.258325 0.036986 0.274315 0.903686 -0.642722 -0.033852 0.689510 0.683497 0.389143
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.025305 -0.100061 -1.093662 -0.582735 -0.344596 -0.021805 -0.479185 0.768605 0.694280 0.683290 0.378471
42 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.299344 0.962445 -0.259997 0.572897 0.169281 0.839972 0.370614 -0.119306 0.702017 0.692975 0.392519
43 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.597981 2.533714 11.490981 -0.158337 7.969674 0.192162 1.858045 2.410975 0.038619 0.687478 0.482855
44 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 0.528458 2.041845 0.017792 -0.268184 0.894397 0.658755 25.441376 22.262178 0.681096 0.682526 0.374718
45 N05 digital_ok 100.00% 0.00% 0.00% 0.00% -0.726138 2.116911 -0.132906 0.030195 0.670397 0.751704 -0.152536 15.269173 0.686837 0.668713 0.385326
46 N05 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.858574 11.866063 -0.484507 12.093038 -0.370695 9.832012 2.784935 2.425472 0.679160 0.035665 0.497775
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 254.752835 254.604381 inf inf 5837.583038 5824.293283 5526.437743 5455.804965 nan nan nan
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.584627 1.001783 1.297242 1.922076 -0.478838 -0.840328 -0.825629 -2.244451 0.653945 0.661485 0.403286
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.220582 0.639796 -1.264072 1.726949 -1.124210 -0.892136 -0.007574 -0.974530 0.626850 0.647582 0.397582
50 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.697935 9.749336 -0.163153 0.633056 2.096339 9.803585 18.425439 96.297753 0.676140 0.633320 0.373147
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 24.402414 1.049818 14.918903 -0.454416 7.942806 0.844458 9.160964 9.679660 0.037390 0.690203 0.539525
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 7.629693 6.717918 -0.486075 -0.008399 2.497071 0.955296 0.714210 0.543833 0.698586 0.695511 0.386536
53 N03 digital_ok 100.00% 0.00% 0.00% 0.00% 0.387067 2.808730 -0.578746 -0.521985 1.186350 0.387746 3.015846 5.386026 0.701776 0.699155 0.390191
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 10.332526 12.097046 11.620551 12.322653 7.943119 9.829766 1.830824 0.806572 0.043267 0.042980 0.001252
55 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 0.743009 12.805399 0.350548 12.212049 2.544122 9.792998 3.980660 2.497920 0.690044 0.033330 0.505895
56 N04 digital_ok 100.00% 0.00% 100.00% 0.00% 1.022635 12.885908 0.092153 12.452174 0.371260 9.856924 1.370521 0.610712 0.697257 0.035702 0.522949
57 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 34.107052 0.585463 4.507854 0.123229 3.134408 1.358479 1.802020 1.365149 0.527424 0.693852 0.376650
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.874423 11.919185 11.562718 12.267676 7.972806 9.906714 2.840301 2.282815 0.035358 0.032941 0.001848
59 N05 digital_ok 100.00% 0.00% 0.00% 0.00% 11.772312 4.206682 -0.859407 0.895680 5.388664 -0.193632 123.989544 20.782454 0.650833 0.676843 0.377435
60 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.792023 11.675854 11.596526 12.242548 7.961793 9.862667 1.967675 2.656350 0.027405 0.026915 0.001404
61 N06 not_connected 100.00% 100.00% 100.00% 0.00% 213.517125 212.887476 inf inf 7007.873122 6727.728418 8106.085125 7637.647785 nan nan nan
62 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.053459 1.348863 0.346782 1.633284 -1.121684 0.011697 0.561410 -1.916483 0.658581 0.665168 0.391378
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 7.370271 12.042461 0.256425 5.288830 0.384417 9.876914 0.363179 3.117112 0.604064 0.041228 0.445364
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% 0.671974 -0.010777 -1.202525 0.641741 -1.488867 -2.020770 0.514347 -1.455229 0.612851 0.632143 0.394605
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.586718 0.998717 0.167201 0.534207 1.634260 1.996122 -0.121005 0.034718 0.678089 0.685730 0.399437
66 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.043941 1.564215 2.150845 1.733785 1.528493 1.462587 -0.192080 1.642629 0.683579 0.688703 0.391284
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -1.053177 -0.761070 1.342667 0.932357 0.683340 0.770781 0.508249 2.228423 0.689216 0.692542 0.383457
68 N03 digital_ok 100.00% 0.00% 100.00% 0.00% 2.147703 27.304622 0.274196 16.232220 0.500221 9.346938 1.284223 9.392936 0.692768 0.029827 0.533767
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.056948 -0.772441 0.006066 0.140111 0.659756 1.574264 0.023916 0.184296 0.697064 0.699967 0.379385
70 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.341511 -0.451203 -0.885574 -0.716426 0.902365 -0.115974 0.518445 2.560129 0.704096 0.704064 0.379223
71 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 6.950963 -0.444525 0.470088 0.709745 1.353824 0.897870 1.693121 1.590506 0.711272 0.701776 0.376378
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 3.103241 -0.078812 0.357914 0.655623 0.544126 1.112749 6.692542 0.758422 0.691823 0.694027 0.371845
73 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.445395 10.865153 11.419932 11.900114 7.945950 9.814532 2.860244 0.710251 0.026975 0.027244 0.001231
74 N05 RF_maintenance 100.00% 100.00% 0.43% 0.00% 10.671982 9.585457 11.932867 11.815730 8.037233 7.659448 2.044497 24.279991 0.029870 0.319177 0.209881
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% 32.208300 -0.846898 -0.292314 0.061548 3.341897 -2.345048 0.975099 0.040764 0.470174 0.645693 0.368687
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.985832 2.547526 3.584384 3.479950 2.441919 2.746770 -2.280111 -2.905021 0.652531 0.660009 0.397849
80 N11 not_connected 100.00% 0.00% 100.00% 0.00% 9.103040 13.249204 3.072256 5.140081 6.220163 9.842228 9.624256 0.742396 0.298601 0.037859 0.198371
81 N07 digital_ok 100.00% 0.00% 0.00% 0.00% -0.318559 0.626997 -0.596577 6.268358 -0.360705 20.297688 -0.385775 0.374331 0.656521 0.595051 0.392460
82 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.827372 0.007193 -0.204732 1.730209 -0.004178 -1.756548 -0.480885 -0.703184 0.671278 0.673676 0.384756
83 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.475179 -0.288258 -0.478670 -0.299509 -0.992055 -0.702552 -0.608506 0.660382 0.683818 0.688015 0.380177
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 2.141972 23.989990 5.262483 15.705456 0.426465 9.369426 13.714291 4.600718 0.667507 0.034241 0.444800
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.139348 0.172234 -0.132934 0.130491 -1.020963 -0.729058 -0.761254 -0.591416 0.692689 0.692054 0.378505
86 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.004377 4.474978 1.983480 0.008620 4.270899 -1.695545 1.143131 15.460303 0.682412 0.668071 0.365954
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.622524 7.564465 1.063438 -0.358494 22.853771 0.509917 5.510706 1.197786 0.625521 0.711301 0.348381
88 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 0.653396 0.395108 -0.000586 0.491182 -1.090338 1.769767 9.678530 3.278736 0.694905 0.693896 0.368603
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.971762 0.451319 -0.287045 0.342756 0.468574 0.613261 -0.783116 -0.688599 0.699151 0.694222 0.379114
90 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.131342 -0.698120 -0.110129 0.624810 -0.873137 -0.912108 0.673521 4.030855 0.691742 0.687362 0.378595
91 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 211.606525 210.305463 inf inf 6561.871390 6698.387766 7343.315007 7655.507666 nan nan nan
92 N10 RF_maintenance 100.00% 2.38% 30.49% 0.00% 38.129795 44.105832 0.251707 0.632366 6.654382 8.930860 0.357535 4.485323 0.273594 0.231204 0.090040
93 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 1.647806 0.128682 2.139829 -0.244634 1.120733 -0.123302 3.371269 -0.535697 0.667754 0.683521 0.398863
94 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -1.037051 -0.684360 0.727279 0.465939 1.448786 1.742554 3.342131 1.909978 0.667503 0.669418 0.397100
95 N11 not_connected 100.00% 0.00% 0.00% 0.00% 2.280674 3.937696 3.634070 4.624247 2.633001 5.211318 -1.735213 -2.526394 0.655636 0.654836 0.399676
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.481932 12.862059 4.710346 5.348999 7.949514 9.933694 0.924988 0.405680 0.032885 0.039147 0.004320
97 N11 not_connected 100.00% 0.00% 0.00% 0.00% 3.374789 2.814690 4.351871 -0.970557 3.722941 -1.416520 -3.080625 11.155568 0.636127 0.615786 0.399476
98 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 1.318440 5.519026 -0.486858 -0.301557 -0.192995 0.269820 1.226698 2.732564 0.654801 0.656971 0.383898
99 N07 digital_ok 0.00% 0.00% 0.00% 0.00% 0.820499 -0.755487 0.028617 0.296894 -1.236081 2.657041 0.812323 -0.711978 0.659937 0.672782 0.386010
100 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -1.237782 -1.143643 -0.222202 0.692305 -0.118605 -0.180035 0.144150 -0.394585 0.675546 0.679969 0.380781
101 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 7.645013 9.246887 -1.019472 0.578302 0.331043 0.514582 -0.008710 -0.084244 0.697460 0.698071 0.376854
102 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.570716 12.028918 11.092281 11.612337 7.946325 9.906161 0.626631 4.018257 0.036626 0.038714 0.003153
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 23.397273 24.521253 13.322566 13.919222 8.089622 9.982016 9.164264 7.758958 0.025595 0.028562 0.003046
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.761569 59.666291 7.667780 8.209497 1.460625 4.572309 0.591918 5.326023 0.650129 0.672526 0.372878
105 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.298497 0.612484 1.006191 0.717715 1.805187 1.168419 -0.093400 0.377999 0.689911 0.691490 0.369777
107 N09 digital_ok 100.00% 0.00% 0.00% 0.00% 3.393921 4.155479 -0.035548 -0.547283 0.504463 1.232924 6.924414 8.131401 0.692190 0.687048 0.362286
108 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
109 N10 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
111 N10 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -1.027485 -0.670372 -0.329864 -0.665867 0.644210 -0.185982 0.236089 -0.457288 0.667095 0.677193 0.406258
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 12.317669 12.885468 4.450692 5.222909 7.956690 9.915553 1.526880 0.648268 0.037127 0.031207 0.003632
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 7.362672 3.854452 2.319198 3.912474 2.176820 4.069985 0.593743 -2.861842 0.489528 0.644363 0.433538
115 N11 not_connected 100.00% 0.00% 0.00% 0.00% 1.913589 6.501066 3.105890 2.391894 1.474580 2.747460 -2.372074 -0.999781 0.635952 0.594836 0.401594
116 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -1.142636 0.286942 -0.597176 0.085418 0.271334 -0.729085 -0.136200 -0.550111 0.649156 0.658680 0.389145
117 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 11.276035 13.308502 11.659939 12.615843 7.965048 9.869477 1.225372 3.319598 0.027378 0.030243 0.001701
118 N07 digital_ok 0.00% 0.00% 0.00% 0.00% -0.643933 0.988020 -0.532705 0.398212 1.121805 2.157199 0.804401 2.168283 0.676588 0.686115 0.382980
119 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.569707 1.961604 -1.383702 4.709892 -0.694830 4.839823 0.834716 2.759396 0.689177 0.649434 0.385458
120 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 25.897015 23.511843 15.517446 15.633887 7.981396 9.722843 11.555474 8.518360 0.023331 0.027737 0.003336
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 2.449654 4.745020 -0.538591 -0.345078 0.449756 1.378737 33.066683 17.035139 0.700501 0.704035 0.377162
122 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 8.119110 7.221250 0.438338 0.230413 2.799023 0.240601 3.900861 -0.744736 0.710279 0.707090 0.377951
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 6.255370 8.996735 0.157095 0.590927 -0.168845 1.102291 -0.413876 0.277259 0.711115 0.708413 0.375375
124 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.678856 0.088633 -0.532749 0.138986 0.495484 -0.441369 0.424666 0.251322 0.708534 0.703486 0.375954
125 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.518511 0.239469 -0.499725 0.332719 -0.372469 1.034982 -0.243611 -0.053475 0.692730 0.690750 0.373451
126 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.776255 4.223832 -1.308984 1.018631 4.181795 -0.825660 8.683944 0.173477 0.696339 0.686204 0.383972
127 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.007193 -0.459385 -0.364341 -0.328330 0.615707 0.292151 0.115813 3.457796 0.691317 0.695274 0.396909
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -1.038988 -0.576939 1.548959 0.629199 0.393901 -0.157376 -0.493870 -0.522947 0.677796 0.687118 0.397186
129 N10 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
130 N10 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 11.340479 12.965556 4.758826 5.507901 7.944354 9.805018 2.433684 -0.492780 0.033022 0.037338 0.001766
132 N11 not_connected 100.00% 0.00% 0.00% 0.00% 3.157499 -0.511755 4.242979 1.983823 3.666188 0.267127 -2.578594 -1.893150 0.638100 0.653565 0.410874
133 N11 not_connected 100.00% 100.00% 83.62% 0.00% 11.811576 17.157434 4.458801 3.667153 7.940384 9.340932 1.357049 0.433877 0.039508 0.168161 0.094140
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -1.296703 11.760405 -0.130810 12.300714 0.141528 9.892960 -0.123007 1.016052 0.647144 0.036640 0.473775
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 2.529990 0.108367 0.251386 0.839988 1.212305 5.097687 -0.234656 -0.127318 0.637424 0.658227 0.389434
137 N07 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.076987 -0.935452 -0.683114 -0.052041 0.388672 2.060746 1.184937 0.951853 0.657733 0.668035 0.390530
138 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.857034 -0.392509 0.628919 1.428692 0.090684 0.409503 4.517856 0.029628 0.678403 0.683441 0.392244
139 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.441880 1.674202 4.918153 3.414487 4.279715 2.331525 -3.155565 -2.022963 0.672342 0.685038 0.388194
140 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 3.602801 12.565556 4.327934 12.137393 2.967549 9.729007 -0.566995 2.302108 0.680307 0.050091 0.554681
141 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -1.421380 4.236920 -1.085595 4.822980 0.205212 5.555240 0.699155 -3.298091 0.696471 0.682095 0.375300
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 0.638896 11.653806 0.048498 12.229354 2.517349 9.837113 0.238232 1.476987 0.695082 0.044990 0.553156
143 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 10.503798 -0.586570 11.733027 -0.188503 7.972348 0.545500 0.042556 -0.748499 0.036379 0.705404 0.550780
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.814736 -0.275661 -0.628617 2.151091 0.915285 -1.076751 -0.565587 1.385143 0.702661 0.693027 0.382290
145 N14 RF_maintenance 100.00% 0.00% 0.00% 0.00% -1.289077 2.636058 -0.429180 8.585463 3.182013 18.816031 -0.179142 0.657720 0.696337 0.594089 0.422097
146 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.681848 4.619191 -0.105304 4.661808 -0.446535 5.239465 -0.763065 -3.406010 0.678662 0.680469 0.386090
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 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
149 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
150 N15 RF_maintenance 100.00% 100.00% 24.16% 0.00% 11.058207 2.780060 11.607250 3.917015 7.938755 5.350798 2.037329 -2.720831 0.046178 0.274721 0.121375
155 N12 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.846276 -0.581174 -0.581704 0.131196 1.987793 6.822236 1.496373 0.465662 0.650864 0.660092 0.405692
156 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 9.661169 -0.170818 11.558462 2.048412 7.820383 0.104980 1.043999 -0.357658 0.084887 0.654754 0.530670
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.066073 -0.375697 -0.044411 0.153978 -0.424159 0.613186 -0.496602 -0.366058 0.663443 0.671998 0.395531
158 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 0.232854 -0.794028 -0.973679 -1.240784 0.986815 -0.322960 4.941708 17.995250 0.680085 0.685180 0.400378
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.172737 22.475564 2.467395 1.340175 0.739960 3.791275 -1.808848 7.191314 0.676924 0.542010 0.376535
160 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.738897 -1.223932 -0.863747 -1.421983 -0.101911 -0.347930 0.413693 0.275462 0.690208 0.693216 0.378072
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.918606 28.561604 -0.555478 -0.993914 0.507701 0.182833 -0.502665 0.929077 0.694169 0.568564 0.351101
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% 0.610542 -0.088806 -1.406079 -1.993415 3.289711 1.539715 0.150354 1.063039 0.705934 0.702402 0.378714
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.474951 0.400415 -0.752980 -0.068817 -0.006192 0.733222 -0.348949 0.585349 0.704047 0.697959 0.384450
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% -0.665404 0.041231 1.287739 -0.903284 6.817743 0.587109 0.131917 0.775520 0.693097 0.698128 0.382574
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 18.261936 -0.123160 8.586704 -0.960220 4.969153 0.194230 -0.342337 -0.518082 0.418398 0.694130 0.432345
166 N14 RF_maintenance 100.00% 0.00% 97.24% 0.00% 29.150198 10.772595 1.855700 11.686135 5.998857 9.675910 20.288510 0.091990 0.552960 0.088230 0.407255
167 N15 digital_ok 0.00% 0.00% 0.00% 0.00% -0.677008 -1.282895 -0.985312 0.776619 -0.049196 1.229941 -1.260266 2.231228 0.697179 0.687938 0.398402
168 N15 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.335727 0.544413 1.548445 1.744981 -0.568569 -1.009174 -1.964804 -1.902549 0.681464 0.686025 0.400413
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 4.786655 4.846654 4.874923 5.169154 4.284885 6.460800 -3.409604 1.986933 0.661638 0.559381 0.394724
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 11.485293 0.088017 6.288780 2.272009 7.943749 -0.368033 0.129116 -1.820940 0.044666 0.674721 0.560043
179 N12 RF_maintenance 100.00% 100.00% 90.54% 0.00% 11.203396 12.435258 11.805902 12.720807 7.975119 9.593085 0.504578 0.873808 0.054997 0.126521 0.068914
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.629210 12.471072 11.709254 12.379424 7.936005 9.880562 0.316068 1.959384 0.045946 0.048931 0.004320
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 0.188872 -0.547012 -0.722830 0.045142 0.135720 1.768426 -0.520012 4.134729 0.698933 0.691725 0.382690
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 1.131830 3.591329 6.456529 4.172002 -1.398894 3.902573 3.583412 -2.123553 0.646665 0.685834 0.391990
183 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 10.564160 -1.242435 10.797898 -1.136044 7.897668 0.870535 -0.267188 -0.263584 0.044051 0.689189 0.510869
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 10.462295 12.095743 11.699874 12.240262 7.827698 9.752709 0.572678 0.735517 0.069005 0.050789 0.021495
185 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
186 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
187 N14 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
189 N15 digital_ok 0.00% 0.00% 0.00% 0.00% 0.119424 1.074208 1.178081 -0.844225 0.948272 0.276798 0.007574 0.710409 0.662508 0.674469 0.402138
190 N15 digital_ok 100.00% 0.00% 100.00% 0.00% 42.877436 11.869272 -0.409513 12.337866 4.910178 9.939855 40.990612 2.592655 0.484282 0.033846 0.364968
191 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -1.049913 -0.243420 4.151902 -0.413452 -0.000375 0.671013 12.834282 -0.061031 0.636213 0.663566 0.428225
200 N18 RF_maintenance 100.00% 100.00% 51.78% 0.00% 11.989889 36.020438 4.690277 0.971894 7.907129 9.476485 1.480155 -1.149635 0.045622 0.215783 0.145717
201 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.505500 5.293005 6.047828 5.319238 6.379710 6.931754 -3.849524 -3.579294 0.649993 0.650703 0.380706
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% 0.440818 1.724953 1.015590 -0.756645 -1.421510 -1.018239 -0.647728 2.571610 0.679058 0.638153 0.390694
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.541601 13.720597 4.408054 4.971713 7.918962 9.791134 2.497081 3.070880 0.032751 0.039642 0.001023
205 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.770821 3.794287 0.848305 0.765259 -0.904128 0.126800 -0.165914 3.864779 0.671677 0.597995 0.414792
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 0.281944 1.059045 0.491214 -0.857970 15.187232 -2.176689 0.676891 3.451882 0.665085 0.648577 0.385969
207 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 2.122853 1.466962 1.808089 0.416284 0.536965 -0.977531 -1.375181 -1.476929 0.648421 0.644668 0.374927
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% nan nan inf inf nan nan nan nan nan nan nan
219 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.978829 3.720933 6.044565 4.342262 6.597501 4.383792 -3.749859 -3.132008 0.621194 0.658682 0.402669
220 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.295009 4.006545 4.434159 4.303281 3.625545 4.530483 -1.200889 -3.201224 0.674029 0.663899 0.395487
221 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 1.729495 -0.312347 -1.105533 -0.296240 -0.051010 -1.734230 1.742601 -0.773255 0.639731 0.663542 0.396913
222 N18 RF_ok 100.00% 0.00% 0.00% 0.00% 4.117460 4.360906 4.780585 4.389407 4.242424 4.491695 -1.130259 -3.073267 0.666915 0.662987 0.393684
223 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.679466 0.562915 -1.679853 -0.637942 -0.714419 -2.156045 0.104260 5.451845 0.644119 0.628435 0.379894
224 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.614148 5.792990 6.259407 5.911830 6.826253 8.407424 -3.815625 -4.012045 0.649763 0.641372 0.390391
225 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
226 N19 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
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% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
237 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 2.129841 1.188413 -0.858274 -1.169965 -0.471071 -1.909989 -0.322622 -0.995111 0.619085 0.638296 0.404379
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% 0.095029 -1.026833 1.553711 1.183016 -0.231218 -0.711797 -0.897926 -1.625520 0.671411 0.659547 0.403193
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.775454 1.837313 -0.222518 3.151152 0.260214 2.181143 0.223069 2.332906 0.665680 0.660578 0.399413
240 N19 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
241 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 1.004016 3.068810 -0.705773 0.059059 -1.552037 -1.379799 5.774355 19.464731 0.656138 0.604835 0.411146
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 26.503423 1.010364 0.193880 1.788447 3.293773 -0.786150 2.440116 -1.529315 0.517169 0.657516 0.396130
243 N19 RF_ok 100.00% 12.32% 0.00% 0.00% 59.300874 1.661238 1.044944 -1.410797 6.742223 -1.843504 -1.640932 -0.539303 0.298904 0.635901 0.511449
244 N20 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan 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 RF_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 100.00% 0.00% 100.00% 0.00% -0.388380 12.579357 -0.755947 7.846778 -1.261728 9.811277 7.857239 2.512754 0.668060 0.046068 0.550832
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 0.576214 1.765460 1.564289 2.121986 0.328673 -0.090961 0.942664 -1.114213 0.568370 0.557357 0.394321
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.059593 -1.346514 1.648498 -1.287875 -0.010238 -0.681346 -1.578493 -0.382312 0.602698 0.572678 0.406106
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 2.282023 -1.586025 -1.446721 -0.146055 -0.829765 -1.795298 6.003415 0.372157 0.528341 0.570119 0.404496
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 2.565277 0.400295 -1.430055 -1.498557 -0.667635 -1.427619 0.795450 0.623755 0.531750 0.554690 0.393986
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, 7, 15, 17, 18, 19, 21, 22, 27, 28, 31, 32, 34, 35, 36, 37, 38, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 63, 68, 71, 72, 73, 74, 77, 78, 80, 81, 84, 86, 87, 88, 90, 91, 92, 95, 96, 97, 98, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, 113, 114, 115, 117, 119, 120, 121, 122, 123, 126, 129, 130, 131, 132, 133, 135, 136, 138, 139, 140, 141, 142, 143, 145, 146, 147, 148, 149, 150, 155, 156, 158, 159, 161, 164, 165, 166, 169, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 190, 191, 200, 201, 203, 206, 208, 209, 210, 211, 219, 220, 222, 223, 224, 225, 226, 227, 228, 229, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 329]

unflagged_ants: [4, 5, 8, 9, 10, 16, 20, 29, 30, 40, 41, 42, 48, 49, 62, 64, 65, 66, 67, 69, 70, 79, 82, 83, 85, 89, 93, 94, 99, 100, 106, 112, 116, 118, 124, 125, 127, 128, 137, 144, 157, 160, 162, 163, 167, 168, 189, 202, 205, 207, 221, 237, 238, 239, 324, 325, 333]

golden_ants: [5, 9, 10, 16, 20, 29, 30, 40, 41, 42, 65, 66, 67, 69, 70, 83, 85, 93, 94, 99, 100, 106, 112, 116, 118, 124, 127, 128, 144, 157, 160, 162, 163, 167, 189, 202]
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_2459884.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.4.dev44+g3962204
3.1.5.dev171+gc8e6162
In [ ]: