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 = 2459817
Date = 8-25-2022
data_path = "/mnt/sn1/2459817"
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 2459817.25308 and 2459817.33608
372 diff files found between JDs 2459817.25308 and 2459817.33608

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 nan nan nan nan nan nan nan nan nan nan
4 1 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
5 1 2 nan nan nan nan nan nan nan nan nan nan
7 2 0 0.895551 0.922030 1.313391 1.274720 1.743189 1.952226 1.906677 1.896118 1.950809 1.808192
8 2 0 1.760555 17.960705 5.032981 41.227235 3.802258 81.410848 4.974770 69.726403 5.168575 88.729330
9 2 0 0.830776 0.888775 1.357276 1.279058 1.574496 1.976861 2.007209 2.167559 1.750559 2.087174
10 2 1 0.875959 0.966720 1.314940 1.214297 1.549092 1.784130 1.659548 2.378934 2.001999 2.189306
15 1 3 1.023605 1.067402 1.234950 1.287296 2.082339 2.111648 2.349041 2.191831 6.989899 5.583630
16 1 3 0.999384 1.148349 1.368966 1.163444 1.983081 2.248422 1.888551 1.901719 4.993678 3.546466
17 1 3 1.076960 0.990510 1.453643 1.101247 2.091628 1.918356 2.071091 1.998304 1.871957 2.051075
18 1 0 28.267411 7.028028 2.336160 2.236816 115.258660 21.619311 1.528531 1.836493 1.617976 1.857152
19 2 1 0.853934 0.876468 1.816626 1.431039 1.401886 1.855886 1.746138 1.806734 2.530534 2.468787
20 2 1 0.923041 0.984109 1.587458 1.208222 1.954011 1.928739 1.819398 1.784586 1.753209 2.015073
21 2 2 0.880352 0.857129 1.578938 1.158483 1.780238 1.897863 1.846595 1.825206 1.811731 1.802742
27 1 0 3.847473 5.091032 8.351283 20.618555 12.807553 7.455542 3.608878 2.196133 3.471548 2.026192
28 1 0 49.994568 1.244752 2.986033 1.354481 260.969046 2.945687 1.918090 2.089798 2.006490 2.486889
29 1 1 1.120275 0.983070 1.618968 1.364332 2.104920 2.019693 2.639171 3.037455 3.460320 3.367865
30 1 1 1.044814 1.110300 1.332856 1.296985 1.982046 2.108080 3.104407 3.298617 2.346001 5.453796
31 2 2 1.035247 1.245998 1.289061 1.132657 1.998860 1.970051 2.808119 5.052558 3.766672 10.111015
32 2 2 1.355651 1.774158 1.485569 1.426052 2.015656 2.115877 4.274624 6.038612 4.758108 7.348787
33 2 3 37.822073 1.055390 2.316166 1.100110 188.509942 1.829693 1.816004 2.056837 1.864324 1.844495
36 3 3 1.098252 0.944738 1.736980 1.443302 1.975008 2.220518 2.058652 1.778053 2.024539 1.937736
37 3 1 0.939396 0.950575 2.871077 1.713811 1.969692 2.091030 2.015220 2.377591 2.314579 3.129988
38 3 1 0.971301 1.292794 1.954203 1.722572 2.088079 2.225332 2.140021 2.599403 1.854515 2.068514
40 4 1 0.869929 1.115138 1.536534 1.588233 1.886942 2.509170 1.662049 2.127260 1.592698 2.180381
41 4 3 0.908938 1.068200 1.302847 2.682309 1.787140 2.074312 1.878492 1.836731 1.623616 2.284701
42 4 0 1.164731 1.088625 1.427640 1.189255 2.387120 1.973438 1.570687 1.943296 2.174886 3.305504
45 5 0 1.394500 1.080121 2.960220 1.117296 3.574385 1.869900 3.160171 2.154808 2.829462 1.957027
46 5 0 1.124129 1.048861 1.223599 1.707004 2.057800 1.966380 1.993383 1.917339 1.840638 2.090958
50 3 3 2.655113 1.069939 1.950246 1.185619 2.135396 1.715389 1.705256 1.853777 1.940998 1.763741
51 3 2 1.366743 1.088954 11.412340 1.449848 1.778918 2.023410 1.779544 1.896818 1.704643 2.129887
52 3 3 1.143258 1.445000 1.838619 2.579264 2.388070 3.186969 2.091585 2.869339 1.959359 2.608294
53 3 2 0.972244 1.210364 1.468851 2.002402 1.839629 2.859473 1.776940 2.530027 2.710752 3.535439
54 4 0 1.029696 0.976057 1.382456 1.143785 2.105532 1.993686 2.003575 1.705976 2.115875 1.980450
55 4 2 1.041162 1.065716 1.958676 1.207662 2.232256 2.026358 2.301209 2.051058 3.073444 2.028024
56 4 1 1.118091 1.194611 1.437854 1.443623 2.271406 2.130596 1.977261 2.026860 2.946504 2.869930
57 4 3 1.154164 1.167560 2.292601 2.797382 2.165816 2.784943 2.097576 1.708543 2.334395 2.478665
65 3 0 1.075515 1.003840 2.471496 1.291555 2.700548 1.814396 2.376139 2.001451 2.200502 1.709442
66 3 0 1.270583 1.036302 2.808098 1.580371 3.102601 1.939421 2.681923 1.732218 2.567500 1.935123
67 3 0 1.016089 1.135706 1.563628 1.623810 2.050547 2.111675 1.836440 2.331299 2.080972 2.115187
68 3 1 0.970047 1.019874 1.472158 1.503599 2.132455 1.708251 2.027369 1.941651 1.782384 2.051313
69 4 1 0.958555 1.134371 1.398950 2.028763 1.961283 2.020739 1.883180 2.181918 1.894977 1.809305
70 4 2 1.519184 1.329183 1.494312 1.544892 2.943932 2.706548 3.323421 2.088538 2.132038 2.617179
71 4 2 1.059449 1.055300 1.880431 1.325670 2.129324 2.069443 2.221944 1.920704 1.989919 1.737427
72 4 0 1.085124 1.290163 1.513718 1.542914 2.509808 2.951873 1.935268 2.170261 2.651417 2.903689
73 5 0 1.038191 2.802664 1.710238 6.134957 2.170769 7.675812 2.092602 1.988275 3.192114 2.234939
81 7 0 1.277201 1.300304 2.187929 1.355777 1.953465 2.369005 2.572084 2.776320 6.486412 4.110114
82 7 0 0.954453 1.071422 1.390412 1.138264 1.880410 2.194678 2.041234 2.025693 2.617661 2.591047
83 7 0 1.056334 1.164680 1.901718 3.099508 2.268849 1.862041 2.522748 2.795741 2.925890 2.551527
84 8 3 1.263065 1.279472 1.771219 1.743129 2.058522 2.444710 2.209820 2.102478 3.538628 4.109922
85 8 0 0.953348 1.142563 1.524505 1.441759 1.989935 2.027971 2.068127 2.696574 2.861196 3.838793
86 8 0 1.767158 1.234674 1.904723 1.397183 3.042606 2.191534 4.293878 4.285217 2.838919 3.843488
87 8 2 1.177500 1.464652 2.000498 1.803965 2.026658 2.850721 1.919547 3.812468 2.808832 3.144265
88 9 0 1.899574 27.689870 8.557397 138.334440 4.635969 93.647826 5.916507 83.921214 7.186590 120.814181
90 9 0 0.958994 1.106333 2.427517 1.614151 2.120100 2.096604 1.737184 2.005729 2.227275 1.809801
91 9 1 1.609111 20.827377 5.392801 56.644864 3.960822 92.595031 4.081346 79.271371 5.464749 96.874237
92 10 0 3.079530 1.885472 0.843014 0.975968 3.647777 2.925806 3.172462 2.410042 3.411921 2.702371
93 10 0 0.996919 1.028813 1.409254 1.304793 2.011936 2.179730 1.911218 1.938158 1.961152 2.122859
94 10 0 0.948789 1.146918 1.371870 2.063069 1.993216 2.620532 2.292341 2.686634 2.005791 4.071133
98 7 2 0.933583 1.134851 1.338849 1.361381 1.845332 1.913908 1.802597 1.828763 2.665378 1.890424
99 7 2 0.967548 1.086645 1.595454 1.612912 2.058903 2.246765 2.075434 2.811925 2.844139 29.905866
100 7 1 1.047844 1.040033 2.355848 1.499275 2.090309 2.046660 2.015994 1.979093 1.893105 1.832552
101 8 2 1.238747 1.135803 1.459921 1.584300 2.043682 2.038147 1.943535 2.110201 1.856311 2.530577
102 8 0 1.237333 1.946296 3.244493 9.839682 2.848497 2.100283 2.156111 3.694703 3.041370 5.514294
103 8 1 nan nan nan nan nan nan nan nan nan nan
104 8 1 nan nan nan nan nan nan nan nan nan nan
105 9 1 1.005896 1.117938 2.486287 1.667114 1.805598 1.960256 1.825419 1.840989 2.317851 2.143418
106 9 3 1.896108 0.948053 8.748524 1.079563 5.337790 1.801327 6.410417 2.009959 7.713559 1.674555
107 9 0 1.483240 15.717052 5.379723 33.764506 3.276307 69.591329 3.323249 57.869971 4.935971 73.382433
108 9 1 0.876541 0.996362 1.440558 1.152290 1.666142 2.022595 1.718262 1.877672 1.914819 1.711948
109 10 1 1.615474 1.469862 1.455382 1.369826 2.461419 3.102523 1.984674 2.335069 1.941210 2.058938
110 10 1 0.965694 1.776119 1.589846 1.604442 2.211268 2.834489 1.975797 3.141028 1.856790 2.378224
111 10 1 2.891058 1.172023 1.776712 1.407806 2.715342 2.118137 2.117586 1.912113 1.898158 1.775631
112 10 2 0.923836 1.653810 1.425279 1.665157 1.890335 2.155155 1.946647 1.897819 1.848098 1.844717
116 7 2 1.384547 1.208182 1.388536 1.260353 4.345048 2.235975 1.987792 1.937246 2.870838 1.908641
117 7 3 0.962710 1.103945 1.511046 1.173569 1.883611 1.782548 1.981588 2.333344 2.657799 3.167889
118 7 3 2.048119 1.105017 5.269338 1.721411 3.435294 2.256929 3.784621 1.878314 4.011852 2.806288
119 7 1 1.017111 0.862015 1.616782 1.707654 2.315365 1.702050 2.092559 1.758266 4.355562 2.215128
120 8 1 nan nan nan nan nan nan nan nan nan nan
121 8 3 1.644962 1.921748 1.689182 1.289498 4.920195 5.060329 3.046384 2.337461 4.500271 6.931638
122 8 2 1.768339 1.440139 1.811550 1.731279 3.548413 2.378695 2.626281 3.270755 3.788226 5.218274
123 8 3 1.052839 0.961788 1.478506 1.544986 1.918260 2.065926 1.791152 1.994961 2.166311 2.139298
125 9 3 2.901917 1.057808 3.017511 1.889110 7.193649 1.795165 9.062469 2.050269 18.959493 1.902995
126 9 3 1.128222 1.334915 2.064948 2.905753 2.682975 4.062365 2.274808 2.457136 2.702942 2.550547
127 10 2 1.290173 1.249148 2.217263 1.236146 2.862023 3.031608 3.259471 2.696700 3.336248 3.560051
128 10 2 1.375926 1.060170 1.728693 1.376782 1.951503 2.111247 2.107970 2.073622 2.851050 2.661985
129 10 3 1.010872 1.003928 1.330252 1.036071 1.914956 1.675327 1.850704 1.661848 1.799792 1.545890
130 10 3 1.143063 1.250254 1.775571 1.202663 2.420182 2.213073 2.223330 2.114439 2.117292 2.545269
135 12 2 1.015634 0.981181 1.434909 1.119168 2.256427 2.025125 2.326841 2.150005 2.300175 1.796636
136 12 2 1.236103 1.098234 3.048186 1.088249 2.108927 1.861909 3.990539 2.436173 2.500917 3.216001
137 7 3 4.362300 26.952238 19.138469 83.085322 10.374759 114.009950 5.179836 89.160206 9.134758 121.082260
138 7 1 3.535478 6.331443 3.013347 6.380630 3.848101 8.170482 2.028540 4.039917 2.141556 8.222687
140 13 2 3.657517 6.684327 18.135229 48.986773 4.733973 4.144590 4.751529 10.792926 8.328648 21.310718
141 13 2 8.650430 1.216714 12.167284 1.292603 30.390076 2.201890 18.156524 1.988222 13.883191 1.926020
142 13 2 6.056187 1.721486 8.115805 2.209642 6.627547 3.154012 2.849992 2.149927 3.682741 4.416797
143 14 2 1.111113 1.055666 2.065552 1.239540 2.222892 1.760768 2.352864 1.865720 2.093195 1.853764
144 14 3 1.102480 1.217317 1.457780 1.351420 2.323793 2.050664 1.841882 1.824525 2.045561 1.917777
145 14 3 1.748121 3.064954 10.559666 10.926063 8.374052 9.926718 1.267449 1.079514 1.395352 1.257529
150 15 1 2.659106 2.910640 16.344790 42.589962 4.770552 7.496973 3.245386 2.344255 2.906162 2.027153
155 12 2 3.181884 2.878472 8.915058 16.643061 3.632018 4.825500 3.266450 2.697688 3.728781 2.149976
156 12 3 1.076866 1.065879 1.411680 1.610667 2.097840 2.409005 1.810077 2.000015 1.659495 1.764723
157 12 3 1.035334 1.009774 1.536224 1.225572 1.928889 1.865459 1.830339 1.896876 1.849281 1.860617
158 12 3 1.255987 1.010261 2.726549 1.634986 3.611116 2.005574 2.525593 2.322349 3.706734 2.921633
160 13 3 4.137220 7.923512 16.687305 60.291132 7.905999 12.980500 6.401071 16.800535 7.642936 25.096813
161 13 0 2.685284 1.279401 2.048807 1.379049 3.977550 2.416767 3.253105 1.931692 7.375129 4.307090
162 13 0 1.029982 0.958021 1.807932 1.385973 2.239186 2.167548 2.064330 1.958481 1.908548 2.292082
163 14 2 1.023250 0.977547 1.722201 1.573268 1.955316 1.933945 2.138144 1.876331 1.813642 1.818575
164 14 2 1.117520 0.961669 1.319911 1.196995 2.159096 1.942169 1.932386 2.473821 1.780959 2.053973
165 14 0 3.107805 2.967403 2.923338 4.164531 10.167145 5.319067 2.958083 3.452251 6.774859 5.268368
166 14 0 1.136267 1.649629 1.568208 1.313979 2.370490 3.058581 2.681026 3.046310 2.172701 2.730131
167 15 1 1.546499 3.555866 3.147977 3.819757 2.554475 3.008222 2.915906 2.745914 2.521720 2.706300
168 15 2 1.797486 1.102992 5.369475 2.899956 3.148109 2.316363 4.492963 3.693208 12.479344 5.058582
169 15 2 1.763856 4.451908 5.806333 22.044642 3.620359 5.854975 4.560820 6.830327 7.308733 10.438330
170 15 2 2.261600 5.770424 8.694919 31.509683 5.512682 13.870073 8.322628 12.148458 8.767312 19.078598
176 12 0 0.912830 0.919806 1.452408 1.068516 1.763815 1.778672 1.873648 1.759161 1.901545 1.834308
177 12 0 1.040351 1.056852 1.345551 1.320078 1.856796 1.868013 1.789933 1.801273 2.379776 2.216817
178 12 0 0.986764 1.019353 1.446789 1.497911 1.815163 2.102022 1.966179 1.995349 1.782035 2.101109
179 12 1 1.280863 0.981069 1.311725 1.468288 2.309993 1.775557 5.076153 2.368515 2.158565 2.061905
180 13 3 2.273788 1.415196 10.787844 1.238008 5.040219 3.322065 3.800004 1.839247 3.554062 2.071955
181 13 3 2.153963 5.441440 1.475960 12.641100 6.062787 8.509777 2.376971 2.076423 2.533509 1.990682
182 13 0 1.639163 1.392965 3.150102 3.447177 5.599656 3.640944 1.985574 2.647695 1.783496 3.164804
183 13 1 1.110433 0.918420 1.524126 1.657477 2.479067 2.074168 1.923629 2.270769 2.288004 2.825405
184 14 0 0.769755 0.725686 0.802938 0.932879 1.289808 1.390885 1.331701 1.361779 1.769653 3.405635
185 14 1 0.983586 1.082449 1.538529 1.589705 2.210350 2.212566 2.245303 2.625015 2.362825 1.994170
186 14 1 0.962081 1.278484 1.201396 1.363955 2.015019 1.913451 2.005541 1.924976 1.847192 2.983886
187 14 1 1.016916 1.249327 1.404736 1.482905 2.161576 2.393633 2.710521 3.445413 5.863375 10.834632
189 15 3 1.120875 1.032134 1.379646 1.353457 1.940704 1.990158 1.919504 1.928693 1.674851 2.792337
190 15 3 0.957324 1.918481 3.669494 0.845878 1.247995 2.076603 0.884982 2.076205 0.937247 2.735274
191 15 3 1.042802 1.224692 3.565212 2.985440 2.009336 1.887679 1.800208 1.832682 1.815460 2.192418
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 0.510590 0.586321 0.073549 0.019099 0.264149 0.279692 0.054182 0.019674 0.046720 0.023352
206 19 0 0.566463 0.557328 0.022352 0.025193 0.270980 0.266133 0.023543 0.031060 0.023628 0.030259
207 19 1 nan nan nan nan nan nan nan nan nan nan
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 nan nan nan nan nan nan nan nan nan nan
224 19 1 nan nan nan nan nan nan nan nan nan nan
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 7.358921 5.342708 17.433275 35.210667 9.645788 7.860924 6.757215 3.571888 7.662288 17.148486
321 2 3 1.389181 0.997840 2.260323 2.557024 1.877588 1.894504 1.933638 2.019534 1.900901 2.027603
323 2 3 0.958348 2.029636 2.397276 4.062007 1.945870 2.815442 2.055597 1.725256 2.182691 2.087132
324 4 3 0.945454 3.189386 2.125827 51.091354 1.894483 9.554532 1.827863 5.844322 1.926267 1.881465
329 12 1 1.205083 1.511810 5.155050 20.054411 2.134215 1.702998 2.091341 1.798503 1.956467 1.782848
333 12 1 1.592305 1.120601 3.425778 1.839234 2.250641 2.406364 1.800644 1.979284 1.899245 1.719264
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 [ ]: