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 = 2459787
Date = 7-26-2022
data_path = "/mnt/sn1/2459787"
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 2459787.25312 and 2459787.33611
372 diff files found between JDs 2459787.25312 and 2459787.33611

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.801460 1.220889 1.389839 1.538544 3.394198 2.648712 1.643095 1.718994 1.148899 2.018009
4 1 2 0.928176 0.785354 1.660535 3.479632 2.061718 1.691487 1.520368 1.481846 4.641856 4.181611
5 1 2 1.000245 0.999250 1.700903 1.468978 2.341288 1.983834 2.072171 1.693529 3.803809 5.351489
7 2 0 0.772068 0.762911 1.134143 0.717720 2.349593 2.360107 0.736959 0.780205 2.447907 2.119691
8 2 0 1.393952 7.366107 4.343321 26.303995 2.972038 17.455011 3.634008 51.092670 4.470722 61.158983
9 2 0 0.938683 0.874938 2.200696 1.356216 2.125415 1.893035 1.876176 1.750254 1.586990 1.419079
10 2 1 1.819335 17.204548 3.711628 83.903336 2.458746 38.896686 2.803356 91.496058 10.208068 110.610650
15 1 3 1.237322 1.088383 1.510143 1.293220 2.145343 2.425227 1.708728 1.909447 3.989263 4.165894
16 1 3 0.992839 1.058842 1.616468 1.625724 2.100819 2.141794 1.999735 1.735554 7.895991 6.165793
17 1 3 0.983488 0.945675 1.275415 1.238539 2.070030 1.815134 1.575623 1.607230 2.520387 2.658173
18 1 0 66.359430 16.563513 2.869769 2.753922 326.137771 67.863083 1.360126 1.385630 2.037969 2.077258
19 2 1 0.000000 0.000000 1.476773 47.668999 1.631286 34.831560 1.576077 46.354175 0.000000 0.000000
20 2 1 1.070446 0.926755 4.133303 1.653306 1.748295 1.877884 2.029855 1.867712 2.659783 1.899353
21 2 2 nan nan nan nan nan nan nan nan nan nan
27 1 0 3.060972 3.392696 5.485076 19.778209 7.499315 5.507772 3.258649 2.016052 3.320437 2.080270
28 1 0 69.592227 1.673543 2.659978 1.749710 320.494306 7.493739 1.624613 1.746987 1.487691 2.075680
29 1 1 1.228971 0.933187 3.026773 1.178755 2.704711 1.741687 3.224525 2.088357 3.971004 3.001201
30 1 1 1.097668 1.104882 1.551152 1.998598 2.082770 2.141978 2.986887 3.377945 1.890670 3.807375
31 2 2 nan nan nan nan nan nan nan nan nan nan
32 2 2 nan nan nan nan nan nan nan nan nan nan
33 2 3 100.177326 0.909263 4.238097 1.758034 481.259636 1.780953 1.719644 1.855972 1.441268 1.671397
36 3 3 1.400949 1.324243 2.061928 1.588056 2.374706 2.501888 1.639915 1.632127 1.274724 1.406027
37 3 1 1.011628 1.034036 5.951409 2.745458 2.570568 1.974335 2.007047 1.938963 2.355374 2.553314
38 3 1 0.909342 0.975904 1.668408 1.151390 1.707151 2.034315 1.756860 1.971454 1.347217 1.455069
40 4 1 0.964026 1.013546 1.798098 1.313006 1.745384 1.849674 1.629190 1.691400 1.268591 2.049878
41 4 3 1.027789 1.127674 1.340586 2.282856 2.000815 2.385099 1.768370 1.676834 1.344018 1.536730
42 4 0 0.939579 0.980793 1.329717 1.285547 2.448291 2.349851 1.763406 1.954069 1.584546 3.259556
45 5 0 1.542999 1.075271 3.262933 1.419403 3.966793 1.971307 3.306064 2.091270 2.691072 2.080635
46 5 0 1.413698 1.302273 1.394136 1.346847 2.628717 2.350739 1.600591 1.759094 1.670739 2.024981
50 3 3 1.188876 0.910216 1.732297 1.396432 2.749250 2.689653 1.688539 1.756165 1.492456 1.475532
51 3 2 4.476565 1.056341 16.035804 1.980890 8.781595 1.754512 4.891868 1.541837 6.774988 1.981789
52 3 3 6.878914 1.111083 24.033281 1.684994 9.612751 2.810749 4.074239 1.738729 4.592512 1.987549
53 3 2 0.997216 0.991453 1.994549 2.048998 2.010078 2.520564 1.674525 2.299965 2.533506 3.245653
54 4 0 1.008594 0.900866 1.330873 1.372325 2.587606 2.061801 1.804150 1.840369 2.047245 2.053982
55 4 2 0.948618 2.365913 1.610169 1.159346 2.012271 3.398953 2.108405 1.588421 1.905539 1.459310
56 4 1 1.111242 1.195950 1.978121 1.886733 2.375639 2.140077 2.268448 2.050781 2.158471 2.807678
57 4 3 0.949901 1.777798 1.868910 8.596425 2.148743 1.927257 1.807249 2.000736 1.509016 1.890070
65 3 0 1.296387 0.858553 3.019511 1.306845 3.627859 2.260960 2.436879 1.693385 2.092608 1.505090
66 3 0 1.351025 1.049349 3.170610 1.540103 3.110203 2.246158 2.501892 1.701469 1.964103 1.795225
67 3 0 1.111744 1.072671 1.451068 1.377451 1.876666 2.009024 1.567859 1.827410 1.380968 1.545917
68 3 1 1.033625 1.008624 1.534741 1.479853 1.849779 2.292847 1.781559 1.756110 1.661926 2.129027
69 4 1 1.024645 1.001938 1.818936 2.193054 1.973414 1.929574 1.905620 1.813701 2.225223 2.265541
70 4 2 1.311035 1.370550 1.719585 1.895470 2.680728 2.462098 2.514368 2.802473 1.630029 2.101924
71 4 2 1.127653 1.220668 1.409236 1.374529 2.158713 2.101027 1.566985 1.662917 1.258379 1.478371
72 4 0 1.086983 1.066622 1.759865 1.807856 2.260154 3.292846 1.674669 2.061281 2.693229 3.019813
73 5 0 1.013250 1.259081 1.767789 1.408596 2.444277 2.303284 2.015663 1.985338 2.594939 2.947677
81 7 0 1.644070 1.351789 1.685920 1.715908 2.891187 2.359665 2.180910 2.096017 8.003109 2.821018
82 7 0 1.032853 0.952287 1.590679 1.265263 1.991764 2.582365 1.710168 1.990617 1.910161 2.496915
83 7 0 1.004052 1.139556 1.768253 4.495367 1.808386 2.457529 1.525851 2.177195 1.415617 4.029491
84 8 3 1.473133 2.127203 1.691775 4.274581 2.075741 2.396709 1.770857 2.709196 5.887192 7.838298
85 8 0 1.703962 0.925446 2.765648 1.743191 3.639034 1.984595 2.001939 1.797920 2.349442 1.541151
86 8 0 0.863540 1.017406 1.810832 1.902837 1.656495 2.223149 1.905676 1.928758 3.387246 3.179981
87 8 2 1.256356 1.119765 4.200576 1.885412 1.666280 2.348122 1.994182 3.063270 3.493857 2.902001
88 9 0 2.315740 5.399183 15.885416 34.133711 5.322389 24.685153 4.369804 3.882733 7.002778 2.480417
90 9 0 9.550445 3.176814 2.573377 2.941271 18.275450 8.801986 25.602859 10.043590 19.773741 10.923620
91 9 1 2.999920 3.544540 12.248295 11.777592 4.500287 9.319425 6.256395 4.095662 8.154480 2.482041
92 10 0 3.136250 2.709165 0.678157 0.961267 11.150693 6.778390 2.552608 2.107926 2.120145 2.034499
93 10 0 1.061220 0.957676 1.656348 1.393586 1.667692 2.358190 1.622999 1.819614 1.426559 1.731767
94 10 0 1.003274 1.222122 1.610467 2.233757 1.890262 3.104916 2.267291 3.003033 2.217124 9.064670
98 7 2 1.218691 0.943606 1.831310 1.345393 2.152600 1.851140 1.863090 1.489786 3.194745 1.219546
99 7 2 0.997318 0.989359 1.554241 1.463167 2.192298 2.042148 1.819330 1.523369 3.232516 5.417011
100 7 1 1.377223 1.180625 1.902518 1.974098 2.353382 2.298913 1.742159 1.939021 1.584424 1.903184
101 8 2 1.475026 9.470569 3.836974 40.637731 1.791933 13.735453 2.058909 12.874068 3.569696 29.773637
102 8 0 0.923430 1.010571 1.553067 2.357552 1.882039 2.312514 1.772239 1.979528 1.732031 2.279012
103 8 1 1.357158 0.907350 1.867943 1.439691 1.989920 2.080228 1.741288 1.641938 1.751653 1.424368
104 8 1 1.576705 1.223591 0.517643 1.307942 2.403053 1.755260 3.207547 1.450831 20.039438 1.207370
105 9 1 2.094266 2.613029 14.587436 6.130666 3.505469 7.200851 4.535048 2.112465 9.054964 2.440475
106 9 3 1.148068 1.202996 1.465281 2.225330 2.233327 2.529218 2.083655 2.218450 1.788097 1.384375
107 9 0 4.270631 3.147331 41.536622 44.322102 8.544121 3.272695 5.921809 6.765937 7.766018 6.965982
108 9 1 1.472803 4.085954 4.194899 7.750280 3.391549 2.202309 2.699991 35.262279 6.343611 42.472187
109 10 1 1.645135 1.594545 1.575568 1.599131 3.608104 3.620461 1.773786 1.842717 1.554148 1.854872
110 10 1 0.964830 1.325146 1.526206 1.509946 1.899930 2.748775 1.611293 2.672778 1.360227 1.872446
111 10 1 1.012982 1.118889 1.945492 1.226476 2.425748 2.058987 1.891877 1.585049 1.581860 1.289403
112 10 2 0.881377 1.105020 1.198698 1.377707 1.781757 1.983592 1.724428 1.502920 1.384768 1.371996
116 7 2 0.917409 0.816032 1.343036 1.654833 2.615917 1.808573 1.734843 1.541763 1.719150 1.468578
117 7 3 1.069256 1.036822 1.637217 1.637730 2.029760 1.995346 1.963766 2.443224 1.986100 2.987642
118 7 3 1.037525 1.048752 1.584403 1.940757 1.925635 2.605938 1.679659 2.046858 1.443911 2.643952
119 7 1 0.974501 0.861010 1.493207 1.618361 2.168285 2.119792 2.208691 1.902015 6.355749 2.215947
120 8 1 3.432169 2.547794 10.219448 2.678489 5.888994 10.333617 8.498771 1.834227 24.279965 2.687520
121 8 3 1.297539 1.654583 1.635603 1.474595 2.230136 5.461773 2.009292 2.029654 1.988840 14.969219
122 8 2 2.772179 1.492360 3.897203 1.917270 7.596204 4.240465 6.622562 3.156471 10.434803 8.185624
123 8 3 1.392418 1.303387 1.623524 1.539603 1.772054 2.075372 1.618034 1.721295 1.329095 1.497600
125 9 3 3.600402 1.679163 37.694143 12.445762 10.253401 4.142011 2.887044 2.170388 5.255604 2.203139
126 9 3 2.516736 3.239971 31.818210 9.018761 4.494536 11.058338 4.333729 4.231072 4.952037 3.735062
127 10 2 0.934758 1.032228 1.573519 1.277763 1.866280 2.199577 1.771816 1.806756 2.320142 2.597551
128 10 2 0.901537 1.055499 1.737813 1.807530 2.363937 2.216448 1.827011 1.747974 1.565562 2.509122
129 10 3 0.959217 0.900446 1.538671 1.308472 2.269859 1.584806 1.928314 1.473769 1.523648 1.586806
130 10 3 1.208765 1.000613 2.669833 2.844235 2.988596 2.914119 2.281753 2.009832 2.451737 2.414983
135 12 2 0.869680 0.940494 1.365462 1.513110 2.032750 2.219815 1.610007 1.707087 1.367892 1.482634
136 12 2 1.106705 1.173134 2.604177 1.278001 2.143515 2.249614 3.454369 2.033625 1.533479 1.807046
137 7 3 3.644993 3.735306 21.221813 19.402435 10.289010 5.063560 4.215974 2.583656 6.816875 2.480788
138 7 1 0.973915 4.676457 1.519210 5.448888 2.169293 5.016895 1.697234 3.005344 6.692961 6.077942
140 13 2 0.940774 1.001320 1.496378 2.290040 1.779955 2.686968 1.633354 1.788513 1.491156 2.045683
141 13 2 7.346757 1.067936 17.060445 1.708368 25.916651 2.829713 13.773109 1.727355 11.985819 1.569059
142 13 2 5.434799 3.073918 7.593036 1.859633 5.463466 9.856737 2.888611 1.728791 3.590408 3.720416
143 14 2 nan nan nan nan nan nan nan nan nan nan
144 14 3 1.151669 1.145199 1.614720 1.336926 2.005517 2.272331 1.783525 1.676861 1.532071 1.584530
145 14 3 3.590489 5.042017 20.886433 18.144371 17.450275 15.215602 3.476265 1.636668 2.609472 1.653792
150 15 1 2.957973 7.726706 16.115030 43.996192 4.404616 10.684795 4.242037 13.719133 7.203535 29.683008
155 12 2 2.323616 2.788935 6.139224 17.944785 3.119742 3.255277 3.160981 5.854834 3.631603 1.661391
156 12 3 1.391580 2.401285 4.004441 7.580345 2.901547 2.605600 2.067939 16.470978 2.360285 19.060171
157 12 3 1.299637 1.340358 4.020113 2.506000 2.304139 1.991518 2.194938 6.816441 2.856586 8.471799
158 12 3 1.526340 1.248200 4.154596 2.424194 3.269835 3.058002 2.302554 3.043853 6.667841 4.487474
160 13 3 4.242038 11.558089 15.643241 72.629289 6.779497 10.687041 5.441094 22.296119 8.877352 44.567342
161 13 0 2.313280 1.178379 2.984640 1.426660 6.349168 2.354358 2.730535 1.733702 3.773413 2.771287
162 13 0 0.983675 0.940462 1.441024 1.243902 2.255011 2.014574 1.621118 1.513854 1.379594 1.488049
163 14 2 nan nan nan nan nan nan nan nan nan nan
164 14 2 nan nan nan nan nan nan nan nan nan nan
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.020761 2.017522 2.098403 2.162233 3.645409 2.427841 2.653866 2.184369 2.581811 1.856551
168 15 2 1.396362 1.001658 3.681959 2.282890 2.988180 2.493552 3.727353 3.644279 5.367138 3.089064
169 15 2 1.561633 3.276302 2.976738 17.498589 1.521304 1.546417 1.703197 3.050418 5.635095 6.715918
170 15 2 1.407478 6.437888 4.196746 32.274381 2.617770 4.423246 2.887331 6.950153 4.046275 8.237717
176 12 0 0.891156 0.884187 1.405731 1.529599 1.831132 2.000079 1.852363 1.708427 1.681621 1.547420
177 12 0 0.872916 0.998457 1.511689 1.617192 2.062564 2.070682 1.626470 1.609232 1.515182 1.760080
178 12 0 0.983004 0.986479 1.582492 2.418332 2.009395 1.891897 1.887092 1.968466 1.501114 1.826620
179 12 1 1.412367 0.910745 1.379821 1.906019 2.222986 2.071783 4.247457 2.186772 2.271773 1.987741
180 13 3 2.189948 1.143253 11.903143 1.352417 4.125126 2.523038 3.016125 1.828821 5.936320 1.655734
181 13 3 1.206771 4.497974 1.481697 11.429320 3.762592 6.339895 1.811520 1.765156 1.939419 2.095457
182 13 0 1.158890 1.335032 1.927718 2.094418 2.509730 3.043942 1.734705 1.972563 1.786950 2.075971
183 13 1 1.057967 1.068572 1.837471 1.606479 2.626001 1.884854 1.954070 1.727523 1.951152 2.230914
184 14 0 nan nan nan nan nan nan nan nan nan nan
185 14 1 nan nan nan nan nan nan nan nan nan nan
186 14 1 nan nan nan nan nan nan nan nan nan nan
187 14 1 nan nan nan nan nan nan nan nan nan nan
189 15 3 0.978024 0.986471 1.542145 1.367703 1.908965 1.986271 1.455488 1.418373 1.486946 1.561477
190 15 3 3.577735 2.558164 12.035090 1.170540 4.735336 3.189372 2.847317 2.632383 3.083785 5.170897
191 15 3 0.984262 0.855969 1.270499 1.352917 2.092875 2.032965 1.682022 1.657503 4.324575 4.552430
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.636656 0.932713 4.953661 1.833894 4.741906 2.328409 3.075613 1.787330 2.287580 1.675647
206 19 0 1.327728 1.125498 1.864820 2.386059 1.812858 2.185826 1.759704 1.891153 1.864677 1.759356
207 19 1 0.814231 0.942975 1.853425 2.081523 1.872710 2.409612 1.848401 1.741210 1.821730 1.880369
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.909677 0.916565 1.957408 1.563012 1.902867 2.008429 1.882128 1.404568 1.798309 1.501311
224 19 1 0.993693 0.769234 2.961249 1.922101 1.845677 1.663958 3.828238 2.125117 7.251348 3.599787
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 5.050917 4.714449 12.956227 28.326435 5.655778 6.502598 5.333552 5.335440 9.849812 16.211867
321 2 3 0.976821 1.133336 1.988751 2.033090 2.292641 1.757817 1.780781 1.718858 1.667823 1.705536
323 2 3 1.236046 1.042773 1.935328 3.909251 2.365273 2.633338 1.747774 1.759916 1.752250 1.868724
324 4 3 1.079580 1.850865 2.553680 1.991737 2.106441 3.640459 1.663653 1.847472 1.837524 1.694387
329 12 1 1.175563 2.240326 5.532895 17.391438 2.318463 2.184935 1.723721 1.729119 1.528813 4.795914
333 12 1 1.188126 1.176437 2.638242 2.391431 2.452229 3.617983 1.548328 1.805902 1.552725 1.567410
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 [ ]: