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 = 2459786
Date = 7-25-2022
data_path = "/mnt/sn1/2459786"
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 2459786.25318 and 2459786.33617
372 diff files found between JDs 2459786.25318 and 2459786.33617

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 2.174632 1.432754 1.529860 1.426612 3.463220 2.815153 1.701849 2.037819 1.428201 2.345308
4 1 2 1.062643 1.119071 2.211965 5.121313 2.365250 1.984672 1.752039 2.082576 1.907118 2.146587
5 1 2 1.025093 1.199048 1.708336 1.417082 2.146777 1.976911 2.260248 1.763936 4.722611 5.091780
7 2 0 1.256974 0.965547 2.133737 1.797802 2.627070 1.935916 2.248615 1.893827 2.470989 2.199889
8 2 0 2.694552 21.442579 10.232051 92.484686 7.699165 48.781495 8.107180 79.159442 10.226980 105.298857
9 2 0 1.014061 0.975006 1.725439 1.443600 2.085803 2.177545 2.338463 2.037009 1.841902 2.119920
10 2 1 nan nan nan nan nan nan nan nan nan nan
15 1 3 1.256147 1.152095 1.764348 1.450106 2.171035 2.051336 1.588381 1.786413 3.244566 3.626167
16 1 3 1.037602 1.072000 1.608981 1.555774 2.239959 1.921492 1.905773 1.915947 6.647058 6.458978
17 1 3 1.217988 0.997885 1.425189 1.577231 2.609431 1.937613 1.702246 1.842186 2.266252 2.327045
18 1 0 53.017757 48.235087 1.317282 1.323429 243.547019 215.896612 1.731637 1.403473 1.793256 1.720827
19 2 1 nan nan nan nan nan nan nan nan nan nan
20 2 1 nan nan nan nan nan nan nan nan nan nan
21 2 2 0.925976 0.910795 1.553019 1.234106 1.822471 1.881318 1.778525 1.767929 1.896955 2.042509
27 1 0 2.166015 2.851428 5.872354 10.602330 6.643777 6.828436 3.800915 2.217640 2.906454 1.781584
28 1 0 44.939210 0.887537 0.916047 1.450815 208.560011 1.968711 1.841310 1.818012 2.149312 2.241696
29 1 1 1.125104 1.330736 1.477201 1.464830 1.990253 2.236917 2.959190 2.274911 2.543426 3.271229
30 1 1 1.367925 1.049848 2.057646 1.694955 2.166560 1.866811 2.819612 3.206459 2.021147 3.279381
31 2 2 1.076129 1.212338 1.519983 1.339505 2.150365 2.221462 2.544624 4.601584 2.847780 7.497719
32 2 2 1.164295 1.372359 1.539488 1.544327 2.508469 2.769904 5.641904 7.067242 5.395344 7.401147
33 2 3 67.560687 0.931438 1.413599 1.481119 309.332186 1.745915 1.831720 1.768284 1.915372 1.903597
36 3 3 1.515934 1.506043 1.580866 1.723654 2.245507 2.371322 1.557369 1.844602 1.395227 2.130663
37 3 1 1.067261 1.036392 3.255721 2.019620 2.653765 2.145066 2.032294 1.933289 1.888581 2.309109
38 3 1 0.964490 1.096659 1.578077 1.387981 2.055836 2.098486 1.771463 2.952066 1.638805 2.196559
40 4 1 1.001407 1.085144 1.964933 1.400838 1.934245 1.989170 1.737072 1.807742 1.575598 3.081476
41 4 3 0.994063 1.063073 1.349839 2.263125 2.140917 2.056313 1.705149 1.693869 1.548024 1.675918
42 4 0 0.966275 0.959068 1.276922 1.560147 2.479437 2.230546 1.914995 2.014875 2.210459 4.841921
45 5 0 1.456804 1.135578 3.705266 1.836554 3.774829 2.105162 2.977714 2.343374 2.704972 2.593823
46 5 0 1.326470 1.092376 1.394183 1.429616 2.512570 1.908565 1.729896 1.619364 1.789841 2.254479
50 3 3 1.257868 0.889815 1.851043 1.201262 2.462270 2.166877 1.568550 1.709582 1.631959 1.434501
51 3 2 6.282069 1.014991 21.564872 1.660531 9.726238 1.832847 5.634085 1.920440 7.082492 2.545810
52 3 3 7.714893 1.038079 28.184285 1.595235 8.758432 2.544879 4.618396 2.096516 5.209774 2.617076
53 3 2 0.999685 1.101107 1.838605 2.474458 2.065395 2.560950 1.852884 2.334775 2.407239 4.108440
54 4 0 0.969425 0.916486 1.227706 1.344636 2.419599 2.063708 1.692220 1.813374 2.146302 2.442756
55 4 2 0.970306 1.034200 1.514691 1.233665 2.127579 2.107856 1.798670 1.907212 2.034478 1.856576
56 4 1 1.049391 1.286963 1.907774 1.818434 2.606907 2.414759 2.250896 2.097135 2.674596 3.364282
57 4 3 0.935832 1.857972 1.780846 7.936774 2.266237 1.743948 1.768893 1.872973 1.782938 2.138652
65 3 0 1.142888 0.887259 2.082547 1.456173 2.587717 2.061213 2.006818 1.672125 1.688601 1.629595
66 3 0 1.265548 1.036823 2.986531 1.763128 3.140968 2.241372 2.149597 1.748554 2.045348 2.005389
67 3 0 0.940643 0.979762 1.453627 1.433276 1.961268 1.901378 1.462724 1.771504 1.425326 1.693343
68 3 1 1.039895 0.980834 1.461410 1.514144 2.340930 2.112348 1.855123 1.666190 1.696049 2.140752
69 4 1 1.060491 0.964809 1.850416 2.546317 2.139208 2.005632 2.113758 2.164820 2.518746 2.890065
70 4 2 1.357247 1.340743 1.402285 1.412368 3.370305 2.064796 2.194252 1.813093 1.559988 1.900960
71 4 2 1.064329 1.127825 1.486332 1.347748 1.911368 1.925033 1.670419 1.724045 1.397046 1.526659
72 4 0 0.987897 0.918645 1.473030 1.897778 2.198455 2.368205 1.768898 1.899923 2.542187 3.084606
73 5 0 0.964424 1.098804 1.463687 1.190165 2.274885 2.005956 1.918768 1.680056 2.239833 2.620439
81 7 0 1.710821 1.530332 1.932283 1.375217 2.973939 2.401984 2.467817 1.737611 9.522110 3.352558
82 7 0 1.065912 0.967198 1.481653 1.249988 2.036625 2.408222 1.584466 1.846478 1.986816 2.262555
83 7 0 0.999101 2.087097 1.619175 12.037345 2.099481 4.582893 1.775335 4.487549 1.760499 10.594655
84 8 3 1.543493 2.070621 1.726979 4.114107 1.866638 2.590866 1.784838 2.438094 4.087406 6.384732
85 8 0 2.938595 0.892215 6.689584 1.601645 3.626239 1.762003 2.310398 1.774863 3.495020 1.712196
86 8 0 1.642611 1.327089 2.528115 1.864114 3.435863 2.254655 3.484419 4.220399 6.360406 6.018674
87 8 2 nan nan nan nan nan nan nan nan nan nan
88 9 0 4.531360 18.042895 20.793624 36.689886 7.208379 33.558231 4.042026 3.810017 6.418222 2.572959
90 9 0 7.281642 2.999530 2.448754 2.666521 10.490841 8.716809 28.019109 9.089851 26.418798 20.860631
91 9 1 nan nan nan nan nan nan nan nan nan nan
92 10 0 2.134877 1.752363 0.556728 1.024670 3.693726 2.805569 2.528061 1.984083 2.524106 2.188543
93 10 0 1.080783 0.924744 1.598412 1.504581 1.758336 2.297760 1.559363 1.703357 1.597944 1.837224
94 10 0 1.035946 1.182556 1.376282 1.827655 2.225508 2.491196 2.002547 2.209096 1.869040 13.397358
98 7 2 1.199964 0.955623 1.570044 1.578154 2.094708 2.006897 1.832940 1.679634 3.144022 1.637293
99 7 2 0.966557 1.150873 1.516141 1.549488 2.158514 2.203099 1.811346 1.780971 2.983555 16.814432
100 7 1 1.431054 1.134672 1.787046 1.674297 2.600986 2.263545 1.813312 1.851074 1.782796 1.904803
101 8 2 nan nan nan nan nan nan nan nan nan nan
102 8 0 0.964763 0.920156 1.388148 3.050486 1.815304 1.644516 1.632177 1.736353 1.702453 1.922220
103 8 1 1.399955 0.884686 1.955160 1.494337 1.837791 1.726285 1.698821 1.721674 1.700748 1.716680
104 8 1 1.811464 1.252848 0.487176 1.566526 2.832323 1.780500 3.733998 1.384122 49.972175 1.460100
105 9 1 nan nan nan nan nan nan nan nan nan nan
106 9 3 1.752012 1.811442 1.730864 1.631082 4.739078 3.890942 2.535706 3.213697 3.464407 2.478140
107 9 0 8.075030 31.822556 31.321787 191.187940 9.446430 21.522935 11.864178 75.776464 21.101776 143.420578
108 9 1 nan nan nan nan nan nan nan nan nan nan
109 10 1 1.428385 1.221738 1.553558 1.787684 3.326034 2.273764 1.679506 1.900918 1.517486 1.568544
110 10 1 0.997616 1.618532 1.835256 3.772518 2.752510 3.348953 1.524567 2.938984 1.476622 2.108275
111 10 1 1.268425 1.194366 1.579006 1.375372 2.350701 2.248450 2.046924 1.737201 1.729189 1.573254
112 10 2 0.988455 1.372621 1.608373 3.244248 2.111444 1.648664 1.763937 1.536427 1.565413 1.373050
116 7 2 0.878990 0.795139 1.452222 1.432920 2.136770 1.947876 1.738112 1.714725 1.899261 1.686170
117 7 3 1.024104 1.065454 1.619201 1.451072 1.960659 1.837875 1.649385 2.127222 1.823025 3.402000
118 7 3 0.999981 0.950735 1.644817 1.555957 2.220652 1.943225 1.910973 2.102507 1.548983 3.090027
119 7 1 0.844913 0.880789 1.302380 1.545838 1.711396 1.708059 1.645788 1.573776 2.929535 1.865178
120 8 1 6.160532 1.706904 12.689924 2.709602 7.725609 3.983138 9.010203 1.825765 27.645865 3.195252
121 8 3 1.686964 1.418866 2.355116 1.527099 4.262088 4.051203 2.827575 2.186216 4.437128 15.363637
122 8 2 nan nan nan nan nan nan nan nan nan nan
123 8 3 1.426410 1.285897 1.670509 1.592316 2.022652 1.978275 1.631390 1.564567 2.232712 2.162578
125 9 3 3.973880 2.682099 37.010921 12.174528 9.635778 5.254848 2.955533 2.185356 4.860641 2.259236
126 9 3 2.643100 2.530489 30.041713 9.243983 6.579416 6.718596 4.126379 4.661135 5.179303 4.017299
127 10 2 1.375322 0.957562 2.218401 1.255874 2.860683 2.013827 2.477839 2.035999 2.201804 2.598700
128 10 2 0.923951 0.973302 1.459785 1.832241 2.166631 2.253249 1.986153 1.857040 2.194052 3.702976
129 10 3 nan nan nan nan nan nan nan nan nan nan
130 10 3 nan nan nan nan nan nan nan nan nan nan
135 12 2 0.950588 0.909331 1.691665 1.508107 2.599312 2.172898 1.641521 1.625683 1.588445 1.433340
136 12 2 1.363948 0.998122 1.612058 1.663339 3.027817 2.207427 3.917525 2.139953 2.645788 2.963972
137 7 3 3.410540 3.883810 6.588133 21.129291 9.832807 7.375172 4.114164 2.725462 5.723800 2.397565
138 7 1 1.061571 5.448628 1.767747 5.303039 2.607069 5.366444 2.298127 3.482804 8.706125 5.334416
140 13 2 1.048848 0.925403 1.644924 1.511914 2.356707 2.085126 1.719240 1.886938 1.898361 2.899010
141 13 2 5.703242 1.044615 14.033022 1.352355 20.793850 2.117977 13.464305 1.615539 9.611349 1.700711
142 13 2 5.251265 1.671086 8.172297 2.074598 6.069707 2.873891 2.983478 1.990509 4.497386 5.052944
143 14 2 1.089607 0.945923 2.141314 1.424238 2.448905 1.950505 1.958538 1.833254 1.912159 2.024636
144 14 3 1.179020 1.028191 1.415574 1.373847 2.517636 2.147338 1.550112 1.664374 1.869430 1.696765
145 14 3 4.107546 3.152492 22.025409 20.507179 17.891138 11.868039 3.452744 2.056871 2.910865 2.035112
150 15 1 2.208116 5.313473 21.391921 37.811203 3.891297 9.507087 3.359400 2.589373 2.452207 2.003793
155 12 2 2.688311 4.526627 8.374830 23.961125 3.891422 3.875690 3.552450 5.089337 3.861552 1.857062
156 12 3 nan nan nan nan nan nan nan nan nan nan
157 12 3 nan nan nan nan nan nan nan nan nan nan
158 12 3 nan nan nan nan nan nan nan nan nan nan
160 13 3 4.950670 12.256498 15.620853 70.308506 6.783905 10.972625 5.754127 22.105885 8.069576 41.664650
161 13 0 2.515616 1.062156 3.066120 1.507832 5.555487 2.023020 2.851668 1.731183 3.939094 2.821516
162 13 0 0.954159 0.945513 1.359710 1.579755 1.950716 1.892605 1.693791 1.834375 1.566876 1.864779
163 14 2 1.109885 1.010254 1.505389 1.576032 2.129609 1.876073 2.054131 1.691481 1.549667 1.855588
164 14 2 0.970922 0.970236 1.709192 1.272597 2.517778 1.719354 2.005915 2.312362 1.852834 1.601928
165 14 0 3.501404 8.078969 2.396018 10.586235 11.673185 22.735715 2.356030 4.690422 5.226460 4.690621
166 14 0 1.054957 1.618166 1.808176 1.613091 2.422638 3.627236 2.307918 4.005574 1.816836 3.173548
167 15 1 2.028680 2.270488 2.750912 4.304963 3.373012 2.542554 2.605544 2.446282 3.190041 1.939537
168 15 2 2.144311 6.978505 5.965805 30.759902 5.473035 12.801306 5.246546 9.377494 9.697784 21.774466
169 15 2 2.366817 13.856873 6.836674 64.212729 7.031787 23.645526 6.124289 29.754337 10.131397 44.762295
170 15 2 2.440306 14.634062 7.594753 62.309632 6.680909 29.848370 5.836784 25.865418 10.884418 48.914570
176 12 0 0.972667 0.889517 1.287396 1.366949 2.085426 1.735109 1.765892 1.655988 1.673871 1.662507
177 12 0 0.955336 1.074595 1.653355 1.576228 2.025078 2.338598 1.699409 1.792410 1.827391 1.789285
178 12 0 1.068122 0.948383 1.497507 2.001411 2.227230 2.130394 1.794603 1.636527 1.595600 1.726855
179 12 1 1.485608 0.863920 1.482367 1.448684 2.197153 2.030306 4.949727 2.156116 2.641498 1.823136
180 13 3 1.902626 1.187015 13.312622 1.369524 4.747413 2.371749 3.808839 1.675540 3.805930 1.750445
181 13 3 1.396679 4.789831 1.414670 13.624078 3.489982 8.874028 2.049159 1.986571 2.082106 2.287572
182 13 0 1.061490 8.427754 1.959166 39.875468 2.418682 10.386024 1.946639 5.423363 2.469144 18.002346
183 13 1 1.068840 1.015730 1.680313 1.585783 2.252568 1.908001 1.801273 1.776832 1.917594 2.020661
184 14 0 0.845412 0.925150 1.472187 1.443667 1.941054 1.863707 1.733525 1.760517 1.532686 1.693009
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.139284 1.013931 1.547833 1.292827 2.654953 1.886245 1.530360 1.482198 1.673825 1.723302
190 15 3 2.683838 1.455231 11.498396 0.977226 4.330985 2.906513 3.242873 2.562679 2.921466 3.814270
191 15 3 0.941525 0.973199 1.297446 1.641045 2.126047 2.290143 1.777855 1.961941 1.634334 1.588099
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.026854 0.853080 2.756678 1.824743 2.665981 1.901277 1.759358 1.590498 1.816948 1.874047
206 19 0 1.350421 0.971878 1.702762 2.323544 2.073216 1.996068 1.928316 1.902532 1.910381 1.858183
207 19 1 0.806231 0.991708 1.946585 3.678981 1.771878 1.851736 1.805709 1.858303 1.967486 3.063981
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.953775 0.956629 1.890933 1.837832 1.832579 1.958074 1.740258 1.647985 1.774115 1.691636
224 19 1 1.312040 1.342627 3.887537 4.690596 3.235307 3.352847 4.856093 3.261410 8.906072 6.337813
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 4.877423 4.314880 11.931928 27.179782 7.440732 5.643740 7.932539 4.877035 10.449101 14.798503
321 2 3 0.943993 1.166326 1.669224 3.500821 2.066961 2.153616 1.667705 2.235478 1.721629 2.064319
323 2 3 1.260652 1.282033 3.984611 5.274049 2.738188 3.194000 2.001043 1.943956 2.081926 1.967798
324 4 3 0.845418 1.463391 2.237146 1.873059 1.726363 3.528428 1.627778 1.859786 1.591252 1.885103
329 12 1 1.005501 0.958505 1.990236 1.544194 2.271233 2.213608 1.856590 1.659974 2.003585 2.520983
333 12 1 1.254039 1.020538 2.670239 1.890648 2.725444 2.732064 1.586350 1.444790 1.717022 1.559707
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 [ ]: