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 = 2459753
Date = 6-22-2022
data_path = "/mnt/sn1/2459753"
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 2459753.25316 and 2459753.33616
372 diff files found between JDs 2459753.25316 and 2459753.33616

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 252.438439 100.250915 485.182604 281.101060 6.966196 17.639347 1.651057 17.963231 1.372738 2.023768
1 0 0 96.043485 134.003370 201.054839 363.095174 1.795554 2.169973 0.885554 0.852451 0.854607 0.697757
2 0 0 92.223368 96.946546 233.210734 248.965349 3.893668 2.807895 4.004924 4.816203 4.435020 1.770096
3 1 2 nan nan nan nan nan nan nan nan nan nan
4 1 2 nan nan nan nan nan nan nan nan nan nan
5 1 2 nan nan nan nan nan nan nan nan nan nan
7 2 0 0.915785 0.829698 1.765019 1.684984 1.987490 1.822028 1.674197 1.973887 1.976170 2.052406
8 2 0 1.121472 30.660950 2.276262 112.798423 2.700983 111.655168 2.091103 136.200653 2.470671 137.801735
9 2 0 0.821259 0.796862 1.716872 1.678077 2.146659 1.846632 1.936866 1.907432 1.913577 2.121915
10 2 1 0.815991 0.933455 1.780522 1.761462 1.784647 1.949627 1.653573 2.373564 1.833329 2.637387
11 0 1 91.360891 577.245982 257.748856 3197.124486 6.876079 1778.309441 3.782884 1431.598636 1.261145 326.273656
12 0 1 214.098418 204.345674 683.568709 895.988311 117.520559 197.219383 539.132538 859.633272 14.248681 30.028586
13 0 1 101.979521 146.290761 204.802332 183.346393 29.237042 59.346186 96.400722 416.679193 5.565354 7.161753
14 0 2 96.126203 222.865351 302.622881 970.545044 39.265024 143.563678 28.863885 119.663929 3.062852 35.772356
15 1 3 1.170196 0.889223 2.016539 1.632593 2.247796 1.775132 3.171757 2.499781 2.822103 3.628491
16 1 3 1.132613 1.094131 1.765953 1.465045 2.198381 2.533439 2.179171 2.536073 5.804012 4.638082
17 1 3 1.148385 0.902124 1.817675 1.737273 2.261816 1.729144 1.768404 1.813129 3.391008 3.743010
18 1 0 29.112499 3.573532 1.257723 1.826984 115.460489 11.340402 1.502999 1.755690 1.748719 2.360038
19 2 1 0.925769 0.897874 2.006680 1.852206 1.932221 1.993633 2.548559 2.444779 10.846421 20.085595
20 2 1 0.875793 0.821280 2.061081 1.670355 1.969137 1.896324 2.119599 1.836872 2.627243 2.272992
21 2 2 0.986162 1.721225 1.821268 1.789914 1.852067 6.991132 2.520789 6.670718 2.007569 9.547513
23 0 2 100.149449 137.123667 269.994111 364.969887 10.016756 8.347637 2.408863 8.042480 2.253889 1.904051
24 0 2 83.651312 89.833116 177.422579 215.542012 1.810327 10.998592 1.051442 2.787747 1.199490 3.133859
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 40.268298 106.075135 1.260272 6.604270 172.325306 537.459053 1.915611 2.038940 1.953873 2.239229
28 1 0 0.833572 35.369538 1.456022 1.313300 1.630297 160.410469 1.631239 1.808104 1.968662 1.889299
29 1 1 1.146514 1.069037 1.993306 1.642168 1.839408 2.314681 4.464282 3.344386 2.661992 2.334433
30 1 1 1.299508 0.951999 2.310819 1.653232 2.551265 2.023150 2.253450 2.468370 3.832411 4.563996
31 2 2 0.984516 0.993893 1.653594 1.770798 1.917209 1.883024 2.222199 3.531828 2.379108 4.672436
32 2 2 1.512290 1.989747 2.018329 1.715936 3.402536 4.112567 4.907728 10.022889 5.056180 7.209563
33 2 3 28.537889 0.784193 1.659202 1.616316 138.370697 1.710217 1.746319 1.788855 1.857428 2.083990
36 3 3 1.257738 1.206650 1.619226 1.933464 1.715533 2.000565 1.742178 1.912788 1.895293 3.479073
37 3 1 1.031700 0.847953 2.218948 1.467404 1.950202 1.867423 2.111111 2.032027 7.257620 5.608126
38 3 1 0.938371 1.120512 1.698425 1.498884 1.880471 2.268143 2.649184 2.750476 2.608076 2.353984
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.839215 0.891016 1.776931 1.703765 1.972964 1.886364 2.165436 2.017853 1.940035 7.287695
41 4 3 0.877479 0.924431 1.906064 1.748950 2.120033 2.779800 2.031176 2.023575 1.987699 2.420281
42 4 0 0.954391 0.913635 1.866437 1.662974 2.073372 1.970416 1.829760 1.716448 13.764958 14.713433
45 5 0 3.413024 0.889201 20.637722 1.509507 4.865371 1.841481 3.178319 1.739332 3.522429 2.150138
46 5 0 1.180211 1.027067 2.045464 1.881683 2.501233 2.389149 2.116308 2.098596 3.252079 9.971302
50 3 3 1.218367 0.926777 1.884536 1.475967 2.614162 2.068194 2.557294 2.434941 4.657726 3.740875
51 3 2 1.178813 1.057412 2.188863 1.647974 2.634678 1.820938 3.597631 2.970920 2.876802 2.709439
52 3 3 1.237385 1.254155 1.917653 1.451770 1.972904 1.830274 2.639857 2.066792 4.330588 3.841065
53 3 2 1.030503 1.008266 2.183158 2.260326 2.023159 2.552035 2.010028 2.400729 3.827130 4.718055
54 4 0 1.031678 0.962873 1.775266 1.592463 2.133111 1.815795 1.532263 1.769481 1.856042 2.280751
55 4 2 0.871973 0.937548 1.805790 2.006905 1.775657 1.886898 1.972907 1.981590 2.191636 1.816581
56 4 1 0.908304 0.867472 1.824887 1.537681 2.237669 1.874606 2.035027 1.782455 1.725588 2.152096
57 4 3 1.036440 0.872595 2.084916 1.083732 2.260508 1.803160 1.844922 1.356982 2.266768 1.888008
65 3 0 1.425681 0.906179 2.653339 2.373376 2.771077 2.045175 2.528639 2.592349 3.113006 4.190808
66 3 0 1.132643 0.879456 2.332814 1.870411 2.355357 2.159342 2.030331 1.759604 2.587819 3.128416
67 3 0 1.102158 1.110058 1.987907 1.654706 2.202594 2.214657 1.627460 1.783504 1.594448 1.986391
68 3 1 1.006531 0.800455 1.544190 1.651368 1.880062 1.891411 1.677591 1.880079 1.642819 2.022955
69 4 1 0.863124 0.839360 1.691431 1.842750 1.732311 1.861421 1.765574 1.942182 2.146100 3.560295
70 4 2 1.211943 1.147143 1.760620 1.918098 2.307124 2.293514 2.075090 2.399476 1.708122 2.160579
71 4 2 0.889781 0.859505 1.988023 2.623082 1.744862 1.930610 2.571390 2.250409 2.511436 1.916591
72 4 0 0.957571 1.074366 3.822951 1.939263 1.989095 2.470977 2.023054 2.318182 3.084714 3.441324
73 5 0 1.004372 0.942577 1.511005 1.523958 2.001923 1.837332 1.918497 1.901161 2.146061 2.363027
81 7 0 nan nan nan nan nan nan nan nan nan nan
82 7 0 nan nan nan nan nan nan nan nan nan nan
83 7 0 nan nan nan nan nan nan nan nan nan nan
84 8 3 1.302126 1.052273 1.787439 1.806334 1.875591 1.982495 1.976635 2.105142 2.617036 5.054001
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.322932 0.837345 1.832568 4.837050 2.189080 1.836941 2.169251 2.236971 2.744124 2.347638
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 3.192015 1.865845 9.009066 9.836448 3.890162 4.302567 2.279607 1.936348 2.801609 2.035063
93 10 0 4.770224 1.680206 9.667210 1.962070 8.242390 1.671232 3.736860 1.955816 3.339160 1.978199
94 10 0 1.037525 1.027530 1.495638 1.963377 2.200234 2.001759 3.631535 3.752833 2.013907 11.286070
98 7 2 nan nan nan nan nan nan nan nan nan nan
99 7 2 nan nan nan nan nan nan nan nan nan nan
100 7 1 9.858872 5.142687 19.234172 19.379387 20.679783 22.228942 3.659703 4.521320 5.062985 2.577768
101 8 2 1.726607 1.360235 1.674910 1.684246 1.902811 2.118827 1.896206 1.819270 1.909721 8.801072
102 8 0 nan nan nan nan nan nan nan nan nan nan
103 8 1 1.190513 0.858742 1.716131 1.666539 1.986485 1.726655 1.571948 1.777531 1.881050 2.398924
104 8 1 1.113445 1.180594 1.626675 1.862259 1.759855 1.827200 1.740990 1.681365 2.659049 1.748364
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.998972 1.378831 2.198484 2.013777 4.878911 4.335478 1.822869 2.097475 2.010158 2.036626
110 10 1 2.565687 0.832502 3.154567 1.542794 4.518938 1.670630 3.559461 1.639960 2.683112 1.727112
111 10 1 0.895659 0.869072 1.963092 1.659409 2.382763 1.809671 2.027858 1.714061 1.849948 1.715852
112 10 2 2.543565 0.862429 8.657072 1.887892 3.332254 2.768751 3.166645 2.410894 3.945828 2.921000
116 7 2 nan nan nan nan nan nan nan nan nan nan
119 7 1 1.265375 4.349506 1.877970 16.692779 2.767162 5.562759 2.160912 2.282295 4.741947 1.811964
120 8 1 5.629365 1.709522 9.231702 1.601008 7.197554 2.049898 8.017646 1.799391 22.288582 2.061682
121 8 3 1.559855 1.077699 1.762598 1.633828 2.935393 2.509482 1.815450 2.061644 2.213527 4.878317
122 8 2 1.370939 1.066633 1.861343 1.762010 2.149879 1.665713 1.889243 1.949841 3.836432 3.234573
123 8 3 1.271530 0.999890 1.766602 1.731388 1.849757 1.637046 1.753862 1.620185 2.334625 2.301066
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.311149 1.750975 2.060477 1.472927 2.390818 4.045994 2.479072 3.645778 3.156527 3.959114
128 10 2 0.877882 0.990336 1.873402 2.251101 2.021387 2.304480 1.979075 2.148055 2.332802 6.934057
129 10 3 0.924059 0.827446 1.705251 1.357828 1.749356 1.743386 1.572669 1.692866 1.535466 2.070253
130 10 3 1.314891 1.498368 2.975556 15.748045 2.167623 1.795715 2.406900 1.909281 3.633587 1.798907
135 12 2 0.976920 0.933444 1.778913 1.582367 2.018939 1.990469 1.986718 3.170346 1.917567 3.750961
136 12 2 1.307440 0.983211 2.452318 1.590959 2.300164 1.662137 4.213483 2.057683 2.483562 3.352636
138 7 1 1.109605 0.924910 1.600079 1.862906 1.840384 1.983007 1.953389 2.339212 9.125457 14.782122
140 13 2 1.400623 1.126521 1.931660 1.702515 1.930185 2.037616 1.929492 2.009589 2.027011 2.084995
141 13 2 5.798654 1.125191 20.733001 1.342118 23.253900 2.310554 11.145722 2.398175 10.849816 3.145659
142 13 2 3.466743 1.027459 5.806326 2.126436 4.768609 1.986338 2.288233 1.972867 2.970166 3.316199
143 14 2 nan nan nan nan nan nan nan nan nan nan
144 14 3 1.180347 1.116652 1.897643 1.352672 2.696914 2.683559 1.896624 1.931032 4.357515 2.934697
145 14 3 0.901371 0.835450 1.826409 1.516356 2.056319 2.043486 1.967734 1.827108 2.396097 1.951868
150 15 1 3.412353 6.130750 20.426129 41.600360 9.079461 10.279310 4.102236 7.497012 3.043128 1.825070
155 12 2 3.028000 2.790830 7.051129 19.256738 3.160155 5.220329 3.400775 2.757864 3.696956 2.006824
156 12 3 1.247337 1.182938 1.477780 1.584906 2.611220 2.637458 2.745430 2.683312 2.440390 2.314916
157 12 3 1.256478 1.252112 1.795820 1.608497 2.333583 2.658087 2.191219 2.411897 2.096035 2.550916
158 12 3 1.212879 1.002316 2.369508 1.569360 3.426475 2.026317 2.333232 2.419931 4.201488 10.037026
160 13 3 1.975514 1.538652 0.897467 2.175155 1.727158 1.992509 1.794581 2.446761 1.840293 2.619754
161 13 0 3.280335 0.906713 1.766918 1.671306 3.646603 1.773183 2.913077 1.818314 2.619133 2.858709
162 13 0 1.228200 1.191945 2.970260 1.573533 2.671429 2.232039 2.234017 2.960820 3.928276 5.619816
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.593041 1.356572 2.916009 2.124381 3.191486 2.882402 2.593664 2.490599 4.832111 4.434206
166 14 0 1.046221 2.531446 1.759757 1.542161 1.851964 3.728860 1.824487 3.117895 1.859137 4.005334
167 15 1 1.404029 3.072164 1.911220 5.550183 2.331984 3.251204 3.511487 3.574481 2.638349 1.954195
168 15 2 1.407809 1.156149 2.932360 1.892325 2.973639 1.827368 5.249663 5.597648 8.287968 6.391412
169 15 2 1.085244 15.346991 1.758494 76.727237 1.810842 22.858805 4.148570 27.223182 2.756043 28.481733
170 15 2 1.370396 16.763687 2.694789 74.458929 2.526515 29.624765 2.960009 34.420515 3.242259 39.373210
176 12 0 0.959808 0.864741 1.598551 1.709375 2.255251 2.234459 2.298618 2.064634 2.217129 3.071355
177 12 0 0.918918 1.003810 2.079880 1.480490 1.711348 2.057170 2.098587 1.657329 2.510478 2.362436
178 12 0 0.960728 0.893776 1.559419 1.500858 2.005222 2.374139 1.781835 2.311396 3.525793 2.747771
179 12 1 1.343372 0.832445 1.926770 1.874817 2.503006 1.854190 3.443383 2.493056 5.417757 3.415446
180 13 3 2.065629 3.836032 13.843983 1.347525 3.166704 11.276809 2.932115 3.677566 2.681783 9.034726
181 13 3 1.268049 1.072931 1.616069 1.275998 3.108096 2.289749 1.858518 1.860203 1.881423 1.806209
182 13 0 1.110720 1.328463 2.057895 1.935729 2.508360 2.628093 2.707457 1.916330 3.653114 3.413114
183 13 1 1.155447 1.006733 1.643807 1.764351 2.314648 2.109932 1.736573 2.424310 2.232569 2.808390
184 14 0 0.843692 0.791921 1.729333 1.726578 1.878775 1.769459 1.860000 1.891174 1.951619 2.411236
185 14 1 1.722814 1.415766 2.180892 1.937764 3.975613 3.662814 3.366844 4.276160 4.051222 3.534642
186 14 1 1.124508 0.920917 1.863371 1.585492 1.984463 1.687206 2.255378 2.389130 2.635322 5.358193
187 14 1 1.384308 0.989206 4.378633 2.026427 3.538214 1.798655 3.073140 2.401119 17.628794 18.129642
189 15 3 0.972695 0.969703 1.805511 1.532407 1.956208 2.077078 1.722212 1.659485 1.794988 2.352041
190 15 3 2.816354 2.703571 1.692125 1.638585 3.079866 3.924983 2.535274 2.487831 5.276328 3.154807
191 15 3 0.988542 1.038917 1.833386 1.636532 2.900420 2.890777 1.824504 1.920042 2.023321 2.298235
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.256888 4.125223 11.839921 21.480502 5.880730 4.627761 4.218148 6.174904 6.586176 2.302297
321 2 3 1.042944 0.774761 1.861950 1.870331 1.979348 1.558159 1.646743 1.715717 1.759069 2.130270
323 2 3 0.902723 3.235808 2.940374 4.382700 1.979387 3.807121 2.024054 1.999524 1.957016 2.237417
324 4 3 0.814508 13.424961 1.737786 67.425455 1.838610 2.048706 1.932953 2.000773 1.858051 4.029390
329 12 1 0.875787 0.947451 1.821543 1.725191 2.130797 2.396626 1.690339 1.719356 1.853041 2.283075
333 12 1 0.770712 1.966152 1.814498 3.184741 1.866064 8.075502 1.767097 1.853186 1.764727 2.129682
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 [ ]: