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 = "2460093"
data_path = "/mnt/sn1/2460093"
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-28-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/2460093/zen.2460093.21278.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

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

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1851 ant_metrics files matching glob /mnt/sn1/2460093/zen.2460093.?????.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/2460093/zen.2460093.?????.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 2460093
Date 5-28-2023
LST Range 10.933 -- 20.895 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1851
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
Total Number of Nodes 19
Nodes Registering 0s N01, N15, N20
Nodes Not Correlating N07
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 78 / 198 (39.4%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 98 / 198 (49.5%)
Redcal Done? ❌
Never Flagged Antennas 98 / 198 (49.5%)
A Priori Good Antennas Flagged 46 / 94 total a priori good antennas:
5, 9, 15, 16, 17, 29, 30, 31, 37, 40, 42, 55,
62, 66, 70, 81, 83, 93, 94, 109, 111, 112,
118, 121, 124, 127, 136, 147, 148, 149, 150,
151, 160, 161, 165, 166, 167, 168, 169, 170,
181, 182, 184, 189, 190, 191
A Priori Bad Antennas Not Flagged 50 / 104 total a priori bad antennas:
8, 22, 35, 36, 43, 46, 48, 49, 50, 52, 57,
63, 64, 73, 74, 79, 80, 89, 90, 95, 97, 102,
108, 113, 114, 115, 120, 126, 132, 133, 134,
135, 139, 179, 185, 201, 206, 220, 222, 223,
224, 237, 238, 239, 240, 241, 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_2460093.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 0.00% 0.00% 0.00% 0.00% -1.000889 -0.168341 -0.546226 0.069704 -0.173135 0.224959 -0.393692 0.460160 0.665726 0.632953 0.373129
8 N02 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.793476 1.857293 1.291295 1.309260 0.443415 0.241963 0.305523 0.132935 0.640753 0.596873 0.376902
9 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.260546 -0.804971 2.789206 -0.444474 1.398276 -0.211567 4.157194 -0.431380 0.659782 0.636326 0.368632
10 N02 digital_ok 0.00% 0.00% 0.00% 0.00% -0.872673 -0.720334 -0.470951 -0.634231 -1.220218 -0.467144 -0.838241 -0.476961 0.657268 0.626844 0.372646
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% -0.541485 0.220551 -0.285562 0.763445 0.020723 2.556995 -0.290443 1.154114 0.680426 0.656638 0.366115
20 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 1.097082 -1.093035 1.782647 -0.507226 1.400944 -0.299814 2.458918 -0.559073 0.680123 0.652446 0.361205
21 N02 digital_ok 0.00% 0.00% 0.00% 0.00% 0.031348 -0.195065 -0.038821 0.283248 0.051510 0.156953 0.145308 0.378173 0.673653 0.645494 0.359101
22 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.824073 -0.809208 -0.087178 -1.034044 -0.384021 -1.000997 0.077593 -0.783971 0.640124 0.621463 0.366651
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 100.00% 0.00% 0.00% 0.00% 0.458466 1.015993 0.920723 3.363826 1.075220 1.653423 1.190123 4.666740 0.695134 0.664131 0.359173
32 N02 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.827652 3.903569 0.090303 -0.556460 -0.655017 0.362887 0.372351 1.449304 0.617443 0.639530 0.282188
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 6.694226 -0.185873 5.728482 -0.466678 1.665479 -1.302047 0.814914 -0.974630 0.044580 0.637299 0.454659
35 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.368474 -0.783950 -0.287029 -0.543941 -1.119954 -0.639867 -0.688737 -0.248459 0.657687 0.634265 0.371949
36 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.686836 2.643917 0.935584 0.683341 1.096483 0.814429 1.208332 0.680679 0.662443 0.630444 0.376992
37 N03 digital_ok 100.00% 0.00% 100.00% 0.00% -0.762702 14.291166 -0.998999 12.522633 -0.616040 1.329226 -0.986228 0.561294 0.672063 0.033973 0.537640
38 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.348691 -0.312385 -0.111054 0.487208 0.063851 0.526551 0.009575 0.892905 0.675839 0.648742 0.368743
40 N04 digital_ok 100.00% 0.00% 0.00% 98.33% -0.169490 0.077189 0.121341 -0.387924 0.026335 0.134459 1.252430 0.201082 0.336582 0.330392 -0.268792
41 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.661968 1.395017 1.155743 2.738930 1.009072 1.653644 1.453026 3.518257 0.693330 0.670491 0.360126
42 N04 digital_ok 0.00% 0.00% 0.00% 98.92% -0.429551 0.554989 -0.244092 -0.574121 -0.127562 0.060192 0.126660 0.006344 0.351843 0.339274 -0.267963
43 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.028055 0.171716 -0.839825 0.663562 -0.906194 0.595077 -1.050611 0.612104 0.694921 0.680329 0.361635
44 N05 digital_ok 0.00% 0.00% 0.00% 0.00% -1.094142 0.213893 -0.716786 0.324825 -0.404483 0.453164 -0.742048 0.250624 0.696757 0.686460 0.361724
45 N05 digital_ok 0.00% 0.00% 0.00% 0.00% 0.518963 0.581213 0.682183 0.625978 0.729112 0.547269 0.824869 0.645847 0.697088 0.679254 0.355390
46 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.488882 -0.887339 0.027542 -0.987345 0.229642 -0.759086 0.116932 -1.003820 0.692492 0.675750 0.365775
47 N06 not_connected 100.00% 100.00% 100.00% 0.00% 6.100642 7.759446 5.589295 5.590667 1.663658 1.304374 0.683696 0.433117 0.037981 0.032626 0.005578
48 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.451495 0.498512 -0.949790 0.248084 -1.108421 -0.818505 -0.979868 -0.589068 0.664993 0.639029 0.369016
49 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.374623 -0.508671 0.582988 -0.839059 -0.104741 -1.243266 0.901029 -0.698190 0.646660 0.634320 0.366855
50 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.386157 0.330233 -0.068714 1.328186 0.220466 1.176576 0.117500 1.518913 0.662740 0.634389 0.379468
51 N03 dish_maintenance 100.00% 0.00% 0.00% 0.00% 0.901045 -0.060388 0.144527 -0.223680 0.488863 0.068014 3.880811 -0.325108 0.669247 0.645155 0.372451
52 N03 RF_maintenance 0.00% 0.00% 0.00% 0.00% 2.526114 1.794846 0.507756 0.240880 0.824966 0.383332 0.676910 0.086221 0.688083 0.658185 0.368899
53 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.229467 0.021209 -0.059676 -0.595613 0.330045 -1.057121 0.296271 -0.742639 0.695067 0.661587 0.370775
54 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.894201 1.929324 0.869349 -0.729394 1.017800 0.392358 0.626026 0.029613 0.395775 0.434499 0.187368
55 N04 digital_ok 100.00% 6.21% 100.00% 0.00% 0.210499 24.248632 0.031069 8.075961 -0.738652 1.364597 -0.084570 0.437244 0.346545 0.048180 0.180472
56 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -1.062541 3.270089 -0.978475 1.545634 -0.749315 0.640118 -1.045416 1.727761 0.702085 0.680975 0.350777
57 N04 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.485733 1.215577 -0.983679 -0.256484 -0.726969 -0.030640 -0.931395 -0.302626 0.706784 0.690114 0.352452
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.505432 7.281744 9.838082 10.270959 1.664319 1.309154 0.852407 0.589641 0.038941 0.039145 0.002021
59 N05 RF_maintenance 100.00% 99.89% 0.00% 0.00% 6.143494 0.760431 9.855132 0.818835 1.658448 0.727121 0.761222 0.883645 0.062494 0.692158 0.520841
60 N05 RF_maintenance 100.00% 0.00% 74.12% 0.00% 0.790018 7.100098 0.130032 10.290907 0.043963 1.298027 0.181278 0.878599 0.690458 0.152219 0.522532
61 N06 not_connected 100.00% 100.00% 91.90% 0.00% 6.604302 1.466520 5.422051 0.712233 1.662197 1.240237 0.671384 0.459161 0.030005 0.083192 0.041921
62 N06 digital_ok 100.00% 0.00% 100.00% 0.00% 0.121600 7.684506 0.971413 5.275685 -0.164690 1.311882 1.015810 0.522741 0.646801 0.060743 0.497297
63 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.324431 2.836251 -0.709711 1.951045 -1.283742 0.885795 -0.985060 0.336292 0.670787 0.600274 0.382530
64 N06 not_connected 0.00% 0.00% 0.00% 0.00% -0.519263 -0.613812 -0.785626 -0.075300 -0.789800 -0.472071 -0.582835 0.185842 0.658438 0.639111 0.364308
65 N03 digital_ok 0.00% 0.00% 0.00% 0.00% 0.281011 -0.119490 0.471907 -0.126123 0.721914 0.063377 0.706429 -0.184832 0.663863 0.635123 0.383507
66 N03 digital_ok 100.00% 9.78% 94.81% 0.00% 1.376250 13.498679 0.946346 12.423575 0.169658 1.335846 0.195485 1.266559 0.299345 0.080723 0.160768
67 N03 digital_ok 0.00% 0.00% 0.00% 0.00% -0.918455 0.201605 -0.280591 1.099738 0.072061 1.064170 -0.012070 1.280391 0.687298 0.667017 0.369388
68 N03 dish_maintenance 100.00% 100.00% 0.00% 0.00% 14.751061 0.379215 12.409898 0.062502 1.658660 -1.024661 0.878686 -0.562039 0.039018 0.658874 0.535811
69 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 0.894966 1.250938 1.137641 -0.603438 1.076833 -0.335510 1.491448 -0.694870 0.706759 0.683367 0.357339
70 N04 digital_ok 0.00% 0.00% 0.00% 97.35% 0.084865 1.735978 1.069172 2.217480 0.655953 1.954861 1.569782 3.324554 0.382303 0.368301 -0.254441
71 N04 digital_ok 0.00% 0.00% 0.00% 0.00% 2.113907 -0.173835 -0.270316 0.296595 0.084223 0.352143 -0.325364 0.217526 0.715815 0.702230 0.349624
72 N04 digital_ok 0.00% 0.00% 0.00% 0.00% -0.156778 -1.214960 -0.305923 -0.847816 0.052816 -0.991913 -0.242253 -1.085537 0.717313 0.701683 0.352492
73 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.677407 1.126355 -0.589516 1.204425 -0.252042 1.531499 -0.585744 1.450075 0.717153 0.708209 0.352803
74 N05 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.069132 -0.217782 -0.630058 -0.209566 -1.029922 0.026756 -0.901677 -0.225761 0.708397 0.702194 0.359007
77 N06 not_connected 100.00% 91.90% 91.90% 0.00% 20.342025 11.698000 0.151040 -0.168367 1.605148 1.277839 0.592569 0.383278 0.061063 0.073857 0.019010
78 N06 not_connected 100.00% 0.00% 0.00% 0.00% 10.986475 0.331346 0.119827 0.223908 -0.399199 -0.862071 0.128850 -0.546323 0.555848 0.655399 0.322482
79 N11 not_connected 0.00% 0.00% 0.00% 0.00% 0.682918 -0.775437 0.662445 -0.825187 -0.157541 -0.861082 0.894113 -0.717699 0.656856 0.653057 0.362508
80 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.424695 1.496423 -0.509898 1.083444 -1.266543 -0.013411 -0.879161 -0.106301 0.664810 0.626466 0.380393
81 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 23.422818 22.472890 24.747208 21.125234 1.788062 1.271001 0.741136 0.506403 0.016756 0.016535 0.001099
82 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 12.106583 51.222715 19.352402 30.540884 1.667889 1.317307 0.730136 0.481586 0.016740 0.016598 0.001047
83 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 21.175490 17.150443 25.777808 20.263585 1.651571 1.297406 0.756165 0.480984 0.016561 0.016611 0.000775
84 N08 RF_maintenance 100.00% 0.00% 100.00% 0.00% 2.119744 13.930434 2.906969 12.516192 1.859387 1.305337 4.296904 0.636778 0.696144 0.044401 0.469552
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.374072 -0.246580 -0.630349 -0.698268 -1.205715 -0.511145 -0.934125 -0.764025 0.702480 0.685880 0.360885
86 N08 digital_ok 0.00% 0.00% 0.00% 0.00% -0.003738 -0.001631 0.500871 0.100653 0.480773 0.110303 0.624760 0.319306 0.713511 0.695024 0.343933
87 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 5.810801 1.820172 1.434997 -0.668813 3.024138 -1.103745 2.943761 -0.916197 0.676882 0.702940 0.325085
88 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.023462 0.450775 0.613603 1.033388 0.551384 0.716153 0.807363 1.063107 0.717964 0.708773 0.334770
89 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.246908 0.186788 0.579066 0.864896 0.635712 0.736061 0.730814 0.834720 0.719720 0.710353 0.342446
90 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.072594 -0.811471 0.924626 -0.743633 0.900874 -1.183677 1.256073 -1.056353 0.712257 0.703140 0.348741
91 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.014685 0.190424 0.716222 0.530871 0.736384 0.457134 0.863289 0.444992 0.706563 0.703401 0.355473
92 N10 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.831054 -0.014727 9.878204 0.402901 1.669264 0.446365 0.811782 0.346276 0.036771 0.695058 0.465151
93 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 6.004184 7.459445 9.929223 10.342742 1.666630 1.310536 0.883262 0.617349 0.031561 0.025287 0.003064
94 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 6.468057 4.021993 10.037147 9.342875 1.627566 2.060225 0.852455 10.696983 0.027630 0.461831 0.299545
95 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.026696 -0.265385 -0.115466 -0.291962 -0.583643 -1.257317 -0.148748 -0.885702 0.657267 0.657436 0.370664
96 N11 not_connected 100.00% 0.00% 0.00% 0.00% 0.483050 9.657664 0.200145 -0.483600 -0.693820 -0.828238 -0.462167 -0.531431 0.667359 0.576017 0.341124
97 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.181115 0.839539 -0.882122 0.395398 -0.837072 -0.136443 -0.654783 1.074802 0.658272 0.639125 0.368912
101 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.659936 3.033624 0.126314 0.912174 0.348212 0.760564 0.190627 0.860969 0.694828 0.677226 0.361272
102 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% -1.097396 0.242283 -0.812612 -0.254729 -0.514390 -0.068735 -0.751436 -0.199077 0.705891 0.685556 0.356325
103 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 1.609322 1.695256 1.044640 -0.681294 0.157135 -0.415893 0.262509 -0.284172 0.689888 0.693728 0.352933
104 N08 RF_maintenance 100.00% 0.00% 0.00% 0.00% 2.743525 27.971229 1.611602 5.717294 1.138584 2.370785 2.022219 7.283295 0.715874 0.700800 0.338436
105 N09 digital_ok 0.00% 0.00% 0.00% 0.00% -0.418406 -0.002101 -0.092720 0.498301 0.138323 0.427659 -0.034671 0.414028 0.720069 0.709210 0.338938
106 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.001631 -0.036746 0.054547 0.145178 0.215483 0.150399 0.162693 0.025160 0.718859 0.711229 0.341745
107 N09 digital_ok 0.00% 0.00% 0.00% 0.00% 0.556882 0.347367 -0.112817 -0.634744 0.004946 -0.495871 -0.006344 -0.672071 0.715108 0.704099 0.341226
108 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.450577 1.886479 1.095598 2.080544 1.030899 1.212036 1.954293 2.491304 0.711065 0.707300 0.346604
109 N10 digital_ok 100.00% 70.29% 100.00% 0.00% 5.569961 7.350229 9.917842 10.127470 1.640455 1.316533 1.126871 0.611688 0.159038 0.038021 0.091854
110 N10 RF_maintenance 100.00% 0.00% 0.00% 0.00% 13.798761 -0.524852 1.366571 -0.120910 2.155237 0.094494 1.841889 -0.267554 0.637655 0.693567 0.323829
111 N10 digital_ok 100.00% 45.27% 76.88% 6.92% 1.437203 7.066363 8.293664 10.100753 1.798195 1.436190 12.581180 2.587186 0.285012 0.121382 -0.057841
112 N10 digital_ok 100.00% 0.00% 0.00% 98.43% 0.420573 1.703005 1.252253 8.321132 0.723324 2.029113 1.769361 13.967483 0.346995 0.282477 -0.237230
113 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.676777 2.699235 1.778497 1.844168 0.980601 0.775921 0.457825 0.278777 0.644723 0.613808 0.379037
114 N11 not_connected 0.00% 0.00% 0.00% 0.00% 2.243230 1.966848 1.472286 3.188100 0.669407 -0.001478 0.319179 3.791810 0.637402 0.595977 0.364803
115 N11 not_connected 0.00% 0.00% 0.00% 0.00% -1.138866 -0.675032 -0.742422 -0.519305 -0.772157 -1.296509 -0.502593 -0.931495 0.649729 0.633848 0.373675
117 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 19.120203 22.460244 24.040374 23.160781 1.657640 1.262024 0.725221 0.506405 0.016444 0.016659 0.001069
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% 13.132396 13.882622 19.921936 20.648919 1.659592 1.274254 0.731376 0.482243 0.016643 0.016517 0.000882
120 N08 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.984204 0.069164 2.214052 -0.555781 1.608041 -0.288213 3.254743 -0.626185 0.698565 0.682987 0.354244
121 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 0.094690 2.162641 -0.632523 4.870152 -0.264440 1.907496 0.159525 7.943279 0.703460 0.689824 0.342370
122 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.222293 1.984744 -0.315005 -0.800304 -0.082858 -0.537077 -0.291087 -0.866337 0.719305 0.702555 0.346969
123 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 2.475615 3.049901 0.789296 0.953446 0.821236 0.815306 1.061005 1.000297 0.726507 0.715555 0.341974
124 N09 digital_ok 100.00% 100.00% 0.00% 0.00% 5.907744 -0.028719 10.052778 0.608350 1.662866 0.568790 0.808899 0.624953 0.044777 0.715181 0.454090
125 N09 RF_maintenance 100.00% 0.00% 0.00% 0.00% -0.965512 1.375242 5.839964 0.989901 0.985319 0.649649 9.040806 1.014279 0.659334 0.706770 0.343570
126 N09 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.201737 1.751378 0.273247 0.852008 0.591322 0.677874 0.529826 0.900381 0.711113 0.704866 0.343278
127 N10 digital_ok 100.00% 100.00% 0.00% 0.00% 5.692637 -1.095277 9.870836 -0.759261 1.666875 -0.913152 0.775795 -1.047984 0.038620 0.695314 0.465405
128 N10 digital_ok 0.00% 0.00% 0.00% 0.00% -0.366705 -0.673950 -0.486970 -0.512592 -0.107459 -1.171823 -0.451824 -0.822684 0.698559 0.685938 0.373119
131 N11 not_connected 100.00% 0.00% 10.64% 0.00% -0.740050 6.527165 -0.743174 5.709846 -1.108143 0.905371 -1.045798 3.030655 0.670026 0.387571 0.419046
132 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.787593 -0.624121 -0.716663 -0.634436 -1.136170 -0.690626 -1.048299 -0.574303 0.661010 0.645730 0.369249
133 N11 not_connected 0.00% 0.00% 0.00% 0.00% -0.478178 -0.873845 -0.631025 -0.831094 -0.763505 -1.255210 -0.490248 -1.041495 0.651906 0.637401 0.373740
134 N11 not_connected 0.00% 0.00% 0.00% 0.00% 1.009188 2.036112 1.858552 1.385101 -0.134132 0.358653 2.461547 0.038468 0.590689 0.594376 0.376822
135 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.668433 -1.115726 -0.592516 -0.880640 -0.114921 -0.563156 -0.275700 -0.750067 0.635388 0.615111 0.390851
136 N12 digital_ok 100.00% 100.00% 0.00% 0.00% 5.311174 -0.419849 9.644162 -0.224075 1.665538 0.045313 0.815670 -0.255181 0.041490 0.626756 0.447421
137 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 13.087753 34.172620 20.727548 21.029040 1.676131 1.264520 0.787109 0.495265 0.016608 0.016731 0.000638
139 N13 RF_maintenance 0.00% 0.00% 0.00% 0.00% 0.558542 -0.462162 0.145813 -0.944552 -0.795018 -0.877516 -0.421172 -0.886199 0.676863 0.659495 0.365125
140 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.088021 -1.110149 0.025487 -0.766150 0.134783 -0.991579 0.320557 -0.968477 0.700920 0.681571 0.350505
141 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.298687 -0.394960 0.093890 -0.256326 0.264369 -1.258684 0.185691 -0.803117 0.710794 0.685018 0.351349
142 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.338953 7.400086 -0.298494 10.308462 0.067406 1.301229 0.562147 0.527423 0.715495 0.054780 0.554261
143 N14 RF_maintenance 100.00% 69.26% 100.00% 0.00% 5.984469 7.172341 9.688050 10.284408 1.998836 1.302897 4.880856 0.604057 0.179990 0.032344 0.120992
144 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.489758 0.683117 -0.385547 0.308331 0.001478 0.662643 -0.337128 0.167856 0.720461 0.708637 0.348825
145 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.037893 0.500742 0.108527 0.694765 0.518399 0.572971 0.188076 0.663629 0.715200 0.705307 0.348692
146 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.601382 -0.790455 -0.756991 -0.997428 -0.759389 -1.091859 -0.665340 -0.990378 0.694465 0.689997 0.360190
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% 6.497741 -0.382766 -0.644108 0.936823 -0.486256 0.158893 -0.395346 1.269095 0.571751 0.638475 0.323873
155 N12 RF_maintenance 100.00% 100.00% 0.00% 0.00% 5.582942 -1.029820 9.776897 -0.348034 1.666846 -0.085019 0.845517 -0.138124 0.041905 0.619884 0.451419
156 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.737327 7.233750 5.163260 10.173386 1.635520 1.309679 9.428136 0.625403 0.620051 0.040276 0.455168
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% 0.419546 0.183799 0.450244 0.725180 0.622726 0.644835 0.747208 0.829506 0.659984 0.647975 0.376983
158 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -1.178606 -1.184545 -0.937383 -0.983536 -0.442725 -0.684636 -0.736506 -0.520889 0.672296 0.656565 0.378935
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 0.174880 7.904826 -0.004511 0.024309 -0.307300 -0.512113 -0.046655 -0.105087 0.660206 0.560912 0.335214
160 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 6.188152 -0.683520 9.847102 -0.311656 1.662926 -0.062623 0.804005 -0.384944 0.049062 0.680941 0.528258
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.106346 15.482513 0.364905 0.432179 0.633222 -0.707923 0.503863 0.109745 0.702795 0.600897 0.317375
162 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.351813 -1.028149 -0.445719 -1.001181 -1.089427 -0.724657 -0.731283 -1.057902 0.706723 0.691675 0.354384
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.076807 0.581632 0.313543 0.538661 0.560710 0.691007 0.427356 0.504513 0.715075 0.703735 0.350695
164 N14 digital_ok 0.00% 0.00% 0.00% 0.00% 0.241840 0.815447 0.715708 1.028980 0.671107 0.834519 0.947530 1.121795 0.713984 0.702091 0.346118
165 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 8.299853 -0.518299 0.717954 -0.254044 -0.290773 -0.080333 0.573428 -0.322669 0.613460 0.697807 0.312947
166 N14 digital_ok 100.00% 100.00% 0.00% 0.00% 5.936214 -0.387998 10.005319 -0.103384 1.657799 -1.113071 0.774984 -0.747368 0.037518 0.684258 0.500965
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% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
170 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
171 N16 digital_ok 0.00% 0.00% 0.00% 0.00% -0.191854 -1.292404 0.954275 -0.861922 -0.091160 -0.928188 1.094893 -0.827389 0.638905 0.639041 0.369934
172 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.918727 0.669882 1.285453 0.235377 0.415699 -0.812473 0.232070 -0.534327 0.637347 0.619363 0.383837
173 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.725633 2.734824 1.826232 1.855140 1.028427 0.784277 0.484739 0.300224 0.608906 0.571030 0.383061
179 N12 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.475688 0.496491 0.021730 1.463705 0.152990 2.058380 0.200181 1.467297 0.673379 0.659455 0.372397
180 N13 RF_maintenance 100.00% 0.00% 100.00% 0.00% -0.647131 7.700648 -0.641744 10.389815 -0.283317 1.303472 -0.272348 0.556893 0.684626 0.059846 0.547605
181 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.154884 1.386011 1.264282 2.288921 1.034816 1.301833 1.691559 3.616887 0.696732 0.681159 0.356851
182 N13 digital_ok 100.00% 0.00% 100.00% 0.00% -0.854180 7.231899 -0.581455 10.109359 -1.145581 1.296590 -0.764155 0.549355 0.701404 0.056607 0.511499
183 N13 digital_ok 0.00% 0.00% 0.00% 0.00% -0.479731 0.592963 0.530423 0.862433 0.610895 0.680651 0.681914 0.843896 0.707421 0.688609 0.343099
184 N14 digital_ok 100.00% 6.37% 0.00% 0.00% 5.293397 -0.071667 9.043802 0.276367 2.134494 0.531876 8.418748 0.191344 0.411236 0.693233 0.391628
185 N14 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.546303 -0.501737 -0.898364 -0.027929 -0.491678 0.077742 -0.858150 -0.144684 0.706897 0.691887 0.356391
186 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.725748 -0.912561 -0.361137 -0.777543 -1.228624 -1.181985 -0.723693 -1.091978 0.698724 0.682805 0.359924
187 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.269886 -0.409190 -0.252214 -0.440474 0.156002 -1.214068 -0.045666 -0.926550 0.692360 0.673536 0.362867
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
190 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
191 N15 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
192 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 1.228942 2.913984 0.918842 1.962431 0.132474 0.883056 -0.180886 0.336301 0.631689 0.571920 0.389468
193 N16 digital_ok 0.00% 0.00% 0.00% 0.00% 2.921816 2.513084 1.952964 1.737460 1.154984 0.685391 0.535188 0.227056 0.602210 0.569568 0.382613
200 N18 RF_maintenance 100.00% 100.00% 12.37% 0.00% 6.689863 -0.419418 5.600734 -0.943849 1.664524 -0.532439 0.832911 -0.183372 0.051237 0.321783 0.172294
201 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% 1.345144 2.254027 0.950996 1.634108 0.206392 0.559773 0.011799 0.194598 0.669893 0.624507 0.373782
202 N18 digital_ok 0.00% 0.00% 0.00% 0.00% 0.340862 -0.739041 0.130428 -1.009646 -0.769137 -0.943903 -0.490482 -0.646714 0.684092 0.663506 0.358251
204 N19 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.818840 4.896223 1.488355 -0.621892 1.293773 -0.391269 2.332835 -0.727268 0.696786 0.675425 0.350663
205 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.392141 -0.483798 4.284728 -0.424027 0.074637 -0.450861 3.765095 0.589001 0.545294 0.669976 0.387725
206 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 1.238132 1.647533 2.287593 2.818051 -0.014617 -0.057048 2.506993 2.979336 0.622515 0.608018 0.325080
207 N19 RF_ok 100.00% 100.00% 0.00% 0.00% 6.613827 -0.557099 5.341356 -0.651386 1.663957 -0.597771 0.790215 -0.606494 0.046578 0.655604 0.547470
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
220 N18 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.454818 -0.848094 -0.427692 -1.017224 -1.197428 -1.000729 -0.838476 -0.947735 0.673428 0.644566 0.362863
221 N18 RF_ok 100.00% 0.00% 0.00% 0.00% -0.647290 -0.685320 -0.975193 -1.012240 -0.859888 -0.956258 0.522371 -1.026315 0.675696 0.654068 0.356795
222 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.483921 -0.183420 -0.668686 -0.489988 -1.185366 -1.319032 -0.921800 -1.039384 0.677642 0.655386 0.357222
223 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.885008 0.518314 -0.281412 2.115365 -0.499121 0.140438 -0.230541 2.577087 0.674020 0.623302 0.357070
224 N19 RF_ok 0.00% 0.00% 0.00% 0.00% 3.150298 2.740896 2.136789 1.914390 1.344946 0.829912 0.617787 0.317373 0.635516 0.606444 0.369993
225 N19 RF_ok 100.00% 0.00% 47.54% 0.00% -0.064519 6.870336 -0.145002 5.677007 -1.085873 1.145713 -0.665985 1.627873 0.667656 0.270159 0.511659
226 N19 RF_ok 100.00% 0.00% 0.00% 0.00% -0.797194 6.334684 -0.981092 -0.411904 -1.021949 -0.543941 -0.959505 -0.728231 0.658033 0.561877 0.353838
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% 0.699020 -0.746193 0.595030 -0.722904 -0.237817 -0.699798 0.744649 -0.702573 0.636165 0.627963 0.367412
238 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.005143 -0.202229 -0.085806 -0.157440 -1.042725 -1.192957 -0.641954 -0.836606 0.663218 0.632564 0.371851
239 N18 RF_ok 0.00% 0.00% 0.00% 0.00% -0.884590 -0.362625 -0.885022 -0.503457 -1.237131 -1.336687 -1.009414 -0.968387 0.666914 0.636914 0.365629
240 N19 RF_maintenance 0.00% 0.00% 0.00% 0.00% -0.643536 -0.416504 -0.227894 -0.996362 -1.115705 -0.911372 -0.735070 -0.892665 0.666268 0.639298 0.366725
241 N19 RF_ok 0.00% 0.00% 0.00% 0.00% -0.982846 -0.744271 -0.834411 -0.508400 -1.188803 -1.349454 -0.996986 -1.049330 0.665012 0.635582 0.369769
242 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 6.480772 -0.036993 -0.628831 -0.214080 -0.568063 -1.207397 -0.578636 -0.857417 0.561737 0.626867 0.340807
243 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 3.092182 -0.896514 0.115044 -0.708566 0.258837 -0.674976 1.587729 -0.656491 0.599351 0.622587 0.364549
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 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% 1.563298 1.697725 0.822023 1.105055 -0.141060 0.055901 -0.164891 -0.117765 0.536270 0.433512 0.376459
324 N04 not_connected 0.00% 0.00% 0.00% 0.00% 1.063421 1.196298 0.102400 0.315161 -0.810803 -0.731696 -0.554206 -0.604759 0.532082 0.454016 0.363159
325 N09 dish_ok 0.00% 0.00% 0.00% 0.00% 0.455507 -0.936700 -0.021730 -0.680296 -0.987919 -0.632071 -0.688346 -0.019893 0.569334 0.501175 0.378278
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 6.550598 7.558111 5.499681 6.036368 1.662830 1.305596 0.811835 0.548596 0.041159 0.038952 0.002088
333 N12 dish_maintenance 0.00% 0.00% 0.00% 0.00% 0.683610 0.166146 -0.184390 -0.585138 -0.230582 -0.521668 0.616060 -0.037421 0.514962 0.478948 0.371433
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, 9, 15, 16, 17, 18, 27, 28, 29, 30, 31, 32, 34, 37, 40, 42, 47, 51, 55, 58, 59, 60, 61, 62, 66, 68, 70, 77, 78, 81, 82, 83, 84, 87, 92, 93, 94, 96, 104, 109, 110, 111, 112, 117, 118, 121, 124, 125, 127, 131, 136, 137, 142, 143, 147, 148, 149, 150, 151, 155, 156, 159, 160, 161, 165, 166, 167, 168, 169, 170, 180, 181, 182, 184, 189, 190, 191, 200, 204, 205, 207, 208, 209, 210, 211, 221, 225, 226, 227, 228, 229, 242, 243, 244, 245, 246, 261, 262, 329]

unflagged_ants: [7, 8, 10, 19, 20, 21, 22, 35, 36, 38, 41, 43, 44, 45, 46, 48, 49, 50, 52, 53, 54, 56, 57, 63, 64, 65, 67, 69, 71, 72, 73, 74, 79, 80, 85, 86, 88, 89, 90, 91, 95, 97, 101, 102, 103, 105, 106, 107, 108, 113, 114, 115, 120, 122, 123, 126, 128, 132, 133, 134, 135, 139, 140, 141, 144, 145, 146, 157, 158, 162, 163, 164, 171, 172, 173, 179, 183, 185, 186, 187, 192, 193, 201, 202, 206, 220, 222, 223, 224, 237, 238, 239, 240, 241, 320, 324, 325, 333]

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