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 = 2459757
Date = 6-26-2022
data_path = "/mnt/sn1/2459757"
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)
1862 sum files found between JDs 2459757.25294 and 2459757.66924
1862 diff files found between JDs 2459757.25294 and 2459757.66924

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 190.454467 171.573588 485.178755 423.842698 15.864194 114.784321 6.211276 35.389151 1.842859 2.508692
1 0 0 119.487979 147.270520 283.284563 365.747745 2.326458 3.477681 0.882354 2.333183 1.016321 1.584626
2 0 0 129.369152 160.396451 309.556493 427.450250 3.515535 4.875948 3.168786 9.597220 2.747671 2.765982
3 1 2 1.744978 1.729244 1.865676 1.769815 1.825999 2.470215 4.647916 7.193845 4.234934 8.466802
4 1 2 1.402631 1.176356 2.019418 1.651543 1.987362 1.981736 1.848648 1.772214 1.879586 1.813562
5 1 2 1.076432 1.368391 1.735906 1.853906 1.720465 2.030610 2.062144 2.187089 12.021637 16.516887
7 2 0 1.156319 1.055665 1.912582 1.763821 1.899272 2.131215 2.017426 2.180189 2.463303 2.752191
8 2 0 1.271625 24.409529 2.835426 60.207457 2.380345 88.763865 2.330904 110.140300 5.141897 123.158598
9 2 0 1.095515 1.216215 3.000319 1.612402 1.992949 2.441795 2.630737 2.292415 2.459892 2.620398
10 2 1 nan nan nan nan nan nan nan nan nan nan
11 0 1 113.730609 899.162485 312.941133 5850.615390 11.034104 440.538005 8.420109 2711.503007 2.363289 299.870402
12 0 1 319.011653 549.382729 1209.463138 3302.412264 210.096510 380.403828 163.825842 831.287234 23.230881 28.527311
13 0 1 196.539075 300.756503 415.366738 1046.209832 97.366557 175.998761 172.065043 523.042716 7.854075 67.944032
14 0 2 169.097112 532.493618 473.059192 2734.524855 46.492198 712.353178 47.572548 259.884700 7.433812 38.216576
15 1 3 1.732218 1.298999 2.352524 1.670857 2.589312 2.246104 2.522154 2.814220 15.963199 10.846871
16 1 3 1.487314 1.433044 1.802879 1.877199 2.194493 2.805638 2.142564 2.862484 25.812158 26.887222
17 1 3 1.541876 1.188043 1.955076 1.551395 2.805301 2.152567 2.205391 1.518852 3.928649 3.718732
18 1 0 37.950738 9.446395 1.818845 1.806187 159.569467 34.423353 1.607205 2.382068 12.220634 3.514787
19 2 1 nan nan nan nan nan nan nan nan nan nan
20 2 1 nan nan nan nan nan nan nan nan nan nan
21 2 2 1.074990 1.070757 1.613940 1.512838 1.860896 2.058775 2.376958 2.172246 2.213924 4.400990
23 0 2 179.434967 130.555217 576.559738 311.052260 9.944029 3.876449 1.604284 1.836042 2.587796 0.932931
24 0 2 239.766522 143.887763 424.680731 357.741232 4.565841 10.653801 1.245362 2.964293 1.638026 2.977484
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 53.430449 116.951550 1.351371 7.515126 236.688180 559.347866 1.590979 1.748550 11.942563 9.609651
28 1 0 1.064888 58.008174 1.631642 1.663769 1.941030 238.284607 1.905021 1.658897 2.631327 14.699231
29 1 1 1.416871 1.867681 2.291445 1.676613 1.963241 2.526786 3.905583 3.095181 4.827138 2.947424
30 1 1 1.446710 1.350238 2.473742 1.777000 2.323864 2.436539 3.910362 4.209555 3.632013 5.185768
31 2 2 1.248742 1.396779 1.666157 1.669651 2.048153 2.068943 2.780967 5.048149 4.077784 11.822824
32 2 2 1.308335 4.249922 1.761213 2.711716 1.890373 5.592387 3.311195 15.337853 3.710612 10.655612
33 2 3 32.433095 1.123565 2.306097 1.529047 151.665895 1.889928 1.725175 1.820266 12.608234 2.631925
36 3 3 1.817716 1.741480 1.716072 1.937784 1.846898 2.559944 2.056203 2.002600 2.521063 3.237084
37 3 1 1.314858 1.203176 2.465445 1.734797 2.904440 2.621938 2.185362 2.105016 5.078730 4.778727
38 3 1 1.356706 1.423864 1.916662 1.896631 1.802423 2.376407 3.453105 2.905507 2.836406 3.149224
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 1.086625 1.192437 1.772105 1.920829 1.777963 2.150366 1.846716 2.271623 2.389991 3.174404
41 4 3 1.193241 1.349122 1.843305 2.395179 1.655747 2.742506 1.645832 2.069262 1.871629 2.431479
42 4 0 1.043077 1.072222 1.811351 1.615948 1.893211 1.978305 1.877843 1.865230 14.307820 14.880249
45 5 0 3.327837 1.213618 32.270454 1.645939 5.399776 1.958240 4.460017 1.828188 4.701023 2.147090
46 5 0 2.767216 1.960732 1.833264 1.756662 5.885325 3.919419 2.530211 2.384843 3.360751 4.222821
50 3 3 1.593065 1.283724 1.661873 1.625110 2.054775 2.120147 2.054971 1.766400 2.277326 1.857773
51 3 2 1.110751 1.179084 2.020183 2.854162 1.686501 2.106922 2.004915 2.175161 6.413894 5.598416
52 3 3 9.005415 1.484113 26.139457 2.071866 5.695929 2.571304 5.260517 2.582296 6.025519 5.098647
53 3 2 1.646593 2.123820 3.202611 2.895312 3.319139 3.658973 2.337797 2.601440 8.187972 6.627846
54 4 0 1.569105 1.436324 2.013282 2.404441 3.323634 3.492862 2.220765 2.928589 4.499576 7.218369
55 4 2 1.090965 1.045775 2.701087 3.436746 1.940584 1.725130 2.066125 2.027773 3.652540 6.156989
56 4 1 1.421379 1.390374 1.915442 1.740873 2.082974 2.315761 2.559039 1.981899 2.998832 3.277987
57 4 3 1.332927 1.219828 2.807358 3.015979 3.038615 2.094931 2.200358 1.982268 2.774584 2.312015
65 3 0 1.377663 0.908904 3.404248 1.845469 2.672682 1.618341 2.411684 1.707239 3.007852 2.318868
66 3 0 1.427313 1.268440 3.640621 2.265227 2.874143 2.829687 2.376962 1.959107 3.018961 4.234771
67 3 0 1.155458 1.205155 2.242583 1.985196 1.923664 2.295439 1.665169 1.956943 1.966645 2.191687
68 3 1 1.294514 0.990119 1.913911 1.694595 2.139779 1.868254 1.809847 1.800393 2.177561 2.200262
69 4 1 1.214108 1.174575 2.149307 1.940571 1.673189 1.910580 1.882890 1.835202 3.065297 2.291979
70 4 2 1.584765 1.873398 1.494941 3.606753 2.373085 2.979735 2.273672 3.085932 2.063297 4.064352
71 4 2 1.341763 1.385329 2.103084 5.854049 1.839257 1.804867 3.788902 3.235133 3.225378 2.726271
72 4 0 1.375088 1.330005 2.842379 2.293464 2.488849 2.799542 2.050181 2.463135 4.804521 6.281206
73 5 0 1.314686 1.380468 1.773949 1.857346 2.304425 2.466168 1.942665 1.977716 6.900656 5.833023
81 7 0 nan nan nan nan nan nan nan nan nan nan
82 7 0 nan nan nan nan nan nan nan nan nan nan
83 7 0 nan nan nan nan nan nan nan nan nan nan
84 8 3 1.882685 1.627340 1.848575 1.800871 2.064314 2.557238 2.092593 2.337245 16.800123 21.910483
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.377478 1.451191 1.753389 8.340978 1.626797 1.910850 2.546843 1.886797 4.093965 2.743318
88 9 0 3.878523 10.160828 21.514654 43.948807 15.122350 40.034671 5.745879 3.971828 8.778512 4.764973
89 9 2 nan nan nan nan nan nan nan nan nan nan
90 9 0 2.280424 1.529933 2.350356 2.176439 4.532796 2.499456 8.273065 2.910454 18.102725 7.384360
91 9 1 5.632054 9.404233 20.482135 17.781731 8.960575 21.624298 8.244952 5.330755 11.848414 3.457657
92 10 0 4.215265 2.839903 14.339696 15.502887 4.901650 3.681372 3.914677 2.017552 4.609881 1.933262
93 10 0 6.272147 1.917334 13.527117 1.914090 9.270523 2.569622 4.858940 1.880128 4.139235 2.262245
94 10 0 1.072620 1.388310 1.472036 3.578186 1.696150 3.158385 2.177857 4.106364 3.767152 6.776011
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 nan nan nan nan nan nan nan nan nan nan
101 8 2 2.054434 1.752561 1.902672 1.718985 2.232254 2.127596 2.247976 2.249618 2.955311 3.075755
102 8 0 nan nan nan nan nan nan nan nan nan nan
103 8 1 1.641787 1.108271 1.907558 1.621604 1.786588 2.225677 1.892536 1.626683 2.495061 2.256681
104 8 1 3.354746 1.455454 1.792823 1.712487 2.428938 1.709154 3.308322 1.602896 3.385432 2.489047
105 9 1 3.794884 6.090635 26.848145 10.939394 4.988083 18.489782 8.468201 2.684058 15.913104 3.341740
106 9 3 2.124357 1.915977 1.944351 2.084570 5.463526 4.059099 2.471480 3.608673 3.984411 2.654802
107 9 0 8.576354 5.930966 36.580836 33.973105 15.676647 3.795297 4.159148 5.845784 7.670463 2.069975
108 9 1 1.455426 1.160418 1.860272 1.559074 1.719337 2.060817 1.809607 2.041063 2.978067 2.359265
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 4.394249 1.252482 13.163134 1.548474 6.130298 2.404291 4.332443 2.994374 5.846541 6.101090
116 7 2 nan nan nan nan nan nan nan nan nan nan
119 7 1 nan nan nan nan nan nan nan nan nan nan
120 8 1 7.758075 2.361707 13.014032 1.902599 7.785797 3.399943 10.308439 1.857390 32.332058 3.029825
121 8 3 2.082152 2.307750 2.082161 1.884396 4.429323 7.311347 2.799002 2.597242 4.991760 8.915635
122 8 2 1.977061 1.567175 1.791604 1.632746 2.283207 1.762516 2.096933 2.148377 3.549252 3.310522
123 8 3 1.514298 1.364233 1.760130 1.921644 1.936158 1.772281 1.819906 1.860349 3.401011 3.532219
124 9 2 nan nan nan nan nan nan nan nan nan nan
125 9 3 5.834546 4.581252 60.467850 17.997065 19.731864 12.829217 4.050711 2.532041 7.136993 2.771479
126 9 3 5.092787 4.975234 52.427675 14.866855 7.470837 28.601752 6.115228 6.562093 7.540990 6.467248
127 10 2 1.668593 1.865055 2.645524 1.979421 3.065772 5.040955 4.619714 3.962855 7.617932 10.786172
128 10 2 0.989972 1.126207 1.783887 2.191610 1.784781 1.868449 1.912122 1.715053 2.269756 2.317590
129 10 3 1.272583 1.099910 1.850068 1.427587 1.770861 1.951773 1.733189 1.626766 1.849373 2.544340
130 10 3 1.771365 2.388185 2.905723 20.774616 3.849955 2.119153 2.368430 1.825174 4.361582 1.703640
135 12 2 1.411262 1.428703 2.164334 1.640536 2.277025 2.540714 2.584585 2.971609 2.238266 3.030718
136 12 2 1.672106 1.330491 6.035266 1.675655 2.474038 1.957867 6.292844 3.082039 3.631117 7.784110
138 7 1 nan nan nan nan nan nan nan nan nan nan
140 13 2 1.373320 1.326072 1.841266 1.719631 2.494783 2.498038 1.970169 2.167315 2.219872 4.089806
141 13 2 6.045905 1.452568 18.778109 1.829783 19.216359 2.885645 10.749264 2.009082 15.261649 3.125758
142 13 2 3.746526 1.452679 9.918642 1.836115 9.824608 2.366267 3.570283 2.270228 6.021950 2.303275
143 14 2 1.303530 1.024817 2.823183 1.613978 2.315197 1.976516 2.307775 1.912287 2.814483 3.160774
144 14 3 1.653752 1.417685 1.537195 1.589639 3.437387 2.659979 1.928462 1.840249 2.926755 2.577683
145 14 3 5.858052 5.397332 24.685327 30.331798 21.532657 19.766612 3.901323 1.889509 3.575925 1.889469
150 15 1 8.705316 16.548840 35.234631 72.547723 16.034766 17.623397 7.192988 28.485328 3.558559 1.855235
155 12 2 4.521338 3.806941 12.217321 26.168226 6.057449 4.992894 4.193632 3.779376 4.320967 2.790522
156 12 3 1.780419 1.775898 2.165499 1.534089 3.878090 2.639201 2.678533 2.088882 2.379352 2.357429
157 12 3 1.498816 1.374674 1.867563 1.895000 2.651526 2.555520 2.201554 2.220404 2.145138 2.794279
158 12 3 1.734048 1.281554 3.500295 1.471211 4.258775 2.080494 2.773530 2.372439 4.268341 4.294426
160 13 3 3.470222 2.813030 1.541390 2.524545 9.003663 5.743520 1.879763 2.281600 2.147879 2.328378
161 13 0 3.038114 1.350210 2.035553 1.694680 6.488333 1.962470 4.068476 1.986873 5.304397 3.574418
162 13 0 1.486724 1.483222 2.523223 1.702149 2.818642 3.056762 2.303801 2.121792 2.797893 2.774618
163 14 2 1.339913 1.274017 1.762727 1.817257 1.860294 1.821864 2.223752 1.974168 2.974966 7.896808
164 14 2 1.261356 1.121772 1.813766 1.527637 2.282692 1.972609 2.340002 3.432509 5.020351 3.795262
165 14 0 2.847657 2.891096 4.418099 4.185396 7.419515 9.587268 3.393812 5.114021 8.774496 8.287639
166 14 0 1.945624 1.656612 1.790675 1.549950 2.829135 3.290852 2.999474 2.374375 2.441673 3.017957
167 15 1 2.236633 3.352206 2.185530 1.626055 3.371985 2.849873 2.569797 2.174676 2.728747 2.136514
168 15 2 1.847644 1.468105 3.719058 2.285916 1.999168 2.420464 4.310524 6.510695 8.572847 7.899004
169 15 2 1.445250 11.476060 2.221432 56.874499 2.625982 7.820833 3.682847 9.209369 7.889413 17.689679
170 15 2 1.914869 14.705730 2.693502 77.478278 3.772968 17.839725 4.609373 20.835763 6.874796 22.702095
176 12 0 1.081283 1.031425 1.727337 1.636798 2.099655 1.924199 2.257801 2.121996 3.452881 2.639309
177 12 0 1.154125 1.298495 1.821546 1.735675 2.387300 2.083608 2.070546 1.778518 3.190376 2.921712
178 12 0 1.277026 1.254268 1.902029 1.440229 2.527171 2.430376 2.304048 2.508020 3.122727 2.546586
179 12 1 2.042332 0.961611 1.649533 1.637508 2.926474 1.767173 4.771059 2.719894 7.287854 3.111223
180 13 3 2.997120 6.672669 20.331840 1.989050 3.960063 15.288856 3.303832 6.175587 3.103145 30.136150
181 13 3 1.426092 1.532642 1.789629 1.475082 1.930576 3.040215 1.808003 1.684193 2.199837 2.240560
182 13 0 1.487864 1.801289 2.525991 2.845436 3.309821 4.041056 2.455519 2.139084 3.666057 4.033128
183 13 1 1.549711 1.487696 2.096346 2.120124 3.468345 3.076033 2.422158 2.358435 4.137857 4.477363
184 14 0 1.096192 1.008942 1.803276 1.581409 1.848559 1.746223 2.366185 1.771874 4.813515 7.756990
185 14 1 1.764334 1.881079 1.743652 2.355056 2.457933 3.461653 4.530449 4.272300 5.995098 13.561527
186 14 1 1.385881 1.260361 1.896766 1.582455 2.343374 1.703505 2.204814 1.769167 3.982678 3.998292
187 14 1 2.136248 2.216786 7.636392 2.680649 5.856451 3.138968 4.887432 4.474966 8.498237 24.591551
189 15 3 1.237143 1.363448 1.943669 1.633908 1.914033 2.227133 1.787642 1.875669 2.088541 2.843943
190 15 3 3.990855 4.891044 1.352300 1.705748 3.352486 4.190510 2.469720 3.452326 4.375946 5.809539
191 15 3 1.306885 1.341103 2.125989 1.670771 2.162341 2.396532 1.746371 1.980298 1.871382 1.991326
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 6.879622 7.384636 15.892736 39.377520 7.466192 8.879980 11.681446 6.151913 10.303725 2.186186
321 2 3 1.077686 1.270507 1.669025 5.705050 1.538943 2.299493 1.677586 1.841086 1.948806 1.825233
323 2 3 1.085221 2.634249 3.553572 6.571453 1.736820 4.459434 1.712534 1.910987 2.267289 3.652882
324 4 3 1.079825 7.082408 1.823671 35.222558 1.889792 2.055354 1.638139 1.801041 1.736984 2.387623
329 12 1 1.037957 2.295324 8.866364 46.126753 1.592067 1.925240 1.814326 1.819447 1.938340 2.008154
333 12 1 1.619060 1.844232 1.778413 1.827205 2.680319 3.164216 1.800377 1.728248 1.933521 2.004834
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 [ ]: