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 = 2459749
Date = 6-18-2022
data_path = "/mnt/sn1/2459749"
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 2459749.25315 and 2459749.33614
372 diff files found between JDs 2459749.25315 and 2459749.33614

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
0 0 0 174.322112 107.266183 392.119860 254.225572 6.368240 16.405389 3.397961 63.900705 1.417593 1.964349
1 0 0 84.156225 77.043231 180.079976 202.111858 1.900553 1.520588 1.239122 1.002464 1.366372 0.736916
2 0 0 89.174861 91.292195 223.230013 242.341610 2.317176 3.357926 3.130823 8.827408 2.229164 2.955940
3 1 2 1.710186 28.766664 4.655103 104.375674 3.411283 99.314394 6.886169 116.591325 7.430555 100.645201
4 1 2 1.407157 27.310453 1.993689 109.887493 1.833191 89.855287 2.975490 99.106760 3.348630 102.789197
5 1 2 2.493572 30.682481 8.024432 102.548648 5.952933 112.347193 7.978329 120.746345 17.664710 126.915340
7 2 0 0.888493 0.836341 1.672755 1.788670 1.743130 1.708689 1.691411 1.921248 2.306754 2.335233
8 2 0 1.268220 19.380563 2.719139 34.470750 2.050547 82.744134 2.847750 90.532143 3.545343 94.214314
9 2 0 0.821939 0.800474 1.641462 1.439329 1.741404 1.773356 2.015540 1.771905 1.798233 1.970890
10 2 1 0.829000 7.520162 1.816937 6.750177 1.801613 32.130181 1.733611 32.313269 2.064500 34.662842
11 0 1 nan nan nan nan nan nan nan nan nan nan
12 0 1 nan nan nan nan nan nan nan nan nan nan
13 0 1 nan nan nan nan nan nan nan nan nan nan
14 0 2 85.126911 196.807713 231.256191 1160.184824 20.793136 150.185417 32.147529 103.780999 2.457474 25.464745
15 1 3 1.000230 0.985410 1.829168 1.700500 2.168244 2.001319 1.892945 2.226873 4.730983 4.676901
16 1 3 0.955120 0.940762 1.931965 1.492384 1.973374 2.084664 2.021888 2.072849 6.882098 5.584996
17 1 3 1.046734 0.846376 1.611609 1.679169 2.198967 2.016177 1.780648 1.924040 2.506880 3.530078
18 1 0 42.379988 2.929436 9.072562 1.454656 198.252158 9.215686 1.803435 1.965460 1.936562 1.650719
19 2 1 0.957530 0.974698 1.773797 1.760632 1.802148 1.936685 2.378648 2.050329 2.907137 5.270014
20 2 1 0.848704 0.798944 2.000790 1.460934 1.840044 1.503708 1.981946 1.439160 2.386976 2.252622
21 2 2 1.252482 0.790575 2.617002 1.660008 1.633009 1.687839 1.979798 2.078992 1.989524 2.450425
23 0 2 83.302813 97.771033 205.219958 226.694585 10.042994 8.494094 1.679129 3.718363 2.243585 1.377648
24 0 2 102.764433 173.072444 220.168236 422.202921 2.857701 3.977125 1.235672 1.426621 1.596195 1.225500
25 0 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
26 0 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
27 1 0 61.714779 147.628681 8.535494 12.676368 310.703429 769.235886 1.562841 2.107116 2.287346 1.825590
28 1 0 0.860195 79.866405 1.564954 8.540059 1.829861 391.091736 1.795892 1.988173 2.206867 2.206827
29 1 1 1.021525 0.830817 2.112879 1.485532 1.948749 1.635452 2.883186 2.213825 4.309437 2.252268
30 1 1 1.135066 0.947648 1.824494 1.936131 1.767732 1.939827 3.355486 4.338433 3.704171 7.943010
31 2 2 0.930088 0.910921 1.728350 1.494000 1.961358 1.878657 1.966096 2.468690 2.150652 3.512753
32 2 2 2.151030 2.635216 1.713255 1.699047 3.765511 2.729805 9.995751 15.646390 12.659798 14.681314
33 2 3 41.129808 0.814464 12.890706 1.660719 192.272345 1.808853 1.620682 2.003684 1.857187 2.516957
36 3 3 1.168821 1.320858 3.192682 1.633615 1.913175 2.027718 1.941269 1.807794 1.813792 3.076761
37 3 1 1.257774 0.945422 2.430459 1.351875 2.748318 2.225186 2.037991 1.861575 3.625058 3.275570
38 3 1 0.909792 1.243944 2.255453 1.383774 2.145390 2.328060 2.591911 2.511767 2.466757 2.300880
39 0 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
40 4 1 0.884470 1.034895 1.909889 1.935850 2.295788 2.444469 2.206700 2.517467 2.355982 6.675005
41 4 3 nan nan nan nan nan nan nan nan nan nan
42 4 0 1.105026 1.002666 1.835965 1.713202 2.949083 2.703158 2.048751 2.604671 5.896160 11.246011
45 5 0 nan nan nan nan nan nan nan nan nan nan
46 5 0 nan nan nan nan nan nan nan nan nan nan
50 3 3 1.028938 0.851788 1.879512 1.324494 2.108082 1.666279 1.905700 1.743551 1.968521 1.739124
51 3 2 0.949885 0.814528 1.831549 1.556139 2.002892 1.732456 2.080944 1.832607 3.853277 3.406642
52 3 3 1.187218 1.192730 2.032622 1.624932 2.224318 1.808593 2.678434 2.144654 3.285225 2.906998
53 3 2 0.968313 1.106146 2.055764 2.770643 1.648131 3.321570 1.827231 2.873578 4.682391 5.755942
54 4 0 1.181851 1.095710 1.832670 1.780240 2.890560 2.220809 1.959791 2.536058 3.237920 4.464987
55 4 2 0.801205 0.893392 1.660442 1.763078 1.839637 1.702714 1.862235 1.780037 2.364155 1.947011
56 4 1 1.003613 0.816567 1.651531 1.642447 1.822035 1.890117 1.832630 1.797274 1.890490 1.972171
57 4 3 nan nan nan nan nan nan nan nan nan nan
65 3 0 1.007592 0.800377 1.749070 1.966004 1.730269 1.845164 1.711373 1.786086 2.029624 2.247451
66 3 0 1.209319 0.940598 3.503081 1.842144 2.676293 2.012796 2.511148 1.807606 2.889679 3.412508
67 3 0 1.005511 0.871448 1.848028 1.593408 2.032361 1.884776 1.709083 1.707027 1.797664 1.984054
68 3 1 1.097700 0.808555 1.541422 1.676522 1.808575 1.617470 1.634370 1.545372 2.044225 2.007320
69 4 1 0.859643 0.865374 2.000092 2.021890 1.775813 1.933458 2.141278 1.977632 2.845249 3.579621
70 4 2 1.224353 1.346155 1.702166 1.537746 2.263329 3.370501 2.189713 2.556245 1.727852 2.521880
71 4 2 0.902022 0.833289 1.684259 1.930189 1.785024 1.711879 1.611449 1.763563 1.793711 1.729971
72 4 0 0.944960 0.922573 1.895462 1.563033 2.343731 2.296321 1.978158 1.840801 2.962716 4.255043
73 5 0 nan nan nan nan nan nan nan nan nan nan
81 7 0 1.626915 2.992791 1.706671 1.610352 2.042457 4.521361 3.780162 11.039059 9.523095 15.204976
82 7 0 1.077613 0.918814 1.493166 1.611601 2.108235 1.920640 1.804559 1.810962 5.329386 8.518936
83 7 0 3.222124 3.477031 12.697030 24.996904 3.464868 6.647774 4.210257 2.390988 5.327349 2.057487
84 8 3 1.333017 1.357906 1.763645 2.220040 1.888564 2.469056 2.071555 2.370331 15.629770 17.570209
85 8 0 nan nan nan nan nan nan nan nan nan nan
86 8 0 nan nan nan nan nan nan nan nan nan nan
87 8 2 1.167066 1.202830 1.640674 1.773754 1.490134 2.686855 2.505604 2.975603 3.849793 3.326245
88 9 0 nan nan nan nan nan nan nan nan nan nan
89 9 2 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 nan nan nan nan nan nan nan nan nan nan
93 10 0 nan nan nan nan nan nan nan nan nan nan
94 10 0 nan nan nan nan nan nan nan nan nan nan
98 7 2 3.570389 4.293464 12.475116 24.613226 3.990618 12.818543 4.533215 2.511532 3.423078 2.137710
99 7 2 1.064938 0.883043 1.632384 1.715263 1.666870 1.893753 1.776755 1.986997 2.559519 2.767231
100 7 1 10.252426 6.348403 18.642932 19.350160 22.064935 30.483696 4.062348 4.101371 4.649119 2.696109
101 8 2 1.741310 1.216451 1.881063 1.850030 1.890425 1.835707 1.991666 2.456318 2.048149 6.340296
102 8 0 nan nan nan nan nan nan nan nan nan nan
103 8 1 1.170010 0.837428 1.759434 1.668285 1.725525 1.653195 1.646028 1.758015 1.892197 1.877953
104 8 1 2.702018 0.977277 4.688920 1.594208 1.903500 1.653267 2.546687 1.673916 2.657340 2.015058
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.637705 1.690119 2.002116 1.656445 2.940083 4.622389 1.778953 1.830925 2.127369 2.099832
110 10 1 1.818843 1.909481 1.722396 1.076364 3.045787 2.813525 2.748315 3.458660 2.740118 2.586560
111 10 1 1.267139 0.888540 1.910446 1.486145 2.270266 1.696841 1.807218 1.821486 1.810326 1.632282
112 10 2 2.516415 1.093258 9.096341 1.621120 3.828294 2.208673 3.019899 3.194034 3.555560 4.518832
116 7 2 9.227840 2.216596 5.380220 10.132055 22.776549 5.189699 5.870330 2.699451 6.277374 3.818859
119 7 1 1.881505 2.876225 1.725590 20.044633 5.717239 6.906020 1.870587 2.283707 10.410917 2.029084
120 8 1 4.767393 2.000102 8.660529 1.719611 5.795754 3.095701 7.452610 1.978636 21.273928 4.883343
121 8 3 1.408895 1.280247 1.983080 1.751132 3.501647 3.619404 2.080780 1.925725 3.290849 13.223898
122 8 2 1.860321 1.234611 1.708954 1.556486 2.655318 1.959363 4.884296 3.481632 6.975209 3.563732
123 8 3 1.258295 1.020000 1.822169 1.839175 2.074210 1.963791 2.193791 2.038571 4.308035 3.352528
124 9 2 nan nan nan nan nan nan nan nan nan nan
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 2.415736 2.234190 3.228005 2.010954 5.908746 7.147194 8.214617 6.437193 10.140368 9.345638
128 10 2 0.879133 0.941936 1.638648 2.685923 1.838645 2.078335 1.800585 2.133177 2.704335 10.851293
129 10 3 0.890141 0.811360 1.887126 1.425405 1.796260 1.669139 1.900656 1.836182 1.844149 2.601763
130 10 3 1.320510 1.517974 2.971313 13.883838 2.232874 1.878866 2.241643 1.898982 2.806291 1.849636
135 12 2 0.930236 0.864512 1.964268 1.571508 1.788010 1.815762 1.996828 1.983208 2.054955 1.871022
136 12 2 1.534343 0.989031 4.197491 1.486360 2.308494 1.558546 5.648783 3.134484 2.775951 2.608954
138 7 1 1.242839 1.003976 1.662747 1.853952 2.317621 2.279978 2.245970 2.591524 31.849588 37.449063
140 13 2 1.204823 0.984714 1.671025 1.564906 1.925421 1.871185 1.808679 2.247086 1.963738 3.794683
141 13 2 5.947547 1.123042 21.252732 1.600365 21.157309 2.180025 10.281002 2.025581 10.693794 2.521873
142 13 2 3.392466 1.063684 6.295402 2.008080 4.962013 2.223101 2.516418 2.135006 3.231768 2.352633
143 14 2 1.122887 0.811231 2.914415 1.537193 2.255383 2.039762 2.267522 1.930891 2.683805 4.674246
144 14 3 1.157789 0.940879 1.725497 1.341546 2.285143 1.732164 1.954709 1.585910 2.198830 1.769332
145 14 3 0.790796 0.838617 1.468210 1.574064 1.592100 1.986065 1.630737 1.716995 1.800992 1.702710
150 15 1 3.657063 10.171496 17.696054 47.860000 7.398902 8.423701 4.863459 18.272880 2.839562 1.814876
155 12 2 2.334178 2.719613 8.829626 19.123045 2.798181 4.594314 3.346685 3.068323 3.714107 2.033580
156 12 3 1.157625 1.218915 1.532102 1.534821 2.844778 2.796171 1.885137 2.226380 1.999099 2.005107
157 12 3 1.007866 0.961552 1.625921 1.573242 2.112161 2.041480 2.121324 1.746420 2.018663 2.124528
158 12 3 1.180833 1.081635 2.921416 1.509220 3.094365 2.567398 2.643331 2.298574 5.723238 6.821938
160 13 3 2.137024 1.639313 1.196912 1.819990 2.866820 2.118404 1.851022 1.913137 2.452678 2.297753
161 13 0 2.052530 0.977680 1.535457 1.617566 3.122821 2.174323 2.850863 1.837277 2.283991 2.601544
162 13 0 1.011472 0.809933 3.017636 1.602145 2.710294 1.918281 2.282740 1.873771 2.110722 1.646896
163 14 2 0.936107 0.862438 1.805752 1.531934 1.919160 1.683862 2.194943 1.681587 2.247697 2.649728
164 14 2 0.971435 0.930755 1.964584 1.649719 2.080407 2.041461 2.170769 2.998108 3.532253 3.119012
165 14 0 1.374972 0.988151 2.490866 1.621715 2.737745 2.120155 2.535858 2.172590 4.062472 4.356604
166 14 0 3.460328 2.834435 2.093984 1.926627 4.472298 5.303814 7.416336 7.381258 5.055208 5.577497
167 15 1 2.846026 2.246867 2.383343 1.379865 2.569540 2.734905 3.388324 1.824995 2.461833 1.726562
168 15 2 1.652962 1.212931 2.968980 2.178062 2.192575 1.632678 4.521731 7.793114 10.255350 6.637690
169 15 2 0.983888 10.824154 1.850652 53.175476 1.751828 5.667948 2.415073 6.961107 3.034531 8.614819
170 15 2 1.607837 12.635818 3.077179 60.492561 3.822107 7.408388 4.066406 8.379746 4.796779 8.327177
176 12 0 0.875784 0.794123 1.725982 1.589495 1.953605 1.620653 2.292841 1.843349 2.631065 1.919375
177 12 0 0.867662 0.936022 1.961719 1.717098 1.940072 1.887766 2.084638 1.865331 3.285346 2.676559
178 12 0 0.951055 0.968996 1.586964 1.547709 1.826339 2.060577 1.739539 2.553733 1.822699 2.851567
179 12 1 1.571587 0.824771 1.774479 1.501182 2.965773 1.500009 7.141045 2.458538 4.167511 2.642119
180 13 3 2.104730 5.226448 15.106635 1.693331 3.201568 10.674207 2.868708 7.725994 2.709990 33.748250
181 13 3 1.044417 0.973079 1.985210 1.301616 2.160498 2.126197 1.945831 1.832124 1.750571 1.651971
182 13 0 1.266434 1.323821 2.427401 1.891221 4.218911 4.115342 2.445283 2.045451 2.839404 2.636189
183 13 1 1.140957 0.934713 1.753430 1.583637 3.123661 1.913155 1.999940 1.802751 2.893254 2.835656
184 14 0 0.895701 0.782319 1.606960 1.513535 1.884274 1.678323 2.128470 1.931476 2.205254 2.680302
185 14 1 1.074977 1.152150 2.012084 2.230856 1.935855 2.497303 2.517274 3.251915 2.596823 2.828651
186 14 1 0.976173 0.901415 1.755300 1.770787 1.931025 1.776637 2.014683 1.955863 2.800425 2.780417
187 14 1 1.193082 1.740081 3.352409 4.928495 2.594866 4.396946 3.150562 5.126757 3.272055 7.602662
189 15 3 0.997028 1.160592 1.890851 1.578733 1.953176 2.150661 1.886586 2.409398 2.555558 5.150649
190 15 3 2.271002 2.627408 0.848445 0.942310 3.476178 2.798543 2.913809 2.605686 5.299238 3.159902
191 15 3 0.968577 0.996602 1.788855 1.721958 2.008406 2.084035 1.909097 2.191540 1.978311 2.180586
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
320 3 2 5.005848 4.021906 10.948623 21.111376 4.784662 4.192141 5.992988 2.756488 4.885263 2.741875
321 2 3 0.906058 0.823337 1.722023 2.197913 1.672913 1.690519 1.679310 1.815509 1.687787 2.421780
323 2 3 1.012135 3.717045 3.216667 5.110676 1.957179 2.810393 2.208790 1.737204 2.083808 2.346586
324 4 3 nan nan nan nan nan nan nan nan nan nan
329 12 1 0.772775 1.179496 3.632983 23.190375 1.589771 1.980906 1.801912 1.683952 1.888878 2.159678
333 12 1 0.820976 1.404281 1.742965 3.271111 1.663659 3.307802 1.633569 2.026277 1.675230 1.784921
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 [ ]: