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 = 2459778
Date = 7-17-2022
data_path = "/mnt/sn1/2459778"
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)
1862 sum files found between JDs 2459778.25316 and 2459778.66946
1862 diff files found between JDs 2459778.25316 and 2459778.66946

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.577404 1.207109 1.574385 1.424634 2.303621 2.377793 2.226565 2.213318 1.642969 2.246099
4 1 2 1.132005 1.127655 2.295370 6.188402 2.102669 1.714195 2.470369 2.219319 3.263953 2.748309
5 1 2 1.085938 1.057877 1.888977 1.206941 1.873761 1.861923 3.192861 2.620206 6.264753 6.327189
7 2 0 1.027499 1.152061 1.349576 1.195860 2.024745 1.827936 2.453576 2.488097 2.347928 3.716509
8 2 0 1.451800 32.600408 2.941849 121.746386 2.845764 120.252895 2.946707 119.965214 4.010444 162.649222
9 2 0 0.913443 1.047664 1.569088 0.992833 1.875010 1.955123 2.251723 2.072875 1.943485 1.759795
10 2 1 0.932568 1.053469 1.316018 2.496086 1.824798 1.925761 1.982318 2.503309 1.719746 2.139645
15 1 3 1.413639 1.248829 1.641259 1.053517 2.460234 2.117850 2.448067 1.922195 6.296308 4.242140
16 1 3 1.214734 1.080820 1.698603 1.160293 2.239158 2.128990 2.395807 2.118404 6.433086 3.381123
17 1 3 1.346229 1.227183 1.578509 1.361309 2.489287 2.311027 2.110171 2.084247 1.924777 2.719989
18 1 0 206.797335 64.160927 1.809189 1.400679 1021.204586 329.296318 2.300998 2.203409 1.677230 1.853037
19 2 1 1.277180 1.234304 1.458742 1.489993 2.001303 2.096266 2.666011 2.252581 2.425599 4.941751
20 2 1 1.009362 0.968365 1.510360 0.929037 2.063230 1.784590 2.368424 1.940775 1.896210 1.550219
21 2 2 0.874367 0.911603 0.856815 1.324755 1.761097 1.579135 2.148219 2.062099 1.416318 1.529538
27 1 0 2.049835 2.040635 3.957340 7.979076 3.524322 2.518238 3.537565 1.811851 3.652756 1.943462
28 1 0 201.099187 1.631098 1.948808 1.619989 1017.376332 2.732610 2.929845 2.488450 3.162276 3.325109
29 1 1 1.352734 1.456706 1.989844 1.351324 2.308411 2.249370 3.816010 2.846511 3.186098 4.308616
30 1 1 0.925849 1.071239 1.242080 0.972563 2.038999 1.979570 2.963118 3.003823 1.509442 2.523263
31 2 2 1.046047 1.017928 1.207065 1.042090 1.773022 1.955435 2.646809 3.743087 2.379491 4.442676
32 2 2 3.994789 3.912753 0.940952 0.956429 4.021316 5.554168 5.347243 7.759385 4.606061 6.595583
33 2 3 136.035303 1.084472 1.164484 1.211154 668.856396 1.890237 2.112019 2.160772 1.877983 2.105076
36 3 3 1.347612 1.496545 1.647453 1.484601 2.194871 2.238063 2.281708 2.424238 1.799659 2.320607
37 3 1 1.203328 1.115966 2.786391 1.224058 2.695055 1.956238 2.402701 2.577969 3.582215 2.952915
38 3 1 1.105504 1.558604 2.285293 1.217668 2.112536 2.151894 2.213691 2.910884 2.060286 2.075581
40 4 1 1.078084 1.166444 1.769025 1.140773 2.020613 2.163640 1.914420 2.263815 1.800506 2.291154
41 4 3 1.113507 1.449039 1.686909 2.008054 2.087555 2.152248 2.167934 2.403914 1.720425 3.347957
42 4 0 1.091259 1.200130 1.365986 1.341168 2.369438 2.289827 2.394802 2.599456 2.904485 6.693200
45 5 0 1.630736 1.150796 2.361251 1.196584 3.936060 1.928303 2.943758 2.332013 2.766535 1.864210
46 5 0 1.437477 1.295014 1.161544 1.723550 2.737238 2.131472 2.270670 2.264357 2.260084 2.530586
50 3 3 1.821227 1.104768 1.863549 1.551574 2.062840 1.782268 1.937688 1.931737 2.081776 1.503035
51 3 2 3.863576 1.159714 16.712457 1.995630 7.127532 1.936900 6.456312 2.513380 8.605101 4.384672
52 3 3 5.119391 1.223740 16.959486 1.472670 4.255908 1.987718 5.695501 1.552052 5.577044 2.287538
53 3 2 1.241945 1.446422 2.767729 2.576095 2.226892 2.202800 2.341970 2.464801 5.481431 5.548195
54 4 0 0.993675 1.016162 1.150246 1.302584 2.129968 2.237284 2.135657 2.055396 2.293364 3.006771
55 4 2 1.123191 1.073060 2.080167 1.020007 2.177356 1.763957 2.738011 2.285477 2.430283 1.627822
56 4 1 1.431302 1.451503 1.606363 1.661314 2.556397 2.245792 2.962032 2.714189 2.773557 3.860157
57 4 3 1.190226 1.829215 2.675289 5.252799 2.582225 1.843111 3.012321 2.596151 2.177788 3.800014
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.027284 1.167040 1.142395 1.547409 1.854794 2.092228 2.112243 3.277693 1.659521 2.908679
69 4 1 1.216582 1.326485 1.743030 2.016299 2.068536 2.414440 3.288451 3.221504 3.052444 2.744365
70 4 2 1.837799 1.275701 1.833631 1.045369 4.175550 2.056253 3.569361 2.625064 2.744850 1.802459
71 4 2 1.669540 1.665207 2.016935 1.656820 1.890137 2.340097 2.458584 2.515089 1.817131 1.817508
72 4 0 1.323164 1.383957 2.119775 1.450911 2.850734 3.625442 2.595932 2.562148 2.687651 3.458682
73 5 0 0.977374 1.348820 1.111498 1.106087 2.213634 2.073903 1.901757 2.246512 1.744559 2.750972
81 7 0 1.964651 1.284894 2.093760 1.199008 2.461333 2.138004 3.903556 2.481028 14.089180 3.171878
82 7 0 0.948872 1.146159 1.071253 1.000266 1.874312 2.116982 2.337774 2.134658 2.010410 2.205917
83 7 0 1.107559 1.174447 2.070314 8.951575 1.702909 2.130634 1.989389 1.946124 1.976236 2.226415
84 8 3 2.253310 2.066043 1.842164 1.787680 3.366029 3.582675 3.013608 3.203113 11.726436 8.582753
85 8 0 3.333381 2.024375 32.038548 13.259444 8.410183 3.002951 4.107377 1.990196 5.608615 1.843001
86 8 0 5.033410 1.532672 17.730715 2.817644 5.113135 3.493353 5.326474 3.512443 170.444629 66.452607
87 8 2 1.439878 1.340814 2.112665 1.862201 1.893038 1.667233 2.826656 3.057053 5.391917 3.734833
88 9 0 2.500342 3.951076 9.604372 15.895308 4.497803 13.425077 5.023373 2.585958 5.137303 1.972939
90 9 0 12.218260 1.543982 3.832380 5.750745 19.644820 2.733492 36.459198 3.335436 50.336781 3.818924
91 9 1 2.984319 2.610212 6.448298 6.402352 3.090762 4.060328 6.183084 2.005282 5.111114 1.983515
92 10 0 1.806489 1.651275 1.501053 1.683897 2.205226 2.164942 1.698071 1.981037 1.987342 2.172083
93 10 0 2.009010 1.562323 9.356153 2.075138 2.751919 1.951320 3.063086 1.777762 3.565125 1.802584
94 10 0 1.024885 1.403371 1.494858 2.501381 1.956812 3.122919 2.761532 3.363724 2.329635 9.607651
98 7 2 1.720995 1.069682 1.644199 1.391002 4.313933 1.839873 8.681474 2.011623 114.833784 2.502868
99 7 2 1.091863 1.109922 1.389743 1.598458 2.021475 1.784610 2.663225 2.262291 2.896084 3.078713
100 7 1 0.987453 1.080021 1.613694 1.512941 1.861442 1.724253 2.228220 2.103337 2.128407 2.102820
101 8 2 1.855033 1.702188 2.103607 1.727348 1.894262 1.895324 2.318562 2.329953 2.692311 4.618728
102 8 0 0.827114 0.754738 0.695295 0.519000 2.696811 2.135617 0.557164 0.463219 0.774871 0.566354
103 8 1 1.650824 1.241922 1.915512 1.831099 2.325724 1.892430 2.336104 2.214693 3.900344 2.911914
104 8 1 2.198778 1.522652 0.710730 1.911906 2.197169 1.788892 3.066056 2.259297 5.455745 2.553402
105 9 1 2.288194 1.983602 7.890149 3.542021 2.860679 2.679394 4.560861 2.815085 4.912926 2.108963
106 9 3 1.362759 1.510055 1.516052 1.493015 2.545863 2.389265 3.173546 3.433204 3.179941 1.638052
107 9 0 3.702356 11.393258 15.988215 7.669035 4.257478 7.148910 6.067451 24.764068 11.973718 38.386086
108 9 1 1.283525 1.109828 1.845799 1.220894 2.024170 1.688112 2.374580 2.051861 2.480548 1.950345
109 10 1 2.205915 1.900225 1.482000 1.828351 5.311704 3.952023 2.639386 2.283357 2.084106 2.243528
110 10 1 1.105282 2.615987 1.889406 1.050356 2.267859 3.509028 2.538634 2.752297 1.860606 1.879108
111 10 1 1.428631 1.265626 2.270543 1.324623 3.125728 2.053873 2.410630 1.687085 2.107031 1.486258
112 10 2 1.087869 2.288913 2.187106 10.506178 1.943616 2.795526 2.483032 3.368542 1.979858 2.211697
116 7 2 1.100009 0.941471 1.864080 1.154377 2.584614 1.945036 2.428621 2.004440 3.481587 1.874001
117 7 3 1.301595 1.320506 1.867317 1.592440 1.857318 1.677351 2.464905 2.661152 3.762271 4.435912
118 7 3 1.220053 1.384041 1.605671 1.829103 1.789224 2.033065 1.869168 2.320117 2.123027 5.335363
119 7 1 1.021746 0.933898 1.618813 1.658995 2.200894 1.907437 2.258876 1.809499 4.423238 2.621770
120 8 1 5.748283 1.890281 8.735150 1.929619 7.821975 2.311599 10.570397 1.701184 28.854698 2.763049
121 8 3 2.726055 3.627449 2.443088 1.821848 7.845326 12.102720 4.708344 5.107836 6.855640 20.709790
122 8 2 2.512506 2.047130 2.185487 1.931547 4.130596 2.881914 4.191717 2.797608 5.395223 8.047570
123 8 3 1.686191 1.595446 2.137972 1.677920 2.540087 1.875282 2.573857 2.065607 3.786732 4.204931
125 9 3 2.419575 1.690624 18.402139 6.069974 4.596900 4.100416 3.495083 1.874275 3.775629 1.782202
126 9 3 2.409606 1.422192 15.787338 4.665556 3.919411 2.977777 4.101820 1.904118 3.991523 1.844417
127 10 2 1.822275 1.577094 2.576738 1.186072 4.357889 4.311471 5.731654 4.307445 5.506473 5.295340
128 10 2 1.061427 1.225307 1.799681 1.870250 2.104484 1.936701 2.543804 2.312948 2.085195 2.803767
129 10 3 nan nan nan nan nan nan nan nan nan nan
130 10 3 nan nan nan nan nan nan nan nan nan nan
135 12 2 1.078742 1.041231 1.925321 1.135469 1.974890 1.854274 2.261964 2.186722 1.836520 1.507499
136 12 2 1.481450 1.274872 4.241888 1.234320 2.246295 1.633754 4.306343 2.174684 4.520593 4.296663
137 7 3 2.078136 3.023888 7.318166 10.431117 3.448795 4.900379 4.024839 1.989748 4.219910 1.873013
138 7 1 1.063060 3.669763 1.093366 3.361468 2.037630 3.357410 1.913057 1.964059 8.360916 2.421021
140 13 2 1.225857 1.387459 1.381378 1.455610 1.967970 2.081656 1.757193 2.214429 2.170853 3.345557
141 13 2 4.022910 1.260106 8.342769 1.112680 13.109007 2.462491 7.201510 1.676689 6.594243 1.977459
142 13 2 3.327838 1.792847 4.096265 4.869428 2.991317 3.044360 3.056723 1.886803 4.750067 2.595574
143 14 2 1.180033 1.184447 2.373943 1.210139 2.475145 2.018870 2.861515 2.496404 2.123317 1.835770
144 14 3 0.968155 1.153666 1.283046 1.307289 2.099292 2.148561 1.704780 1.983297 1.521353 1.595770
145 14 3 2.587843 2.021488 10.639469 10.454527 6.604564 5.376122 3.527776 1.772666 3.260745 2.005389
150 15 1 4.660602 16.561830 30.073164 10.610687 6.112431 16.563492 6.823441 28.945286 8.076874 53.547113
155 12 2 1.767650 2.514877 4.051054 9.914955 2.648837 2.025967 3.553233 3.057029 3.672797 1.909933
156 12 3 1.444366 1.301186 1.443906 1.163436 2.668817 2.366290 2.441688 2.815865 1.666397 2.295379
157 12 3 1.475432 1.065788 1.730741 1.140859 2.372424 1.995419 2.424908 2.078214 1.904317 1.872018
158 12 3 1.244968 0.997328 2.478517 0.825078 2.931068 2.035722 2.830965 2.602911 2.738906 3.102056
160 13 3 4.420484 14.911804 4.879391 3.271808 4.096604 9.489005 6.620001 31.498336 10.862010 66.027493
161 13 0 3.142113 1.305570 1.787464 1.050900 4.269758 2.227959 3.515344 2.384290 3.315252 4.180016
162 13 0 1.098475 1.259832 1.928569 1.294091 1.914592 1.938970 2.158626 2.078019 1.760632 1.739960
163 14 2 1.005285 1.096429 1.597723 1.092332 2.086179 1.946905 2.744379 2.328770 1.687737 3.230721
164 14 2 1.086909 1.096408 1.113616 1.134247 2.254907 1.969600 2.383516 3.424179 1.897178 2.319589
165 14 0 5.013603 10.524785 5.370983 14.676467 17.131710 28.559565 3.754801 7.993252 8.983999 6.428079
166 14 0 1.207678 2.009811 1.990184 1.473032 2.396618 2.641052 2.465819 3.727209 2.657462 3.845621
167 15 1 2.828888 4.140473 2.277990 14.394289 3.432943 2.608043 2.837078 2.319784 2.957699 1.949651
168 15 2 1.851978 1.353690 3.698711 2.232869 2.803829 1.949381 5.911220 4.936334 8.069302 5.141110
169 15 2 1.446703 15.684975 2.941544 78.092361 2.982775 11.776875 4.216696 9.026570 9.194334 24.109841
170 15 2 1.890504 19.047300 3.646417 94.767249 4.160204 19.055316 5.243784 17.456860 6.665413 32.684152
176 12 0 0.988012 0.998484 1.587884 1.306584 1.941396 1.808183 2.386832 1.904553 2.603885 2.118881
177 12 0 0.945792 1.234153 0.911109 1.406757 1.830638 1.810116 1.611853 1.825589 1.579075 2.572388
178 12 0 1.091213 1.079887 1.488943 1.288322 2.067129 1.832322 2.751171 2.623104 2.038942 1.810302
179 12 1 1.796495 1.396744 1.352795 1.023405 2.620728 2.040625 7.681148 3.827475 2.315200 2.604363
180 13 3 1.786633 1.353967 9.879715 1.654426 2.531395 2.250595 2.988698 2.053990 4.111399 1.972915
181 13 3 2.443190 2.592033 3.128135 6.125846 4.032517 4.250490 1.733467 2.058526 2.114668 4.031400
182 13 0 1.270741 1.851750 1.689599 2.286743 2.717990 5.279994 1.826316 2.460395 1.738649 4.213785
183 13 1 1.301598 1.256405 1.600974 1.293261 2.750843 2.328500 2.401866 2.488756 2.177354 2.994289
184 14 0 1.119979 1.041663 1.231606 1.226409 2.051815 1.874134 2.661510 2.503610 1.852343 1.958195
185 14 1 1.037295 1.548752 1.408218 2.534136 1.902822 2.314696 2.699714 4.189102 2.289704 2.885325
186 14 1 0.964044 0.975932 0.934203 1.113117 1.866057 1.863617 2.084379 2.245879 1.553082 1.829301
187 14 1 1.273252 1.069511 1.972393 1.192910 2.398804 2.031292 3.251759 3.147843 6.840340 7.011984
189 15 3 1.228389 1.264120 1.509549 1.207379 1.619121 1.982806 1.547585 2.006397 1.704375 2.400491
190 15 3 2.177414 2.913441 6.276072 0.884104 3.014907 3.499774 4.115112 2.331507 3.454723 4.392524
191 15 3 1.338139 1.236959 1.367307 1.273091 2.253878 2.098877 2.652954 2.484051 1.713912 1.730829
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.818334 0.944557 5.596899 1.953430 4.591935 1.721222 3.306443 1.892995 3.142731 2.240704
206 19 0 1.320493 1.145236 5.130189 4.174896 1.971009 2.011853 2.505189 1.840388 2.857232 1.716578
207 19 1 1.004163 0.831028 2.215381 1.758252 2.062341 1.629076 1.883289 1.779494 1.993958 1.740702
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.109251 0.970359 2.703708 1.680757 1.765254 1.687746 1.913995 1.931367 1.872995 1.944493
224 19 1 0.979681 0.794275 2.081946 2.083211 1.921280 1.717701 5.481390 2.189286 9.346218 4.450120
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.944248 4.099100 11.984705 33.403583 5.940862 5.302967 7.470748 4.104230 9.105355 19.483379
321 2 3 1.580565 1.875923 1.836418 1.881502 1.842653 2.551311 1.894315 4.704519 2.011125 2.048563
323 2 3 1.557869 2.187067 6.962351 6.382816 2.549061 4.691121 3.370918 2.335809 2.578614 2.928696
324 4 3 1.074568 2.994515 1.697224 1.800381 1.665036 3.868026 1.582676 1.755029 1.639082 1.979005
329 12 1 1.230462 1.736822 2.992092 8.331568 2.075483 1.891059 2.180567 1.827692 2.024696 2.011659
333 12 1 1.733388 1.946071 1.716262 2.579159 2.921029 5.146910 1.862688 1.805472 1.741691 1.781761
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 [ ]: