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 = 2459801
Date = 8-9-2022
data_path = "/mnt/sn1/2459801"
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 2459801.27110 and 2459801.35409
372 diff files found between JDs 2459801.27110 and 2459801.35409

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 0.932617 1.074045 1.130668 1.032600 1.762704 1.914490 1.840546 1.669161 1.479501 1.904654
4 1 2 1.101508 1.509429 1.489121 2.375367 1.844578 1.920983 1.712613 1.990124 1.722624 1.788623
5 1 2 0.910612 0.919036 1.708421 1.135704 1.732151 1.666591 2.095849 1.754465 4.243824 4.779142
7 2 0 0.900340 0.915025 1.169472 1.122156 1.875537 1.730675 1.847011 1.739215 1.704431 1.587011
8 2 0 1.151424 6.251058 2.941231 40.602989 2.112639 20.943015 2.280117 9.050954 2.912357 37.262918
9 2 0 0.850655 0.959948 1.210339 0.990687 1.693719 1.875644 1.890277 1.994205 1.799727 1.962461
10 2 1 0.868957 1.006798 1.381478 1.629822 1.915911 1.842948 1.908831 2.095978 2.112198 2.381737
15 1 3 0.936468 1.105811 1.131427 1.161139 1.775486 2.019960 2.097341 2.005251 5.599723 5.163648
16 1 3 0.862075 0.954525 1.232407 1.009365 1.673705 1.970353 1.760383 1.859550 5.274216 3.105541
17 1 3 1.008844 0.881803 1.380231 1.032108 2.326317 1.853563 2.163942 1.773036 2.228962 2.442315
18 1 0 27.111031 13.534877 0.909352 1.242260 104.094781 50.014964 1.364638 1.613866 1.109278 1.661863
19 2 1 0.986819 0.951832 0.942779 1.572660 1.785598 2.013562 1.797584 1.857091 1.908339 3.032295
20 2 1 0.908515 0.954649 1.225916 0.920164 1.583089 1.789862 1.538295 1.740743 1.629128 1.550398
21 2 2 0.916512 0.930837 1.427475 0.955607 1.889910 1.860122 2.215230 1.737662 2.078018 1.747627
27 1 0 5.526337 4.263848 7.190331 18.058698 13.048671 6.811437 3.288462 1.953298 3.516021 1.802500
28 1 0 60.156355 2.363591 0.916541 1.391278 267.136775 11.683208 1.744754 1.935352 1.407322 2.143188
29 1 1 1.059746 0.924066 1.477134 1.021874 1.954837 1.737071 2.201293 2.541117 4.468905 2.794223
30 1 1 0.959963 0.949280 1.161524 1.235971 1.635215 1.749434 2.061375 2.170132 1.997187 3.709898
31 2 2 1.090739 1.273515 1.228097 1.091470 1.656648 1.959979 2.218686 5.012097 2.940534 9.330835
32 2 2 1.642680 1.718014 1.249786 1.107106 3.373481 2.488495 5.722459 6.113999 5.752527 7.796149
33 2 3 32.392787 1.005638 1.166047 1.098775 155.592025 1.933605 1.741885 1.946389 1.543396 1.950803
36 3 3 0.868913 0.819511 1.285289 1.155889 1.831898 1.831947 1.757018 1.775457 1.551515 1.561999
37 3 1 0.946367 1.001070 4.907371 1.482179 2.330649 1.705979 2.103359 1.767803 2.905833 2.873855
38 3 1 0.897427 1.421400 1.336350 1.209519 1.608212 1.840888 1.527903 1.866728 1.444061 1.719125
40 4 1 0.937690 1.286085 1.442706 1.276443 1.787192 2.209211 1.790510 1.988533 1.622881 2.017238
41 4 3 0.863507 0.829503 1.168492 1.349316 2.001950 1.616604 1.670973 1.464688 1.585513 1.661928
42 4 0 1.234691 1.048075 1.149159 1.288885 2.542868 2.127963 1.815827 2.113864 2.052365 4.299373
45 5 0 1.131558 1.031905 1.734646 1.127329 3.217212 1.849519 2.852501 2.133838 2.433259 2.019327
46 5 0 1.088529 0.960150 1.069790 1.369067 1.840536 1.944483 1.717508 1.825908 1.797367 1.839733
50 3 3 0.925505 1.524490 1.318400 0.990432 1.901958 2.705404 1.705651 1.988326 1.755736 2.053075
51 3 2 1.834979 1.185946 7.075764 1.377215 1.957457 1.826707 1.584257 1.668610 1.715460 1.688624
52 3 3 0.942007 1.051939 1.389139 1.710267 2.132290 2.654507 1.954903 2.340979 1.819673 2.241072
53 3 2 0.877732 1.188025 1.439435 1.777717 2.060708 2.794035 1.937702 2.492120 3.391091 3.123597
54 4 0 0.951355 1.029480 1.251880 0.973456 2.244647 1.976857 1.928669 1.800318 2.189144 2.017246
55 4 2 0.928366 1.059956 1.425621 1.092295 1.848463 1.831698 2.045452 1.878307 2.215362 1.797646
56 4 1 1.095821 1.110844 1.128856 1.313261 2.382892 1.912205 1.959852 1.974184 2.444986 2.185815
57 4 3 2.516862 1.715837 1.909082 8.706564 12.221330 2.094099 2.297087 2.172383 2.283453 2.156655
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 0.978297 1.090781 1.356518 1.379984 1.669223 1.781389 1.467711 1.874140 1.586912 1.917215
69 4 1 0.950577 1.002590 1.595512 1.673942 1.866492 1.964664 2.022728 2.015904 2.029791 1.783505
70 4 2 1.144805 0.996571 1.226890 1.422776 3.354071 2.549366 2.421471 2.177730 1.858108 1.992751
71 4 2 1.164730 1.009076 1.484394 1.102462 1.944196 1.791335 1.770738 1.794397 1.540486 1.677762
72 4 0 1.146598 1.450352 1.579560 1.181053 2.643900 3.302067 1.951063 1.986310 2.999126 4.139013
73 5 0 1.091231 1.723230 1.461015 5.006880 2.116913 3.346327 1.934309 1.900125 2.301000 1.984925
81 7 0 1.199337 1.028534 1.444503 1.175244 1.856905 2.015115 2.209991 1.891846 7.959705 3.555147
82 7 0 0.837825 1.130976 1.097914 0.980575 1.680303 1.793469 1.794840 1.635575 1.795962 2.114921
83 7 0 0.923572 1.003983 1.769015 5.304331 1.769646 1.834039 1.738531 1.919242 1.703597 1.768196
84 8 3 0.900611 1.076330 1.192351 2.613836 1.838227 2.029609 1.749899 1.963735 2.893479 4.415814
85 8 0 0.849802 1.100180 1.319937 1.255369 1.768567 1.843107 1.984615 2.411534 2.307349 3.411309
86 8 0 1.554491 1.145662 2.095727 1.190071 2.438996 2.044140 3.176840 4.321049 2.707031 4.026350
87 8 2 0.822410 0.856733 1.372118 1.365144 1.833183 1.656637 1.741994 2.626456 1.730552 2.114272
88 9 0 2.296302 5.507169 14.734251 36.819962 5.286616 35.351964 4.208298 3.908982 6.980116 2.853187
90 9 0 1.940443 1.382286 6.554328 14.166949 2.621201 2.075298 2.566912 2.211655 3.219790 3.070185
91 9 1 3.269236 3.721112 11.956374 5.535757 4.574478 9.244602 5.356252 4.091438 6.962016 2.831510
92 10 0 2.623693 2.327741 0.572061 1.040121 5.012197 9.915860 2.881668 2.375980 2.770879 2.870871
93 10 0 1.076522 0.979958 1.153492 1.206899 1.825966 1.932823 1.817508 1.844880 1.662674 2.172888
94 10 0 0.885065 1.055977 1.132222 1.916491 1.801088 2.353420 1.951612 2.733860 1.966814 3.398880
98 7 2 0.890650 0.958098 1.197702 1.183494 2.044327 1.730839 2.220876 1.720741 4.546341 1.566973
99 7 2 0.950779 1.079301 1.505735 1.492152 2.331685 2.380392 2.019148 2.070810 3.119733 13.893922
100 7 1 1.354679 1.097356 1.838600 1.482606 2.256511 2.093731 1.754223 1.780994 1.662477 1.823708
101 8 2 0.944723 0.858611 1.456250 1.596359 1.980372 1.780019 1.936511 2.002832 1.771955 2.152424
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 nan nan nan nan nan nan nan nan nan nan
104 8 1 nan nan nan nan nan nan nan nan nan nan
105 9 1 2.180351 2.469226 15.040970 6.388635 3.318685 7.961933 4.731830 2.098476 9.527379 2.530936
106 9 3 2.963701 2.860040 10.394181 15.584208 4.187780 10.669390 3.272290 2.780277 5.507419 2.380528
107 9 0 7.671274 31.516008 30.242888 191.557534 9.592736 18.667615 11.778531 69.135288 20.815315 131.837808
108 9 1 1.693718 1.228531 8.512002 5.011701 2.386167 1.862972 3.054398 1.831472 3.475954 2.054601
109 10 1 1.527791 1.227161 1.385367 1.268574 3.045260 3.087962 1.976966 1.814056 1.905111 1.850312
110 10 1 1.157377 1.886627 1.469877 2.075806 2.081094 2.606904 1.854988 2.440798 1.917223 2.224547
111 10 1 1.074353 1.108109 1.551346 1.217625 1.988346 2.009122 2.015601 1.923267 1.811975 1.558133
112 10 2 1.003699 3.411016 1.507178 3.237742 1.886806 2.409479 1.826690 1.689202 1.827152 1.598734
116 7 2 1.076936 0.953799 1.086623 1.034170 2.099561 1.667649 1.818411 1.800663 1.850744 1.801290
117 7 3 0.985890 1.167598 1.414657 1.408237 1.975752 1.573386 1.776337 2.154047 2.123054 3.423422
118 7 3 0.999114 0.972130 1.221533 1.246609 1.810349 1.704691 1.711947 1.693433 1.568845 2.613450
119 7 1 0.943106 0.802252 1.190918 1.457797 2.382276 1.850078 2.022337 1.802790 5.403004 2.030629
120 8 1 nan nan nan nan nan nan nan nan nan nan
121 8 3 1.625274 1.785732 1.260178 1.230232 4.419352 4.395493 3.019543 2.283467 3.427820 5.525137
122 8 2 1.053530 0.992513 1.369161 1.359305 2.504134 2.036952 1.803385 2.027587 2.011006 3.387804
123 8 3 0.897292 0.815769 1.257261 1.223968 1.788933 1.710004 1.628488 1.863802 1.759743 1.799208
125 9 3 4.043550 2.115798 37.913422 13.015718 13.840653 5.875827 3.099400 2.363960 5.203131 2.523877
126 9 3 3.072222 2.412660 33.089901 10.634086 5.743106 8.482800 4.296502 4.775941 5.086927 3.820346
127 10 2 1.487412 1.548067 1.914903 1.244826 3.644566 4.627203 4.533664 4.281614 4.626312 5.953705
128 10 2 1.106497 1.116398 1.365722 1.307820 1.946264 2.047306 1.741442 2.165169 1.813357 2.112245
129 10 3 1.060799 1.011799 1.205390 0.925244 1.791308 1.567577 1.818968 1.580003 1.601098 1.526199
130 10 3 1.182947 1.149410 1.480238 1.198589 2.204719 1.992279 1.727664 1.842514 2.038792 2.102686
135 12 2 1.375826 1.268189 1.120481 1.021361 2.317140 2.262191 1.882755 2.207950 1.930577 1.781045
136 12 2 1.058086 0.972103 1.807583 1.000019 1.770089 1.798786 3.319051 2.325460 2.087269 2.923444
137 7 3 3.578775 3.528722 5.679991 18.986726 9.689120 4.593376 4.013333 2.684250 5.886569 2.370360
138 7 1 0.948055 4.500309 0.914218 5.822495 2.003271 6.110983 1.695770 3.437642 6.725483 6.125104
140 13 2 2.296342 5.459671 8.989708 37.186246 2.802465 2.783087 3.306813 12.032555 3.707601 24.780977
141 13 2 6.566818 1.012956 10.197917 1.152273 25.001514 2.069586 14.781018 1.879994 11.268716 2.385219
142 13 2 5.848635 2.373658 7.442295 1.796500 6.032053 11.042883 2.671824 1.963460 4.378158 4.053920
143 14 2 1.010119 0.989970 1.620651 1.132120 1.882557 1.878023 2.058324 1.868339 1.977985 2.580484
144 14 3 0.992432 1.149495 1.083024 1.197428 2.309319 1.908274 1.783893 1.809356 1.820203 2.128666
145 14 3 5.306058 6.907635 19.259395 19.915727 15.707420 15.546199 3.226938 1.773830 2.555803 1.910809
150 15 1 2.989854 6.298232 23.199125 41.741861 4.623563 7.200835 4.041128 12.843657 6.660564 27.078287
155 12 2 2.462330 3.960512 7.471160 21.675549 3.232307 4.072531 2.817794 5.710885 3.355708 1.940815
156 12 3 1.160279 1.141723 0.977399 1.122782 2.487693 1.919264 1.733839 1.802779 1.646500 1.711458
157 12 3 0.898767 0.917028 1.526358 1.163902 1.944240 1.879442 2.046377 1.781347 1.864854 1.586474
158 12 3 1.030804 1.145080 2.004083 1.204291 2.364126 2.091065 2.322831 2.016286 3.390781 2.170585
160 13 3 4.620113 5.177783 12.045434 22.519129 6.830485 9.352815 4.286808 4.957945 3.192828 7.340669
161 13 0 3.333138 1.217065 1.475112 1.162171 4.079592 2.115870 2.597320 1.891469 4.596342 3.477142
162 13 0 0.993345 0.924542 1.256706 1.196582 1.598884 1.980600 1.874031 1.915502 1.601304 2.139949
163 14 2 0.889987 0.969881 1.204903 1.106965 1.804828 1.969740 1.787954 1.730018 1.495385 2.119197
164 14 2 1.042184 0.892025 1.212716 1.072486 1.931349 1.894287 1.939960 2.698512 1.852690 2.002524
165 14 0 4.067958 4.622198 2.645645 4.623806 13.507606 10.252312 3.436270 4.022007 10.203686 7.981385
166 14 0 0.984713 1.206230 1.240875 1.326300 1.887962 2.435033 1.883786 3.050148 1.929722 3.238645
167 15 1 1.570351 3.084174 2.630288 2.056827 2.595499 1.986687 2.553957 1.816652 2.925696 1.942479
168 15 2 1.134609 1.041550 3.791622 3.173903 2.324963 2.073161 3.780031 4.024018 4.404446 3.694079
169 15 2 1.056777 4.959499 2.895628 36.843663 2.210194 2.154549 2.536928 4.585725 4.399785 7.363371
170 15 2 1.322825 6.483806 3.475856 53.534593 3.088073 8.219596 3.476087 5.973697 6.676106 15.672844
176 12 0 0.809971 0.919736 1.278612 1.083506 1.752641 1.784935 2.049431 1.832320 1.806270 1.760606
177 12 0 0.971034 0.910841 1.271743 1.104901 1.748423 1.796131 1.839244 1.709040 1.870854 1.924299
178 12 0 0.948068 1.079113 1.310353 1.444455 1.905455 2.014497 1.880071 1.983283 1.826073 1.694839
179 12 1 1.164056 0.880778 1.109928 2.577592 2.214085 1.801793 4.556147 2.147122 2.774920 2.385335
180 13 3 2.051068 1.073724 9.720457 1.101802 5.906259 2.224586 4.358169 1.657605 3.599192 1.854827
181 13 3 2.751603 5.293645 0.962975 11.439080 11.089848 7.436244 1.908842 1.949087 2.254651 2.969858
182 13 0 2.965940 1.337024 5.032288 2.699077 7.933635 3.566165 2.007666 2.106355 2.133262 2.919701
183 13 1 1.073314 0.986753 1.260560 1.131365 2.183650 1.530361 1.834369 1.719074 2.062494 2.149660
184 14 0 1.077041 0.920203 1.120778 1.228769 2.024226 1.867593 1.884533 1.875429 1.750282 2.336876
185 14 1 0.867007 1.689999 1.037997 1.355305 1.522547 1.889548 1.785570 2.122477 1.669711 1.499435
186 14 1 0.996071 0.991019 1.048113 0.972696 1.959997 1.709565 1.850702 1.661997 1.763030 2.133255
187 14 1 0.865205 1.052437 1.316623 1.946741 1.944420 2.287842 2.478437 3.236341 4.728640 8.375493
189 15 3 nan nan nan nan nan nan nan nan nan nan
190 15 3 nan nan nan nan nan nan nan nan nan nan
191 15 3 nan nan nan nan nan nan nan nan nan nan
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.165647 0.793736 3.124714 2.089356 3.252333 1.771702 2.725175 1.809502 2.283739 1.941245
206 19 0 1.106753 1.121222 1.631888 1.325029 1.653704 1.689680 1.857846 1.692619 2.087973 1.724166
207 19 1 0.842158 0.811840 1.686997 1.883531 1.672454 1.802373 1.717359 1.905447 1.724388 2.110754
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.835581 0.871680 1.543210 1.653270 1.767614 1.614530 1.727178 1.699592 1.658049 1.688885
224 19 1 0.901965 0.899413 2.310577 2.621272 1.836667 1.905626 3.471519 2.510665 6.032655 3.407096
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 6.212419 5.340492 15.314954 29.470490 7.600886 8.123084 7.297282 5.429112 10.404616 14.020864
321 2 3 0.786237 1.091003 2.015806 1.999715 1.750620 1.726232 1.729503 1.881084 1.572279 1.849092
323 2 3 0.823846 1.288743 1.957491 3.800589 1.868379 3.461424 1.722586 1.766768 1.817613 1.963250
324 4 3 0.808443 1.640518 1.880594 2.277017 1.875878 4.579975 1.650603 1.783328 1.683683 1.902553
329 12 1 1.153856 1.748055 11.513278 24.204282 1.722776 1.571891 1.814408 1.644803 1.708705 1.536826
333 12 1 1.442178 1.468709 2.258303 1.234960 2.242637 2.367680 1.726899 1.657438 1.668761 1.646978
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 [ ]: