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 = 2459797
Date = 8-5-2022
data_path = "/mnt/sn1/2459797"
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 2459797.25304 and 2459797.33603
372 diff files found between JDs 2459797.25304 and 2459797.33603

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.068883 0.960227 1.274827 1.266673 1.988362 2.190304 1.800953 1.818214 1.602333 2.101352
4 1 2 0.980275 1.124333 1.745595 2.797699 1.865532 1.727812 1.746203 1.766778 2.039232 1.779941
5 1 2 0.875192 1.025863 1.410930 1.182160 1.846578 1.989834 1.699865 1.604953 3.677462 3.966580
7 2 0 0.852333 0.837213 1.221938 1.420165 1.724686 2.071410 1.659399 1.663081 1.580227 1.612840
8 2 0 1.513455 9.602264 3.982652 22.646249 3.265862 47.509127 3.217504 43.040454 4.456852 52.515512
9 2 0 0.834434 0.865034 1.246825 1.133393 1.969389 2.066266 1.997510 2.021248 1.776884 1.713490
10 2 1 0.819757 0.915798 1.666061 2.791447 1.877579 2.027752 1.674529 2.106012 2.022750 2.616318
15 1 3 0.966425 1.069039 1.198163 1.197955 2.121729 2.231893 1.943634 1.816622 4.432461 4.137930
16 1 3 1.039812 0.898478 1.239430 1.258294 2.321896 2.469024 1.947758 2.229053 9.153181 5.285060
17 1 3 0.987513 0.900304 1.138898 1.053891 2.360066 1.932038 1.655831 1.604868 1.735117 1.761771
18 1 0 40.321714 13.937749 1.568607 1.503404 196.567588 66.912299 1.469823 1.680489 1.609305 1.710602
19 2 1 1.031355 0.986324 1.224866 2.254378 2.283625 2.090533 1.717268 1.788238 2.410579 3.448625
20 2 1 0.854450 0.896470 1.156538 1.210100 2.207631 1.978615 1.591433 1.638266 1.499399 1.516259
21 2 2 0.927541 0.838881 1.329060 0.979878 1.922529 1.851355 1.851218 1.540681 1.712601 1.508466
27 1 0 4.509236 4.121748 7.246477 17.352124 12.867469 5.688979 3.630148 2.046665 3.472564 1.888413
28 1 0 75.700266 1.441392 1.868287 1.563068 409.093442 5.971868 1.750776 1.958440 2.119432 2.312827
29 1 1 1.171462 0.901428 1.950146 1.321238 2.120639 2.107899 2.328355 3.064286 4.592555 3.725126
30 1 1 0.930490 0.927969 1.435244 1.508602 2.060679 2.203517 2.110823 2.331109 1.874355 4.370945
31 2 2 0.868279 1.041257 1.201102 1.008001 1.901074 2.099009 2.341671 4.693328 2.652356 6.983983
32 2 2 1.482780 1.950026 0.743583 0.937037 2.479519 1.894493 4.507836 6.643107 4.163138 6.955895
33 2 3 42.807035 0.939829 1.174283 1.143003 221.388792 1.932116 1.482068 1.675743 1.675777 1.659391
36 3 3 1.116912 1.282446 1.390595 1.151802 1.891211 1.917626 1.672177 1.557673 1.463141 1.361728
37 3 1 0.931432 0.883902 4.050992 2.043341 2.515503 2.106413 1.837100 1.622486 2.452624 2.773867
38 3 1 0.831354 1.019104 1.564985 1.204510 1.705463 2.298399 1.648369 2.091727 1.517387 2.053500
40 4 1 0.891231 1.003263 1.431568 1.074520 1.833600 2.374862 1.665209 1.864323 1.664305 2.038364
41 4 3 0.847148 1.016394 1.254609 1.506200 2.050879 2.459580 1.749491 1.785543 1.672901 1.668564
42 4 0 0.979790 0.899012 1.246864 1.337606 2.578477 2.172675 1.637358 2.022016 1.782342 3.803155
45 5 0 1.315867 0.920492 3.164827 1.391265 3.859100 1.778419 3.115485 1.950220 3.135941 2.019737
46 5 0 1.220622 1.086880 1.544255 1.190205 2.725487 2.329228 1.713519 1.781031 1.835072 2.126619
50 3 3 1.250914 1.072668 1.513276 1.245359 2.062279 1.813478 1.678220 1.659782 1.684169 1.613113
51 3 2 nan nan nan nan nan nan nan nan nan nan
52 3 3 1.150745 1.136701 1.751425 2.045904 2.029446 2.265363 1.786027 1.957967 1.564463 1.969704
53 3 2 nan nan nan nan nan nan nan nan nan nan
54 4 0 0.891404 0.827333 1.117285 1.010804 2.245729 2.080345 1.658177 1.667811 2.139271 1.964873
55 4 2 0.937235 0.907872 1.391121 1.577969 2.314980 2.463544 1.913335 1.747257 2.021183 1.653035
56 4 1 1.094750 1.098326 1.320536 1.376588 2.536654 2.332307 1.960704 1.884043 2.053360 2.017424
57 4 3 1.480650 1.567412 1.683600 7.836053 4.213674 1.932773 1.937809 1.862056 2.145024 1.784328
65 3 0 0.959236 0.850846 1.970681 1.137707 2.594221 2.135419 2.081601 1.724023 1.921992 1.682500
66 3 0 1.249691 0.859295 2.772041 1.538731 2.990930 2.169681 2.212551 1.559425 1.833244 2.008904
67 3 0 0.890455 0.904015 1.689881 1.425501 2.271002 2.158018 1.780797 1.698028 1.891544 1.717703
68 3 1 0.900276 0.946303 1.534519 1.375131 2.152690 2.194884 1.740197 1.815067 1.978849 1.782228
69 4 1 0.940901 1.033391 1.539711 1.447191 2.217774 2.607675 1.870369 1.874891 2.075166 1.922037
70 4 2 1.229433 1.133095 1.171434 1.443767 3.179884 2.754866 3.059636 2.182122 1.678821 2.086268
71 4 2 0.936258 0.952590 1.391168 1.214504 1.958362 2.144667 1.532554 1.644663 1.496920 1.469559
72 4 0 0.929111 1.096441 1.291971 1.413299 2.199868 2.309701 1.600365 1.569363 1.738217 1.790944
73 5 0 1.073765 1.923486 1.305768 1.157500 2.081998 2.335839 1.740841 1.700786 2.219199 2.677526
81 7 0 1.380435 1.174910 1.714481 1.463416 2.292480 2.405732 2.559603 2.009918 8.685242 3.677462
82 7 0 0.943556 1.026762 1.296920 0.970100 1.948937 2.107783 1.634613 1.723557 1.818944 1.849733
83 7 0 0.904261 1.132092 1.644845 1.561855 2.147140 2.102435 1.817086 1.910212 1.794345 1.722458
84 8 3 1.156438 1.151425 1.464550 2.065468 2.333452 2.284240 1.714163 2.011800 2.724494 4.016861
85 8 0 0.797550 0.863819 1.160294 1.343698 1.969489 1.862888 1.566273 1.902843 1.803685 2.450296
86 8 0 1.273925 1.038463 1.869719 1.444740 2.584479 1.994765 3.211459 3.971994 2.468860 3.099865
87 8 2 1.056084 1.403009 1.556470 2.261737 2.098238 2.726247 1.715215 3.655821 2.234899 2.972441
88 9 0 2.307401 6.964196 16.888229 32.628385 5.871726 21.665343 5.038239 3.870830 8.422961 2.219308
90 9 0 1.861728 1.251324 6.113593 13.560775 2.454589 2.330655 2.746782 2.202840 3.161871 2.003703
91 9 1 3.154365 4.234194 12.075384 5.133245 3.820349 8.060600 5.298194 3.923292 7.177789 2.598531
92 10 0 2.729936 1.860409 0.571737 0.863530 3.568967 4.889674 2.801166 2.422870 2.557233 2.358151
93 10 0 1.039386 0.973520 1.508571 1.171847 2.121479 2.712681 1.823121 1.582991 2.086665 2.413284
94 10 0 0.947616 0.995862 1.296718 1.820694 2.539586 2.345664 1.967557 2.488434 1.943477 5.538795
98 7 2 0.915142 0.887069 1.309226 1.503323 1.875571 1.917331 1.909106 1.717942 3.422986 1.739134
99 7 2 1.039928 1.157255 1.544533 1.486062 2.477416 3.054348 1.984116 1.683905 3.766910 4.427792
100 7 1 0.940793 0.974801 1.324760 1.398731 1.941433 2.328668 1.573762 1.536235 1.689044 1.654687
101 8 2 1.186064 1.219480 1.393731 1.442634 2.174944 2.075142 1.753765 1.909175 1.666233 2.257267
102 8 0 0.838923 3.367703 1.210740 20.076806 2.067781 3.549715 1.705046 7.327016 1.662387 9.054292
103 8 1 1.456942 1.052205 1.468127 1.348032 2.292436 2.138319 2.221063 2.094641 3.489927 2.033747
104 8 1 2.155573 1.236177 0.397652 1.248915 2.537673 2.258514 3.852832 1.598185 3.868096 1.452012
105 9 1 2.131802 2.689125 15.071602 6.846000 3.594477 7.710628 4.579064 2.241001 9.646154 2.942212
106 9 3 2.710047 4.185732 9.951783 17.212718 3.916640 8.875439 2.935064 2.314832 5.103226 2.727035
107 9 0 4.385976 3.457804 16.288163 41.768714 8.240020 3.467688 6.778572 6.838924 9.093684 7.109212
108 9 1 1.730577 1.253797 9.777721 5.329442 2.646980 2.188379 3.435265 2.205318 3.614797 2.033367
109 10 1 1.338727 1.113302 1.400382 1.214457 3.040676 2.486884 1.730894 1.703019 1.650434 1.717788
110 10 1 0.897122 2.042916 1.518841 3.305980 2.550240 3.237986 1.680459 3.187023 1.693986 2.154515
111 10 1 0.870538 1.057150 1.540885 1.137736 2.305009 2.182596 1.765840 1.635118 1.689101 1.562889
112 10 2 0.920690 1.162435 1.354975 1.280477 2.239490 2.181033 1.888272 1.757563 1.597042 1.742933
116 7 2 0.836750 0.839546 1.228926 1.344967 1.938238 2.202447 1.682546 1.973996 1.804741 2.120751
117 7 3 0.959003 1.028607 1.692794 1.181797 2.384417 1.859078 1.932522 2.161019 2.547086 3.160334
118 7 3 0.980579 1.053281 1.406123 1.421833 2.315410 2.135623 1.697743 1.885669 1.794708 3.109209
119 7 1 1.100780 0.773172 1.256460 1.473379 2.589951 1.867030 2.697617 1.634297 11.129069 2.002188
120 8 1 3.633923 1.684360 10.180578 2.637172 6.135221 5.360612 8.577351 1.680366 21.626206 2.152470
121 8 3 1.521279 1.729924 1.336342 1.284208 4.157456 5.183238 2.282044 2.207582 3.219948 10.921587
122 8 2 1.957261 1.361584 1.662110 1.342862 4.858614 2.871881 4.338333 1.683278 4.445106 3.920990
123 8 3 1.313547 1.096264 1.597646 1.390508 2.277670 1.953731 1.747751 1.611898 2.444231 2.093113
125 9 3 4.150879 1.637369 39.546947 11.748103 14.154105 4.245192 3.087651 2.202350 5.393432 2.197279
126 9 3 3.027945 2.780042 32.084824 11.448721 4.641623 15.039505 4.314510 4.754702 5.013187 3.969709
127 10 2 1.363552 1.702703 1.936097 1.309372 3.510258 4.335274 3.832958 4.105288 3.929549 5.161141
128 10 2 0.914987 0.980067 1.434801 1.753067 2.635643 2.340744 1.973180 2.040623 2.332470 2.688879
129 10 3 0.937298 0.904751 1.115855 1.187627 1.970698 2.408681 1.485169 1.630275 1.399360 1.746410
130 10 3 1.038576 1.003446 1.526173 1.806352 2.280184 2.372447 1.736377 1.572996 1.977332 1.791442
135 12 2 0.881476 0.844250 1.630931 1.097971 2.241624 1.794741 1.711297 1.500715 1.538378 1.231539
136 12 2 1.226002 1.115148 2.219950 1.333357 2.956598 2.325839 3.204174 2.334192 2.325465 3.138703
137 7 3 3.570617 3.945510 2.528248 18.877760 9.719751 6.325283 3.800619 2.755498 6.054893 2.220617
138 7 1 0.931650 4.537021 1.182475 5.483997 2.151762 5.006009 1.829479 3.511858 5.315417 6.569720
140 13 2 3.360389 5.377748 13.887866 45.476518 4.014817 3.133837 3.113522 9.563267 5.233669 19.430490
141 13 2 8.443547 1.028919 16.046933 1.362579 31.601118 2.291241 20.049802 1.728215 13.828532 3.961624
142 13 2 5.572667 2.099529 7.398929 1.698469 5.362875 6.491753 2.747912 1.962971 4.413923 4.351712
143 14 2 0.951124 0.940082 2.130742 1.218279 2.475856 2.000452 2.219335 1.772880 1.910245 2.047045
144 14 3 1.196653 1.054047 1.240944 1.216683 3.007411 2.080394 1.624557 1.610357 1.719142 1.609329
145 14 3 3.434670 5.416029 23.556643 18.761385 14.551733 14.632328 3.146340 1.810575 2.975127 1.902764
150 15 1 nan nan nan nan nan nan nan nan nan nan
155 12 2 2.582287 4.850536 9.069965 21.551320 4.080435 3.874724 3.141930 3.723677 3.485454 1.843299
156 12 3 1.176059 1.323928 1.150704 1.433577 2.193168 1.967614 1.581522 1.694950 1.437567 1.637010
157 12 3 1.049179 0.955860 1.389330 1.278684 2.240417 1.912164 2.039426 1.717112 1.924149 1.447195
158 12 3 1.020824 0.943341 1.825398 1.829479 2.496953 2.114399 1.973770 1.795086 2.064182 1.857933
160 13 3 4.401812 12.031938 13.458869 71.166947 7.919480 12.550190 6.255795 21.760959 6.990788 40.231106
161 13 0 2.451137 0.960511 2.696271 1.420895 4.703947 2.138977 3.140158 2.008937 7.041361 4.375166
162 13 0 0.892350 0.942254 1.246258 1.009690 2.151751 1.891867 2.051657 1.627631 1.580359 1.702828
163 14 2 0.874715 0.985196 1.399861 1.250749 1.807978 2.194159 1.835908 1.770439 2.007537 2.459993
164 14 2 0.905614 0.864297 1.236579 1.299405 1.836862 1.956173 1.806745 2.381483 1.971682 1.905529
165 14 0 2.658277 4.149794 4.391211 7.281547 9.056716 12.082543 3.052328 3.356299 7.503516 6.318201
166 14 0 0.997127 1.060615 1.561652 1.461187 2.408866 2.791696 2.110143 2.556336 1.989143 2.658386
167 15 1 nan nan nan nan nan nan nan nan nan nan
168 15 2 1.808269 1.822352 3.988827 4.368015 3.805904 3.975583 5.707971 8.674262 9.998413 10.406851
169 15 2 1.388358 5.387259 3.084735 30.391795 3.376214 3.682024 3.783817 6.828070 6.043510 9.692573
170 15 2 1.818325 7.487190 3.474743 39.227974 4.066045 6.565995 4.992938 9.134077 8.351175 11.991202
176 12 0 0.782234 0.869839 1.426785 1.349964 1.828010 2.027762 1.796796 1.533073 1.820080 1.812719
177 12 0 0.880715 0.955870 1.452087 1.251136 2.207418 2.228420 1.705474 1.782879 1.785314 1.901069
178 12 0 0.996994 0.909101 1.619312 1.666122 2.403856 2.094703 1.921739 1.771110 1.741715 1.608451
179 12 1 1.324975 0.855762 1.338568 4.032913 2.449891 2.174634 2.940831 2.152653 2.819732 2.028818
180 13 3 2.117768 1.182008 11.393399 1.183620 4.877476 2.832157 3.797932 1.601227 3.334257 1.804995
181 13 3 1.993928 4.833774 1.194182 9.305172 4.808927 7.123300 1.970683 1.830362 2.268704 2.340951
182 13 0 1.280275 1.786914 2.120546 4.047210 3.783636 4.514221 1.712496 3.535077 1.682678 5.538985
183 13 1 1.033318 0.882656 1.417895 1.183393 2.871702 1.856522 1.625632 1.657204 2.023456 2.059634
184 14 0 0.926704 0.833443 1.265502 1.249413 2.002079 1.944157 1.634364 1.617762 1.659351 2.287030
185 14 1 0.875077 1.333693 1.135291 1.511832 1.875053 2.282823 2.065956 2.884532 2.389219 1.976713
186 14 1 0.851556 0.902724 1.153091 1.749437 2.236577 2.060313 1.800371 1.939478 1.878013 2.703235
187 14 1 0.944160 1.083670 1.849736 1.337972 2.267617 2.165105 2.537354 2.832142 3.400542 5.143566
189 15 3 1.038758 1.094170 1.555425 1.292452 2.432134 1.969107 1.645305 1.721578 1.555313 1.842364
190 15 3 2.990544 2.894819 11.465206 1.496495 4.697162 3.321244 3.103426 2.859348 3.014549 4.238274
191 15 3 1.004391 0.862882 1.166040 1.257434 2.160085 2.016989 1.926074 1.608738 1.734856 1.646935
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.979623 0.966554 1.969088 1.721225 2.379897 1.937901 1.756932 1.683032 1.926877 1.744787
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.999050 0.980801 1.757402 1.513052 2.125858 2.186828 1.616585 1.796627 1.725297 1.681730
224 19 1 0.964981 1.036621 2.935277 2.946850 2.228483 2.517027 4.098130 3.033801 7.578277 4.668845
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.338345 1.235423 1.962257 3.190701 1.988648 2.018892 1.795676 1.696769 1.742316 1.959521
323 2 3 1.077051 0.918694 2.373973 3.586461 1.951854 2.986396 1.847005 1.784872 1.678904 1.803061
324 4 3 0.910717 0.993100 2.314395 1.776408 1.755711 1.727591 1.718665 1.498367 1.852870 1.934979
329 12 1 1.034018 1.598081 8.838270 18.173156 1.707689 1.737305 1.692412 1.665252 1.740990 2.327856
333 12 1 1.254777 1.273212 2.628880 1.334415 2.012462 2.268830 1.704263 1.382526 1.792472 1.205577
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 [ ]: