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 = 2459761
Date = 6-30-2022
data_path = "/mnt/sn1/2459761"
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 2459761.25318 and 2459761.33617
372 diff files found between JDs 2459761.25318 and 2459761.33617

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 nan nan nan nan nan nan nan nan nan nan
1 0 0 nan nan nan nan nan nan nan nan nan nan
2 0 0 nan nan nan nan nan nan nan nan nan nan
3 1 2 1.122576 0.909621 1.655305 1.433653 2.128134 1.881847 1.705327 1.815942 1.699181 2.267089
4 1 2 1.063335 2.002925 3.940749 9.553978 1.923467 2.495277 1.959398 2.129421 3.499449 3.133842
5 1 2 1.014846 1.016622 1.688255 1.631869 2.039770 2.154915 2.197604 2.192672 8.865243 9.893682
7 2 0 1.017476 0.937983 1.812675 1.713208 2.274868 2.474709 1.998180 2.037228 2.520166 2.825196
8 2 0 2.328947 18.907280 8.196340 71.838154 4.585858 57.996091 7.766067 22.765581 7.819722 89.132452
9 2 0 0.868182 0.982573 1.577767 1.501243 1.769836 2.035624 2.301993 2.549658 2.519503 2.778748
10 2 1 1.017824 1.070606 1.998673 1.857701 2.131507 2.450472 1.868774 2.475297 2.600770 2.685659
11 0 1 90.093108 244.336112 226.186455 1731.765448 11.443764 119.548349 9.930763 876.235326 4.318036 1141.791114
12 0 1 206.694780 386.284231 738.856670 2765.068586 125.984873 281.305580 155.245885 570.137096 20.271693 603.304494
13 0 1 101.800945 273.532426 235.210349 758.090000 57.665261 146.294862 142.343218 672.028959 12.980414 53.044187
14 0 2 nan nan nan nan nan nan nan nan nan nan
15 1 3 1.239509 1.074876 1.951825 1.712353 2.000194 2.644202 1.902508 2.214873 4.801818 7.826106
16 1 3 1.048251 0.889887 1.737524 1.623696 1.871557 1.828554 1.765811 1.722427 9.435615 3.479763
17 1 3 1.137618 0.902258 1.593166 1.592980 2.722795 2.014531 1.785359 1.823694 3.042672 3.264987
18 1 0 54.364903 1.586521 1.189161 1.387367 229.290707 3.961933 1.605121 1.710083 2.276596 1.769257
19 2 1 0.985185 1.020652 1.547068 1.888185 1.774209 2.159692 1.868569 2.130357 4.329758 12.680668
20 2 1 0.891507 0.898163 1.683250 1.490197 1.760706 1.653941 1.785256 1.600132 2.299773 2.996275
21 2 2 0.881551 0.854334 1.456561 1.535278 1.774933 1.797869 1.946237 2.234699 1.905904 2.422115
23 0 2 nan nan nan nan nan nan nan nan nan nan
24 0 2 nan nan nan nan nan nan nan nan nan nan
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 4.175799 2.978030 7.889258 10.316873 9.695968 5.432444 3.486235 2.262524 3.733825 1.995442
28 1 0 98.321677 16.271474 1.252406 57.327014 487.332102 49.972336 2.142851 18.510113 2.655246 71.952543
29 1 1 1.430684 1.272330 2.789305 1.765406 2.189715 2.371287 3.241366 3.165377 4.213287 6.136092
30 1 1 1.369888 0.966132 2.582939 1.445665 2.289327 1.944923 3.139066 3.182873 3.487316 12.168069
31 2 2 0.937613 1.090483 1.577430 1.707116 1.853051 2.144493 2.452492 4.862864 3.233754 9.661943
32 2 2 0.889378 2.376396 1.655994 1.364206 1.591907 3.870067 2.545808 12.214040 2.676357 6.702321
33 2 3 21.640655 0.928709 1.796318 1.569622 94.644373 1.835287 1.846878 1.741079 2.540246 2.394450
36 3 3 nan nan nan nan nan nan nan nan nan nan
37 3 1 1.224047 1.000406 2.071966 1.438966 2.932438 2.396759 2.110430 1.939653 4.674483 3.498451
38 3 1 0.959750 1.043415 2.210784 1.520414 1.768649 2.074942 2.727789 2.575739 2.978406 3.060827
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.954422 0.988866 1.450068 1.633643 1.796311 2.219792 1.807361 2.333414 2.159038 4.655765
41 4 3 1.018963 1.035480 1.640090 1.893680 1.823631 2.192224 1.691577 1.782667 1.876290 2.343369
42 4 0 1.127216 0.944477 1.448433 1.738114 1.970718 2.300532 1.660137 1.974731 3.586006 6.781917
45 5 0 2.350841 1.135387 18.024870 1.641699 2.862778 1.795094 3.270995 2.028534 3.469662 2.153948
46 5 0 1.787180 1.300144 1.961749 1.627688 3.703943 2.893628 1.996275 1.978333 2.898554 4.204825
50 3 3 nan nan nan nan nan nan nan nan nan nan
51 3 2 4.317453 0.890692 11.481956 2.617323 4.911958 1.732952 4.658637 2.012821 5.697577 4.129179
52 3 3 nan nan nan nan nan nan nan nan nan nan
53 3 2 1.087289 1.013130 2.390195 2.584681 2.236997 2.800255 2.277483 2.487745 5.299871 5.916047
54 4 0 1.064495 0.919348 1.972509 1.760770 2.554804 1.992053 2.258887 2.156404 4.572149 5.355910
55 4 2 0.939189 0.878297 2.032340 1.502346 1.944622 2.145928 2.225368 1.799243 3.294185 2.518186
56 4 1 1.184257 1.151756 1.613535 1.556176 2.125907 2.132334 2.455827 2.197248 3.043233 4.720396
57 4 3 1.225345 1.001026 2.257124 1.381732 2.905607 2.190833 1.946536 1.621960 2.407740 1.826928
65 3 0 1.100793 0.803178 2.262015 1.600146 2.226692 1.929444 2.024070 1.694075 2.332201 2.363598
66 3 0 1.335471 2.240866 3.243603 8.336285 2.593593 6.482050 2.308927 3.297893 2.868392 11.860610
67 3 0 1.035276 0.898533 1.707897 1.533635 1.790244 1.580008 1.607219 1.747575 1.669023 2.136982
68 3 1 0.973276 0.844491 1.681110 1.733288 1.863664 1.756775 1.687983 1.656003 2.013921 2.079090
69 4 1 0.953798 0.903694 1.627601 2.024385 1.931027 2.095891 2.063804 1.923576 2.716489 3.342357
70 4 2 1.037992 2.297139 1.444402 1.747811 2.773422 5.105674 2.240807 3.689099 2.381731 3.057052
71 4 2 0.937174 0.914942 1.758899 2.058502 1.931194 1.703006 1.962999 1.781244 2.114878 1.893045
72 4 0 1.210332 1.165190 1.818215 2.080928 2.877339 4.102915 2.085552 2.226786 4.789153 6.106656
73 5 0 1.055846 1.007564 1.567538 1.499854 2.274510 2.191492 2.105237 1.805565 5.335202 4.446408
81 7 0 1.537466 1.005707 2.270957 1.661860 2.727825 2.320557 3.098308 1.863868 9.949456 3.541463
82 7 0 1.093629 0.909362 1.620162 1.749928 2.114413 2.040081 1.872067 1.558625 4.237601 3.920734
83 7 0 0.943305 3.412529 2.274757 14.333448 1.828557 10.715304 1.950054 5.450997 2.264846 18.618275
84 8 3 1.746960 1.527885 1.763692 2.179507 2.632020 2.938773 2.329672 2.593086 9.956039 8.963088
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.228143 1.091644 1.869966 1.855331 1.714965 1.795140 2.382510 2.320713 4.996709 3.782735
88 9 0 2.895481 6.179820 14.307044 31.146765 9.429378 13.903059 4.628562 3.488438 7.153836 3.432544
89 9 2 nan nan nan nan nan nan nan nan nan nan
90 9 0 8.871713 4.344197 3.384443 2.674402 16.281987 9.372538 41.860154 13.798646 85.437506 47.102653
91 9 1 3.107100 3.439961 12.083732 12.598561 4.422936 9.682056 5.931008 4.294357 7.999479 2.856318
92 10 0 1.933269 1.556034 1.909049 1.977578 2.395097 1.983449 1.959649 1.755611 1.946950 1.727957
93 10 0 6.240491 1.534061 9.614690 2.009132 8.804537 1.657874 3.536276 1.791667 3.307662 2.189433
94 10 0 0.950733 1.170517 1.523696 3.083813 1.993487 2.968430 2.231789 3.591692 3.124600 22.771424
98 7 2 nan nan nan nan nan nan nan nan nan nan
99 7 2 nan nan nan nan nan nan nan nan nan nan
100 7 1 4.209314 4.747484 14.756415 14.588744 7.650875 23.281070 4.128346 2.620551 4.958210 2.779419
101 8 2 1.795596 1.332130 1.653918 1.512442 1.764522 1.610228 1.868933 1.939144 2.350747 4.348333
102 8 0 nan nan nan nan nan nan nan nan nan nan
103 8 1 1.251618 0.949924 1.758375 1.749030 1.622771 2.190032 1.698212 1.974340 2.375396 2.567673
104 8 1 2.304320 1.146205 3.207995 1.618870 2.618871 1.648868 3.055041 1.655072 10.449962 2.526294
105 9 1 2.523279 3.802295 15.754273 7.159474 3.415423 9.468874 5.271703 2.231794 10.540093 3.111915
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 4.094628 3.137248 31.476891 29.206803 5.398938 2.664889 5.909844 5.290935 8.477875 6.765458
108 9 1 1.225241 0.871595 1.927475 1.700781 2.114623 1.736825 1.833501 1.794769 3.085676 2.641131
109 10 1 nan nan nan nan nan nan nan nan nan nan
110 10 1 nan nan nan nan nan nan nan nan nan nan
111 10 1 nan nan nan nan nan nan nan nan nan nan
112 10 2 1.283692 0.949540 4.159719 2.050009 3.099211 2.237856 1.646723 1.790227 2.211554 2.026065
116 7 2 nan nan nan nan nan nan nan nan nan nan
119 7 1 2.535984 2.340902 2.023208 16.983551 7.919598 5.008718 2.419766 1.987510 15.093532 2.034028
120 8 1 4.906911 2.174847 8.028696 2.176995 5.201734 2.802885 7.262918 1.895427 18.927891 2.595998
121 8 3 2.050067 1.407657 1.771931 1.613700 4.502912 3.952560 3.175272 2.299145 6.514055 30.681274
122 8 2 1.731527 1.507801 1.938468 1.658381 3.102649 3.139277 2.397430 2.337139 4.209161 4.869347
123 8 3 1.445769 1.073397 1.801025 1.606451 2.189021 1.793141 2.090385 1.715237 4.419145 3.430369
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.236165 2.271595 3.472728 2.004948 4.983180 7.721197 7.562761 5.779155 10.292245 8.418957
128 10 2 0.885460 0.962053 1.965879 2.188240 1.923308 2.300407 2.044603 2.215713 2.859841 6.563260
129 10 3 nan nan nan nan nan nan nan nan nan nan
130 10 3 nan nan nan nan nan nan nan nan nan nan
135 12 2 1.112669 1.011263 2.007105 1.543078 2.029464 2.143011 2.139697 2.119077 2.038121 1.941099
136 12 2 1.404300 0.989041 4.095831 1.611590 2.692507 1.962730 6.814946 2.816274 4.100230 4.064113
138 7 1 1.197168 1.911622 1.587055 3.287644 2.680325 1.769207 1.903407 1.904532 7.918694 2.101081
140 13 2 nan nan nan nan nan nan nan nan nan nan
141 13 2 nan nan nan nan nan nan nan nan nan nan
142 13 2 nan nan nan nan nan nan nan nan nan nan
143 14 2 1.246277 0.870207 2.901659 1.722355 2.533249 1.809447 2.482314 2.063994 3.645878 5.847539
144 14 3 1.498300 1.131587 1.763626 1.350236 2.803006 2.245165 1.836210 1.629845 2.740673 2.108038
145 14 3 2.836931 3.845487 14.762091 18.714357 12.642898 8.243066 2.913821 1.680936 2.764641 1.790005
150 15 1 2.991062 6.300332 16.244584 39.019253 3.899152 9.648684 4.161444 7.931044 4.673595 9.463105
155 12 2 3.378211 2.613562 9.154798 18.139282 4.726478 3.309559 3.276797 5.712082 3.583326 1.984869
156 12 3 1.339951 1.189647 1.663953 1.753016 2.539457 2.056508 1.812319 2.027315 2.040491 2.371933
157 12 3 1.246089 1.111001 1.669113 1.750877 2.122551 2.423642 1.976976 1.924577 1.862610 2.328432
158 12 3 1.271780 1.149657 2.729265 1.576061 3.060443 2.640609 2.466674 2.817624 4.385829 8.295351
160 13 3 2.378538 3.522435 6.300811 19.946583 4.540559 4.369076 2.520791 3.577938 2.901666 7.052908
161 13 0 nan nan nan nan nan nan nan nan nan nan
162 13 0 nan nan nan nan nan nan nan nan nan nan
163 14 2 1.054791 0.964598 1.615964 1.511851 1.845637 1.753247 2.216841 1.750737 2.812078 3.716875
164 14 2 1.126625 0.926483 1.821002 1.726577 2.247919 1.843503 2.072562 3.100312 3.988671 3.129906
165 14 0 4.112814 2.766818 5.178591 4.392780 10.670740 7.176020 3.876835 4.894672 8.141343 9.538567
166 14 0 2.159010 2.008016 1.889462 1.639934 3.637902 4.471408 5.283827 3.818766 3.431738 3.298598
167 15 1 1.653164 1.445491 1.947306 2.254034 3.874048 2.561673 3.290834 3.361171 3.010572 2.365146
168 15 2 1.781395 1.286609 3.994153 2.113738 2.197651 2.085492 6.851326 7.202848 11.426028 7.596707
169 15 2 1.120613 7.750770 2.221079 38.007353 2.331692 14.518113 3.092604 8.218717 4.045288 24.578857
170 15 2 1.351960 12.695556 2.587697 65.900917 2.595095 17.169780 3.885176 9.314250 4.578510 27.247763
176 12 0 0.995458 0.893813 1.835830 1.717812 2.107502 1.952129 2.112091 1.974970 2.983902 2.899513
177 12 0 1.009621 0.996386 1.964418 1.682990 2.271196 2.165077 2.169895 1.864927 3.038038 2.918025
178 12 0 1.042878 0.979126 1.796997 1.439426 2.140402 2.032287 2.052197 2.194452 2.573334 2.137051
179 12 1 1.401602 0.848464 1.673598 1.727338 2.613909 1.707499 3.957348 2.275684 5.432068 2.858183
180 13 3 2.085701 4.944387 14.264915 2.217487 3.111947 10.252787 2.969492 7.598641 2.573803 24.763252
181 13 3 1.080912 1.043951 1.688062 1.341380 1.985175 2.459113 1.812428 1.685106 2.227378 1.945455
182 13 0 nan nan nan nan nan nan nan nan nan nan
183 13 1 1.041803 1.041646 1.703658 1.595256 2.461477 2.259359 2.063436 1.881962 2.400897 3.127399
184 14 0 0.897026 0.841881 1.492990 1.816647 1.532511 1.799047 1.908892 1.919836 4.815663 8.301297
185 14 1 1.257302 1.496106 1.732664 2.026726 2.165149 3.102566 2.654260 3.261233 3.576284 2.742286
186 14 1 1.185796 1.011012 1.617421 1.692940 2.061821 1.813772 2.161374 1.666704 3.040043 5.245426
187 14 1 2.144535 1.437032 7.976946 2.951815 6.413642 3.085829 5.242965 4.711173 8.040758 18.853202
189 15 3 1.061665 1.180247 1.736543 1.846661 1.912729 2.554305 1.854283 2.333846 2.505693 4.752633
190 15 3 3.383615 4.699125 1.544147 2.088321 3.164264 3.149490 2.879688 3.420030 5.787907 6.161731
191 15 3 1.133208 1.095370 1.706051 1.841964 2.698193 2.710646 1.849466 2.368510 2.421500 2.888228
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.243695 5.662213 12.943478 24.112804 5.455630 6.193639 5.177399 5.522129 6.584632 7.378549
321 2 3 0.935381 0.871502 1.776374 2.299282 1.635864 1.945438 1.645993 1.910313 1.998412 1.945040
323 2 3 0.929628 2.927005 4.459296 5.072508 1.787261 3.025305 1.880306 1.699387 1.901291 3.196523
324 4 3 0.901987 1.514412 2.297126 5.536547 2.023896 2.812637 2.007208 1.632890 2.007499 1.863802
329 12 1 0.885910 1.102070 1.779025 3.593331 1.699967 2.444188 1.737905 1.625701 2.079071 2.072826
333 12 1 0.801544 1.032153 1.878110 1.766509 1.967949 2.741576 1.750193 1.808897 2.008054 2.201033
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 [ ]: