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 = 2459760
Date = 6-29-2022
data_path = "/mnt/sn1/2459760"
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 2459760.25301 and 2459760.33601
372 diff files found between JDs 2459760.25301 and 2459760.33601

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 154.862279 119.836391 59.476068 79.222238 4.524873 42.974944 3.346368 45.245854 1.173904 18.667658
1 0 0 126.572949 134.472552 52.170102 65.110210 2.509113 2.527110 1.158885 1.518652 1.394751 1.028498
2 0 0 93.024662 46.471676 43.807428 22.711482 2.272880 1.042010 1.595657 1.578695 1.844058 0.579849
3 1 2 1.182301 0.893477 1.768460 1.635509 2.537666 2.162440 1.820094 1.912570 1.816788 2.564687
4 1 2 1.249907 1.085877 8.568412 10.912775 2.482034 2.392700 2.207225 2.346787 2.776361 2.424946
5 1 2 1.050334 0.951136 1.906390 1.751118 2.265326 2.189554 2.497119 2.265680 7.832564 9.109146
7 2 0 1.062928 0.907876 1.565563 1.568987 2.412016 2.261021 1.715328 2.030517 2.258705 2.344983
8 2 0 1.293199 17.085755 3.015232 55.318040 2.910861 52.584135 2.907118 59.872041 3.692521 83.608955
9 2 0 0.932997 0.938623 1.977040 1.614851 2.495450 2.286562 2.593971 2.683289 2.494988 3.028275
10 2 1 1.032132 6.765728 1.924220 8.924055 2.359423 28.546057 1.851198 39.273601 2.112386 49.902393
11 0 1 nan nan nan nan nan nan nan nan nan nan
12 0 1 nan nan nan nan nan nan nan nan nan nan
13 0 1 nan nan nan nan nan nan nan nan nan nan
14 0 2 81.775991 203.322495 176.226135 1134.550207 27.027171 198.046738 31.793824 40.045602 6.595716 614.525314
15 1 3 1.231689 0.972206 1.823156 1.571690 2.484072 2.331646 1.962078 2.126405 5.094763 6.451748
16 1 3 1.053503 0.910092 1.878691 1.579774 2.200777 1.794286 1.748420 1.888555 6.158636 3.702265
17 1 3 1.104480 0.940772 1.728512 1.548491 2.741921 2.079281 1.773401 1.855985 2.536680 2.970979
18 1 0 73.976801 4.795084 1.341891 1.670620 353.534123 16.391668 1.786400 1.831025 2.333095 2.107266
19 2 1 1.046092 1.019024 1.679563 1.611438 1.842482 2.078918 1.836116 1.921450 2.580150 6.959677
20 2 1 0.941733 0.861884 1.730041 1.713672 2.020771 2.163869 1.734236 1.960419 2.119947 2.625369
21 2 2 0.948139 0.818658 1.495678 1.621648 2.409310 1.844316 2.007952 2.352499 1.776674 2.514074
23 0 2 88.042216 81.280637 62.648508 49.595042 10.007181 6.147327 1.954855 3.085724 3.380227 1.567908
24 0 2 83.507963 164.131314 45.235317 79.000353 2.664305 7.715197 1.098722 2.598491 1.691503 2.858010
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 3.426717 3.335395 7.078097 10.052229 10.005260 6.051047 3.989860 1.796491 3.610143 2.124943
28 1 0 140.039340 14.435721 0.841180 56.771327 635.338383 48.415746 1.871915 21.982831 2.239265 70.457739
29 1 1 1.364685 1.054902 2.582629 1.626338 2.601148 1.975725 3.050235 3.354617 3.997498 5.392114
30 1 1 1.358660 1.036414 2.691590 1.653109 2.705250 2.059222 3.129873 3.831582 3.268989 5.740702
31 2 2 1.020562 1.022962 1.789511 1.499896 2.290782 2.088171 2.312858 3.491717 3.154630 6.611669
32 2 2 1.005516 2.194058 1.776295 1.248996 2.321665 2.918220 2.585832 12.109312 3.003383 5.966276
33 2 3 30.168472 0.844681 1.820670 1.462877 154.866661 1.912881 2.094834 1.663600 2.686436 2.398131
36 3 3 1.343739 1.241990 2.085243 1.635333 2.148905 2.008539 1.880666 1.588542 2.380896 2.640469
37 3 1 1.332646 0.950347 2.961222 1.395928 3.139113 2.304159 2.608671 1.899090 5.821110 4.694895
38 3 1 1.228842 1.220002 2.311767 1.671320 2.306118 2.339206 4.174731 3.465002 3.894991 3.161220
39 0 3 0.000000 nan 0.000000 nan 0.000000 nan 0.000000 nan 0.000000 nan
40 4 1 0.989901 1.028944 1.612905 1.703469 2.135547 2.262896 2.045164 2.212629 2.304536 4.367854
41 4 3 1.027211 0.956960 1.779504 1.579337 2.425582 2.216930 1.670128 1.789915 1.717456 2.080596
42 4 0 1.198186 0.970064 1.792240 1.794206 2.964766 2.535737 2.020464 2.130660 4.116776 5.189209
45 5 0 1.963211 1.014070 17.900836 1.698579 2.946656 2.007792 3.383683 2.009116 3.977977 2.141393
46 5 0 1.683023 1.280246 2.044777 1.787939 3.874872 2.906797 2.116785 2.237145 2.846164 3.504028
50 3 3 1.081844 0.852292 2.033838 1.452557 2.164105 1.863920 1.884014 1.769450 2.111911 2.019655
51 3 2 1.045804 0.878800 2.196122 2.621767 2.379405 2.175324 2.234654 2.077395 5.267142 3.926591
52 3 3 6.124986 1.169891 11.972910 2.153010 3.639100 2.429678 3.987906 2.187088 4.403229 3.281476
53 3 2 0.981784 1.003888 2.041196 2.360748 2.432136 2.765957 1.996358 2.449800 4.993743 5.336082
54 4 0 1.062137 0.969161 1.649714 1.915241 2.412772 2.310266 1.964475 2.066802 3.256556 4.640347
55 4 2 1.231140 0.898350 3.232461 2.735933 2.175772 2.467954 3.811191 1.909218 6.458135 2.549753
56 4 1 1.217146 1.070192 1.563347 1.511128 2.406390 2.198072 1.981343 2.025002 2.545713 3.627073
57 4 3 1.215376 1.096308 2.161897 1.275712 3.390454 2.393527 2.378875 1.703168 2.996238 1.839027
65 3 0 1.090669 0.998809 2.483646 1.732727 2.336335 2.078094 2.010983 3.142328 2.406954 3.781394
66 3 0 1.361497 5.777122 3.555772 24.798738 3.127396 19.283088 2.421340 8.843060 3.044087 31.923581
67 3 0 1.144384 0.863896 1.782604 1.596104 2.420494 2.036969 1.688159 1.763484 1.859931 2.032599
68 3 1 1.097241 0.804670 1.871039 1.840285 2.628680 1.988779 1.855182 1.876508 2.126442 2.422264
69 4 1 1.007693 0.953415 1.892774 2.113875 2.448754 2.274460 2.368830 2.278793 3.232318 3.538657
70 4 2 1.017889 2.168220 1.733356 1.981567 2.308397 6.111369 1.984370 2.864165 1.968131 3.070069
71 4 2 1.000882 0.938333 1.851781 2.199445 2.251772 2.075780 2.749156 1.832843 3.152337 2.086855
72 4 0 1.058087 1.084960 1.734745 1.637032 2.520052 3.006416 1.968261 1.738636 4.544705 4.093864
73 5 0 1.101534 1.104353 1.790884 1.652520 2.698623 2.384173 1.747366 1.762349 3.968012 3.758944
81 7 0 1.351488 0.958884 1.846810 1.601081 2.413782 1.898280 2.251944 1.774867 7.156796 3.992660
82 7 0 1.128326 0.969213 1.677133 1.620886 2.309706 2.019962 1.686617 1.672177 3.057112 3.089888
83 7 0 1.491036 1.095286 3.551992 2.717881 2.333178 2.401304 5.147777 3.660497 7.839396 5.041278
84 8 3 1.390632 1.206602 1.883133 1.744323 2.137486 2.319208 1.921143 2.133426 9.853811 10.838045
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.304396 1.070088 2.596162 1.903503 1.976118 1.986611 2.703904 2.042862 4.454269 3.165864
88 9 0 2.600571 6.139165 14.598523 29.858752 9.035568 18.502218 4.472816 3.308809 6.519229 2.858524
89 9 2 nan nan nan nan nan nan nan nan nan nan
90 9 0 1.899612 1.258435 1.774893 1.993436 3.710675 2.675786 7.084067 3.385819 14.110254 9.864353
91 9 1 4.019691 3.073590 13.947010 11.912225 5.564272 8.264926 6.593718 3.654336 8.012283 2.521900
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 4.971056 2.440214 10.189635 20.753093 6.647344 5.895820 5.032073 2.468404 4.346955 2.211902
99 7 2 1.066799 0.919108 1.651499 1.713183 2.396822 1.955738 1.871655 1.819863 3.304912 5.158894
100 7 1 4.334149 4.494410 12.316716 17.284883 6.253386 17.906140 3.901652 3.421248 4.539804 7.595981
101 8 2 1.701003 1.191975 1.833311 1.676356 2.392652 1.824546 2.170061 2.016995 2.466724 4.789422
102 8 0 nan nan nan nan nan nan nan nan nan nan
103 8 1 1.359302 0.963962 1.821210 1.614379 2.101329 2.175959 1.847913 1.751945 2.307222 2.331109
104 8 1 1.845178 1.197839 0.982892 1.744927 2.327365 2.475324 3.075066 1.662342 7.724138 2.425691
105 9 1 2.148097 3.295462 15.016656 7.356489 3.767337 10.117806 4.999788 2.527219 9.760986 2.873099
106 9 3 1.681541 1.321986 1.703141 1.610885 4.705000 2.863462 2.271093 2.754445 3.038514 2.597694
107 9 0 3.483261 7.430372 28.063911 51.696179 4.348253 4.470453 3.703131 13.014739 8.270165 22.887098
108 9 1 1.109337 0.882285 1.773950 1.747859 2.094479 2.142200 1.864141 2.119728 2.879884 2.658394
109 10 1 101.801788 104.358969 31.282503 539.534598 1.872858 35.139185 1.371747 25.629716 0.753037 345.819903
110 10 1 79.876758 90.833574 42.477686 58.862858 1.955364 2.843638 4.894060 25.057189 1.367291 3.245717
111 10 1 146.037949 94.110572 57.407402 65.500578 2.911021 3.458334 1.483915 7.212358 1.527536 4.071343
112 10 2 86.960340 90.124526 36.329359 198.829848 7.797850 26.496045 1.504679 40.385105 1.266671 16.022451
116 7 2 7.975939 1.764296 5.960874 7.964737 25.467097 3.178378 6.551189 2.690156 6.545277 2.794906
119 7 1 2.810954 2.085127 2.143850 16.088100 8.861568 4.189925 2.730756 1.810238 15.848564 1.830067
120 8 1 4.815963 1.972296 5.754968 1.647105 5.175850 1.970518 6.767811 1.686823 20.636989 2.396630
121 8 3 2.249359 2.357096 2.729181 1.617687 5.497750 7.627714 3.811738 2.891909 7.246985 25.728105
122 8 2 2.283834 1.792074 1.864053 1.693938 5.135246 4.442231 3.473801 2.796184 6.049681 6.982244
123 8 3 1.268563 1.012230 1.772516 1.623201 2.396111 1.675307 2.087895 1.675518 3.902642 2.967198
124 9 2 nan nan nan nan nan nan nan nan nan nan
125 9 3 3.401149 2.699593 39.321705 11.104742 12.483470 6.142215 3.191844 1.960778 5.348420 2.189666
126 9 3 3.028896 2.564453 34.971111 9.895426 5.421706 10.950718 4.919168 4.791066 5.105817 4.312017
127 10 2 84.912854 124.880627 26.729257 50.998019 1.494459 2.411206 0.592589 1.031763 0.609295 1.020701
128 10 2 154.533374 122.658259 65.011877 65.173224 2.812198 2.427654 1.159010 0.878238 1.303736 0.824377
129 10 3 147.320607 93.582517 76.180128 599.498480 60.642355 100.352686 5.841068 172.028040 1.778247 21.551256
130 10 3 118.608009 55.639386 71.533953 31.367946 4.119103 2.102053 1.548726 1.139849 1.355804 0.600449
135 12 2 0.960177 0.927533 2.100952 1.611983 1.937215 1.891449 2.218644 1.849153 2.128796 1.945720
136 12 2 1.410124 1.042339 3.244274 1.754844 2.860570 2.481448 5.374915 3.032548 5.223165 7.374664
138 7 1 1.124225 4.010960 1.868076 3.268274 2.163255 3.018082 2.467471 2.001159 12.077137 2.341488
140 13 2 1.063372 1.025769 1.959524 1.612807 2.434334 1.847867 1.871309 2.067906 4.070815 5.043614
141 13 2 6.402127 1.105924 21.417324 1.724586 23.159492 2.395353 13.612475 2.173439 12.328215 3.392965
142 13 2 2.838606 1.088942 4.485684 1.787932 6.715073 2.599680 2.503633 1.905517 3.697737 1.942734
143 14 2 1.125638 0.879899 2.436622 1.571970 2.601344 1.809526 2.173409 2.011421 2.857300 4.155975
144 14 3 1.443533 1.133963 1.949677 1.541543 3.355985 2.368687 2.069419 1.786160 2.374741 2.204353
145 14 3 4.763116 3.497265 13.959094 19.859815 12.943253 9.335750 3.118149 1.832621 2.744407 1.969195
150 15 1 3.168760 11.270356 18.832565 51.734584 4.168133 12.557669 4.764840 20.178602 5.945195 38.411472
155 12 2 3.192655 2.489512 9.211488 20.022213 4.156809 3.739161 3.584428 3.611525 3.599099 1.961757
156 12 3 1.354691 1.074288 1.606682 1.634979 3.254958 2.306023 1.910573 1.950000 2.169842 1.992922
157 12 3 1.253615 1.104872 1.754223 1.754883 2.609959 2.360787 2.208166 1.918395 1.815632 2.071782
158 12 3 1.449797 1.054547 3.869203 1.652570 4.569477 2.224631 2.871723 2.769653 4.329906 6.958228
160 13 3 2.165867 1.549824 1.230234 2.320889 4.927477 2.914971 1.648858 2.110148 1.959919 2.547971
161 13 0 1.819621 1.321964 1.254454 1.615116 4.673001 2.849145 3.206996 1.951569 4.408463 4.423924
162 13 0 0.994323 0.917051 1.743930 1.868486 2.229171 2.207255 1.921597 2.334684 2.368603 4.190147
163 14 2 1.069900 0.976386 1.890005 1.719871 2.316473 1.848490 2.655497 1.725586 2.542541 3.303823
164 14 2 1.096868 0.913941 1.671117 1.801955 2.444200 2.179641 2.173248 3.402494 4.131509 3.230169
165 14 0 5.108051 2.739866 6.757367 4.790650 14.451185 8.693707 4.888245 6.298548 8.538006 13.363354
166 14 0 2.212966 1.855951 1.945521 1.570119 3.728603 3.605729 4.561596 3.712019 3.471993 3.712302
167 15 1 2.345272 2.515409 1.965833 1.474368 3.036139 2.157892 2.753507 2.358228 2.970381 1.931964
168 15 2 1.752323 1.013413 4.965392 2.245745 2.114913 1.891878 4.845844 3.465489 7.749819 3.446723
169 15 2 1.404617 7.751725 3.244506 33.776759 2.609929 15.042370 3.918021 13.582944 6.487642 24.174225
170 15 2 1.424470 12.944251 3.029024 58.770990 2.974050 16.871931 3.726773 15.195680 4.359379 22.946863
176 12 0 0.995502 0.874264 1.824114 1.694055 2.420638 1.890257 1.990225 2.001845 2.645528 2.533392
177 12 0 1.041531 0.983133 1.877190 1.664454 2.368168 2.084322 2.411647 1.711062 3.308510 2.560529
178 12 0 1.101995 1.038897 1.732123 1.674853 2.498837 2.346381 2.259838 2.245944 2.901309 2.767371
179 12 1 1.439090 0.855280 1.724805 1.769459 2.867295 1.804368 4.252010 2.719005 4.898242 2.998888
180 13 3 1.986788 4.936522 14.677986 1.663168 3.095523 10.986655 2.848681 7.522913 2.570817 19.018552
181 13 3 1.242192 1.047828 1.946806 1.355132 2.678288 2.522683 2.105750 1.726015 2.238783 1.985623
182 13 0 1.388370 1.792163 2.980618 2.638148 2.971620 4.430240 3.401857 5.982697 4.339693 7.585356
183 13 1 1.114643 1.034865 1.772616 1.536662 2.936690 2.370987 2.092290 1.830600 2.784443 3.002108
184 14 0 0.953365 0.827519 1.753578 1.462336 2.293493 1.762782 1.981090 1.724252 4.016333 5.310046
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.002821 0.974935 2.200496 1.719687 2.518475 2.038132 1.873641 1.878766 2.234107 2.217492
190 15 3 3.301792 3.636709 1.537500 1.697687 3.163758 3.174497 3.032633 3.119344 4.057891 4.539440
191 15 3 1.173151 1.098697 2.079589 1.806264 3.091787 2.586102 2.248097 2.333196 2.410780 2.341251
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 4.640000 4.893402 5.810913 22.711022 4.344610 4.944647 6.017164 5.609449 6.940342 6.701619
321 2 3 0.922241 0.869436 1.956438 2.999003 1.959421 1.946120 1.948325 1.645329 2.041180 1.852141
323 2 3 0.996455 1.615808 2.564438 4.210050 2.095223 3.498949 2.017934 1.820784 2.257928 3.178715
324 4 3 0.818375 1.752506 1.777089 6.803900 1.716980 2.276016 1.746456 2.822113 2.009450 3.752175
329 12 1 0.847465 0.958894 1.828245 3.079536 1.707965 2.357136 1.632254 1.670778 1.872900 2.019234
333 12 1 0.821759 1.146537 1.788885 1.807646 2.011554 3.595284 1.799012 1.707221 1.746416 2.053884
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 [ ]: