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 = 2459750
Date = 6-19-2022
data_path = "/mnt/sn1/2459750"
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)
1850 sum files found between JDs 2459750.25309 and 2459750.66671
1850 diff files found between JDs 2459750.25309 and 2459750.66671

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
0 0 0 120.348069 139.482229 233.542535 349.105021 5.704865 12.903474 2.433240 27.003424 0.635217 33.218399
1 0 0 176.855054 152.539382 358.420202 397.503904 3.379169 3.512053 1.202060 2.148158 1.276356 1.516834
2 0 0 142.210808 189.082869 340.110165 469.260291 4.373863 5.136944 2.361635 9.397324 1.521195 2.743584
3 1 2 1.795895 2.019507 1.636381 1.789936 2.100038 2.741159 5.787440 13.092461 11.423086 33.313487
4 1 2 1.322657 1.101458 1.708998 1.767194 1.853547 1.707812 2.030432 1.890493 2.139950 1.976907
5 1 2 1.186658 1.639035 1.703754 1.910646 1.725035 4.611841 2.775689 3.265143 10.383294 14.623430
7 2 0 1.178507 0.988931 1.787823 1.532509 2.029493 1.634773 1.885892 1.583977 2.256995 2.562662
8 2 0 1.160256 43.343045 3.115443 157.392631 2.545066 131.510307 2.649498 115.530089 3.025313 188.151760
9 2 0 0.948141 0.944479 1.679860 1.498936 1.893381 1.866208 2.041261 1.614231 1.921902 2.063226
10 2 1 nan nan nan nan nan nan nan nan nan nan
11 0 1 nan nan nan nan nan nan nan nan nan nan
12 0 1 nan nan nan nan nan nan nan nan nan nan
13 0 1 nan nan nan nan nan nan nan nan nan nan
14 0 2 nan nan nan nan nan nan nan nan nan nan
15 1 3 1.845946 1.371545 2.565081 1.715451 2.848463 2.351700 2.740588 2.631571 15.377425 11.159789
16 1 3 1.330459 1.165448 1.930177 1.444808 2.282936 2.067528 1.982440 1.858101 9.569252 6.963711
17 1 3 1.409849 1.074700 1.616457 1.579464 2.337988 1.647701 1.849346 2.082683 2.720003 3.821319
18 1 0 40.529447 18.569583 1.484878 1.571684 178.997650 77.133793 1.597476 1.996594 2.139556 1.828474
19 2 1 nan nan nan nan nan nan nan nan nan nan
20 2 1 nan nan nan nan nan nan nan nan nan nan
21 2 2 1.154420 2.482099 1.384340 1.859341 2.105465 9.398974 1.953604 6.499752 2.222001 11.150145
23 0 2 nan nan nan nan nan nan nan nan nan nan
24 0 2 nan nan nan nan nan nan nan nan nan nan
25 0 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
26 0 3 1217.234824 0.000000 4562.167645 0.000000 4103.072377 0.000000 5016.841114 0.000000 463.836440 0.000000
27 1 0 63.284071 162.001343 0.810957 7.738942 275.322726 817.307253 1.435703 1.837166 2.397712 1.617762
28 1 0 1.026252 59.399407 1.592998 0.962843 1.739190 260.237898 1.903508 1.516800 2.850995 2.418485
29 1 1 nan nan nan nan nan nan nan nan nan nan
30 1 1 nan nan nan nan nan nan nan nan nan nan
31 2 2 1.272357 1.105246 1.712136 1.686985 2.002408 1.802095 2.076961 2.717192 2.733402 5.154869
32 2 2 3.118513 3.995373 1.701084 1.746843 4.717378 4.513499 9.301190 21.075120 11.149025 18.349731
33 2 3 35.825371 1.219591 1.591563 1.627497 162.308954 1.913881 1.485295 1.833005 2.179433 3.028813
36 3 3 1.741181 1.913151 2.139185 1.725374 2.357526 2.148430 2.147421 1.844685 2.508603 3.372650
37 3 1 1.378274 1.285475 1.992785 1.586089 2.863193 2.372999 1.837728 2.107490 5.256886 5.487625
38 3 1 1.071649 1.281160 1.793094 1.900488 1.928576 2.292393 2.563182 2.567886 2.336251 3.184179
39 0 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
40 4 1 1.206495 1.271130 1.833367 1.768952 2.344541 2.810033 2.271456 2.669830 2.921531 6.680567
41 4 3 1.185231 1.492246 2.059817 2.469845 1.985622 3.629876 1.882173 2.134503 1.988257 2.892500
42 4 0 1.608196 1.206564 1.966396 1.752736 4.295850 2.839370 2.305434 2.954679 9.407545 15.689603
45 5 0 3.377049 1.179474 25.497337 1.852945 5.015965 1.793301 4.399705 1.863922 4.517731 2.171940
46 5 0 2.251577 1.337800 1.808350 1.587097 4.063336 2.335967 2.171600 1.806946 3.101960 3.412639
50 3 3 1.468060 1.081732 1.573315 1.615609 2.390108 1.725258 1.882846 1.740339 2.273215 1.835658
51 3 2 1.099353 1.035927 1.969568 1.862020 2.061206 2.002206 1.931076 1.975147 3.569581 3.387175
52 3 3 1.480186 1.459478 1.758421 1.967585 2.578145 2.239146 2.140054 2.338270 3.392040 3.663839
53 3 2 1.274120 1.770321 2.822314 2.499783 2.660292 3.399531 2.240950 2.670533 7.537321 6.949848
54 4 0 1.470517 1.303332 1.742200 1.796335 3.019040 2.099169 1.893909 2.631483 2.995783 4.781163
55 4 2 1.059053 1.087394 1.778481 1.716279 1.815910 1.768768 2.654940 3.055255 3.178972 2.436969
56 4 1 1.219350 1.124491 1.845663 1.745264 2.310900 1.937160 2.080622 1.757349 2.436544 2.449464
57 4 3 1.328753 1.190849 3.127257 1.176850 3.071081 2.050883 2.342170 1.842171 3.195062 2.211649
65 3 0 1.321624 0.845046 2.405312 1.618434 2.096294 1.599675 1.930170 1.636392 2.140375 2.244129
66 3 0 1.623890 24.022368 4.129204 98.489996 3.494343 79.651485 2.661375 33.063972 3.251968 123.149686
67 3 0 1.077674 1.047739 1.513740 1.687050 2.070924 1.940083 1.649110 1.724939 1.877967 2.248892
68 3 1 1.199008 0.945490 1.659807 1.782562 1.865048 1.790820 1.579370 1.936368 2.469961 2.828827
69 4 1 1.291352 1.111610 2.063190 2.065664 2.113996 2.192807 2.802075 2.247174 3.886106 4.644477
70 4 2 1.788934 1.792710 1.467109 1.395314 2.749900 3.132418 2.306100 3.830677 2.023262 3.252168
71 4 2 1.595049 1.308583 4.181407 2.255083 2.973753 1.918985 2.802582 1.832504 4.814904 1.980630
72 4 0 1.294096 1.220957 2.048078 1.970076 3.013508 2.830191 1.840468 1.971135 3.301571 5.279340
73 5 0 1.352275 1.285712 1.868869 1.664339 2.100673 1.962703 2.016730 1.822645 3.681869 5.734807
81 7 0 2.730560 2.087932 2.101794 1.818354 3.468708 2.675768 5.163919 4.187874 47.477543 27.844780
82 7 0 1.401598 1.148837 1.585234 1.527889 2.031029 2.229229 2.186922 1.800116 9.030040 10.792474
83 7 0 6.483451 5.317322 16.670909 28.052435 6.348229 11.802796 6.101869 2.619664 8.036922 2.355512
84 8 3 1.882951 1.746126 1.537036 2.285856 1.911392 2.358281 1.905776 2.280591 17.315409 20.995299
85 8 0 nan nan nan nan nan nan nan nan nan nan
86 8 0 nan nan nan nan nan nan nan nan nan nan
87 8 2 1.958310 25.369303 9.249488 91.765126 2.289273 80.691780 2.334511 39.497178 6.849936 132.420976
88 9 0 nan nan nan nan nan nan nan nan nan nan
89 9 2 nan nan nan nan nan nan nan nan nan nan
90 9 0 nan nan nan nan nan nan nan nan nan nan
91 9 1 nan nan nan nan nan nan nan nan nan nan
92 10 0 4.216288 2.827160 14.441749 14.239221 4.773133 3.632186 3.685724 1.891223 4.878705 1.759704
93 10 0 6.363859 2.212947 13.601464 1.516755 8.888915 4.988418 5.232320 1.788672 4.065253 2.100190
94 10 0 1.112793 1.328366 1.696662 2.539031 2.062488 2.462210 2.601683 4.072712 3.487214 12.561073
98 7 2 4.750203 3.824611 18.097622 28.811956 6.286366 11.464179 8.021103 3.061657 5.918367 2.483760
99 7 2 1.462333 1.321536 1.671254 1.843891 2.134130 2.508622 2.005623 2.129639 3.119156 7.411664
100 7 1 7.904292 8.101097 32.739180 28.813271 14.103167 26.223753 6.248281 6.845811 7.963788 10.373096
101 8 2 2.062168 1.768857 1.586101 1.831882 1.939787 2.315896 1.872831 2.184611 2.338725 4.471083
102 8 0 nan nan nan nan nan nan nan nan nan nan
103 8 1 1.716768 1.144130 1.835042 1.558440 2.259314 2.168556 1.769460 1.993695 3.715992 3.370331
104 8 1 2.650086 1.333937 3.684092 1.765757 2.355118 1.645651 3.552468 1.821980 3.665264 2.945992
105 9 1 nan nan nan nan nan nan nan nan nan nan
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 nan nan nan nan nan nan nan nan nan nan
108 9 1 nan nan nan nan nan nan nan nan nan nan
109 10 1 2.426866 1.915142 2.162551 2.022429 5.153231 4.011038 1.858604 1.787947 2.309390 2.875183
110 10 1 1.984850 2.917202 1.686796 1.276242 3.026430 3.412669 2.227623 3.421729 2.808654 2.643218
111 10 1 1.425783 1.076868 2.071477 1.453546 2.414072 1.498141 1.894738 1.664898 2.173889 1.475954
112 10 2 3.784856 1.172650 10.453057 1.414714 6.310132 2.294446 4.509673 3.071173 5.065139 5.872396
116 7 2 9.850678 2.819288 8.475819 11.404369 27.465607 5.868803 7.452346 2.664014 7.511875 3.302520
119 7 1 2.581265 3.363686 2.068591 25.942048 8.064699 7.654988 2.139144 1.841506 16.021837 2.244545
120 8 1 7.449731 3.079790 12.645142 2.020506 7.643719 9.986155 9.634319 2.414634 30.304712 7.969950
121 8 3 2.015645 3.292382 2.713515 1.790536 4.505004 11.164983 3.030453 2.687374 6.446715 36.278145
122 8 2 3.039753 2.250953 2.052541 1.639422 5.386056 3.812961 7.067169 6.840470 10.887638 5.858343
123 8 3 1.760449 1.286474 1.977835 1.870820 2.457638 1.972623 2.283018 1.961235 4.698288 4.471596
124 9 2 nan nan nan nan nan nan nan nan nan nan
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 3.757413 4.007602 5.121191 2.786484 9.457661 11.989767 13.209531 10.543275 17.345854 16.229542
128 10 2 0.950876 0.974422 1.774527 2.025275 1.857416 1.872459 1.784080 1.921113 2.976900 4.817707
129 10 3 1.171278 1.019159 1.728541 1.251360 1.905330 1.646343 1.788452 1.738425 1.685137 2.387747
130 10 3 1.539151 2.371203 2.434513 20.765097 2.721828 2.105034 3.324031 1.756773 4.182903 1.701204
135 12 2 1.226591 1.087462 1.768221 1.567801 1.905439 1.879422 2.048486 2.253275 2.365392 1.797024
136 12 2 1.754424 1.302844 5.734949 1.604826 2.336792 1.900556 6.893237 4.394492 2.782540 3.838742
138 7 1 1.573975 1.224058 1.772786 1.645695 3.101916 1.908354 2.334587 2.717418 35.194634 35.624426
140 13 2 1.381905 1.243877 1.926283 1.877550 2.129393 2.239759 1.912707 2.606253 2.478732 3.988223
141 13 2 6.908081 1.427984 15.184976 1.693186 24.997629 2.169788 15.382762 2.296080 12.267263 3.945130
142 13 2 5.543067 1.401991 10.413654 2.391071 6.813291 2.387606 3.577482 2.375463 7.367327 2.561126
143 14 2 nan nan nan nan nan nan nan nan nan nan
144 14 3 1.637114 1.218361 1.544724 1.505575 2.629503 1.946037 1.829106 1.796872 2.354682 2.379142
145 14 3 1.028321 1.278268 1.681593 1.892104 1.871051 2.073900 1.621344 1.686613 2.037525 2.175103
150 15 1 4.648862 11.564150 24.926897 57.901911 6.443852 14.918583 5.745621 19.039819 10.506959 40.471227
155 12 2 3.625389 3.388930 11.153379 26.240897 4.088944 3.951294 4.555202 6.280257 4.967950 2.089347
156 12 3 2.068129 1.599814 2.098543 1.435571 3.796303 3.159982 2.357839 2.127203 2.710770 1.983872
157 12 3 1.510341 1.617474 1.731325 1.670038 2.114451 4.560618 2.408680 3.957611 2.108072 5.877023
158 12 3 2.159184 1.364203 4.526472 1.607736 6.346711 2.432041 3.359734 2.291625 6.899741 7.549795
160 13 3 2.882305 2.752276 1.548888 2.417998 4.510319 7.806906 1.885478 1.988784 2.599067 2.473734
161 13 0 3.452582 1.275970 2.032900 1.705241 6.298329 2.023314 3.321186 1.876463 3.217516 3.683270
162 13 0 1.316713 1.021408 1.981430 1.767039 2.086232 2.327264 2.050192 1.856493 2.056485 1.963225
163 14 2 nan nan nan nan nan nan nan nan nan nan
164 14 2 nan nan nan nan nan nan nan nan nan nan
165 14 0 1.789328 1.289853 2.496171 1.854830 3.449047 2.888068 2.301479 2.745814 5.484011 7.497877
166 14 0 3.647152 2.836102 1.929168 1.693968 5.359031 6.310587 9.048181 8.086786 6.356605 6.640227
167 15 1 3.026359 18.918156 2.206791 117.197620 4.361056 3.739076 2.908460 2.901035 2.300556 4.262652
168 15 2 3.578163 6.483897 18.316170 26.657074 4.377356 19.552535 6.475018 17.098645 19.997734 35.393471
169 15 2 1.453473 25.511341 2.734991 105.831235 2.136487 61.757405 3.266480 39.088296 4.205823 88.639919
170 15 2 2.014497 24.239875 3.575393 115.253398 4.940185 56.912628 4.527855 37.574766 5.714999 80.877202
176 12 0 1.039584 1.004077 1.656127 1.667694 2.035156 1.818698 2.145463 1.800912 2.957524 2.412845
177 12 0 1.127079 1.110716 1.967576 1.739679 1.834118 1.960829 2.079318 1.632680 3.403510 3.376736
178 12 0 1.304158 1.077465 1.925359 1.518905 2.325101 2.103753 2.018853 2.337551 2.574673 3.000101
179 12 1 2.120396 0.929571 1.696666 1.724555 3.261379 1.671490 10.438006 2.971472 6.579278 3.211190
180 13 3 2.933018 7.716267 19.448097 2.293611 4.091974 17.586782 3.235143 11.222553 2.956134 36.761562
181 13 3 1.550046 1.453860 1.986686 1.285501 2.782071 2.894024 2.299340 1.483326 2.104586 1.908124
182 13 0 1.352853 8.309668 1.832485 34.316074 3.389571 23.953497 1.876004 10.935533 2.268534 38.521407
183 13 1 1.505505 1.295727 1.755287 1.694559 3.120059 2.174680 2.055026 1.846688 3.221792 3.690251
184 14 0 1.183811 0.971184 1.774096 1.609333 1.860448 1.892577 2.199105 1.907126 3.575418 5.193785
185 14 1 nan nan nan nan nan nan nan nan nan nan
186 14 1 nan nan nan nan nan nan nan nan nan nan
187 14 1 nan nan nan nan nan nan nan nan nan nan
189 15 3 nan nan nan nan nan nan nan nan nan nan
190 15 3 nan nan nan nan nan nan nan nan nan nan
191 15 3 nan nan nan nan nan nan nan nan nan nan
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
320 3 2 7.248041 5.830229 19.119185 33.956537 6.979698 5.405378 9.146178 4.345260 11.145287 20.121282
321 2 3 1.386486 0.980462 1.623815 2.123304 1.905376 1.860932 1.671753 1.698771 1.989693 1.976082
323 2 3 1.141284 2.058860 2.235515 6.114666 1.665304 3.788298 1.877152 1.647396 2.038520 2.869120
324 4 3 0.944951 14.123694 2.151509 70.490974 2.248161 8.557779 1.909774 4.968208 1.913438 9.546878
329 12 1 0.908351 1.057602 1.970195 1.604774 1.999414 2.199753 1.885568 1.734336 2.268874 2.861705
333 12 1 1.268742 1.923755 1.842530 2.725927 2.064174 5.071514 1.614428 1.645402 1.769500 1.579474
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 [ ]: