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 = 2459791
Date = 7-30-2022
data_path = "/mnt/sn1/2459791"
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 2459791.25313 and 2459791.33612
372 diff files found between JDs 2459791.25313 and 2459791.33612

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.050641 0.917432 5.195038 4.536189 2.084631 1.931455 1.775989 1.660573 1.448016 1.949511
4 1 2 0.935577 0.947207 4.876266 4.829818 1.826908 1.859299 1.616698 1.684572 1.549412 1.557358
5 1 2 0.961293 1.104518 3.928337 2.718030 1.951172 2.115165 2.235470 1.825308 4.081740 4.304339
7 2 0 0.961039 0.888620 4.856859 4.589591 1.791333 1.840960 1.725861 1.638961 1.517970 1.572742
8 2 0 1.377930 12.019382 14.439963 55.137404 2.686601 35.731539 3.388214 65.990927 3.458427 90.935624
9 2 0 0.845564 0.851972 4.814098 4.339945 1.977813 2.060116 2.161022 1.904902 1.689041 1.552140
10 2 1 1.128374 1.151773 3.732275 3.032611 2.590140 2.090816 2.627452 1.899997 2.535038 1.690435
15 1 3 1.314882 1.100796 5.071461 4.635315 2.038793 2.075111 1.783962 1.805485 4.886289 4.522916
16 1 3 0.986359 1.100476 4.596584 4.536696 2.066633 2.248939 1.781358 2.120076 8.877602 7.275443
17 1 3 1.024688 0.924205 4.739151 4.136645 2.050852 1.947603 1.692680 1.778063 1.598123 1.752178
18 1 0 55.530338 48.028331 5.328301 5.283354 265.918148 244.364781 1.623399 1.566506 1.349219 1.638171
19 2 1 0.879651 1.026407 3.058225 3.333163 1.925321 2.043284 1.806679 1.777362 2.158677 4.402125
20 2 1 0.874605 0.879485 4.598085 3.415745 1.969533 1.975979 1.788238 1.642592 1.759063 1.492603
21 2 2 0.893520 0.803226 1.907502 1.563476 1.822042 1.844408 1.612797 1.598415 1.445792 1.868396
27 1 0 3.018671 3.859347 10.401281 22.805259 12.692719 6.880075 3.998265 2.090727 2.869788 2.005260
28 1 0 66.129258 0.857348 4.495838 5.836846 290.704424 2.187782 1.599174 1.999130 1.439993 2.277854
29 1 1 0.998918 1.071911 4.370449 4.626091 1.844351 1.939393 2.188835 2.431720 2.861002 2.807215
30 1 1 1.038340 0.882878 5.293207 5.382832 2.096546 1.906944 2.336825 2.109412 1.924256 3.133907
31 2 2 0.896379 1.064901 3.184539 3.045222 1.795187 1.885173 2.286340 3.578845 2.500439 6.432052
32 2 2 1.637723 1.931428 2.177487 2.804608 2.171302 1.993476 4.316070 6.241755 3.885819 6.737566
33 2 3 47.922708 0.943814 5.846737 2.835669 244.106445 1.937503 1.682455 1.710305 1.481541 1.841950
36 3 3 1.406073 1.359050 5.044778 4.894236 2.243371 1.975954 1.729818 1.543431 1.388620 1.789632
37 3 1 0.951598 0.940848 12.453641 6.767581 2.016563 2.190516 1.736512 1.885247 2.237277 2.807826
38 3 1 0.873613 1.003924 5.092656 5.509292 1.822476 2.155780 1.814068 2.277301 1.573668 1.787029
40 4 1 0.874772 0.927016 5.614296 4.059241 1.907173 1.918596 1.761997 1.710273 1.567515 2.462658
41 4 3 0.845864 1.052499 4.468889 5.922752 1.725033 1.756489 1.613437 1.655233 1.274734 1.475231
42 4 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
45 5 0 1.204860 1.023687 8.316889 4.797140 3.109577 1.891712 2.929742 2.020138 2.606993 1.933690
46 5 0 1.239830 1.073105 5.139822 4.596664 2.575015 2.031671 1.914847 1.723662 1.672192 1.700875
50 3 3 2.725240 1.020271 4.526074 4.398495 3.613428 2.250268 2.314636 1.604913 2.496502 1.326838
51 3 2 1.962009 1.017789 31.420040 6.242112 4.293839 1.945949 1.961068 1.730042 2.537329 1.851000
52 3 3 8.994398 1.145148 27.970276 6.417457 7.823423 2.033403 4.858952 1.824258 4.992571 1.761807
53 3 2 0.897739 0.917104 4.923913 4.456276 1.775925 1.942097 1.664204 1.814609 2.000165 2.422666
54 4 0 nan nan nan nan nan nan nan nan nan nan
55 4 2 0.889863 0.895864 5.329898 4.952462 1.825864 1.973291 1.755081 1.758199 1.934714 1.947237
56 4 1 1.088336 1.120719 5.082484 4.732425 2.209866 2.154090 2.236825 1.938277 2.370502 2.302733
57 4 3 0.883321 1.864480 4.185958 12.300484 1.926020 1.805235 1.553156 1.858585 1.358265 1.842227
65 3 0 1.026428 0.815120 5.562728 4.463768 2.360082 2.066126 1.965583 1.645589 1.702990 1.391367
66 3 0 1.056418 0.977018 5.624978 4.865735 2.201766 1.807643 1.758666 1.463141 1.481688 1.623331
67 3 0 0.984296 1.033708 5.258645 4.823020 1.905791 1.928165 1.738564 1.757978 1.476956 1.506438
68 3 1 1.010091 0.924474 5.042996 4.975504 2.039743 1.859169 1.811409 1.715608 1.813362 2.137911
69 4 1 0.964910 0.985923 5.329008 5.590224 1.982829 2.173598 2.328073 2.166452 2.041371 2.198561
70 4 2 1.463236 1.382352 3.997159 4.357522 3.910629 1.890890 2.487768 1.814700 1.355281 1.645677
71 4 2 0.955489 1.030964 4.551853 3.923821 2.032543 1.526279 1.733184 1.582019 1.432824 1.300533
72 4 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
73 5 0 1.110468 1.372577 4.291069 2.758178 2.246869 2.035065 1.958503 1.788541 2.007007 2.459189
81 7 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
82 7 0 nan nan nan nan nan nan nan nan nan nan
83 7 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
84 8 3 1.409899 1.348745 5.594874 6.699299 2.039546 2.170107 1.880141 1.964247 3.391091 4.026397
85 8 0 2.534042 0.819619 7.378786 4.748230 3.478210 1.634690 1.755120 1.588611 2.306073 1.356947
86 8 0 1.271140 1.114016 6.400637 4.625433 2.508843 1.905583 2.741359 3.392278 3.428818 3.849971
87 8 2 1.241003 1.217798 7.844735 6.366367 1.875149 1.760683 1.773576 2.983857 3.082914 2.954497
88 9 0 4.936318 19.018878 23.960961 34.977829 4.905603 30.124095 4.204407 3.527058 6.944328 2.453715
90 9 0 8.874865 5.783784 8.020678 6.983187 16.106210 16.331944 34.693605 8.916360 31.501307 30.233895
91 9 1 2.722891 6.293742 15.285688 8.237122 4.160678 14.215803 5.061608 3.574884 6.855640 2.225640
92 10 0 3.151857 2.399494 6.099091 5.737362 3.745132 2.720312 2.621857 2.223691 2.374499 2.916990
93 10 0 1.013420 0.898403 4.536262 5.569190 1.821303 2.249777 1.606175 1.981026 1.692306 2.586882
94 10 0 0.885029 1.013885 4.524863 4.806906 1.759187 2.434368 2.505061 2.817229 1.721956 7.589419
98 7 2 2.688288 2.373233 7.935829 19.743212 6.391378 5.323290 10.609431 16.082321 35.577681 19.986826
99 7 2 0.957342 2.821510 9.924417 30.341667 2.196317 2.306859 2.100926 2.310772 4.172645 30.155729
100 7 1 1.404810 1.135449 4.455497 4.776735 2.259018 2.009021 1.695830 1.620911 1.581553 1.648021
101 8 2 1.320744 1.384930 4.762412 6.518917 1.765795 1.854382 1.828510 2.368164 1.638249 4.637659
102 8 0 0.832862 2.273234 5.334834 11.634840 1.805537 2.151863 1.878455 5.085737 1.702452 7.902797
103 8 1 1.366559 0.856964 6.131397 4.792202 1.957149 1.715094 1.779211 1.650181 1.520729 1.440273
104 8 1 1.758989 1.337445 5.390980 2.538846 2.301630 1.834624 4.098222 1.604218 3.777274 1.462239
105 9 1 3.403230 1.787230 18.297267 9.574684 3.732953 5.126965 4.875078 2.100126 9.306822 2.551783
106 9 3 1.522418 8.540748 11.205389 44.330039 4.199083 25.471211 3.023099 52.159935 4.376585 70.004523
107 9 0 7.656040 31.424119 27.542639 165.264540 8.479815 19.075545 10.495741 67.953009 20.410774 129.543554
108 9 1 1.129707 0.864118 5.395836 4.503858 1.919759 1.712927 1.676503 1.682303 2.015313 1.680782
109 10 1 1.519109 1.400527 4.632715 4.715893 3.078756 2.942027 1.737429 1.784314 1.483430 1.888420
110 10 1 0.908220 1.120951 5.448580 5.227482 2.000787 2.400338 1.590847 2.356651 1.304255 1.795648
111 10 1 1.037761 1.145693 5.760173 4.272368 2.301377 2.122145 1.955630 1.698038 1.468344 1.340666
112 10 2 0.864394 1.632229 4.893972 4.490373 1.881381 1.984673 1.813328 1.578617 1.511947 1.454225
116 7 2 0.997880 0.790027 9.803230 3.624017 2.254110 1.868947 2.021199 1.533418 2.905183 1.447826
117 7 3 nan nan nan nan nan nan nan nan nan nan
118 7 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
119 7 1 0.956896 0.853222 4.542786 7.080837 1.899480 1.628717 1.997198 1.648900 4.298939 1.773450
120 8 1 7.001674 1.604887 14.323492 7.280357 7.487987 3.634623 10.383895 1.780031 26.059002 2.528904
121 8 3 1.884768 1.404031 6.453922 4.621975 4.752726 3.684735 2.859153 2.312866 4.491361 12.447224
122 8 2 1.855403 1.890296 5.178059 6.628320 3.864833 4.076398 2.621898 3.561818 2.929448 5.072303
123 8 3 1.388596 1.289014 6.101680 4.533126 1.935991 1.855702 1.612271 1.629671 1.874585 2.028401
125 9 3 3.843398 2.778079 44.285397 16.068741 13.143135 6.875513 3.350698 2.105673 5.407989 2.458002
126 9 3 2.474483 2.447678 34.446765 13.943827 6.166191 7.919236 4.239040 4.730256 5.589828 3.824346
127 10 2 1.623988 1.657992 5.978400 5.178142 4.204862 4.843096 4.377628 4.785262 4.575923 5.335674
128 10 2 0.851059 0.884208 5.205490 4.546553 1.700841 1.917633 1.742992 1.752759 2.078166 3.486158
129 10 3 0.878550 0.929943 5.147550 4.108403 1.775796 1.827245 1.757660 1.612442 1.360384 1.651910
130 10 3 1.017318 0.884966 5.044841 5.459653 2.014598 1.761895 1.835391 1.488961 1.674199 1.554355
135 12 2 0.893112 1.058597 4.889749 5.009424 2.475349 2.380600 1.750662 2.203686 1.696202 1.732834
136 12 2 1.192884 1.044842 6.996169 5.055788 2.720188 2.116312 3.870650 2.232437 2.222711 3.001862
137 7 3 nan nan nan nan nan nan nan nan nan nan
138 7 1 0.873142 3.046728 5.105621 10.012730 1.942698 6.307649 1.873208 3.075393 6.394823 5.697940
140 13 2 1.185230 0.977596 4.238177 5.564574 1.960419 2.207652 1.476914 1.789245 1.390952 1.659488
141 13 2 6.974394 1.165702 20.681281 3.871405 26.996186 1.917363 16.954262 1.526412 13.221697 1.788903
142 13 2 2.491382 1.378326 11.836231 5.166396 10.630953 2.231519 2.931310 1.718506 4.112113 3.746859
143 14 2 1.025464 0.863993 5.707982 3.927262 2.435768 1.563510 2.314659 1.613098 1.815623 1.725007
144 14 3 1.203629 1.034288 4.539553 4.138067 2.102540 1.740569 1.608142 1.574454 1.785078 1.412062
145 14 3 4.623729 4.488817 23.885710 24.463678 17.754443 12.950548 3.057363 1.955576 2.656027 1.999565
150 15 1 2.685437 5.978812 21.400281 38.527038 4.076335 9.606213 4.189958 7.509442 4.599217 10.804693
155 12 2 3.005950 3.084899 12.139472 26.194485 3.949788 3.704589 3.051520 2.607745 3.248550 2.017780
156 12 3 1.350573 1.178630 7.124464 7.188358 2.558166 2.372461 2.210530 2.178112 2.340937 2.563933
157 12 3 1.120748 1.088143 7.323287 4.825791 1.981217 1.999949 1.931809 1.819905 1.837474 1.806264
158 12 3 1.450766 0.975999 7.684053 5.218976 3.759458 2.524835 2.774111 2.243737 2.753747 2.713823
160 13 3 5.072295 11.404853 13.810406 69.726646 5.917021 10.352245 4.348537 22.675830 8.068393 45.264082
161 13 0 1.938389 1.186899 5.315500 4.848446 4.110634 2.129313 3.189572 1.890563 6.376868 3.370964
162 13 0 0.921362 0.978776 4.536215 4.714123 1.974527 1.796238 1.767930 1.636413 1.293692 1.698978
163 14 2 0.986438 1.063598 4.686307 4.414954 1.761843 1.722735 1.839323 1.464259 1.426547 1.595049
164 14 2 0.950675 0.959801 4.855697 4.627448 2.032180 1.972875 1.840597 2.046347 1.465413 1.867102
165 14 0 4.557702 6.571054 6.555421 8.271308 15.401697 15.895761 2.988922 2.916883 6.808120 4.857210
166 14 0 1.023547 1.295025 4.373321 5.642813 2.125962 2.825522 1.869102 2.630204 1.410406 2.493585
167 15 1 1.819667 1.456879 11.564416 6.846788 3.004143 2.511675 2.943949 2.208715 2.554848 1.924384
168 15 2 1.328023 1.211241 14.946016 13.576875 2.502843 2.180551 4.205395 6.040589 5.876647 5.140624
169 15 2 1.252428 6.344971 15.338786 46.380170 2.413346 1.984143 3.533705 4.958753 6.669833 7.726639
170 15 2 1.406646 7.125771 12.831606 55.622448 3.064175 7.932678 4.241985 9.432182 6.890276 16.280433
176 12 0 0.887317 0.879185 4.897795 4.264888 2.160011 1.607228 1.782714 1.442709 1.573708 1.294095
177 12 0 0.943248 0.976891 4.702029 4.639512 2.081198 1.847206 1.902082 1.753132 1.989971 1.813574
178 12 0 0.954141 0.863461 5.490023 4.997082 2.270387 1.638585 1.789494 1.802452 1.889015 1.797938
179 12 1 1.449821 0.863215 4.552336 5.348648 2.096275 1.823689 4.726131 2.139781 2.471503 1.866257
180 13 3 1.982501 1.335181 17.317859 4.784597 4.979626 2.320776 3.461065 1.879539 4.322902 1.873955
181 13 3 1.501288 4.666823 2.987864 13.043244 2.833595 7.402121 1.914408 1.916497 1.885699 2.641697
182 13 0 1.096699 1.143072 4.872303 9.839062 2.181120 3.095925 1.575106 2.144525 1.347581 2.991222
183 13 1 1.053310 0.973280 5.461970 4.565422 2.664364 2.000359 1.851472 1.502645 1.794810 1.954067
184 14 0 0.823493 0.854782 4.705061 4.465508 1.715992 1.812640 1.798018 1.585735 1.502739 2.165291
185 14 1 1.018097 1.081392 4.082985 5.993745 1.807593 2.249524 2.172974 3.398386 2.439963 2.611029
186 14 1 0.912869 0.919219 4.741054 4.159333 2.011875 1.856115 1.877433 1.708807 1.807123 2.040569
187 14 1 0.971074 1.483516 5.264748 6.104135 2.117737 2.359347 2.654940 4.006578 2.879913 10.371059
189 15 3 1.103655 1.105451 4.606603 4.274368 2.007810 1.823025 1.559835 1.531547 1.549674 1.578708
190 15 3 2.801096 2.060405 14.015575 2.162771 4.026617 3.262136 2.939575 2.890136 2.604425 4.423901
191 15 3 1.080457 1.006210 9.530648 7.132615 1.982463 2.049642 1.917941 1.723399 1.780938 1.585226
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.139753 0.975348 4.015635 5.929816 2.641112 1.965510 1.856967 1.944825 1.805071 1.791548
206 19 0 1.156158 1.015904 4.606851 3.761854 1.774341 1.830549 1.965538 1.873158 1.993889 1.499425
207 19 1 0.912286 0.926014 5.068489 6.378201 1.938472 1.745874 1.675684 1.558258 1.690658 1.754233
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.891178 0.901549 5.264180 3.244512 1.760034 1.728503 1.735655 1.541035 1.644918 1.446748
224 19 1 0.849106 0.703660 8.773095 8.964702 2.024867 1.462262 3.529831 1.829983 6.700842 3.437334
241 19 3 nan nan nan nan nan nan nan nan nan nan
242 19 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
243 19 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
320 3 2 4.743857 4.536710 12.257818 28.116646 7.758954 6.187694 6.747489 2.936298 5.790529 12.223512
321 2 3 1.458123 1.040827 4.776682 6.141216 2.151600 2.163414 1.679940 1.946175 1.587367 2.114069
323 2 3 1.149841 1.052070 5.826004 5.275320 2.047295 3.180030 2.027671 1.918577 1.859735 2.145037
324 4 3 0.853714 0.844286 11.110446 9.296977 1.991826 1.585259 1.918799 1.707229 1.860171 1.682276
329 12 1 1.102693 1.562139 13.951062 33.813794 1.973881 2.192561 1.894410 1.838960 1.786748 1.696442
333 12 1 1.096090 1.032248 7.855088 3.264781 2.301116 2.358397 1.805423 1.735493 1.619273 1.579392
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 [ ]: