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 = 2459788
Date = 7-27-2022
data_path = "/mnt/sn1/2459788"
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)
392 sum files found between JDs 2459788.25284 and 2459788.37442
392 diff files found between JDs 2459788.25284 and 2459788.37442

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.432379 1.128211 1.649685 1.457311 1.932576 1.841226 1.800754 1.740308 1.699516 1.960090
4 1 2 0.983914 0.984612 2.652722 6.945832 1.771159 1.778287 1.694831 1.837667 1.726325 1.668519
5 1 2 1.004898 1.110248 1.542182 1.398221 1.684226 1.879791 2.140988 1.845270 3.742686 5.223039
7 2 0 1.031208 0.902562 1.815586 1.807203 1.807077 1.892848 1.778581 1.907864 1.870900 1.665484
8 2 0 1.071782 13.113266 2.169166 49.033943 2.114885 32.076638 2.213820 66.742412 2.429016 85.131265
9 2 0 0.905299 0.856952 1.790783 1.239949 1.738467 1.678498 2.168980 1.960350 1.714087 1.547328
10 2 1 0.867442 23.494676 1.879312 95.519207 1.735286 46.131288 1.829180 99.644249 2.534107 124.450183
15 1 3 1.099568 1.119950 1.580944 1.322055 1.856162 1.919047 1.591236 1.900812 3.356672 4.140228
16 1 3 1.034152 0.981208 1.575344 1.334006 1.935355 1.930115 1.864573 1.930424 6.840659 6.066497
17 1 3 1.038108 1.077077 1.326901 1.387692 2.013384 1.778025 1.642600 1.583883 1.824773 1.767994
18 1 0 51.317924 9.345340 1.158788 1.423603 227.929444 40.903318 1.419247 1.899677 1.313701 1.807182
19 2 1 0.906481 18.474936 1.802995 81.766766 1.610237 56.744323 2.069462 77.600748 4.203296 122.520235
20 2 1 0.804138 0.987874 1.817605 1.729876 1.621014 1.732343 1.755655 1.910426 2.507159 2.093192
21 2 2 0.931574 0.903803 1.455433 1.247906 1.764282 1.741376 1.707607 1.873394 1.631651 1.702984
27 1 0 2.765747 4.520185 5.999155 19.830356 7.005643 6.506389 3.418824 1.889608 3.501884 1.888323
28 1 0 74.849005 1.129703 0.907669 1.640909 361.914805 3.894753 1.587787 2.157583 1.479821 2.524709
29 1 1 1.220752 1.171201 2.413499 1.291994 2.375347 1.798024 3.106765 2.338498 3.011486 2.797511
30 1 1 1.056197 0.982172 1.643138 2.087513 2.132055 1.652966 2.905798 2.954152 2.059383 3.862063
31 2 2 1.013604 1.180474 1.362328 1.302854 1.709801 2.004353 2.621112 5.377815 2.755831 7.853193
32 2 2 1.337019 1.971106 0.759320 1.061049 2.073831 2.229156 4.818974 6.258544 4.344548 6.202461
33 2 3 66.036668 0.886697 1.382781 1.525742 322.882175 1.720817 1.598326 1.691136 1.380010 1.654878
36 3 3 1.327892 1.407192 1.889030 1.223376 1.958746 1.749786 1.963017 1.527286 1.394227 1.729326
37 3 1 1.064480 0.989365 6.827869 3.798672 2.192355 1.908078 1.851853 2.143938 2.176978 2.397662
38 3 1 0.964508 0.892508 2.151285 1.271424 1.918424 2.022331 1.826085 2.000259 1.572431 1.674999
40 4 1 0.932301 1.011551 1.824120 1.382377 1.884458 2.045387 1.750130 1.958715 1.543017 2.398298
41 4 3 0.906320 1.133574 1.340777 2.032530 1.920886 2.024813 1.663367 1.765945 1.460609 1.557567
42 4 0 0.893718 0.961568 1.309087 1.218575 2.104641 2.191179 1.642607 1.921657 1.618018 3.358943
45 5 0 1.320415 1.078251 2.869292 1.722678 3.052174 1.610558 2.875160 2.320331 2.595955 2.213172
46 5 0 1.949622 1.692356 1.283663 1.379697 3.441614 2.649238 2.119404 2.014548 2.389535 3.982212
50 3 3 1.178227 0.853314 1.563526 1.394602 1.787643 1.823544 1.722912 1.765650 1.651473 1.536657
51 3 2 5.126691 0.969181 18.379962 1.916923 9.051568 1.640306 5.510905 1.637260 6.653540 1.652092
52 3 3 6.383771 1.023916 28.903522 1.795959 10.603696 1.895248 4.726749 1.802761 5.421651 2.091443
53 3 2 1.038604 1.077284 2.283779 2.415290 2.128059 2.561566 2.077731 2.500545 2.372815 3.527044
54 4 0 0.936593 0.924636 1.213528 1.368153 2.246144 2.210920 1.835324 1.972504 2.057497 2.831264
55 4 2 0.992870 2.081800 1.469688 1.349303 2.181727 3.242403 2.046893 1.819293 2.089781 1.671119
56 4 1 1.143333 1.285543 1.937079 1.645538 2.344202 1.976358 2.508763 2.044229 2.562305 3.271998
57 4 3 0.931361 1.750127 1.686915 8.051583 2.037479 1.842734 1.566929 1.886442 1.547302 1.775317
65 3 0 1.028798 0.814293 2.079160 1.425716 2.026502 1.809422 2.037829 1.774499 1.607543 1.517347
66 3 0 1.281180 0.946418 3.102335 1.388202 2.794709 1.716514 2.360318 1.552297 1.971528 1.759963
67 3 0 1.020443 1.600133 1.406016 1.503405 1.691200 1.686250 1.670999 1.932633 1.536556 1.578426
68 3 1 1.019101 0.986986 1.472386 1.555123 1.767622 1.854198 1.638121 1.945367 1.633222 1.961555
69 4 1 1.052550 0.985762 1.784789 2.224751 1.613176 1.891155 1.833807 2.006646 2.128825 2.259556
70 4 2 1.289155 1.495386 1.753174 1.776036 2.427649 2.528943 2.230578 3.643113 2.011046 2.740457
71 4 2 1.079342 1.118867 1.628190 1.515871 1.800909 2.023144 1.620590 1.689740 1.512661 1.522653
72 4 0 1.047782 1.077822 1.697860 1.723060 2.336108 3.243035 1.957850 2.042189 3.254376 3.680641
73 5 0 0.985943 1.289613 1.474351 1.263139 2.014318 2.023652 1.865636 1.713321 2.221749 2.597162
81 7 0 1.591297 1.426356 1.734356 1.750297 2.029010 2.032744 2.669321 1.809736 8.554489 2.760502
82 7 0 1.045164 0.923629 1.616343 1.239737 1.792591 2.168740 1.862967 1.813939 2.133373 2.383996
83 7 0 1.068775 1.381946 1.552096 6.911155 1.958278 2.890868 1.818365 3.076238 1.669660 6.278992
84 8 3 1.416250 1.419547 1.830199 1.686975 1.915336 1.906926 1.926992 2.035873 3.862258 4.491995
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 nan nan nan nan nan nan nan nan nan nan
88 9 0 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 3.065060 3.005533 0.536418 1.007343 4.585521 3.173250 2.071584 2.138255 2.208403 2.467378
93 10 0 1.056727 0.918433 1.829175 1.340384 1.703059 1.793169 1.610791 1.767423 1.628367 1.845902
94 10 0 0.948184 1.186367 1.683600 2.702044 2.051968 2.788984 2.185810 2.769643 2.297050 9.511278
98 7 2 2.131485 0.953196 1.704600 1.394485 5.240559 1.780645 9.345844 1.582929 100.486846 1.649648
99 7 2 0.960991 1.071612 1.556969 1.530184 1.647193 1.840571 1.796428 1.954462 3.222236 17.751370
100 7 1 1.360769 1.062157 1.907241 1.596784 2.256859 1.932205 1.699394 1.654629 1.696552 1.540341
101 8 2 nan nan nan nan nan nan nan nan nan nan
102 8 0 nan nan nan nan nan nan nan nan nan nan
103 8 1 1.325127 0.915112 1.948837 1.463466 1.976928 1.755499 1.856565 1.761277 2.373949 1.678169
104 8 1 2.034216 1.285156 0.462705 1.624701 2.664448 1.845965 4.376380 1.617469 3.301774 1.482686
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 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 0.925380 1.103864 1.308041 1.355138 1.646283 1.898256 1.693140 1.694004 1.495821 1.441075
116 7 2 0.833398 0.749507 1.492543 1.300634 1.864647 1.686103 1.695489 1.620223 1.823565 1.556473
117 7 3 1.029421 1.061329 1.661382 1.766883 1.824361 1.715349 1.947345 2.423079 1.978238 3.430807
118 7 3 0.951973 1.063367 1.710498 1.563824 1.791372 2.132815 1.771730 2.168064 1.640953 3.704445
119 7 1 1.064595 0.838296 1.382579 1.513419 1.976650 1.701803 2.163450 1.689557 9.617345 1.762958
120 8 1 4.735496 1.689557 11.960128 2.449233 7.594096 3.679816 9.179499 1.757151 24.987534 3.015066
121 8 3 1.677126 2.168809 1.664207 1.554214 3.963030 7.616054 2.677463 2.273379 3.342873 15.269810
122 8 2 nan nan nan nan nan nan nan nan nan nan
123 8 3 1.359642 1.198036 1.620740 1.314739 1.785783 1.675209 1.529839 1.493772 1.496690 1.398506
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 1.213161 0.981449 1.950758 1.487691 2.178671 2.110697 2.292001 2.416186 1.969282 3.064318
128 10 2 0.949466 0.975395 1.770920 1.725869 2.096097 1.796795 1.925583 1.740197 2.048594 2.649450
129 10 3 0.903945 0.959866 1.377756 1.395110 1.789088 1.669053 1.657302 1.567279 1.425850 1.870362
130 10 3 1.178681 0.880269 2.411115 2.323390 2.564438 1.759812 2.226554 1.564263 2.445352 2.300794
135 12 2 1.041032 1.151275 1.985472 1.595144 1.934274 1.815363 1.855613 1.701013 1.691745 1.434519
136 12 2 1.155334 1.070512 2.523924 1.294070 1.847831 1.810513 3.141078 2.113013 1.793628 2.585946
137 7 3 3.498304 3.714532 19.849574 18.763752 10.508236 5.710458 4.092524 2.596819 6.047849 2.346911
138 7 1 1.056636 4.362289 1.418376 5.294682 2.006484 4.899497 1.938931 2.963246 7.318111 5.952949
140 13 2 0.974014 0.955071 1.502154 2.128869 1.969996 1.928764 1.685794 1.840365 2.179241 2.708648
141 13 2 8.477334 1.197052 18.881636 1.608258 31.256409 2.257916 18.239714 1.633768 13.838253 1.602422
142 13 2 4.935594 1.661301 8.104706 1.763012 5.890189 3.735779 2.783918 1.904509 4.541273 4.202948
143 14 2 1.061192 0.897480 2.338500 1.424843 2.225689 1.929554 2.151123 1.871471 1.762876 2.617654
144 14 3 1.174700 1.092040 1.526162 1.562043 2.108475 1.909760 1.539696 1.742010 1.670001 1.929752
145 14 3 3.581159 4.861937 23.025323 21.792984 18.342196 18.142757 3.524212 2.137235 2.712550 2.134936
150 15 1 2.857663 6.260027 21.609963 39.907942 3.966202 5.913643 4.396585 12.260000 7.191791 26.682995
155 12 2 2.426363 3.363504 7.930174 23.040463 3.180743 4.150850 3.274747 7.340267 3.492799 2.148458
156 12 3 1.360807 5.362601 2.169875 21.892617 3.556788 7.421546 2.241505 31.787454 2.313822 37.279315
157 12 3 1.121496 3.085412 1.848032 6.654985 2.151794 2.730144 2.283751 27.446502 2.107507 31.598448
158 12 3 1.220751 1.219581 3.149424 2.641565 2.564432 2.912950 2.513872 3.140280 5.878243 6.633007
160 13 3 nan nan nan nan nan nan nan nan nan nan
161 13 0 2.358785 1.096266 2.965199 1.203210 5.044270 1.742486 2.851133 1.484925 4.369922 3.297989
162 13 0 0.947076 0.979312 1.413983 1.274317 1.781153 1.611637 1.849616 1.461099 1.301263 1.582316
163 14 2 1.044551 1.078404 1.683462 1.801866 2.061782 1.735204 2.071649 1.716508 1.488942 1.803585
164 14 2 0.904165 1.077733 1.357883 1.343308 2.098777 1.675511 1.589998 2.272726 1.774576 1.686712
165 14 0 2.932950 3.830968 2.472512 4.078227 8.772123 9.983266 3.063708 3.033301 3.749364 6.832515
166 14 0 1.041363 1.456052 1.882583 1.323659 2.118932 2.850642 2.053671 3.719281 2.205613 3.611792
167 15 1 2.006473 9.632613 1.819023 54.150317 3.821389 2.934131 2.458873 2.714834 2.636029 2.463574
168 15 2 1.361180 1.110784 3.174339 2.008953 2.417057 1.771699 4.179378 4.875368 5.447051 4.074366
169 15 2 1.236265 8.430408 2.102719 40.456189 2.230023 3.110109 3.180050 8.761871 4.021935 13.586632
170 15 2 1.380487 10.743019 2.410617 52.464235 2.552668 17.090396 3.555985 14.135525 4.680503 27.180763
176 12 0 0.868285 0.903305 1.367332 1.294017 1.622621 1.731087 1.840938 1.638920 1.678721 1.557027
177 12 0 0.867893 1.059359 1.564118 1.196495 1.639950 1.738094 1.464356 1.379205 1.834378 1.764785
178 12 0 0.986672 0.869130 1.527620 2.112366 1.895846 1.807870 1.954726 1.800794 1.670033 1.748700
179 12 1 1.464744 0.908819 1.507077 2.618616 2.284247 1.731848 4.748564 2.383302 2.455284 1.880474
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.230666 1.530908 2.104130 2.592220 2.973687 4.029154 1.928410 2.715159 5.674880 5.157628
183 13 1 1.071041 1.061413 1.785847 2.222913 2.397747 1.903061 1.700359 1.834490 1.863980 2.401997
184 14 0 0.829646 0.912619 1.549132 1.479823 1.731938 1.761779 1.658181 1.682522 1.710278 2.055441
185 14 1 0.871939 1.214791 1.363369 2.583173 1.758651 2.097493 1.724844 2.224751 1.678357 2.364309
186 14 1 0.830964 0.919338 1.311717 2.289286 1.753478 1.528408 1.688853 1.587084 2.458581 1.787298
187 14 1 1.132592 1.443035 2.527195 2.754701 2.377885 2.619281 3.028122 4.101623 11.155419 21.197331
189 15 3 1.018047 1.307266 1.566404 1.510929 1.653107 2.114106 1.597759 1.644870 1.436944 1.978914
190 15 3 3.817472 1.829388 13.329642 0.874773 5.268914 2.922505 3.001087 2.747996 3.179752 3.354000
191 15 3 1.201141 0.975806 3.070017 2.044812 2.167491 1.996369 1.682194 1.703014 1.491684 1.502616
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.422598 0.909968 4.281418 1.896904 3.983621 1.716138 2.674843 1.711593 2.148918 1.803825
206 19 0 1.229916 1.026038 1.646831 2.038991 1.888351 1.707360 1.845095 1.736573 1.651857 1.628920
207 19 1 0.831059 0.849168 1.706640 1.776253 1.699633 1.599130 1.660165 1.762324 1.801964 1.517826
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 0.979948 0.835752 2.139841 1.710463 1.775643 1.739382 1.762603 1.482300 1.935501 1.567504
224 19 1 0.834652 0.768703 1.816754 1.915653 1.845900 1.564846 3.682353 2.423106 6.907407 4.411945
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 6.013438 4.911961 15.347212 30.248698 6.638143 7.415207 6.932127 5.857551 9.683675 17.116540
321 2 3 1.224171 0.906309 1.546842 1.972123 1.749042 1.760047 1.603011 1.821452 1.671250 1.749455
323 2 3 1.128174 1.070320 2.300689 4.268667 1.706034 2.654033 1.637771 1.838637 1.744631 2.016293
324 4 3 0.927120 1.339792 2.586991 2.049421 1.891093 4.156016 1.797610 1.902407 1.785519 1.887426
329 12 1 0.915517 0.941612 1.830433 2.903518 1.504986 1.812965 1.469665 1.678607 1.579596 4.644348
333 12 1 1.098792 1.025328 3.038237 2.283538 2.394136 2.820214 1.796927 1.681887 1.904138 1.571160
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 [ ]: