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 = 2459796
Date = 8-4-2022
data_path = "/mnt/sn1/2459796"
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 2459796.25309 and 2459796.33609
372 diff files found between JDs 2459796.25309 and 2459796.33609

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.028791 0.938245 1.183764 1.219463 1.840983 2.166832 1.666273 1.795337 1.331338 1.870989
4 1 2 0.919454 1.737809 1.558850 1.098550 1.847979 1.859295 1.516022 1.772075 1.583376 1.752570
5 1 2 0.827111 0.941907 1.336065 1.069312 1.740657 1.898252 1.819099 1.504988 4.099354 4.582640
7 2 0 0.876215 0.868299 1.166008 1.606413 1.888515 1.949338 1.669743 1.709001 1.597174 1.703114
8 2 0 1.305175 8.813069 2.370811 30.169708 2.632642 32.458859 2.230804 40.524025 2.706372 55.349704
9 2 0 0.826521 0.892905 1.316179 1.275796 1.910455 2.058415 1.892405 1.943701 1.630250 1.842030
10 2 1 0.821192 0.957329 1.248898 2.330629 1.742982 1.961789 1.734769 1.909838 1.677693 1.871777
15 1 3 0.954679 1.022006 1.241537 1.079010 2.029801 2.003261 1.937114 1.913514 4.477262 3.857545
16 1 3 0.991126 0.882953 1.578705 1.094646 2.109403 1.926102 1.957896 1.633926 4.687930 4.860279
17 1 3 1.015628 0.988709 1.420099 1.121913 2.174732 1.919808 2.004558 1.647158 2.293989 2.198013
18 1 0 42.411009 9.962444 1.224797 1.333752 200.221105 37.179326 1.448523 1.743058 1.370135 1.686874
19 2 1 0.847950 0.851192 1.339338 1.740617 1.978140 1.874306 1.808571 1.789892 2.673026 3.976895
20 2 1 0.814057 0.814486 1.189341 1.113401 1.781161 1.721487 1.512750 1.592340 1.398101 1.613113
21 2 2 0.859477 0.809815 1.648312 1.026457 2.225749 2.042790 2.258579 1.646219 1.907324 1.629929
27 1 0 3.989228 3.812108 7.547605 18.931136 11.500419 6.201326 4.079562 2.185321 3.022551 1.852349
28 1 0 53.180851 1.286712 0.959363 1.454871 261.248261 4.343911 1.617640 1.961042 1.886965 2.251406
29 1 1 1.210695 0.911831 2.289726 1.165733 2.490194 1.676706 2.410244 2.526797 3.467758 2.866392
30 1 1 0.848392 0.895124 1.489298 1.366795 1.993439 1.849331 2.409833 2.215386 1.957928 3.287126
31 2 2 0.913086 1.070788 1.527459 1.833626 2.225332 2.182799 2.285121 5.787294 2.537870 7.097628
32 2 2 1.747599 2.040489 0.816487 0.946086 2.998541 2.064831 4.536333 5.908178 4.067715 5.988453
33 2 3 53.629882 0.851536 1.195196 1.503282 271.349440 2.006598 1.506360 1.734336 1.672560 1.733972
36 3 3 1.217386 1.346202 1.698198 1.790907 2.196061 2.331877 1.735699 1.555797 1.451390 1.596284
37 3 1 0.977635 0.804044 5.136341 2.352505 2.367355 1.801556 1.937374 1.691043 2.486452 2.148587
38 3 1 0.890013 1.170345 2.020513 1.356478 2.153671 2.401620 2.063374 2.292977 1.843331 1.792198
40 4 1 131.171401 128.875108 318.774596 315.381575 2.172215 2.309589 0.971203 1.278275 1.121170 0.977442
41 4 3 233.642580 670.789741 1553.247270 4243.952681 167.506219 2160.822394 121.825621 1259.413121 1163.692648 2482.112567
42 4 0 123.465630 152.898891 386.662742 395.119562 11.441396 7.504711 4.675061 5.811368 4.110481 4.008274
45 5 0 1.703009 0.983242 4.372824 1.445519 4.965187 1.884619 3.854379 2.257483 3.557786 2.237855
46 5 0 1.219434 1.052864 1.260140 1.129151 2.848546 2.259829 1.750648 1.766075 1.726567 2.008622
50 3 3 1.160412 1.169826 3.495031 2.861524 2.632037 2.194179 1.824747 1.857740 2.071075 1.666605
51 3 2 1.007452 0.978772 12.698307 1.859418 2.044843 2.089118 1.723380 1.714289 1.394379 1.616473
52 3 3 1.437880 1.308413 1.806240 1.846774 2.111160 2.236326 1.817394 1.963413 1.588368 1.835853
53 3 2 0.886952 0.966336 1.583361 1.431390 1.901981 2.165462 1.671855 1.644775 3.138864 2.890828
54 4 0 97.225651 108.895532 262.771987 304.431282 2.251030 12.072804 0.697346 4.559434 0.617744 2.626444
55 4 2 119.907356 49.822815 330.832212 117.955540 2.522135 4.892258 2.597102 1.257735 1.143674 0.457952
56 4 1 92.850332 242.435189 377.936879 1457.197144 37.863152 190.833381 52.424205 129.563196 27.352218 170.872457
57 4 3 126.476098 121.517588 344.344419 532.387308 2.273129 34.377251 0.973413 24.590190 0.778766 259.359073
65 3 0 0.930619 0.854348 1.656910 1.070615 2.228527 1.923887 1.904045 1.700858 1.663323 1.484807
66 3 0 0.982126 0.898111 2.121225 1.421601 2.313520 2.148192 1.870195 1.674228 1.705765 1.739466
67 3 0 0.887486 0.921308 1.322460 1.234336 1.967709 1.960480 1.838802 1.702192 1.716284 1.579718
68 3 1 0.911810 0.880258 1.288340 1.245296 1.904686 1.742629 1.599974 1.866383 1.799043 1.998575
69 4 1 0.000000 68.141537 0.000000 171.769368 0.872745 3.325219 0.000000 3.783673 0.000000 0.956782
70 4 2 0.000000 86.060177 376.113515 225.762100 0.000000 8.508484 0.000000 7.208235 0.000000 1.116614
71 4 2 107.620461 122.163676 292.468265 332.430211 3.317485 5.674057 3.116630 13.109615 1.961296 2.583236
72 4 0 93.548196 235.501992 269.768471 1091.649415 6.591003 901.821500 22.778120 152.388586 22.106162 193.156201
73 5 0 1.032503 0.875346 1.333572 1.066611 1.884415 1.689665 1.495212 1.488308 1.690163 1.556802
81 7 0 1.363906 1.146117 2.163580 1.712025 2.929060 2.507136 2.595035 2.057503 8.906724 3.906802
82 7 0 0.871112 0.900598 1.328299 0.951981 1.792365 1.874423 1.634194 1.733872 1.725242 1.824368
83 7 0 0.878019 0.893097 2.124093 1.505115 2.061524 1.584715 1.859696 1.830627 2.028071 1.787083
84 8 3 1.432497 1.418675 1.808735 1.546681 2.878176 2.653585 2.257695 2.030703 3.456222 3.410506
85 8 0 0.844738 0.891211 1.536097 1.405116 1.986827 1.932562 1.836309 2.265712 2.542351 3.517077
86 8 0 0.948711 0.898003 1.557451 1.651265 1.893773 1.777829 2.136991 2.652132 1.919224 2.331841
87 8 2 1.057751 1.157230 1.615302 2.474254 2.019844 2.683819 1.412952 3.278270 1.879758 2.332147
88 9 0 2.171650 6.096207 14.953774 40.853045 5.867037 23.386662 4.583122 4.264007 7.899539 2.643682
90 9 0 1.792838 1.413389 6.103915 14.270893 2.482856 2.079880 2.441412 2.088147 3.060711 2.783977
91 9 1 2.905906 6.324314 12.607626 5.510462 4.912794 14.071590 5.558006 4.202660 7.194410 2.572380
92 10 0 2.790636 1.871239 0.656944 0.768325 2.818418 3.149010 3.311106 1.844031 3.290061 2.392711
93 10 0 1.017253 0.962308 1.506422 1.239019 1.998240 2.480054 1.690193 1.752000 1.958175 2.579787
94 10 0 0.829773 1.202006 1.384729 3.205998 1.869549 3.594735 2.123276 3.188836 2.027559 7.136960
98 7 2 1.110402 0.887503 1.561821 1.684536 2.526692 1.851988 2.104512 1.863861 3.878328 1.939701
99 7 2 1.151985 1.251012 1.939332 2.070037 2.369037 2.753535 1.943309 2.147178 3.768975 20.840073
100 7 1 0.838959 0.868856 1.401432 1.355345 1.868370 1.985798 1.714503 1.776683 1.781073 1.826502
101 8 2 1.085998 1.238088 1.471161 1.460523 2.124319 1.841541 1.895817 1.822819 1.809262 2.196438
102 8 0 0.825728 0.865513 1.079415 2.726155 1.635157 1.851505 1.550274 1.757401 1.672371 1.771219
103 8 1 1.244533 0.886202 1.703590 1.450521 2.091285 1.725125 1.900052 1.772984 2.428115 1.653792
104 8 1 2.041306 1.109485 0.393287 1.458193 2.749390 1.964602 3.507463 1.680826 4.015696 1.569749
105 9 1 2.227133 3.456646 16.430475 7.321386 3.725671 7.934865 5.263388 2.158762 10.756074 2.883739
106 9 3 2.953471 2.804525 10.199259 16.289513 4.241666 11.619572 2.746274 2.661362 4.758686 2.463780
107 9 0 7.567980 32.417730 28.102070 200.555162 8.125411 20.882603 10.709888 76.067456 22.044237 146.420793
108 9 1 1.761855 1.361222 8.275708 5.423116 2.367729 1.997401 2.978312 1.985457 3.136880 1.952293
109 10 1 1.373301 1.643737 1.263136 1.235819 2.953536 3.283736 1.891578 1.880247 2.136545 2.516743
110 10 1 0.926784 1.634782 1.616760 4.925997 2.186676 2.414530 1.700500 2.342605 1.498665 1.828213
111 10 1 0.939348 1.092975 2.331554 1.192724 2.166894 2.120079 1.843467 1.500540 1.561967 1.266466
112 10 2 0.877261 1.215671 1.423769 1.230296 1.959722 2.061172 1.788276 1.624295 1.703741 1.528951
116 7 2 0.910941 0.849819 1.979587 1.143801 2.774566 1.933027 1.921820 1.666694 2.392641 1.511903
117 7 3 0.926363 1.021615 1.532791 1.647237 1.773888 1.869748 1.689824 2.252482 2.067322 3.379283
118 7 3 1.009528 1.082270 1.576788 1.122073 2.110070 1.924600 1.733605 1.752564 1.689537 2.359166
119 7 1 0.976917 0.796955 1.320970 1.594874 2.248510 1.935544 2.163730 1.828542 6.326557 1.945420
120 8 1 3.484218 1.526388 11.035115 2.943273 6.875691 5.181128 8.930935 1.717204 26.490125 3.366906
121 8 3 1.651112 1.808220 1.768774 1.354120 4.209036 5.802983 2.432330 2.332784 3.585469 11.070667
122 8 2 1.452272 1.359085 1.480576 1.424047 3.246840 2.277162 2.340496 1.850523 2.811555 4.444628
123 8 3 1.284256 1.099740 1.572666 1.250064 2.330080 1.680275 1.775864 1.617758 2.344753 1.927369
125 9 3 4.052289 1.641337 37.093789 12.098405 12.598030 3.469802 2.860118 2.420707 4.974801 2.434051
126 9 3 3.313735 2.499743 34.433100 9.785601 4.744248 7.067274 4.133903 4.035149 5.174426 3.606285
127 10 2 1.311848 1.438467 1.631289 1.249921 2.839203 4.147318 3.640255 3.737484 3.826902 4.846651
128 10 2 0.847914 0.988902 1.430483 1.732762 1.925561 2.206931 1.561218 1.704401 1.939299 2.042704
129 10 3 0.882303 0.843796 1.156879 1.141407 1.714123 1.611281 1.602549 1.580713 1.288438 1.660411
130 10 3 1.074983 1.023494 2.054595 2.611268 2.389546 2.534212 2.028386 1.770403 2.200651 2.073452
135 12 2 nan nan nan nan nan nan nan nan nan nan
136 12 2 nan nan nan nan nan nan nan nan nan nan
137 7 3 3.900088 3.838645 2.900884 20.954444 10.246229 6.676350 4.002934 2.642685 6.686441 2.669874
138 7 1 0.891686 2.876784 1.274806 5.209855 2.240581 4.232722 1.972233 3.220492 5.715847 5.856801
140 13 2 1.088370 1.077365 1.374840 2.003111 2.182723 2.115105 1.890501 1.855518 1.757980 2.340417
141 13 2 2.436209 1.124958 5.932093 1.349091 7.507347 2.021142 4.708082 1.483447 3.895875 4.280466
142 13 2 4.898457 1.538677 6.741797 1.377427 5.138817 4.129209 2.684658 1.482639 3.524655 3.458683
143 14 2 nan nan nan nan nan nan nan nan nan nan
144 14 3 1.241510 1.140245 1.482782 1.185987 2.306231 1.798920 1.640616 1.542014 1.709590 1.626721
145 14 3 3.580563 5.213886 21.817575 17.836395 11.888213 15.100458 2.914936 1.669011 2.848248 1.758990
150 15 1 3.081667 7.087540 17.311738 40.671287 4.430892 8.865804 4.262556 13.884504 6.994589 28.087281
155 12 2 nan nan nan nan nan nan nan nan nan nan
156 12 3 1.174689 1.038513 1.675488 1.518608 2.403847 2.093586 1.667786 1.767269 1.522021 1.519765
157 12 3 1.052472 0.879075 1.472678 1.187711 2.037739 1.813865 1.692704 1.646170 1.566504 1.358756
158 12 3 1.155595 0.909175 2.613011 2.295820 3.190224 2.265430 2.093779 2.285914 2.807337 2.361435
160 13 3 3.541516 5.115677 5.482340 29.290683 6.441668 10.516352 3.025038 4.994064 2.991936 10.330351
161 13 0 1.918703 0.947232 1.148942 1.229503 3.219647 1.965842 2.709383 1.584970 3.773629 2.665603
162 13 0 0.872929 0.900948 1.159303 1.193140 1.817472 1.736728 1.589637 1.692655 1.372199 1.587406
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 4.556917 6.648551 6.670668 9.890133 15.213224 20.819209 4.073673 5.494003 12.251319 6.249316
166 14 0 1.016757 1.284194 1.465491 1.354662 2.478049 2.699813 1.757975 2.876591 1.750075 1.960233
167 15 1 1.327298 1.259064 2.386346 1.645196 2.248447 2.356486 2.740898 1.798027 2.854226 1.982957
168 15 2 1.322841 1.100979 3.196053 2.058353 2.181339 1.703260 3.764395 4.881945 5.490152 3.616280
169 15 2 1.151354 5.883922 2.503408 35.679762 2.672526 1.951497 2.891404 4.313118 4.517439 5.298841
170 15 2 1.292492 6.604246 2.854858 40.494628 2.877171 3.010388 3.683586 5.253106 5.413385 6.695379
176 12 0 0.877386 0.862490 1.406522 1.972799 2.481343 2.102360 1.913124 1.522996 1.862659 2.106171
177 12 0 0.902632 0.943927 1.850066 1.313157 2.085994 1.722422 1.798905 1.487155 1.982825 1.505727
178 12 0 0.850573 0.843675 1.618095 1.550423 1.906360 1.910850 1.664001 1.903053 1.505612 1.819235
179 12 1 1.303659 0.812653 1.277755 1.272506 2.232708 1.934804 3.873208 1.819571 2.339086 1.709179
180 13 3 2.381062 1.023183 10.551982 1.190066 5.421356 2.227061 3.157941 1.621567 3.090953 1.620537
181 13 3 2.035938 4.784355 1.282266 9.921061 5.735698 7.676499 2.100718 1.895876 2.228987 1.981742
182 13 0 3.572230 1.512061 7.268778 2.308979 11.395844 3.358146 2.227233 2.167258 2.499925 4.218109
183 13 1 0.990161 0.914637 1.301965 1.719926 2.342432 2.029270 1.464157 1.893959 1.681026 1.958200
184 14 0 0.904998 0.839613 1.269425 1.603714 1.959884 2.183173 1.376064 2.083671 1.451697 2.106932
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.001489 1.121795 1.733129 1.302439 2.046967 2.003308 1.442445 1.758017 1.504735 2.091423
190 15 3 2.892002 2.078048 11.184654 1.239599 3.617000 3.113715 3.003924 3.411452 2.986023 4.638183
191 15 3 0.996335 0.914893 1.237708 1.169862 2.548830 1.908172 1.827961 1.763462 1.858714 1.521888
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 2.258575 0.890222 6.876050 1.821429 7.329082 1.836511 4.511177 1.659901 3.082427 1.946185
206 19 0 1.217363 1.069860 2.202499 1.947375 1.836521 1.939372 1.824638 1.661444 1.850124 1.721760
207 19 1 1.055468 1.045168 2.038047 3.748108 2.382326 2.053454 1.894825 2.036594 1.861876 2.804621
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 1.018433 0.864275 1.732964 1.681534 2.078270 1.762283 1.654500 1.610933 1.481132 1.627282
224 19 1 0.867094 0.826829 1.871267 1.936965 1.783643 1.674364 3.177653 2.425089 6.075421 4.035505
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 5.397485 4.746672 13.519103 27.711022 6.950548 6.276312 4.837488 5.286921 10.643015 15.982436
321 2 3 1.297641 0.891338 2.043625 2.098975 1.955870 1.620996 1.645839 1.639811 1.541679 1.564042
323 2 3 1.080068 0.936963 2.404338 4.202604 2.397178 2.784964 2.080773 1.929509 1.956801 1.987536
324 4 3 99.977049 109.064145 221.554996 279.276052 3.158495 6.853361 2.336903 7.548189 1.622338 2.029109
329 12 1 3.242085 6.227345 11.463502 30.182135 2.174025 2.135263 1.708534 1.884330 1.979664 2.050767
333 12 1 1.377955 1.396458 2.681205 1.486194 2.227345 2.265384 1.585378 1.593300 1.477032 1.556146
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 [ ]: