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 = 2459816
Date = 8-24-2022
data_path = "/mnt/sn1/2459816"
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)
505 sum files found between JDs 2459816.25313 and 2459816.38386
505 diff files found between JDs 2459816.25313 and 2459816.38386

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.019697 1.028386 1.242401 1.363607 2.042754 2.000253 2.357433 2.362397 1.883645 2.150450
4 1 2 1.118960 1.048871 1.927779 2.386472 2.279143 2.231071 2.347503 2.550386 2.161164 2.655426
5 1 2 0.918692 0.944540 1.812746 1.192401 1.966280 1.920610 2.373812 2.149750 4.234159 4.266161
7 2 0 0.999759 0.941637 1.242542 1.292151 1.921660 1.904058 1.976911 1.831622 1.952862 2.044456
8 2 0 1.278866 21.201476 2.422494 49.456473 2.373729 84.483859 3.112063 85.982399 3.214805 101.189514
9 2 0 0.945878 0.988321 1.290083 1.202630 1.919448 2.064647 1.932922 2.081648 1.763269 2.062161
10 2 1 0.958440 1.084375 1.184219 1.369254 1.650977 1.659424 1.913019 2.690530 2.179443 1.882985
15 1 3 1.064230 1.085283 1.393256 1.077027 2.278575 2.148529 2.475820 2.158536 5.980454 4.471152
16 1 3 0.996273 1.052865 1.395646 1.240639 2.157251 2.339703 2.428325 1.933109 4.169445 3.031395
17 1 3 1.017010 0.976541 1.150667 1.005516 2.189315 1.716456 2.254296 1.814750 2.117112 2.249002
18 1 0 55.041737 13.640849 1.907193 1.341738 253.321380 55.358710 2.067526 1.950661 1.793386 1.950124
19 2 1 1.010881 1.018878 2.182171 1.928832 2.293274 1.585887 2.107032 1.791963 2.092886 3.943677
20 2 1 0.974717 0.997085 1.402312 1.128403 1.789589 1.799205 2.150337 1.935773 1.928591 1.938128
21 2 2 0.934643 0.995056 1.230651 1.184934 1.889592 2.050429 2.310190 2.226011 2.017303 2.411837
27 1 0 4.175959 3.083404 6.116142 18.600855 11.444207 6.153749 3.023151 2.266309 3.391893 2.247180
28 1 0 41.747147 1.440464 2.883938 1.378448 202.101987 2.664049 2.198884 2.050247 2.997058 3.483700
29 1 1 1.187983 1.027264 2.044668 1.289435 2.269606 1.876342 2.735536 2.637148 3.870081 2.785769
30 1 1 0.999684 1.089216 1.323999 1.151661 1.724172 2.247117 3.228217 3.366339 2.409096 5.314881
31 2 2 1.044225 1.185442 1.151741 1.058610 2.127701 2.085682 3.124263 6.101137 3.889056 9.027072
32 2 2 1.458526 1.748578 1.511422 1.213518 2.515350 2.555052 4.948297 5.505835 5.417275 6.799663
33 2 3 65.442469 1.067362 1.218527 1.845487 329.105786 1.874423 1.892088 2.021524 2.139602 2.420089
36 3 3 1.117528 1.117680 1.439235 1.204934 2.057642 1.923194 2.151383 1.847444 2.102272 1.910882
37 3 1 1.020763 0.967173 1.444811 1.232668 2.471182 2.133209 2.560728 2.173907 3.348755 3.241751
38 3 1 1.014123 1.249152 1.361570 1.197360 2.034928 1.951295 2.054528 2.352971 1.926805 1.976731
40 4 1 1.296844 1.124748 1.652306 1.270397 1.839869 2.308908 1.964937 2.336318 1.775149 2.224398
41 4 3 nan nan nan nan nan nan nan nan nan nan
42 4 0 1.204880 1.113632 1.223538 1.317159 2.114390 2.007043 2.113701 2.270077 2.030793 3.069730
45 5 0 1.197053 1.108400 1.780975 1.262511 2.528865 1.935175 2.754160 2.366996 2.652123 2.485068
46 5 0 1.161821 1.151497 2.849337 1.360933 2.261536 2.072817 2.162235 2.078723 1.962072 2.305705
50 3 3 0.984457 0.901786 1.337938 1.288773 1.854556 1.913130 2.074247 1.908851 1.730337 1.859501
51 3 2 nan nan nan nan nan nan nan nan nan nan
52 3 3 1.231241 1.309951 1.665322 2.221802 2.000038 2.120302 2.276488 2.354229 2.061565 2.280409
53 3 2 nan nan nan nan nan nan nan nan nan nan
54 4 0 1.046763 1.024363 1.057559 1.121896 2.229336 2.082012 2.056386 1.962328 2.683143 2.537732
55 4 2 1.015843 0.992558 1.542263 1.212214 2.005870 1.741610 2.192440 1.823043 2.405385 1.804545
56 4 1 1.120954 1.069571 1.363133 1.486415 2.102010 1.922843 2.210794 2.224774 2.134922 1.960487
57 4 3 nan nan nan nan nan nan nan nan nan nan
65 3 0 nan nan nan nan nan nan nan nan nan nan
66 3 0 nan nan nan nan nan nan nan nan nan nan
67 3 0 nan nan nan nan nan nan nan nan nan nan
68 3 1 1.082431 1.120736 1.316025 1.516157 2.080667 1.841346 2.123612 2.147890 2.019455 2.501486
69 4 1 0.986244 1.189961 1.142983 1.650074 1.760222 2.413035 2.297500 2.565258 2.133908 2.790639
70 4 2 1.471302 1.669462 1.594255 1.746522 3.745905 2.324159 3.886391 2.572206 2.632536 2.601242
71 4 2 1.341644 1.230937 1.312760 1.276454 1.757948 1.882684 2.277273 2.171249 1.905995 1.928809
72 4 0 1.076656 1.288682 1.549793 1.684558 2.437499 2.665258 1.929225 2.231088 2.367024 3.013922
73 5 0 1.005463 2.534315 1.305922 4.137279 2.131889 7.595038 2.076661 1.796897 2.719703 1.765567
81 7 0 1.290595 1.161653 1.761904 1.459502 2.420039 2.002470 2.491859 1.896919 6.573537 3.018792
82 7 0 0.940226 1.027754 1.110773 1.555722 2.082217 1.790113 2.104893 2.203043 2.160739 2.182574
83 7 0 1.042283 1.044303 2.007522 2.214960 2.200094 1.776197 2.540991 2.243828 2.923900 1.853628
84 8 3 1.565174 1.750427 1.415093 1.395088 2.930830 3.110026 2.920683 2.618568 4.284327 4.320188
85 8 0 1.032317 1.148204 1.969127 1.518181 2.104414 2.143156 2.585939 2.711716 3.009657 3.579053
86 8 0 1.577213 1.155071 2.441487 1.641788 3.003255 1.955797 3.577488 3.901145 2.407451 5.121229
87 8 2 1.115798 1.170552 1.513951 1.593389 2.087440 1.949420 2.364762 2.547502 2.483596 3.777619
88 9 0 0.951070 33.135399 2.242690 140.390601 1.945308 97.396297 2.339756 96.376312 2.587895 141.637889
90 9 0 1.078984 1.078988 1.792506 2.446545 1.946130 1.934436 1.777478 2.195117 2.205409 2.301944
91 9 1 0.812092 24.842229 1.854333 66.617245 1.848094 97.311055 1.910943 98.175499 2.239225 117.276661
92 10 0 2.865558 1.629934 0.669631 0.947005 2.587473 2.912936 4.191362 2.300543 3.577153 2.753338
93 10 0 1.017526 1.082874 1.397123 1.034275 2.381221 2.025780 2.587633 2.036007 2.293244 2.298700
94 10 0 1.017080 1.338696 1.335685 2.031268 2.411239 2.657732 2.890213 2.878538 2.157870 6.839416
98 7 2 1.024143 1.008827 1.362813 1.466718 1.928209 1.865950 2.304132 1.961783 2.425399 2.210069
99 7 2 0.958160 0.981401 1.511191 1.380728 1.959138 1.870863 2.494766 2.054476 4.175556 2.340402
100 7 1 1.143536 1.055114 1.457577 1.548059 2.240696 1.893285 2.532216 2.150172 2.488277 2.061260
101 8 2 1.147550 1.252661 1.367163 1.655716 2.034812 1.908111 2.158331 2.391029 2.130915 3.293045
102 8 0 1.317200 1.320350 2.344391 5.482483 2.808269 2.416105 2.462244 3.007098 2.861145 2.735804
103 8 1 1.158630 1.033056 1.551813 1.324309 1.994619 1.681078 2.374733 2.228924 2.371390 1.979798
104 8 1 2.328091 1.120208 0.304367 1.253564 2.724154 2.058505 3.936787 2.200654 3.794635 2.025503
105 9 1 0.952020 1.033680 1.636339 1.257789 1.679193 1.595485 2.167996 1.834243 2.431190 2.133209
106 9 3 1.049186 1.046230 2.467444 1.044472 2.157377 1.844894 2.580618 2.497340 2.814472 1.674614
107 9 0 1.069559 20.582413 2.163678 48.878744 2.327383 87.525871 1.822087 87.131518 3.168299 105.083985
108 9 1 0.987776 0.991737 1.488154 1.209687 1.972780 2.175857 1.990716 2.014853 2.284392 2.145147
109 10 1 1.360035 1.397595 1.367461 1.254130 2.965143 2.567296 2.448044 2.424472 2.197967 2.052728
110 10 1 1.013478 1.499557 1.455572 0.748917 2.198906 2.402330 2.083991 2.079548 1.679818 1.742137
111 10 1 1.158614 1.237953 1.549229 1.345950 2.123907 2.233968 1.941272 2.165311 1.738520 1.874273
112 10 2 0.986884 1.105992 1.338733 1.435882 1.818152 1.754675 2.252221 1.949518 1.805488 2.092854
116 7 2 1.196581 0.970279 1.399706 1.289696 3.055974 2.023740 2.374800 2.094722 3.066869 2.207134
117 7 3 0.997455 1.117259 1.377918 1.712433 1.987177 1.925755 2.083133 2.450975 2.702901 3.393552
118 7 3 1.738933 1.062069 3.733395 1.386593 2.730528 2.052678 3.274423 1.959732 3.510208 2.746794
119 7 1 1.071307 0.820155 1.371237 1.563517 2.199374 1.806239 2.514009 1.861930 5.907367 2.426257
120 8 1 3.189348 1.381615 9.077153 3.115600 6.817441 2.493289 7.189315 1.731669 23.114802 2.306906
121 8 3 1.983400 1.895904 3.099144 1.174958 5.308799 4.506482 3.901014 2.576821 4.396125 15.730215
122 8 2 1.304858 1.394054 1.416726 1.412947 2.685739 2.907496 2.347738 2.070765 2.867998 3.340536
123 8 3 1.053578 1.103936 1.513493 1.350349 1.942619 1.983693 2.272294 2.148705 2.393085 2.032427
125 9 3 2.577839 1.151917 2.161964 1.642915 6.557636 2.044764 4.905383 1.750845 23.935698 2.580657
126 9 3 0.958892 1.727952 1.916951 2.590636 1.948074 3.802296 1.910447 2.009684 2.143933 2.536193
127 10 2 1.131778 1.251118 1.720217 1.233701 2.791946 2.922437 3.733596 2.842958 3.230054 3.539473
128 10 2 1.022550 1.100024 1.158130 1.394429 1.943346 1.929904 1.940511 2.193797 2.185558 2.474076
129 10 3 1.128508 0.973766 1.464067 1.286082 2.000616 1.818347 2.392540 1.879797 1.998470 2.138800
130 10 3 1.096583 1.176633 1.307184 1.226222 1.902654 2.180674 2.194367 2.082790 1.893951 2.062405
135 12 2 1.058755 1.267457 1.360756 1.385154 2.188588 2.798626 2.481781 2.443945 2.706936 2.345693
136 12 2 1.111738 1.143060 1.029830 1.224001 1.925802 2.069781 3.317885 2.386326 1.689477 2.346567
137 7 3 4.412646 27.343162 15.981722 90.282450 13.733853 98.071630 4.877024 88.733063 8.652377 118.572055
138 7 1 2.916510 3.096058 1.639144 5.455590 3.526331 4.855207 1.690536 3.744051 1.812584 7.564618
140 13 2 3.565741 6.740572 9.255992 40.807958 4.685250 3.926953 4.088557 11.718986 4.436158 25.274814
141 13 2 5.337799 1.170639 10.962965 1.319397 19.328452 2.238017 11.474615 1.948093 10.879456 2.166368
142 13 2 2.594258 1.442778 5.945640 1.512988 5.658723 2.673346 2.754494 1.723653 3.488405 3.987004
143 14 2 0.944006 1.096377 1.240930 1.091291 1.630351 1.880691 2.043648 2.333058 1.703865 1.961824
144 14 3 1.136875 1.189889 1.283794 1.268632 2.255065 1.936527 2.023667 1.962020 1.875261 2.052119
145 14 3 4.096973 3.275197 23.172376 18.555628 13.765521 11.213472 3.404016 1.860401 2.937827 1.686998
150 15 1 3.486430 2.383537 19.520085 42.506074 4.715661 6.117334 3.124722 2.193277 2.711735 1.989774
155 12 2 2.600201 2.097505 8.088299 18.999659 3.088063 4.578429 3.187194 2.411266 3.112230 1.965449
156 12 3 1.198573 1.040585 1.349137 1.364428 2.372128 2.026686 2.417721 2.153038 2.332116 1.688292
157 12 3 1.033468 1.051860 1.303874 1.233832 2.015468 2.114291 2.055983 2.013977 1.797916 2.034961
158 12 3 1.108718 1.057835 1.351014 1.138580 2.624317 2.035743 2.487832 2.501175 2.993003 2.616874
160 13 3 3.740681 5.440164 10.925017 25.283969 10.251188 10.789139 3.510266 4.743864 3.312184 10.904283
161 13 0 3.120454 1.217037 1.235829 1.369600 5.186195 2.068017 3.434864 1.990926 4.916692 4.579281
162 13 0 0.974526 0.993219 1.613299 1.186298 2.498167 2.107592 2.246717 1.962888 1.875529 1.757545
163 14 2 1.065868 1.075335 1.528018 1.312850 1.831381 1.717896 2.398871 2.260921 2.202641 3.709151
164 14 2 1.006896 0.925604 1.143148 1.156781 1.773269 2.128965 2.046992 2.749587 1.858126 2.207047
165 14 0 3.431643 3.445475 3.982260 3.352205 10.546883 8.158294 3.927135 5.352693 5.293285 5.546471
166 14 0 1.048885 1.133623 1.233742 1.199373 2.488948 1.951155 2.299004 1.702029 2.253407 2.591639
167 15 1 2.529787 7.117955 2.061860 38.457930 3.976586 2.725364 2.421913 2.313677 2.625275 2.024448
168 15 2 1.318269 1.084218 3.231547 2.029729 2.167934 1.998806 2.951603 2.842983 5.155745 3.999878
169 15 2 1.285597 6.960819 2.205918 31.687349 2.264972 3.641813 3.080148 7.115875 5.249977 9.968010
170 15 2 1.307387 11.416470 2.750743 54.288451 3.087041 17.981650 2.804245 19.914151 2.973863 24.720051
176 12 0 0.937818 0.945507 1.361822 1.198030 2.038387 1.719674 2.356918 1.947459 2.120417 1.754946
177 12 0 1.018261 1.050457 1.445281 1.381876 2.117937 2.031882 2.153799 1.930615 2.207423 1.989224
178 12 0 0.964744 1.023346 1.135343 0.917882 1.949689 1.762541 2.147958 2.118044 1.992783 1.937312
179 12 1 1.140163 1.191490 1.126162 2.737547 2.193513 1.870357 4.082291 2.523218 2.545843 3.846225
180 13 3 2.042821 1.193096 10.425568 1.267126 4.535677 2.386904 2.538318 2.022699 2.633191 2.068124
181 13 3 3.030091 5.270520 1.031142 10.072452 3.740078 7.055267 1.832613 1.657117 1.979127 2.028651
182 13 0 5.625164 1.299019 10.760394 2.049765 17.454871 3.376538 2.823438 1.959311 2.854852 2.907400
183 13 1 1.131593 1.019611 1.271047 1.236293 2.137423 1.852033 2.107735 2.100414 2.112003 2.265087
184 14 0 0.948685 0.991449 1.071250 1.178042 1.794290 1.873947 2.094425 2.248325 2.151416 3.113161
185 14 1 0.952727 1.163067 1.026687 1.390684 1.813589 1.888777 2.082048 2.751863 1.848550 1.956431
186 14 1 1.028714 1.120708 0.870514 1.577442 1.685480 2.021999 1.953807 2.166585 1.928156 2.417411
187 14 1 1.002532 1.531601 1.437922 1.785269 2.342401 2.814133 2.829562 3.530038 2.414925 3.126895
189 15 3 1.000157 1.004024 1.235268 1.413167 1.798690 2.122408 1.691489 2.029872 1.801531 2.382388
190 15 3 4.000197 1.947309 13.105813 1.041340 5.378000 2.699660 3.121000 2.720942 3.092896 3.712485
191 15 3 1.033231 1.072367 0.884585 1.206756 1.975294 2.195237 2.312608 2.253891 1.777486 1.965545
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 0.095211 0.075765 0.053783 0.016487 0.128265 0.060592 0.041626 0.018148 0.036292 0.018685
206 19 0 0.086066 0.074111 0.021232 0.018242 0.079930 0.061963 0.019331 0.017978 0.020823 0.021107
207 19 1 0.062324 0.060556 0.017357 0.025809 0.067475 0.062905 0.016572 0.016095 0.017234 0.016304
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.071100 0.069209 0.017822 0.017182 0.079389 0.054437 0.017790 0.016939 0.018233 0.016829
224 19 1 0.037048 0.034658 0.008054 0.005937 0.043328 0.038941 0.011576 0.006166 0.016559 0.009816
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 nan nan nan nan nan nan nan nan nan nan
321 2 3 1.158500 1.025902 1.756415 1.952909 1.783530 1.566868 1.776947 1.727114 1.824394 1.766047
323 2 3 1.208434 1.769425 3.227280 4.288566 2.241938 3.263325 2.489044 1.846136 1.676604 2.455537
324 4 3 nan nan nan nan nan nan nan nan nan nan
329 12 1 1.112665 1.411667 2.774918 4.262201 2.569929 1.894804 1.998542 1.844694 1.959509 1.930959
333 12 1 1.459793 1.406887 1.627814 1.378188 2.595615 2.823046 2.030389 1.835017 1.818034 1.808834
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 [ ]: