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 = 2459782
Date = 7-21-2022
data_path = "/mnt/sn1/2459782"
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)
372 sum files found between JDs 2459782.25338 and 2459782.33638
372 diff files found between JDs 2459782.25338 and 2459782.33638

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 2.672278 0.998105 1.553170 1.369361 6.812727 2.312341 1.796337 1.546379 1.607887 2.044071
4 1 2 1.535554 1.166488 2.578399 4.998657 5.484513 1.800378 2.030889 1.848418 2.340808 1.791775
5 1 2 1.728461 1.038308 1.498647 1.431673 4.699837 2.070710 2.012347 1.679386 5.677384 5.268132
7 2 0 1.925406 0.942129 1.452902 3.106601 6.050756 1.996195 1.564472 1.894203 1.702377 2.896327
8 2 0 1.590661 28.585748 3.077361 102.109662 3.686679 94.134257 2.722946 101.093342 3.273325 100.131251
9 2 0 1.802653 0.871856 1.462932 1.253440 4.818057 1.787736 1.959782 1.718808 1.750963 1.460521
10 2 1 nan nan nan nan nan nan nan nan nan nan
15 1 3 2.063975 1.154449 1.866200 1.263643 5.077151 2.776159 1.714740 1.811223 2.519822 3.044910
16 1 3 2.112904 1.064742 1.680738 1.448745 4.939890 2.309860 1.746405 1.748715 6.366519 4.973978
17 1 3 1.909406 1.050605 1.358940 1.366651 5.254250 2.533660 1.633838 1.693680 1.560366 2.037487
18 1 0 118.864056 80.044130 3.503190 2.712620 645.414438 453.321018 1.777495 1.679011 1.728950 1.558365
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.598380 0.878724 1.531821 1.474355 5.286047 1.958633 1.763517 1.654142 1.759278 1.909523
27 1 0 2.427318 1.902927 5.161116 6.146376 7.595517 4.010449 3.281237 2.059829 3.521585 1.970306
28 1 0 118.495329 1.589034 2.893099 1.860812 581.662695 5.485408 1.626471 2.020419 1.926615 3.007956
29 1 1 2.139804 1.055504 1.333713 1.459945 4.782537 2.176594 2.772603 2.558631 2.275367 3.071214
30 1 1 1.937522 0.894492 2.415110 2.237198 5.145287 2.240839 2.844437 2.584029 2.071053 2.569756
31 2 2 1.709454 1.141838 1.372486 1.524893 5.789955 2.175089 2.121126 3.626594 2.518264 9.350137
32 2 2 2.219880 1.776815 1.358045 1.073005 7.314837 2.244172 3.989320 5.106310 3.716470 5.385679
33 2 3 105.192682 0.977540 3.168352 1.573418 518.925162 2.284334 1.585856 1.728390 1.563013 1.887001
36 3 3 1.914245 1.269029 1.530489 1.544665 3.265127 2.326539 1.627392 1.633602 1.469749 2.237906
37 3 1 1.880330 0.940830 4.431855 1.911449 6.272994 2.062104 1.963424 1.751271 2.361893 2.117181
38 3 1 1.947156 0.982869 1.738358 1.290805 5.785704 2.276972 1.768556 2.212637 1.646334 1.583695
40 4 1 1.953836 1.029925 1.889339 1.356973 5.958320 2.047235 1.692615 1.920832 1.641098 3.085543
41 4 3 1.859512 1.215986 1.554073 3.384930 5.201061 2.166441 1.631781 1.718879 1.696890 2.629631
42 4 0 nan nan nan nan nan nan nan nan nan nan
45 5 0 2.245253 1.025841 3.145794 1.636529 6.689361 2.163181 2.999485 2.159173 3.882407 2.318009
46 5 0 2.069702 1.240984 1.550063 1.336297 7.097457 2.446264 1.925362 1.632325 2.044679 2.103957
50 3 3 1.493053 0.849219 1.499321 1.290172 3.845800 2.192905 1.777617 1.716444 1.703039 1.602109
51 3 2 nan nan nan nan nan nan nan nan nan nan
52 3 3 5.029727 1.425090 13.819827 2.130848 2.882550 2.868577 4.050677 1.944480 3.751660 2.134264
53 3 2 nan nan nan nan nan nan nan nan nan nan
54 4 0 nan nan nan nan nan nan nan nan nan nan
55 4 2 1.461863 0.817064 1.491344 1.406171 4.810656 2.249041 1.977677 1.841289 1.635927 1.747053
56 4 1 1.703753 1.050497 1.688925 1.372762 5.485808 1.964463 1.956894 1.623640 1.762754 1.651459
57 4 3 1.917648 1.579732 1.688690 4.563578 5.885131 1.708624 1.798465 1.968893 1.624866 2.559772
65 3 0 1.749794 0.840649 2.929618 1.342045 4.649655 1.914043 2.059191 1.673105 1.951326 1.493540
66 3 0 2.531244 1.279239 4.085090 1.268033 8.577051 2.871396 2.798400 1.500340 2.331561 2.038427
67 3 0 1.495175 1.049685 3.136326 1.405538 4.382765 2.566131 1.871582 1.591303 1.688068 1.556613
68 3 1 2.301984 0.984731 1.495072 1.546196 8.376019 2.741530 1.657362 1.647247 1.598986 1.928023
69 4 1 2.127690 1.028242 1.487423 1.756822 6.209457 2.096418 2.366795 2.070928 3.184933 3.026768
70 4 2 2.678076 1.211833 1.685296 1.578512 7.038622 2.285457 3.303101 2.264017 2.519593 1.935748
71 4 2 2.103997 1.283604 1.369157 1.323001 6.205959 2.031468 1.712832 1.678115 1.537579 1.658293
72 4 0 nan nan nan nan nan nan nan nan nan nan
73 5 0 1.920759 1.071865 1.340771 1.247138 5.048181 2.396188 1.537265 1.573995 1.517054 1.708263
81 7 0 2.102088 1.179564 2.046354 1.489886 4.264335 2.245447 3.252406 1.623039 17.291933 3.404587
82 7 0 1.625653 0.929874 1.443525 1.185134 4.698700 2.296982 1.582475 1.757215 1.997650 1.839373
83 7 0 2.414261 1.239349 1.594156 7.305363 6.900699 2.108961 1.652999 2.033560 1.787121 2.227130
84 8 3 nan nan nan nan nan nan nan nan nan nan
85 8 0 3.953766 0.961025 7.766294 1.776653 11.039522 2.103799 2.032758 1.781819 3.650251 2.256091
86 8 0 1.400851 1.317411 3.041945 1.617742 3.487105 2.434691 2.948236 1.863339 3.037417 2.310890
87 8 2 1.853848 1.319473 2.500992 2.850094 3.938994 2.411781 2.783725 2.358974 4.457933 3.736671
88 9 0 3.652771 16.913437 10.539032 14.195709 3.959615 6.997513 3.780997 2.020420 3.690750 1.743556
90 9 0 8.186145 2.804282 3.355530 4.882899 16.681175 4.645503 22.408531 2.311884 24.702090 2.584889
91 9 1 nan nan nan nan nan nan nan nan nan nan
92 10 0 nan nan nan nan nan nan nan nan nan nan
93 10 0 nan nan nan nan nan nan nan nan nan nan
94 10 0 nan nan nan nan nan nan nan nan nan nan
98 7 2 1.927637 0.901598 1.781328 1.578651 5.691466 2.058130 9.601072 1.621338 154.954964 2.135852
99 7 2 1.543047 1.501812 1.489017 1.416792 5.780412 3.690701 1.800301 4.500481 1.923453 16.557004
100 7 1 1.958274 1.156697 1.716392 1.773012 5.824423 2.690239 1.557959 1.858449 1.699267 1.886872
101 8 2 2.755151 1.325037 1.697468 1.601017 5.066994 1.701163 1.860110 1.727291 2.303930 3.032530
102 8 0 1.484009 0.880886 1.568674 1.844091 4.530008 2.078362 1.695781 1.869737 1.840038 2.426789
103 8 1 2.587560 0.981595 1.746799 1.776775 4.527380 2.452500 1.660847 1.760224 2.224347 2.246495
104 8 1 1.729001 2.051583 1.467538 1.782385 3.430161 4.232508 2.855810 1.575282 8.723946 1.922554
105 9 1 nan nan nan nan nan nan nan nan nan nan
106 9 3 2.208364 2.084485 1.631077 1.558104 6.176861 5.897915 2.962440 3.397246 3.887309 2.823424
107 9 0 6.438214 30.508637 26.832658 194.211062 4.682974 21.622958 10.496373 76.583940 17.635431 134.207216
108 9 1 nan nan nan nan nan nan nan nan nan nan
109 10 1 nan nan nan nan nan nan nan nan nan nan
110 10 1 nan nan nan nan nan nan nan nan nan nan
111 10 1 nan nan nan nan nan nan nan nan nan nan
112 10 2 2.259343 1.541674 1.625568 3.399700 6.056686 2.260416 1.751726 1.675318 1.590881 1.871671
116 7 2 1.650656 0.894979 1.486201 1.260221 5.972824 2.479370 1.908266 1.605453 2.391522 1.530232
117 7 3 1.563126 1.041123 1.773539 1.294855 3.959897 2.080022 1.899750 2.138505 2.421623 3.078964
118 7 3 1.492289 1.124707 1.719549 2.039803 4.673930 2.667707 1.665245 1.958850 1.743674 3.558496
119 7 1 2.012363 1.047289 1.356612 1.807527 7.219207 2.409970 1.585459 1.901894 1.851250 2.485087
120 8 1 4.598740 3.127876 8.070875 1.791971 5.883412 8.451746 7.846950 1.769511 21.093683 3.013550
121 8 3 nan nan nan nan nan nan nan nan nan nan
122 8 2 3.348638 2.235070 1.762697 2.030854 8.981142 7.129368 3.732727 3.784308 8.593450 8.995203
123 8 3 nan nan nan nan nan nan nan nan nan nan
125 9 3 1.718607 1.316938 12.778709 4.777899 2.958298 3.657932 2.638374 1.887243 2.651167 1.869493
126 9 3 1.729859 1.160215 11.845108 3.893587 3.220528 2.594634 3.260261 1.940167 3.384873 2.027687
127 10 2 2.218242 0.963573 2.839364 1.297292 5.666673 2.281232 2.734084 2.072400 2.465766 2.145931
128 10 2 1.594917 1.098208 1.566785 2.011414 4.851471 2.474301 1.839427 2.021346 2.884504 6.815864
129 10 3 2.338822 0.951481 1.555769 1.243281 5.805998 2.224236 1.624358 1.642039 1.380240 1.986421
130 10 3 2.049293 1.123723 2.102609 1.231477 5.044310 3.080811 2.116001 1.632244 2.194777 1.553436
135 12 2 1.294837 1.177498 1.820110 1.410375 3.751920 2.866976 1.790245 1.664273 1.704584 1.493076
136 12 2 1.923025 1.275042 3.547691 1.400480 5.860510 3.375909 4.791230 2.245268 2.688600 2.754719
137 7 3 1.552320 1.838761 3.479574 6.950242 3.700708 2.817623 3.525944 1.958742 3.696953 1.925125
138 7 1 2.231765 1.620606 1.757092 2.692751 7.794023 1.674306 2.049279 1.999443 7.146263 2.161263
140 13 2 1.985770 1.340735 1.448060 1.950738 5.118366 3.757618 1.605502 1.747605 2.357681 3.040644
141 13 2 2.567804 1.341307 6.433327 1.306162 7.940657 3.763520 5.445657 1.643917 4.948440 1.728004
142 13 2 2.004508 2.532566 3.539647 3.412542 3.719516 6.004468 2.395862 1.728602 2.908161 2.299405
143 14 2 2.046482 0.936297 2.207597 1.389957 7.533293 2.414775 1.900316 1.485837 1.824111 1.380313
144 14 3 nan nan nan nan nan nan nan nan nan nan
145 14 3 nan nan nan nan nan nan nan nan nan nan
150 15 1 3.309907 11.123428 23.282667 51.151466 5.049382 11.755554 4.425099 19.122972 4.915142 32.814415
155 12 2 1.423406 1.285857 4.036812 6.181530 1.927727 1.607453 2.777504 1.903894 2.948042 1.697094
156 12 3 2.129965 1.033771 1.521510 2.411246 5.336849 2.569076 1.630342 1.541726 1.520525 1.445356
157 12 3 2.163785 1.307908 1.541103 1.163587 4.699401 3.437000 1.790127 1.755971 1.629228 1.560279
158 12 3 2.473166 0.963274 3.244686 1.866474 7.974829 2.384925 2.623801 2.002851 2.723526 2.743051
160 13 3 2.107747 2.635603 10.802854 25.290116 2.735148 2.489197 3.282274 3.959695 3.714335 4.028188
161 13 0 nan nan nan nan nan nan nan nan nan nan
162 13 0 nan nan nan nan nan nan nan nan nan nan
163 14 2 1.990948 0.989118 1.804167 2.034985 6.318211 2.244868 1.700137 1.705238 1.552051 2.743648
164 14 2 1.883221 0.971658 1.218445 1.232747 4.884186 2.150874 1.430632 2.011141 1.669800 1.756563
165 14 0 4.483920 12.313045 2.090428 12.607225 13.742254 38.878183 2.346189 5.961688 5.069076 4.904716
166 14 0 2.441608 1.932941 1.733371 1.238844 7.761898 4.329287 4.122614 3.667996 2.927639 3.309251
167 15 1 2.168409 2.086579 3.260842 1.759032 5.499103 1.934382 2.443056 1.860297 2.904702 1.855767
168 15 2 1.716381 1.330302 3.331194 3.814323 3.486942 3.201736 3.716929 3.768264 5.096484 4.376175
169 15 2 1.695478 12.247280 2.575823 58.084175 3.872503 9.738180 3.696350 7.048463 6.479630 16.950143
170 15 2 1.670865 16.231104 2.982681 77.718062 4.554405 36.325222 3.705844 21.380796 4.232349 44.618235
176 12 0 1.435556 0.964399 1.511822 1.519939 3.038020 2.185544 1.729096 1.578550 1.874901 1.656930
177 12 0 1.651559 1.098018 1.633205 1.574719 5.005519 3.385331 1.782700 1.923418 1.716612 2.082666
178 12 0 2.131241 0.982251 1.720468 1.687133 6.521240 2.129561 1.819840 1.842314 1.805779 1.582485
179 12 1 2.728460 1.433907 1.489484 1.923051 7.245846 2.459356 4.562005 1.713641 2.360243 1.995173
180 13 3 1.591822 1.371342 6.205726 1.419183 2.038306 3.000031 2.362746 1.710260 1.835868 2.100562
181 13 3 1.470869 1.932702 2.501821 4.935228 4.095246 2.978347 1.855768 2.079455 2.141734 1.751771
182 13 0 nan nan nan nan nan nan nan nan nan nan
183 13 1 1.885623 1.113866 1.612548 1.961857 5.439097 2.986143 1.491962 1.777393 1.630582 2.587421
184 14 0 1.678673 0.982569 1.603850 1.380283 5.960522 2.200223 1.829343 1.474685 1.766651 2.637653
185 14 1 2.085362 1.046732 1.383495 2.062049 5.761096 1.958848 1.943619 2.529010 1.699896 3.124481
186 14 1 2.033401 0.866828 1.400516 1.626475 6.995878 2.034129 1.836252 1.676074 1.782828 1.978419
187 14 1 2.093559 1.153213 1.908044 2.067274 4.218527 2.874392 2.143988 2.335816 5.656135 4.634139
189 15 3 1.756196 1.367793 1.357949 1.442076 4.957470 2.811537 1.509772 1.565686 1.411046 1.554710
190 15 3 1.703516 2.344207 4.977147 1.306753 1.973045 3.338335 2.799069 2.218806 2.438055 3.662784
191 15 3 2.097510 1.010989 1.368937 1.396815 5.915172 2.599846 1.863755 1.823944 1.558201 1.455826
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.799250 1.035884 3.338611 1.999694 4.391821 3.212804 1.716059 1.905003 2.259925 2.274333
206 19 0 1.691246 1.074385 1.753190 4.146113 4.229529 2.243852 2.026299 1.730415 2.157984 1.453088
207 19 1 0.935310 0.922824 1.830416 1.746020 2.292734 2.747990 1.794887 1.823108 1.839367 1.821559
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.409281 1.001189 1.805859 1.916090 2.863970 2.107095 1.727932 1.818696 2.048233 1.882776
224 19 1 1.149529 0.856073 2.142119 2.501185 2.639861 2.282742 3.953673 2.293502 8.869519 4.700543
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 nan nan nan nan nan nan nan nan nan nan
321 2 3 1.615863 1.014008 1.650057 2.171008 2.544053 2.752592 1.591883 1.721708 1.733774 1.866611
323 2 3 1.847499 1.280906 3.462200 4.301716 4.352046 3.027246 1.817600 2.103158 2.330317 2.865382
324 4 3 1.282038 1.199087 2.197343 2.008001 3.136515 2.403332 1.607978 1.716876 1.722233 2.098002
329 12 1 1.430328 0.907696 1.922899 1.940407 3.334339 2.144925 1.844276 1.833829 1.756399 2.817503
333 12 1 1.461216 1.307530 2.250928 2.936754 4.136026 2.651328 1.686531 1.953781 1.618267 1.867368
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 [ ]: