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 = 2459748
Date = 6-17-2022
data_path = "/mnt/sn1/2459748"
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 2459748.25320 and 2459748.33619
372 diff files found between JDs 2459748.25320 and 2459748.33619

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.730708 95.052900 253.376576 229.831526 5.361309 20.548374 4.865211 40.549278 1.359215 18.110867
1 0 0 145.685931 99.014068 346.944506 232.446512 3.045872 2.526762 1.533244 2.387209 1.644064 1.498687
2 0 0 91.821559 118.377467 241.089369 285.160797 2.037202 3.160078 2.364837 6.651630 1.669012 2.041163
3 1 2 1.147958 1.583818 1.520428 1.620079 1.790324 2.248959 4.665303 10.718343 10.369140 30.142175
4 1 2 1.211646 0.905027 1.698294 1.490813 1.798999 1.673692 2.172917 1.907195 2.201038 1.682755
5 1 2 0.972753 0.975937 1.844554 1.474636 1.828505 1.952693 2.437472 2.185097 9.212111 9.732043
7 2 0 0.944213 0.830907 1.705981 1.682323 1.676198 1.605579 1.571658 1.833684 2.111584 2.702776
8 2 0 1.152939 14.353904 3.609907 55.099134 2.474204 40.675313 2.999821 17.054109 3.413742 62.015820
9 2 0 0.804763 0.797277 1.975212 1.506384 1.740459 1.722837 2.400035 1.806760 2.076350 1.721597
10 2 1 0.850500 0.870229 1.902006 1.556864 1.895733 1.928570 2.033657 2.524683 2.636533 2.987637
11 0 1 109.970103 540.785925 404.820576 3376.436941 9.589248 415.920621 438.791945 304.182478 1065.229926 3261.980948
12 0 1 171.493110 126.590580 257.163049 907.880196 44.821587 98.661884 602.061578 319.787204 655.901854 689.900996
13 0 1 102.041120 111.145218 292.792198 426.894129 12.365767 64.863316 172.142158 87.053433 45.240182 35.332038
14 0 2 109.481469 427.673088 349.283662 1598.291383 42.830512 1018.011675 54.300742 194.798726 4.360761 502.853169
15 1 3 1.055338 0.932492 1.891230 1.545960 1.970817 1.914296 1.859369 2.304247 8.221368 8.567994
16 1 3 0.914100 0.886264 1.755912 1.620823 1.856887 1.736499 1.763153 1.902532 4.098320 2.873527
17 1 3 1.053686 0.906277 1.525431 1.567763 2.106155 1.790067 1.800846 1.944005 2.741497 3.204802
18 1 0 43.469615 2.260846 1.377759 1.559648 198.200349 6.782054 1.506822 1.897055 2.132777 1.971790
19 2 1 0.932516 1.032684 1.664436 1.599093 1.863317 2.114000 1.758706 2.185326 2.086786 3.803223
20 2 1 0.788277 0.788692 1.733587 1.707782 1.472870 1.717751 1.677815 1.992962 2.005386 2.216085
21 2 2 0.839618 0.824686 1.546812 1.525945 1.642448 1.665248 1.742072 1.949363 1.906761 2.387253
23 0 2 79.313570 132.368052 204.591817 321.396369 7.334962 4.341394 1.384990 2.038358 2.102070 1.153944
24 0 2 72.060822 73.706192 154.299474 185.510856 1.941257 2.324584 0.752924 0.709918 0.844124 0.703910
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 99.076296 140.223786 0.928506 5.905147 473.550612 724.615770 1.566540 1.883281 2.327528 1.749260
28 1 0 0.825306 66.637066 1.661830 1.133647 1.937376 290.405645 1.807223 1.720158 2.144734 2.398940
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 0.874304 0.968705 1.851437 1.791016 1.832488 1.955589 2.372360 3.621682 3.150835 7.902271
32 2 2 2.306095 2.945113 1.892075 1.450736 6.010876 5.285782 8.676062 17.641187 15.033039 20.963921
33 2 3 41.220882 0.844534 2.567456 1.390618 195.539077 1.574042 1.738800 1.672487 2.315187 2.350840
36 3 3 1.262521 1.066470 2.214128 1.784344 2.168207 2.051604 1.864292 1.993944 2.341299 2.645471
37 3 1 1.049084 0.868508 2.093767 1.365496 2.513382 1.990654 2.016317 1.787438 4.750269 3.740667
38 3 1 0.955769 1.406096 1.817449 1.690468 1.688938 2.216286 2.405852 2.363703 2.258276 2.749115
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 0.910720 1.039778 1.635663 1.608263 1.915030 2.263775 2.045288 2.482434 2.455829 3.283773
41 4 3 0.942382 0.859351 1.706751 1.688892 1.965009 1.876151 1.886824 1.844056 2.065525 2.294057
42 4 0 nan nan nan nan nan nan nan nan nan nan
45 5 0 2.775019 0.902926 19.528185 1.591950 4.587827 1.584501 3.327001 1.750026 3.468371 1.686564
46 5 0 1.746839 0.999092 1.714727 1.572570 3.035797 1.998254 1.987298 1.876550 2.550123 2.699970
50 3 3 0.957048 0.977281 1.565746 1.488654 1.620641 1.584551 1.618700 1.711764 1.911107 2.785202
51 3 2 0.959581 0.816112 2.044975 2.196983 2.054548 1.646308 2.008476 1.838919 2.722279 2.220731
52 3 3 1.172386 1.211377 1.920605 2.017785 2.284838 2.249916 2.820528 2.528415 2.905833 3.828466
53 3 2 0.922808 0.991029 1.942020 2.663079 1.942037 2.904127 1.903518 2.610826 5.449348 5.966711
54 4 0 nan nan nan nan nan nan nan nan nan nan
55 4 2 0.834266 0.890310 1.734973 1.804285 1.677160 1.528390 1.748248 1.829652 2.476141 1.933301
56 4 1 1.072775 0.819064 1.725116 1.442575 1.915297 1.770944 2.002287 1.735246 2.429898 1.795898
57 4 3 1.140233 0.884968 2.990069 1.445439 2.836902 1.984100 2.674996 1.935038 2.703173 2.037269
65 3 0 1.226219 0.786436 3.098680 1.487919 2.512431 1.626064 2.274796 1.656246 2.392263 1.980175
66 3 0 1.101096 2.550858 2.928660 9.389168 2.267749 7.142994 2.154910 3.532501 2.548299 12.193491
67 3 0 0.873400 0.810431 1.860117 1.697339 2.105381 2.166000 1.886602 1.947522 1.937636 2.196066
68 3 1 1.066481 0.787253 1.802803 1.606311 1.804378 1.680895 1.789066 1.769574 2.145844 2.183406
69 4 1 0.861817 0.876976 1.832509 1.845841 1.996027 1.884043 2.245653 1.944252 2.856222 2.232692
70 4 2 1.236039 1.369614 1.589902 1.452219 2.420924 3.418603 1.992409 2.959947 2.096622 2.638321
71 4 2 0.831302 0.834325 1.730811 1.862029 1.804595 1.635555 1.660566 1.704946 1.952194 1.769839
72 4 0 nan nan nan nan nan nan nan nan nan nan
73 5 0 0.854961 0.867368 1.707709 1.406822 1.823156 1.551398 1.693533 1.818666 2.413315 3.063003
81 7 0 2.324168 1.497507 2.236533 1.824778 2.596827 2.356124 3.973878 3.692906 26.715069 11.629884
82 7 0 1.079406 0.929774 1.746865 1.712906 2.074643 2.117806 1.942738 1.917483 6.218308 5.020792
83 7 0 3.347282 3.906144 13.363299 17.574916 3.468805 6.496543 4.498463 2.127582 5.700250 2.202809
84 8 3 1.390490 1.138110 1.725344 1.619689 1.771615 2.283161 2.018755 2.123469 17.755024 21.330336
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.277238 9.215778 2.079603 34.458786 2.244288 28.081443 4.417798 13.162590 6.114877 48.873176
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 3.189397 2.090445 9.654382 10.169521 3.689868 2.726870 3.131142 1.896314 3.528056 2.411992
93 10 0 4.467754 2.177712 9.630681 1.701928 6.459077 1.674889 3.830679 1.957050 2.999814 2.220417
94 10 0 0.887159 1.057065 1.669208 2.752523 1.814647 2.496555 1.902601 2.836003 2.381580 6.806107
98 7 2 3.246236 2.991446 14.722653 19.092425 4.459326 9.713446 4.916244 2.077039 3.802011 2.429935
99 7 2 1.022244 1.135831 1.618043 1.620576 1.808266 2.605529 1.987987 2.530756 3.961272 28.389656
100 7 1 5.612580 8.541182 20.667201 17.912299 9.318206 31.837457 4.007691 2.797386 4.668382 3.725347
101 8 2 1.504127 1.121162 1.789070 1.722104 1.688815 1.914075 1.660972 1.941746 2.146425 2.779548
102 8 0 nan nan nan nan nan nan nan nan nan nan
103 8 1 1.104544 0.827968 1.514315 1.595240 1.419461 1.764395 1.422451 1.683738 2.011954 1.831463
104 8 1 2.426102 0.973400 4.851110 1.706264 2.101629 1.660010 2.593819 1.713751 3.109588 2.307554
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.975501 1.394333 2.072607 1.656757 4.896451 2.662621 1.860072 1.701948 2.327849 1.963744
110 10 1 2.563646 1.895224 2.407298 1.019923 3.916022 2.963274 3.447573 3.606828 3.837683 2.860466
111 10 1 1.160299 0.864183 1.993536 1.510214 1.888468 1.782432 1.755832 1.764164 1.948130 1.632824
112 10 2 2.393628 1.004889 7.062422 1.739583 4.251882 2.171591 3.237730 3.254580 3.785711 6.394760
116 7 2 7.358777 2.247916 6.120144 9.863071 22.539547 5.290138 5.540624 2.806306 7.143157 4.207011
119 7 1 3.363746 2.362230 2.595812 18.095752 11.363480 5.402930 2.254664 2.128357 18.376632 2.210402
120 8 1 4.396558 2.546690 8.894366 2.046270 5.116363 3.906744 7.744617 2.201248 22.845024 6.478112
121 8 3 1.912532 1.183852 3.570162 1.711114 4.939211 2.979592 2.734727 1.988776 4.498991 4.943904
122 8 2 1.507778 1.278191 1.818304 1.691584 2.281953 2.230966 2.255433 2.608176 3.094986 3.173628
123 8 3 1.183780 0.916780 1.607708 1.730071 1.579923 1.741268 1.666682 1.954191 3.025815 2.892262
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.510683 1.383614 2.063228 1.844338 3.051490 4.103579 4.596648 4.363536 6.569909 10.491563
128 10 2 0.824233 0.953387 1.623182 2.261998 1.589531 2.059658 1.717850 2.216954 2.559356 4.023194
129 10 3 0.905841 0.802472 1.646064 1.240112 1.732827 1.616893 1.695582 1.576852 1.582744 2.408620
130 10 3 1.446062 1.479363 2.983242 14.482218 2.330510 1.569860 3.315103 1.932352 4.207267 1.569308
135 12 2 0.937580 0.801425 1.514279 1.485415 1.774834 1.701930 1.689008 1.789421 1.826567 1.726599
136 12 2 1.659136 0.993258 4.971721 1.430437 2.435645 1.611107 8.161928 3.076409 2.866707 2.581872
138 7 1 1.293726 1.047091 1.868491 1.568779 2.854885 1.863240 2.228240 2.460048 25.427688 25.735447
140 13 2 1.067884 0.926132 1.744301 1.681661 1.901728 1.762702 1.938757 2.161217 2.252405 2.643886
141 13 2 4.965775 1.137201 15.151724 1.681543 18.503620 2.390687 11.155414 2.013116 10.293601 2.571849
142 13 2 3.835205 1.047671 6.151333 1.819599 3.541826 2.174752 2.363040 2.163721 4.905132 2.120392
143 14 2 1.059509 0.779722 2.393415 1.593242 1.921336 1.772418 1.908302 1.877896 2.224812 2.080690
144 14 3 1.143891 0.905630 1.745119 1.495639 2.542063 1.838828 1.724776 1.785074 2.179592 1.912880
145 14 3 0.827334 0.811016 1.690690 1.437308 1.665763 1.790686 1.817477 1.672019 2.001973 1.593565
150 15 1 2.470870 4.032323 17.090733 36.661840 5.490788 6.928829 3.512657 2.595041 2.995839 1.897205
155 12 2 2.567504 2.412734 7.063717 19.208188 2.803159 3.485802 2.980681 6.265507 2.977093 2.217542
156 12 3 1.171174 1.188220 1.864256 1.623843 2.882297 2.341875 2.088763 1.950806 2.006266 1.787792
157 12 3 1.105496 1.020529 1.549453 1.807591 1.813043 2.503919 1.910568 2.190746 1.893342 2.424234
158 12 3 1.137925 1.016592 2.384975 1.615059 2.740497 2.335545 2.291055 2.773123 3.450137 7.096723
160 13 3 2.324091 1.722526 1.308757 2.298793 2.933194 2.442488 1.939808 2.025896 2.441737 2.264192
161 13 0 2.188719 0.897793 1.491316 1.544198 3.451787 1.787087 2.710491 1.809122 2.562784 2.696701
162 13 0 0.925308 0.932216 1.727170 1.409781 1.693715 1.789481 1.782768 1.508079 1.838177 1.489890
163 14 2 0.942545 0.881313 1.812719 1.796468 1.748061 1.766422 1.927292 1.940615 2.375620 2.987927
164 14 2 0.984974 0.910695 1.819917 1.851638 1.978919 2.040402 1.997754 3.215375 2.613074 3.261794
165 14 0 3.591951 1.958373 4.473558 3.207021 10.697357 5.616806 4.220845 5.305974 8.651284 7.609303
166 14 0 1.943508 2.263630 2.121487 2.218661 3.475499 4.695770 4.819616 6.298789 3.258439 5.482202
167 15 1 1.689001 2.245261 1.664742 1.166910 2.044626 2.502463 3.068650 1.745413 2.201290 1.802787
168 15 2 1.786361 1.325353 3.736241 2.513358 2.604541 1.836022 6.223671 7.036880 11.255607 8.039306
169 15 2 0.942942 9.105100 2.133127 50.183119 1.856239 11.939621 1.970516 5.939857 2.598081 18.923667
170 15 2 1.493391 9.588019 2.713618 51.938189 3.282947 9.914648 3.150357 6.168111 3.410831 14.994395
176 12 0 0.861273 0.819269 1.556117 1.702817 1.860387 1.629316 2.093375 2.003094 2.454623 2.414293
177 12 0 0.955020 0.953363 2.167329 1.640870 2.050864 1.934013 2.026857 1.797085 3.721185 2.913188
178 12 0 0.938257 0.894845 1.574171 1.502506 1.683671 1.783382 1.794184 1.774344 1.712584 1.793471
179 12 1 1.564450 0.814827 1.588306 1.484255 2.458056 1.807298 7.824084 2.714669 4.070504 3.060223
180 13 3 2.345312 4.231666 13.764511 2.103617 2.823774 7.799741 2.660665 4.892217 3.005041 14.267527
181 13 3 1.091131 0.982197 2.092041 1.348544 2.140845 2.188970 2.209955 1.848569 1.946578 1.875388
182 13 0 1.525032 1.504184 2.847698 2.160615 4.959080 4.425437 1.613896 2.033904 1.680042 2.931713
183 13 1 1.002456 0.867315 1.767422 1.758933 2.574547 1.786979 1.771177 1.798216 2.204050 2.283561
184 14 0 0.901246 0.797326 1.742582 1.689410 1.918721 1.709313 2.136826 1.784049 2.453419 3.361008
185 14 1 1.025297 0.991837 1.841685 1.951354 1.987955 2.071882 2.452410 4.065708 3.269850 3.884867
186 14 1 0.986489 0.945108 1.692943 1.722222 1.759412 1.709958 1.858448 2.218238 3.559014 4.460481
187 14 1 1.096691 1.320710 1.780656 3.328273 1.994914 3.002530 3.018089 4.944234 5.301030 11.613766
189 15 3 1.042097 1.073140 1.875662 1.638803 1.828520 1.961382 1.730622 1.897059 2.027532 3.269571
190 15 3 2.995208 4.048214 1.457891 1.419610 2.519602 3.203979 2.318117 2.553669 3.966017 4.923043
191 15 3 1.096593 0.983102 1.718942 1.539222 2.592936 2.083596 2.150109 2.119553 2.139682 2.009326
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.978214 4.014317 12.532196 22.905730 4.722475 3.955929 5.911668 3.410347 6.989746 13.802242
321 2 3 0.856547 0.802568 1.634493 2.700919 1.535968 1.590073 1.609662 1.694351 1.809839 1.661048
323 2 3 1.062863 3.105999 6.596608 5.294346 2.096248 2.996604 2.272890 1.787092 2.175270 3.306721
324 4 3 0.815114 5.158241 1.987396 25.388608 1.905439 2.996164 1.767904 1.657997 1.852521 2.385160
329 12 1 0.839886 1.098917 1.741401 2.367935 1.477079 1.972422 1.760493 1.721344 1.804552 2.520408
333 12 1 0.818704 1.609816 1.600971 3.171398 1.683896 5.933484 1.564950 1.673181 1.677457 1.593246
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 [ ]: