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 = 2459805
Date = 8-13-2022
data_path = "/mnt/sn1/2459805"
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 2459805.25305 and 2459805.33604
372 diff files found between JDs 2459805.25305 and 2459805.33604

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.415605 1.153733 1.235989 1.274486 3.404690 1.924327 1.714628 1.768392 1.595981 1.817143
4 1 2 1.283164 3.490989 1.384627 1.236934 3.255350 1.848442 1.735878 1.847680 1.684438 1.648117
5 1 2 0.948647 0.904836 1.721010 1.198722 3.081472 1.738945 1.956489 2.006341 3.471741 4.328019
7 2 0 1.044408 0.911388 1.221210 1.610356 2.841021 1.699374 1.687561 1.888724 1.793098 1.681594
8 2 0 1.070775 4.450683 2.331779 27.602225 2.332011 14.042039 2.396300 6.897130 2.145954 27.458903
9 2 0 1.012089 0.939845 1.279530 1.035618 3.639968 2.046112 2.252400 2.100852 1.716636 1.781586
10 2 1 1.041551 0.965523 1.305624 1.283128 3.626679 1.851484 1.886410 2.541121 2.038857 2.360520
15 1 3 1.060545 0.966129 1.109194 1.012639 2.814203 1.854445 2.039847 1.689489 2.943654 2.982181
16 1 3 1.148188 1.044458 1.439631 0.980279 4.476774 1.936028 1.989742 1.777723 5.474843 4.127475
17 1 3 1.092697 1.064066 1.135410 1.066962 3.086612 1.975386 1.683578 1.871494 1.729305 1.905497
18 1 0 34.952340 31.973174 13.770818 12.756867 183.883282 166.430788 1.924372 1.920318 1.493382 1.626531
19 2 1 1.048252 0.910219 1.685202 1.987088 2.290601 1.814974 2.188402 2.240735 4.152304 5.148563
20 2 1 1.157284 0.951964 1.334435 1.065819 3.711822 1.912115 1.624837 1.756349 1.695337 1.913796
21 2 2 1.157339 0.902558 1.379945 0.938787 4.393154 1.601888 1.976108 1.785686 1.942893 2.044662
27 1 0 3.389572 3.844781 7.254080 19.285719 10.934536 5.472903 4.000623 2.072434 3.086268 1.879983
28 1 0 81.594252 3.708680 24.251500 1.390600 416.651560 18.725836 1.593410 1.935057 1.705450 2.055340
29 1 1 1.030978 0.966473 1.113668 1.138233 2.815298 1.667115 2.077999 2.623728 3.153627 3.207132
30 1 1 1.151663 0.961693 1.469717 1.215373 2.872178 2.055124 2.518231 2.564283 2.123399 3.037663
31 2 2 1.052398 1.100777 1.084281 1.174135 2.948295 2.071712 2.321860 4.514074 2.814078 8.439805
32 2 2 1.602028 2.663142 0.963332 1.018792 5.014316 2.465522 4.443629 5.727775 4.444968 6.566248
33 2 3 30.389736 1.090685 15.772159 1.027857 142.262883 1.964407 1.564198 1.733212 1.445277 1.628309
36 3 3 1.017175 0.907217 1.495664 1.265241 2.185338 1.933795 1.629501 1.649161 1.614215 1.529237
37 3 1 0.892489 0.975513 2.488807 1.439466 2.661154 1.793768 1.613911 1.757852 2.350615 3.291767
38 3 1 1.074137 1.342242 1.390187 1.238192 3.242797 2.107795 1.664852 2.572228 1.549172 1.916620
40 4 1 0.966297 1.160858 1.744154 1.300359 2.399874 2.197264 1.738464 1.861220 1.800609 2.089633
41 4 3 1.342651 1.076148 1.158993 1.553978 5.023742 2.876468 1.520612 1.976273 1.353723 1.732703
42 4 0 1.324733 1.077164 1.226913 1.284753 3.489270 2.042184 1.910841 2.207897 1.878412 3.556214
45 5 0 1.174059 1.024173 1.796841 1.230416 3.601915 2.078823 2.428219 2.358054 2.116477 2.279204
46 5 0 1.478932 1.124636 1.279385 1.177655 4.825394 1.756197 1.766416 1.604688 1.838249 1.895531
50 3 3 1.252241 0.922188 1.341937 1.124733 1.991692 1.879824 2.015183 1.693778 1.733483 1.727096
51 3 2 1.384090 1.081726 3.660210 1.244478 5.078661 1.501255 1.829458 1.451567 1.683957 1.580973
52 3 3 1.037877 1.038382 1.861141 1.593160 3.453541 2.232548 1.892976 2.123100 1.836903 1.793865
53 3 2 1.230461 1.155575 2.555526 1.957348 4.037314 2.802663 2.223301 2.511139 3.707243 3.570111
54 4 0 1.750250 0.986338 1.263998 1.064626 3.442092 1.961371 1.926176 1.806600 2.394471 1.955051
55 4 2 1.059803 1.000931 1.494566 0.930196 2.883083 2.387234 1.835270 1.734197 2.290492 1.711363
56 4 1 1.241842 1.150533 1.374493 1.474994 4.821138 2.301708 2.092941 2.156339 2.536995 2.407046
57 4 3 2.606413 1.820124 2.687716 8.079049 11.917532 1.844547 2.603947 1.799198 2.684407 1.759631
65 3 0 0.986935 1.267604 1.734063 1.012599 2.344243 1.911764 2.056089 1.641250 1.699229 1.505698
66 3 0 1.335185 1.007735 2.123560 1.370516 4.826448 1.985098 2.038389 2.006450 2.112601 2.215814
67 3 0 0.987766 1.028332 1.476532 1.194809 3.497402 1.799677 1.756087 1.638424 1.483735 1.506984
68 3 1 1.249145 1.076311 1.381076 1.292911 4.750541 1.931654 1.735349 1.839746 2.000892 2.074839
69 4 1 0.976881 1.064466 1.909501 1.552110 2.862150 2.501775 1.950187 1.807429 1.657210 1.847497
70 4 2 2.040289 1.334444 1.522975 1.392935 6.109857 2.785141 3.409320 2.367628 2.178811 2.916656
71 4 2 1.314676 0.977512 1.370670 1.227034 4.517936 2.171160 1.758978 1.720189 1.490624 1.397560
72 4 0 1.322157 1.571503 1.329150 1.530581 4.787725 5.243852 1.863460 2.608247 2.791875 4.572348
73 5 0 1.170080 1.844372 1.519866 5.578337 2.927248 4.227406 2.010543 1.932697 2.409592 1.905574
81 7 0 1.050738 1.558735 1.658628 1.381648 2.533059 3.223891 2.338495 3.453168 4.771170 5.344808
82 7 0 1.008415 1.090764 1.206043 1.016078 2.922571 1.760763 1.557169 1.669733 2.073638 2.428926
83 7 0 0.990929 1.294365 1.848729 3.672618 2.986528 1.845070 1.898368 1.844220 1.866563 1.723592
84 8 3 1.226132 0.974643 1.374620 1.411164 4.551703 2.053129 1.800705 2.008381 3.475054 5.160212
85 8 0 1.121919 1.089095 1.347752 1.220493 3.758990 1.877274 1.796115 2.218357 2.048397 2.738465
86 8 0 1.685628 1.426792 1.810631 1.085524 4.447756 1.862834 2.725914 3.126901 3.765767 4.563457
87 8 2 1.125616 0.950311 1.426801 1.453791 4.004517 1.690779 1.778804 1.989382 2.239446 2.976519
88 9 0 2.167759 6.485384 15.664672 32.863701 9.294286 29.024445 4.172108 3.196096 7.391740 2.323682
90 9 0 1.925306 1.403817 6.612744 12.983465 2.729977 1.922881 2.812262 1.802048 3.446418 2.649151
91 9 1 3.237591 3.624378 12.677065 5.081384 4.711970 9.430253 5.808419 3.437672 7.621706 2.399795
92 10 0 3.443410 2.324699 0.663938 0.946304 13.364173 9.238606 2.529957 2.026648 2.553968 2.406640
93 10 0 1.018971 1.123284 2.194491 1.161124 3.368380 2.003708 2.098324 2.018462 2.790852 1.734149
94 10 0 0.921715 1.050135 1.132050 1.773038 2.607645 2.583801 2.105184 2.579500 1.856508 2.936660
98 7 2 0.931102 0.975714 1.118450 1.278610 2.335967 1.860199 2.081714 1.760847 3.866544 1.727061
99 7 2 1.149901 0.987456 1.453077 1.514149 4.589330 1.928512 1.928564 1.682895 2.572180 2.395325
100 7 1 1.599082 1.190348 2.173109 1.559475 4.397531 2.005595 1.969721 1.822333 2.022039 1.868767
101 8 2 1.072680 0.965521 1.297546 1.535913 3.531061 1.732076 1.818542 1.859563 1.677403 2.137451
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.226840 0.936026 1.348332 0.975706 4.484522 1.446521 2.005241 1.529298 2.097339 1.583050
104 8 1 1.888271 0.892639 0.302013 1.159541 4.552274 1.675654 3.705817 1.697683 3.701355 1.390301
105 9 1 2.227890 2.270458 17.073584 7.564592 3.669243 7.977178 4.730263 2.425281 9.302564 3.098619
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 7.427151 33.321025 34.441063 214.441489 9.026488 22.689429 11.853345 82.739288 20.861693 154.628079
108 9 1 1.850839 1.276084 8.365555 4.968959 2.035495 1.885688 3.427234 1.750246 3.348799 1.982005
109 10 1 nan nan nan nan nan nan nan nan nan nan
110 10 1 nan nan nan nan nan nan nan nan nan nan
111 10 1 nan nan nan nan nan nan nan nan nan nan
112 10 2 1.121808 1.940409 1.529694 3.163050 4.559227 2.146588 1.950988 1.742321 1.822358 1.744320
116 7 2 1.296829 1.052553 1.176475 1.160428 3.578619 1.975325 1.644434 1.862417 2.340530 2.079495
117 7 3 1.188218 1.149168 1.651251 1.538189 4.316500 1.991572 1.866628 2.416412 2.545898 3.836496
118 7 3 1.974527 0.973413 4.487707 1.602689 2.761153 1.887967 3.665349 1.967360 3.638106 2.687750
119 7 1 1.001337 0.831905 1.135357 1.392010 3.722417 1.542488 1.696739 1.752876 1.895815 1.714271
120 8 1 4.043775 2.227418 11.675074 2.256842 7.103114 10.393391 7.854743 1.672084 20.126454 2.280907
121 8 3 1.777097 1.691066 1.671192 1.265000 6.888745 4.397943 2.915244 2.431807 3.957222 5.137733
122 8 2 1.288152 1.039623 1.400240 1.367161 3.863894 1.945963 2.146124 2.452712 2.272287 2.871262
123 8 3 1.064795 0.809566 1.141950 1.426373 3.406856 1.874617 1.539603 1.594524 1.772525 1.888085
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 1.548544 1.601334 2.587484 1.209008 4.515221 4.114742 4.427928 3.834337 4.881247 4.851008
128 10 2 1.401545 1.183757 1.411835 1.306029 3.524213 1.846163 1.768793 1.831838 2.029340 2.041012
129 10 3 1.092071 1.052743 1.178188 1.096444 3.598182 1.757956 1.676337 2.049613 1.596442 1.920283
130 10 3 1.271982 1.369377 1.681669 1.174293 3.522871 2.158481 2.183821 1.597441 2.219762 1.820511
135 12 2 1.113863 1.020824 1.536873 1.213768 2.788924 1.960491 1.935320 1.820246 1.677581 1.721751
136 12 2 1.240224 1.009836 3.101400 0.904456 4.414621 1.726548 3.757195 1.900355 2.530197 2.816721
137 7 3 3.590368 3.029478 6.267819 21.551271 10.687792 6.220040 3.950307 2.971770 5.588413 2.369703
138 7 1 1.079410 2.938068 1.016411 6.068894 3.905720 6.179839 1.715160 3.210567 7.319450 5.889271
140 13 2 2.961864 5.114418 15.374836 48.372653 3.266744 2.565938 3.651133 9.923369 6.808175 21.045587
141 13 2 7.301792 1.149850 9.572718 1.288359 26.898475 2.215816 14.957880 1.801777 12.386404 2.034079
142 13 2 3.883895 3.470841 7.554222 1.863160 9.731695 17.835266 2.959536 2.085156 4.890380 3.802515
143 14 2 1.074503 0.962124 1.460119 1.029006 3.284780 1.776963 1.690789 1.598013 2.351826 4.111170
144 14 3 1.040484 1.115912 1.050053 1.136761 3.161845 1.908736 1.504985 1.642847 1.613446 1.738670
145 14 3 7.768192 3.616077 22.219870 18.389272 26.318916 12.907126 3.301745 1.770119 2.965843 1.867594
150 15 1 2.535687 4.468209 22.279973 38.043097 4.766229 7.572554 3.358540 2.434310 2.687583 1.899180
155 12 2 2.710002 4.970119 10.985378 24.476717 4.373112 4.622340 3.631252 2.533606 3.756321 2.061383
156 12 3 1.055371 1.107441 1.450354 1.276000 3.585852 2.441745 1.950911 2.229581 1.898263 1.925974
157 12 3 0.981315 0.857435 1.687415 1.101419 2.857085 1.911714 1.962356 1.772867 1.965855 1.821319
158 12 3 1.269081 0.959776 2.830778 1.442857 4.489711 1.937727 2.436585 1.922004 2.819665 1.851598
160 13 3 4.503685 6.455962 19.944772 54.988449 5.549935 6.602510 5.193010 14.173100 7.234257 21.795289
161 13 0 2.483592 1.241389 1.409726 1.188403 4.316300 1.961335 2.832077 1.899759 4.437439 4.074714
162 13 0 1.001165 0.879150 1.171537 1.062640 2.838603 1.943226 1.928446 1.588830 1.580749 1.550360
163 14 2 0.960370 0.990872 1.367285 1.121316 3.107492 1.772744 1.794516 1.772601 1.711939 1.933260
164 14 2 1.078849 0.875416 1.302837 1.103431 3.413851 1.636953 2.028924 1.910632 1.825616 1.566520
165 14 0 2.711183 1.891829 3.115150 3.560797 9.354991 5.163403 3.040455 4.041908 4.210601 5.321986
166 14 0 1.631802 1.748269 1.594378 1.389934 4.491596 2.995118 4.100277 3.707248 3.090004 4.176097
167 15 1 1.674255 2.712185 1.850862 16.773675 3.018145 3.012437 2.338844 1.886552 2.079937 1.648520
168 15 2 nan nan nan nan nan nan nan nan nan nan
169 15 2 nan nan nan nan nan nan nan nan nan nan
170 15 2 nan nan nan nan nan nan nan nan nan nan
176 12 0 0.860983 0.892658 1.515425 1.033705 2.311260 1.993735 1.855222 1.611557 2.329868 1.487161
177 12 0 1.086648 0.864535 1.374085 1.136231 3.063832 1.898734 1.755453 1.798030 1.998351 1.869107
178 12 0 1.207101 1.032517 1.358267 0.917152 4.352330 1.885633 2.036495 2.015331 1.863059 2.057038
179 12 1 1.350232 0.904883 1.409171 2.763167 4.145153 1.843539 4.556021 2.319451 2.563745 2.206435
180 13 3 1.989328 0.998734 10.079581 1.043736 5.823212 2.113090 4.011290 1.838940 3.764244 1.925637
181 13 3 1.726699 4.861795 1.096235 12.297406 7.289651 7.744203 2.587606 1.788478 2.569931 1.805602
182 13 0 1.575902 1.134204 3.833846 2.437619 5.575903 2.934376 1.776574 2.135559 1.822757 2.792941
183 13 1 1.154874 1.003740 1.356303 1.153499 3.966852 1.721641 1.782939 1.631275 2.160385 2.251408
184 14 0 1.220024 0.924699 1.221263 1.155733 3.572754 1.886500 1.606064 1.829739 1.493738 1.820917
185 14 1 1.057376 1.022902 1.209770 1.488865 3.941450 2.009882 2.278031 3.083722 2.466384 3.494787
186 14 1 1.089531 0.994774 1.179050 1.284648 4.003271 1.857511 1.714385 1.952218 1.582112 1.969777
187 14 1 0.975654 1.068934 1.534437 1.264484 3.224833 1.843478 2.748138 2.738540 5.063985 7.136142
189 15 3 0.971493 1.068625 1.311256 1.196216 2.838507 2.041129 1.698314 1.926619 1.839407 2.048995
190 15 3 2.994108 1.632681 13.196114 0.905797 4.609741 3.675360 3.498813 2.520533 3.599716 4.349477
191 15 3 1.068923 0.991689 1.612297 1.237195 3.064505 1.748105 1.972184 1.955278 1.800772 1.961240
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.111986 0.830827 1.514112 1.694550 3.203635 1.684161 2.441639 1.691053 1.863108 1.838768
206 19 0 0.949138 0.890634 1.641853 1.393842 2.697682 1.711943 2.159539 1.508977 2.149530 1.763051
207 19 1 0.848982 0.888475 1.887576 2.349180 1.793814 1.946116 1.934312 1.583432 1.841525 1.682481
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.994283 0.890673 1.778588 1.685898 2.508751 1.674563 1.703470 1.767689 1.709722 1.586572
224 19 1 0.850696 0.804379 2.160218 2.019777 1.793091 1.367096 3.025258 2.083933 5.572045 3.114806
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.755106 4.562340 7.094796 28.495600 6.467430 6.952223 6.877942 5.371497 10.888789 14.917574
321 2 3 2.439984 2.005932 1.990004 1.864005 2.675174 1.923629 1.711241 1.830250 1.747694 1.721005
323 2 3 0.846810 1.129139 2.110631 3.761083 1.913845 3.330428 1.574538 1.761073 1.668033 2.047158
324 4 3 0.798759 0.999131 2.316039 2.138714 1.873057 1.770917 1.936942 1.615465 1.918262 1.720117
329 12 1 1.008715 1.002158 3.372623 2.991120 1.904488 1.663306 1.691812 1.667075 1.587667 1.611990
333 12 1 1.352064 1.128515 2.196619 1.119123 2.356997 1.709010 1.889784 1.522745 1.744946 1.429850
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 [ ]: