In [1]:
import os
os.environ['HDF5_USE_FILE_LOCKING'] = 'FALSE'
import h5py
import hdf5plugin
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 = 2459830
Date = 9-7-2022
data_path = "/mnt/sn1/2459830"
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 2459830.25328 and 2459830.33627
372 diff files found between JDs 2459830.25328 and 2459830.33627

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 10*log10($|\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 0.926043 0.988425 1.460037 2.618908 1.973780 2.108242 1.841472 1.875045 1.928281 3.464857
8 2 0 2.467882 14.349117 13.392438 27.533122 4.538963 56.762280 4.669974 73.677257 7.065250 84.666804
9 2 0 0.900830 0.951089 3.539449 1.279480 1.946226 1.869212 1.878473 1.884639 1.565838 1.723567
10 2 1 0.930986 1.034180 1.449298 1.534062 1.894923 2.083513 1.695626 2.237915 1.688377 2.120631
15 1 3 1.149167 1.235709 1.458053 1.550554 2.086058 2.063389 1.983228 1.728757 3.371770 2.708342
16 1 3 0.896675 1.107140 1.459419 1.346372 2.022653 1.980788 1.834611 1.891576 4.702971 2.077383
17 1 3 0.941747 1.160903 1.583910 1.409487 2.069695 2.143320 1.611590 1.657111 1.690049 1.861608
18 1 0 58.357960 18.398676 2.615531 2.039934 267.111795 68.974329 1.481988 1.540750 1.444565 1.624750
19 2 1 1.018253 1.074990 1.460001 1.663945 1.965659 1.837268 1.716744 1.700399 1.529581 3.258645
20 2 1 0.910603 1.030025 1.349272 1.380334 1.971047 1.952855 1.614407 1.649115 1.584640 1.698575
21 2 2 0.891750 0.816207 1.364757 1.468620 1.906445 1.979686 1.843110 1.941053 1.727116 1.979173
27 1 0 2.546392 2.643089 6.448812 13.622587 13.101497 6.235695 3.651977 2.224347 3.718496 2.310139
28 1 0 45.920841 1.589344 2.402819 1.491810 228.172260 2.452244 1.704363 2.168232 2.100422 3.210114
29 1 1 1.401592 0.990297 3.314890 1.405707 2.745567 1.823942 2.967487 2.375266 4.964032 2.975988
30 1 1 0.986722 1.052032 1.316721 1.429574 1.622547 1.843876 2.038046 2.622560 2.823435 6.255224
31 2 2 0.944147 1.338715 1.192073 1.363127 1.788543 2.047337 2.208682 4.972478 2.486360 7.514960
32 2 2 1.719048 1.497857 1.373983 0.885188 2.729688 2.481521 5.495535 5.483729 5.121259 5.980191
33 2 3 87.406025 0.939778 2.183548 2.155660 389.311106 1.780049 1.531455 1.663322 1.556743 2.319477
36 3 3 1.569255 1.324396 1.942141 1.422619 3.087302 2.055713 2.128123 1.660164 1.861768 1.799366
37 3 1 0.989643 0.924658 1.601621 1.510148 2.177293 2.131195 1.833925 1.745109 1.802068 1.847267
38 3 1 0.968267 0.918423 1.440249 1.398015 1.841698 2.207689 1.695654 2.029007 1.536797 1.926448
40 4 1 0.970614 1.184998 2.218408 1.304524 2.189131 2.220641 2.118297 2.076485 1.736126 2.138464
41 4 3 1.070262 1.332075 1.349593 1.650497 1.939006 2.213922 1.519138 1.818736 1.407001 1.568326
42 4 0 0.934300 0.971336 1.407193 1.386303 2.101444 1.936031 1.852109 1.823933 2.153560 2.984049
45 5 0 1.046970 1.159007 2.415578 1.323768 2.388396 1.595222 2.412340 1.932955 2.147909 1.598488
46 5 0 1.243705 1.167651 1.810859 1.447131 2.859959 1.903426 1.953356 1.475141 1.901768 1.749032
50 3 3 0.889988 0.988472 1.368234 1.069139 2.007437 1.808260 1.522534 1.594117 1.433310 1.670390
51 3 2 1.255374 0.902150 17.234281 1.516855 1.758851 1.981164 1.789406 1.689081 1.522709 1.952698
52 3 3 1.398159 1.568284 1.416889 2.006822 2.006830 2.450113 1.923145 2.033692 1.625610 1.823275
53 3 2 1.052092 1.487565 2.143934 2.361485 2.186808 4.489702 1.866750 2.622011 2.250232 2.844730
54 4 0 1.013474 0.857201 1.282946 1.430278 2.234537 2.024490 2.171023 1.632197 2.030496 2.216663
55 4 2 0.892318 0.980091 1.403482 1.228128 1.949068 2.067182 1.678876 1.834185 2.077450 2.039828
56 4 1 1.093212 1.361868 1.252883 1.338497 2.118261 2.166463 1.894614 1.863559 2.298952 2.554435
57 4 3 0.971934 1.283385 1.648498 2.077840 2.089871 3.358121 1.880671 1.866018 1.689202 2.322936
65 3 0 1.099621 0.938755 1.797427 1.344238 2.561273 1.725748 1.746074 1.570924 1.773936 1.526282
66 3 0 1.096026 1.034825 2.029413 1.643458 2.303135 1.955741 1.907676 1.646744 1.683204 1.592505
67 3 0 0.887424 0.934893 1.295689 1.377084 1.842369 2.081115 1.616297 1.830585 1.594995 1.812586
68 3 1 1.020996 0.878209 1.256544 1.610380 2.129474 2.098255 1.615505 1.767150 1.680148 1.706761
69 4 1 0.999753 1.213379 1.359918 1.753400 1.872300 2.224548 1.965839 1.808319 1.598312 2.262607
70 4 2 1.458395 1.734066 1.538334 1.493917 2.866827 2.232324 2.601073 2.189164 1.937116 2.132025
71 4 2 0.985915 1.229664 1.119982 1.309372 1.626640 2.257831 1.539602 1.599635 1.395133 1.562749
72 4 0 1.011419 1.044134 1.705439 1.514683 2.245108 2.880824 1.870399 1.798537 2.116587 2.724872
73 5 0 0.949223 1.601517 1.594477 3.874671 2.189901 3.848128 1.762706 1.724869 1.921051 1.859553
81 7 0 1.650018 1.380613 1.711842 1.690249 3.249471 2.078943 2.383657 1.801718 6.352489 2.751983
82 7 0 1.014416 0.917727 1.399406 1.150972 1.821838 2.032960 1.754779 1.874363 2.053920 2.427908
83 7 0 0.893074 1.020613 1.583317 1.524411 1.685732 1.820448 1.743654 1.636847 1.730984 1.748143
84 8 3 1.528988 1.868567 1.716089 1.663151 2.384916 2.751866 2.295914 2.529877 4.410909 5.208217
85 8 0 0.850963 0.968080 1.893477 1.568479 2.088120 1.909575 1.790081 2.118442 2.016089 2.919947
86 8 0 1.463153 1.516954 1.950703 1.652777 3.533858 2.259184 3.515968 5.410845 5.867991 9.195330
87 8 2 1.380688 3.272950 1.575787 1.307566 2.274607 5.343492 3.026097 31.172460 4.893583 15.213149
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.728429 1.724900 0.620338 0.854045 2.281516 1.950629 2.374534 1.753855 2.607220 2.121960
93 10 0 0.859082 0.901466 1.334891 1.257875 1.804711 1.729408 1.841487 1.707264 2.076910 1.986295
94 10 0 0.974075 1.373455 1.331443 2.251491 1.814747 2.489021 1.949342 2.294497 1.547047 5.410293
98 7 2 1.169177 0.819910 2.172882 1.723856 2.654464 1.819031 2.044736 1.650763 3.584696 1.691580
99 7 2 0.959252 1.291011 1.594262 1.483637 1.829547 2.003513 1.816792 2.004533 2.958041 9.256253
100 7 1 1.198920 1.041721 1.819510 1.761298 2.097129 2.044310 1.881825 1.635940 1.963152 1.613764
101 8 2 1.378190 1.367932 1.486858 1.455678 1.812241 1.848007 1.619073 1.546330 1.506443 3.884352
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.258977 1.022249 1.503994 1.528668 1.944150 1.986125 1.681350 1.784078 2.218553 1.539776
104 8 1 2.334901 1.489966 0.414468 1.564642 2.192526 1.996907 3.991502 1.816327 3.483833 1.820391
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.991647 2.399009 1.751321 2.050637 3.725512 7.167531 1.584658 1.807488 1.653576 1.933794
110 10 1 1.515754 1.411118 1.612418 1.392151 2.585986 2.136232 2.243639 2.400430 2.036323 1.784253
111 10 1 0.948928 1.111858 1.573849 1.319242 2.188081 2.012348 1.960683 1.638784 1.717646 1.703139
112 10 2 0.930470 0.933349 1.186249 1.270570 1.729531 1.738618 1.463584 1.693933 1.456516 1.671369
116 7 2 0.936650 0.862848 1.286329 1.290275 2.833873 1.728266 1.755100 1.658955 2.042324 1.568447
117 7 3 0.938073 0.977567 1.567094 1.616978 1.998358 2.026756 2.050454 2.241640 2.603344 3.252797
118 7 3 1.592269 1.079951 3.879905 1.603796 2.603235 2.043326 3.414022 1.670541 3.595862 2.478406
119 7 1 0.941659 0.896392 1.498719 1.658511 2.071169 2.146833 2.004548 1.863274 4.213568 2.135214
120 8 1 3.001917 1.288585 8.349720 2.635767 6.342221 2.644528 8.073091 1.716695 21.621151 2.478423
121 8 3 1.951260 1.555817 4.561639 1.599239 5.357314 3.538908 3.609233 2.287105 3.891216 17.877998
122 8 2 1.400139 1.488026 1.560358 1.941761 2.412542 2.837017 1.891216 1.869002 2.357798 2.550723
123 8 3 1.216951 1.347571 1.576582 1.696858 1.906593 2.263531 1.592478 1.647015 1.916732 1.656155
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.250880 1.438059 2.266095 1.469811 3.359336 3.027972 3.451182 3.110489 3.410774 3.392417
128 10 2 0.787313 1.038986 1.396713 1.352403 1.751116 1.898809 1.697468 1.818366 1.988398 2.254751
129 10 3 0.969435 0.947166 1.428137 1.419017 1.916635 1.869790 1.595868 1.598521 1.527750 1.935470
130 10 3 0.946878 1.110316 1.914235 1.437758 2.125264 2.203452 1.968296 1.809494 2.142195 2.119921
135 12 2 1.198085 1.163976 1.527891 1.377132 2.821731 2.068193 1.880004 2.074024 1.938892 3.136229
136 12 2 1.127014 1.252159 1.130795 1.522942 2.059817 2.009167 4.177579 2.309186 2.362711 2.207281
137 7 3 0.924952 1.002351 1.602535 2.644384 1.829787 2.018860 1.704658 2.012084 1.759058 2.307914
138 7 1 0.771889 0.820070 1.282066 1.551002 1.720252 1.872700 1.586662 1.644088 1.435084 1.812045
140 13 2 3.201383 5.845660 14.277515 44.430212 4.442393 3.747475 3.618716 9.382455 7.190087 19.340226
141 13 2 5.162779 1.259145 13.695094 1.125107 18.527767 2.057786 12.464878 1.486821 13.884700 1.544886
142 13 2 2.377678 1.471486 5.943372 1.480865 7.110566 2.444544 2.911897 1.751143 3.423870 3.689041
143 14 2 0.921185 0.900692 1.505744 1.453845 1.941573 1.796402 1.999542 1.683998 1.582775 1.717819
144 14 3 1.125472 1.291809 1.577810 1.598945 2.628697 2.288868 1.773560 1.946499 1.865179 2.102378
145 14 3 3.552169 4.165979 22.210351 17.020712 12.848751 13.597166 3.503861 1.761651 2.618725 1.819690
150 15 1 3.126421 10.434964 16.970251 53.271148 5.480877 9.652193 5.645993 21.785606 5.631170 35.946774
155 12 2 2.770237 2.118504 8.992862 18.378571 3.809743 4.331840 3.274724 2.579659 3.481521 1.893671
156 12 3 1.031698 1.292871 1.322482 2.397920 1.807165 2.429499 1.465907 2.009553 1.369048 2.008544
157 12 3 1.169115 1.259021 1.425357 1.532882 2.062388 1.998260 1.757395 1.717606 1.671680 1.717341
158 12 3 1.171988 1.486108 2.246351 4.035953 2.929480 4.094900 2.474036 1.889490 2.866617 1.908632
160 13 3 4.001318 11.185139 18.383971 70.031369 7.304114 11.086884 5.201714 22.250026 10.248981 45.428498
161 13 0 2.104991 1.056081 1.055657 1.625342 3.893908 2.365600 3.166785 1.973720 5.104582 3.330610
162 13 0 0.940658 1.039701 1.394033 1.338149 1.753768 2.020312 1.673075 1.631856 1.390024 1.481479
163 14 2 0.967415 1.088665 1.670221 1.935074 1.894064 2.147398 1.849561 1.832708 1.623207 1.778917
164 14 2 0.925122 1.007185 1.397173 1.353634 1.915414 2.023897 1.883916 2.672315 1.691770 1.966433
165 14 0 nan nan nan nan nan nan nan nan nan nan
166 14 0 nan nan nan nan nan nan nan nan nan nan
167 15 1 1.661173 1.728742 2.180753 1.842500 2.778872 2.137375 4.082130 2.796743 3.196283 2.134994
168 15 2 2.106527 1.441117 9.325999 5.651632 4.222015 1.948105 5.010496 3.126686 8.544474 3.738570
169 15 2 2.027257 2.176846 9.980448 8.858287 2.394364 3.126209 2.718387 5.155184 4.060108 5.189770
170 15 2 2.407757 3.899189 11.228150 18.623184 3.115196 5.412438 3.538634 7.818644 7.632701 14.162897
176 12 0 0.896847 1.056614 1.535851 1.497295 2.350743 1.912802 2.087193 1.644852 1.957182 1.727391
177 12 0 0.929266 1.291847 1.476433 1.208128 2.091910 1.933117 1.756330 1.514204 1.513847 1.688070
178 12 0 0.879134 0.923506 1.263923 1.277565 1.789362 2.025189 1.516354 1.664490 1.640411 1.535978
179 12 1 1.396547 1.044856 1.273420 1.486821 2.045842 1.932978 3.921049 2.112217 2.281609 2.052740
180 13 3 2.688547 1.384869 11.370061 1.348538 6.412452 2.280674 3.081415 1.798177 3.169230 1.760224
181 13 3 3.186980 4.649979 1.188194 10.740281 3.786030 7.067085 2.037675 1.784121 2.388744 1.926998
182 13 0 1.550596 1.388397 3.657764 2.425077 5.323416 2.928793 1.944655 1.788196 1.698448 2.236967
183 13 1 1.176643 1.319420 1.453852 2.177271 2.663792 2.405991 1.688401 1.998476 2.310013 2.631619
184 14 0 nan nan nan nan nan nan nan nan nan nan
185 14 1 0.878397 1.268765 1.337570 1.810439 1.926209 1.789543 1.780548 2.374433 1.830314 1.742243
186 14 1 0.970067 1.016844 1.436330 1.520420 1.810124 1.990177 1.932997 1.789695 1.791188 2.199868
187 14 1 1.114971 1.451965 1.748733 1.803852 2.721268 2.728575 2.640035 3.570958 2.287408 4.603579
189 15 3 1.015829 1.191872 1.505873 1.481954 1.890916 2.105650 1.421562 1.629973 1.473453 1.649080
190 15 3 2.804650 1.670000 10.177512 0.997340 4.291552 2.530106 2.784269 2.746391 2.816815 3.297314
191 15 3 0.879283 1.112191 1.438757 1.353534 1.864820 2.172087 1.808258 1.823239 1.504251 1.557853
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 0.339835 0.133293 0.062335 0.025870 1.506439 0.136379 0.064018 0.025522 0.050010 0.028367
206 19 0 0.250103 0.218236 0.036074 0.033869 0.823993 0.091577 0.041433 0.034755 0.040981 0.037306
207 19 1 0.239238 0.168530 0.030148 0.038723 0.708613 0.169990 0.035688 0.029990 0.031678 0.034613
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.199316 0.203310 0.030659 0.036325 0.487083 0.158622 0.036245 0.034958 0.029910 0.032672
224 19 1 0.081265 0.067787 0.022474 0.019358 0.135233 0.069917 0.020785 0.013741 0.034300 0.018253
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.643271 4.014112 11.165138 29.180336 7.323229 6.670567 8.126695 3.755114 7.363388 3.405449
321 2 3 1.058833 1.301070 1.558454 1.991715 2.199865 2.074029 1.709096 1.915606 1.757261 2.054254
323 2 3 1.023905 2.106349 2.657662 3.404529 1.918742 2.959198 1.577364 1.706600 1.674530 1.884309
324 4 3 1.005045 1.632849 2.869977 17.320345 2.196845 2.055294 1.690659 1.790273 1.654605 1.796376
329 12 1 1.036072 0.878530 2.554376 4.582125 2.276389 2.016890 1.761589 1.899038 1.773231 1.590345
333 12 1 1.245338 1.354503 1.815498 1.894477 2.580922 4.135871 1.757478 1.765878 1.655099 1.637112
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 [ ]: