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 = 2459807
Date = 8-15-2022
data_path = "/mnt/sn1/2459807"
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 2459807.25316 and 2459807.33616
372 diff files found between JDs 2459807.25316 and 2459807.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 1.213691 1.311265 1.126923 1.458579 2.443840 2.543944 1.739717 1.846554 1.607470 2.199920
4 1 2 1.155229 2.391145 2.958680 4.275557 2.191492 2.066355 1.715490 1.958114 1.809318 1.993634
5 1 2 0.889072 1.035287 1.778494 1.116600 2.171305 2.186775 2.048240 1.772739 4.039595 4.110596
7 2 0 0.992270 1.042932 1.289290 1.180204 2.387808 2.313793 1.718959 1.781735 1.634776 1.613969
8 2 0 1.320697 5.628543 4.627264 34.153274 2.012791 16.065800 2.140867 7.298629 2.902041 28.170491
9 2 0 1.023043 1.035088 1.240327 1.023590 2.408640 2.576193 2.418204 2.345723 1.744400 1.738429
10 2 1 0.938422 1.154986 1.290878 1.128929 2.217299 2.101117 1.675626 2.276837 1.845770 2.013079
15 1 3 1.057653 1.016206 1.264504 0.932337 2.469225 1.882798 2.184164 1.682050 6.150267 5.003553
16 1 3 1.036753 1.108507 1.390128 1.075198 2.146866 2.343763 1.844937 2.090333 7.483590 7.762936
17 1 3 1.043523 1.045806 1.215386 1.208464 2.699736 2.284618 1.802989 1.791347 1.643037 2.228791
18 1 0 51.930620 38.195975 1.185581 1.232436 247.379680 191.952492 1.537290 1.708939 1.409591 1.819723
19 2 1 1.017930 1.108445 1.259198 1.392874 2.278648 2.149426 1.873797 1.685636 2.258621 3.431327
20 2 1 0.987665 1.050822 1.344073 0.956676 2.597611 2.181645 1.686054 1.813790 1.735957 1.874490
21 2 2 0.910396 0.968113 1.313791 0.986224 1.916157 2.076839 1.760227 1.683635 1.547552 2.038554
27 1 0 3.515515 3.981792 7.568082 11.093116 11.153907 8.501284 3.479338 1.851298 3.342003 1.617986
28 1 0 108.116062 2.066834 0.896205 1.480801 519.828040 9.082241 1.565545 2.092060 1.442796 2.216138
29 1 1 0.979609 1.042103 1.217107 1.173061 2.493117 2.098057 2.597597 2.583200 4.230991 3.303921
30 1 1 1.018906 1.113536 1.460918 1.173330 2.265262 2.311313 2.401877 2.789789 2.179203 4.515744
31 2 2 1.113050 1.122121 1.174510 1.110680 2.322497 2.182739 2.175294 3.374581 2.244783 4.443624
32 2 2 2.129474 2.894760 0.965665 0.983188 3.612195 4.542264 4.136300 5.916429 3.954495 6.740699
33 2 3 41.444657 1.092413 1.101203 1.184547 194.310448 1.857361 1.576200 1.509464 1.503123 1.566364
36 3 3 0.971735 0.935026 1.531880 1.423658 2.593164 2.258637 1.686032 1.766645 1.727580 1.514485
37 3 1 1.041821 1.030481 4.365007 2.026947 2.550317 2.099445 1.918240 1.908852 2.240349 2.587404
38 3 1 0.928557 1.246670 1.464390 1.386810 2.387564 1.979307 1.848296 2.236107 1.585950 1.889935
40 4 1 1.046742 1.226330 1.513009 1.350982 2.285213 2.474307 1.745686 2.057867 1.832510 2.106978
41 4 3 0.952340 0.973769 1.567828 2.688837 2.137652 2.066992 1.770327 1.916183 1.607671 1.895511
42 4 0 1.262084 1.109463 1.281482 1.245616 2.823523 2.162426 1.791591 2.171744 1.891816 3.847626
45 5 0 1.376007 1.054990 1.976416 1.087574 3.967811 1.760320 3.409593 2.005497 2.772261 1.946675
46 5 0 0.927223 1.029586 1.181553 1.263563 1.992579 2.277396 1.885562 1.822316 1.580413 2.003668
50 3 3 0.930342 2.609464 1.869412 1.261785 2.237898 5.988754 1.749603 2.172787 1.695145 2.054629
51 3 2 2.863949 1.138047 6.919121 1.396991 2.183134 1.900179 1.765219 1.884667 1.601778 1.834524
52 3 3 1.038821 1.026801 1.425512 1.582638 2.724325 2.757892 2.160828 2.369645 2.096103 2.069096
53 3 2 0.905469 1.272567 1.414185 2.127496 2.348168 3.113303 1.879048 2.680053 2.822662 2.940265
54 4 0 1.049778 1.056988 1.203164 0.939636 2.644632 2.425699 1.856270 1.774763 2.675940 2.511261
55 4 2 1.010477 1.063662 1.382259 0.992317 2.156383 2.289909 1.864603 2.067115 2.174038 1.745354
56 4 1 1.084297 1.157074 1.160764 1.427354 2.764964 2.388652 2.100984 2.010573 2.617724 2.579473
57 4 3 1.965921 1.949732 1.885968 8.115557 6.582793 1.623406 2.129061 1.854746 1.955896 1.875263
65 3 0 1.041498 0.965220 1.681144 1.047191 2.716488 1.907991 1.893712 1.784608 1.798571 1.597245
66 3 0 1.339460 1.123511 2.528231 1.324865 3.205606 1.948694 2.413947 1.704873 2.252784 1.877118
67 3 0 0.960808 1.180812 1.243376 1.320436 2.462223 2.198993 1.717937 1.930573 1.776493 1.708834
68 3 1 1.010207 1.122343 1.729074 1.386317 2.386909 1.858294 1.738943 1.736044 2.075107 2.025221
69 4 1 0.926504 0.933831 1.369217 1.305484 2.145431 2.083473 1.847039 1.808448 1.877103 1.764185
70 4 2 1.222490 1.483509 1.463475 1.481851 3.223879 4.338047 4.158501 2.663530 2.235952 2.605464
71 4 2 1.303969 1.191713 1.398503 1.245083 2.207713 1.898280 1.794438 1.595664 1.675064 1.571394
72 4 0 1.098921 1.430375 1.207281 1.543440 2.253619 3.247360 1.596909 2.505373 5.395307 7.764057
73 5 0 1.057432 1.978747 1.517430 5.233995 2.335262 4.299972 1.866279 1.925340 2.321402 1.867998
81 7 0 1.276143 1.134021 1.840054 1.152934 2.618402 2.318646 2.160682 1.722775 10.087960 3.038375
82 7 0 0.899953 1.085324 1.122040 0.926196 1.800191 1.716911 1.516946 1.546549 2.153627 2.843871
83 7 0 1.035685 1.069065 1.649229 2.882429 2.356535 1.677391 2.007157 1.943537 1.828006 1.708051
84 8 3 0.971022 1.083435 1.342960 2.619463 2.137309 2.282433 1.665981 2.127927 6.177163 8.068893
85 8 0 0.977571 1.136100 1.273959 1.265803 2.415697 2.302156 2.161574 2.646522 3.037938 4.217425
86 8 0 1.526918 1.279622 2.014473 1.067753 2.908069 2.139696 3.664351 3.609058 2.482280 2.997313
87 8 2 0.867668 0.924642 1.610579 1.548329 2.094078 1.960922 1.758546 2.542287 2.057075 2.273890
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.063259 2.297669 0.622390 1.002540 4.096951 8.616175 2.849278 2.269133 2.848134 2.547325
93 10 0 0.968424 1.157190 2.165721 1.087096 2.189494 2.323816 1.841232 1.927502 2.416369 1.712539
94 10 0 0.961433 1.162562 1.287801 2.283377 2.363789 2.886224 2.090440 3.204320 2.131246 3.494500
98 7 2 0.949785 0.974166 1.385560 1.230572 2.357231 1.826123 2.299736 1.898123 5.418557 2.080020
99 7 2 1.003044 1.028379 1.368110 1.608610 2.214905 2.175673 1.771309 2.137562 2.635285 21.557939
100 7 1 1.373812 1.179373 1.782870 1.375150 3.119537 1.994774 1.973243 1.624656 2.125821 1.632741
101 8 2 1.085819 1.029714 1.331137 1.578999 2.488126 2.200320 1.935807 1.842053 1.714483 2.224218
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.048239 0.959405 1.246988 1.058686 2.457757 1.961598 2.090128 1.825406 2.793464 1.781246
104 8 1 1.805179 0.903937 0.264432 1.230043 2.416609 2.257684 3.259455 1.735699 2.917926 1.793629
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 2.024775 1.959615 1.577468 1.329901 5.069397 3.670283 2.177711 1.982315 2.111928 1.996302
110 10 1 0.991305 2.146078 1.671587 1.522935 3.089835 3.880681 1.548911 3.037096 1.718040 2.453707
111 10 1 6.379589 1.106955 1.687717 0.963277 2.608775 1.830022 1.971939 1.348757 1.659622 1.423117
112 10 2 0.962261 1.287706 1.510990 1.109906 2.193385 1.982081 1.832410 1.656892 1.932271 1.577807
116 7 2 1.026068 1.024792 1.224638 1.032725 2.206708 2.266032 1.495332 1.842586 1.914412 1.869559
117 7 3 0.946616 1.137758 1.328188 1.408095 1.878721 1.804447 1.519899 2.218770 1.850555 3.083777
118 7 3 2.007943 0.944216 4.458984 1.423009 2.678075 2.240852 3.242409 2.024797 3.311983 2.952823
119 7 1 0.829062 0.868030 1.162858 1.456699 2.026306 2.217050 1.759284 1.691862 1.842834 1.849383
120 8 1 6.248727 1.805614 10.980808 2.511333 7.202262 7.218754 8.782725 2.005169 21.507861 2.460261
121 8 3 1.852871 1.766180 1.947196 1.299686 5.402107 5.476261 3.346185 2.502056 4.146530 6.430062
122 8 2 1.779865 1.330719 1.671131 1.248874 5.290278 3.578709 3.282947 2.063098 4.326912 4.839609
123 8 3 0.873096 0.799969 1.350217 1.222407 2.180679 1.901118 1.777606 1.775263 2.205373 1.801212
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.488230 1.714982 1.799716 1.171875 3.947091 3.790688 4.297971 4.319368 5.896858 6.036592
128 10 2 1.219433 1.161182 1.499210 1.164859 2.194258 2.158977 1.914144 1.863627 2.226283 2.340779
129 10 3 0.943365 1.014091 1.239513 1.008539 2.049096 2.165828 1.698824 1.759963 1.529905 1.571153
130 10 3 1.452835 1.526703 1.967120 1.626369 3.047862 2.112915 2.252225 1.778370 2.308924 1.747531
135 12 2 1.101010 1.114586 1.543968 1.029281 2.672925 2.077263 1.923713 2.196015 1.654548 1.667485
136 12 2 1.147227 1.075363 1.927683 1.175432 2.738251 2.112922 4.004851 2.692276 2.601737 3.025677
137 7 3 3.640703 1.666356 20.432718 16.588706 11.438990 4.149274 4.387358 2.451467 6.148644 1.924854
138 7 1 0.969392 2.833809 1.128563 5.944333 2.235896 6.421951 1.971414 3.288417 7.128705 5.490265
140 13 2 3.180879 5.100301 10.651845 29.869363 3.212982 4.176984 2.502554 4.324700 3.590815 7.235638
141 13 2 5.411982 1.023661 8.098322 1.225927 19.562729 2.097665 11.813734 1.847859 9.114105 2.262523
142 13 2 4.869711 2.194478 7.234022 1.865656 11.719306 8.970685 2.668762 2.047189 3.842256 4.645343
143 14 2 1.102952 1.040561 1.496502 1.148915 2.089758 1.842935 1.880476 1.664248 1.692882 1.632472
144 14 3 0.945854 1.160855 1.032871 1.132673 2.360777 2.378480 1.769089 1.859913 1.735604 1.966231
145 14 3 6.614986 6.405147 22.627806 23.181591 22.789622 18.704781 3.088570 2.043969 2.988490 2.003159
150 15 1 2.733224 6.492043 21.949635 40.340443 4.554980 10.121811 3.685081 7.508812 5.269759 11.746215
155 12 2 2.752709 2.588998 7.740337 21.823879 3.621888 4.210348 3.092554 3.054713 3.411021 2.072105
156 12 3 0.954525 1.073439 1.128011 1.397373 2.403470 2.485194 1.689881 1.912366 1.466501 1.765974
157 12 3 1.068974 1.091211 1.576702 1.051330 2.743047 2.381815 1.992391 1.667620 1.701191 1.651960
158 12 3 1.002905 1.135310 2.198702 1.169721 2.642821 2.219519 2.241960 2.116639 3.304229 3.361062
160 13 3 4.198065 6.788670 17.849763 55.350162 6.390376 7.690297 5.680925 14.892501 7.902397 20.334453
161 13 0 2.997608 1.513683 1.917569 1.177696 4.348267 2.321075 2.826870 1.916028 6.305851 3.425757
162 13 0 1.058012 1.064830 1.312953 0.987703 2.424224 2.093322 1.953755 1.792738 1.803406 3.915102
163 14 2 0.884394 1.015558 1.338539 1.240354 2.413159 2.223737 2.191885 1.831483 1.872351 1.996433
164 14 2 1.053508 0.935714 1.359419 1.214298 2.606239 2.222798 1.825764 2.301956 1.761533 2.185197
165 14 0 2.533795 2.376993 2.808276 2.798124 7.499404 6.173982 2.895154 5.445502 4.459178 6.566767
166 14 0 1.952991 1.599067 1.099068 1.024842 4.578101 4.795935 4.823805 3.800485 3.893847 4.072282
167 15 1 1.588749 1.529067 2.359931 2.090119 2.883132 2.852363 2.119326 2.099098 2.276184 1.614670
168 15 2 1.277236 0.963237 4.736240 2.268805 2.021380 1.564377 3.492110 3.555901 4.786888 3.372324
169 15 2 1.217674 4.992176 4.056951 35.429125 2.050552 2.279956 2.492787 4.046068 4.959241 7.005057
170 15 2 1.288640 5.882547 3.209702 40.635386 2.455277 6.856474 2.693198 4.562783 4.754164 11.019219
176 12 0 0.873967 0.913459 1.406359 1.164683 2.557003 1.993156 1.897010 1.885987 1.801610 1.746528
177 12 0 1.020436 0.961845 1.480780 1.067739 2.403657 2.231870 1.841726 1.687707 1.915271 1.874497
178 12 0 0.995867 1.037481 1.268621 1.220180 2.401979 2.149389 1.788677 1.924217 1.911759 1.863171
179 12 1 1.219487 0.921728 1.188135 2.581494 2.611530 2.091523 4.179427 2.031005 2.746953 1.794069
180 13 3 2.031542 1.050343 10.938616 1.142556 5.817123 2.573599 4.125507 1.782960 3.944752 1.880282
181 13 3 2.089681 4.801098 0.875870 11.867809 6.999193 8.133923 2.646065 2.001231 2.584074 1.982363
182 13 0 1.080804 1.383795 1.547092 2.228372 2.145879 3.222523 1.693985 1.868599 1.719097 2.480374
183 13 1 1.129563 1.059406 1.343261 1.062465 3.279765 2.163162 1.687821 1.802650 2.072838 2.144585
184 14 0 1.277138 0.994190 1.382420 1.210522 2.233197 2.129082 1.849571 1.698239 2.157954 2.961008
185 14 1 1.013316 1.087687 1.134950 1.653895 2.337093 2.450323 2.289571 3.399821 2.285671 2.391906
186 14 1 1.005663 1.001868 1.025216 0.943489 2.078999 1.948068 1.757674 1.623900 1.665830 1.671612
187 14 1 0.926480 1.026875 1.573373 1.944699 2.368033 2.349444 1.934211 2.723135 2.221980 3.706810
189 15 3 0.935964 0.966355 1.382798 1.098801 2.385739 2.188972 1.772499 1.690394 1.608201 1.698910
190 15 3 2.765867 1.406835 11.175575 0.862255 4.173107 3.326696 3.052692 2.413973 3.022626 4.257890
191 15 3 0.952712 1.036082 4.640422 3.286313 2.061843 2.412389 2.313214 1.957217 3.090272 2.686173
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.220041 0.836825 3.076028 1.696471 3.846107 1.947715 2.744124 1.907309 2.442354 1.921407
206 19 0 0.874194 0.891662 1.557556 1.428466 1.674205 2.379057 2.039366 1.825928 2.079256 1.626862
207 19 1 0.909379 0.836738 1.814460 2.147419 1.976140 1.955268 1.672971 1.901377 1.694443 1.926314
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.646451 1.959006 1.575217 2.021816 3.097456 2.435898 1.687983 1.856850 1.485713 1.947156
224 19 1 0.945351 0.785415 3.278129 1.959857 1.829478 1.448314 3.442684 1.801613 6.421259 3.148136
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.965733 6.138278 6.740430 29.044632 7.142454 8.349875 6.051146 5.372008 10.929937 14.724183
321 2 3 2.160737 2.108591 1.804092 2.210216 2.424681 2.353419 1.700353 1.733565 1.614042 1.785784
323 2 3 1.108444 1.529548 5.349717 6.647005 2.826267 3.672227 1.763786 1.986054 1.796033 2.020944
324 4 3 0.840859 0.969433 2.191356 2.194653 2.242223 2.978784 1.623019 1.825558 1.881045 1.790173
329 12 1 0.876334 1.177255 1.883299 1.136753 2.190922 1.991181 1.846620 1.696552 1.681558 1.541514
333 12 1 1.580293 1.370108 2.801359 1.612999 2.524282 2.606583 1.752831 1.733502 1.729285 1.750207
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 [ ]: