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 = 2459806
Date = 8-14-2022
data_path = "/mnt/sn1/2459806"
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)
1862 sum files found between JDs 2459806.25322 and 2459806.66952
1862 diff files found between JDs 2459806.25322 and 2459806.66952

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.521076 1.703483 1.270148 1.638574 3.092293 3.421267 1.677686 1.874598 2.097244 2.416659
4 1 2 1.283097 4.417968 2.128002 1.689516 2.015647 2.195147 1.803706 2.182172 2.249803 2.367731
5 1 2 1.046887 1.017960 1.948596 1.333009 1.735232 1.851379 2.132573 1.928322 7.549675 7.059465
7 2 0 1.149672 1.038524 1.534772 1.404352 1.836300 2.059845 1.877281 1.731812 2.629142 2.572561
8 2 0 2.368303 16.595041 3.606532 64.582281 3.904873 52.679695 4.023419 30.170575 5.383911 86.081748
9 2 0 0.969617 1.007997 1.289928 1.198754 1.903026 2.072278 2.338507 2.247394 2.714731 2.822689
10 2 1 0.907223 1.204234 1.326357 1.515821 1.586626 1.809902 1.601394 2.896587 2.518959 4.795942
15 1 3 1.267245 1.270487 1.697670 1.330166 1.779261 2.280335 2.114324 2.070131 7.043741 7.806011
16 1 3 1.209436 1.406693 1.516632 1.203779 2.106594 2.189335 2.125920 1.994457 12.188144 10.789444
17 1 3 1.221977 1.139209 1.337986 1.180670 2.125277 1.795884 1.923935 1.792918 2.227636 2.531159
18 1 0 76.239690 72.587622 1.542732 2.392148 398.378562 358.097614 1.710323 1.521114 2.858545 1.880078
19 2 1 1.092211 1.073430 1.564421 1.637195 1.861264 1.767711 2.151924 1.894030 3.976066 5.932412
20 2 1 1.082178 1.103451 1.486949 1.122859 1.698529 1.807541 1.697760 1.596648 2.045546 2.251338
21 2 2 1.021775 1.005436 1.376366 1.064640 1.943989 2.186753 2.146389 1.810461 2.422644 3.149465
27 1 0 4.338820 4.771946 9.288998 23.092526 16.467186 11.894213 5.038378 2.157196 4.969621 1.800441
28 1 0 103.133750 2.850097 1.085532 1.481794 494.591695 11.135169 1.828329 2.240804 4.227785 5.239868
29 1 1 1.319341 1.078708 1.429442 1.229164 1.994164 1.794611 2.276509 2.950741 5.732054 4.905308
30 1 1 1.246384 1.086488 2.601641 1.431676 2.531496 1.759108 3.538104 3.011661 2.627111 3.839799
31 2 2 1.123221 1.279208 1.669629 1.355825 1.809369 2.163251 2.062157 4.093299 2.992808 6.932906
32 2 2 1.242088 3.044355 1.354340 2.011178 2.148285 3.526106 4.644691 12.114487 5.036092 10.131339
33 2 3 75.972723 1.090796 1.423324 1.864953 393.714328 2.062230 1.484215 1.842531 3.142551 2.897996
36 3 3 1.329355 1.295034 1.565933 1.409151 1.852218 2.937823 1.772197 1.502962 2.619584 2.377751
37 3 1 1.100211 1.073458 3.963329 1.377796 2.520947 2.641827 2.199884 1.811629 3.578615 4.219610
38 3 1 1.029585 1.478205 1.702128 1.465957 1.734509 2.360947 1.626666 2.543605 2.422023 2.623715
40 4 1 1.133116 1.453998 2.138650 1.679149 2.097851 3.196622 1.859415 2.149127 2.364764 2.487658
41 4 3 1.067326 1.589883 1.443129 5.013938 1.793638 2.793099 1.798827 2.288897 2.080304 3.946333
42 4 0 1.417287 1.214738 1.470276 1.288275 3.428511 2.480908 2.096498 2.224206 3.022743 7.128985
45 5 0 1.297040 1.288029 2.319307 1.379752 2.261126 1.931117 3.046681 2.592695 3.683811 3.188541
46 5 0 1.055525 1.094052 1.579761 1.233957 2.060171 1.697659 1.792073 1.553155 2.642000 2.111296
50 3 3 1.666655 1.715094 1.260271 1.262232 2.850628 3.491876 1.912087 1.679715 2.432857 2.172603
51 3 2 1.586321 1.206234 5.815231 1.461150 1.867967 2.292094 1.784429 1.728385 1.929355 2.908888
52 3 3 1.386664 1.760367 1.408198 3.224766 2.225468 3.550402 1.937167 2.874789 2.829723 3.758169
53 3 2 1.395999 1.629372 2.920741 2.461516 3.037249 3.801198 2.609006 3.268614 6.941873 6.407278
54 4 0 3.028438 1.072592 1.276406 1.179935 5.721986 2.375915 2.602788 1.830772 3.899004 3.036834
55 4 2 1.049069 1.139404 1.763865 1.339026 1.793008 2.101339 1.962946 2.153365 2.385487 2.356961
56 4 1 1.411364 1.350185 1.343598 1.558125 2.669777 2.147049 2.138060 2.247591 3.682139 3.292413
57 4 3 1.971014 2.150868 1.881205 11.093728 3.295812 1.952214 2.469645 1.789591 2.863945 2.451671
65 3 0 1.253601 1.226991 2.142916 1.073026 2.280234 1.849824 2.125242 1.657226 2.563713 2.145303
66 3 0 1.562899 1.242667 3.727119 1.773787 4.012333 3.005372 2.794273 1.798121 3.067297 2.682376
67 3 0 0.972891 1.060528 1.506895 1.218054 1.634300 1.912507 1.713969 1.741509 2.472880 2.254168
68 3 1 1.170724 1.144112 1.578637 1.903978 1.890543 1.878851 1.525426 1.843833 2.176982 2.964929
69 4 1 0.970796 1.226208 1.888485 2.053114 1.741760 2.084787 1.838981 1.944266 2.470142 2.305787
70 4 2 1.888940 1.666445 1.630860 1.502536 4.039991 3.180350 4.280960 2.498060 3.529479 4.630692
71 4 2 1.236213 1.327578 1.633505 1.283048 1.838459 2.075275 1.588394 1.724706 2.038056 2.159280
72 4 0 1.349361 1.713199 1.453122 1.654382 3.244046 3.826932 2.112007 2.286065 5.996346 8.266164
73 5 0 1.413648 1.871313 1.628660 5.861970 2.304255 5.880867 1.894935 2.170736 2.554174 1.935102
81 7 0 1.528017 1.928570 1.664157 1.186098 2.021100 3.420303 2.514439 2.984526 9.302242 7.812636
82 7 0 1.012087 1.260237 1.257116 1.057864 1.674049 2.213899 1.771008 1.819610 2.867513 2.852917
83 7 0 1.279219 1.256972 1.939506 3.948281 1.886664 2.050883 1.978650 2.062147 3.417626 2.600957
84 8 3 1.505734 1.894120 1.629054 1.505856 2.736145 3.599946 2.221301 2.500155 7.461934 6.002483
85 8 0 1.083904 1.301267 1.572325 1.354693 1.898994 2.469476 2.141428 2.622973 4.039320 5.869823
86 8 0 2.121032 1.467738 2.791393 1.133092 3.674830 3.108197 4.679894 4.172649 4.545858 5.241609
87 8 2 1.252398 1.278154 1.584837 2.265845 1.782236 2.747272 1.747179 4.233004 3.144363 4.694555
88 9 0 2.768388 13.948847 18.883226 52.682516 11.081231 49.303211 5.678908 5.173936 10.099087 3.822321
90 9 0 2.435886 1.432538 8.602752 20.027774 3.688409 2.426205 3.770498 1.963843 4.496335 2.001389
91 9 1 4.724979 6.205519 18.952034 17.020185 7.754640 12.850494 8.751889 5.167184 11.594909 2.925177
92 10 0 4.954195 3.259314 0.729717 1.052610 4.274363 10.660956 3.400659 2.572052 5.383333 3.091622
93 10 0 1.165288 1.181112 1.771641 1.278070 2.464318 2.004280 1.930287 2.016593 4.189169 2.673029
94 10 0 0.981407 1.285290 1.361339 2.237919 1.957244 2.888096 2.088058 2.927178 2.506020 3.347361
98 7 2 1.286724 1.072782 1.695944 1.566998 2.562050 1.962927 2.591240 1.861203 8.875136 3.070961
99 7 2 1.163790 1.530059 1.513576 1.524695 1.886710 2.259288 1.700679 3.203616 4.027263 42.305752
100 7 1 1.860654 1.511969 2.671710 2.252032 2.701767 3.097152 1.957797 1.903027 3.320831 2.965692
101 8 2 1.483928 1.519476 1.562022 1.524844 2.025745 1.824035 1.963316 1.912693 2.814060 3.351421
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 1.505927 1.226888 1.623589 1.225672 1.985987 3.076189 1.997898 2.037721 3.319488 2.276539
104 8 1 2.753503 1.414753 0.324695 1.453761 2.834529 1.852281 3.897677 1.695598 4.791967 2.237275
105 9 1 4.242279 2.909664 22.376540 8.906183 5.634512 10.645757 6.800611 2.722030 14.690698 5.880942
106 9 3 4.319676 5.174459 15.045393 22.578947 6.532186 14.709152 4.500407 3.189164 8.424666 2.878363
107 9 0 6.249516 4.729201 58.791293 62.270890 11.127849 5.118746 9.105107 9.905069 12.863140 10.643899
108 9 1 2.162038 1.217142 11.840053 6.414945 2.746214 1.886862 4.284544 1.827936 4.498048 1.678437
109 10 1 2.218944 1.725990 1.378727 1.436969 5.630300 3.902044 2.006556 1.835846 2.113840 2.491831
110 10 1 3.113645 3.167127 3.297237 1.811943 5.161246 3.836018 3.170292 3.648326 4.360792 3.034151
111 10 1 1.334790 1.342279 1.946901 1.450088 2.601120 2.994636 2.183422 1.692648 2.549397 2.007771
112 10 2 nan nan nan nan nan nan nan nan nan nan
116 7 2 1.122455 1.018192 1.352230 1.313049 1.858125 1.875041 1.654876 1.561516 4.035640 3.046582
117 7 3 nan nan nan nan nan nan nan nan nan nan
118 7 3 nan nan nan nan nan nan nan nan nan nan
119 7 1 0.938846 1.005259 1.310349 1.721713 1.821990 1.753693 1.803630 1.652647 2.967279 3.177103
120 8 1 4.795773 3.928009 13.162902 3.839987 9.372764 15.941907 13.004297 2.289309 40.453262 8.414783
121 8 3 2.369325 2.966827 2.167718 1.285790 6.559441 8.882424 3.789483 2.843320 6.494807 7.571620
122 8 2 2.385044 1.833241 1.894332 1.482816 4.938568 3.185261 2.684014 2.891763 4.934111 8.026743
123 8 3 1.386845 1.416223 1.665017 1.355584 2.095843 1.764467 1.870384 1.660912 3.220045 2.610398
125 9 3 5.010765 4.059228 54.139891 17.205759 17.056998 11.407889 4.375149 2.452413 7.519000 2.678993
126 9 3 4.104473 3.529412 44.933919 12.393574 11.386829 11.121328 6.050365 6.290945 8.234740 5.600564
127 10 2 nan nan nan nan nan nan nan nan nan nan
128 10 2 nan nan nan nan nan nan nan nan nan nan
129 10 3 1.003728 1.246845 1.566918 1.312301 1.725696 1.877379 1.611772 1.764742 2.818752 3.878347
130 10 3 1.377105 1.532694 1.944154 1.304039 2.400866 2.310185 2.018513 1.843422 2.792898 2.831447
135 12 2 1.167987 1.337684 1.680687 1.308633 1.892235 2.412442 2.029997 2.522934 3.044021 3.094574
136 12 2 1.455122 1.334431 2.723721 1.041647 2.112437 2.045798 4.929522 2.356755 3.010840 3.295827
137 7 3 nan nan nan nan nan nan nan nan nan nan
138 7 1 1.046373 4.725418 1.148373 8.280698 2.053834 9.204508 1.940676 4.443948 13.928835 10.691204
140 13 2 3.199467 4.363757 17.832764 44.200533 4.691485 3.594118 4.141094 6.767797 5.069014 10.359745
141 13 2 7.671261 1.358079 15.712697 1.346658 25.962192 2.340921 16.527419 1.610059 14.841028 2.123858
142 13 2 6.574277 3.487303 9.479992 2.167879 14.786748 11.940186 3.669570 1.904115 6.663296 4.640963
143 14 2 1.204477 1.125069 1.773267 1.194783 1.993916 2.115817 1.842163 1.812905 2.917869 4.328767
144 14 3 1.291711 1.470481 1.418668 1.199034 2.319619 1.924447 1.611188 1.597298 1.924801 2.352868
145 14 3 10.530731 4.960619 27.021232 28.055088 34.348701 19.200857 4.036763 1.880318 3.380024 1.785818
150 15 1 nan nan nan nan nan nan nan nan nan nan
155 12 2 3.402211 7.239884 8.906011 30.207425 4.936227 6.058813 4.038052 10.263257 4.688433 3.190375
156 12 3 1.212584 1.526180 1.603647 2.145915 2.484805 2.833030 1.963816 1.794721 2.117006 2.439289
157 12 3 1.239579 1.193320 1.683101 1.400081 2.215336 2.007917 2.037461 1.768755 2.266995 2.226420
158 12 3 1.500089 1.191838 4.037398 1.331878 4.331964 2.852920 3.191986 2.510772 5.378939 5.066013
160 13 3 5.477888 5.973949 19.677473 36.153209 8.148217 11.427246 5.587903 6.079438 5.735691 5.049093
161 13 0 4.208032 1.551249 1.471931 1.861985 6.382641 4.701504 3.397105 2.300146 8.169661 6.748203
162 13 0 1.153322 1.180600 1.687024 1.514424 2.166355 2.188012 2.110372 1.915958 2.079373 3.727568
163 14 2 1.063642 1.082289 1.858935 1.399047 1.890628 1.769163 2.600876 1.871544 2.579560 2.448411
164 14 2 1.128049 1.011903 1.569855 1.140327 2.188162 2.175048 2.191306 2.552060 2.692524 2.512880
165 14 0 4.113732 2.402623 4.005016 3.874813 12.233971 5.441243 3.178981 4.834462 7.171038 12.893237
166 14 0 2.368081 2.285321 1.512739 1.118477 4.661554 5.565625 5.841872 5.165413 6.548083 7.601531
167 15 1 nan nan nan nan nan nan nan nan nan nan
168 15 2 1.928895 1.681432 4.564965 2.552186 2.332179 1.806977 7.748519 11.770235 12.862580 11.231230
169 15 2 1.580359 16.149437 2.793178 75.078471 2.804406 3.625415 4.360851 8.035797 9.322399 11.635416
170 15 2 1.927954 17.667410 3.437234 83.612108 3.960014 15.782431 6.339568 11.804807 10.762079 27.448621
176 12 0 0.952982 1.020323 1.452920 1.325050 1.827646 1.933679 1.978477 1.805588 3.077125 2.275783
177 12 0 1.054998 1.117925 1.476518 1.375175 2.028832 1.866487 1.778614 1.882499 2.287329 2.613619
178 12 0 1.192188 1.168990 1.467775 1.429435 2.104091 2.163550 2.135603 2.620907 3.406627 3.505668
179 12 1 1.667520 1.030821 1.431887 1.317091 2.744769 1.887417 5.720053 2.622892 3.468160 2.867521
180 13 3 2.921399 1.449935 18.509109 1.394453 7.769947 2.735786 4.904940 2.039951 4.399476 2.191733
181 13 3 5.235854 6.529364 1.073227 15.344823 7.530018 10.217524 2.891712 2.032915 2.828908 2.150991
182 13 0 1.052889 1.802473 2.150604 2.646040 2.777298 4.778510 1.770290 2.611911 1.478037 4.319942
183 13 1 1.280641 1.187550 1.329383 1.911742 2.706238 2.215429 1.607780 1.741904 2.274969 3.155290
184 14 0 1.370964 0.992862 1.427401 1.604819 2.047906 1.987967 1.747222 1.813172 3.475573 5.774041
185 14 1 1.086537 1.299464 1.451400 1.999896 1.880789 1.924948 2.006391 3.238690 2.945093 3.425473
186 14 1 1.143461 1.041355 1.150541 1.188603 1.828693 1.994497 1.836441 1.829527 2.886417 3.204994
187 14 1 1.134728 1.488309 1.435174 2.170955 2.085608 3.206364 3.086450 4.142827 5.791840 11.544113
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.306569 1.034349 3.271568 1.557823 3.290742 1.643018 2.309274 1.687959 2.417276 1.953931
206 19 0 1.200965 1.140838 1.656525 2.317375 1.679745 1.962134 2.072470 1.869992 2.274487 1.825737
207 19 1 1.086222 0.904065 1.931004 2.216932 1.910950 1.686355 1.791401 1.819072 1.860566 1.795913
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.095166 1.109805 2.088900 1.948487 1.950370 1.695340 1.909838 1.615825 2.233989 1.718975
224 19 1 1.067757 0.907293 2.010178 2.582719 1.834181 2.081621 5.305582 2.746687 12.360963 7.262490
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.349120 7.071104 11.581572 43.653525 10.792043 12.462462 9.574382 8.884275 7.617436 8.467924
321 2 3 1.737591 1.527688 1.571435 2.346767 2.128833 2.231410 1.683553 2.050852 1.976821 2.071713
323 2 3 1.485312 2.930429 2.668319 5.398661 2.549636 4.959601 1.823566 1.935456 1.859538 3.262162
324 4 3 1.485791 1.961956 1.782528 1.811783 3.087467 4.785224 1.518439 1.691169 1.795746 1.750163
329 12 1 0.980646 1.087227 5.320541 12.865999 1.535584 2.198423 1.822446 1.783211 2.218933 2.138084
333 12 1 1.628890 1.619316 1.970768 1.573005 2.360300 2.967420 1.738602 1.781196 1.915903 1.560948
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 [ ]: