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 = 2459795
Date = 8-3-2022
data_path = "/mnt/sn1/2459795"
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 2459795.25314 and 2459795.33613
372 diff files found between JDs 2459795.25314 and 2459795.33613

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.372716 1.107648 1.269900 1.184891 2.119265 1.785281 1.729068 1.695691 1.434591 1.650561
4 1 2 0.952626 0.883143 1.625677 3.702456 1.808464 1.951229 1.800588 2.203306 1.630416 2.057382
5 1 2 0.865205 0.929665 1.507479 1.199377 1.886948 1.813602 1.981414 1.877067 4.443434 5.137837
7 2 0 0.910202 0.887773 1.561947 1.511688 2.133890 1.769873 1.832229 1.699932 1.730152 1.558098
8 2 0 1.444895 8.730730 4.040715 38.285559 2.638285 23.378548 3.047640 49.409303 4.067015 66.126508
9 2 0 0.871277 0.849688 1.379853 1.249713 1.894821 1.890587 1.954489 2.123767 1.727881 1.677631
10 2 1 0.849980 0.973702 1.471610 1.563106 1.997112 1.873796 1.784623 1.990329 1.592507 1.792814
15 1 3 0.952732 0.953463 1.267937 1.324918 1.987112 2.028181 1.963937 1.917045 3.602460 3.476913
16 1 3 1.018584 0.932406 1.412224 1.217050 2.043547 1.867245 1.957614 1.844811 9.017079 6.648965
17 1 3 1.017579 0.822972 1.225205 1.130707 2.426551 1.804582 1.626465 1.584588 2.112355 1.951286
18 1 0 33.873371 10.526986 13.742698 6.058152 156.574096 41.602356 1.453757 1.646492 1.704112 1.721424
19 2 1 0.856025 0.999515 1.327879 2.717215 1.891190 1.712429 1.992612 1.652028 2.080979 3.145929
20 2 1 0.784948 0.800178 1.519172 1.078638 2.363761 1.798425 1.881410 1.742902 1.776165 1.650969
21 2 2 0.891625 0.779644 1.515097 1.150136 1.926512 1.651771 2.052170 1.884252 1.624556 1.820560
27 1 0 4.982160 3.579207 7.622877 19.362690 14.481226 5.745166 3.448141 2.004474 3.683920 2.047305
28 1 0 31.093653 1.428704 13.697394 1.388027 155.855523 5.230028 1.729854 1.850603 1.971900 2.505790
29 1 1 1.299081 0.890527 3.375538 1.256543 2.809242 1.835782 2.855651 2.620632 4.178569 2.624302
30 1 1 0.917034 1.007203 1.391283 1.245718 1.969973 1.812760 2.817614 3.141352 1.674530 4.082006
31 2 2 0.893192 1.004206 1.397089 1.122569 2.006859 1.979684 2.602853 5.407285 2.605673 6.950760
32 2 2 1.245378 1.930174 0.753930 1.000973 2.260311 1.754362 4.256389 5.893618 3.556492 5.924527
33 2 3 45.708355 0.808899 14.612704 1.483781 231.419849 1.812656 1.694762 2.117407 2.397345 1.775764
36 3 3 1.190574 1.292037 1.644443 1.358473 2.248059 1.801822 1.761232 1.548112 1.293165 1.440283
37 3 1 0.949325 0.889574 2.588396 1.549710 2.234207 1.877720 2.021569 1.948075 2.406316 2.663297
38 3 1 0.928487 1.155127 1.642702 1.153522 2.083531 2.231458 1.869731 2.285362 1.552111 1.815254
40 4 1 91.384214 44.979232 275.429084 134.298485 1.486900 1.271136 0.585778 0.894423 0.712794 0.595601
41 4 3 196.140807 483.135101 885.293769 1433.875447 85.929499 295.534609 89.894705 1221.787093 68.141117 671.555163
42 4 0 106.686066 127.217712 329.776988 353.329837 10.566920 15.944664 4.239924 3.839697 4.276519 1.966266
45 5 0 1.190019 0.898058 2.718195 1.457515 3.382641 1.826940 3.197127 2.073757 2.817746 2.153990
46 5 0 1.122898 1.261389 1.094927 1.111269 2.389891 2.401776 1.728075 2.415672 2.163911 7.817689
50 3 3 1.385104 0.993299 1.374210 1.422568 1.981724 1.830021 1.754763 1.981996 1.796366 1.445642
51 3 2 1.037571 0.807761 8.114555 1.802550 1.702846 1.692647 1.823376 1.577401 1.735959 1.393344
52 3 3 1.354281 1.321665 1.868369 1.997619 1.793324 2.201266 1.686990 2.045744 1.899243 1.802026
53 3 2 0.967454 1.008203 2.265828 2.095420 2.641960 2.826595 2.151799 2.393671 4.275311 3.866751
54 4 0 75.038591 0.000000 222.715353 0.000000 2.032932 0.000000 0.949617 0.000000 0.803076 0.000000
55 4 2 169.150074 95.629970 464.110731 357.253274 2.785597 17.444702 2.006113 36.854188 1.211853 10.022357
56 4 1 81.978498 229.285939 412.557055 1593.212006 120.965927 348.071855 15.610579 102.357685 122.214889 981.524419
57 4 3 118.476881 80.896972 461.759812 239.217145 1.978032 5.956951 1.148058 19.887501 1.180422 8.851263
65 3 0 0.941928 0.786638 1.670439 1.099127 2.095855 1.794982 1.761476 1.709895 1.571825 1.277863
66 3 0 1.172370 0.855672 2.836406 1.825132 3.036593 2.150260 2.197035 1.991789 1.974074 2.073767
67 3 0 0.849915 0.880100 1.518657 1.197316 2.151715 1.713282 1.705593 1.658923 1.652176 1.467569
68 3 1 0.977542 0.884158 1.351895 1.332388 2.278203 1.846638 1.754712 1.826613 1.987529 2.342547
69 4 1 132.984673 95.383076 310.999159 279.847911 2.779705 8.376524 0.972081 3.950241 1.586345 20.396395
70 4 2 84.748221 85.185935 207.234461 232.422174 1.798674 7.142806 0.988541 7.242856 0.991637 1.077143
71 4 2 144.451232 87.754623 391.731262 233.685541 3.238624 3.435840 2.411074 8.371753 1.596464 1.893168
72 4 0 86.175012 164.742099 222.588018 655.175540 4.108495 225.771485 50.843947 134.899041 8.059339 53.536429
73 5 0 1.214902 1.042343 1.250410 1.159562 2.553280 1.863738 1.776347 1.772008 1.996331 2.635408
81 7 0 1.346705 1.093783 1.806593 1.289582 2.295224 1.934326 2.782427 1.827891 8.426335 3.213327
82 7 0 0.868473 0.907444 1.294205 0.938309 1.731069 1.766272 1.524724 1.651141 1.570877 1.614555
83 7 0 0.909599 0.900354 1.911860 1.676236 2.023532 1.655246 1.704177 1.902391 1.719724 1.718583
84 8 3 1.228474 1.819717 1.587513 3.765722 2.086478 1.975965 1.808585 2.309160 3.142481 4.901119
85 8 0 0.856540 0.832537 1.441919 1.449360 1.721744 1.650252 1.692719 1.942588 2.047903 2.373338
86 8 0 0.919485 0.881038 1.785403 1.475198 1.982728 1.583206 2.142314 2.215423 1.948221 1.880751
87 8 2 1.074450 1.019940 1.561351 2.029047 1.967115 1.791431 1.413439 1.935762 1.726077 1.720509
88 9 0 2.302744 5.572961 14.439044 37.754529 4.858078 22.580357 4.331925 4.392880 6.898930 2.666901
90 9 0 1.836550 1.367735 5.697157 13.288033 2.396091 1.989566 2.271409 1.879297 2.888615 2.775826
91 9 1 3.249899 6.512225 12.218599 5.417994 4.911846 14.469744 5.541378 4.033551 7.401873 2.642297
92 10 0 1.954296 1.908845 0.611705 1.022851 2.833119 5.587144 2.719195 2.003222 2.491124 2.667530
93 10 0 1.061238 0.874017 1.287591 1.293351 1.707708 2.375718 1.705331 1.803713 1.670079 2.531954
94 10 0 0.893874 1.067667 1.379864 2.714713 2.010915 3.105393 2.120047 2.701791 1.917863 7.937569
98 7 2 nan nan nan nan nan nan nan nan nan nan
99 7 2 nan nan nan nan nan nan nan nan nan nan
100 7 1 0.889608 0.817464 1.283824 1.422636 2.003236 1.915474 1.518485 1.737173 1.471976 1.667602
101 8 2 1.222867 1.226293 1.493693 1.453059 2.059402 1.833814 1.767764 1.990594 1.708163 2.542901
102 8 0 0.876895 1.264437 1.309484 4.224690 1.903696 1.718759 1.659356 2.764561 1.774823 3.523375
103 8 1 1.278050 0.886602 1.497998 1.331652 2.026359 1.845748 1.850026 2.007263 2.402219 1.868810
104 8 1 1.762001 1.163323 0.470867 1.243628 2.016475 1.654888 3.267886 1.508713 3.050623 1.280073
105 9 1 2.124922 2.203459 14.298279 6.577141 3.552204 7.888039 4.968889 2.228692 10.725198 2.580908
106 9 3 2.630134 3.436345 9.950179 14.879873 3.890335 15.065562 3.478579 2.249189 5.357988 2.425047
107 9 0 7.489354 31.592555 30.275575 195.923317 9.534769 19.225676 11.767757 69.285907 21.831499 133.491687
108 9 1 1.744021 1.284455 9.092193 5.118039 2.631826 1.752309 3.196412 1.715149 3.714560 1.955322
109 10 1 1.435803 1.258605 1.164956 1.444849 3.664731 2.689502 1.592534 1.853102 1.531700 2.123133
110 10 1 0.896072 1.877123 1.566999 3.062102 2.249083 2.562735 1.649765 2.293011 1.461950 1.888622
111 10 1 0.906724 1.033274 1.585854 1.251934 2.162538 1.894053 2.036930 1.753922 1.643747 1.648002
112 10 2 0.907993 1.097755 1.141913 1.353776 1.979035 1.886523 1.652819 1.779331 1.519985 1.639718
116 7 2 nan nan nan nan nan nan nan nan nan nan
117 7 3 1.113731 1.141137 1.686882 1.400113 2.173813 1.823922 2.171895 2.471065 2.763480 4.551653
118 7 3 1.092550 0.965968 1.343436 1.353639 2.179462 1.969517 1.695443 1.703749 1.665050 3.050051
119 7 1 0.932600 0.783019 1.263884 1.571653 2.036065 1.893938 1.574370 1.857847 3.515473 2.262991
120 8 1 3.733111 1.713352 10.268882 2.499883 6.741936 5.523001 8.306936 1.741051 21.907369 3.071451
121 8 3 1.443706 1.903065 1.744974 1.523552 3.351802 7.627156 2.484821 2.961702 3.209180 15.681341
122 8 2 1.234825 1.271822 1.247080 1.389031 2.338928 1.974361 1.853159 1.889056 2.017768 3.334929
123 8 3 1.309603 1.140919 1.272178 1.374004 1.977606 1.608671 1.490588 1.613807 1.918173 1.904291
125 9 3 3.883690 1.604946 41.175403 11.356227 12.374811 4.158838 3.346970 1.976617 5.036364 2.184756
126 9 3 2.832469 3.134903 37.307813 8.537300 6.113716 8.864911 4.559900 3.800851 5.640824 3.127799
127 10 2 1.428644 1.363569 2.409636 1.360678 4.362581 3.865121 4.151206 3.695464 4.038971 4.776999
128 10 2 0.828163 0.906789 1.262948 1.858103 1.912149 2.108572 1.761143 1.871370 1.847216 2.415442
129 10 3 0.806738 0.864459 1.222384 1.163306 1.792747 1.639854 1.483434 1.696525 1.321696 1.651738
130 10 3 1.030183 0.905376 1.732049 2.313738 2.225135 1.779018 2.077412 1.700817 1.934029 1.923963
135 12 2 0.979546 1.097535 1.477129 1.197679 2.367277 2.046513 1.947753 2.306932 1.735633 2.369560
136 12 2 1.176745 1.147364 2.765486 1.241529 2.100575 1.729545 3.647535 2.308793 1.848097 1.816224
137 7 3 3.577937 3.806519 2.925180 21.078004 10.748053 6.725776 4.134030 2.551084 6.667587 2.370650
138 7 1 0.885512 6.748302 1.317605 5.796486 2.062799 6.877284 1.815022 3.536160 5.597342 6.440544
140 13 2 0.963478 1.074018 1.385488 1.519849 2.341460 2.010724 1.841511 1.762985 1.628074 1.919956
141 13 2 3.074838 1.071198 8.026915 1.384693 11.248549 2.232936 6.397412 1.758731 5.104777 1.751757
142 13 2 5.721325 1.648520 7.802829 1.632769 6.017719 4.462858 2.861428 1.900658 3.862960 3.669867
143 14 2 0.905596 0.845174 1.602343 1.187257 2.024267 1.639435 1.947158 1.740333 1.610816 1.704084
144 14 3 1.171960 1.218378 1.224327 1.179038 1.985812 1.695336 1.520296 1.619242 1.415642 1.578103
145 14 3 3.471062 4.995903 22.771618 20.827155 11.286455 17.639779 3.212877 1.926408 2.813359 2.063477
150 15 1 2.787680 6.887419 23.321684 39.505008 3.969466 7.332419 4.489030 13.708984 8.076008 28.335617
155 12 2 2.486230 4.905468 8.820792 21.520533 3.680676 3.664447 2.989572 2.391678 3.677756 2.003430
156 12 3 1.340856 1.207470 1.731257 1.207092 2.877146 2.023122 1.709083 1.741040 1.813284 1.750128
157 12 3 1.099796 0.855706 1.278086 1.085828 2.294940 1.754234 1.737076 1.576923 1.528569 1.470663
158 12 3 1.179851 0.880658 2.925493 1.818743 3.586153 1.795093 2.734283 1.940159 2.770649 2.811699
160 13 3 3.837784 7.153873 13.647597 51.892786 6.496357 9.837582 5.048027 14.155466 5.737441 19.705840
161 13 0 2.273325 0.882086 1.234932 1.192225 4.302721 1.641649 3.290942 1.789609 4.960690 3.478263
162 13 0 0.868662 0.954446 1.363723 1.368173 1.890601 1.886084 1.680778 1.786218 1.553569 1.735260
163 14 2 0.914636 1.050149 1.338042 1.377509 1.990989 1.861879 2.062240 1.902932 2.123172 3.947332
164 14 2 0.891219 0.881667 1.193886 1.175337 1.927323 1.688000 1.590180 2.279557 1.553361 1.485100
165 14 0 3.566728 6.481420 5.132055 9.515501 14.301067 21.014453 3.322999 3.969487 8.897982 3.569172
166 14 0 0.946539 1.469207 1.375563 1.339737 2.352858 2.996109 1.800694 4.501377 1.675545 4.098152
167 15 1 1.990234 2.226574 2.587740 4.749126 3.399417 2.828629 4.969522 5.169115 4.979458 5.285794
168 15 2 nan nan nan nan nan nan nan nan nan nan
169 15 2 nan nan nan nan nan nan nan nan nan nan
170 15 2 nan nan nan nan nan nan nan nan nan nan
176 12 0 0.800276 0.820865 1.276586 1.338625 2.014265 1.715611 1.785903 1.595794 1.698266 1.464300
177 12 0 0.802612 0.921591 1.464323 1.365333 1.868910 1.701399 1.658684 1.700586 1.541489 1.547275
178 12 0 0.910978 0.797283 1.294514 1.301308 2.101307 1.733502 1.706758 1.836042 1.369704 1.659478
179 12 1 1.353802 0.847775 1.294154 1.330243 2.228529 1.850685 4.129210 2.088816 2.354683 1.976977
180 13 3 2.109711 1.147224 10.356732 1.339381 4.652108 2.694835 3.104111 1.754971 3.316609 1.904925
181 13 3 1.693559 4.556279 1.055288 9.196028 3.965401 6.862305 1.892187 1.964606 1.983766 1.788776
182 13 0 1.134855 2.166834 2.015901 5.964996 2.881352 4.056228 2.354427 5.458078 3.680191 9.468040
183 13 1 1.022980 0.967740 1.265668 1.602415 2.400211 1.915191 1.584912 1.755514 1.770356 1.909361
184 14 0 0.907464 0.753409 1.303970 1.409786 1.881554 1.819416 1.459703 1.658520 1.450299 1.824262
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 1.027525 1.220356 1.253756 1.249540 2.087493 1.716469 1.527440 1.584596 1.772955 2.644459
190 15 3 2.878850 2.646583 12.199135 1.052875 5.078088 3.163122 3.294675 2.359017 3.199388 2.964290
191 15 3 0.946864 0.831086 1.179207 1.055398 2.080809 1.617415 1.750996 1.616130 1.535664 1.563756
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 nan nan nan nan nan nan nan nan nan nan
206 19 0 nan nan nan nan nan nan nan nan nan nan
207 19 1 0.925614 0.915331 1.803862 1.889720 1.855669 1.738590 1.683185 1.818560 1.628205 1.691318
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.048866 0.938811 2.168009 1.460097 1.905774 1.523901 1.757138 1.671515 1.891782 1.588872
224 19 1 0.982408 1.153551 3.235601 4.208936 1.717587 1.910203 3.766014 3.706173 7.119659 6.108984
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 5.188622 4.946277 14.216890 28.344267 6.362935 8.930158 5.982898 5.338192 10.180519 15.560057
321 2 3 1.046748 1.016400 1.788151 2.153215 1.519468 1.775042 1.548148 1.723849 1.595051 1.671607
323 2 3 0.944114 0.973014 1.954042 3.864065 1.565110 2.552137 1.772013 1.854219 1.592391 1.926390
324 4 3 99.130032 99.488868 224.152121 265.148592 3.369947 6.873261 2.359734 7.871861 1.486080 2.047045
329 12 1 0.977072 1.801997 8.934792 20.630567 1.703625 1.616972 1.784091 1.649714 1.707850 1.599240
333 12 1 1.085838 1.131052 2.319693 1.401497 2.103055 2.385683 1.712420 1.679027 1.474253 1.435088
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 [ ]: