In [1]:
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
import matplotlib.patches as mpatches
import matplotlib.gridspec as gridspec
import numpy as np
from pyuvdata import UVCal, UVData, UVFlag
import pyuvdata
import os
import sys
import glob
import uvtools as uvt
from astropy.time import Time
from astropy.coordinates import EarthLocation, SkyCoord, AltAz, Angle
import pandas
import warnings 
import copy
from hera_notebook_templates import utils
import hera_qm
from hera_mc import cm_hookup
import h5py
import importlib
from scipy import stats
import scipy
import pandas as pd
from IPython.display import display, HTML
#warnings.filterwarnings('ignore')

%matplotlib inline
%config InlineBackend.figure_format = 'retina'
In [2]:
#get data location
JD = os.environ['JULIANDATE']
data_path = os.environ['DATA_PATH']
nb_outdir = os.environ['NB_OUTDIR']
utc = Time(JD, format='jd').datetime
print(f'JD = {JD}')
print(f'Date = {utc.month}-{utc.day}-{utc.year}')
print(f'data_path = "{data_path}"')
JD = 2459792
Date = 7-31-2022
data_path = "/mnt/sn1/2459792"
In [3]:
# Load in data
HHfiles, difffiles, uvdx, uvdy = utils.load_data_ds(data_path,JD)
    
uvd = UVData()
uvd_diff = UVData()
uvd.read(HHfiles[0])
use_ants = [int(ant) for ant in uvd.get_ants()]
bls = [(ant, ant) for ant in use_ants]
uvd.read(HHfiles[::10], skip_bad_files=True, bls=bls)
uvd_diff.read(difffiles[::10], skip_bad_files=True, bls=bls)
lsts = uvd.lst_array

flagfile = glob.glob(os.path.join(HHfiles[0].split('zen')[0],'zen.{}*total_stage_1_threshold_flags.h5'.format(JD)))
uvf = UVFlag()
uvf.read(flagfile)
bls = [(ant, ant) for ant in uvd.get_ants()]
times_uvf = np.unique(uvf.time_array)
times_uvd = np.unique(uvd.time_array)
idx_times = [np.where(time_uvd == times_uvf)[0][0] for time_uvd in times_uvd]
uvd.flag_array[:,0,:,:] = np.repeat(uvf.flag_array[idx_times], len(bls), axis=0)
1862 sum files found between JDs 2459792.25308 and 2459792.66938
1862 diff files found between JDs 2459792.25308 and 2459792.66938

LST Coverage¶

Shows the LSTs (in hours) and JDs for which data is collected. Green represents data, red means no data.

In [4]:
utils.plot_lst_coverage(uvd)

Delay spectrum¶

Delay spectrum CLEANed using uvtools.dspec.high_pass_fourier_filter with 7th-order Blackman-Harris window function. Odd/even visibilities are used to remove noise bias.

In [5]:
_data_cleaned_sq, d_even, d_odd = utils.clean_ds(bls, uvd, uvd_diff, N_threads=14)

Waterfalls of delay spectra for autocorrelation¶

These plots show autocorrelation delay spectrum waterfalls of each antenna that is active and whose status qualifies for this notebook. For nn/ee polarization, the autocorrelation delay spectrum is normalized by the max of the delay spectrum. For ne polarization, the autocorrelation delay spectrum is normalized by max(sqrt(|nn| |ee|)). ne and en are the same for autocorrelations, and thus only ne is shown here. The delay spectra are presented in dB with 10log10($|\tilde{V}|$).

For each node, antennas are ordered by SNAP number, and within that by SNAP input number. The antenna number label color corresponds to the a priori status of that antenna.

nn polarization¶

In [6]:
utils.plot_wfds(uvd, _data_cleaned_sq, 0)

ee polarization¶

In [7]:
utils.plot_wfds(uvd, _data_cleaned_sq, 1)

ne polarization¶

In [8]:
utils.plot_wfds(uvd, _data_cleaned_sq, 2)

Analysis of 2700ns features in delay spectra¶

This plot shows the relative amplitude at 2700 ns feature. The relative amplitude is calculated in dB with the mean amplitude at 2500-3000 ns compared to the mean amplitude at 2000-2500 ns. Larger values of relative feature amplitude indicate higher probability of detecting the peak at 2700 ns. Antennas in the same node are grouped by the shaded region.

In [9]:
utils.plot_antFeatureMap_2700ns(uvd, _data_cleaned_sq, JD, pol='nn')
In [10]:
utils.plot_antFeatureMap_2700ns(uvd, _data_cleaned_sq, JD, pol='ee')

This plot shows a matrix representing the 2700ns feature correlation of each baseline. The color bar indicates the amplitude of 2700ns (mean amplitude of 2500-3000ns delay spectrum) in dB which is the same as that in the above plot.

In [11]:
# utils.CorrMatrix_2700ns(uvd, HHfiles, difffiles, flagfile, JD, N_threads=14)

Analysis of noise floor in delay spectra¶

This plot shows the ratio of delay spectrum to noise floor (averaged over 1000-4000ns). Near 1 indicates the delay spectrum reaches to the noise floor, which may mean good.

In [12]:
utils.plot_antFeatureMap_noise(uvd_diff, d_even, d_odd, JD, pol='nn')
In [13]:
utils.plot_antFeatureMap_noise(uvd_diff, d_even, d_odd, JD, pol='ee')
In [14]:
# get the ratio of delay spectum to noise for different freqeuncy bands and pols
ds_noise_ratio = utils.get_ds_noise_ratio(uvd, uvd_diff, bls)

nodes, antDict, inclNodes = utils.generate_nodeDict(uvd)
ants = uvd.get_ants()
# build dataframe
to_show = {'Ant': ants, 'Node': [int(antDict[ant]['node']) for ant in ants], 'Snap': [int(antDict[ant]['snapLocs'][0]) for ant in ants]}
df = pd.DataFrame(to_show)
 
cols_ratio = []
for key in ds_noise_ratio.keys():
    if(key[0] == 40):
        col = r'Full '
    else:
        col = r'{}-{} MHz '.format(key[0], key[1])
    col += key[2]
    df[col] = ds_noise_ratio[key]
    cols_ratio.append(col)
    

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

ratio_cut = 3
# style dataframe
table = df.style.hide_index() \
          .applymap(lambda val: 'color: red' if val > ratio_cut else '', subset=cols_ratio) \
          .set_table_styles([dict(selector="th",props=[('max-width', f'70pt')])])

This table shows the ratio of the delay spectrum to the noise level from diff files for different frequency bands and pols. The ratio > 3 is colored in red

In [15]:
HTML(table.render())
Out[15]:
Ant Node Snap Full nn Full ee 50-85 MHz nn 50-85 MHz ee 120-155 MHz nn 120-155 MHz ee 155-190 MHz nn 155-190 MHz ee 190-225 MHz nn 190-225 MHz ee
3 1 2 1.357811 1.341600 1.531019 1.414640 2.896551 2.543973 2.030625 1.752175 1.945542 2.038379
4 1 2 1.778874 2.515072 1.396150 3.604470 1.995570 2.171451 1.768577 2.198760 2.583053 2.760608
5 1 2 1.058286 1.102460 1.642503 1.287884 1.816598 1.824536 2.459911 1.887690 7.030593 6.926121
7 2 0 1.079896 1.067619 1.540202 2.916939 2.008484 1.953198 1.743636 1.895267 1.926481 1.881109
8 2 0 1.736959 43.912189 4.018180 155.686741 3.255835 148.032073 3.839870 147.957308 4.357065 144.162273
9 2 0 1.007637 1.041528 1.325391 1.111927 2.046518 2.169406 2.233247 2.341023 1.737696 1.778164
10 2 1 1.250387 1.242218 2.315510 1.319608 2.282650 2.147343 1.873387 2.657564 2.350863 2.027916
15 1 3 1.432310 1.284260 1.720584 1.122783 2.308833 2.388820 1.790181 1.835632 6.661866 6.089199
16 1 3 1.267699 1.304402 1.552386 1.248372 2.455807 2.504317 1.798911 2.153466 8.398498 11.743166
17 1 3 1.253526 1.260098 1.175032 1.057970 2.312001 1.948540 1.519040 1.539731 1.907383 2.049041
18 1 0 80.825009 77.526438 1.403838 1.559875 378.714904 402.659267 1.586459 1.649463 1.677803 1.892967
19 2 1 1.163042 1.217245 1.672249 1.916387 2.341820 2.150099 1.830341 2.051781 3.288566 8.532214
20 2 1 1.160146 1.172667 1.753300 1.170632 2.124591 2.036336 1.540657 1.651446 2.015475 1.950882
21 2 2 1.029624 0.954934 1.212048 1.072185 1.880435 1.818406 2.088604 1.653616 1.783988 2.100277
27 1 0 4.495237 7.708671 9.488076 21.448956 14.941324 11.546170 5.241126 2.146412 5.078836 1.774151
28 1 0 91.028788 2.340382 1.383555 1.550332 432.841904 8.205664 1.725234 2.552590 2.472152 4.733934
29 1 1 1.284315 1.323715 1.562302 1.280153 2.328689 2.412549 2.681236 2.504260 4.141623 4.546654
30 1 1 1.399158 1.513233 2.225944 1.126718 2.536127 2.385910 2.625289 2.514103 2.369596 3.870866
31 2 2 1.385743 1.392670 1.502234 1.443111 2.161207 2.271310 2.161657 3.617239 2.533158 6.704186
32 2 2 1.492364 2.388309 1.100252 1.995311 2.264702 5.172451 4.452489 9.808861 4.910727 11.402448
33 2 3 78.112855 1.123125 1.296266 1.550923 355.992098 1.968367 1.424038 1.926820 1.941388 2.191573
36 3 3 1.610997 1.596971 1.915620 1.530034 2.418619 2.282856 1.930943 1.858415 2.033041 1.793454
37 3 1 1.178595 1.135220 1.690520 1.342429 2.875859 1.929181 1.874199 1.877959 3.561393 4.000004
38 3 1 1.094611 1.405614 1.756837 1.780347 2.136163 2.436578 1.677792 2.515564 1.701464 2.473827
40 4 1 1.490322 1.376338 2.010407 1.310479 2.118392 2.023659 1.737332 1.947378 2.136095 2.569305
41 4 3 1.198684 1.451076 1.640739 4.782859 2.447486 2.222785 1.939377 1.809420 1.802373 1.798788
42 4 0 1.342947 1.373609 1.296882 1.373292 3.309815 2.722539 1.827666 2.273695 3.171159 6.651553
45 5 0 1.482000 1.286167 2.607796 1.464541 3.242063 2.118030 3.150054 2.136321 2.746052 2.188067
46 5 0 1.693942 1.319086 1.329602 1.465312 3.356891 2.239431 1.963719 1.842379 2.223662 1.994880
50 3 3 1.726953 1.222513 1.945574 1.412918 3.455499 1.970064 1.811987 1.488492 2.137491 1.512095
51 3 2 11.869839 1.605341 27.529682 1.757714 15.596143 2.231987 6.961325 1.548840 12.129981 3.784919
52 3 3 10.314098 1.570907 34.313047 1.688608 12.813423 2.455959 6.821670 1.816677 7.714234 2.599944
53 3 2 1.181415 1.442990 2.267939 2.359036 2.853508 3.732685 2.192747 2.747129 3.420750 4.082174
54 4 0 1.666897 1.123816 1.553073 1.263645 3.076204 2.319826 1.947529 1.962417 2.674079 2.676621
55 4 2 1.195237 1.156639 1.985141 1.161130 2.414155 1.932089 1.916545 1.606020 2.450945 1.953430
56 4 1 1.433519 1.452528 1.438663 1.375948 3.094058 2.578525 2.189724 1.996368 2.752409 3.052510
57 4 3 1.219094 2.279505 1.939448 10.490964 2.338839 2.267708 2.016612 1.926833 1.949534 3.357683
65 3 0 1.228645 1.133325 2.111595 1.187970 2.412090 2.015147 1.992194 1.635705 1.839394 1.692123
66 3 0 1.557722 1.246148 3.298706 1.646093 4.115836 2.439843 2.749431 1.779183 2.542743 2.296480
67 3 0 1.125854 1.280235 1.333157 1.325584 2.104786 1.926560 1.615205 1.591080 1.860781 1.557037
68 3 1 1.247443 1.191568 1.446820 1.844194 2.205603 2.348941 1.671892 2.283286 2.223376 2.698400
69 4 1 1.196538 1.339989 2.063862 2.087626 2.519149 2.767248 2.371519 2.315639 2.448343 2.547184
70 4 2 1.864739 1.810506 1.712163 1.704394 5.075079 3.733843 2.821696 3.602043 2.559966 3.566748
71 4 2 1.571967 1.631510 1.622163 1.473741 2.640416 2.231834 1.711286 1.973866 1.626435 1.791789
72 4 0 1.485855 1.758441 1.683962 2.315696 3.934998 5.083303 2.140380 2.505524 8.919056 12.492563
73 5 0 1.147147 1.406631 1.616502 1.317926 2.377610 2.341020 1.651205 1.888501 1.933832 2.050662
81 7 0 3.132120 1.692793 2.407026 1.429174 3.092733 2.370747 6.179781 2.299596 29.899193 5.619418
82 7 0 1.189944 1.363781 1.265947 1.240761 1.992381 2.439643 1.550155 2.030598 2.422692 2.815592
83 7 0 1.183263 1.219988 1.889996 1.711686 1.999068 1.738537 1.938716 2.348647 2.326809 2.607626
84 8 3 1.490477 1.551595 1.859507 2.754931 2.101128 2.326802 1.801155 1.893405 7.023250 10.254982
85 8 0 3.703024 1.057763 4.766858 1.463304 7.302838 1.813197 1.745395 1.669541 3.353059 1.842805
86 8 0 2.039714 1.505020 2.373766 1.258178 3.776098 2.548667 3.681374 5.261668 7.382167 9.623820
87 8 2 1.670331 1.411832 1.993900 1.652509 2.356825 1.844616 1.987449 3.082576 6.266104 4.831838
88 9 0 3.659685 17.574085 20.883119 55.535622 13.984993 49.234169 6.287598 5.644837 10.801200 4.545112
90 9 0 10.956025 4.448049 4.227530 3.880298 22.012129 11.773702 53.989977 16.002525 66.485242 36.234562
91 9 1 4.549593 7.884777 18.570592 16.196054 7.631773 16.226571 8.921912 5.062119 11.662701 2.936532
92 10 0 5.322941 3.709464 0.536072 1.192262 11.730463 8.660142 3.901136 3.198991 3.502005 2.751578
93 10 0 1.370601 1.256711 1.705036 1.817202 2.456842 3.028963 1.632874 1.933201 2.270760 2.949969
94 10 0 1.240217 1.606477 1.406803 2.521275 3.339914 3.639612 2.090991 3.471987 2.767236 3.576733
98 7 2 1.866397 32.019045 1.882041 100.577592 3.111953 109.130915 3.590896 105.652472 13.592449 103.931244
99 7 2 1.254941 28.168952 1.964296 108.161453 2.161842 76.804036 2.457536 57.469419 5.347965 82.646826
100 7 1 1.958126 1.569894 2.342956 1.735853 3.374044 2.342486 2.280610 1.812550 2.359249 2.189502
101 8 2 1.668871 1.790809 1.656541 1.756563 2.456421 2.714001 1.974607 2.110415 2.059371 3.553056
102 8 0 0.382006 0.654048 0.544529 2.555297 0.918053 1.188652 0.508557 0.595026 0.581801 0.614703
103 8 1 1.503646 1.164622 1.514444 1.320275 2.212116 1.951652 1.649252 1.615599 2.242710 1.814959
104 8 1 3.486741 1.445276 0.337148 1.520363 3.732167 1.837451 4.425114 1.597520 3.806089 1.755784
105 9 1 3.133498 3.615293 21.185989 9.243240 5.742973 9.493321 7.269174 2.739869 15.465387 4.086194
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 9.399899 39.042536 67.485779 284.412283 10.238643 3.489975 15.317591 114.315685 7.925992 2.870116
108 9 1 1.364503 1.342585 1.976662 1.229445 2.314364 1.939893 1.623587 1.869610 2.974229 2.342841
109 10 1 2.233213 2.014661 1.458830 1.465397 5.419241 3.537684 1.781919 1.799493 1.983906 2.254554
110 10 1 1.595028 2.512921 2.493089 3.553917 4.786204 5.350248 1.881158 3.262643 1.899329 2.435026
111 10 1 1.385378 1.277876 2.532849 1.256453 3.213996 2.219319 2.185064 1.471359 1.709336 1.515755
112 10 2 nan nan nan nan nan nan nan nan nan nan
116 7 2 1.328390 0.966386 2.003146 1.365494 3.254705 1.721458 1.987796 1.779656 4.647373 2.031936
117 7 3 1.274007 35.017994 1.825269 122.998997 2.323893 115.812792 1.821089 112.974841 2.397527 104.566173
118 7 3 1.341885 1.490837 1.436671 1.720919 2.290902 2.741634 1.628309 2.095513 1.863068 4.594153
119 7 1 1.158152 1.098468 1.688430 1.506411 2.380993 2.368480 2.144276 1.659897 5.881862 2.146510
120 8 1 7.346261 3.185305 12.336439 3.228464 10.566371 12.342635 12.872867 1.958773 40.858992 3.384558
121 8 3 2.306897 2.084918 3.323250 1.344723 6.585440 5.529446 3.365324 2.390578 8.444681 8.535306
122 8 2 2.728262 3.643272 1.744517 2.238430 6.071343 8.940192 3.941083 6.391452 5.183863 10.825365
123 8 3 1.538195 1.488471 1.995953 1.464345 2.319995 2.284194 1.810247 1.724147 2.200023 2.438351
125 9 3 nan nan nan nan nan nan nan nan nan nan
126 9 3 nan nan nan nan nan nan nan nan nan nan
127 10 2 nan nan nan nan nan nan nan nan nan nan
128 10 2 nan nan nan nan nan nan nan nan nan nan
129 10 3 1.147921 1.219536 1.488708 1.252700 2.222980 2.289032 1.829721 1.729516 1.617434 1.964930
130 10 3 1.475943 1.286366 2.243697 1.430051 3.022156 2.407963 2.232333 1.542673 2.472685 1.775667
135 12 2 1.321540 1.282226 1.620757 1.177549 2.364309 2.290295 2.054044 2.498893 2.372370 1.687482
136 12 2 2.009755 1.467412 3.415583 1.189666 3.283587 2.044994 4.856174 2.221111 3.017314 3.783413
137 7 3 4.882412 2.477154 18.860421 27.189293 14.392574 6.758548 5.273278 3.119508 8.055086 2.809217
138 7 1 1.117695 7.470211 1.211437 7.072153 2.230228 8.679639 1.982020 4.690098 12.569218 11.641401
140 13 2 1.268516 1.214842 1.442818 2.552224 2.544080 2.597730 1.711286 1.632351 1.713115 1.534274
141 13 2 9.001571 1.400426 17.087512 1.201898 32.162866 2.284691 21.567910 1.589812 21.301808 2.145951
142 13 2 4.438473 3.383932 9.491901 2.116453 15.597007 10.120994 3.950456 2.048096 5.779764 4.994807
143 14 2 1.406354 1.219364 2.739659 1.291136 3.130381 2.015251 2.305170 1.892854 2.198000 2.273545
144 14 3 1.557970 1.440033 1.621064 1.093600 2.513410 2.001665 1.670221 1.745679 2.099984 1.910258
145 14 3 8.323921 4.039631 32.082294 30.283084 27.346665 18.269957 5.125008 2.014730 4.109565 1.929877
150 15 1 4.576793 8.210831 30.058145 57.873617 6.721116 13.894227 6.281240 11.337371 3.765889 1.878041
155 12 2 2.174100 3.946947 9.933567 26.796486 3.556463 5.284338 4.358722 9.297347 4.911421 2.198949
156 12 3 1.605989 1.612765 2.046345 1.528931 3.220051 3.108147 2.326053 2.104366 2.329403 2.252831
157 12 3 1.389046 1.405080 1.647049 1.273166 2.453175 2.337251 2.070250 1.765988 1.963416 1.796836
158 12 3 1.903090 1.307029 4.148193 1.208407 5.316648 2.845918 3.148906 2.128461 4.584343 5.881075
160 13 3 nan nan nan nan nan nan nan nan nan nan
161 13 0 3.356875 1.397303 1.335721 1.758562 5.369050 2.362691 3.679419 2.029773 6.794010 4.032491
162 13 0 1.146590 1.187074 1.189758 1.326551 2.090024 2.550495 1.812328 2.003482 1.546679 2.107279
163 14 2 1.114680 1.281590 1.685439 1.841194 2.014951 2.559238 1.961292 1.923725 1.989069 2.257343
164 14 2 1.067462 1.146654 1.206991 1.250216 1.923000 2.127115 2.007194 3.107150 1.730724 2.133784
165 14 0 7.023758 9.233591 4.516821 10.936433 23.623756 22.290554 3.867867 4.806384 11.808965 5.955387
166 14 0 2.635752 2.389499 1.546991 1.187527 5.193268 4.267881 5.253938 3.943467 3.094100 2.970680
167 15 1 2.523657 3.221107 2.407333 3.401671 4.076176 3.808453 3.335268 2.774194 2.972870 2.101693
168 15 2 1.918320 11.126962 4.323547 44.423800 2.695019 21.775940 5.089574 12.696105 6.755019 5.687735
169 15 2 1.923334 26.707547 3.127070 109.057505 4.078553 72.377176 4.652338 65.337092 11.145862 67.083577
170 15 2 2.048107 29.266369 3.354097 118.882894 4.017958 84.731936 5.372808 69.088664 11.673286 59.074309
176 12 0 0.946602 1.092450 1.386565 2.126781 1.933255 2.402552 1.774792 1.911014 2.018209 2.099181
177 12 0 1.097321 1.175550 1.339313 1.272710 1.969412 2.181867 1.642248 1.496834 1.834741 1.911950
178 12 0 1.121928 1.121468 1.404853 2.113912 2.018915 2.567635 1.800495 2.109844 1.864469 2.019122
179 12 1 1.778781 1.036367 1.429628 1.249652 2.712348 2.121543 5.674093 2.572088 3.067600 2.495855
180 13 3 nan nan nan nan nan nan nan nan nan nan
181 13 3 nan nan nan nan nan nan nan nan nan nan
182 13 0 1.320420 12.120944 1.562735 41.019314 3.065371 37.467618 1.901285 29.734185 2.186436 31.447348
183 13 1 1.375292 1.442282 1.441881 2.024262 2.825047 2.523325 1.850772 1.599289 2.367960 2.793462
184 14 0 1.313922 1.027705 1.374458 1.495477 2.104626 2.056115 1.888073 1.699923 2.348024 3.013141
185 14 1 1.130050 1.344963 1.245344 1.820560 2.010125 2.236685 1.991613 2.921788 2.604484 2.410935
186 14 1 1.223314 1.427670 1.158726 1.249025 1.874787 2.387457 1.648340 1.782106 2.172359 2.768363
187 14 1 1.253556 1.830650 2.248935 2.765624 2.535512 3.412111 3.041244 5.600994 8.408328 18.162559
189 15 3 1.357608 1.337407 1.776117 1.147429 2.987923 2.261865 1.758788 1.614997 1.693279 1.849732
190 15 3 4.270089 3.502622 15.435810 1.207070 6.793507 3.827394 4.383426 2.780862 4.627172 4.642538
191 15 3 1.325236 1.158471 2.048779 1.499520 2.356613 2.312169 2.255382 1.983810 2.467210 1.885613
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.519673 1.131199 3.183510 1.632477 3.913326 2.417597 2.530140 1.753669 2.307049 1.888762
206 19 0 1.313954 1.272585 1.906146 2.341369 1.997750 2.026419 1.870009 1.693324 1.937456 1.595795
207 19 1 1.074349 1.066204 2.055788 4.684995 2.502484 1.880053 1.891551 1.910013 1.747841 1.686280
220 18 2 nan nan nan nan nan nan nan nan nan nan
221 18 2 nan nan nan nan nan nan nan nan nan nan
222 18 2 nan nan nan nan nan nan nan nan nan nan
223 19 1 1.084294 1.149748 1.932307 2.057562 2.341491 2.100584 1.858027 1.636570 1.821539 1.565377
224 19 1 1.133562 7.088101 2.465548 17.353919 1.984238 32.255767 5.359960 29.201824 10.856675 29.399487
241 19 3 nan nan nan nan nan nan nan nan nan nan
242 19 3 nan nan nan nan nan nan nan nan nan nan
243 19 3 nan nan nan nan nan nan nan nan nan nan
320 3 2 5.867166 9.229276 10.185370 40.309392 9.947290 12.662480 9.920707 4.222933 8.494538 2.425291
321 2 3 1.753411 1.540705 1.855378 2.300255 2.140997 2.031200 1.827004 1.842138 1.952926 2.163550
323 2 3 1.210198 2.707305 2.337378 4.498967 2.493732 5.596002 1.822745 1.924962 2.883550 5.578419
324 4 3 1.317454 1.514617 2.074928 2.009946 2.210236 3.008452 1.764191 1.844007 1.862402 2.138588
329 12 1 1.011695 1.879688 3.439798 6.111314 1.865243 2.254359 1.768884 1.659059 1.774693 1.736603
333 12 1 1.794394 1.550600 1.725761 1.534029 2.665890 2.984805 1.651606 1.634600 1.541923 1.668855
In [16]:
csv_file = os.path.join(nb_outdir, 'ds_noise_ratio_{}.csv'.format(JD))
df.to_csv(csv_file, index=False)

Delay spectrum and autocorrelation plot per baseline per polarization for a given frequency (sub-)band¶

Left panel: time averaged delay spectum of autocorrelation in dB with 10*log10($|\tilde{V}|$) (blue) and noise from diff file representing the expected variance of the delay spectrum (red). The time-averaging is performed by 1. binning three time integrations of each even and odd visibility, 2. Fouier transform the binned even and odd visibilities, and 3. multiply the even and odd delay spectra at alternating time bin and average the squared delay spectrum along the time axis. This helps to reduce the noise bias. Both autocorrelation delay spectrum and diff delay spectrum are averaged in the same way

Right panel: time averaged autocorrelations w/o (orange) and w/ xRFI flags (blue). Flagged one is shifted from the unflagged one for clarity

In [17]:
utils.interactive_plots_dspec(bls, uvd, uvd_diff, JD)
In [ ]: