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 = 2459755
Date = 6-24-2022
data_path = "/mnt/sn1/2459755"
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 2459755.25305 and 2459755.33604
372 diff files found between JDs 2459755.25305 and 2459755.33604

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 130.129858 96.201735 261.446406 251.127836 3.523947 18.325758 1.438193 16.542735 0.804964 1.994649
1 0 0 41.343208 136.838450 86.115797 319.914603 0.949809 2.229561 0.477528 1.124911 0.511023 0.820813
2 0 0 89.083462 86.259610 203.324443 221.421981 2.544300 1.902069 2.679187 2.957419 2.162360 1.253646
3 1 2 1.348328 1.831458 2.023823 1.663449 2.555502 2.948025 7.314558 14.309279 4.864211 12.080088
4 1 2 1.119119 0.880227 2.036360 1.528542 2.549319 1.965092 1.702222 1.882852 1.762954 2.228955
5 1 2 1.046712 0.985664 1.855356 1.634333 2.093260 2.224854 2.022288 2.111759 7.348175 10.874048
7 2 0 0.941292 0.797437 1.739994 1.658611 2.533913 2.061161 2.100141 1.839166 2.288206 2.292494
8 2 0 0.936625 3.461334 2.498807 3.583379 2.111382 2.882029 2.142264 2.224143 2.737912 10.961799
9 2 0 0.947405 0.960357 1.717889 1.609259 2.291044 2.506973 2.250489 2.160993 1.934760 2.738857
10 2 1 0.930592 1.013401 1.587181 1.880312 2.178189 2.398241 2.072865 2.772777 2.140731 7.177198
11 0 1 89.610062 318.781140 551.091620 867.611491 35.318696 226.664662 67.772998 957.970887 6.621271 332.516734
12 0 1 134.912645 245.709039 424.807419 943.032636 112.239420 132.300200 42.562510 444.410108 32.352151 12.123579
13 0 1 145.450571 196.022940 287.323313 548.306593 53.694742 88.536093 22.842850 303.644443 10.329206 45.642412
14 0 2 69.245442 251.812736 420.445552 2699.090755 61.110590 261.780298 20.801613 123.933474 7.370804 53.458874
15 1 3 1.345002 1.074411 1.711384 1.487215 2.682724 2.181423 2.126364 2.071896 12.377558 16.372387
16 1 3 1.268740 1.055652 1.721762 1.460734 2.380797 2.284149 2.274305 2.275100 15.164314 21.270448
17 1 3 1.424035 0.961758 2.053801 1.483397 3.211254 1.853459 1.505096 1.594004 2.085491 3.361130
18 1 0 29.962842 4.403973 1.346923 1.627851 124.766993 13.551364 1.599336 2.306502 2.003837 2.167495
19 2 1 1.028592 1.007757 1.717774 1.902276 1.887769 2.394097 2.458909 2.801202 5.487191 16.364058
20 2 1 0.953664 0.930505 1.591120 1.582369 2.116550 2.321553 1.786820 1.915247 2.178288 2.974540
21 2 2 1.114118 0.930177 1.573049 1.605362 2.429463 2.312731 1.882935 2.331823 2.272490 8.692531
23 0 2 106.801952 120.051118 285.514888 302.749022 6.476245 9.123989 1.535346 6.477341 2.392262 1.535608
24 0 2 104.476923 120.372931 236.453307 287.441282 2.503171 2.699638 1.590628 1.162020 2.101620 1.113102
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 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
27 1 0 41.770617 153.291107 0.930892 5.090823 185.076107 649.130871 1.768149 1.738236 2.381876 1.806313
28 1 0 0.841602 37.532831 1.363596 1.049823 1.894501 156.482264 1.848480 1.767832 2.066309 2.567425
29 1 1 1.214388 1.129193 2.791973 1.475081 2.740644 2.076855 2.797894 2.675053 4.509548 2.668602
30 1 1 1.174230 0.945872 1.983672 1.695523 2.164975 2.037345 2.865389 3.289076 3.343950 3.504755
31 2 2 1.058528 1.065651 1.664629 1.660244 2.426798 2.251936 2.519456 5.176087 3.051359 9.302387
32 2 2 1.710042 2.145201 2.151347 1.729840 3.262164 3.099392 6.804429 10.221408 13.122109 15.939765
33 2 3 28.961473 0.920896 1.752028 1.626309 139.933762 1.996146 1.864694 1.659458 2.440399 2.472869
36 3 3 1.373853 1.209276 1.856041 1.726495 1.983129 2.035792 1.825414 1.702243 1.983685 3.502838
37 3 1 1.171888 0.929740 2.728102 1.581241 3.281114 2.469764 2.304555 2.238397 5.010169 5.808623
38 3 1 1.029510 1.130966 2.044050 1.651828 2.216584 2.640104 3.359343 2.824773 2.268209 2.641032
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.065315 1.006793 1.593834 1.755743 2.480844 2.523946 1.872720 2.266380 2.311005 5.955393
41 4 3 1.048633 0.983881 1.666422 1.713228 2.245309 2.354113 1.708938 1.797391 1.710566 2.306569
42 4 0 1.091922 0.946197 1.727461 1.623161 2.736072 2.230451 1.905968 2.113541 13.877407 14.663087
45 5 0 3.099556 1.084847 19.350311 1.540206 3.426725 1.976680 2.987806 1.813949 3.210565 2.165141
46 5 0 3.690473 1.846226 1.940399 1.807412 7.433341 4.346731 2.968590 3.288585 6.414629 13.899753
50 3 3 1.195666 0.952940 1.674325 1.530328 3.320175 2.750620 2.475814 1.899270 4.124676 3.325138
51 3 2 0.999070 0.840873 1.886991 1.491888 2.372160 2.156782 1.861819 1.880619 2.539046 3.222414
52 3 3 1.275910 1.408850 2.124521 2.341676 2.980718 3.005297 2.394345 2.819300 3.743495 5.148128
53 3 2 1.132649 1.021396 2.139474 2.439109 2.798649 3.013885 2.144218 2.401134 4.548350 5.793631
54 4 0 1.032960 1.100803 1.699264 1.557892 2.327420 2.236752 1.684246 2.145806 2.191734 4.085959
55 4 2 0.890472 1.000989 2.560090 2.013773 2.226938 2.288036 1.828563 1.751298 2.891851 2.091163
56 4 1 1.132854 0.908864 1.636956 1.752774 2.532341 2.354257 1.654588 1.591398 2.051911 2.134784
57 4 3 1.121402 0.927543 2.358609 1.306741 2.599538 2.078810 2.306140 1.699253 2.503489 2.095557
65 3 0 1.295165 0.917455 3.020846 1.468719 2.947102 1.963228 2.392793 1.647040 3.230359 2.363546
66 3 0 1.280871 0.905765 2.428264 2.037826 2.775726 2.273042 1.956211 1.691154 2.092692 3.148055
67 3 0 1.110805 0.852346 2.220635 1.568441 2.985060 2.184891 1.609073 1.836286 1.870730 2.427913
68 3 1 1.125797 0.848876 1.667466 1.621056 2.730486 2.027799 1.779562 1.642075 1.916601 2.064179
69 4 1 1.023615 0.846346 1.684886 1.748276 2.403336 1.982724 1.891306 1.712130 2.500987 3.146284
70 4 2 1.475775 1.310819 1.861833 2.522605 3.837501 2.503692 2.145745 2.156034 1.953326 2.735184
71 4 2 0.867795 1.015262 1.709708 3.934551 1.864884 2.167286 1.887879 1.986183 1.912132 1.953453
72 4 0 0.978916 0.985908 2.392412 1.784873 2.642627 2.457318 1.753997 2.232036 4.519964 5.868784
73 5 0 1.161532 1.073454 1.346089 1.517162 2.753243 2.056384 1.726984 1.768369 4.636081 5.813347
81 7 0 1.347303 1.183100 1.979971 1.616808 2.639654 2.262346 2.883706 3.678690 14.539986 12.582224
82 7 0 1.165595 1.019703 1.602709 1.867711 2.671108 2.237158 2.147844 1.884679 7.144704 8.252648
83 7 0 3.934442 3.527022 12.155259 26.936675 3.840821 5.085944 4.300198 2.122764 5.674304 2.344193
84 8 3 2.421419 2.181982 1.600402 2.111599 4.389581 5.938736 3.094065 3.933610 8.458448 8.320093
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
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 2.795696 1.907346 9.898968 8.394857 3.542778 2.975860 3.096167 1.717802 3.755996 1.793040
93 10 0 4.859592 1.747006 8.656241 2.541883 6.107591 2.497127 3.624059 1.936317 3.407733 2.420588
94 10 0 1.039422 0.961375 1.648023 1.720520 2.774472 2.184972 2.275305 2.501990 3.133889 7.146611
98 7 2 3.188774 3.448574 14.798046 20.865574 4.674496 12.340588 6.029725 2.508816 3.897489 1.991122
99 7 2 1.122325 0.908225 1.727047 1.575324 2.416025 2.137675 1.775440 1.794920 2.957243 3.788531
100 7 1 5.590128 4.529409 20.739040 21.601496 12.025765 20.284332 3.715115 3.991599 4.799471 2.927309
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.279635 0.957130 1.675371 1.395306 2.225853 2.224342 1.623069 1.639477 2.058453 2.670938
104 8 1 2.341463 1.203096 2.765850 1.739093 2.218218 2.724413 2.171402 1.605685 12.169669 2.200429
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 1.361336 0.987187 1.789506 1.696680 3.278120 2.855154 1.710759 1.764815 1.812830 2.036601
110 10 1 1.249802 2.118094 1.730636 1.162526 2.575216 4.072075 1.556729 3.294799 1.947198 2.445402
111 10 1 1.336923 0.975096 2.461761 1.457390 3.190899 1.994992 2.006075 1.649323 2.072121 1.597416
112 10 2 2.530624 1.012047 7.599526 1.670940 3.777796 2.396357 3.018804 2.688908 4.523593 4.288565
116 7 2 7.738865 2.354414 5.156007 13.176777 21.390848 6.081838 5.148824 2.979931 7.008368 5.098848
119 7 1 2.274942 5.010234 1.833010 20.053404 5.686832 9.919930 2.469683 1.946372 11.189476 2.065817
120 8 1 4.801274 2.253289 8.156232 1.968348 5.229306 2.794671 7.822836 1.704872 20.900342 2.104861
121 8 3 1.628683 1.642084 1.861461 1.564818 4.162494 2.737232 2.349870 1.948082 3.904756 34.355618
122 8 2 nan nan nan nan nan nan nan nan nan nan
123 8 3 1.338009 1.020924 1.676441 1.731889 2.668985 1.946005 1.987844 2.009499 3.542994 3.589215
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 1.675735 1.725442 2.299126 1.922284 3.402506 5.476694 4.669895 4.785921 5.348825 7.024254
128 10 2 0.981231 0.968467 1.665370 1.845928 2.427873 2.085065 2.007318 1.759607 3.025789 5.300224
129 10 3 1.049902 0.891378 1.784160 1.548034 2.471863 2.356571 1.770330 1.762302 1.758128 2.478140
130 10 3 1.281648 1.546791 2.711094 14.596322 2.122549 1.689535 2.130909 1.879606 3.287525 1.731562
135 12 2 nan nan nan nan nan nan nan nan nan nan
136 12 2 nan nan nan nan nan nan nan nan nan nan
138 7 1 1.354057 0.898874 2.018709 1.602481 2.937226 2.057283 2.074148 2.165912 15.748861 14.088687
140 13 2 1.119824 1.021808 2.102273 1.687998 2.956724 2.266033 1.711572 2.148711 2.282483 2.722651
141 13 2 5.641028 1.162160 23.320592 1.617434 20.652396 2.468817 10.634064 1.765853 9.888498 2.357643
142 13 2 2.555206 1.191374 5.952479 2.742127 6.272452 3.108295 2.840000 2.226632 3.774149 2.226714
143 14 2 1.063353 0.851988 2.044775 1.563114 2.327072 2.130447 1.941629 1.798312 3.072174 3.095383
144 14 3 1.306830 1.158925 1.595792 1.395662 2.878634 2.675064 1.659008 2.024573 1.859891 2.284223
145 14 3 0.926936 0.879854 1.769728 1.661856 2.038849 2.667079 1.700093 1.766647 1.926256 2.099328
150 15 1 2.798450 3.877846 14.720755 40.091726 6.302559 7.544745 3.089272 2.843743 2.610804 2.193056
155 12 2 nan nan nan nan nan nan nan nan nan nan
156 12 3 1.352817 1.385114 1.674109 1.768234 3.358448 2.504073 2.299426 2.004786 2.204546 2.468448
157 12 3 1.195489 1.057063 1.675537 1.591107 2.644989 2.427959 1.994390 1.898081 1.960222 2.155215
158 12 3 1.476845 1.051285 3.800117 1.521713 4.534124 2.413452 3.019691 2.530819 4.032306 9.339876
160 13 3 2.554509 1.770889 1.522505 2.117505 5.177072 3.227293 1.594186 2.215943 2.251294 2.346463
161 13 0 3.246763 0.994732 1.356742 1.625720 5.670646 2.355164 3.268873 2.170884 3.958249 3.179202
162 13 0 1.223405 1.108655 2.318864 1.940404 2.932772 2.516957 2.190708 2.526982 2.789305 4.433173
163 14 2 1.089195 0.977580 1.993870 1.648955 2.435821 2.271598 2.177863 1.992064 2.471937 4.110522
164 14 2 1.089789 0.933385 1.905509 1.686982 2.451884 2.108965 2.313223 3.463311 2.694189 3.020029
165 14 0 1.279301 0.965965 1.854812 1.693800 2.749465 2.352415 1.917576 2.107974 2.627357 2.744646
166 14 0 3.929850 3.537541 2.271645 1.438271 6.509532 5.462431 12.890637 8.173421 9.119309 7.584611
167 15 1 1.566824 3.500553 1.864008 1.213207 3.185775 3.168203 1.956457 3.052244 2.799869 2.777656
168 15 2 1.649736 1.316585 3.381131 2.164402 2.270306 1.933229 4.491353 6.548085 7.850090 7.546692
169 15 2 1.118138 2.936827 1.982616 2.899178 2.581453 2.437188 2.907345 4.704402 4.572476 6.890485
170 15 2 1.386083 3.241668 2.266382 2.364455 3.388889 2.629409 4.737344 5.373605 4.955057 4.588819
176 12 0 0.990232 0.882644 2.102589 1.625745 2.410032 1.946232 2.276288 1.844081 3.015157 2.196272
177 12 0 0.962696 0.940287 1.680548 1.492965 2.281224 2.041401 2.093601 1.597713 2.501546 2.522772
178 12 0 1.082352 0.982008 1.663282 1.558506 2.634556 2.369422 2.087439 2.405779 2.745930 2.626427
179 12 1 1.631484 0.884397 1.709465 1.690078 3.138600 1.671700 3.815549 2.439852 5.386839 2.568286
180 13 3 2.427709 4.207991 12.523773 2.383311 2.518227 10.687414 2.815682 5.376076 2.441631 26.676571
181 13 3 1.154520 1.095130 1.713585 1.318284 2.990614 2.591326 2.040319 1.560952 2.319764 1.906002
182 13 0 1.188899 1.635129 1.940559 2.124851 2.717048 4.334328 2.087655 2.017421 3.189508 3.992654
183 13 1 1.158547 1.054906 1.763717 1.520208 3.063497 2.356770 1.987127 2.085959 2.379085 3.409937
184 14 0 0.913844 0.845492 1.435888 1.882795 2.291058 2.176296 1.826623 2.065305 3.275215 6.415300
185 14 1 1.659258 1.602141 2.932578 1.927296 3.394790 2.513988 3.468702 4.489220 11.297196 30.389362
186 14 1 1.109302 0.915803 1.613292 1.581968 2.117200 1.826223 1.906458 1.943879 3.937876 5.750079
187 14 1 1.303396 1.473491 3.164427 3.962074 2.817506 3.279324 2.906550 4.806992 4.944127 18.653160
189 15 3 1.033934 1.212840 1.606439 1.705182 2.505914 2.064736 1.822520 2.081438 1.798837 2.313316
190 15 3 2.988064 3.393613 0.818553 1.338288 3.571138 3.182993 2.391739 3.202479 4.483711 2.443960
191 15 3 1.075128 1.053848 1.858237 1.744128 3.019688 2.446235 1.929635 1.960033 2.285544 2.491663
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 4.848274 3.987467 12.703014 23.575781 4.354567 3.756357 8.423804 4.132968 6.326896 2.156710
321 2 3 0.955696 0.920783 1.747028 2.221666 1.696765 2.443035 1.518267 1.731656 1.725451 2.157729
323 2 3 0.915279 3.802955 1.749165 3.550641 1.882238 3.412357 1.677169 1.840048 1.668223 3.196317
324 4 3 0.897315 2.087299 1.579145 1.739040 1.793255 2.043511 1.581434 1.648191 1.620820 1.956223
329 12 1 1.058552 0.922501 3.289934 9.578379 2.032527 2.319988 1.631689 1.642852 1.720303 2.294816
333 12 1 0.804952 1.283211 1.635139 3.045245 2.064981 4.105076 1.613698 1.759954 1.631794 2.003926
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 [ ]: