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 = 2459781
Date = 7-20-2022
data_path = "/mnt/sn1/2459781"
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)
813 sum files found between JDs 2459781.25322 and 2459781.60213
813 diff files found between JDs 2459781.25322 and 2459781.60213

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.788960 1.526728 1.822819 1.230356 1.879372 1.638100 2.005289 1.845907 2.174428 1.989467
4 1 2 1.198466 2.596060 1.699023 1.234773 1.910429 1.726312 1.859124 1.889733 2.079064 2.069379
5 1 2 1.064755 1.164135 2.205455 1.424215 1.875816 1.686852 2.408852 1.872541 5.742936 4.939171
7 2 0 1.102992 1.147298 1.403130 1.225077 1.887046 1.715461 1.771128 1.903984 2.093658 2.235972
8 2 0 1.199657 1.599755 2.796250 3.711095 2.004743 3.076905 2.212345 2.544441 3.257981 12.644895
9 2 0 1.091723 1.147920 1.639608 0.985972 1.766021 1.679707 2.253076 1.906244 2.302503 1.698273
10 2 1 1.017970 1.210446 1.117764 1.263039 1.998680 1.814871 1.799741 2.656131 2.195710 3.708274
15 1 3 1.178478 1.106940 1.189789 1.037395 1.880743 1.842363 1.759226 1.712340 5.255889 4.100514
16 1 3 1.326639 1.221832 1.750674 1.118316 2.363033 1.803616 1.978127 1.697439 8.472981 4.104843
17 1 3 1.261964 1.069244 1.650954 1.087723 2.326384 1.795343 2.093630 1.743847 1.932397 2.186726
18 1 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
19 2 1 1.050385 1.175656 1.565742 1.722953 1.856773 2.137637 2.023925 1.954506 2.619557 5.836063
20 2 1 1.081267 0.973406 1.420913 0.972872 1.674932 1.751776 1.700871 1.724756 1.858355 1.777319
21 2 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
27 1 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
28 1 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
29 1 1 1.383755 1.198917 2.223681 1.478833 2.081392 1.717304 3.343327 2.426143 3.945350 3.331489
30 1 1 1.202773 1.331682 1.212505 1.199257 1.918517 2.212018 2.464594 3.017270 2.063503 3.595468
31 2 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
32 2 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
33 2 3 81.057604 1.312481 1.030506 1.473014 348.753135 1.803713 1.673256 1.829407 2.083875 2.424436
36 3 3 1.246609 1.155299 1.657500 1.792894 2.014415 1.867815 1.845835 1.692730 2.329077 2.280912
37 3 1 1.306143 1.105296 3.441885 1.589243 2.296926 1.971461 1.994743 1.926971 3.388017 3.239018
38 3 1 1.152949 1.898477 2.084773 1.429996 2.010013 2.313966 1.849835 2.543404 2.122799 2.417580
40 4 1 1.169736 1.206046 1.508395 1.253791 1.988617 1.774510 1.938032 1.922553 2.153678 2.426719
41 4 3 1.115565 1.415154 1.637244 3.290381 1.659132 2.343166 1.667881 1.840113 1.939583 2.110557
42 4 0 1.168500 1.230136 1.372043 1.583451 2.211300 2.245321 1.751682 2.503927 2.399670 6.650852
45 5 0 1.831577 1.200092 2.070307 1.183645 5.559399 1.936908 4.087509 2.098675 2.838396 2.186352
46 5 0 1.999472 2.051360 1.223660 1.560173 3.212120 3.202834 2.022129 2.325399 2.791507 5.328327
50 3 3 1.581452 1.189531 1.447968 1.404573 2.374830 1.973390 2.355282 1.836347 2.625654 1.812673
51 3 2 3.685684 1.114441 10.720696 2.265294 6.084290 1.549525 5.847839 2.039552 7.650346 3.324255
52 3 3 3.960356 1.199296 12.638093 1.570319 4.474832 2.463672 4.163797 1.964114 5.110970 2.444152
53 3 2 1.097902 1.280074 3.434397 5.268224 2.170962 2.509632 2.187811 2.564879 4.377306 5.429582
54 4 0 1.092288 1.072099 1.443777 1.305428 2.100099 1.879062 1.816106 1.702860 3.162983 4.974238
55 4 2 1.140131 1.158667 2.089680 1.021250 2.306785 1.980629 2.704817 2.085086 2.643585 1.625498
56 4 1 1.338440 1.329600 1.905416 2.082537 2.158484 2.008929 2.096354 2.144677 2.610724 3.459930
57 4 3 1.389111 1.743576 2.366247 4.556607 2.571628 1.557572 2.437738 2.020903 2.427460 2.750661
65 3 0 1.222894 1.471474 1.969701 1.090573 2.279197 1.887500 1.991625 2.035770 2.052147 2.074289
66 3 0 1.478483 1.281656 2.496179 2.133518 2.913274 2.241977 2.426694 1.986335 2.064868 2.639814
67 3 0 1.021899 1.203214 2.382957 1.888769 1.913354 1.920083 1.910653 2.045997 2.049868 2.131066
68 3 1 1.081297 1.200768 1.410978 1.534948 1.906754 1.651915 1.684524 2.283475 1.710631 2.202202
69 4 1 1.143081 1.215421 2.146061 2.058923 1.918253 2.027366 2.249516 2.271039 2.618463 2.574090
70 4 2 2.277379 1.437583 2.445200 1.456406 4.523086 2.686529 6.016265 3.298612 3.903040 3.475797
71 4 2 1.414074 1.318422 2.473515 1.603778 1.936364 1.927086 2.053273 1.976496 1.959186 2.076787
72 4 0 1.233311 1.445098 1.733260 1.332281 2.254843 1.991909 1.743586 1.932252 4.739948 4.788462
73 5 0 1.070649 1.481348 1.124719 1.084235 1.972037 1.928794 1.667144 1.901087 1.680567 2.616631
81 7 0 1.597703 1.387274 2.137527 1.521380 2.478630 2.291266 3.140254 2.376472 11.674825 4.100835
82 7 0 0.960601 1.250206 1.188101 1.755878 1.760976 2.073145 1.776090 2.038889 2.255755 2.567677
83 7 0 1.105380 1.069028 2.275356 5.956602 1.987951 1.666678 1.989964 1.519792 2.710451 1.981283
84 8 3 2.006811 2.039770 2.231167 2.294726 4.203691 4.931487 3.261961 3.264520 11.759183 9.589494
85 8 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
86 8 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
87 8 2 1.171962 1.016598 2.191895 2.049242 1.628554 1.914793 2.185604 3.039967 4.949325 3.897706
88 9 0 2.345456 3.067591 6.610283 14.442469 3.179093 8.319683 4.205239 2.455085 3.981160 1.890319
90 9 0 7.309347 2.101122 3.481271 2.705839 12.201112 4.303748 39.729376 3.882239 61.282727 6.104714
91 9 1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
92 10 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
93 10 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
94 10 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
98 7 2 0.995699 1.120596 1.285926 1.485189 2.045434 1.911163 1.992659 2.050677 3.574120 2.532804
99 7 2 0.969330 1.184571 1.285291 1.925746 1.744807 1.984567 1.742467 1.859413 2.125737 6.999397
100 7 1 1.255504 1.176267 1.569075 1.554491 1.968344 1.639647 1.749382 1.581381 2.288248 2.284916
101 8 2 1.489771 1.420570 1.913277 2.035340 1.880499 1.832693 1.906938 2.221900 2.568353 4.125208
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.600087 1.150138 2.269446 1.915529 2.262370 1.915970 2.673213 2.420529 7.110131 3.076813
104 8 1 3.222067 1.145325 0.716715 2.221395 2.427009 1.767888 3.587158 1.929840 6.616392 2.816543
105 9 1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
106 9 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
107 9 0 2.378850 3.055036 18.529581 29.182562 3.878697 2.615299 2.938432 4.651527 4.611299 1.944235
108 9 1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
109 10 1 1.630509 1.630897 1.502847 1.548664 4.053663 2.788415 1.837455 1.871526 2.059866 2.317279
110 10 1 1.021521 2.084890 1.783968 1.502572 1.902970 2.912734 1.738451 2.683507 1.794145 2.188772
111 10 1 1.262912 1.301149 2.440502 1.524386 2.605706 1.912009 2.231549 1.792966 2.150389 1.699454
112 10 2 nan nan nan nan nan nan nan nan nan nan
116 7 2 1.089730 1.022485 1.486367 1.105182 1.733315 1.813944 1.599770 1.990293 3.134976 2.136270
117 7 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
118 7 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
119 7 1 1.159948 0.966720 1.934735 2.042784 2.225383 1.675938 2.147933 1.963628 4.458726 2.737771
120 8 1 4.934449 1.801505 6.256419 2.320082 5.484717 3.761085 6.738268 1.938050 18.747107 4.202396
121 8 3 2.093587 2.559161 2.649455 2.297039 4.857615 7.292300 3.558013 3.251103 7.493852 14.484634
122 8 2 1.856235 1.748915 2.524427 2.073980 4.691752 4.376360 3.121952 2.823405 7.805819 6.743192
123 8 3 1.401375 1.386828 2.449085 2.072142 2.617316 2.537534 2.305606 2.086058 5.015669 5.588304
125 9 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
126 9 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
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 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
130 10 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
135 12 2 nan nan nan nan nan nan nan nan nan nan
136 12 2 nan nan nan nan nan nan nan nan nan nan
137 7 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
138 7 1 1.159555 3.296657 1.178032 2.838669 1.904683 2.729223 1.910496 2.038848 9.305808 2.456084
140 13 2 1.180172 1.162871 1.456667 1.692395 2.065689 1.959761 1.716216 1.648852 2.064572 2.261997
141 13 2 4.451999 1.207879 6.847723 1.242337 15.484964 2.139860 10.717584 1.630999 8.208452 1.717134
142 13 2 2.472383 1.777746 3.174922 4.107533 3.027087 2.749101 2.508168 1.826326 3.259375 2.360609
143 14 2 1.191316 1.239215 1.976722 1.252084 1.835412 1.835228 2.038938 2.141357 2.454442 2.212507
144 14 3 1.188716 1.241101 1.302323 1.293858 2.257763 2.048712 1.860810 1.644647 1.982681 1.496268
145 14 3 2.059968 1.998947 8.695859 7.743412 3.912871 5.338010 2.841251 1.753366 2.707653 1.870336
150 15 1 3.909979 5.299342 19.203530 45.640358 5.802753 10.140139 3.703073 3.202534 3.122960 2.132819
155 12 2 nan nan nan nan nan nan nan nan nan nan
156 12 3 1.163426 1.141593 1.479391 1.430434 2.242386 2.125462 1.807083 1.808305 1.618318 1.554573
157 12 3 1.209067 1.039492 2.183870 1.262767 2.179325 1.941721 1.877497 1.879220 2.090395 1.863205
158 12 3 1.375191 1.099081 2.437863 0.882976 3.346724 1.778884 2.970959 1.824889 3.634721 2.404455
160 13 3 4.829089 12.182618 15.099936 78.504674 7.338474 7.670637 5.279904 24.463843 3.294409 1.907506
161 13 0 3.120291 1.428795 1.020498 1.135695 3.352113 2.013661 3.129787 1.881659 3.424346 4.052767
162 13 0 1.183719 1.123692 1.903179 1.364310 1.754444 1.803606 1.993308 2.071884 1.697184 2.102799
163 14 2 1.001083 1.025112 1.269293 1.374877 1.673538 1.990945 1.697377 1.866741 1.766509 3.151889
164 14 2 1.126190 1.014260 1.055075 1.182304 2.039298 2.086179 1.724457 3.013030 2.064377 2.299224
165 14 0 5.057552 5.923799 4.671589 11.869536 16.145099 13.552843 4.927491 6.951118 11.328512 8.649500
166 14 0 1.603394 2.727680 1.838707 2.093316 2.333825 3.540354 3.155982 5.576426 2.073325 3.907380
167 15 1 2.201516 2.538714 2.977888 2.277731 3.053798 2.286622 2.436740 2.383786 2.499113 1.997798
168 15 2 1.619364 1.266718 3.760625 2.435365 2.296383 1.950018 4.303621 4.767390 6.573045 4.884561
169 15 2 1.302831 1.194129 2.661693 2.608760 2.610635 2.058367 3.149599 3.459111 5.690200 10.018329
170 15 2 1.343856 1.124326 2.443442 2.775167 2.148704 2.026214 3.307613 2.779086 3.595640 2.912095
176 12 0 1.036812 1.061396 2.041977 1.637692 1.822460 1.729374 2.091836 1.743210 2.680256 2.404840
177 12 0 1.026395 1.086370 1.121630 1.498484 1.783758 1.824789 1.638825 1.764373 1.641598 2.458445
178 12 0 1.193961 1.217503 1.563740 1.652939 2.090078 1.904341 2.025508 2.029458 2.537283 2.304503
179 12 1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
180 13 3 1.869389 1.479308 6.161653 1.536108 2.066695 2.582899 2.806906 1.769190 2.104643 1.947535
181 13 3 3.993418 2.373472 3.113761 8.295082 3.145757 3.732073 1.910357 2.360834 2.291278 2.053175
182 13 0 1.465901 1.500916 1.982301 2.579387 3.004596 3.757971 1.837048 2.143509 2.381893 3.558856
183 13 1 1.308016 1.143123 1.612681 1.653923 2.405786 2.011511 1.964668 1.932450 2.143635 2.516709
184 14 0 1.192377 1.039528 1.212698 1.182436 1.983224 1.749793 1.836894 1.870844 3.164882 6.318775
185 14 1 nan nan nan nan nan nan nan nan nan nan
186 14 1 nan nan nan nan nan nan nan nan nan nan
187 14 1 nan nan nan nan nan nan nan nan nan nan
189 15 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
190 15 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
191 15 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.309717 0.949824 3.780201 2.328003 2.717284 1.739832 2.267906 1.962293 2.325779 2.377635
206 19 0 1.113239 1.090432 2.434444 2.861103 1.856744 1.829295 2.192515 1.818777 2.155664 1.722560
207 19 1 0.961156 0.842764 2.120209 2.260317 1.763533 1.566215 1.814389 1.797603 1.867942 1.854357
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.102056 0.966190 2.069541 2.060495 1.947955 1.781510 1.807763 1.695359 2.015920 1.898484
224 19 1 0.949691 0.790120 2.115509 2.199865 1.751320 1.741785 3.782822 2.082040 7.236116 4.535413
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.690574 4.969645 9.715795 29.696223 4.625490 7.435247 6.881481 6.439609 6.307895 2.157510
321 2 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
323 2 3 1.196964 2.455194 4.269978 3.931186 2.392352 3.742493 2.035498 1.884077 2.644790 2.751859
324 4 3 1.137143 1.662883 2.581408 2.254196 2.217955 2.766000 1.722922 1.774837 1.874594 2.028301
329 12 1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
333 12 1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
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 [ ]: