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 = 2459808
Date = 8-16-2022
data_path = "/mnt/sn1/2459808"
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 2459808.25312 and 2459808.33611
372 diff files found between JDs 2459808.25312 and 2459808.33611

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.148200 1.280588 1.155877 1.258777 2.204053 1.954815 1.923640 1.711203 1.689275 1.916842
4 1 2 1.107403 2.445055 1.756675 4.251173 1.784818 1.716212 1.710712 1.941769 1.678514 1.838794
5 1 2 0.913195 0.978728 1.710640 1.098239 1.833155 1.783907 2.056150 1.913936 4.407297 5.008655
7 2 0 1.023194 0.973367 1.262491 1.147963 1.613103 1.736358 1.808962 1.764727 1.725713 1.657721
8 2 0 0.984968 5.609596 2.676754 34.826423 1.619272 17.590349 1.690207 8.019301 2.300062 31.072567
9 2 0 0.856693 1.002236 1.144350 0.995378 1.703725 1.674533 1.888500 1.886230 1.628623 1.851334
10 2 1 0.879259 0.999384 1.100515 1.901027 1.545358 1.871604 1.591981 2.075627 1.637419 2.187640
15 1 3 0.912402 1.022905 1.144617 1.005454 1.792693 1.848943 1.716648 1.865681 2.909842 2.295167
16 1 3 0.917639 0.915962 1.230500 0.927490 1.741516 1.771931 1.745130 1.674240 3.124285 2.314320
17 1 3 0.988670 0.855900 1.098617 0.921177 1.955506 1.745948 1.896326 1.778181 1.824975 2.160392
18 1 0 38.023712 4.821333 3.302164 2.276314 176.474840 16.031711 1.637841 2.007533 1.450297 1.832644
19 2 1 0.906960 0.896847 1.081349 1.174221 1.722985 1.763464 1.703994 1.808886 1.514464 1.758157
20 2 1 0.936273 1.013250 1.185719 0.985656 1.642054 1.572656 1.635367 1.798879 1.572482 1.671690
21 2 2 nan nan nan nan nan nan nan nan nan nan
27 1 0 6.225098 4.553988 7.166490 17.313602 14.148067 6.826652 3.409317 1.846595 3.361060 1.769058
28 1 0 77.852063 0.928035 3.968857 1.318154 370.429257 1.566503 1.648143 1.799954 1.401810 2.007095
29 1 1 1.090182 0.960803 1.353278 1.201915 1.800215 1.794093 2.519842 2.743101 3.889844 3.803837
30 1 1 1.047339 0.903756 1.252712 1.026461 1.803674 1.717475 3.229830 2.938417 2.277911 4.885121
31 2 2 nan nan nan nan nan nan nan nan nan nan
32 2 2 nan nan nan nan nan nan nan nan nan nan
33 2 3 42.525893 1.035706 3.848967 0.964318 212.379426 1.633546 1.609157 1.689311 1.595317 1.543849
36 3 3 0.898294 0.820718 1.273880 1.152034 1.792307 1.513823 1.729875 1.697329 1.527948 1.390290
37 3 1 1.014617 0.936062 3.319694 1.449917 2.322013 1.681437 1.973405 1.728843 2.399593 2.359391
38 3 1 0.917046 1.167960 1.295929 1.161889 1.673822 1.918760 1.752897 1.873052 1.536542 1.767421
40 4 1 nan nan nan nan nan nan nan nan nan nan
41 4 3 0.893977 0.927804 1.428946 2.808878 1.980887 2.103511 2.096561 1.820250 1.849106 2.018260
42 4 0 1.182070 1.122529 1.332673 1.120378 2.381428 1.851113 1.891218 1.883179 1.934056 2.954269
45 5 0 1.177768 1.052341 2.061648 1.215569 2.584748 1.834419 2.315604 2.027004 2.041190 1.922368
46 5 0 0.885267 0.971671 0.981049 1.097495 1.569903 1.759627 1.581905 1.662857 1.373251 1.750861
50 3 3 0.805896 1.427998 1.297161 1.131504 1.705158 2.097222 1.707302 2.130568 1.680189 1.996951
51 3 2 3.241970 1.197814 8.161381 1.230962 1.649095 1.930383 1.618735 1.677660 1.464521 1.604163
52 3 3 0.908796 0.873660 1.811368 1.506134 2.253785 1.835752 1.953885 1.855628 2.028580 1.662380
53 3 2 0.846213 1.223600 1.294483 1.781692 1.850341 2.552427 1.943101 2.243923 2.731624 2.834026
54 4 0 1.032286 1.062622 1.052765 1.043306 1.896257 1.934306 1.577827 1.789408 2.136288 2.052746
55 4 2 1.013729 1.121899 1.534471 1.140570 1.919424 1.665641 1.952782 1.848698 2.344593 1.918285
56 4 1 nan nan nan nan nan nan nan nan nan nan
57 4 3 1.029704 1.119342 1.326421 8.288428 1.882733 3.607468 1.795024 1.620020 1.623710 2.041327
65 3 0 0.979368 1.043586 1.426074 0.990603 1.870556 1.719966 1.809573 1.736611 1.577822 1.677893
66 3 0 1.027408 0.972697 1.932742 1.187860 2.510771 2.027884 2.041041 1.563760 2.164323 2.069200
67 3 0 0.893819 1.075873 1.206190 1.257876 1.681940 1.949282 1.606486 1.925090 1.604396 1.674354
68 3 1 0.936230 1.105581 1.333784 1.425751 1.580740 1.868575 1.700006 1.641760 1.527621 1.906756
69 4 1 nan nan nan nan nan nan nan nan nan nan
70 4 2 1.301369 1.198049 1.200329 1.510007 2.866620 2.409906 3.087638 2.502449 2.255627 2.081373
71 4 2 1.141746 1.053533 1.458975 1.145885 1.681550 1.998413 1.805725 1.683443 1.606022 1.539178
72 4 0 1.084396 1.629074 1.470310 1.651285 2.439846 2.393767 1.885177 2.074135 3.787815 4.140461
73 5 0 0.839262 1.915230 1.306949 5.037785 1.722155 3.879371 1.644716 1.759093 2.012408 1.799015
81 7 0 1.268142 0.998096 1.657832 1.219736 1.958467 2.105609 2.139732 2.061481 7.471660 3.422307
82 7 0 0.800726 1.096604 1.151049 1.294478 1.666858 2.031184 1.830028 1.754868 1.675420 1.933241
83 7 0 0.934553 1.087759 1.667135 2.242610 1.748599 1.668731 2.292428 2.295046 2.409347 2.051536
84 8 3 0.987527 1.061239 1.489824 2.872324 2.105100 1.956478 1.860860 1.991790 6.133545 7.073174
85 8 0 0.864427 1.128840 1.144889 1.222706 1.812823 1.959820 1.874120 2.418899 2.219275 3.253561
86 8 0 1.846002 1.350763 2.331504 1.188529 2.892155 2.078770 4.499725 5.057109 2.418646 3.886862
87 8 2 0.796739 0.896580 1.572460 1.379805 1.653353 1.746199 1.717615 2.160852 1.954371 3.276683
88 9 0 2.162011 5.553013 15.290004 35.993447 5.264636 33.543521 4.217997 3.702916 6.326970 2.339515
90 9 0 0.905647 0.864517 1.806926 1.991990 1.787809 1.669819 1.654778 1.765621 2.123096 2.362276
91 9 1 2.774452 1.379747 13.066414 1.114662 5.387613 1.790738 5.402548 1.504625 7.598009 1.826853
92 10 0 nan nan nan nan nan nan nan nan nan nan
93 10 0 nan nan nan nan nan nan nan nan nan nan
94 10 0 nan nan nan nan nan nan nan nan nan nan
98 7 2 1.656311 0.953107 1.383943 1.086735 4.106262 1.511280 7.359549 1.659969 50.590764 1.977653
99 7 2 0.839909 0.909708 1.216597 1.208510 1.764553 1.711284 1.766211 1.646896 2.525972 3.447389
100 7 1 1.309052 1.097341 2.130671 1.496206 2.066261 1.927098 1.795088 1.605022 1.625734 1.741678
101 8 2 0.852600 0.810726 1.099217 1.550321 1.833592 1.796532 1.747837 1.784102 1.639681 2.167740
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 0.935123 0.947875 1.338343 1.039792 1.869699 1.688233 1.907615 1.774538 2.894735 1.583101
104 8 1 2.008188 0.832493 0.383448 1.338365 2.392803 1.710428 3.648438 1.827845 3.245729 1.902227
105 9 1 0.900955 3.544593 3.031183 20.732196 2.007834 10.727860 2.198998 5.093528 2.564471 19.214430
106 9 3 0.878497 0.948528 2.900811 1.359243 1.838835 1.711200 2.079426 1.878338 2.079442 1.581078
107 9 0 4.517754 2.447274 14.428704 1.962033 7.755583 2.600459 7.201568 2.073567 7.033758 1.821684
108 9 1 1.904137 1.363532 7.627094 5.339773 2.279085 1.938570 3.120298 1.901771 3.215984 2.007567
109 10 1 1.581247 1.476162 1.314959 1.237995 3.543000 4.122846 1.913195 1.851793 1.847740 2.189528
110 10 1 1.003665 1.812132 1.723359 1.513895 2.200810 2.561886 1.725720 2.557568 1.765924 2.011371
111 10 1 0.946119 1.081862 1.391284 1.225761 2.021763 2.135197 1.890161 1.831992 1.567657 1.777907
112 10 2 0.968725 4.121041 1.473207 3.629148 1.741558 2.633787 1.795329 1.682150 1.774025 1.752632
116 7 2 1.098443 0.939402 1.015039 1.148406 2.133135 1.842580 1.639561 1.771620 1.857677 1.662753
117 7 3 1.021341 1.157923 1.479278 1.194133 1.673407 1.568816 1.622970 2.019227 2.017930 3.248968
118 7 3 1.873175 1.043522 3.936509 1.244738 2.489100 1.821609 3.016006 1.920913 3.289462 2.751045
119 7 1 0.973706 0.816148 1.234465 1.540240 2.383354 1.833158 2.289048 1.907505 5.909442 2.066863
120 8 1 4.884922 1.016131 11.911826 2.610146 7.879355 2.067465 9.706180 1.697307 26.022220 1.876291
121 8 3 1.508251 1.848493 1.538511 1.027464 4.141455 3.977028 3.014649 2.385451 4.170524 5.479613
122 8 2 1.124947 1.037230 1.526319 1.149880 2.716946 2.193430 2.233961 1.911188 2.537609 2.906948
123 8 3 0.842959 0.800914 1.332523 1.217537 1.728548 1.795735 1.673224 1.645642 1.585569 1.752435
125 9 3 1.249982 9.406403 3.280950 53.539755 2.954742 29.210753 2.570304 21.596873 4.434345 47.074386
126 9 3 0.958811 1.239774 3.094160 7.851970 1.899099 2.264353 2.071514 1.971359 2.173946 1.919170
127 10 2 1.364099 1.782393 1.606594 1.164980 3.536238 4.308491 4.339853 4.257678 5.563471 5.411568
128 10 2 1.296714 1.108472 1.245829 1.195841 1.828075 1.783302 1.648637 1.787248 1.977029 2.128129
129 10 3 1.565346 0.912055 1.743737 0.946791 2.584834 1.674129 1.800895 1.666435 1.629380 1.476419
130 10 3 1.335136 1.493787 1.503276 1.110772 2.038732 1.607332 1.723093 1.742229 2.031457 1.518736
135 12 2 0.983399 1.152737 1.294156 1.194161 1.875076 2.415637 2.132443 2.143998 2.109477 2.422492
136 12 2 1.051842 0.951727 1.976553 1.099161 1.847407 1.805619 3.927451 2.410933 1.858709 2.092732
137 7 3 3.763224 2.655534 6.765611 19.852015 10.473309 4.534431 4.122503 2.806865 6.726716 2.452141
138 7 1 0.947586 2.476207 1.022896 5.854483 1.921951 5.361416 1.870335 3.092065 7.216274 6.303256
140 13 2 3.031892 3.774234 13.134583 28.162075 4.480708 3.074815 3.408925 4.241662 4.221312 7.033787
141 13 2 5.369442 0.995547 7.042101 1.036019 20.589511 1.868010 12.272472 1.710125 10.294150 1.724474
142 13 2 6.046839 1.611073 7.640404 1.661596 6.036824 1.917907 2.817339 1.821699 3.523696 4.044861
143 14 2 1.025747 1.114682 1.484620 1.009707 1.687896 1.432896 1.904154 1.607848 1.710869 1.472511
144 14 3 1.155559 1.175587 1.026938 1.025713 2.036763 1.703257 1.733845 1.568680 1.858290 1.663484
145 14 3 4.624143 6.433186 20.947810 19.186726 17.534413 19.710482 2.765985 1.902644 2.791251 2.053800
150 15 1 3.272903 11.150019 23.354699 48.620808 4.461247 9.788656 4.900744 20.206729 5.795524 35.218839
155 12 2 3.111330 4.727666 9.709736 23.257639 3.582122 3.946676 3.127773 2.617608 3.154662 1.876911
156 12 3 1.051788 0.954366 1.049381 1.288079 2.283201 1.699412 1.635863 1.829615 1.617086 1.681958
157 12 3 0.968275 0.916050 1.511349 1.055975 2.142873 2.024813 2.074851 1.732944 1.971378 1.757787
158 12 3 0.964532 1.001421 1.795173 1.188802 2.434538 1.728218 2.496556 1.915713 4.081176 2.033735
160 13 3 5.554383 12.142997 15.908558 72.232488 6.875164 10.047216 6.259703 22.737076 8.429872 42.292178
161 13 0 3.319878 1.171985 1.989175 1.074359 4.480341 1.936128 3.156335 1.733241 5.476935 4.322816
162 13 0 0.940255 0.941107 1.327143 0.990089 1.850099 1.808660 1.940924 1.714566 1.614034 1.670566
163 14 2 0.843051 1.000592 1.266216 1.054039 1.587438 1.901936 1.806931 1.925072 1.504138 2.012920
164 14 2 0.925750 0.886556 1.137997 0.973716 1.609654 1.890509 1.665874 2.156666 1.508655 1.806462
165 14 0 4.366476 6.300556 6.125637 8.994811 14.938850 14.291971 4.101627 4.941847 17.060988 8.226986
166 14 0 0.972819 1.317282 1.272756 1.187456 1.793262 2.034403 1.897941 2.650275 1.676732 2.367826
167 15 1 1.649982 1.647224 3.475714 1.646954 2.226376 2.016012 2.523665 1.802290 2.333714 1.686635
168 15 2 1.018480 0.898617 3.467233 2.365220 2.176949 1.613242 2.424543 2.048272 3.711040 2.552838
169 15 2 1.079981 5.222562 3.295406 37.211550 2.136222 1.728239 2.732105 3.317609 5.580652 6.551408
170 15 2 1.392004 5.257843 3.264151 35.538619 2.652721 5.054662 3.426711 6.181003 6.043920 10.654159
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.123984 0.956519 1.068197 1.251618 2.192908 1.715999 3.980023 2.419473 3.925850 2.974170
180 13 3 1.807509 0.936004 7.449872 1.135140 3.729057 2.107274 3.145341 1.893836 2.993386 1.972123
181 13 3 1.614494 5.068484 0.844072 12.474617 3.452051 7.146147 2.084796 1.794953 2.249653 2.789550
182 13 0 0.971917 1.232949 1.490463 3.009056 1.837963 3.304587 1.856237 1.965254 1.933053 2.785338
183 13 1 1.041184 1.107775 1.135971 1.134958 1.980057 1.955243 1.673523 1.965778 2.009271 2.566185
184 14 0 0.981950 0.977175 1.043680 1.094285 1.616162 1.827226 1.534569 1.922552 1.635252 1.748870
185 14 1 0.899020 1.094883 1.020411 1.497492 1.685988 1.873271 1.923052 2.445247 1.709365 1.894148
186 14 1 0.956092 1.125792 0.930379 1.402987 1.922747 1.812422 2.050875 1.949908 1.731726 2.032170
187 14 1 0.841563 1.142077 1.312056 1.537546 1.846336 2.560623 2.410223 3.543998 5.055149 7.689596
189 15 3 0.874443 0.971602 1.216734 1.077679 1.762166 1.745617 1.674499 1.730467 1.798597 1.974618
190 15 3 3.585969 2.305478 12.203287 0.859321 5.412569 2.244786 3.021800 2.318260 3.099616 3.330784
191 15 3 0.866914 0.954125 0.964637 1.162299 1.619049 1.897086 1.687333 1.889468 1.680416 1.745132
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.125280 0.848520 3.073114 1.677928 2.990419 1.651444 2.320310 1.941060 2.088588 1.986603
206 19 0 0.865271 0.860891 1.809612 1.383038 1.732664 1.764567 2.015171 1.701810 2.332353 1.466662
207 19 1 0.807886 0.825029 1.697533 2.570935 1.692301 1.680815 1.789945 1.764288 1.874184 1.883981
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.917924 0.842558 1.356918 1.689048 1.727829 1.475692 1.816801 1.716030 1.831008 1.566445
224 19 1 0.846123 0.773432 3.138211 2.315719 1.748489 1.478928 3.667731 1.700473 6.097620 2.826056
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.111824 5.656245 10.111426 27.362533 7.607882 7.578060 6.796182 3.715154 6.242984 3.438230
321 2 3 2.024176 1.806435 1.921188 1.817526 1.720982 1.625226 1.715644 1.890084 1.779463 1.621496
323 2 3 0.783852 1.607979 2.539338 3.716706 1.992530 2.989916 1.925897 1.870469 1.792040 2.076421
324 4 3 1.146633 2.819123 1.829660 1.848517 1.943397 3.643689 1.610055 1.569822 1.782607 1.675469
329 12 1 2.851342 4.680099 8.299280 16.887316 1.557564 1.746850 1.693549 1.684802 1.662953 1.450132
333 12 1 1.348132 1.316679 2.018945 1.367892 1.621737 2.438385 1.643549 1.866969 1.794872 1.659992
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 [ ]: