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 = 2459802
Date = 8-10-2022
data_path = "/mnt/sn1/2459802"
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)
600 sum files found between JDs 2459802.25321 and 2459802.40312
600 diff files found between JDs 2459802.25321 and 2459802.40312

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.154412 1.376492 1.011386 1.036120 1.791976 1.932395 1.679575 1.608163 1.536009 2.079258
4 1 2 1.083373 1.114123 1.041288 1.246529 2.023821 1.888804 2.031498 1.676106 2.519478 2.397109
5 1 2 0.896656 1.015799 1.397658 1.113296 1.496445 1.704236 1.762704 1.784313 5.032760 5.444886
7 2 0 0.961313 0.928180 1.278763 1.257068 1.836232 1.865006 1.612163 1.723878 2.265509 2.146667
8 2 0 1.645374 5.893186 4.959332 30.510294 3.771558 17.255186 4.420316 8.434722 5.241942 33.326759
9 2 0 0.885448 0.961429 1.227312 0.949987 1.723239 1.892237 2.136742 2.102206 2.395668 2.080012
10 2 1 0.861175 0.991570 1.070650 1.023019 1.746613 1.670450 1.742582 1.814637 1.926475 2.296672
15 1 3 0.978764 1.205371 1.167101 1.087976 1.804153 2.040864 1.707649 1.698854 2.859379 3.436862
16 1 3 0.958829 0.983707 1.252488 1.019963 1.796549 2.244793 2.005742 1.731711 4.990050 2.914580
17 1 3 1.112036 0.945125 1.219632 1.048564 2.031495 1.646318 1.733197 1.621978 1.914633 2.154088
18 1 0 41.526209 16.443388 2.286868 2.291068 184.961135 64.606091 1.501403 1.695044 1.762779 1.839993
19 2 1 0.887794 1.029292 1.054638 2.463060 1.814388 2.177242 1.671861 2.133308 2.194649 4.687441
20 2 1 0.958198 0.993098 1.300057 0.961220 1.790560 1.738006 1.742939 1.648855 1.892247 1.837920
21 2 2 0.840254 0.916877 1.159392 1.002578 1.735302 1.832296 2.143678 1.797267 1.918279 1.880162
27 1 0 4.827803 4.654137 8.455907 18.940033 15.361933 7.160608 3.783203 1.886020 3.925227 1.620568
28 1 0 77.658790 1.753397 4.110767 1.412575 363.888664 6.961301 1.626929 1.989709 2.914889 3.179992
29 1 1 1.262384 1.038758 1.921723 1.232159 2.131921 1.910239 3.206321 2.946985 4.265454 3.409448
30 1 1 1.004124 1.084772 1.204854 1.299214 1.679705 2.338108 2.319555 2.919619 2.352024 5.555410
31 2 2 1.188061 1.306687 1.236285 1.231982 1.744717 2.185340 2.644744 5.226327 3.975885 10.796328
32 2 2 1.639940 2.642164 0.814826 1.151844 2.335989 2.568350 4.813592 6.417033 5.345651 7.408414
33 2 3 39.196021 1.038759 1.605386 1.322195 171.318414 1.717522 1.452965 1.644667 2.148265 2.136626
36 3 3 1.075607 1.034498 1.286956 1.291868 1.786552 1.887361 1.860426 1.649539 2.040878 1.859395
37 3 1 nan nan nan nan nan nan nan nan nan nan
38 3 1 nan nan nan nan nan nan nan nan nan nan
40 4 1 0.898785 1.240588 1.636616 1.243758 2.006508 2.333193 1.865134 1.963307 2.085688 1.977908
41 4 3 0.888353 0.981314 1.243907 2.213541 2.167200 2.383557 1.737368 1.808941 1.851192 2.001473
42 4 0 1.253868 1.101516 1.407859 1.221169 2.851636 1.911272 1.974421 2.073094 2.421992 4.735142
45 5 0 1.201076 1.247910 1.701169 1.100309 2.497350 1.826219 3.108133 2.202811 3.435125 2.613890
46 5 0 1.019239 1.064393 1.273161 1.154638 1.713887 1.850637 1.617251 1.768759 1.996608 1.911486
50 3 3 0.951663 1.953077 1.319269 0.887607 1.830069 2.824453 1.686091 1.835423 1.925124 2.303146
51 3 2 2.313093 1.051030 5.551264 1.519875 1.906212 2.266765 1.841714 1.757359 1.789524 2.386031
52 3 3 1.227776 1.258674 1.392450 1.912017 1.811481 2.565220 1.825579 2.284423 2.143971 2.622425
53 3 2 0.924110 1.320370 1.569682 1.865080 1.764223 2.790943 1.866452 2.418145 3.478990 3.134906
54 4 0 1.023723 1.040291 1.113171 1.043428 2.039463 2.234230 1.789940 1.620446 2.523673 2.762730
55 4 2 0.968248 1.058753 1.460587 1.148649 1.786978 2.289764 1.879569 1.707481 2.119186 2.143910
56 4 1 1.242518 1.250350 1.379477 1.408934 2.407985 2.465652 2.355924 2.160102 3.660722 2.620628
57 4 3 1.414340 2.058383 1.863992 9.794571 4.063465 2.263704 2.182073 1.815884 2.304091 1.953932
65 3 0 nan nan nan nan nan nan nan nan nan nan
66 3 0 nan nan nan nan nan nan nan nan nan nan
67 3 0 nan nan nan nan nan nan nan nan nan nan
68 3 1 nan nan nan nan nan nan nan nan nan nan
69 4 1 0.957356 1.055959 1.599108 1.561718 2.071377 2.110863 2.009441 2.003927 2.279955 1.993943
70 4 2 1.657429 1.421679 1.428495 1.435067 3.882433 2.762948 3.375171 2.484061 2.133557 2.970293
71 4 2 1.131585 1.128263 1.383741 1.130933 1.813732 2.011031 1.773116 1.760106 1.907133 1.869212
72 4 0 1.222475 1.465618 1.422904 1.325898 3.354372 3.776198 2.163380 2.086700 5.041549 5.925219
73 5 0 1.185642 1.922911 1.342896 5.587988 2.097430 4.337745 1.572818 1.727185 1.883560 1.787178
81 7 0 1.419196 1.126213 1.671895 1.316175 2.251319 2.065889 2.372680 1.695121 10.379275 3.851133
82 7 0 0.854886 1.105638 1.084919 0.933200 1.771953 1.976022 1.638394 1.762130 2.211493 2.117648
83 7 0 0.927775 0.979894 1.550817 2.369071 1.813084 1.712304 1.798042 1.716563 2.562083 1.922304
84 8 3 1.389414 1.700185 1.269936 3.672663 2.191061 3.159908 2.116606 2.561180 4.160713 5.374677
85 8 0 0.899254 1.076492 1.445866 1.232880 1.877083 1.789168 1.970156 2.174040 3.239092 3.931697
86 8 0 1.662307 1.262905 2.151214 1.054472 3.058371 1.795370 3.766957 4.483297 3.960395 4.659938
87 8 2 0.941305 0.972030 1.388625 1.369288 1.882893 1.884400 1.728553 2.518175 2.948538 3.197963
88 9 0 2.663113 7.590893 14.835586 41.297428 5.905749 40.693373 4.679014 4.629334 7.981438 2.795812
90 9 0 2.154477 1.584528 7.201682 16.174387 2.934447 2.351585 2.845393 2.363601 3.172584 2.984973
91 9 1 3.924505 4.380496 15.357574 15.210228 5.595782 10.019982 6.693042 4.939200 8.883384 2.913774
92 10 0 2.890192 1.978645 0.652756 0.811600 4.808172 4.732571 3.102573 2.239947 3.775020 2.366756
93 10 0 1.105898 0.959772 1.093916 1.316497 1.740899 1.985806 1.657190 1.988882 1.961872 2.843524
94 10 0 0.898785 1.202815 1.075289 2.069546 1.739434 2.681600 2.077897 2.758931 2.062721 4.486901
98 7 2 0.969144 0.955014 1.181126 1.235828 1.920091 1.991875 2.261326 1.676662 4.987462 2.200893
99 7 2 1.031494 1.065184 1.526501 1.378900 2.164842 2.113691 1.944170 1.773188 3.657639 7.278253
100 7 1 1.609508 1.174334 1.996715 1.632130 2.277119 2.070346 1.747709 1.693947 2.407896 2.378427
101 8 2 1.103129 1.105511 1.085603 1.393970 1.654085 1.738789 1.692720 1.666781 1.964633 2.348723
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.137455 0.987506 1.156729 1.128001 1.943438 1.958311 1.733046 1.711462 3.054607 1.988027
104 8 1 2.282147 1.095622 0.327258 1.383697 2.917771 1.825877 4.133502 1.762619 4.156210 2.055407
105 9 1 2.888127 3.155674 18.037963 7.039623 4.719312 8.206286 5.542681 2.615960 11.470797 2.927302
106 9 3 3.409572 3.654296 12.040419 16.311050 4.990960 10.636516 5.410387 2.725714 6.304118 2.029225
107 9 0 8.527572 35.821333 57.055886 232.524441 10.596013 22.926472 13.985705 85.167647 24.591374 161.349795
108 9 1 2.049480 1.349337 9.811889 5.663754 2.317028 1.915981 3.463916 1.914290 3.750617 1.932744
109 10 1 1.868178 1.394594 1.146634 1.312661 4.626667 3.392647 2.126771 1.917397 1.928356 2.363586
110 10 1 1.167582 2.535860 1.442906 0.828822 2.217795 3.031046 1.941685 3.019039 1.987673 2.406281
111 10 1 1.155081 1.259758 1.364730 1.155340 2.124347 2.101499 1.862712 1.836873 1.751192 1.800897
112 10 2 0.958840 2.769745 1.284187 1.320680 1.847112 2.279192 1.750615 1.818107 1.960779 2.003026
116 7 2 0.963826 0.895848 1.063121 1.073275 1.756745 1.882822 1.682750 1.596020 2.753618 2.046402
117 7 3 1.055465 1.163268 1.473644 1.345762 1.679138 1.693242 1.785976 2.193428 3.322419 4.029407
118 7 3 0.908307 1.092092 1.522457 1.305680 1.820519 2.008132 1.781289 1.817839 1.664573 2.646183
119 7 1 1.138980 0.834866 1.250742 1.456421 2.445142 1.706487 2.409274 1.703982 9.570886 2.624351
120 8 1 3.832727 1.623596 11.949688 2.534136 7.325326 4.866357 9.872669 1.622554 29.170667 2.129663
121 8 3 1.615964 1.662875 1.614533 1.114469 4.099691 4.466421 2.732033 2.366151 5.225357 8.137372
122 8 2 1.140109 1.226200 1.419001 1.485573 2.224074 2.460836 1.877461 2.079591 2.783115 3.058877
123 8 3 1.122475 1.081671 1.378248 1.359696 1.728636 1.958522 1.594650 1.937644 2.101809 2.353124
125 9 3 4.353049 2.185573 44.550866 13.102199 13.929507 6.009669 3.284680 2.095105 5.742225 2.144882
126 9 3 5.038021 3.014815 37.278011 9.821242 7.096479 9.172887 4.845228 4.949512 5.820698 4.192028
127 10 2 1.731072 1.808023 2.351899 1.364100 4.183569 5.624324 4.754304 4.509661 5.499478 6.411202
128 10 2 1.144347 1.057514 1.441860 1.188818 1.883082 1.882756 1.823420 1.977014 2.319694 2.426795
129 10 3 1.018491 1.072000 1.273478 1.025548 1.705753 1.763115 1.657527 1.634171 1.850903 2.329075
130 10 3 1.168922 1.353525 1.522247 1.126630 2.085112 2.752387 1.983849 1.867671 2.361490 2.311612
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
137 7 3 4.201324 4.195116 17.588347 21.904958 10.874346 7.030481 4.134072 2.794959 6.364939 2.277044
138 7 1 1.034572 4.725148 1.106117 6.637673 1.924503 7.109935 1.876881 3.767328 8.062146 7.028514
140 13 2 2.949500 4.082702 14.811032 32.113786 3.829266 3.235938 3.301978 4.450589 4.083473 7.744672
141 13 2 5.124572 1.119636 7.383488 1.169656 18.297837 2.340451 9.601420 1.747417 7.443960 2.939308
142 13 2 5.557794 1.969740 8.757407 1.970729 10.001814 6.137482 3.052775 1.960990 6.078617 3.952356
143 14 2 1.029022 0.974139 1.535816 1.038148 1.910665 2.000853 1.880168 1.734427 2.110208 2.298330
144 14 3 1.061930 1.152250 1.049804 1.029186 1.860454 2.025932 1.556854 1.450508 1.578289 1.703606
145 14 3 5.592255 5.792610 22.448433 22.962595 21.668351 18.701624 3.562371 1.850995 2.818140 1.871743
150 15 1 3.528734 6.191817 26.448308 44.839423 5.356132 9.293016 4.411930 8.654205 6.103150 12.161404
155 12 2 nan nan nan nan nan nan nan nan nan nan
156 12 3 0.966924 1.083205 1.056414 1.539857 1.994270 1.991465 1.718643 1.675724 1.501523 1.690489
157 12 3 1.088442 0.898960 1.468233 1.099300 2.078658 1.951317 1.986452 1.714705 1.985695 1.764686
158 12 3 1.052599 1.038650 1.989969 1.151440 2.369691 2.259809 2.237831 2.393254 3.847613 3.616289
160 13 3 3.805134 5.197248 15.237318 28.934493 6.742593 10.884492 4.761632 4.765936 3.537582 3.821459
161 13 0 3.451336 1.286997 1.058866 1.090203 4.990882 2.285152 3.036577 1.625099 5.466038 4.216288
162 13 0 1.039150 0.964927 1.546866 1.056763 1.612910 1.925193 1.671993 1.478528 1.861102 1.603560
163 14 2 1.002754 1.070298 1.423221 1.170477 1.887413 1.803671 1.896780 1.841619 2.191176 2.436131
164 14 2 1.117126 0.928301 1.178416 1.097814 1.760331 1.900217 1.948435 2.988009 1.991720 2.236178
165 14 0 4.782606 5.563445 5.040474 10.117872 16.116064 12.101482 4.247935 6.068965 14.006658 10.418150
166 14 0 0.940746 1.448034 1.284819 1.492318 2.009656 2.965546 1.834655 3.065129 1.742483 2.642152
167 15 1 2.087243 3.139133 3.672738 2.826360 3.678709 3.214636 3.572572 3.152787 4.906983 3.072312
168 15 2 1.657600 1.284527 5.380226 3.164230 3.756774 2.796599 5.476679 4.655524 7.007808 4.013604
169 15 2 1.532962 5.892533 4.363333 34.258819 3.555271 3.025850 5.049668 6.185676 8.135081 9.530469
170 15 2 1.963871 7.349869 4.543381 41.472891 4.109223 6.718312 5.125461 9.808815 11.949712 15.646101
176 12 0 0.843067 0.845607 1.216870 1.102846 1.776877 1.865356 1.908814 1.786275 2.451435 1.913551
177 12 0 0.947253 0.980965 1.345904 1.227122 1.896450 1.980348 1.712425 1.790055 1.948548 2.006342
178 12 0 0.949378 1.014781 1.081941 1.151177 1.893649 2.004116 1.819612 1.951088 2.108214 2.181132
179 12 1 1.356138 0.886812 1.026140 1.320968 2.078858 1.872561 4.149907 2.058424 2.461201 2.440351
180 13 3 2.223204 1.312880 11.391502 1.245586 6.135080 2.653163 4.605601 1.801482 3.902083 2.076028
181 13 3 2.116060 5.571839 0.882597 12.851918 5.781076 7.852798 1.986603 1.902029 1.996608 2.033547
182 13 0 8.068178 1.666610 17.362152 3.562801 22.355863 4.556750 3.629882 3.633102 3.564495 4.352949
183 13 1 nan nan nan nan nan nan nan nan nan nan
184 14 0 1.134688 0.946077 1.077891 1.251382 1.720329 1.868204 1.724494 1.649127 2.037217 2.901871
185 14 1 0.914432 1.420978 1.116101 1.585061 1.744286 1.861315 1.884927 2.258950 2.209896 1.979898
186 14 1 1.004331 1.118821 0.808376 1.023637 1.491065 2.033668 1.601399 1.821418 1.830961 2.734233
187 14 1 0.934722 1.162678 1.302189 1.597743 2.102006 2.442116 2.907841 2.961602 5.498713 7.262249
189 15 3 1.016965 1.026492 1.507397 1.149851 2.116441 1.835493 1.885130 1.779602 2.039467 1.881702
190 15 3 3.213682 2.703500 12.493838 1.068409 4.904105 4.175160 3.247229 2.887120 3.084981 4.212317
191 15 3 1.090056 0.963125 1.137778 1.075076 1.895355 1.825959 1.985362 1.839342 1.770567 1.627260
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.824859 0.994900 3.820378 1.630701 5.262469 1.750679 3.525400 1.750461 2.803163 1.678119
206 19 0 1.134143 1.130063 1.787547 1.567145 1.919090 1.935642 2.140253 1.687415 2.336032 1.958944
207 19 1 0.963565 0.962889 1.643853 1.922699 1.545108 1.679386 1.494807 1.923640 1.569176 1.718928
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.088692 0.978092 1.424782 1.520628 1.790356 1.860469 1.893959 1.815329 1.571190 1.673292
224 19 1 1.103306 0.983531 3.281298 3.391702 2.546150 2.495082 3.714625 3.099545 5.760323 4.292158
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 7.888385 5.397912 16.443278 29.825298 8.226672 7.301170 8.354385 4.077756 6.521707 3.212941
321 2 3 2.042714 1.246476 1.654292 1.647862 2.139099 2.085308 1.802408 1.820894 2.055145 1.867959
323 2 3 1.134913 2.000683 1.838223 3.106829 1.851862 4.566644 1.801057 1.964223 1.914449 3.611972
324 4 3 0.943777 1.421996 1.821097 1.791308 1.844779 3.127520 1.688837 1.672540 1.859255 1.739641
329 12 1 2.841059 4.770023 4.749740 15.651506 1.722294 1.778170 1.643407 1.724835 2.005901 2.009605
333 12 1 1.370265 1.438233 1.574790 1.206401 1.845390 2.155965 1.745262 1.553908 1.774457 1.451610
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 [ ]: