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 = 2459784
Date = 7-23-2022
data_path = "/mnt/sn1/2459784"
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 2459784.25306 and 2459784.33605
372 diff files found between JDs 2459784.25306 and 2459784.33605

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.393967 0.938938 1.488649 1.700344 2.273585 2.135386 1.810763 1.780947 1.432991 2.249936
4 1 2 0.930268 2.143055 1.874851 1.463202 1.760845 1.647191 1.657257 1.854275 1.695318 1.663560
5 1 2 1.000876 1.024383 1.635724 1.280768 1.761576 1.625549 2.310509 1.642632 5.257354 4.972744
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.899944 1.267416 1.428003 1.452432 1.791458 1.993013 1.721961 2.662922 1.674240 5.106470
15 1 3 1.237866 1.046208 1.893424 1.247597 2.020886 1.870736 1.714298 1.676802 4.243477 4.581923
16 1 3 0.881831 1.028342 1.769653 2.032644 1.772510 1.990647 1.533788 1.757831 4.191423 3.429155
17 1 3 1.015869 0.965883 1.311885 1.243071 2.096760 1.594471 1.880182 1.424346 1.687629 1.971454
18 1 0 49.959217 18.774260 1.204384 1.322262 254.181392 88.285161 1.762721 1.810028 1.711033 1.508445
19 2 1 0.826239 0.984336 1.532762 1.647707 1.698926 1.968146 1.692986 1.910993 2.372032 4.016816
20 2 1 0.857271 0.924855 1.187491 1.255564 1.611811 1.737222 1.580703 1.600907 1.388374 1.683985
21 2 2 0.919959 0.810708 1.497534 1.511955 1.781606 1.824465 1.690771 1.751928 1.727093 1.966362
27 1 0 2.344297 3.267786 5.254314 11.587259 8.362406 4.672020 3.300455 1.912538 3.165296 1.780854
28 1 0 47.951982 0.870117 0.952084 1.761678 245.587846 2.111049 1.849283 1.981650 2.694345 2.760720
29 1 1 1.106034 1.030279 1.307622 1.324101 1.836541 1.801970 2.716799 2.437840 3.491677 3.224332
30 1 1 1.070181 1.016707 1.703644 1.592463 1.837531 1.792156 2.439228 3.367003 2.166750 4.392540
31 2 2 1.002941 1.094484 1.286373 1.458208 1.704829 2.124831 2.371438 4.908148 2.975448 8.208028
32 2 2 1.057994 1.729083 1.265356 2.266676 2.105987 2.666229 3.929857 5.692343 3.359372 5.570361
33 2 3 69.568251 0.911231 1.262605 1.468064 310.153154 1.803601 1.439858 1.760039 1.615582 1.935402
36 3 3 1.274252 1.437824 1.580511 1.537192 1.760264 1.729041 1.586126 1.517117 1.597008 1.867159
37 3 1 1.093539 0.988237 2.677941 1.901986 2.761584 1.898303 2.255937 1.838022 2.932371 3.299289
38 3 1 0.948287 0.964362 1.666192 1.315073 1.761970 2.070360 1.618007 2.169463 1.685235 1.938500
40 4 1 nan nan nan nan nan nan nan nan nan nan
41 4 3 0.961476 1.091719 1.331041 3.432411 1.828831 1.816569 1.564439 1.755676 1.721348 2.864369
42 4 0 0.861601 0.907647 1.235059 1.396330 1.978142 1.947992 1.597037 1.766413 2.313445 4.855983
45 5 0 1.506121 1.006220 3.226672 1.328362 3.735667 1.710508 3.189889 2.050487 3.008449 2.200425
46 5 0 1.369315 1.031290 1.529174 1.261173 2.618090 1.786677 1.816920 1.683627 1.985731 1.962244
50 3 3 2.738282 0.947689 1.340775 1.362666 3.534273 1.742143 2.458675 1.699441 2.979491 1.580394
51 3 2 3.871342 0.899788 10.775254 2.082414 5.118270 1.678854 4.528560 1.969111 6.790358 3.252093
52 3 3 5.150854 1.002859 15.732492 1.739253 3.183645 1.797903 4.154404 1.671739 4.335053 2.395388
53 3 2 0.912653 1.149614 1.673924 2.613508 1.880714 3.167280 1.745483 2.731972 2.598365 4.118223
54 4 0 0.964139 0.861527 1.281375 1.472841 2.283721 1.974065 1.741727 1.813740 2.119930 2.463872
55 4 2 0.952806 0.886430 1.352101 1.325115 1.741292 1.849076 1.825784 1.684546 1.894492 1.841410
56 4 1 nan nan nan nan nan nan nan nan nan nan
57 4 3 0.977650 1.884156 1.591526 6.905503 2.117863 1.845089 1.768572 2.027172 1.654548 3.056280
65 3 0 1.103934 0.841319 2.167233 1.541410 2.122141 1.981931 1.922503 1.756315 1.897951 1.959951
66 3 0 1.254616 1.093149 3.398346 1.561845 2.972271 2.004457 2.311102 1.693206 1.982331 1.964530
67 3 0 0.941152 0.932173 1.378973 1.389550 1.821489 1.752079 1.618985 1.652822 1.501625 1.674895
68 3 1 0.908386 0.953914 1.550391 1.407705 1.938166 1.752267 1.961061 1.776565 2.057802 2.420766
69 4 1 nan nan nan nan nan nan nan nan nan nan
70 4 2 1.515142 1.341469 1.763260 1.636354 3.215880 2.472761 2.615820 1.861586 1.700086 2.342653
71 4 2 0.994321 1.032511 1.388361 1.298174 1.833941 1.781250 1.686238 1.799032 1.714845 1.668257
72 4 0 1.127685 0.860245 1.847180 1.537159 2.381320 1.992202 1.890839 1.833059 3.855008 3.797822
73 5 0 0.916214 1.092978 1.499575 1.412142 2.014825 1.943055 1.722304 1.820308 2.372267 2.906751
81 7 0 1.439380 1.281039 1.875944 2.053617 2.254555 2.266335 2.378406 2.167697 10.456692 5.167149
82 7 0 1.026102 0.875783 1.374079 1.046143 1.666615 2.228258 1.552986 1.741282 2.198170 2.360610
83 7 0 0.981756 1.199011 1.663909 6.844073 1.877671 2.585532 2.049388 2.284384 1.992997 4.508278
84 8 3 1.647281 2.170744 1.859831 3.811365 2.296857 2.580766 2.151607 2.411359 4.516777 4.889160
85 8 0 2.104403 0.908871 2.993590 1.503385 3.361192 1.714166 2.096383 1.546971 3.208697 1.632720
86 8 0 1.366453 1.027173 2.759214 1.302165 2.486648 1.691668 2.580424 2.667054 4.104859 4.438489
87 8 2 1.319102 1.772187 1.891988 1.588804 1.827963 4.129330 1.869504 4.409170 3.480791 4.064374
88 9 0 1.905888 5.170265 7.821845 17.778917 3.103343 16.973501 3.654203 2.358841 4.717420 1.905823
90 9 0 3.279809 1.803188 2.130584 1.795531 7.559817 4.345884 15.335834 4.451359 21.438503 11.382005
91 9 1 2.447991 1.693565 8.614443 3.402426 3.026051 4.666004 4.544968 2.281973 5.869587 2.054065
92 10 0 2.466984 3.131684 0.465719 1.215772 4.870120 3.062114 2.120106 1.930021 2.339551 2.126177
93 10 0 1.008152 0.956674 1.604054 1.301333 1.858797 2.012899 1.616569 1.859640 1.918642 2.649830
94 10 0 0.923368 1.157335 1.456099 2.506300 1.808002 2.747701 1.868471 2.912749 2.252642 12.601041
98 7 2 1.995966 0.944475 1.647524 1.574798 4.385510 1.920080 7.184549 1.805718 34.991556 2.002757
99 7 2 0.959524 0.917769 1.358185 1.369791 1.651830 1.602868 1.561805 1.679636 2.702366 2.165470
100 7 1 1.206620 0.917808 1.743441 1.406422 2.250497 1.791595 1.978813 1.757980 2.170983 1.901703
101 8 2 1.485337 1.324158 1.689270 1.581296 2.151281 1.899512 1.809281 1.791247 2.076442 3.133264
102 8 0 0.930788 0.778377 1.477609 1.783411 1.645565 1.725829 1.997266 1.702623 2.222457 2.058899
103 8 1 1.384398 0.874705 1.650876 1.505951 1.793044 1.893957 1.780835 1.727013 2.266850 1.846787
104 8 1 1.723610 1.265649 1.903312 1.674473 2.099542 1.746172 2.533366 1.836038 6.288776 1.798650
105 9 1 1.829273 1.684319 10.129911 4.448171 2.737198 3.699602 4.522895 2.111204 8.500211 2.340342
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 6.757356 29.826041 29.708246 186.760511 6.197687 19.476537 11.165802 69.997755 20.593828 133.881145
108 9 1 1.217075 0.865087 1.931149 1.407858 2.028549 1.764139 1.649467 1.695174 2.064491 1.636814
109 10 1 1.577833 1.185335 1.327955 1.490824 2.634951 2.301952 1.579811 1.670071 1.540436 1.756925
110 10 1 0.949119 1.081411 1.691281 2.637570 2.046128 1.961539 1.846528 2.099588 1.779305 1.537583
111 10 1 1.060928 1.162664 1.946136 1.321449 2.331114 1.747202 2.147022 1.488926 1.734894 1.547456
112 10 2 0.938482 1.031395 1.394622 1.514154 1.528311 1.597847 1.510122 1.434489 1.371048 1.483599
116 7 2 0.781197 0.762156 1.421231 1.340702 1.836565 1.776045 1.633033 1.661353 2.212723 1.760918
117 7 3 1.057765 1.120188 1.547433 1.845647 1.630341 2.024620 1.660580 2.901600 2.266660 5.082412
118 7 3 0.999370 0.989096 1.423936 2.012936 1.765544 1.930445 1.747045 1.963842 1.738282 2.990217
119 7 1 0.939338 0.795363 1.318787 1.604886 1.844690 1.662099 1.891164 1.754665 5.694418 2.635206
120 8 1 4.161559 1.667038 8.225796 2.204659 5.753783 2.347192 8.228082 1.587367 21.508869 2.619227
121 8 3 1.792418 1.382951 1.743684 1.355410 4.501999 3.233305 2.992457 2.032437 5.549513 16.933880
122 8 2 1.479336 1.271370 1.871849 1.660392 2.400538 1.796882 2.222859 1.622879 2.865132 2.863404
123 8 3 1.312571 1.264233 1.908609 1.587209 1.760399 1.841969 1.856776 1.630654 2.544817 1.928385
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.151904 0.903676 2.346877 1.208693 2.417423 1.954474 2.073835 1.813312 1.969779 2.575481
128 10 2 0.907468 1.045755 1.472346 2.309521 1.930276 2.438747 2.034028 2.139291 2.373759 6.036161
129 10 3 0.921737 0.871667 1.469029 1.203164 1.637775 1.670254 1.563935 1.545597 1.402077 1.966651
130 10 3 1.237782 0.913291 2.421468 2.412299 2.179372 1.823129 1.999637 1.866742 2.421063 2.018327
135 12 2 0.825994 0.891568 1.662925 1.472444 1.857579 1.799601 1.894214 1.742833 1.653817 1.414711
136 12 2 1.187993 1.006875 2.994304 1.462737 1.925348 1.900162 3.097367 2.224152 1.505402 2.052813
137 7 3 2.083543 3.050672 2.240253 13.197854 5.348645 4.477764 3.647945 2.273004 4.949420 2.310727
138 7 1 0.968578 3.504414 1.525142 3.279644 2.029569 2.810344 2.037859 2.267661 7.021842 3.128493
140 13 2 1.077157 0.820046 1.537571 1.943751 1.952729 1.570746 1.642537 1.395624 1.680878 1.497588
141 13 2 7.009342 1.045383 16.633762 1.456621 24.430780 2.049503 14.280879 1.745015 12.056477 1.854752
142 13 2 4.080716 1.553026 6.124881 1.563886 4.051641 1.866407 2.556163 1.663108 4.308255 3.238778
143 14 2 0.971980 0.849630 2.026078 1.236681 1.976117 1.650230 2.065143 1.815487 2.017591 2.346039
144 14 3 1.277217 1.084346 1.610625 1.353465 2.305472 1.973897 1.606106 1.687084 1.861668 1.784687
145 14 3 3.942421 4.276798 18.050012 15.289743 14.801387 11.903343 2.932065 1.942353 3.349316 1.951908
150 15 1 3.442210 11.241752 21.426558 49.712652 4.870380 10.531823 5.176423 19.362113 5.759791 34.806030
155 12 2 2.471792 1.782445 6.631211 13.306181 3.578673 2.607161 2.717023 2.035531 3.288054 2.049786
156 12 3 1.114054 0.985779 1.867605 1.443198 2.092740 1.734683 1.845847 1.680196 1.699936 1.355511
157 12 3 1.091221 1.003271 1.745217 1.260677 2.062985 1.723568 1.817584 1.718866 2.044390 1.737580
158 12 3 1.385997 1.036599 3.968702 2.142574 3.739239 1.882395 2.773681 2.165808 3.064144 3.603442
160 13 3 2.649381 3.055964 8.555858 24.911102 4.282610 4.515180 3.453900 3.917096 3.140507 3.345604
161 13 0 1.684889 1.046631 2.072065 1.310830 3.841138 2.045678 2.691331 1.632550 3.510174 2.624474
162 13 0 0.969876 0.880066 1.420926 1.534864 1.829848 1.728083 1.750039 1.644725 1.579002 1.458030
163 14 2 0.997655 1.038859 1.602245 1.738974 1.961381 1.738207 1.762589 1.595859 1.532908 2.481304
164 14 2 0.901455 0.966114 1.471972 1.302741 1.802786 1.945246 1.784065 2.301612 1.703582 1.889106
165 14 0 3.237275 2.241363 3.543746 3.139066 10.594800 7.709280 2.363587 5.066564 5.114456 11.043171
166 14 0 2.080046 1.862690 1.518501 1.304910 3.167562 3.091177 3.718309 3.117891 2.963724 2.488977
167 15 1 1.198643 1.490549 1.548552 1.480414 1.889670 2.240031 2.546871 1.862638 2.064424 1.523062
168 15 2 1.284965 0.980026 2.931905 2.019775 2.091835 1.614089 3.215909 3.491581 4.719377 3.351763
169 15 2 1.100311 8.415818 2.368585 39.851304 2.469478 3.308637 3.034712 4.293717 4.356304 6.023357
170 15 2 1.165116 9.804712 2.651768 49.194898 2.596165 12.551817 3.340981 7.672522 4.203716 18.992807
176 12 0 0.937613 0.882775 1.560001 1.383221 1.807730 1.942995 2.035626 1.700380 2.030635 1.723810
177 12 0 0.870757 0.957197 1.980911 1.325952 2.027959 1.771100 1.728088 1.617570 1.776372 1.859025
178 12 0 0.948311 0.951448 1.511113 2.028998 1.617162 2.023499 1.715456 1.949964 1.500967 1.791488
179 12 1 1.503055 0.859310 1.371091 1.682454 2.112351 1.694616 4.419592 2.036657 2.231167 2.126952
180 13 3 1.816080 1.127273 9.810479 1.531843 3.696194 2.360970 2.886660 1.935482 2.736340 1.950465
181 13 3 1.614042 3.663269 1.752740 6.984173 4.684059 5.219151 2.188279 1.820678 2.685993 1.857105
182 13 0 1.281938 1.334862 2.148616 2.170151 3.495309 3.456081 2.225397 2.309479 3.172667 3.977429
183 13 1 0.978524 0.968549 1.742358 1.457751 2.135472 1.784035 1.637557 1.697362 1.864024 2.261042
184 14 0 0.836497 0.852382 1.334444 1.261501 1.600275 1.504793 1.761196 1.551387 1.899038 2.870667
185 14 1 0.958936 1.017391 1.303130 2.118703 1.700859 1.908528 1.858541 2.276581 1.741424 4.986738
186 14 1 0.947627 0.879821 1.399533 2.063098 1.929511 1.746432 1.792909 1.850391 2.058559 2.284739
187 14 1 1.074134 1.124949 1.853575 2.169794 1.797233 2.622911 1.979102 3.276000 5.284823 7.492881
189 15 3 0.985268 1.091714 1.565796 1.528936 1.899928 1.975846 1.561612 1.810456 1.837077 3.381122
190 15 3 2.807155 2.318777 9.240371 1.036404 3.845872 2.357533 2.889867 2.366813 2.612959 3.329246
191 15 3 0.911987 0.990946 1.228781 1.559218 1.732838 2.025707 1.703083 1.805010 1.622415 1.535032
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.213081 0.812121 4.062237 1.881380 3.482570 1.669195 2.424698 1.873584 2.377824 2.287606
206 19 0 1.148516 0.936517 1.823389 2.567585 1.917640 1.839529 1.969334 1.856590 2.192484 1.634402
207 19 1 0.830640 0.791099 1.901161 1.722485 1.716808 1.573222 1.886369 1.761761 1.962749 1.760666
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.842190 0.868756 1.684658 1.537716 1.585758 1.729829 1.776702 1.669723 1.902659 1.764606
224 19 1 0.950850 0.812035 1.969561 1.786590 1.830825 1.781259 4.459166 2.290151 5.990650 3.377998
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.569688 5.561813 10.004391 34.290427 4.928728 9.756680 5.110666 5.406822 11.470286 16.998594
321 2 3 1.239348 0.873684 1.852429 2.241890 1.721646 1.837093 1.832490 1.807941 1.926632 2.084104
323 2 3 1.019414 1.349531 2.493357 4.344258 1.744680 2.514740 1.845180 2.034353 1.889519 2.392116
324 4 3 0.800441 1.079730 2.161660 2.043565 1.638259 1.593846 1.737941 1.648758 1.682159 1.789448
329 12 1 0.932159 0.881734 2.207259 3.865224 1.594934 1.898501 1.800763 1.799483 1.965695 3.012712
333 12 1 1.104438 1.176489 2.446466 2.823709 1.920229 3.433578 1.665571 1.667498 1.699473 1.676245
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 [ ]: