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 = 2459800
Date = 8-8-2022
data_path = "/mnt/sn1/2459800"
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 2459800.25309 and 2459800.33609
372 diff files found between JDs 2459800.25309 and 2459800.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 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.274245 1.087866 1.319834 1.226290 2.304828 2.269690 1.908285 1.494905 1.580260 1.801937
4 1 2 1.093688 1.831323 1.923353 4.407447 2.122818 2.774482 1.856647 2.123331 2.032313 2.052207
5 1 2 0.883948 1.198726 1.652839 1.125171 2.138383 2.402877 1.664620 1.732741 3.839845 4.104322
7 2 0 0.866264 0.955889 1.255649 1.421445 1.970753 2.470189 1.731251 1.691452 1.684475 1.688341
8 2 0 1.481760 5.930202 6.405039 33.245758 3.472187 18.552706 3.844650 8.930128 5.027987 35.859983
9 2 0 0.831717 0.893713 1.389580 1.104778 1.896869 2.456516 2.003859 2.117372 1.726284 2.127526
10 2 1 nan nan nan nan nan nan nan nan nan nan
15 1 3 0.984049 1.099783 1.103782 1.041358 2.154938 2.410230 2.091102 1.936129 6.054212 5.120278
16 1 3 1.011995 0.925425 1.421888 1.078549 2.563835 2.328264 1.823796 1.724865 5.531905 3.000050
17 1 3 1.033670 0.985509 1.258554 1.042925 2.451053 2.163563 1.678615 1.631562 1.878201 1.915312
18 1 0 42.808985 12.978648 1.170313 1.288665 197.418567 57.033788 1.466190 1.753189 1.536415 1.840482
19 2 1 nan nan nan nan nan nan nan nan nan nan
20 2 1 nan nan nan nan nan nan nan nan nan nan
21 2 2 1.045268 0.916617 1.337829 1.079681 3.132128 2.506164 2.019350 1.622522 1.767840 1.540922
27 1 0 3.832110 3.866561 6.593865 18.972560 12.164927 5.911025 3.085719 1.937558 3.111752 1.742404
28 1 0 59.205905 1.906609 0.793139 1.556996 288.060010 9.123027 1.792466 1.872175 1.937453 2.450696
29 1 1 1.116762 1.257201 2.071557 1.399437 2.492648 2.787280 2.621209 2.856823 3.959636 2.874038
30 1 1 0.970181 1.357184 1.238455 1.583900 2.041914 2.475187 1.853457 2.205286 2.127026 4.866593
31 2 2 1.101895 1.226351 1.335512 1.223029 2.523776 2.860634 2.510504 5.072526 2.884860 8.462702
32 2 2 1.486842 2.771790 1.014897 1.106849 2.873627 2.326649 4.715724 5.417291 4.683602 6.361158
33 2 3 49.112315 1.055871 1.038572 1.173075 224.328436 2.576154 1.448113 1.807023 1.604853 1.970701
36 3 3 1.034430 1.267726 1.335587 1.294016 2.622123 2.840034 1.404749 1.654280 1.401339 1.607572
37 3 1 1.023094 1.030700 2.339722 1.730543 3.002372 2.511267 1.780694 1.929726 2.419518 2.842582
38 3 1 0.880857 1.106377 1.306189 1.242963 2.332981 2.333220 1.734582 2.027320 1.586972 1.953991
40 4 1 1.018508 1.184792 1.796164 1.359887 2.481715 2.901724 2.000368 2.094790 1.712038 2.030331
41 4 3 1.046556 1.022739 1.332367 2.894816 2.512571 2.152941 1.759358 1.583446 1.547241 1.899666
42 4 0 1.115838 1.044505 1.142096 1.450984 2.501372 2.439651 1.796674 2.187192 2.064315 4.254869
45 5 0 1.394761 1.266339 2.832631 1.267261 4.294094 2.613427 3.149101 1.952753 2.946200 2.261723
46 5 0 1.159209 1.072319 1.650338 1.090313 3.337222 2.485106 1.755849 1.671480 1.667362 1.936142
50 3 3 0.988439 2.211045 1.736507 1.150055 2.398743 4.384725 1.716414 1.969680 1.920701 1.996515
51 3 2 2.007512 0.994951 6.789490 1.943898 2.573294 2.111419 1.661289 1.603067 1.660166 1.562337
52 3 3 1.147343 1.214376 1.611482 1.920058 2.441191 3.130276 1.883086 2.022105 1.964849 2.025589
53 3 2 1.046124 1.371935 1.951468 1.918198 2.780664 2.953763 2.129347 2.586938 3.594131 3.205033
54 4 0 0.969944 0.976849 1.200363 1.084213 2.575178 2.736943 1.593017 1.781369 2.172585 2.116304
55 4 2 1.025374 1.059988 1.484663 1.169090 3.229781 2.290269 2.095525 1.830592 2.417954 1.710126
56 4 1 1.035333 1.186637 1.630703 1.451618 2.531459 2.403037 2.047723 1.871960 2.571207 2.216620
57 4 3 1.470964 1.959449 1.515271 9.486349 5.928508 2.289840 2.063390 2.109557 2.401343 2.211536
65 3 0 1.000003 0.975380 1.784473 1.000924 2.893456 2.531359 1.996649 1.489986 1.837161 1.425357
66 3 0 1.293091 0.975647 2.341141 1.427590 3.036889 2.559315 2.277706 1.794246 2.111449 1.991976
67 3 0 0.869388 0.972254 1.250553 1.207491 2.322592 2.497653 1.638298 1.671917 1.635437 1.581759
68 3 1 0.954708 1.032329 1.519480 1.202225 2.805480 2.627785 1.734700 1.686641 1.981751 2.246519
69 4 1 1.023496 0.990724 1.293629 1.454479 2.858895 2.771224 1.786192 1.957707 1.685577 1.830096
70 4 2 1.165147 1.125388 1.341915 1.611718 3.469031 2.562070 2.269978 2.097249 1.677276 2.035917
71 4 2 1.117649 1.035354 1.393888 1.231749 2.393999 2.297581 1.710918 1.731921 1.631867 1.599820
72 4 0 1.128357 1.197236 1.533270 1.495522 3.351049 3.359934 1.878903 2.033994 2.960915 4.586549
73 5 0 1.176117 1.788425 1.462958 4.928650 2.289405 3.382291 1.740056 1.767988 2.287297 1.577732
81 7 0 1.210721 1.187751 1.702666 1.233152 2.563811 2.296568 2.217431 1.653152 6.963359 3.080661
82 7 0 0.874497 1.154054 1.252286 1.143038 2.459975 2.476377 1.941088 1.905009 1.806758 2.184043
83 7 0 0.920708 1.021248 1.909144 1.283002 2.412265 2.446558 1.780196 1.856173 1.783162 1.752803
84 8 3 1.084396 1.031186 1.385115 1.674226 2.332821 2.217827 1.678919 1.792106 3.090130 3.718063
85 8 0 0.907342 1.038682 1.496086 1.469905 2.613083 2.423160 1.819697 2.367002 2.530255 3.477412
86 8 0 1.651374 1.250188 2.097654 1.463260 3.400551 3.478567 3.443687 4.187339 2.825223 3.764261
87 8 2 1.003079 1.142467 1.399518 1.506254 2.297694 2.349527 1.738221 2.514347 2.299150 2.458600
88 9 0 2.348324 6.136003 15.670456 36.539673 5.937012 36.520812 4.548489 4.008385 7.397221 2.591112
90 9 0 1.936079 1.227797 6.271121 12.258178 2.588352 1.905768 2.879969 1.596102 3.264458 1.917923
91 9 1 3.572689 3.379465 13.158998 11.640014 5.486250 9.007213 6.035153 4.108540 7.939644 2.557444
92 10 0 2.130826 2.123335 0.616031 0.869260 3.830760 7.998205 2.444855 2.123978 2.586577 2.530779
93 10 0 1.141570 0.942341 1.373166 1.334273 2.173222 2.615660 1.762327 1.846011 1.791994 2.422123
94 10 0 0.969761 1.271163 1.463293 2.660353 2.780497 3.494319 2.071316 2.990338 1.966039 4.498937
98 7 2 1.265484 0.944172 1.780677 1.420159 3.678823 2.108397 3.246407 1.942587 10.640908 1.728908
99 7 2 1.001564 1.202105 1.671263 1.678521 3.180519 2.650101 2.053171 2.185911 2.861015 19.299679
100 7 1 1.222215 1.077006 1.676997 1.498859 2.647096 2.441706 1.779809 1.750381 1.724030 1.889989
101 8 2 1.046267 1.040353 1.480083 1.507380 2.288826 2.118399 1.777998 1.742235 1.747138 1.995557
102 8 0 0.918976 1.511740 1.307580 5.248792 2.832266 2.286803 1.989364 2.748502 2.459172 4.413763
103 8 1 1.420929 0.984956 1.648395 1.173969 3.224147 2.226373 2.439161 1.732630 3.802227 1.733734
104 8 1 1.958885 1.067169 0.351403 1.303814 2.892887 2.433115 3.524173 1.613759 3.871896 1.423080
105 9 1 2.234784 2.198523 15.824858 6.372225 3.721026 6.523694 4.863134 2.240408 9.539946 2.748237
106 9 3 2.832097 3.480839 10.059456 15.570117 4.279941 13.422017 3.250807 2.238338 5.302540 2.643140
107 9 0 4.038735 3.229449 37.151032 33.361934 7.851685 2.844663 6.472110 5.998168 8.755716 6.241171
108 9 1 1.683625 1.351428 7.663797 4.886695 2.063992 1.699568 2.717087 1.750882 3.200848 1.940077
109 10 1 1.780785 1.307523 1.604096 1.389569 5.385229 3.748155 2.035356 1.823505 1.614387 1.849097
110 10 1 0.929758 1.333083 1.573957 2.083685 2.672325 2.728390 1.597810 2.071079 1.671732 1.744508
111 10 1 1.200195 1.178742 2.143608 1.300159 2.865990 2.760933 2.478310 1.718250 2.035172 1.696333
112 10 2 0.920040 1.339612 1.288745 1.407516 2.317086 2.332322 1.791389 1.689558 1.638916 1.484951
116 7 2 1.037373 0.906715 1.272064 1.123741 3.041634 2.458566 1.515921 1.707619 1.970166 1.594870
117 7 3 1.048705 1.097993 1.714755 1.432900 2.916137 2.139513 1.846319 2.567447 2.275699 4.466459
118 7 3 1.030678 1.026459 1.510509 1.351475 2.422381 2.393608 1.959278 2.008570 1.640717 3.630649
119 7 1 0.923913 0.823741 1.281413 1.597376 2.564495 1.884587 1.820589 1.699735 3.310382 2.014854
120 8 1 3.653315 1.872810 11.787503 2.627289 6.946234 7.984216 8.890029 1.834026 24.815554 3.062504
121 8 3 1.517833 1.510884 1.243857 1.325511 5.008083 4.722240 2.288351 2.446521 3.513625 8.531849
122 8 2 1.544186 1.430240 1.651350 1.309655 4.254565 3.764154 2.345715 2.267214 3.487208 5.251945
123 8 3 1.239053 1.011637 1.496044 1.310513 2.588118 2.192272 1.770636 1.721332 2.473646 1.979092
125 9 3 4.137669 1.754677 39.131675 12.586969 12.737643 5.645249 3.090806 2.117481 4.903442 2.488373
126 9 3 3.047617 2.399390 34.174153 8.489762 5.783814 6.302427 3.770321 4.132814 5.123002 3.318698
127 10 2 1.488173 1.762530 1.876409 1.327623 4.332537 4.372718 3.622186 3.976764 3.782839 4.731775
128 10 2 0.873619 0.947419 1.538011 1.350541 2.185600 2.391830 1.862567 1.769719 2.159008 2.341234
129 10 3 0.950663 1.050602 1.454910 1.200884 2.807302 2.511551 1.766787 2.001842 1.726353 2.555290
130 10 3 1.332331 1.351041 1.965982 1.672090 3.439707 2.866443 2.107689 1.617608 2.369308 1.924819
135 12 2 1.091510 1.208198 1.479970 1.057327 2.820760 2.721658 2.014364 2.164101 1.985113 2.075423
136 12 2 1.199713 1.006101 1.809997 1.068648 2.337353 2.051668 4.131361 2.029009 2.345488 2.535604
137 7 3 3.360479 3.136156 15.802803 17.326978 9.585990 5.315468 3.788269 2.542246 5.996520 2.086133
138 7 1 0.964784 2.654148 1.408112 6.473475 2.592803 5.289157 2.006425 3.444871 7.201788 6.925793
140 13 2 2.770229 5.008621 15.463817 44.947268 3.134611 2.594323 3.741391 9.556358 5.742263 18.783077
141 13 2 8.082603 1.077093 13.535889 1.226876 30.475524 2.171840 18.610157 1.765124 13.979180 2.267491
142 13 2 5.108336 2.000598 8.440931 1.713973 8.988188 8.315839 2.873527 1.810045 5.682197 4.019838
143 14 2 1.006988 0.964622 2.038769 1.228408 2.300543 2.290831 2.158405 1.848845 2.031158 2.241389
144 14 3 1.181634 1.193802 1.273970 1.206573 2.473955 2.184111 1.736871 1.566481 1.789367 1.888102
145 14 3 4.138444 5.440211 22.532045 19.318636 20.417958 15.787427 2.893061 1.947882 3.072725 1.831320
150 15 1 2.836669 4.499972 24.328621 41.275084 4.811092 5.438106 3.822900 7.515319 5.206801 11.469317
155 12 2 2.431216 4.767787 7.330245 21.846052 3.511636 3.881886 3.430204 2.340174 3.307207 1.844947
156 12 3 1.137520 1.195300 1.163874 1.723821 2.557983 2.358823 1.781559 1.946292 1.633577 1.887826
157 12 3 1.061220 0.997624 1.444120 1.172221 2.621680 2.347049 1.601972 1.804458 1.607946 1.482742
158 12 3 1.135826 0.934010 2.414438 1.809643 3.020664 2.042597 2.096405 1.654759 2.069478 1.620478
160 13 3 nan nan nan nan nan nan nan nan nan nan
161 13 0 2.013103 1.031471 1.071641 1.339815 4.267615 2.175401 3.299075 1.833205 6.147533 3.793862
162 13 0 0.938375 0.896509 1.419583 1.215747 1.972737 2.026076 1.960991 1.688062 1.473512 2.201558
163 14 2 0.919735 0.959529 1.417590 1.213541 2.679803 2.250582 2.191456 1.691232 1.742295 1.724888
164 14 2 1.012368 0.900784 1.458933 1.233652 2.688121 1.935762 1.786445 2.020790 1.638107 1.682664
165 14 0 nan nan nan nan nan nan nan nan nan nan
166 14 0 nan nan nan nan nan nan nan nan nan nan
167 15 1 2.180986 2.789459 1.917001 2.027298 2.607489 1.712779 2.694215 1.766628 2.479545 1.921622
168 15 2 1.400227 1.122410 4.613698 2.303662 2.264510 1.617472 4.459380 4.820810 5.756083 4.719879
169 15 2 1.229220 6.964630 4.670621 40.051280 2.572997 2.175533 3.200789 4.482891 5.623731 6.538601
170 15 2 1.498034 7.055144 4.913684 45.906381 2.917706 4.945414 3.425133 7.380747 6.217146 9.719054
176 12 0 0.835024 0.915328 1.510700 1.265252 2.322643 2.344082 1.842917 1.822878 1.922284 1.763519
177 12 0 0.895526 0.917200 1.615572 1.230106 2.061433 2.130136 1.576516 1.736713 1.715803 1.885632
178 12 0 1.002594 0.956578 1.195622 1.971270 2.317425 2.624401 1.540200 2.108205 1.798386 1.828606
179 12 1 1.347386 0.922731 1.290660 2.863288 3.251895 2.655860 3.960285 2.049573 2.076447 2.006485
180 13 3 nan nan nan nan nan nan nan nan nan nan
181 13 3 nan nan nan nan nan nan nan nan nan nan
182 13 0 1.373932 1.279405 1.744704 2.286585 3.794483 3.225740 1.882852 1.945624 1.568700 2.791017
183 13 1 1.002195 1.047268 1.681096 1.308662 2.915679 2.560363 1.705639 1.798924 2.028828 2.271735
184 14 0 nan nan nan nan nan nan nan nan nan nan
185 14 1 0.963718 1.388734 1.078304 1.786080 2.905201 2.739539 1.867982 2.110461 1.957465 1.606111
186 14 1 0.923660 1.133115 1.222672 1.121284 2.375375 3.121904 1.839901 1.580847 1.922026 2.144460
187 14 1 0.955930 1.171339 1.831734 1.917997 2.789695 3.085533 2.253823 3.221658 4.884536 7.376150
189 15 3 0.907095 1.018721 1.231991 1.160191 1.828355 2.490543 1.520004 1.937025 1.600516 2.015562
190 15 3 2.933474 1.843558 12.558803 1.039428 4.451534 3.630931 3.224975 2.487446 3.280249 4.500109
191 15 3 0.996212 0.874415 1.229625 1.564659 2.649877 2.370201 1.983592 2.135603 1.852659 1.662328
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.741574 1.035183 4.674293 1.880653 4.973215 1.846367 3.066122 1.972341 2.565141 1.809777
206 19 0 1.313018 1.053057 1.583286 1.638905 2.138997 2.377286 1.767618 1.644934 1.965389 1.616597
207 19 1 0.909845 0.942402 2.015736 3.029262 2.256524 1.728695 1.741000 1.752130 1.749631 2.272156
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.269493 1.743433 1.862931 2.034652 2.078721 2.000721 1.563491 1.644017 1.675369 1.480053
224 19 1 0.908703 0.829817 3.207540 2.466916 1.867685 1.739876 3.756534 1.931829 6.848950 3.538010
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.651794 5.078218 9.589680 27.438398 6.576922 6.813447 6.939651 5.258607 5.681461 5.569742
321 2 3 0.793481 1.121057 2.040672 2.859428 1.997231 2.087978 1.752180 1.903664 1.741894 1.896839
323 2 3 1.060086 1.059319 3.210656 4.581559 2.147864 3.815963 1.642854 1.823484 1.743108 1.852094
324 4 3 0.854594 0.926261 2.674519 2.021606 1.877077 1.760788 1.858706 1.682024 1.898066 1.743393
329 12 1 0.846969 1.199974 2.704607 6.872184 1.714951 2.184421 1.600482 1.707149 1.684557 1.570254
333 12 1 1.192596 1.482511 3.126136 1.443925 2.317575 2.642878 1.747926 1.776350 1.931854 1.573459
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 [ ]: