In [1]:
import os
os.environ['HDF5_USE_FILE_LOCKING'] = 'FALSE'
import h5py
import hdf5plugin
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 = 2459826
Date = 9-3-2022
data_path = "/mnt/sn1/2459826"
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 2459826.25305 and 2459826.33604
372 diff files found between JDs 2459826.25305 and 2459826.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 10*log10($|\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 0.923094 0.968431 1.287136 1.440139 1.767887 2.106449 1.757941 1.730833 1.570915 2.035231
4 1 2 1.089635 1.230390 1.448881 2.121699 2.168336 3.235237 1.750058 1.804216 2.402668 2.378440
5 1 2 0.891857 1.058488 1.674515 1.468634 1.838873 2.461972 1.936903 1.700114 5.082191 5.423187
7 2 0 nan nan nan nan nan nan nan nan nan nan
8 2 0 nan nan nan nan nan nan nan nan nan nan
9 2 0 nan nan nan nan nan nan nan nan nan nan
10 2 1 0.921853 1.132945 1.321123 1.230933 1.645812 2.651590 1.566805 2.011437 1.617370 1.849429
15 1 3 1.332014 1.463482 1.303850 1.296272 1.790477 3.384557 1.770391 2.213515 5.940100 5.861588
16 1 3 0.945270 1.220243 1.382848 1.236109 2.132345 3.359044 1.763805 1.707426 3.397914 2.440897
17 1 3 1.047573 1.309457 1.429049 1.165919 1.934000 3.051366 1.839294 1.503352 1.596124 1.787836
18 1 0 40.794042 12.931194 1.170714 1.313830 184.068765 52.141745 1.633096 1.834253 1.704795 1.921072
19 2 1 0.904787 1.186723 1.279148 1.535506 1.733273 2.703405 1.613485 1.637967 1.652282 2.344746
20 2 1 0.927883 1.050992 1.606377 1.471802 1.841346 3.189185 2.026029 1.903783 1.883008 1.981844
21 2 2 0.913563 0.924152 1.304772 1.169123 1.694110 2.948563 1.826825 1.760145 1.874749 1.910554
27 1 0 3.500594 2.765742 6.562379 16.286726 13.002512 5.934228 4.168138 2.177954 4.309337 2.162920
28 1 0 44.171178 1.334791 0.948342 1.413793 194.511994 2.131010 1.669459 1.951600 2.510979 2.895472
29 1 1 1.206800 1.042201 2.466775 1.329306 2.236175 2.716218 2.498513 2.223258 3.961673 2.657682
30 1 1 1.097313 1.187743 1.500640 1.458395 1.879283 2.707542 2.818278 3.294073 2.859982 5.557947
31 2 2 0.966391 1.492168 1.256000 1.203641 1.971201 2.546276 2.456037 4.457923 3.672719 9.123051
32 2 2 1.581678 1.269232 1.064766 1.467360 2.291007 2.241556 4.830957 7.450279 5.141870 7.712893
33 2 3 49.292392 1.007620 1.332897 1.584019 244.996902 3.206911 1.466422 1.869493 1.966313 2.080518
36 3 3 1.413712 1.296589 1.712523 1.499121 2.248653 2.562715 2.008612 1.942113 2.012252 2.094110
37 3 1 1.025856 0.979255 1.674487 1.413374 2.243945 3.091865 2.078302 1.804183 2.340104 2.494304
38 3 1 0.952755 1.105966 1.687391 1.470505 1.850224 3.643898 1.855410 2.425085 2.025858 2.444740
40 4 1 0.917690 1.326320 1.815774 1.588426 1.982747 3.458313 2.038781 2.239132 1.670582 2.650352
41 4 3 nan nan nan nan nan nan nan nan nan nan
42 4 0 0.968904 1.152370 1.383872 1.263840 2.317103 2.682329 1.808670 1.949228 2.327494 3.964789
45 5 0 1.073463 1.227412 2.338379 1.283986 2.658759 3.153883 2.437021 1.912317 2.509887 1.988674
46 5 0 1.211101 1.332945 1.273357 1.668426 2.452998 3.258102 1.919577 1.907507 2.159190 2.280450
50 3 3 0.908486 3.262998 1.694173 1.125061 1.936509 3.173675 1.759344 2.503915 1.968587 2.325253
51 3 2 4.080525 0.943408 8.729347 1.727686 1.839475 2.595796 1.603562 1.757814 1.469154 2.416540
52 3 3 1.390346 1.624562 1.633242 2.086620 2.308790 3.665139 1.959229 2.009734 2.020254 2.452378
53 3 2 0.904368 1.381112 1.710722 1.833623 1.903953 4.098712 1.794930 2.156097 2.499204 3.239083
54 4 0 1.273053 0.973285 1.289365 1.123170 2.236760 3.116898 1.861688 1.712265 2.326614 2.430055
55 4 2 0.860782 1.001305 1.590236 1.356041 1.953060 3.161495 2.016123 2.083596 2.249836 2.184688
56 4 1 1.034656 1.399257 1.503249 1.384549 2.036499 3.283669 2.173442 2.050864 2.381857 2.215151
57 4 3 nan nan nan nan nan nan nan nan nan nan
65 3 0 1.019564 0.968855 2.043677 1.513227 2.184235 2.270519 1.969015 1.693327 1.829831 2.105790
66 3 0 1.062841 1.019609 2.079833 1.663935 2.387713 2.483525 2.024851 1.585716 1.844096 2.018108
67 3 0 0.929350 1.007131 1.640738 1.336097 1.887525 2.449963 1.785366 1.792328 1.948339 1.991503
68 3 1 0.907751 0.928808 1.104272 1.600593 1.865577 2.618946 1.906235 1.921769 1.579488 2.569929
69 4 1 0.940178 1.425499 1.364762 1.800636 2.007105 3.499068 2.044222 1.996820 2.160522 2.652719
70 4 2 1.679032 1.604818 1.340276 1.653770 3.460025 3.365204 2.974941 2.208091 2.120070 2.536608
71 4 2 1.044255 1.434887 1.429995 1.275838 1.897205 3.667701 1.920129 1.766048 1.756301 1.767098
72 4 0 0.939075 1.021445 1.418923 1.495459 2.035015 3.240730 1.741722 2.009558 1.981402 2.453145
73 5 0 1.054542 1.858683 1.722549 4.024735 2.354409 4.938793 1.991863 1.768000 3.240801 1.915560
81 7 0 1.541945 1.326976 1.835400 1.559848 2.366367 2.590102 2.500850 2.124409 8.312652 3.059156
82 7 0 1.024049 0.991681 1.407054 1.347671 1.845242 2.703733 1.841379 1.930569 2.228231 2.384254
83 7 0 0.883170 1.004322 1.226677 1.525758 1.666253 2.651461 1.596709 1.755112 2.089396 1.922555
84 8 3 1.403352 1.821608 1.591604 1.778462 1.888025 3.182822 2.160756 2.254909 3.492742 5.163271
85 8 0 0.852938 1.080523 1.797978 1.409151 1.701817 2.741276 1.760535 2.387668 2.271395 3.359033
86 8 0 1.919709 1.580545 2.163190 1.493602 4.113279 2.802895 3.720191 6.613722 6.204178 9.129687
87 8 2 1.212503 2.047228 1.742640 1.157149 1.814558 5.014544 1.945257 4.120442 2.002621 3.190369
88 9 0 0.936536 27.507681 2.327761 116.948697 1.854824 76.035970 1.965965 80.322706 2.469079 123.607102
90 9 0 0.824749 1.084883 1.399731 1.488830 1.768005 3.214577 1.704605 1.635309 2.212843 2.500947
91 9 1 0.837493 20.072563 2.011359 49.417258 1.790583 75.776780 1.854845 90.207021 2.345478 107.341269
92 10 0 2.813475 1.904647 0.581438 0.943348 2.831718 2.740906 2.849743 2.252456 3.070507 2.611548
93 10 0 0.889615 0.975017 1.453589 1.110136 1.920651 2.721374 1.766017 1.592311 1.923326 1.853925
94 10 0 0.982831 1.482825 1.197346 2.319221 2.064129 3.832649 1.905443 2.574147 1.893071 5.626100
98 7 2 1.126554 0.893495 1.853490 1.975936 2.370696 2.627248 2.158981 2.085822 4.662611 2.533741
99 7 2 0.990363 1.287717 1.475542 1.477273 1.860578 2.515512 1.622432 2.058915 3.936710 12.727731
100 7 1 nan nan nan nan nan nan nan nan nan nan
101 8 2 1.432220 1.587140 1.441235 1.751775 1.896522 2.764800 1.777110 1.805756 1.960212 2.874625
102 8 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
103 8 1 1.447825 1.099909 1.426843 1.658033 2.369592 2.956512 1.731060 1.703858 2.550036 1.854453
104 8 1 2.490866 1.465514 0.433689 1.569353 2.693490 2.592271 5.398338 1.826725 5.409823 2.092228
105 9 1 0.955233 0.974066 2.100859 1.467162 1.878553 2.479390 2.044702 1.821958 2.535490 2.621743
106 9 3 0.989917 1.215565 2.037268 1.366883 1.957253 2.768704 2.197934 3.410500 2.458924 1.544776
107 9 0 1.300762 17.245093 2.456015 38.763612 1.984535 64.608564 3.065343 76.220962 16.478583 79.257127
108 9 1 0.951403 0.857026 1.702402 1.443063 1.939814 2.513712 2.052248 1.561259 2.607566 1.760506
109 10 1 2.270162 2.751989 1.753023 1.697983 4.861610 8.109830 1.876377 1.903641 1.776856 2.392196
110 10 1 1.984870 1.780193 2.351849 1.235047 2.742792 2.029497 2.164612 2.211857 2.238455 1.923989
111 10 1 1.028212 1.186199 1.806429 1.388099 2.168236 2.548768 1.913065 1.665659 1.648301 1.766589
112 10 2 0.929858 1.069373 1.560419 1.059783 2.105220 2.836932 1.973439 1.552187 2.032741 1.822616
116 7 2 0.926195 0.915092 1.326528 1.474577 2.602334 2.759975 1.913783 1.721484 2.970327 2.067462
117 7 3 0.894799 1.108629 1.463699 1.900724 1.659157 2.933142 1.805063 2.463677 2.680345 3.704258
118 7 3 1.818794 0.998091 3.249798 1.372171 2.337330 2.072119 2.939252 1.748294 3.125053 3.025291
119 7 1 nan nan nan nan nan nan nan nan nan nan
120 8 1 3.862764 1.460335 8.702238 3.687382 8.493899 4.171959 7.530710 1.951048 21.827493 4.697036
121 8 3 2.064475 2.045692 3.443537 1.575068 5.227139 5.679989 3.681709 2.390765 3.811792 16.313475
122 8 2 1.631691 1.552698 1.782394 1.871088 2.837495 2.680225 2.231734 2.112180 2.624519 3.107009
123 8 3 1.364232 1.244924 1.689608 1.545352 2.076557 2.676765 1.924243 1.914017 2.122286 2.232779
125 9 3 2.477271 1.016137 2.132487 1.929632 5.311467 1.935890 5.139510 2.071029 23.793216 2.825151
126 9 3 0.882473 2.059767 1.743830 2.018494 1.700307 4.334445 1.630238 1.967219 1.929337 2.996499
127 10 2 1.122153 1.481146 2.083729 1.381912 2.799298 4.001240 3.189210 2.898352 3.276499 3.525468
128 10 2 1.049248 1.168443 1.481306 1.611406 2.040539 3.411022 1.959101 2.145126 2.216401 3.226971
129 10 3 0.913008 1.029670 1.388900 1.521525 1.825218 3.117592 1.729060 2.115756 1.709700 2.748948
130 10 3 1.049213 1.362169 1.800308 1.295996 2.234317 2.960004 1.949988 1.723121 2.026877 2.140279
135 12 2 1.197176 1.339615 1.400346 1.454147 3.111065 2.572128 2.229904 2.188313 3.483374 4.909900
136 12 2 1.148121 1.273692 1.295711 1.173745 1.975843 2.486856 3.502176 2.122907 1.901032 2.112432
137 7 3 0.950674 22.510351 2.246664 79.645155 1.900305 77.320279 1.848374 86.162958 2.570897 111.281649
138 7 1 nan nan nan nan nan nan nan nan nan nan
140 13 2 3.170984 2.880154 8.546575 16.366078 6.670336 2.643313 3.586898 2.466973 3.047880 1.802736
141 13 2 4.903726 1.275816 9.831612 1.213372 16.379697 2.517574 9.682851 1.508301 7.994712 1.765880
142 13 2 4.916847 1.602482 6.288413 1.964538 6.046505 3.019281 2.965250 2.233854 3.608268 3.751045
143 14 2 0.932590 1.080497 1.353338 1.372303 1.762577 3.317438 2.028514 1.915162 2.095744 3.100767
144 14 3 1.087167 1.329571 1.414610 1.350133 2.061184 2.846274 1.589346 1.772511 1.951443 1.992100
145 14 3 3.452805 2.659981 19.657383 15.497808 11.617563 9.828516 3.242710 1.530714 2.953348 1.545462
150 15 1 2.825940 5.695978 16.063019 41.020528 4.436593 8.888204 3.919801 7.722510 4.707668 10.385455
155 12 2 2.785001 2.962678 6.953594 19.946800 3.784141 4.445537 3.052218 4.139713 3.551849 2.186457
156 12 3 1.101540 1.323583 1.327068 1.322134 2.003337 2.473618 1.758037 1.808213 1.542350 1.470463
157 12 3 1.112137 1.341241 1.266338 1.417655 1.980968 2.741013 1.880252 1.797489 1.773460 1.673523
158 12 3 1.286513 2.285945 2.340568 4.271325 3.619111 6.016405 2.643627 1.820297 3.280689 1.825799
160 13 3 3.906527 7.415178 19.832549 51.815367 7.141892 9.230993 6.027580 14.634127 8.443828 21.632085
161 13 0 2.716431 1.119810 1.588873 1.400855 5.199354 2.958066 3.856272 1.874799 6.035707 3.746472
162 13 0 0.972725 1.053386 1.469105 1.438337 1.838630 2.982762 1.856314 1.852531 1.714959 1.718102
163 14 2 0.960621 1.124427 1.641198 1.608016 1.811170 2.819175 1.731799 1.713555 2.027390 2.282568
164 14 2 0.963662 1.119688 1.206843 1.157422 1.896528 2.478001 1.843286 2.465154 1.981044 2.245855
165 14 0 3.989624 3.233871 4.004459 4.898378 12.546585 8.816530 3.068974 5.821061 4.311959 6.231988
166 14 0 0.928545 1.469150 1.547045 1.619239 1.913489 2.248951 1.964760 2.210035 1.752528 2.450835
167 15 1 1.674820 2.565735 1.709830 1.771053 2.095522 2.213673 3.333853 2.492222 2.399377 1.889342
168 15 2 1.307829 1.080044 2.903696 1.988489 1.895350 1.670943 3.671212 2.711266 5.372364 3.302185
169 15 2 1.477114 4.581483 2.491705 20.417827 2.602160 4.735200 2.989314 6.419816 5.848376 8.554631
170 15 2 1.500879 7.531652 2.714053 35.483180 2.755303 17.965411 3.943320 18.636448 5.701461 24.370832
176 12 0 0.818088 0.985827 1.318691 1.543073 1.864095 1.996140 1.800047 1.609729 1.873450 1.985337
177 12 0 0.934074 1.292506 1.426110 1.305639 1.834542 2.140091 1.519759 1.566224 2.074091 1.784694
178 12 0 0.884233 1.071373 1.306559 1.358768 1.833719 3.891150 1.671605 2.023267 1.734283 2.210328
179 12 1 1.360621 1.164409 1.447617 1.467956 2.370357 3.680089 3.101958 2.156260 2.814863 2.313323
180 13 3 2.452534 1.424843 11.924802 1.229764 6.275548 3.637261 3.443216 1.738676 3.337262 1.899543
181 13 3 2.892053 5.202939 0.942430 12.256969 3.629008 10.141613 1.746160 2.189496 2.058749 2.028805
182 13 0 3.961368 1.498617 7.729574 1.955999 12.866238 3.079414 2.364116 2.000560 2.417519 2.552944
183 13 1 1.118122 1.165757 1.328138 1.411109 2.371156 2.978042 1.637925 1.835869 2.096938 2.184776
184 14 0 0.918592 0.960353 1.363027 1.294101 1.822391 2.820310 1.767892 1.743505 2.605858 3.761076
185 14 1 0.855959 1.285691 1.355685 2.264751 2.054063 3.034923 1.809094 2.413533 2.052753 3.661581
186 14 1 1.014168 1.201855 1.397361 1.236206 1.690655 2.925718 1.791579 1.801947 1.856766 2.798709
187 14 1 1.118405 1.336161 1.487802 1.486645 2.115413 2.744488 3.044419 3.979621 5.104603 6.085850
189 15 3 1.069049 1.333001 1.545818 1.696952 1.876167 2.679871 1.519442 1.615157 1.311534 1.449464
190 15 3 3.109175 1.393338 12.148130 0.806456 4.575836 2.328561 3.189287 2.258798 3.158146 2.620008
191 15 3 0.991523 1.093061 1.385512 1.267434 2.033157 3.050076 1.939698 1.977384 1.693850 1.975881
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 0.108970 0.075212 0.070825 0.015037 0.148104 0.064842 0.049865 0.018057 0.038547 0.016847
206 19 0 0.080949 0.082221 0.020242 0.018523 0.078484 0.067221 0.020977 0.018820 0.021200 0.022201
207 19 1 0.064832 0.065111 0.017322 0.015318 0.068427 0.054991 0.018189 0.014744 0.017034 0.014946
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.095525 0.081399 0.022573 0.018558 0.081866 0.069075 0.024565 0.019898 0.024589 0.018959
224 19 1 0.040001 0.035947 0.007242 0.007114 0.040684 0.036764 0.015912 0.006594 0.025500 0.011933
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.573837 5.742916 9.327522 29.692353 5.627987 6.989214 6.461818 5.709311 10.438053 17.144837
321 2 3 1.010655 1.186938 1.732817 2.227788 1.865342 2.108260 1.701875 1.983759 1.741705 1.884050
323 2 3 0.882800 1.485826 1.896708 4.331263 1.715641 2.428311 1.797117 1.479893 1.632733 1.720400
324 4 3 nan nan nan nan nan nan nan nan nan nan
329 12 1 2.324321 3.494336 5.525354 16.603341 2.050592 1.855461 1.792844 1.756061 1.917567 1.964762
333 12 1 1.183243 1.394747 1.702785 1.614732 2.315518 3.232910 1.740551 1.742712 1.690125 1.468573
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 [ ]: