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 = 2459794
Date = 8-2-2022
data_path = "/mnt/sn1/2459794"
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 2459794.25320 and 2459794.33619
372 diff files found between JDs 2459794.25320 and 2459794.33619

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.293555 0.936956 1.639894 1.192186 1.918042 1.919923 1.598905 1.609557 1.311835 1.713468
4 1 2 0.867369 0.828999 2.458011 3.568438 1.902567 2.248415 1.709801 1.931329 1.491187 2.020815
5 1 2 0.816687 0.995939 1.929527 1.165773 1.895624 1.946926 1.970480 1.731939 4.334772 5.985407
7 2 0 0.902069 0.890201 1.757298 1.400041 2.007269 1.761817 1.625367 1.678783 1.459195 1.657164
8 2 0 1.171012 23.305732 2.501755 87.448734 2.268396 79.307677 2.309125 86.349476 2.810618 115.107643
9 2 0 0.832581 0.834985 1.877424 1.213944 1.839914 1.859846 1.734584 1.832681 1.484191 1.798072
10 2 1 0.867262 1.075975 1.810239 1.522701 1.774081 1.809536 1.869788 1.939561 1.991950 1.952905
15 1 3 0.982537 1.114112 1.364241 1.232540 1.906957 1.894112 2.086130 1.792680 4.021809 4.136390
16 1 3 0.945450 0.931579 1.406464 1.174661 2.016338 1.913313 1.830396 1.821222 7.122348 6.291946
17 1 3 1.033127 0.967713 1.578975 0.973696 2.003855 1.738989 1.658388 1.732401 1.940585 2.367673
18 1 0 37.939902 13.731685 111.063913 39.021328 169.179220 61.321279 1.467609 1.671846 1.240562 1.426594
19 2 1 0.779362 1.017171 1.462026 2.070968 1.929588 1.760167 1.990307 1.891268 2.269581 7.536886
20 2 1 0.807274 0.790964 1.785771 1.375387 2.031070 1.916367 1.848631 1.805857 1.722601 1.646394
21 2 2 0.836487 0.851997 1.497108 1.244115 1.707334 1.720588 1.981188 1.641789 1.507920 1.722544
27 1 0 3.672201 3.495814 7.924679 19.923547 12.796621 5.844764 3.268754 2.107227 2.987957 1.928995
28 1 0 54.693809 1.598928 153.928849 1.597948 286.897777 7.394690 1.962873 1.826045 1.717414 2.499866
29 1 1 1.148887 1.014036 2.929865 1.305894 2.376270 1.850546 2.693625 2.316126 2.815103 2.644618
30 1 1 0.881403 0.995015 1.290973 1.262507 1.675861 1.771269 2.135562 2.562464 1.510073 3.502174
31 2 2 0.863702 1.027694 1.938269 1.616915 2.042632 1.988865 2.906998 5.402444 2.631340 6.575191
32 2 2 0.930181 1.938866 0.957908 2.453154 1.752438 2.304038 3.276944 6.565785 2.900162 5.766449
33 2 3 63.500915 0.954706 148.510485 1.600892 334.145898 1.971100 1.615752 1.926810 1.474121 1.659713
36 3 3 1.207917 1.373104 1.572610 1.492888 1.910109 1.792571 1.596778 1.616395 1.192511 1.465841
37 3 1 0.931136 0.956253 1.827153 1.177236 2.295999 1.985723 1.632338 1.735361 2.113980 2.658020
38 3 1 0.880615 1.040119 1.981120 1.414928 2.044444 2.066404 1.845702 2.172715 1.666061 1.719863
40 4 1 95.754383 92.239076 251.099685 261.378619 1.724148 2.222348 0.984794 1.342324 0.877174 0.863398
41 4 3 285.688733 464.201644 569.837436 3209.673154 170.969003 425.445018 306.328267 544.872249 615.294748 2738.881798
42 4 0 97.393249 130.787517 282.701081 359.403325 8.939477 20.436531 3.715397 4.588772 3.178419 2.782283
45 5 0 1.430275 0.987172 3.603634 1.503616 3.765696 1.863206 2.901044 1.812683 2.351935 1.669953
46 5 0 1.343532 1.161571 1.380951 1.161755 3.326010 2.214924 1.985176 1.634995 1.678641 1.960788
50 3 3 1.472047 1.018558 1.634663 1.474470 2.598904 1.698120 1.956878 1.889743 2.307852 1.532286
51 3 2 1.043832 0.900362 13.723857 1.393310 1.715095 1.510489 1.704930 1.594928 1.775868 1.200103
52 3 3 1.029305 1.574809 2.102417 2.720787 1.714006 2.474867 1.835725 2.383614 1.877098 3.050372
53 3 2 0.941330 1.090906 1.981173 2.588373 2.095231 2.597948 2.148535 2.408618 2.417827 2.931669
54 4 0 220.797742 64.684149 499.555266 159.622751 4.881188 7.903374 1.252394 3.035612 1.331763 2.002068
55 4 2 111.467687 102.115169 266.459177 367.772585 4.109666 96.033414 3.690358 14.427596 1.464775 15.420086
56 4 1 114.022874 271.765220 451.391329 1745.830782 173.275327 299.785239 26.572239 85.588674 21.334285 975.955270
57 4 3 97.299686 85.813286 296.445543 260.403969 2.169200 14.810126 1.432294 26.327038 1.242820 76.364073
65 3 0 0.932168 0.858293 1.422367 1.263574 2.070861 1.844367 1.828536 1.763553 1.598777 1.578390
66 3 0 1.254760 0.896181 3.091507 1.516345 2.795601 1.796381 2.307688 1.571732 1.922231 1.651758
67 3 0 0.922050 0.966090 1.339284 1.367522 1.772871 1.764529 1.556769 1.924762 1.393626 1.617103
68 3 1 0.964071 0.919384 1.410313 1.245160 1.825849 1.746505 1.687382 1.736124 1.746816 1.949718
69 4 1 105.332672 76.067958 234.878857 202.419036 2.545931 5.929726 2.120953 2.406041 1.316768 5.370635
70 4 2 197.395322 100.083680 562.675018 294.976147 3.183762 5.821103 1.230996 5.994090 1.377483 1.139547
71 4 2 61.291481 121.977625 162.533474 319.578058 1.305001 5.308984 1.305769 12.410316 0.826230 2.590867
72 4 0 71.100899 105.351310 194.181970 784.659497 4.134457 155.468747 12.164753 28.626146 1.808420 149.162330
73 5 0 1.135787 0.988654 1.552034 1.392770 1.940244 2.117898 1.739602 1.714487 2.371443 2.877438
81 7 0 1.374234 1.028837 1.865214 1.218477 2.123432 1.741729 2.350058 1.603923 8.092902 2.849966
82 7 0 0.913283 0.834020 1.389562 1.406119 1.885468 1.714797 1.716309 1.640136 1.612385 1.556486
83 7 0 0.892783 0.913098 2.417266 1.647745 1.706829 1.746793 1.803626 1.907905 1.722581 1.593463
84 8 3 1.159335 1.143544 1.604899 1.854647 2.089777 1.863707 1.794112 1.855989 4.228294 5.229812
85 8 0 0.801546 0.818708 1.787445 1.469168 1.826475 1.746439 2.020658 1.874520 2.244177 2.164226
86 8 0 1.052587 0.922268 1.561588 1.512543 1.933183 1.537970 2.479365 2.500179 2.065609 2.234303
87 8 2 1.139759 1.229392 1.626510 1.814072 1.627070 1.737290 1.578386 2.038552 1.509063 2.435633
88 9 0 nan nan nan nan nan nan nan nan nan nan
90 9 0 nan nan nan nan nan nan nan nan nan nan
91 9 1 nan nan nan nan nan nan nan nan nan nan
92 10 0 2.393069 2.008992 1.301831 1.074668 2.768492 5.569213 2.821018 2.128803 2.651861 2.791100
93 10 0 1.020855 0.990290 1.331173 1.514407 2.101351 2.737138 1.865269 2.071599 2.640914 3.919107
94 10 0 0.880327 1.247919 1.382218 3.433449 1.821801 3.381289 1.917299 3.101798 1.835657 11.528270
98 7 2 1.280489 0.952488 1.557600 1.750619 2.838276 1.676925 3.113412 1.881430 7.846925 1.914962
99 7 2 0.986192 1.032492 2.123018 1.873823 2.152690 1.779578 2.059656 1.909633 3.053954 14.808054
100 7 1 0.921665 0.829697 1.236653 1.564075 1.801386 1.752222 1.657194 1.628410 1.425882 1.500085
101 8 2 1.277025 1.222885 1.548324 1.405535 1.944454 1.684201 1.889281 1.992035 1.545466 2.342786
102 8 0 0.773074 1.556344 1.336786 6.091321 1.821704 1.948874 1.743278 3.373890 1.329048 4.336084
103 8 1 1.261254 0.837874 1.777470 1.491265 2.311751 1.807655 1.907462 1.791712 2.728354 1.508636
104 8 1 1.867962 1.207584 0.572740 1.437619 2.846458 1.732452 3.602627 1.646862 3.529901 1.350863
105 9 1 nan nan nan nan nan nan nan nan nan nan
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 nan nan nan nan nan nan nan nan nan nan
108 9 1 nan nan nan nan nan nan nan nan nan nan
109 10 1 1.034684 0.981190 1.180096 1.474907 2.283096 2.560873 1.498252 1.759081 1.286530 1.614182
110 10 1 0.886384 1.415246 1.817805 3.946554 2.035810 2.497012 1.627826 2.280937 1.662516 1.994893
111 10 1 0.851391 1.003886 1.537197 1.169818 1.922695 1.820876 1.752995 1.475290 1.472758 1.306481
112 10 2 0.851271 2.657408 1.268569 1.547611 1.683264 2.495543 1.713914 1.486396 1.409039 1.361760
116 7 2 0.856030 0.824345 1.722478 1.149648 1.917303 1.786179 1.717641 1.573783 2.104749 1.630460
117 7 3 1.196472 1.345083 1.732301 1.567213 2.201165 1.687546 2.232646 3.021766 3.425532 7.591763
118 7 3 0.921614 0.937714 1.445370 1.246541 1.999354 1.901245 1.784048 1.787210 1.581125 2.768270
119 7 1 0.891133 0.789626 1.440072 1.462954 2.022050 1.734568 1.855680 1.755547 3.199251 1.889012
120 8 1 5.153297 1.965847 10.393183 3.069650 6.661818 7.331795 7.509823 2.234867 25.600025 5.288621
121 8 3 1.520615 1.263118 2.211153 1.186813 3.514920 3.355209 2.862642 2.370095 3.739116 17.401552
122 8 2 1.499844 1.255493 1.545985 1.425473 3.195920 2.084026 2.146625 1.610327 2.555894 3.173195
123 8 3 1.458582 1.202297 1.536403 1.210451 2.001347 1.651815 1.612866 1.610911 1.977312 1.811068
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.481662 1.663554 2.241351 1.488059 3.246238 5.425964 3.656168 3.733998 4.249740 5.044190
128 10 2 0.810028 0.847753 1.328128 1.417819 1.805382 1.795323 1.764126 1.682275 1.869171 1.824396
129 10 3 0.844788 0.782628 1.631072 1.184119 1.674175 1.828710 1.552919 1.532410 1.363098 1.378748
130 10 3 0.934600 0.824973 1.842989 2.191850 2.137467 1.932059 1.782766 1.689039 1.860960 1.870515
135 12 2 0.878657 1.062851 1.455025 1.416002 1.955658 2.425129 1.935917 2.497452 1.754388 2.855156
136 12 2 1.138961 0.958730 1.937895 1.222113 2.096314 1.657758 3.848406 1.789688 2.442759 1.687404
137 7 3 3.238532 3.699207 2.608591 19.167532 8.796319 5.314551 3.684518 2.502027 5.663474 2.081510
138 7 1 0.859515 5.038573 1.445956 5.619879 2.018229 5.320208 1.786615 3.099028 5.077332 5.635257
140 13 2 1.081992 0.990199 1.449557 2.373917 1.828615 2.003255 1.634221 1.985490 1.337913 2.364100
141 13 2 3.997479 1.067162 11.440465 1.371308 15.853434 1.764840 9.054691 1.428902 6.562380 1.796937
142 13 2 4.412417 2.120008 7.759559 1.554915 5.574256 8.867094 2.748278 1.791888 3.802358 3.573335
143 14 2 0.877072 0.894509 1.587175 1.152418 1.703486 1.794303 1.802236 1.750356 1.686212 2.279076
144 14 3 1.219374 1.174724 1.436850 1.182435 2.078443 1.820390 1.665639 1.679836 1.569767 1.767574
145 14 3 3.298709 4.976923 22.454705 19.632564 13.925448 16.529405 3.038300 1.924917 2.911139 2.075673
150 15 1 3.510186 10.968643 23.013854 52.372233 4.390382 9.442861 4.410918 20.570141 6.189548 38.523064
155 12 2 2.822735 4.299569 9.431751 20.719552 3.958799 3.889390 2.922682 5.480549 3.353044 1.896130
156 12 3 1.406237 1.299753 1.881302 1.301953 2.699538 2.152594 1.825511 1.806103 1.603631 1.759162
157 12 3 1.084909 0.913864 1.676779 1.267205 2.280235 1.928759 1.958982 1.737928 1.555138 1.474578
158 12 3 1.256357 0.916898 2.806968 1.285267 3.328659 2.043524 2.213182 1.608560 2.541469 2.672608
160 13 3 4.152059 12.058363 12.768078 74.013783 6.140836 11.867395 6.051724 23.819623 7.456387 45.120209
161 13 0 2.238340 0.952671 1.637292 1.367228 4.001712 2.076515 3.314570 1.957790 6.146881 3.617942
162 13 0 0.908081 1.003805 1.218040 1.252319 1.741192 1.871306 1.777885 1.922127 1.294991 2.281793
163 14 2 0.924246 1.052980 1.658237 1.341036 1.874018 1.816093 2.195206 1.819798 1.861843 3.680248
164 14 2 0.857380 0.893290 1.182078 1.113264 1.735117 1.647426 1.598001 2.311896 1.346455 1.542715
165 14 0 1.928161 1.591912 2.209354 2.203757 5.328718 3.970492 2.505510 4.138509 3.144787 2.680239
166 14 0 0.988682 1.190604 1.487564 1.659220 2.197048 2.536259 1.834862 3.075190 1.725095 2.555919
167 15 1 1.446857 2.082296 1.877786 2.653110 3.219185 2.495939 2.347582 3.133238 1.928249 2.119073
168 15 2 1.239559 1.145457 3.253184 2.596519 1.906743 1.949594 3.434708 5.407941 5.060238 4.359449
169 15 2 1.116956 12.704439 2.191987 57.858633 2.216130 20.972443 2.784638 17.395833 6.647653 35.881349
170 15 2 1.302545 14.144276 2.401777 66.035274 2.730047 34.654172 3.751762 29.059896 6.201875 46.723268
176 12 0 0.786741 0.811693 1.420190 1.023744 1.914385 1.572408 1.915249 1.460910 1.749572 1.282176
177 12 0 0.827761 0.981055 1.410464 1.489289 1.742304 1.653793 1.595665 1.655350 1.511975 1.648004
178 12 0 0.892573 0.811237 1.478576 1.423356 2.005417 1.584991 1.693423 1.718002 1.452684 1.501009
179 12 1 1.194530 0.836562 1.182832 1.263335 2.033410 1.676949 3.374336 2.020612 2.536401 1.807890
180 13 3 2.326969 1.106429 12.063097 1.156230 6.064238 2.213557 3.591468 1.430901 3.235115 1.523347
181 13 3 1.215829 4.663764 1.053391 9.336475 3.257671 6.870310 1.808057 1.826446 2.325005 1.885508
182 13 0 0.994606 1.442535 2.405314 3.188632 2.269084 3.763717 2.136665 2.453569 2.966543 5.161416
183 13 1 0.940962 0.950562 1.511146 1.385042 2.094049 1.845988 1.602894 1.575762 1.490573 1.727930
184 14 0 0.861632 0.826961 1.474991 1.351385 1.781682 1.840977 1.625303 1.774706 1.382084 1.726337
185 14 1 0.944052 1.104742 1.197247 1.459711 1.896070 2.019643 1.941203 2.675119 1.655436 1.682461
186 14 1 0.837876 0.818994 1.356357 1.538857 1.831643 1.654795 1.671179 2.595777 1.658437 1.810294
187 14 1 0.939635 1.226926 1.504616 1.711013 2.062645 2.207731 2.674980 3.887986 3.543521 4.110495
189 15 3 1.087281 1.044341 1.513840 1.259914 1.861409 1.782433 1.432946 1.607405 1.365159 1.735599
190 15 3 3.665808 1.674411 12.905728 0.650077 5.259957 2.377906 3.141156 2.131463 2.962639 2.819644
191 15 3 0.993725 0.851829 1.136416 1.323090 2.006542 1.759816 1.973787 1.631144 1.775329 1.605428
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.028567 0.954251 2.736551 1.710044 2.917143 1.794554 2.180251 1.626083 1.916124 1.612469
206 19 0 1.167411 0.976282 1.598926 1.867052 1.914077 1.893330 1.612835 1.565115 1.727399 1.434647
207 19 1 0.978197 1.035917 2.072950 3.420055 1.764569 1.682207 1.675914 1.768531 1.864566 2.483527
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.961198 1.007484 1.854317 1.712519 1.719764 1.553564 1.836159 1.613241 1.885139 1.447681
224 19 1 0.824351 3.201039 2.129287 8.199977 1.750116 13.571061 4.224558 11.353912 7.481358 15.691246
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.616678 4.919488 13.402500 28.791950 5.643288 7.400919 6.977123 3.205212 4.935045 11.804758
321 2 3 1.499072 0.998440 2.056159 3.270558 2.049828 1.689946 1.720673 1.648186 1.507410 1.599116
323 2 3 1.024273 1.375902 3.331110 3.823903 2.045390 3.747064 1.724224 2.044328 1.868725 1.942961
324 4 3 102.683447 85.814198 234.347705 211.589814 3.706332 6.295188 2.442848 6.628189 1.673157 1.655339
329 12 1 0.901767 1.734905 2.049667 4.132425 1.838043 1.810127 1.775082 1.724111 1.584796 1.987359
333 12 1 1.247696 1.120368 2.717524 1.785072 2.293159 2.753901 1.783668 1.868141 1.428205 1.734795
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 [ ]: