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 = 2459783
Date = 7-22-2022
data_path = "/mnt/sn1/2459783"
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 2459783.25312 and 2459783.33611
372 diff files found between JDs 2459783.25312 and 2459783.33611

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.081224 0.918069 1.488271 1.524665 1.877437 1.816737 1.756049 1.890383 1.595099 2.159371
4 1 2 0.938210 0.908460 1.511101 3.417039 1.612554 1.808732 1.466537 1.984524 1.664548 2.064401
5 1 2 1.041376 1.026110 1.495779 1.254750 1.641281 1.656757 2.150270 1.726655 5.204389 4.963091
7 2 0 0.996941 0.872980 1.334340 1.264713 1.815551 1.540061 1.622698 1.542303 1.636188 1.682013
8 2 0 1.352218 19.393594 2.377365 69.705925 2.766230 71.341384 2.505223 92.128157 3.010143 118.417230
9 2 0 0.952844 0.837382 1.573829 1.199619 2.000524 1.675775 2.217061 1.757019 2.141177 1.622520
10 2 1 0.951792 1.134481 1.119455 1.361783 1.421289 1.982593 1.379673 2.173413 1.575380 1.945915
15 1 3 1.276608 1.019656 1.570727 1.427058 2.005568 2.119066 1.911692 1.789283 4.248440 4.157806
16 1 3 0.944168 0.945832 1.449810 1.514386 1.876041 1.882995 1.609434 1.601579 3.780023 2.590930
17 1 3 1.026921 0.946352 1.325669 1.267340 2.048059 1.596563 1.777903 1.554712 1.859133 1.965888
18 1 0 108.282326 20.991096 1.758991 1.399676 538.541669 90.132554 1.639456 1.753659 1.835223 1.911876
19 2 1 0.888346 0.992878 1.273697 1.370333 1.726026 1.875389 1.586987 1.717335 1.701120 2.312484
20 2 1 0.912305 0.936465 1.209186 1.271243 1.603987 1.648186 1.655701 1.624137 1.402896 1.739402
21 2 2 0.883354 0.867400 1.311776 1.604319 1.651751 1.957620 1.814082 1.760887 1.679832 2.182251
27 1 0 1.863951 2.035148 3.883872 7.664753 2.775423 2.273353 2.499174 1.959521 3.045596 2.086752
28 1 0 116.686212 0.940273 0.971482 1.895930 557.591660 2.079639 1.545181 2.082094 2.201952 2.951738
29 1 1 1.233936 0.991778 2.527890 1.310672 1.879923 1.712112 2.414171 2.274541 3.143352 2.549946
30 1 1 1.015312 0.907403 1.453635 1.754364 1.668118 1.890111 2.702499 3.020684 2.198106 4.947391
31 2 2 0.976545 1.167362 1.331460 1.452039 1.919485 2.093000 2.356163 4.367345 3.114170 7.903643
32 2 2 1.261572 1.357052 1.099391 1.084854 3.120820 2.897794 4.703262 5.114256 4.096341 5.624984
33 2 3 90.313786 0.872301 1.417741 1.688577 442.342014 1.739635 1.531518 1.790784 1.698495 1.869557
36 3 3 1.327036 1.143518 1.798983 1.602135 1.951009 1.779583 1.759564 1.637793 1.811599 2.023071
37 3 1 1.058369 0.944395 4.566365 2.909375 2.285161 2.046071 1.712559 1.844232 2.395528 2.551642
38 3 1 0.973251 1.089138 1.731646 1.345657 1.660718 2.514771 1.508339 2.141010 1.728284 2.147669
40 4 1 0.866038 0.981354 1.625687 1.308707 1.744389 1.894467 1.623591 1.707555 1.593330 2.292924
41 4 3 1.023325 1.086264 1.248565 3.399946 1.696381 1.667607 1.450718 1.635562 1.546003 2.891182
42 4 0 0.871370 0.989762 1.355484 1.261556 2.124012 1.983951 1.692704 1.674092 2.303496 4.214545
45 5 0 1.442136 0.998787 3.641374 1.479031 3.788420 1.649020 3.393728 2.045361 3.373949 2.150396
46 5 0 1.276125 1.103650 1.168389 1.359388 2.121586 2.005869 1.597711 1.757371 1.713012 2.215078
50 3 3 0.952285 0.805450 1.259199 1.598945 1.703177 1.884658 1.544090 1.837008 1.579007 1.908213
51 3 2 3.634570 0.990833 12.483018 4.231594 5.318118 1.661034 4.986878 1.916195 6.856810 2.431851
52 3 3 4.839670 1.064366 16.886861 1.825569 3.288073 1.727931 3.810406 1.517111 4.051435 1.952961
53 3 2 1.060359 0.950465 2.342193 2.276995 1.889527 2.120062 1.831980 2.044308 3.315547 4.486035
54 4 0 0.944038 0.886547 1.227258 1.502164 1.956316 1.935756 1.697517 1.975203 1.969953 2.918589
55 4 2 0.910150 0.791889 1.652991 1.327408 2.086233 1.801435 2.014703 2.077307 2.163138 1.852371
56 4 1 0.940256 1.114405 1.523662 1.779289 2.050017 1.913467 1.980579 1.894084 2.457254 2.309637
57 4 3 0.929418 1.601600 1.468071 5.223372 1.900378 1.630078 1.643344 1.908981 1.730592 2.893811
65 3 0 1.254807 0.836511 3.025628 1.511625 3.018914 1.681856 2.171164 1.991276 2.388572 1.922306
66 3 0 1.085452 1.133045 2.229279 1.421623 2.296211 1.980596 1.796073 1.691407 1.689789 1.981491
67 3 0 0.969820 0.943622 1.567125 1.300401 1.656837 1.503770 1.589495 1.629512 1.547438 1.678528
68 3 1 0.905430 0.922404 1.348242 1.360852 1.604316 1.767078 1.586910 1.640544 1.604445 1.816623
69 4 1 1.017281 1.003626 1.506542 2.207922 1.973691 1.874426 2.006301 2.043928 2.559922 2.685462
70 4 2 1.556194 1.209321 1.434209 1.597506 3.825062 1.768624 2.734057 1.705974 1.917661 1.927251
71 4 2 1.100349 1.018813 1.391453 1.286043 1.741060 1.875973 1.670508 1.607820 1.784127 1.738502
72 4 0 1.024040 0.856732 1.550879 1.613713 2.007378 1.972735 1.741969 1.630458 3.151983 2.543064
73 5 0 1.037108 1.104786 1.469589 1.224649 1.935826 1.837279 1.889955 1.528992 2.674509 3.173373
81 7 0 1.677461 1.212103 1.970765 2.150968 2.235571 2.002644 2.598269 1.760297 10.388243 3.862074
82 7 0 0.960292 0.921934 1.451274 1.053859 1.699669 2.017486 1.690386 1.719408 2.161820 2.244535
83 7 0 0.998286 1.215991 1.450076 6.695745 1.838401 2.061191 1.785591 1.816958 1.919004 2.115869
84 8 3 1.611858 1.417501 1.718622 1.883807 2.257016 2.371775 2.239514 2.066589 7.779230 8.011674
85 8 0 3.350988 0.893831 6.723624 1.546826 3.327665 1.609653 2.190623 1.783011 4.024053 1.844246
86 8 0 1.024540 0.936382 2.796300 1.485905 1.893581 1.643527 2.132141 2.155179 2.761487 2.990873
87 8 2 1.221281 1.092741 2.283766 1.662721 2.303207 1.673000 2.337312 2.501062 4.014695 3.064612
88 9 0 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 2.129925 2.071918 0.791036 1.061625 4.013152 2.698190 1.809214 1.921112 2.568121 2.403520
93 10 0 0.962207 0.944014 1.584323 1.306272 1.678101 1.746897 1.773217 1.784005 1.844308 2.100471
94 10 0 0.989778 1.224599 1.435414 2.728975 1.789916 2.862421 1.936411 2.672744 2.487253 17.186793
98 7 2 2.010666 0.874275 2.493211 1.629061 4.229473 1.841189 8.820402 1.796906 93.310629 2.298930
99 7 2 0.963989 1.118196 1.410712 1.564760 1.787523 2.031422 1.869095 1.980397 2.888932 15.709323
100 7 1 1.183882 0.915900 1.696670 1.587433 1.915579 1.866884 1.601633 1.722918 1.944171 2.135655
101 8 2 1.593048 1.356755 1.558122 1.874810 1.632172 2.089965 1.956577 2.292887 2.409796 5.508989
102 8 0 0.909049 0.806736 1.356988 1.790498 1.522778 1.650817 1.614451 1.621322 1.868957 2.253829
103 8 1 1.364203 0.891520 1.818327 1.579943 2.100733 1.849946 1.950895 1.611895 4.513362 2.515079
104 8 1 1.781424 1.252894 2.671629 1.515275 2.661474 1.694413 2.790774 1.719443 8.899399 2.201951
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.667426 1.596238 1.561002 1.713593 3.333096 3.500456 1.711442 1.797996 1.796310 2.158923
110 10 1 1.036521 0.977191 1.700403 1.658651 2.197345 1.840107 1.764334 1.683245 1.790972 1.827001
111 10 1 1.099410 1.145744 2.003222 1.486483 2.324360 2.317027 2.163667 1.694815 1.952368 1.674256
112 10 2 0.943296 1.544210 1.661280 4.175698 1.784323 1.557001 1.654914 1.531724 1.720121 1.521117
116 7 2 0.863583 0.787963 1.293464 1.339258 1.833682 1.668312 1.593631 1.659511 2.146897 1.612449
117 7 3 1.060691 1.037772 1.644321 1.567253 1.733869 1.703449 2.063598 2.208601 2.888715 3.400558
118 7 3 0.994535 0.971514 1.430116 1.440383 1.900536 1.733262 1.639192 1.834938 1.945575 2.577630
119 7 1 0.807472 0.793898 1.257870 1.392059 1.640373 1.590990 1.666208 1.454690 1.948704 2.667470
120 8 1 4.175952 1.480501 8.560211 1.677208 5.116976 1.910524 6.809493 1.771817 20.216189 2.915857
121 8 3 1.825193 1.595423 2.395585 1.600882 3.307791 3.822115 2.513398 2.492263 4.513519 22.824209
122 8 2 2.071810 1.471385 2.333508 1.580426 5.522938 3.021420 4.786233 2.564487 6.387381 4.196873
123 8 3 1.128545 1.114065 1.742021 1.712379 1.699586 1.836546 1.648649 1.920731 3.031976 3.071075
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.019640 0.940310 1.767772 1.051033 2.045356 1.803967 1.761293 1.857405 1.700904 2.253783
128 10 2 0.921453 0.883854 1.438676 1.512217 1.894538 1.744604 1.577541 1.606584 1.829087 2.366196
129 10 3 1.020952 0.858088 1.487647 1.262288 1.788342 1.685722 1.614629 1.609002 1.445136 1.920625
130 10 3 1.238221 0.866238 2.663491 1.824991 2.477676 1.725688 2.132708 1.706156 2.662665 2.133689
135 12 2 0.883111 0.912049 1.483551 1.529955 1.752301 2.105233 1.562454 1.856179 1.636221 1.571016
136 12 2 1.159694 1.013355 3.410970 1.504247 1.941789 1.780063 3.846402 2.173080 2.996899 3.500432
137 7 3 1.911829 3.246863 2.206269 11.878549 4.628140 3.910009 3.278230 1.962381 4.975982 1.880718
138 7 1 0.950551 3.652680 1.572392 3.096823 1.881298 3.093620 1.825177 1.975575 6.008918 3.066492
140 13 2 0.931312 0.841438 1.394927 1.730331 1.617365 1.662187 1.516550 1.553837 1.795844 2.037219
141 13 2 4.331538 0.933415 13.869475 1.289838 15.029840 1.823311 9.624342 1.442549 8.635886 1.536093
142 13 2 2.536555 1.516424 6.494613 1.591157 7.015236 2.261285 2.603031 1.511489 3.492985 2.945160
143 14 2 1.045489 0.803946 2.489960 1.295091 2.515749 1.597944 2.552645 1.752272 2.278148 1.564584
144 14 3 1.289209 1.213700 1.640923 1.516999 2.845409 2.312803 1.655361 1.618093 2.201218 2.057266
145 14 3 2.667939 3.400852 15.989325 14.284043 12.339693 9.953568 2.512607 1.832598 2.940728 1.917661
150 15 1 2.727921 7.004552 15.226399 42.584320 3.808083 6.714729 3.797520 13.912980 7.273986 29.190238
155 12 2 1.714599 2.055151 4.451251 8.583143 2.125097 1.905890 2.479120 2.145967 2.887492 2.043235
156 12 3 1.102595 0.958051 1.386071 2.881300 1.880681 1.884747 1.606244 1.858609 1.703766 2.244945
157 12 3 1.174300 0.936456 1.659476 1.388800 1.668096 1.790551 1.525051 1.696869 1.577916 1.765304
158 12 3 1.238107 0.918782 2.440701 1.858364 3.054393 1.926778 2.448566 1.717389 2.474351 2.326494
160 13 3 2.594744 5.414678 14.592458 47.069742 3.297360 2.880540 5.362717 13.547486 8.238887 21.844176
161 13 0 2.144829 1.079393 2.579106 1.652889 4.414719 2.227424 2.836463 1.688281 2.863788 2.786918
162 13 0 0.983474 0.843939 1.460931 1.254686 2.071087 1.654884 2.080824 1.596164 2.018966 1.749898
163 14 2 0.996936 1.000042 1.722062 1.551490 1.638167 1.843792 1.685900 1.741599 1.609765 3.110231
164 14 2 0.879112 1.013222 1.268343 1.251746 1.836013 1.833510 1.464476 2.172565 1.635183 1.911628
165 14 0 2.047507 1.873366 2.161358 2.398118 4.632160 3.655815 2.275163 4.539718 2.491045 4.862580
166 14 0 1.415370 1.014323 1.509521 1.509996 2.290509 2.182978 2.676867 2.907262 2.635883 2.834246
167 15 1 2.255176 1.801535 1.842961 1.337355 2.127956 2.129292 2.531479 2.125083 2.679009 1.928635
168 15 2 1.351540 0.957792 2.871265 2.053470 2.316270 1.741892 3.751514 3.236814 5.315491 4.090484
169 15 2 1.164942 9.470293 2.839305 44.771315 2.713045 2.214175 2.497261 2.930364 3.394875 3.692497
170 15 2 1.339385 9.728868 3.209863 48.025888 3.098742 15.839413 3.297573 7.987547 4.057259 25.214206
176 12 0 0.993702 0.940747 1.295820 1.361096 1.830589 1.572647 1.765057 1.583891 2.028716 1.714363
177 12 0 0.795684 0.936574 1.381352 1.417076 1.774586 1.825970 1.512108 1.615639 1.718420 2.029591
178 12 0 1.001055 0.895854 1.667757 1.863287 1.780091 1.645307 1.761641 1.863942 1.952363 1.685108
179 12 1 1.506978 0.941170 1.385245 1.258321 2.188120 1.616376 3.193385 1.861847 1.867389 1.953820
180 13 3 1.549155 1.154476 6.654900 1.278807 2.042417 1.920271 2.421526 1.574815 2.334925 1.682968
181 13 3 1.443831 1.956448 2.735639 4.272740 2.698632 2.442684 1.742700 1.604362 2.042418 1.642750
182 13 0 1.177571 1.196099 1.838361 2.340971 2.687414 3.601734 1.828834 2.021421 2.140678 2.348248
183 13 1 1.031857 1.009112 1.666225 1.953628 2.316205 1.991604 1.939189 1.736722 2.088320 2.773857
184 14 0 0.804381 0.848963 1.424747 1.393346 1.709481 1.716290 1.711821 1.814502 2.237819 2.787883
185 14 1 0.980788 1.073155 1.323890 1.924149 1.843510 1.814048 1.847870 2.371555 2.009523 2.575284
186 14 1 0.916566 0.798290 1.271820 1.594740 1.760413 1.593122 1.627754 1.619173 1.693361 1.863557
187 14 1 1.042309 1.163379 1.378427 3.397571 1.969454 3.054095 2.218391 2.760797 3.485191 4.129112
189 15 3 1.006163 0.946041 1.609193 1.396579 1.939042 2.032153 1.593196 1.617407 1.610421 1.931044
190 15 3 1.969096 2.130934 5.812271 1.048102 2.282139 2.218224 2.592622 3.010670 2.626252 4.891308
191 15 3 1.027736 0.880069 1.364522 1.256744 2.228642 1.767437 1.854409 1.623698 1.992666 1.593405
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.170834 0.829474 3.705456 2.079077 2.843162 1.937758 2.288762 2.157506 2.169171 2.457250
206 19 0 0.996545 1.027462 1.775650 4.037024 1.632441 1.895268 2.025629 1.713929 2.277930 1.510258
207 19 1 0.830351 0.792545 1.915820 1.887475 1.742191 1.702850 1.741482 1.836632 1.890414 1.830773
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.840631 0.778263 1.843284 1.653728 1.705542 1.500044 1.855721 1.446982 1.950823 1.753849
224 19 1 0.959212 0.847072 2.201959 1.920697 2.060884 1.722252 4.148433 2.706189 7.424972 4.746710
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.486586 3.570490 12.007769 20.515134 4.999394 3.443251 5.630452 5.293756 9.512754 14.845346
321 2 3 1.472625 1.423207 1.690852 1.960839 2.232082 2.258233 1.857707 1.668964 1.788034 1.807052
323 2 3 1.097150 1.358897 1.746818 3.762316 1.570721 2.353580 1.486903 1.683994 1.632302 2.210949
324 4 3 0.825455 2.486820 1.874420 1.962592 1.798809 7.213309 1.715722 1.777335 1.832366 1.890674
329 12 1 1.206058 1.161123 6.340760 16.338730 1.699799 2.070532 1.563798 1.789564 1.976552 3.592411
333 12 1 1.131942 1.525606 2.420353 3.301314 2.103918 3.477002 1.516650 2.018930 1.575118 1.881043
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 [ ]: