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 = 2459803
Date = 8-11-2022
data_path = "/mnt/sn1/2459803"
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 2459803.25316 and 2459803.33616
372 diff files found between JDs 2459803.25316 and 2459803.33616

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 nan nan nan nan nan nan nan nan nan nan
4 1 2 nan nan nan nan nan nan nan nan nan nan
5 1 2 nan nan nan nan nan nan nan nan nan nan
7 2 0 1.027180 0.912895 3.472133 2.377259 1.952769 1.651543 2.034769 1.625796 1.777129 1.564713
8 2 0 1.493423 4.710410 5.823019 25.681144 2.800354 13.379936 4.846674 6.637665 6.428013 23.972020
9 2 0 0.884090 0.938140 1.193320 1.023801 1.705037 1.823363 1.617425 1.623410 1.360358 1.528830
10 2 1 0.899368 1.223825 1.117097 1.120764 1.992222 2.047853 1.918611 2.044993 1.623567 1.897323
15 1 3 0.859643 1.075533 1.127644 1.054018 1.561381 1.892944 1.629425 1.859028 2.230822 2.262237
16 1 3 0.900864 0.926260 1.312531 1.014529 1.753237 2.022296 1.757936 1.748446 3.454507 2.250696
17 1 3 1.023695 0.840328 1.073033 0.976585 2.239918 1.888388 1.737935 1.551516 1.839844 2.003981
18 1 0 33.157442 15.028902 14.756209 6.415398 147.725157 64.354836 1.489525 1.620167 1.514565 1.604466
19 2 1 0.849176 1.010118 1.253161 1.791025 1.861372 1.986855 1.855798 1.975400 1.646253 2.412716
20 2 1 0.871403 0.935065 1.267169 0.859792 1.713576 1.632116 1.657925 1.578513 1.448377 1.440599
21 2 2 0.839329 0.889538 1.185455 0.875989 1.779686 1.443267 1.728760 1.614131 1.466988 1.693532
27 1 0 2.536677 5.382657 7.109041 18.924261 9.706294 5.907590 2.944372 2.174530 2.910396 1.851359
28 1 0 75.900356 4.717583 26.784125 1.453325 375.591235 24.662016 1.766672 2.055798 1.769023 2.271081
29 1 1 1.129693 1.197658 1.946052 1.171802 2.274231 2.300473 2.716074 2.705418 4.663842 3.356319
30 1 1 0.956446 0.971497 1.288951 1.203595 1.971145 2.080570 2.749334 2.862119 1.928354 3.855677
31 2 2 1.009594 1.281721 1.280271 1.233638 1.821878 2.050694 2.408924 4.838794 3.075174 9.167408
32 2 2 1.496430 2.374587 0.992855 1.226836 2.487685 1.965758 4.603961 5.676682 4.840135 6.468143
33 2 3 34.025793 1.064929 16.982551 1.255478 175.001042 1.868658 1.780264 1.944373 1.637441 1.797621
36 3 3 0.917035 1.084238 1.427617 1.319384 1.735914 2.094701 1.843484 1.939688 1.361570 1.537504
37 3 1 0.919086 0.947295 3.990611 2.041973 2.301651 1.865748 1.895717 2.004095 2.523082 2.684950
38 3 1 0.913235 1.134921 1.407367 1.241706 1.807317 2.184356 1.846431 2.028654 1.695378 1.942347
40 4 1 0.876655 1.107148 1.458392 1.294399 1.858144 2.063261 1.854335 2.050561 1.629530 1.944077
41 4 3 1.055004 1.052204 1.349431 2.873649 2.121025 2.872159 1.836097 1.818772 1.670806 1.928035
42 4 0 1.105367 1.023935 1.032788 1.247891 2.393352 1.923566 1.660034 2.032506 1.820365 3.622534
45 5 0 1.051414 1.175671 1.753205 1.096530 2.690084 2.164724 2.753731 2.100415 2.396215 2.318239
46 5 0 0.918073 0.953155 1.146478 1.289967 1.955750 1.784502 1.988828 1.759571 1.656551 1.616223
50 3 3 0.979805 0.965254 1.075867 1.231628 1.941471 2.274574 1.822941 1.965331 1.863125 1.655420
51 3 2 4.676361 0.970716 4.102006 1.534975 1.718120 1.937408 1.707817 1.672240 1.507656 1.546227
52 3 3 0.931111 1.094340 3.592130 1.871935 1.914156 2.553264 1.845327 2.221732 1.688628 1.958771
53 3 2 0.935777 1.199821 1.304739 1.406613 1.813100 2.185813 1.738782 1.953037 2.692569 2.363269
54 4 0 0.944343 1.041679 1.101104 1.071206 2.015932 2.266526 1.686266 1.925234 2.071086 2.226694
55 4 2 0.919432 1.061144 1.457746 1.082663 1.900827 3.149306 2.168484 1.871848 2.084777 1.671165
56 4 1 1.009067 1.131283 1.259056 1.493059 2.143332 2.767377 1.732761 1.886869 1.727233 1.694074
57 4 3 3.171932 1.988632 1.733079 8.913372 14.451222 2.279417 2.077063 2.118604 1.965004 1.956727
65 3 0 0.921316 0.996033 1.403039 1.045135 1.629061 1.828300 1.760626 1.625827 1.455914 1.457860
66 3 0 0.991042 0.938207 1.883626 1.151676 2.326829 1.700492 2.100314 1.648842 1.879086 1.552269
67 3 0 0.801339 0.976252 1.100758 1.250506 1.567944 2.045757 1.460712 1.735608 1.426233 1.679918
68 3 1 0.947703 1.095238 1.350190 1.384482 1.738914 2.334186 1.765258 2.104047 1.689867 1.908895
69 4 1 0.925662 0.971824 1.547590 1.093086 1.990691 1.960209 1.890783 1.918194 1.871153 1.633246
70 4 2 1.345526 1.286484 1.385816 1.477418 2.995019 3.473091 3.596735 2.912545 2.144633 3.026069
71 4 2 1.032108 1.015374 1.402326 1.187438 1.675064 2.159610 1.704767 1.789352 1.484721 1.434718
72 4 0 1.074998 1.543979 1.550222 1.372578 2.543033 4.768958 2.070169 2.371993 4.357155 6.600888
73 5 0 1.055942 1.705463 1.394025 4.585143 1.956713 3.061918 1.695344 1.656284 1.968955 1.737565
81 7 0 1.314425 1.044719 1.763337 1.149432 2.173762 2.127981 2.329084 1.853287 9.110790 3.058939
82 7 0 0.822949 1.089651 1.290367 0.946096 1.819284 1.885147 1.858482 1.582253 1.895462 1.791124
83 7 0 0.888751 0.985192 1.655503 2.087085 1.748428 1.801014 1.925015 1.937719 1.754175 1.695588
84 8 3 0.985944 1.163561 1.313461 2.847896 1.895417 2.094352 1.841847 1.989021 3.045378 4.125260
85 8 0 0.902680 1.066365 1.490888 1.180948 1.943442 1.880329 1.943508 2.468723 2.325819 3.038792
86 8 0 1.587075 1.169192 1.843741 1.289528 2.836444 2.069030 3.395380 4.992409 3.200066 4.584245
87 8 2 0.847589 1.178123 1.489459 1.737862 1.777661 1.931872 1.829924 2.140838 1.786301 2.052286
88 9 0 2.210057 6.299812 14.131566 36.506731 5.437995 18.718222 4.013600 3.891023 5.777271 2.245330
90 9 0 1.879907 1.246291 6.736425 13.788328 2.596565 2.000875 2.663154 1.941173 2.925575 1.974008
91 9 1 3.574092 3.426258 12.462318 14.019739 4.439702 8.745019 5.698296 3.831610 7.419207 2.556280
92 10 0 4.505352 2.227801 0.599424 0.793979 21.358713 8.243706 2.638488 1.940908 2.377047 2.420076
93 10 0 1.167534 0.855971 1.286463 1.278939 1.875197 1.917413 1.647635 2.011305 1.564274 1.973696
94 10 0 0.935635 1.197886 1.511013 2.319998 2.203458 3.128914 2.561021 2.652462 2.367975 3.600921
98 7 2 0.942531 0.912856 1.240195 1.275087 2.137981 1.777779 2.291975 1.633591 4.866445 1.524052
99 7 2 0.897272 0.905499 1.534055 1.566579 2.169038 2.006728 1.911970 1.824857 2.935675 9.015706
100 7 1 1.436512 1.208327 2.106296 1.745298 2.586782 2.239003 1.806036 1.768165 1.767455 1.872677
101 8 2 0.926051 0.970143 1.443230 1.531453 1.916331 2.031489 1.784030 1.951659 1.559001 2.040703
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.001476 0.937603 1.352622 1.070354 2.114031 1.720860 1.796207 1.770541 2.320684 1.548613
104 8 1 1.892542 0.949302 0.319790 1.338757 2.497909 1.811424 4.266876 1.770615 3.525372 1.465400
105 9 1 1.968996 2.478970 14.290459 7.430642 3.433557 7.869297 4.364075 2.164777 9.304835 2.868591
106 9 3 2.786579 2.822200 10.963214 16.340538 4.368924 7.956019 3.290510 2.840800 5.748678 2.610535
107 9 0 4.147342 3.153934 37.600741 41.731777 7.191125 3.217078 5.471348 5.961101 7.306975 6.103052
108 9 1 1.786764 1.271973 9.150033 5.077406 2.395923 1.882572 3.524240 1.905064 3.490167 1.861850
109 10 1 1.476797 1.298399 1.399898 1.248997 4.007316 3.339227 2.149446 1.956503 1.690762 1.992287
110 10 1 1.183525 0.974338 1.400901 1.774325 1.784990 1.883882 1.873460 2.020867 1.539228 1.651749
111 10 1 0.991023 1.115708 1.525011 1.145614 2.234196 2.173791 1.896830 1.778074 1.793691 1.691882
112 10 2 0.925194 1.119856 1.379964 0.943335 2.005132 1.875413 1.619668 1.628560 1.716862 1.480161
116 7 2 1.021329 0.893285 1.159272 1.180116 1.865971 1.873742 1.760194 1.694278 1.791457 1.697717
117 7 3 1.026538 1.155939 1.526134 1.315881 1.787416 1.818992 1.871795 2.254441 2.274724 3.429824
118 7 3 1.772694 0.943668 3.913060 1.288364 2.378801 1.961278 3.035615 1.872868 3.159303 2.059587
119 7 1 0.825440 0.788894 1.376861 1.414649 1.898026 1.721525 1.854409 1.703214 2.047871 1.939051
120 8 1 3.560830 2.154384 11.100886 2.499672 6.074061 10.133620 9.135359 1.695125 22.974965 1.754385
121 8 3 1.543099 1.745281 2.180347 1.026412 4.013712 3.711171 2.872312 2.059470 4.421681 5.288615
122 8 2 0.904540 0.866653 1.814867 1.227596 1.815611 1.656133 1.778912 1.807786 1.886909 1.751157
123 8 3 0.959192 0.904306 1.472426 1.240108 1.802827 1.892062 1.836429 1.748187 1.511521 1.746710
125 9 3 3.828988 2.034254 38.581012 12.397976 11.230293 5.526561 2.909187 2.158600 4.866740 2.250563
126 9 3 3.019774 2.384902 36.859899 9.498248 5.581269 7.204679 5.157122 4.502761 5.712814 3.834119
127 10 2 1.481368 1.645023 2.126005 1.513248 3.791165 5.424823 4.624017 4.803288 5.238161 6.238627
128 10 2 1.095041 1.081205 1.470606 1.155906 1.903584 2.203526 2.025794 2.067655 1.979198 2.062079
129 10 3 0.852762 0.951169 1.134891 0.972418 1.648002 2.026116 1.650468 1.865291 1.459476 1.638869
130 10 3 1.184855 1.376203 1.669429 1.409205 2.440239 2.447540 2.103541 1.772712 2.280642 1.592048
135 12 2 0.932064 1.015551 1.087395 1.056185 1.827594 1.988840 1.777002 2.016309 1.492557 1.572595
136 12 2 1.031787 1.025557 2.466039 1.171002 2.111328 1.854480 3.465587 2.383664 1.781067 2.410297
137 7 3 3.460144 3.418658 16.524531 18.939550 8.768850 5.864838 3.789765 2.708750 6.447699 2.368323
138 7 1 0.952626 2.721195 1.227268 5.507269 2.042955 4.673837 1.897253 3.439032 5.732026 6.308457
140 13 2 2.736386 5.684275 9.233420 39.898791 3.446697 2.443324 4.226651 12.054542 4.073960 24.592707
141 13 2 2.315221 1.036636 4.525344 1.170770 8.356513 2.184795 5.144224 1.738057 4.122301 1.802802
142 13 2 5.593791 3.388123 8.370194 1.623892 7.393167 16.118274 2.730811 1.741849 3.866560 3.314245
143 14 2 0.984205 0.850995 1.626745 0.955609 2.164945 1.632075 1.910455 1.705626 1.776875 2.082711
144 14 3 1.021575 1.067507 0.960316 1.213508 2.191418 2.042303 1.515393 1.686506 1.677886 2.070157
145 14 3 3.684468 4.649662 20.884531 19.841623 15.388375 15.062627 3.026933 2.076528 2.459482 1.818840
150 15 1 2.558150 4.362082 20.525558 40.005148 3.837232 5.894155 3.680765 7.807081 5.137913 11.168436
155 12 2 2.646261 4.456741 6.731931 19.553055 2.916900 3.763739 2.800899 4.064954 3.248656 1.833750
156 12 3 nan nan nan nan nan nan nan nan nan nan
157 12 3 nan nan nan nan nan nan nan nan nan nan
158 12 3 nan nan nan nan nan nan nan nan nan nan
160 13 3 5.098115 11.792436 16.071274 75.834705 6.311120 11.249958 5.613442 22.494903 7.604892 42.349835
161 13 0 3.054522 1.316923 2.252924 1.121294 6.017412 2.234154 3.386446 1.735825 6.688631 3.795275
162 13 0 0.878967 0.908070 1.482471 1.088836 1.915743 1.975423 1.795805 1.627611 1.528243 1.579260
163 14 2 0.912377 1.011044 1.226896 1.117103 1.851983 2.016897 1.738148 1.815285 1.767043 1.575088
164 14 2 0.929605 0.888225 1.333654 1.306870 1.820124 1.813051 1.866507 2.396652 1.642610 1.715190
165 14 0 3.177785 2.084588 3.493241 5.594078 10.574349 5.393355 2.650186 4.230551 5.530561 5.451246
166 14 0 0.942933 1.155866 1.404947 0.949948 2.779123 1.897316 2.087609 2.005237 1.935775 2.427329
167 15 1 2.058520 3.182408 4.291554 7.022778 3.148599 2.198419 3.446086 2.457779 4.843480 3.666011
168 15 2 1.659198 1.247119 6.561771 5.830648 2.850936 1.593177 5.672921 3.190004 7.511584 4.119962
169 15 2 1.696307 4.483068 6.411709 35.394841 2.817990 2.358825 5.404441 7.494174 9.697509 10.899127
170 15 2 1.831003 6.402520 6.198391 45.889294 3.465646 4.990938 4.745632 8.183266 9.991548 11.092080
176 12 0 nan nan nan nan nan nan nan nan nan nan
177 12 0 nan nan nan nan nan nan nan nan nan nan
178 12 0 nan nan nan nan nan nan nan nan nan nan
179 12 1 1.129560 0.914875 1.119218 1.417116 2.050048 2.359749 4.142571 2.071109 2.298204 1.930669
180 13 3 1.939425 0.982537 9.733190 1.283505 5.239500 2.509640 3.739793 1.995705 3.207548 1.892214
181 13 3 5.533564 4.847553 0.991729 12.524237 27.908855 7.190922 2.139484 1.976817 2.080978 2.423593
182 13 0 6.504858 1.324303 16.272988 5.459187 18.355236 2.997922 3.700015 2.296436 3.688551 3.900675
183 13 1 0.982568 0.989810 1.330402 1.179490 2.301612 1.886031 1.511518 1.821338 1.753102 2.209812
184 14 0 0.925171 0.938935 1.151736 1.134384 1.530660 1.766294 1.726081 1.785119 1.445003 2.133511
185 14 1 0.866623 1.370865 1.104580 1.670988 1.786340 2.501486 1.756750 2.154053 1.583191 1.537317
186 14 1 0.868546 1.146053 0.857657 1.323578 1.582239 2.043271 1.601239 2.024196 1.360728 2.177594
187 14 1 0.895013 1.028788 1.294343 2.059762 2.068889 2.341879 2.230725 2.878075 4.437658 7.540974
189 15 3 0.850732 1.010067 0.969142 1.236251 1.576858 1.909298 1.423109 1.731956 1.354392 1.708626
190 15 3 2.671239 1.401973 11.355770 0.786078 3.657256 3.026158 3.146798 2.410771 3.229749 3.517852
191 15 3 0.914632 0.945062 1.508668 1.199816 2.118849 2.047987 1.932891 1.907046 1.822516 1.585724
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.680819 0.886371 4.226306 1.711092 5.408162 2.094870 3.867646 1.773366 2.966193 1.860893
206 19 0 1.055076 0.975705 1.791392 1.454942 2.002429 1.805129 1.937681 1.732084 1.964369 1.611499
207 19 1 0.876356 0.857529 1.958030 1.829869 1.633707 1.843338 1.823955 1.838665 1.826387 1.851024
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.905047 0.914483 1.329216 1.411211 1.640941 1.817493 1.580993 1.668025 1.547688 1.677733
224 19 1 1.458661 1.103031 7.363544 4.453447 2.659508 2.071004 6.095774 3.935207 9.850548 5.199704
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.524586 8.684066 13.292408 25.627186 6.964964 6.317916 6.486680 3.679381 5.672329 3.068665
321 2 3 2.086034 1.499961 1.834675 1.686695 2.202969 1.686122 1.832024 1.768142 1.692899 1.724266
323 2 3 0.836667 1.118511 2.140818 3.727456 1.513775 2.871412 1.800159 1.819214 1.851965 1.863016
324 4 3 0.825897 0.871426 2.231545 1.907530 1.574128 1.496749 1.597662 1.562182 1.763883 1.637107
329 12 1 2.934162 5.478342 4.693787 16.294318 1.879074 2.136074 1.844412 2.682838 1.681650 1.829607
333 12 1 1.062428 1.326532 2.575901 1.407846 1.625135 2.012263 1.690475 1.737378 1.452250 1.554636
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 [ ]: