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 = 2459846
Date = 9-23-2022
data_path = "/mnt/sn1/2459846"
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)
124 sum files found between JDs 2459846.14065 and 2459846.33966
124 diff files found between JDs 2459846.14065 and 2459846.33966
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Input In [3], in <cell line: 19>()
     17 times_uvf = np.unique(uvf.time_array)
     18 times_uvd = np.unique(uvd.time_array)
---> 19 idx_times = [np.where(time_uvd == times_uvf)[0][0] for time_uvd in times_uvd]
     20 uvd.flag_array[:,0,:,:] = np.repeat(uvf.flag_array[idx_times], len(bls), axis=0)

Input In [3], in <listcomp>(.0)
     17 times_uvf = np.unique(uvf.time_array)
     18 times_uvd = np.unique(uvd.time_array)
---> 19 idx_times = [np.where(time_uvd == times_uvf)[0][0] for time_uvd in times_uvd]
     20 uvd.flag_array[:,0,:,:] = np.repeat(uvf.flag_array[idx_times], len(bls), axis=0)

IndexError: index 0 is out of bounds for axis 0 with size 0

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 6.560686 5.938072 3.666571 3.352080 34.624862 32.378097 0.472698 0.133620 0.268148 0.087667
4 1 2 8.021336 6.269680 2.508222 0.249619 41.403973 32.994668 0.501034 0.165162 0.337430 0.092669
5 1 2 7.295030 6.047372 2.731791 2.612278 39.809455 32.182453 0.589793 0.137882 0.401665 0.116613
7 2 0 7.103262 6.665252 1.692451 3.453098 37.952339 32.483619 0.418698 0.135300 0.241120 0.100502
8 2 0 2.048911 2.669639 0.973928 5.222287 11.503990 13.583969 0.776617 7.351906 0.813598 8.166367
9 2 0 6.466542 6.165588 1.598481 1.807771 35.196717 32.518007 0.510856 0.157716 0.434720 0.132676
10 2 1 7.398299 6.075924 2.131123 0.855490 36.128186 31.349436 0.364177 0.127872 0.380437 0.108552
15 1 3 7.356444 5.627476 2.216496 0.795333 38.530776 27.121144 0.398692 0.144804 0.289106 0.110986
16 1 3 7.787901 5.322433 2.593244 4.977970 35.975375 27.242977 0.417269 0.159888 0.229909 0.087773
17 1 3 7.458522 5.355311 1.255102 1.779312 35.403431 27.466762 0.396535 0.123699 0.163289 0.083231
18 1 0 7.680702 8.102850 0.230944 1.459520 26.550614 39.941182 0.360276 0.185902 0.166669 0.132906
19 2 1 6.811859 5.395167 2.023963 2.422383 34.087594 26.482428 0.408299 0.157960 0.390516 0.270047
20 2 1 5.952285 4.920908 1.232491 1.225911 31.769452 26.024604 0.437623 0.121109 0.317041 0.090660
21 2 2 5.780097 4.647215 6.989902 0.504663 28.981089 24.826380 0.343185 0.127536 0.337619 0.096423
22 6 0 6.439618 6.111602 2.273424 4.134754 37.191606 31.426596 0.578778 0.173062 0.292710 0.432926
27 1 0 30.303382 60.717184 73.446627 214.554871 1.025782 1.765983 0.680471 0.521507 0.740108 0.471086
28 1 0 3.587206 3.521159 0.888305 0.812083 6.261677 16.661725 0.296880 0.568285 0.153676 0.096582
29 1 1 7.525593 6.017539 2.261263 0.669414 35.207488 30.143813 0.560112 0.141333 0.477243 0.115306
30 1 1 9.632418 5.277466 6.246249 0.960280 33.687924 27.735477 0.440127 0.117866 0.395921 0.162992
31 2 2 6.189110 5.810796 2.127368 5.008534 31.793083 31.092294 0.411008 0.146063 0.335240 0.103037
32 2 2 6.497560 5.910704 3.292130 0.321552 32.973801 32.240093 0.570600 0.201040 0.609966 0.128029
33 2 3 7.013087 5.145448 7.241543 0.953318 15.766253 26.666761 0.188603 0.113315 0.082257 0.081887
34 6 0 6.790728 61.750392 10.824867 152.295752 33.334053 1.261001 0.551630 0.491446 0.305389 0.444994
35 6 0 6.907271 4.838350 12.883655 7.397425 30.780783 24.441976 0.532426 0.127263 0.240568 0.410849
36 3 3 10.204310 9.029867 16.524871 20.799509 46.986523 36.364838 0.570784 0.150412 0.266212 0.082928
37 3 1 7.586306 5.724882 3.131275 3.409004 30.753784 30.296168 0.555388 0.148783 0.365985 0.095346
38 3 1 7.299307 5.458081 0.514208 1.962476 38.222655 28.864924 0.440963 0.122710 0.181677 0.080012
40 4 1 8.079552 6.072026 5.070525 0.766793 40.164150 32.649932 0.505001 0.177363 0.436087 0.106349
41 4 3 6.883812 5.790200 2.024428 1.344977 31.650452 31.220515 0.382903 0.345093 0.165749 0.120080
42 4 0 6.793766 5.930685 0.667056 0.660964 33.539147 30.806112 0.439608 0.149170 0.226749 0.126403
43 5 2 5.231209 27.777275 2.106738 432.288109 29.701471 0.763936 0.957142 0.478703 1.164059 0.494510
44 5 1 11.707297 9.048972 29.350727 2.702038 32.855773 36.474492 0.476901 0.170321 0.274467 0.129454
45 5 0 7.323205 5.607456 2.833503 0.320192 28.425326 27.228804 0.445224 0.153146 0.346399 0.093387
46 5 0 267.144330 4.957210 180.668317 2.181030 5.408928 27.115468 0.582507 0.155274 0.792808 0.122215
47 6 1 6.561725 6.111140 7.121447 4.152736 35.372378 30.107049 0.621868 0.335419 0.306294 0.215419
48 6 2 3.303771 4.638462 2.718334 4.070664 18.486487 23.232067 0.476535 0.263481 0.339785 0.246308
49 6 2 5.029278 5.089504 1.667934 0.730808 22.806160 26.117850 0.504771 0.266306 0.366187 0.234700
50 3 3 10.738335 9.302184 22.651838 21.339281 41.908429 37.089289 0.288782 0.156064 0.096362 0.102562
51 3 2 7.494245 388.321766 1.169937 93.338977 36.145205 7.621505 0.479907 0.850161 0.129171 0.841982
52 3 3 11.662999 7.878327 16.353347 14.867398 34.174906 28.181490 0.401932 0.136544 0.220103 0.104461
53 3 2 3.589193 2.642252 2.044511 2.299965 17.442240 12.423870 0.547352 0.204204 0.133733 0.095423
54 4 0 6.781130 213.756961 0.971589 172.951841 35.037614 4.331444 0.471615 0.447066 0.404889 0.454766
55 4 2 6.471024 5.544445 2.858471 1.547986 33.032562 30.241824 0.445859 0.185140 0.156188 0.103753
56 4 1 7.134964 6.266737 2.675671 0.494408 33.586232 33.496216 0.484403 0.163898 0.442552 0.118160
57 4 3 8.159527 6.073916 1.517566 0.427455 35.180496 31.521118 0.421946 0.058566 0.190615 0.047335
58 5 1 554.774300 311.379648 1894.676076 1050.494589 10.421618 6.355205 0.607965 0.528710 0.665705 0.473430
59 5 1 8.082139 6.046786 28.414311 23.037542 30.129013 29.172903 0.408616 0.155713 0.185634 0.101869
60 5 2 11.300581 10.452261 186.521128 144.231395 0.635222 0.658096 0.640627 0.464162 0.663973 0.492538
61 6 1 7.967131 6.296994 8.312596 6.440231 38.164285 30.520284 0.578238 0.227473 0.213365 0.168633
62 6 2 4.226086 4.720285 5.926037 2.478087 21.553080 27.093998 0.508116 0.324986 0.343513 0.221021
63 6 3 69.448172 4.367083 229.127716 11.631865 1.520159 24.310136 0.870646 0.297152 1.093977 0.252374
64 6 3 4.569511 4.933551 3.621562 2.842381 24.769343 25.164336 0.565135 0.288070 0.448224 0.243601
65 3 0 9.246369 7.018983 0.565479 1.167685 46.446475 35.698951 0.504195 0.146083 0.135815 0.096933
66 3 0 6.513754 6.111113 0.762524 3.423247 33.636148 32.088291 0.420345 0.174545 0.125803 0.086347
67 3 0 9.881762 5.212917 0.881229 0.841303 35.953291 27.740697 0.421233 0.123896 0.234514 0.081224
68 3 1 817.617591 5.639861 1416.449180 0.810120 16.219543 28.818207 2.032446 0.140814 2.308076 0.107257
69 4 1 6.559359 5.344497 0.541809 1.287527 32.657954 28.357788 0.434211 0.250827 0.209297 0.112630
70 4 2 9.390038 5.689876 1.413518 1.015156 39.379539 29.395631 0.559559 0.149118 0.395553 0.098157
71 4 2 8.420477 5.100520 5.018524 2.148214 29.748612 26.963138 0.477575 0.124391 0.200475 0.087622
72 4 0 6.989182 6.837949 3.907626 2.118491 34.175195 35.135832 0.544791 0.239476 0.458360 0.099644
73 5 0 5.551741 86.002753 0.677574 19.938032 28.484350 2.318280 0.383107 0.455691 0.143097 0.536955
74 5 2 80.316141 17.737981 143.430475 116.433677 5.093555 0.663963 0.303157 0.455182 0.295800 0.497717
75 5 3 127.651834 4.692914 46.034480 1.059966 3.111934 24.812011 1.264956 0.080451 2.255929 0.081739
77 6 1 6.716898 5.636460 8.638679 10.760390 31.487840 29.932851 0.290179 0.240526 0.239487 0.246886
78 6 3 4.844841 5.680320 7.939773 14.951356 25.482701 30.178850 0.562695 0.344650 0.345930 0.214764
81 7 0 8.290468 7.242532 3.554341 1.359201 42.820263 32.943484 0.364209 0.139546 0.122327 0.091345
82 7 0 6.993881 5.674822 2.899715 1.987768 31.850804 30.354159 0.392657 0.199837 0.086905 0.136278
83 7 0 7.352917 5.264533 1.101829 0.982228 38.656244 27.900909 0.491838 0.270140 0.235785 0.128093
84 8 3 565.429233 5.080361 230.016445 0.898653 10.735295 26.724429 1.841380 0.143417 1.598495 0.101065
85 8 0 6.725263 4.946480 0.949896 1.673169 27.690988 26.163565 0.359963 0.124210 0.127760 0.082070
86 8 0 7.097278 5.370758 1.692368 1.929737 28.707675 28.489238 0.355248 0.169969 0.127123 0.161528
87 8 2 5.682406 7.986274 1.974471 0.383587 23.946185 41.974814 0.283120 0.332024 0.072805 0.194532
88 9 0 5.678899 4.502302 1.879226 0.265028 30.931045 25.364748 0.673527 0.301023 0.449812 0.235899
89 9 2 5.747484 5.682708 9.057286 0.349787 27.507191 29.923932 0.317717 0.208796 0.106727 0.141720
90 9 0 8.570757 5.253879 4.344881 0.153255 26.593679 26.898468 0.293220 0.157730 0.141929 0.080591
91 9 1 4.661806 4.868431 1.728607 1.170940 25.741441 27.931450 0.629334 0.254339 0.503911 0.202498
98 7 2 9.856082 6.549876 2.516067 3.885468 48.181729 33.450756 0.428969 0.143109 0.199267 0.076111
99 7 2 6.303572 4.933884 3.539400 3.017086 31.936106 25.049830 0.414438 0.066505 0.149116 0.105986
100 7 1 7.734908 5.808475 0.483605 3.922472 34.423496 29.241809 0.388417 0.127758 0.104966 0.096094
101 8 2 7.230938 5.706365 2.595928 1.522431 34.635418 30.743626 0.478936 0.212205 0.393194 0.138637
102 8 0 304.705063 3.763626 136.411536 0.895635 5.947945 7.258722 0.652140 0.023651 0.710021 0.025873
103 8 1 405.870810 292.287344 258.606328 176.425659 7.834870 5.418780 1.097353 1.005746 2.526394 0.979025
104 8 1 9.456655 5.702547 0.497405 0.986057 19.001639 29.509519 0.058381 0.385884 0.133904 0.130517
105 9 1 6.394437 5.522864 2.545334 3.308146 30.461046 29.111207 0.513744 0.190142 0.372499 0.103835
106 9 3 5.388311 5.271708 1.896615 0.956744 28.615789 27.312521 0.594322 0.139439 0.499097 0.090425
107 9 0 6.085869 5.370030 1.179173 0.829841 29.643469 28.007983 0.675132 0.296589 2.388495 0.817690
108 9 1 5.289173 2.228530 0.284078 14.701680 27.644696 5.686160 0.351713 0.017335 0.120222 0.015271
116 7 2 7.015272 8.448175 1.345098 5.626933 33.176264 44.173776 0.128366 0.583882 0.073508 0.243641
117 7 3 53.516697 171.270176 291.431484 132.510595 1.223444 3.416434 0.583319 0.480189 0.693549 0.570005
118 7 3 7.058955 4.948713 2.897258 1.537636 34.957899 26.228310 0.355046 0.102971 0.111293 0.063763
119 7 1 5.716026 5.588055 5.699422 1.883324 29.087399 30.172559 0.340009 0.240034 0.145327 0.163371
120 8 1 156.008322 5.658150 269.049279 0.617623 3.552988 28.702624 1.027150 0.158941 1.542690 0.113287
121 8 3 6.895025 6.104724 0.596889 0.639599 34.913567 30.483584 0.383074 0.130096 0.116245 0.771454
122 8 2 6.894456 5.673068 0.586700 0.207590 27.966495 29.878141 0.387285 0.118174 0.112064 0.073549
123 8 3 6.067897 5.431008 3.796550 0.871611 31.644895 29.089578 0.380430 0.194486 0.098084 0.102509
124 9 2 4.751938 5.801358 1.449926 2.131165 26.950252 30.427866 0.382864 0.501689 0.209600 0.310013
125 9 3 5.912308 5.123902 0.726672 2.248509 30.701371 27.668046 0.470672 0.120642 0.224497 0.091792
126 9 3 5.284184 6.865712 3.503480 7.432743 25.523593 34.926958 0.364952 0.160458 0.155335 0.140287
137 7 3 7.321690 5.356525 3.767163 1.892547 35.309889 27.781326 0.385846 0.187862 0.148317 0.125360
138 7 1 7.435327 5.297711 0.230183 1.296007 35.368815 28.281343 0.517448 0.138208 0.143193 0.098375
143 14 2 6.763549 5.917809 2.342043 1.183629 34.900315 31.617858 0.428168 0.139663 0.132749 0.088715
144 14 3 7.336642 5.897264 0.306787 0.152800 30.733289 31.376036 0.390538 0.138315 0.108912 0.082855
145 14 3 116.516637 316.290118 166.803794 324.742711 2.415352 6.357386 0.564968 0.522243 0.701555 0.520591
147 15 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
148 15 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
149 15 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
150 15 1 92.726699 29.354861 236.007633 269.005157 1.998397 0.928831 0.658272 0.526730 0.719586 0.485833
163 14 2 6.922253 6.995503 2.374949 2.416962 35.238507 31.538716 0.475465 0.121520 0.270612 0.083978
164 14 2 9.079990 6.314836 5.482950 3.513593 37.313125 33.778282 0.461060 0.131447 0.134715 0.083134
165 14 0 12.087126 7.896303 32.316920 14.153818 35.438997 32.079720 0.393758 0.230850 0.129672 0.166199
166 14 0 11.012274 8.872835 27.850914 21.325027 38.821019 34.379404 0.312356 0.167751 0.440948 0.125760
167 15 1 8.244213 4.651104 2.023649 6.073929 42.075492 19.629080 0.496670 0.191645 0.261316 0.177815
168 15 2 8.415738 6.834933 1.252095 1.320282 42.545494 34.407868 0.637763 0.187533 0.519925 0.114764
169 15 2 8.496735 6.189434 3.149882 0.150307 38.595328 33.916843 0.489705 0.273416 0.310248 0.120227
170 15 2 7.603530 6.257888 1.307342 0.860987 32.587348 33.815079 0.531686 0.220128 0.391778 0.172432
184 14 0 12.617883 9.069097 27.341936 22.902976 42.473384 29.499556 0.524164 0.114788 0.253246 0.079546
185 14 1 7.533233 6.319323 1.577531 0.393969 38.039641 33.647120 0.438103 0.168981 0.261331 0.100668
186 14 1 8.570890 6.640919 0.355477 1.582273 35.648658 32.247273 0.446285 0.121012 0.131613 0.085713
187 14 1 8.838349 5.538693 3.122316 2.054954 43.070500 28.841813 0.482194 0.120998 0.332103 0.107006
189 15 3 7.557746 7.374353 1.104939 0.196397 36.411374 32.030118 0.402570 0.147814 0.130208 0.093655
190 15 3 13.487418 3.137513 4.397027 5.496026 0.279453 10.399326 0.073720 0.163720 0.083577 0.159935
191 15 3 7.397360 6.187686 1.791958 0.709586 32.618339 32.089847 0.448859 0.224224 0.344609 0.133394
320 3 2 57.371240 5.344887 590.164679 0.691310 1.501522 29.048912 1.250012 0.439334 1.468007 0.296881
321 2 3 5.595015 5.933214 7.114204 2.232053 30.011487 30.871841 0.610018 0.272313 0.410279 0.231870
322 5 3 3.278814 5.389078 1.486353 2.574980 18.746980 30.405007 0.445267 0.264137 0.323863 0.249310
323 2 3 4.196107 6.342240 2.420099 4.649357 23.027187 34.243252 0.466114 0.112320 0.364476 0.122616
324 4 3 3.965620 4.818818 1.707200 1.011013 22.543875 26.315245 0.500174 0.311633 0.339887 0.229329
325 9 2 6.560746 4.427847 7.598127 2.150383 36.731646 25.153568 0.593430 0.258018 0.252048 0.234549
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 [ ]: