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 = 2459754
Date = 6-23-2022
data_path = "/mnt/sn1/2459754"
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 2459754.25311 and 2459754.33610
372 diff files found between JDs 2459754.25311 and 2459754.33610

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
0 0 0 171.661204 96.067308 465.004083 224.448215 7.618767 8.512288 3.721131 21.154166 1.713975 1.443034
1 0 0 84.742314 100.438941 218.180172 241.182851 2.364930 1.696653 1.411896 0.864567 1.569338 0.705399
2 0 0 110.443396 139.253804 242.183654 354.692867 2.413562 2.673511 1.728693 3.039204 1.508245 1.209354
3 1 2 1.137751 1.237152 1.624737 1.667540 1.919277 2.562862 2.891810 4.914559 3.321545 6.936221
4 1 2 0.884038 0.872287 1.588708 1.540604 2.034653 2.242722 1.690423 1.857723 1.953512 1.942950
5 1 2 0.939371 0.816490 1.774304 1.564279 1.936139 1.721666 1.846461 1.852875 2.203336 2.250113
7 2 0 1.019932 0.846809 1.839601 1.515438 2.466057 1.858825 1.936611 1.801574 2.416823 2.249274
8 2 0 1.048306 28.453085 2.145465 81.393521 1.826378 106.441540 2.128211 139.032862 2.379329 156.566677
9 2 0 0.848699 0.892076 1.783350 1.477966 1.824127 1.985891 1.915450 1.981275 1.867647 2.142894
10 2 1 0.897554 25.151795 1.715587 24.362615 2.245954 95.706435 1.859366 126.281588 2.454508 147.882042
11 0 1 53.149067 309.562562 107.345971 2173.722573 5.478052 282.030065 104.794973 259.054465 74.680276 412.578216
12 0 1 164.367582 166.538842 348.561267 1033.204982 55.374580 141.328832 734.395235 261.948922 25.145858 48.243227
13 0 1 123.810679 159.729767 251.783249 486.133380 22.121615 127.717103 205.164588 172.205211 19.138791 47.705020
14 0 2 98.689854 520.453325 370.850693 3733.156567 24.770486 1213.674732 27.239385 351.316144 4.027899 188.317712
15 1 3 1.133986 0.915059 1.853729 1.558505 2.064259 2.086546 2.462063 2.027059 9.951524 8.493579
16 1 3 1.238270 1.207856 1.892064 1.743894 2.215393 2.458223 2.038364 2.685294 10.457875 12.140475
17 1 3 1.339602 0.907528 1.778841 1.613123 2.590876 1.851454 1.877511 1.795677 2.497154 3.188908
18 1 0 38.508688 3.941951 1.432611 1.350624 194.392961 9.344293 1.738508 1.587814 1.963144 1.889917
19 2 1 1.039489 0.984533 1.886152 1.796406 1.716018 1.793834 1.988221 2.211229 6.300735 15.406717
20 2 1 0.883671 0.848495 1.744785 1.361977 2.033947 1.543732 1.986300 1.560709 2.423523 1.831369
21 2 2 0.979976 0.959219 1.832515 1.534315 1.976800 1.955004 2.715903 2.713965 2.852782 6.232712
23 0 2 86.155543 106.130914 236.343585 279.961572 9.067345 10.652371 1.720914 2.970126 2.131385 1.914336
24 0 2 79.200243 98.642504 174.511402 232.617701 1.200353 11.170577 0.461844 2.958749 0.517193 2.222418
25 0 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
26 0 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
27 1 0 58.407167 96.952050 1.185909 5.531796 294.146636 467.670135 1.804925 1.899281 2.429501 1.595230
28 1 0 0.823843 51.936409 1.452575 1.231327 1.647965 260.334117 1.694856 1.918095 1.843272 2.189858
29 1 1 1.136716 1.010180 2.143242 1.706032 1.944543 1.860083 2.863067 2.142580 2.881979 2.299821
30 1 1 1.280273 0.952711 2.478924 1.698306 2.305292 2.049440 2.643988 3.314470 3.146552 5.299301
31 2 2 0.897496 0.789146 1.898026 1.441725 1.992794 1.614476 2.007911 1.859430 2.065659 3.892207
32 2 2 1.440524 2.207200 1.399105 1.422087 2.236694 2.212950 8.953318 14.303660 4.414281 7.179266
33 2 3 33.215994 0.862440 3.085630 1.426800 164.521260 1.742148 1.842726 1.838375 2.258294 1.974218
36 3 3 1.320464 1.201567 1.862298 1.677777 2.053793 2.115812 1.916721 1.782472 1.911784 2.797585
37 3 1 0.992566 0.796808 2.171601 1.618244 2.020749 2.063471 2.008354 2.063554 4.459021 4.838213
38 3 1 0.907437 0.954542 2.041721 1.307685 1.906225 2.214159 2.450499 2.044641 2.465585 2.395709
39 0 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
40 4 1 0.871575 0.917113 1.585409 1.785254 1.844320 2.406776 1.761504 2.186494 1.981598 5.176849
41 4 3 0.854622 0.828391 1.482044 1.547881 1.629084 1.791149 1.569765 1.550732 1.674732 1.865736
42 4 0 0.946396 0.911949 1.788610 1.411115 1.949091 1.974983 1.933072 1.845493 6.406209 9.503095
45 5 0 2.569432 0.915740 21.736568 1.593054 3.600052 1.813588 3.257308 1.680574 3.319916 2.000201
46 5 0 1.197488 1.015999 2.038360 1.785247 2.173189 2.466070 2.062517 2.075027 2.171458 4.145902
50 3 3 1.636885 0.852427 1.704482 1.559755 2.756742 2.226637 3.287870 1.939854 5.202239 4.304052
51 3 2 1.063663 0.946576 1.853987 1.807595 2.379013 2.236097 2.545652 2.175671 5.557048 3.819754
52 3 3 2.114745 1.266308 1.661154 2.233889 2.477402 2.232199 2.734206 2.328802 3.828201 3.752304
53 3 2 1.075517 1.038884 2.386308 2.779030 2.376251 2.926811 2.175835 2.745935 3.926064 5.260910
54 4 0 0.895080 0.849510 1.891776 1.634656 2.103808 1.930997 1.833067 1.831150 2.017394 2.808950
55 4 2 0.869338 0.868788 2.097677 1.862020 1.753958 1.704589 1.866743 1.521063 2.092142 1.790958
56 4 1 1.389934 0.832118 1.813080 1.679652 2.126955 1.764177 1.878773 1.877777 2.037693 2.084877
57 4 3 1.057986 0.981476 2.624790 1.245816 2.428442 2.401886 2.337689 1.695547 2.544999 1.866655
65 3 0 1.277132 0.951806 2.219359 1.862236 2.191894 1.970606 2.160952 2.336991 3.459643 3.522605
66 3 0 1.144189 0.868423 2.122583 1.754223 1.997932 2.086021 1.902431 1.915713 2.267713 3.253743
67 3 0 1.124336 0.901849 2.110634 1.758669 2.016372 2.259457 1.691357 2.051355 1.764729 1.984827
68 3 1 1.019211 0.815429 1.669639 1.774627 1.942890 1.913592 1.805593 1.871814 1.782988 1.987823
69 4 1 0.864740 0.883439 1.750470 2.068111 1.792250 2.035624 1.766007 1.997325 2.154096 2.929457
70 4 2 1.024196 1.088708 1.632373 1.516292 1.837047 2.042751 1.849761 2.044426 1.529393 1.845133
71 4 2 0.871919 0.940103 1.840241 2.386913 1.981021 1.813655 2.531498 2.096090 2.462333 1.827286
72 4 0 0.913388 0.976499 2.441284 1.851137 2.163275 2.259447 1.929935 2.041268 6.457798 5.702126
73 5 0 0.950681 1.001102 1.575681 1.758183 1.911385 2.254833 1.692763 1.981549 2.499197 4.340278
81 7 0 1.019287 0.937531 1.551951 1.615952 1.793270 1.853426 1.883496 2.295549 4.059948 6.871517
82 7 0 1.026762 0.840200 1.671623 1.810392 1.653683 1.901096 1.706011 1.796112 3.102181 4.225567
83 7 0 3.839321 3.425275 12.507323 26.920679 3.962360 5.741029 4.433348 2.440706 5.544181 2.269698
84 8 3 1.530430 1.369050 1.662707 2.091294 2.743511 2.660434 2.167709 2.298860 5.675145 6.399444
85 8 0 nan nan nan nan nan nan nan nan nan nan
86 8 0 nan nan nan nan nan nan nan nan nan nan
87 8 2 1.273949 1.095318 1.624108 2.989313 1.996780 1.805332 1.997903 3.157362 2.225617 2.416431
88 9 0 nan nan nan nan nan nan nan nan nan nan
89 9 2 nan nan nan nan nan nan nan nan nan nan
90 9 0 nan nan nan nan nan nan nan nan nan nan
91 9 1 nan nan nan nan nan nan nan nan nan nan
92 10 0 nan nan nan nan nan nan nan nan nan nan
93 10 0 nan nan nan nan nan nan nan nan nan nan
94 10 0 nan nan nan nan nan nan nan nan nan nan
98 7 2 3.660273 2.751361 13.158468 24.668917 4.598450 6.989133 4.380650 2.175933 3.792554 2.162865
99 7 2 0.974681 0.825535 1.774764 1.547345 1.908780 1.695290 1.840142 1.481065 3.230519 2.541191
100 7 1 7.169094 4.427618 19.526946 17.873363 16.191464 18.318935 3.681701 3.757205 4.781441 3.459740
101 8 2 1.656182 1.359834 1.888672 1.744915 1.894931 1.847369 1.824727 2.118116 2.239992 5.822434
102 8 0 nan nan nan nan nan nan nan nan nan nan
103 8 1 1.202831 0.889526 1.989929 1.704376 2.080009 2.015078 1.866762 1.813568 2.316546 2.314634
104 8 1 2.674676 1.134910 3.262481 1.691625 2.444734 1.978573 2.707130 1.796358 6.837140 2.147904
105 9 1 nan nan nan nan nan nan nan nan nan nan
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 nan nan nan nan nan nan nan nan nan nan
108 9 1 nan nan nan nan nan nan nan nan nan nan
109 10 1 1.429495 1.104338 2.341868 2.210924 3.397869 3.562741 1.763739 2.001856 1.912149 2.249332
110 10 1 1.184648 0.823484 1.734576 1.425800 2.125902 1.819724 2.026913 1.556469 1.907262 1.775383
111 10 1 1.102847 0.878910 2.549228 1.536463 2.289884 1.780463 2.137464 1.753498 2.057046 1.745120
112 10 2 16.719886 1.018635 26.715502 1.622848 3.566754 2.762025 2.913168 2.739622 3.749486 3.666858
116 7 2 9.860566 2.125799 6.232074 9.173772 31.737819 5.839762 6.435675 2.562309 6.636389 3.791686
119 7 1 1.291663 5.633698 1.855592 18.958408 3.100573 11.007172 2.036818 1.934530 2.852131 1.979982
120 8 1 5.274383 1.910047 8.719684 1.808017 5.157456 1.973815 6.301533 1.909884 18.934614 2.785457
121 8 3 1.504772 1.192481 3.207933 1.893539 3.175081 3.057456 2.509738 2.104688 2.870879 4.085859
122 8 2 1.634689 1.254063 1.858946 1.760974 2.288585 2.029171 2.002618 2.081163 7.212361 8.989468
123 8 3 1.295948 1.024359 1.730537 2.158080 1.973057 1.917789 1.708715 1.918984 2.699783 2.978309
124 9 2 nan nan nan nan nan nan nan nan nan nan
125 9 3 nan nan nan nan nan nan nan nan nan nan
126 9 3 nan nan nan nan nan nan nan nan nan nan
127 10 2 1.385622 1.334137 2.417882 1.394736 3.633022 3.589717 2.545348 2.509364 3.494127 4.418131
128 10 2 0.873373 0.947580 1.667428 2.433961 2.245531 2.353892 1.863276 1.980378 2.292089 4.499379
129 10 3 0.991635 0.858178 1.675859 1.423088 1.875879 1.926202 1.895353 1.757499 1.683800 2.311211
130 10 3 1.355004 1.669689 2.961693 13.270218 2.095857 1.923004 3.708066 1.781237 4.487936 1.676013
135 12 2 1.033262 0.976020 2.050007 1.664289 2.107230 2.330748 1.943381 2.129313 2.374820 4.879050
136 12 2 1.171989 1.056864 1.754131 1.700956 2.073493 2.166111 3.342003 2.119239 2.539583 4.446071
138 7 1 1.114934 0.876179 1.523212 1.711586 1.750632 1.897387 2.061944 2.290910 9.956125 14.127071
140 13 2 1.108037 0.963144 1.703128 1.855656 2.181508 2.101339 1.909904 2.426318 1.723070 2.214684
141 13 2 7.146352 1.082174 23.081198 3.012075 27.086046 2.440201 13.144937 1.972704 14.096135 3.025009
142 13 2 2.467773 1.029834 5.931013 2.163461 5.864434 2.018477 2.765772 1.768511 3.413682 2.253457
143 14 2 nan nan nan nan nan nan nan nan nan nan
144 14 3 1.068314 0.966537 1.324255 1.528844 1.867034 2.356449 1.393223 1.760457 1.756794 3.320930
145 14 3 0.927589 0.843930 1.576710 1.318295 1.725131 1.803928 1.598629 1.649246 1.933421 2.103391
150 15 1 4.612230 10.445069 21.077406 51.315890 8.013431 11.780285 5.597494 20.574178 2.638592 1.993234
155 12 2 3.392630 2.718591 9.907356 19.691837 3.455976 4.899985 3.170301 2.808196 3.157643 2.370382
156 12 3 1.292644 1.315363 1.621391 1.694346 2.778154 3.351225 2.312199 2.788761 2.456862 3.694333
157 12 3 1.158644 1.097175 1.880206 1.616058 2.556954 2.333885 2.141233 1.923009 2.187230 2.303297
158 12 3 1.747105 1.038786 4.173905 1.604135 5.503909 2.246661 3.163583 2.100177 4.409438 10.339777
160 13 3 1.929230 1.583011 1.125076 2.286962 1.667963 2.199302 1.898007 2.215506 2.420582 2.117218
161 13 0 3.805739 0.979690 1.742869 1.858806 4.045083 2.294069 3.454772 1.930363 3.107382 2.939375
162 13 0 1.233033 1.029280 2.816449 1.695279 2.836131 2.558675 2.144449 2.031618 3.008418 3.030366
163 14 2 nan nan nan nan nan nan nan nan nan nan
164 14 2 nan nan nan nan nan nan nan nan nan nan
165 14 0 1.374626 1.022241 2.398688 2.060743 2.412656 2.809111 2.050974 2.679492 3.383712 3.030246
166 14 0 1.039091 2.609218 1.637105 1.600179 1.872540 3.665501 1.705188 3.401089 2.274661 3.938225
167 15 1 1.307055 2.607684 2.075094 1.257566 2.963162 3.642986 2.320496 2.985050 2.456333 2.150653
168 15 2 1.429219 1.211720 2.927704 2.022762 2.041698 2.136028 4.293429 6.532056 7.368660 11.324135
169 15 2 1.009393 13.451454 1.875305 67.197922 1.713454 9.953311 2.677883 11.930389 4.196370 14.958958
170 15 2 1.442944 15.338811 2.459171 78.826723 3.224368 18.675886 4.923689 22.511834 4.778486 25.838007
176 12 0 0.911878 0.853092 1.615231 1.393937 2.052908 1.670614 2.115139 1.627911 2.856403 2.728564
177 12 0 0.863528 1.031073 2.067995 1.743197 1.828125 2.289443 1.954800 1.868187 2.465630 2.561449
178 12 0 0.909291 0.833044 1.899713 1.282050 1.785859 1.825858 1.832889 1.842704 2.301975 2.386084
179 12 1 1.383505 0.820476 1.978093 1.620185 2.683334 1.845863 3.654050 2.294656 5.381885 2.731206
180 13 3 2.165257 4.229359 13.151267 1.487967 2.489643 12.551229 2.519411 3.691505 2.316892 9.618671
181 13 3 1.245517 1.051354 1.846312 1.250257 2.519033 2.436513 2.020981 1.654363 1.896125 2.130357
182 13 0 1.180844 1.481957 2.092929 1.919784 2.409808 3.314299 2.600293 1.782022 3.445279 3.278713
183 13 1 1.126425 0.980875 1.649728 1.513765 2.458414 1.920044 2.104157 1.828721 2.521764 2.350006
184 14 0 0.865138 0.779108 1.740943 1.671083 1.716972 2.080249 1.756040 2.031051 3.536234 6.344811
185 14 1 1.586813 1.207674 1.876329 1.947211 2.434138 2.398993 2.437664 3.488056 3.250418 2.813743
186 14 1 1.062794 0.830873 1.758631 1.522151 2.139319 1.841698 2.403737 1.924517 3.215238 3.060703
187 14 1 2.349724 0.998292 10.950099 2.207076 7.195272 2.065508 5.185136 2.783497 7.492710 13.721003
189 15 3 0.928950 1.003109 1.710570 1.698365 1.878300 1.993840 1.747819 1.910167 1.800445 2.352261
190 15 3 3.153184 2.437980 1.214539 0.850084 2.177323 3.055015 2.880143 2.212751 4.129613 3.651201
191 15 3 0.968513 1.020411 2.271043 1.698399 2.565043 2.407705 2.083149 1.947907 2.337688 2.617258
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
320 3 2 5.272575 4.999200 12.468817 26.488070 5.941774 6.604471 5.426292 3.151095 5.705425 2.127896
321 2 3 0.985907 0.859691 1.739752 1.995141 2.024156 2.145483 1.986007 1.581807 1.836179 1.688783
323 2 3 0.880966 3.380648 2.392425 3.160488 2.079736 3.440657 2.144512 1.790721 2.089099 2.419648
324 4 3 0.816204 11.353342 1.737147 54.421917 1.645503 1.832910 1.674441 1.819238 1.648519 3.060299
329 12 1 0.894192 1.017251 4.508290 16.773701 2.228362 2.075299 1.749255 1.670865 1.762428 1.754719
333 12 1 0.832289 1.334499 1.786975 3.053331 1.867416 4.514453 1.713277 1.784031 1.666785 2.159330
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 [ ]: