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 = 2459825
Date = 9-2-2022
data_path = "/mnt/sn1/2459825"
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 2459825.25309 and 2459825.33609
372 diff files found between JDs 2459825.25309 and 2459825.33609

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 1.025932 1.012481 1.219134 1.272829 1.698653 1.974092 1.559706 1.689422 1.440670 1.839469
4 1 2 1.005476 0.881238 1.211001 1.251925 2.038369 2.012623 1.959989 2.032052 2.075334 2.000641
5 1 2 0.869591 1.061983 1.486897 1.480273 1.594748 1.932289 1.938317 1.866513 4.978447 5.439777
7 2 0 0.901956 0.913755 1.255478 2.204880 1.621825 1.870359 1.554814 1.773937 1.813220 2.654428
8 2 0 2.215939 22.189386 5.819052 44.998642 4.914821 90.678490 6.267084 84.497859 7.206136 96.506618
9 2 0 0.884171 0.908089 1.487689 1.109037 1.979558 1.864492 2.325768 2.026225 2.237467 1.969774
10 2 1 0.837738 1.050336 1.330344 1.296183 1.559013 1.723023 1.580836 2.173081 1.693112 2.034920
15 1 3 1.245730 1.294071 1.318991 1.313430 2.430644 2.449044 1.831154 2.016815 2.833840 3.351072
16 1 3 0.926383 1.028346 1.452709 1.375666 1.892891 1.993488 1.632617 1.787092 5.586618 2.248620
17 1 3 0.971071 1.063085 1.291554 1.331941 1.949972 2.178742 1.806042 1.786950 1.760392 2.249975
18 1 0 45.478430 13.575629 1.123774 1.277596 182.643663 43.629207 1.572283 1.693867 1.858367 1.856970
19 2 1 0.000000 0.000000 1.304060 1.351710 1.736006 1.857341 1.737772 1.665354 0.000000 0.000000
20 2 1 0.882064 0.958551 1.388756 1.207923 1.779346 1.850144 1.609642 1.761922 1.640496 1.706467
21 2 2 0.882459 0.828872 1.428952 1.389765 1.581523 2.079623 1.738832 1.943830 1.878341 2.428016
27 1 0 3.332468 3.098354 6.868382 14.011196 10.976734 5.648915 3.208605 2.499154 3.378882 1.836935
28 1 0 57.307892 1.402220 1.173850 1.525216 270.996710 2.266485 1.932943 1.978140 2.533551 3.125859
29 1 1 1.397379 1.101594 2.976336 1.254175 2.246473 2.062777 2.809802 2.016465 3.889377 2.583346
30 1 1 1.029762 1.062902 1.173748 1.181501 1.705982 1.804861 2.261525 2.906000 2.076844 4.399848
31 2 2 1.001382 1.262257 1.289535 1.267534 1.870694 2.019821 2.741798 5.763011 3.494560 8.207262
32 2 2 1.538045 1.349045 1.193497 1.226496 1.887032 2.226501 4.662145 5.568624 4.777041 5.717259
33 2 3 64.873792 0.846115 1.281122 1.534550 280.827160 1.886141 1.582552 1.766379 1.952874 2.045070
36 3 3 1.382802 1.279154 1.654854 1.471944 1.968431 2.322755 2.058537 1.960701 2.026229 2.246550
37 3 1 0.982198 0.868884 2.142121 1.307291 2.462165 2.182761 2.245387 1.739477 2.008492 1.956602
38 3 1 0.911730 1.039955 1.611268 1.153883 1.981590 2.210650 2.014008 2.060376 2.072257 1.969874
40 4 1 0.871814 1.103963 1.763609 1.238473 1.824459 2.093095 1.823044 1.923505 1.822061 1.954896
41 4 3 0.869538 1.192278 1.192618 1.707410 1.961093 1.777736 1.762078 1.644277 1.533024 1.728285
42 4 0 1.010788 0.958752 1.314381 1.487914 2.448089 2.297209 1.817909 2.089903 1.845404 3.714016
45 5 0 1.177533 1.137370 2.732848 1.339615 3.233489 1.914976 2.919288 2.222387 2.781432 2.225677
46 5 0 1.262980 1.228178 1.653385 1.471880 2.812051 2.331272 1.906688 1.622396 2.142711 2.109220
50 3 3 0.852385 2.783650 1.612829 1.138085 2.017509 2.234232 1.872664 2.458774 1.888288 2.497433
51 3 2 nan nan nan nan nan nan nan nan nan nan
52 3 3 1.372927 1.368176 1.375244 1.809423 2.516304 2.243394 2.097326 1.992359 2.065055 2.142677
53 3 2 nan nan nan nan nan nan nan nan nan nan
54 4 0 0.923688 0.878151 1.233755 1.295645 2.175180 2.216055 1.854262 1.791014 2.474801 2.681144
55 4 2 0.913374 0.895683 1.466935 1.267682 1.895175 2.045694 1.920326 1.736195 2.256328 2.052604
56 4 1 1.068839 1.234275 1.515473 1.354184 2.270418 2.273530 2.087273 2.211362 2.734801 3.063293
57 4 3 1.135343 1.225985 1.699808 2.295056 2.139601 3.094368 1.894757 1.942929 2.120489 2.155652
65 3 0 1.053109 0.977381 2.353735 1.341639 2.470306 2.096564 2.241774 1.721415 2.074178 1.934977
66 3 0 1.071000 0.939989 1.801098 1.365953 2.537190 1.956546 1.893447 1.749747 1.874139 1.942761
67 3 0 0.855502 0.924409 1.724890 1.399676 2.019538 1.887137 1.987938 1.800284 1.944562 1.976607
68 3 1 0.884541 0.828874 1.241346 1.409005 1.850890 1.966826 1.636496 1.874927 1.728340 2.503522
69 4 1 0.903384 1.250987 1.140647 1.529176 1.745004 2.131570 1.662100 1.963365 1.740112 2.592118
70 4 2 1.417097 1.444020 1.396843 1.408326 3.005554 2.493035 2.485751 2.473481 1.997616 2.636679
71 4 2 0.971471 1.234073 1.227220 1.360836 1.795636 2.177959 1.799908 1.735181 1.686297 1.857216
72 4 0 1.062722 1.621137 1.391792 1.925441 2.048881 7.166520 1.784494 2.387093 3.181529 3.985206
73 5 0 0.996858 2.316395 1.325215 4.678861 2.537421 6.062127 1.833014 1.683586 2.617651 1.845026
81 7 0 1.190399 1.885840 1.528779 1.579996 1.720464 3.150205 2.168676 3.254708 4.327536 4.950674
82 7 0 0.965866 0.944915 1.414197 1.326832 2.103043 1.890328 1.764457 1.828604 2.173123 2.330904
83 7 0 0.844384 1.026404 1.510951 1.839283 1.660325 1.743844 1.587535 1.777689 2.014111 2.042871
84 8 3 1.681695 1.950025 1.741471 2.214893 3.365185 4.148160 2.639087 2.673415 4.194291 4.211064
85 8 0 0.842455 0.942290 1.804399 1.252120 2.135054 1.811024 2.045090 2.383378 3.311175 4.298208
86 8 0 1.553812 1.404636 1.697795 1.392299 3.323258 2.479580 3.176777 5.537515 5.771551 8.270567
87 8 2 1.140100 1.438497 1.756643 1.438927 1.874238 1.777132 1.766782 1.923073 2.280605 2.660705
88 9 0 2.154526 28.802320 7.415955 129.478831 3.987528 100.358857 6.976792 88.600054 8.543107 136.580426
90 9 0 0.847534 0.901250 1.306627 1.248884 1.773996 1.674457 1.518139 1.598512 1.878757 2.140343
91 9 1 2.227864 22.323942 8.304354 57.323907 4.635826 98.547583 7.677488 91.383711 9.145262 106.326893
92 10 0 2.415891 1.587256 0.978154 0.951971 2.160793 2.602702 2.328809 2.137619 2.582158 2.328130
93 10 0 0.886893 0.940978 1.196888 1.010801 1.910297 1.946469 1.494773 1.750983 2.127597 2.304411
94 10 0 0.902598 1.261902 1.280639 2.258389 1.929275 2.716041 2.045954 2.591387 2.210946 7.027160
98 7 2 0.992803 0.756564 1.310799 1.469616 1.947965 2.043249 1.823436 1.838729 2.940963 2.146882
99 7 2 1.072640 1.166233 1.576675 1.453139 2.238649 2.185816 1.893266 1.668356 5.058354 9.000834
100 7 1 1.330386 1.124379 1.822253 1.916573 2.547422 2.220613 2.003550 1.900277 2.455087 2.484785
101 8 2 1.278576 1.409184 1.355600 1.540425 1.880761 1.920006 1.599327 1.901659 2.040881 2.923916
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.227565 0.971333 1.617686 1.405551 2.033524 1.834721 1.829139 1.749557 2.438886 2.113307
104 8 1 2.437940 1.288506 0.463279 1.345099 2.240511 2.079025 3.914778 1.799583 4.762423 1.783303
105 9 1 1.055650 0.915656 1.976794 1.584909 1.767030 1.808383 2.849615 1.766160 3.255524 2.683917
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 2.989435 15.997543 4.692228 29.246059 3.684765 63.534487 10.838539 61.113957 48.863346 66.163077
108 9 1 0.976840 0.807317 1.428556 1.238097 1.761717 1.977963 1.889213 1.824005 2.471339 1.906954
109 10 1 1.384287 1.934216 1.522983 1.666151 3.162783 5.261794 1.579835 1.746883 1.782451 1.894390
110 10 1 1.381768 1.693753 1.541293 1.401421 2.516282 2.464345 2.436484 2.499613 2.522039 1.750797
111 10 1 0.944908 1.120671 1.535277 1.471172 1.853106 2.065193 1.967495 1.683362 1.792790 1.856272
112 10 2 0.842695 0.827412 1.441272 1.085738 1.607312 2.067084 1.519402 1.788700 1.642456 2.016677
116 7 2 0.924689 0.866246 1.377326 1.376201 2.484268 1.930926 1.779901 1.690513 3.015235 2.128298
117 7 3 0.876811 0.940427 1.362895 1.504071 1.821748 1.754673 1.777946 2.073691 2.767122 3.090203
118 7 3 1.718695 0.998241 4.353873 1.419747 2.495748 1.925947 3.237827 1.951733 3.534473 3.191445
119 7 1 0.828342 0.914424 1.376392 1.692736 1.858420 2.036293 1.681937 1.813175 2.322005 2.375308
120 8 1 3.720514 1.004626 11.429354 2.730779 7.457952 2.460533 7.202911 1.677611 23.916983 2.263867
121 8 3 2.188046 1.975496 3.570344 1.347919 5.435384 4.903481 3.800970 2.475442 4.119676 14.524876
122 8 2 1.588760 1.329956 1.355651 1.762168 2.604705 2.262661 1.788707 2.380955 2.608816 3.950880
123 8 3 1.275798 1.186213 1.465301 1.486176 1.783836 2.112468 1.638791 1.841547 2.116378 2.654496
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 0.000000 0.000000 2.273792 1.163925 2.909591 2.585607 0.000000 0.000000 0.000000 0.000000
128 10 2 0.817821 1.049653 1.289008 1.523225 1.672925 2.332607 1.576091 1.789817 1.917833 2.442436
129 10 3 0.856615 0.873619 1.286938 1.332403 1.679011 1.894788 1.645050 1.637472 1.525515 2.161245
130 10 3 1.093334 1.080555 2.135682 1.409794 2.304355 2.208856 1.970600 1.806611 2.096458 2.472328
135 12 2 1.055605 1.021811 1.384178 1.288447 2.479057 2.122272 2.011659 2.326397 2.712507 2.089774
136 12 2 1.108211 1.300607 1.259503 1.377475 2.093109 1.958972 3.607269 2.329353 2.414397 1.907281
137 7 3 1.186264 23.844151 3.599824 76.677847 2.094314 88.825968 4.247526 80.063233 4.677919 101.175397
138 7 1 0.781824 19.426315 1.416608 75.366703 1.765102 67.319461 1.727334 61.356527 1.866121 72.820501
140 13 2 2.655969 2.200342 8.011790 18.075396 3.916146 2.172326 2.940681 2.432836 2.714387 1.877969
141 13 2 5.248750 1.245021 11.395504 1.295860 19.042267 2.044467 10.823805 1.586006 6.865843 1.995813
142 13 2 2.475855 1.529501 7.044247 1.409036 6.428061 2.246111 2.889490 1.516078 3.827275 3.392478
143 14 2 0.851509 0.885429 1.530377 1.293949 1.841287 1.983200 2.183134 1.796651 2.135572 2.181348
144 14 3 1.127133 1.242774 1.476577 1.420289 2.641557 2.042910 1.881199 1.751068 2.530010 2.047006
145 14 3 3.771218 4.787874 22.535049 20.963415 10.842845 10.096511 2.900800 1.937958 2.961757 1.808594
150 15 1 3.172183 4.458728 20.049160 45.384020 5.968306 6.563409 3.812463 8.073687 5.833261 11.868456
155 12 2 3.589829 2.294022 8.891082 21.514481 3.661032 4.425540 3.510488 3.076377 3.319375 2.155821
156 12 3 1.519536 1.313417 1.376902 1.483674 3.057728 2.453157 2.463575 1.879125 2.153031 1.820254
157 12 3 1.012887 1.155626 1.353361 1.404081 1.926114 1.967727 1.704300 1.776171 1.800947 1.847878
158 12 3 1.033690 1.823712 1.437735 5.245301 2.495175 4.189902 1.789685 2.021765 2.759393 2.133007
160 13 3 3.064108 6.620429 17.321703 52.450736 6.929542 8.492112 4.418988 14.284252 6.698555 21.619954
161 13 0 2.456419 0.980505 1.412271 1.475687 4.759243 2.279001 3.141468 1.965863 4.784445 3.562917
162 13 0 0.956930 0.989384 1.352033 1.202634 1.993732 1.939371 1.839531 1.637027 1.526959 1.789661
163 14 2 0.925289 1.020345 1.541620 1.272981 2.044089 1.904298 1.724766 1.654171 1.883134 2.102632
164 14 2 0.931806 1.006403 1.360111 1.139804 2.090015 2.071324 1.953072 2.842776 1.898894 2.107800
165 14 0 3.633395 3.071508 3.742763 4.085505 11.921690 8.372354 3.957983 5.049695 5.020453 6.158717
166 14 0 1.532891 2.679028 1.391010 1.274986 1.975626 3.396580 2.564932 3.421130 2.094380 2.863280
167 15 1 1.785170 1.416241 4.088484 1.426934 2.993020 2.175053 5.332267 2.526536 5.162182 2.138278
168 15 2 2.539142 1.472003 8.641387 4.447800 4.392194 2.693067 8.985215 5.878281 11.741879 6.645008
169 15 2 0.000000 0.000000 0.000000 0.000000 3.668520 5.562842 6.182292 7.507639 8.389604 9.079214
170 15 2 2.231073 7.958776 6.437817 40.478352 3.964053 13.671707 7.649392 13.001850 8.665972 19.548651
176 12 0 0.843781 0.931306 1.596076 1.364366 2.055195 1.933169 1.964543 1.701303 2.616889 1.744129
177 12 0 0.886540 1.203274 1.226737 1.215468 1.708266 1.918307 1.630155 1.673000 1.602441 1.905040
178 12 0 0.900690 0.900950 1.207109 1.086340 1.752820 1.784409 1.746542 1.722248 1.896745 1.999358
179 12 1 1.215694 0.891097 1.396283 1.300548 2.449353 2.028999 4.967684 3.072557 2.372448 2.866046
180 13 3 2.704781 1.258793 9.709732 1.435391 6.809190 2.264101 3.254060 1.761424 3.084529 1.756495
181 13 3 2.617466 4.824717 1.054526 11.568083 3.472840 7.540957 2.149664 2.078346 2.390064 1.918852
182 13 0 1.152864 1.778060 1.628461 4.555938 2.584359 3.560785 2.138806 4.407607 2.259427 5.948375
183 13 1 nan nan nan nan nan nan nan nan nan nan
184 14 0 0.877924 0.952112 1.253485 1.334844 1.690098 1.815296 1.602029 1.479499 2.055747 2.463879
185 14 1 0.829204 0.872055 1.190153 1.800793 2.077379 1.828536 1.906724 2.018815 2.030107 5.857597
186 14 1 0.955349 1.005227 1.374452 1.266771 2.202176 1.980783 1.802870 1.767736 2.004854 2.300828
187 14 1 0.999800 1.355533 1.251900 1.955690 1.796375 3.085394 2.549507 3.408282 2.915193 4.449999
189 15 3 1.079577 1.293288 1.358228 1.158135 1.869143 1.646510 1.463863 1.384976 1.447075 1.434258
190 15 3 4.209856 1.551789 13.915851 0.975196 5.326282 2.433219 3.267341 2.835321 3.387988 3.108000
191 15 3 0.966485 1.028704 1.455125 1.409688 1.856059 2.073111 1.818499 1.908881 1.885921 1.810019
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 0.114598 0.080001 0.074954 0.015665 0.145739 0.061762 0.048045 0.016954 0.040825 0.016524
206 19 0 0.078057 0.079766 0.021924 0.017763 0.064833 0.060867 0.018757 0.018484 0.020894 0.017946
207 19 1 0.066463 0.069583 0.016918 0.016538 0.059454 0.062199 0.016339 0.014139 0.017873 0.015670
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.072504 0.082092 0.020957 0.018854 0.071976 0.069646 0.021324 0.018117 0.020645 0.016894
224 19 1 0.047827 0.041068 0.017503 0.012509 0.053328 0.039214 0.022622 0.011518 0.034949 0.017093
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 0.925447 1.198376 1.575422 1.634103 1.941161 2.108198 1.829375 1.717506 1.897213 1.869280
323 2 3 0.913403 1.245440 1.949837 3.359692 1.661290 2.935711 1.708158 1.810783 1.652382 2.217962
324 4 3 0.931388 0.934592 1.711977 3.070152 1.856970 1.599214 1.746926 1.763437 1.846485 1.790735
329 12 1 0.967005 0.886949 1.465335 1.732509 1.925579 1.888729 1.741130 1.785470 1.851584 1.682251
333 12 1 1.156765 1.027303 1.517865 1.406823 2.115824 2.496967 1.803847 1.591182 1.655840 1.639241
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 [ ]: