In [1]:
import os
os.environ['HDF5_USE_FILE_LOCKING'] = 'FALSE'
import h5py
import hdf5plugin
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 = 2459832
Date = 9-9-2022
data_path = "/mnt/sn1/2459832"
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 2459832.25316 and 2459832.33615
372 diff files found between JDs 2459832.25316 and 2459832.33615

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 10*log10($|\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 0.864567 0.908326 1.321440 1.572971 1.650381 1.832593 1.643837 1.555265 1.558399 1.847531
4 1 2 1.006652 1.003046 1.220146 1.499713 2.050594 1.947798 1.599556 1.991787 2.047757 2.127829
5 1 2 0.899761 0.991081 1.475344 1.384740 1.859593 1.632559 1.945939 1.673004 5.067773 5.226388
7 2 0 1.158751 1.039275 1.820328 1.469439 2.160130 2.164083 1.885663 1.629578 2.712921 2.168203
8 2 0 1.361069 10.003836 3.061059 12.004291 2.690188 36.947169 2.866548 47.701752 2.905936 51.623239
9 2 0 0.890661 0.931317 1.890377 1.318032 1.932483 2.028344 2.043546 1.939236 1.702241 1.899850
10 2 1 0.849044 1.034403 1.268394 1.399985 1.617436 1.927337 1.662903 2.152182 1.723007 2.865634
15 1 3 1.104051 1.177100 1.705963 1.449226 2.015888 2.042889 1.775658 1.706495 2.904013 2.855654
16 1 3 0.889775 1.014400 1.538227 1.233555 1.786153 1.713411 1.863776 1.501303 2.576047 1.714375
17 1 3 1.025962 1.107806 1.717297 1.284067 2.360420 1.811397 1.630465 1.699095 1.753578 1.836374
18 1 0 65.615864 8.449648 18.696818 3.012664 320.254479 25.883400 1.913439 1.703639 1.882954 1.783223
19 2 1 0.942513 1.343600 1.341494 6.002762 1.600147 1.953471 1.625478 2.520502 1.448263 5.549778
20 2 1 0.833535 1.038122 1.275125 1.374692 1.853510 1.860567 1.678767 1.837133 1.558210 1.909468
21 2 2 0.880691 0.841571 1.415013 1.566888 1.929550 1.906627 1.814784 2.032331 1.962384 2.226186
27 1 0 6.161643 3.164791 6.434711 16.061640 20.721212 7.613335 3.551661 2.112792 3.933225 1.946687
28 1 0 68.551243 1.506471 14.836133 1.293395 343.098227 2.033795 1.964338 1.863881 2.906155 3.003583
29 1 1 nan nan nan nan nan nan nan nan nan nan
30 1 1 nan nan nan nan nan nan nan nan nan nan
31 2 2 0.893838 1.168459 1.474437 1.373370 1.886661 1.937925 2.621738 4.293680 2.997426 6.834298
32 2 2 1.806574 1.935119 1.178509 0.933660 2.280970 3.004275 4.463509 5.559915 4.534503 5.547948
33 2 3 99.835004 0.915248 19.682119 1.512838 529.282015 1.738081 2.034538 1.591128 2.067614 1.654678
36 3 3 1.316736 1.443016 1.836654 1.452914 2.194648 1.904232 2.047611 1.460250 2.077555 1.797165
37 3 1 0.978019 0.943143 1.379724 1.459757 2.067773 1.849301 1.809822 1.797936 2.369927 2.778311
38 3 1 0.889243 0.908066 1.334224 1.546683 1.831343 2.041074 1.560434 1.747275 1.614353 2.050040
40 4 1 0.833923 1.099045 1.870017 1.286389 1.747418 2.223109 1.674296 2.069689 1.588177 1.957006
41 4 3 0.918758 1.577246 1.269987 5.207709 1.810187 2.200119 1.554484 2.407754 1.478883 4.712834
42 4 0 0.920592 0.999367 1.396589 1.295413 2.062128 2.069173 1.771523 1.675686 2.045572 3.223616
45 5 0 1.274788 1.250273 2.033390 1.397231 3.125940 1.740438 2.663518 1.606485 2.146772 1.881604
46 5 0 1.221349 1.199038 1.362906 1.402173 2.519711 1.919245 1.793381 1.561140 2.025599 1.961825
50 3 3 0.810633 0.930881 1.519643 1.142346 1.726038 1.861740 1.664456 1.855125 1.652533 1.705921
51 3 2 1.732266 0.887985 13.294491 1.351016 1.996550 1.938755 1.782496 1.602849 1.567275 2.047731
52 3 3 1.284173 1.582377 1.443813 2.341790 1.933998 2.648618 1.700670 2.000503 1.912738 2.247800
53 3 2 1.038122 1.379773 1.844963 2.175062 1.998170 3.497699 1.864118 2.328556 2.398054 3.376609
54 4 0 0.915137 0.850001 1.365845 1.345025 1.796372 2.042876 1.715315 1.683219 1.847717 2.742853
55 4 2 0.891293 0.907399 1.534913 1.467415 1.870391 1.887099 1.608639 2.127471 1.965793 2.154733
56 4 1 0.988710 1.258210 1.626263 1.496169 2.332265 2.047608 2.158045 2.007768 2.349028 2.013621
57 4 3 0.986821 1.455862 1.261227 1.804256 1.722393 2.810839 1.764313 1.815805 1.798432 2.325684
65 3 0 0.955301 0.911203 1.521675 1.353712 1.884093 1.690274 1.810534 1.593789 1.814062 1.792909
66 3 0 0.995196 1.012677 1.614754 2.035251 1.754043 2.147614 1.574262 1.791437 1.607346 2.074319
67 3 0 0.880565 0.948976 1.470596 1.627243 1.713898 1.980829 1.535037 1.886345 1.634929 1.972425
68 3 1 0.988417 0.969125 1.269120 1.678179 1.972075 1.862437 1.526539 1.759376 1.551956 2.504830
69 4 1 0.914491 1.283646 1.238494 1.863675 1.807681 2.368909 1.939991 1.969476 1.915534 2.441023
70 4 2 1.133973 1.508677 1.406349 1.690485 2.166275 2.019766 1.835386 1.927454 1.554714 2.191509
71 4 2 0.973063 1.254112 1.614145 1.533310 2.030280 2.005900 1.683113 1.645967 1.756974 1.751783
72 4 0 1.085764 1.081712 1.369083 1.857555 2.575246 2.957940 1.844560 1.877970 2.728263 3.750372
73 5 0 0.928958 3.674456 1.465941 4.135253 2.344147 13.079203 1.793366 1.919415 2.333069 2.044860
81 7 0 1.441028 1.210829 1.667440 2.127109 2.453239 2.225289 2.364088 2.034312 6.770886 3.277005
82 7 0 0.962823 0.909140 1.334004 1.281205 1.651126 1.664574 1.648117 1.588500 2.351672 2.885169
83 7 0 1.006273 0.995608 2.354540 1.600088 2.592949 1.933368 2.151782 1.813883 2.726615 1.943180
84 8 3 1.769999 3.400268 1.877557 7.034344 2.786985 3.547940 2.431769 3.794672 3.758426 5.130542
85 8 0 0.852121 0.974064 2.061711 1.424235 1.881293 1.904352 1.855205 2.192961 2.374629 3.192877
86 8 0 1.830509 1.425280 2.033724 1.418204 3.867429 2.039563 3.855722 5.408760 6.371982 7.829232
87 8 2 2.420116 2.875302 2.123242 2.318698 5.940889 5.370657 7.249220 11.013995 16.915403 45.968844
88 9 0 1.090766 26.557434 2.721820 92.799868 2.390852 80.756590 2.591005 79.378124 3.269532 114.856523
90 9 0 0.868283 0.852605 1.636465 1.511418 1.964673 1.758104 1.751295 1.840792 2.513920 2.088982
91 9 1 0.931818 17.017877 2.751118 24.524492 2.237105 69.035339 2.609477 78.586630 2.762411 84.469716
92 10 0 2.166266 1.489523 0.652576 0.879314 2.223736 2.199768 2.294756 1.840702 3.105606 2.455804
93 10 0 0.853567 0.920841 1.489951 1.383290 1.965792 2.010283 1.691124 1.728082 2.065963 2.110111
94 10 0 0.959950 1.475031 1.381860 3.303907 1.980293 3.706124 2.055971 3.225976 2.041163 5.994859
98 7 2 0.945185 0.870927 2.214514 1.964156 1.847591 1.854250 1.705247 1.724278 2.593195 2.082223
99 7 2 1.010606 1.186031 1.531320 1.316566 1.780668 2.222139 1.863839 1.594209 3.804672 7.078463
100 7 1 1.241499 1.125272 1.703181 1.972226 2.264196 2.401408 1.792857 1.876163 2.119843 2.077417
101 8 2 1.250721 1.379100 1.620314 1.625740 1.979632 1.860263 1.632122 1.823697 2.029352 3.669729
102 8 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
103 8 1 1.131520 1.063659 1.398908 1.757938 1.723215 2.046382 1.601669 1.881166 1.870061 1.914840
104 8 1 2.303524 1.408385 0.454394 1.610875 2.507912 1.712103 3.790354 1.624558 4.005755 1.882626
105 9 1 1.208010 0.944366 1.653461 1.470464 2.081786 1.758770 2.128180 1.849602 3.251911 2.367311
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 2.730267 0.956292 2.222335 1.702317 2.453193 1.896906 15.966291 2.093562 45.645703 8.639678
108 9 1 0.975092 0.778394 1.824794 2.171240 1.788782 1.663064 1.653561 1.710710 2.393132 1.746291
109 10 1 2.249979 3.460699 2.017843 2.159215 3.962043 10.568123 2.054738 2.031490 1.951582 2.077297
110 10 1 1.343856 1.234436 1.712144 1.699218 2.530649 2.241790 2.251903 2.168895 2.386143 1.933712
111 10 1 1.031582 1.087936 1.340012 1.365734 2.223254 2.228061 2.043521 1.892028 1.761969 1.989845
112 10 2 0.926450 0.972478 1.425906 1.378487 1.883287 1.964573 1.644500 1.854950 1.710339 2.034656
116 7 2 0.787067 0.832191 1.250960 1.387307 1.726178 1.864353 1.654150 1.757285 2.609030 1.930599
117 7 3 0.901240 1.004960 1.490299 1.713363 1.810342 1.950344 2.007114 2.226261 2.967944 3.388196
118 7 3 1.662471 1.010226 3.532658 1.571196 3.002564 2.114955 2.784006 2.067083 3.339876 3.282949
119 7 1 0.817634 0.853998 1.544535 1.783504 1.798536 2.008664 1.819279 1.863602 2.244024 2.430990
120 8 1 3.890539 1.231189 8.623780 3.115928 7.644476 2.123778 6.920178 1.756258 21.589115 1.911297
121 8 3 1.391001 1.486285 2.439047 1.468368 3.617755 3.156029 2.371830 2.223620 3.416727 15.329988
122 8 2 1.271553 1.445507 1.544205 1.690878 1.887513 2.288111 1.546037 1.642539 2.155798 2.683645
123 8 3 1.153982 1.254051 1.406936 1.682412 1.862007 1.561331 1.653251 1.726800 2.284485 2.241180
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.162689 1.276953 1.770261 1.328590 2.645170 2.735555 2.987946 2.671002 3.215098 3.401907
128 10 2 0.781746 0.977023 1.449575 1.539840 1.672134 1.925049 1.894176 1.853601 2.117880 2.123285
129 10 3 0.928628 0.925136 1.330957 1.521722 1.486398 1.535852 1.431136 1.573236 1.408639 2.010705
130 10 3 1.063007 1.030784 1.648624 1.479012 2.372060 2.090892 1.850342 1.683755 2.383333 1.998925
135 12 2 0.980825 1.238707 1.337686 1.593382 1.887671 2.360857 1.596492 1.897752 1.333057 1.817993
136 12 2 1.142217 1.262814 1.070474 1.335848 1.922585 1.716725 3.241691 2.038376 1.926825 2.288274
137 7 3 0.890365 1.179442 1.476845 3.607432 1.782076 2.619347 1.744153 2.293041 2.193280 3.016305
138 7 1 0.850652 0.845538 1.265580 1.469403 1.773348 1.848641 1.707196 1.953257 1.864409 2.288859
140 13 2 3.518673 2.316045 7.892724 17.896297 3.938829 2.447702 3.386252 2.752272 2.629752 1.820667
141 13 2 11.534414 1.196846 26.013307 1.325761 43.487034 2.038333 21.577164 1.548022 16.042457 1.417396
142 13 2 2.030810 1.470532 5.282913 1.877941 6.612380 2.911162 2.779030 1.950156 3.736599 3.665777
143 14 2 0.902748 0.926616 1.473116 1.488387 1.791969 1.872871 1.946741 1.712420 1.711122 1.626936
144 14 3 1.022118 1.195425 1.404415 1.231932 2.075177 1.921754 1.652578 1.691452 1.760916 1.974171
145 14 3 3.643454 3.760249 21.095347 18.494094 11.439716 14.656481 2.877019 1.954892 2.773714 1.844957
150 15 1 3.452000 10.147337 23.030120 50.722410 8.336257 9.441060 5.935372 19.977020 6.648342 33.737330
155 12 2 2.162347 2.396738 7.840253 21.782011 2.633620 6.623672 2.562164 2.162025 3.431411 2.207164
156 12 3 0.992766 1.144893 1.309320 1.850069 1.881028 2.076047 1.648909 1.769598 1.467638 1.537330
157 12 3 1.139694 1.245558 1.467902 1.614661 2.105068 2.175640 1.559425 1.856085 1.743100 1.984134
158 12 3 1.193654 1.679335 2.099540 4.125365 2.715422 4.506175 2.498491 1.953724 2.802008 2.008457
160 13 3 nan nan nan nan nan nan nan nan nan nan
161 13 0 1.763481 1.050166 0.978937 1.432497 3.789714 1.926369 3.417762 1.702207 3.554901 2.670721
162 13 0 0.922080 1.009164 1.356379 1.399990 1.905476 1.978106 1.714874 1.616998 1.492251 1.677802
163 14 2 0.955377 1.034230 1.902549 1.565813 1.816900 2.075446 1.894682 1.679436 1.856495 2.237885
164 14 2 0.953315 0.971144 1.407161 1.532967 1.794886 2.007414 1.745468 2.048381 1.717415 2.055830
165 14 0 1.900987 1.798792 2.477966 2.773460 5.066376 4.072132 2.055497 3.198170 2.625704 3.745960
166 14 0 0.976085 0.859491 1.504736 1.332162 1.904708 1.765353 1.705663 1.850233 1.619290 1.890727
167 15 1 2.219145 1.574179 1.923289 1.869272 3.406667 2.224570 3.854089 2.586226 3.381580 2.099517
168 15 2 1.307419 1.108160 3.417077 1.989928 2.612340 1.774491 4.425656 3.518243 4.989677 3.059903
169 15 2 1.270854 1.394450 2.869530 2.101013 2.363886 2.375386 2.605115 5.137740 4.952712 5.535747
170 15 2 1.376949 1.164177 3.114268 3.019898 2.791126 2.197352 2.864589 4.044774 5.238132 4.042642
176 12 0 0.882241 1.043025 1.425464 1.865421 1.923706 1.944306 1.923210 1.903065 1.908533 1.928747
177 12 0 0.847486 1.189036 1.488437 1.412939 1.777210 1.874159 1.717080 1.642639 1.720818 1.868614
178 12 0 0.904097 0.843680 1.282066 1.185202 1.835115 1.704742 1.867855 1.960165 1.741722 1.559247
179 12 1 1.183976 0.964738 1.340126 3.725947 1.948586 1.642701 2.663914 1.923078 2.149807 2.512867
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.854308 1.388618 3.726442 1.935980 2.727911 2.975089 1.720409 1.815356 1.744468 2.478693
183 13 1 1.046758 1.157780 1.391662 2.344130 2.109300 2.527208 1.471489 1.989442 1.891882 2.310056
184 14 0 0.829280 0.946312 1.412528 1.718391 1.771015 2.011159 1.636270 1.756633 1.861852 2.284472
185 14 1 0.840171 1.179687 1.301457 1.989227 1.735692 1.935856 1.795220 2.281534 2.004044 2.012875
186 14 1 0.910615 1.000526 1.551123 1.763448 1.897908 2.056806 1.721449 1.748554 2.285368 2.524168
187 14 1 0.991597 1.346437 1.672780 2.050587 1.971193 2.558307 1.813118 2.769980 1.713345 2.609819
189 15 3 0.970556 1.113294 1.451462 1.379677 1.758534 1.851439 1.477839 1.725817 1.330503 1.486442
190 15 3 3.983979 1.904652 12.734297 1.021593 6.053966 2.788996 3.179231 2.717607 3.154218 2.948993
191 15 3 0.858231 1.009805 1.257001 1.291268 1.857040 1.967383 1.667823 1.829171 1.366436 1.541767
203 18 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
320 3 2 4.134724 5.055585 11.061769 26.536823 6.926933 9.142495 6.561968 6.027661 9.735813 16.467178
321 2 3 0.974438 1.103440 1.747664 1.531582 2.035619 1.662487 1.639018 1.838138 1.915190 1.699435
323 2 3 0.950077 2.075308 4.786768 3.443090 1.737143 3.082467 1.541391 1.826360 1.763513 2.462383
324 4 3 0.963384 1.261634 2.113372 27.527000 1.692669 1.638001 1.618293 1.759447 1.564948 1.859228
329 12 1 1.128989 1.074445 4.383431 14.716442 2.049693 1.983947 1.649552 1.726337 1.797381 1.853709
333 12 1 1.201811 1.059864 1.684542 1.933349 2.185048 3.428990 1.834671 1.706886 1.644705 1.804425
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 [ ]: