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 = 2459821
Date = 8-29-2022
data_path = "/mnt/sn1/2459821"
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 2459821.25309 and 2459821.33609
372 diff files found between JDs 2459821.25309 and 2459821.33609

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 0.386168 0.415577 0.404475 0.675882 0.503727 0.683898 0.478376 0.752414 1.069383 1.562444
4 1 2 0.400069 0.391841 0.603796 0.435329 0.688479 0.601420 0.699063 0.808838 1.367325 1.422856
5 1 2 0.492654 0.477797 0.984185 0.672763 0.891018 0.792559 0.953659 0.830373 2.553497 1.969688
7 2 0 0.405682 0.427246 2.173761 2.561451 0.729745 0.718328 0.717498 0.778102 1.454037 1.602737
8 2 0 0.908496 1.498798 0.283697 2.626365 2.545329 5.782286 0.361706 6.007246 0.877409 7.685464
9 2 0 0.196255 0.171727 0.309465 0.275726 0.518945 0.472741 0.184598 0.155675 0.281303 0.288764
10 2 1 0.523864 0.561545 1.642222 0.682968 0.820322 1.006519 0.737519 1.320517 1.555180 2.299255
15 1 3 0.216552 0.197124 0.174582 0.152796 0.676297 0.636243 0.195094 0.166192 0.690967 0.625765
16 1 3 0.461848 0.431309 0.726426 0.491178 0.766973 0.724745 0.717839 0.702180 1.831117 1.528711
17 1 3 0.329762 0.282017 0.453154 0.296640 0.571964 0.441526 0.549744 0.429129 0.875962 0.871576
18 1 0 14.774496 5.163985 0.471759 0.620173 82.224275 20.274216 0.602766 0.820821 1.568093 1.524908
19 2 1 0.298046 0.288847 0.634548 0.386837 0.360697 0.418639 0.418073 0.388037 1.256887 0.979535
20 2 1 0.360821 0.444675 0.525540 0.482812 0.623222 0.835567 0.583014 0.837401 1.210260 1.521950
21 2 2 0.604231 0.588486 1.495167 1.248185 0.420359 0.495272 0.804584 0.746946 0.684044 0.802933
27 1 0 0.097814 0.146213 0.187824 0.725776 0.436016 0.291814 0.094162 0.068082 0.153681 0.165569
28 1 0 12.841620 0.552752 0.331771 0.544798 75.476839 1.451289 0.507371 0.779941 1.408175 1.824099
29 1 1 0.560066 0.426283 1.041306 0.482492 0.996935 0.671499 1.225101 1.233763 3.025333 2.014766
30 1 1 0.219632 0.210769 0.329910 0.261848 0.392657 0.369602 0.591736 0.633944 0.948694 1.597926
31 2 2 0.604881 0.715042 0.479238 0.318027 1.720604 1.932684 0.993451 1.868599 1.376008 3.375539
32 2 2 1.635261 1.720369 3.473296 1.820769 1.110029 1.184238 3.070992 3.040312 5.014760 4.915991
33 2 3 60.364544 1.127280 1.779340 1.724970 270.350869 2.539910 1.779808 2.233642 2.395234 2.654947
36 3 3 0.720533 0.352785 1.178114 0.443690 1.089003 0.583328 1.124484 0.519580 1.872602 1.073909
37 3 1 0.945550 0.877805 1.646538 1.237648 1.929839 1.940799 1.627917 1.793591 2.591437 3.562348
38 3 1 0.515600 0.550002 1.067769 0.918881 1.048440 1.075428 1.128689 1.048727 1.719957 1.559803
40 4 1 1.179248 1.414775 2.794361 1.848802 2.927704 2.959153 2.672169 2.854952 2.522547 2.871495
41 4 3 1.234648 1.362467 2.266830 2.078350 2.799929 2.631613 2.632462 2.835079 2.358954 2.765801
42 4 0 1.371768 1.254446 2.063264 1.645441 3.598463 2.689550 2.561248 2.652750 3.020976 5.166059
45 5 0 1.556315 1.350787 3.290913 1.927700 4.169088 2.297136 3.575236 2.835501 3.504779 2.762594
46 5 0 1.332602 1.271995 2.113531 2.226529 3.019866 2.186730 2.504222 2.110386 2.719295 2.574858
50 3 3 0.561902 0.249815 0.734048 0.289629 0.849175 0.398736 0.728024 0.433676 1.426828 0.738722
51 3 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
52 3 3 0.662627 0.483214 0.921279 1.025681 1.046775 0.945108 0.963185 0.795618 1.543050 1.062065
53 3 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
54 4 0 1.070471 1.088780 1.839563 1.521170 2.487679 2.359794 2.348844 2.124071 2.533511 2.596469
55 4 2 1.129883 1.233279 2.322529 1.477885 2.488241 1.966249 2.571814 2.143053 3.208484 2.598290
56 4 1 1.399991 1.598738 2.080309 1.854653 3.039889 2.693135 2.666617 2.475887 4.051098 3.249200
57 4 3 1.401148 1.288435 2.464885 4.138625 2.983299 3.891363 2.449002 2.277886 2.674861 3.076225
65 3 0 0.901422 0.770439 2.144435 0.896753 2.053509 1.418610 1.839689 1.385090 2.642373 2.266221
66 3 0 1.287214 0.931421 2.884759 1.934006 3.151823 1.915997 2.470230 1.708711 3.116513 2.784280
67 3 0 0.767153 0.786031 1.440537 1.198064 1.506448 1.403745 1.693156 1.377198 2.818457 2.688200
68 3 1 0.601999 0.494647 0.841311 0.782144 1.098651 0.889383 1.029704 0.955649 2.289863 1.830523
69 4 1 1.092393 1.508652 1.903987 2.424966 2.556882 2.751637 2.185128 2.521862 2.372839 2.949223
70 4 2 1.730633 1.747338 2.438604 1.998361 5.346191 2.983996 3.689868 3.365012 3.639932 3.505371
71 4 2 1.226323 1.394646 2.024662 1.514344 2.366126 2.868870 2.381503 2.401183 2.495749 2.424141
72 4 0 1.555445 1.551605 2.183103 2.174058 3.507022 3.937670 2.326927 2.577550 4.900554 6.293872
73 5 0 1.277568 3.728919 2.432756 5.875203 2.955265 11.762671 2.722268 2.303952 3.095776 2.446947
81 7 0 1.623823 1.429910 2.880435 2.007180 2.928523 2.504862 3.086074 2.836963 17.051508 4.353609
82 7 0 1.230452 1.205365 1.761468 1.380908 2.410704 2.616479 2.384608 2.429528 2.672140 2.522465
83 7 0 1.275323 1.315369 2.967945 2.425842 3.067575 2.576990 3.818919 3.791459 4.812234 4.341835
84 8 3 2.064656 2.712282 2.771485 5.149152 4.192333 4.832474 3.576246 3.471578 6.997101 6.746706
85 8 0 1.188650 1.381155 2.520507 3.049351 2.762723 2.503864 2.834556 3.051579 3.410316 4.743484
86 8 0 2.788525 1.834329 2.767484 1.596350 5.249818 2.579498 6.881994 7.140570 4.301362 6.377578
87 8 2 1.406989 2.143302 2.266332 3.641534 2.482278 2.845863 2.427231 5.591850 4.106210 4.312188
88 9 0 1.529604 38.056704 4.810822 195.059847 3.548456 119.464102 4.262210 123.999470 6.574839 193.941530
90 9 0 1.130826 1.183382 2.499890 1.722945 2.587722 2.348697 2.314519 2.421320 2.962223 3.330618
91 9 1 1.260927 27.759513 3.707870 63.143626 2.645416 103.341712 2.832434 125.499249 4.718862 147.209121
92 10 0 0.781455 0.865943 0.248308 0.419445 1.267625 2.659428 1.227015 1.061163 1.995528 2.043535
93 10 0 0.485120 0.710514 0.792011 0.926019 1.044712 1.683794 1.026150 1.530491 1.946634 3.082177
94 10 0 0.511395 0.450714 0.642667 0.715634 0.922875 0.891000 1.008962 0.975346 1.780554 1.990913
98 7 2 2.481462 1.020718 1.843549 2.284115 5.055284 2.422918 11.190380 2.167023 84.156625 3.004557
99 7 2 1.137353 1.339611 1.928086 1.653825 1.892539 2.240712 1.926388 2.351708 3.051353 3.562807
100 7 1 1.606141 1.272615 2.347761 2.044150 3.052701 2.328506 2.463504 2.163848 2.992508 2.636124
101 8 2 1.597963 1.692884 2.066496 2.191331 2.406239 2.480167 2.484164 2.828115 2.785903 3.929443
102 8 0 2.027259 2.135618 6.349927 12.059297 5.278898 2.674332 3.039151 4.256399 5.528777 6.671567
103 8 1 1.900625 1.106252 2.846686 1.640266 3.883545 2.113059 3.239630 2.104786 6.967933 2.434496
104 8 1 2.733153 1.400325 0.397562 1.847349 2.485781 2.211105 6.047603 2.217839 5.300588 2.447882
105 9 1 1.372770 1.272008 4.251326 2.390398 2.283425 2.361341 2.494538 2.332263 3.704372 3.091383
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 1.448399 16.029184 5.057822 27.352897 3.315907 57.703631 3.857258 67.459309 5.820116 87.807199
108 9 1 1.142521 1.083901 2.932485 1.342996 2.564986 2.270958 2.385345 2.164626 3.194630 2.436204
109 10 1 1.078849 1.174107 1.009637 1.303744 3.045437 2.434252 1.338581 1.137237 2.020365 1.903080
110 10 1 0.613526 0.762418 0.809907 0.752838 0.929826 0.973975 0.769231 1.078106 1.583267 1.801085
111 10 1 0.672643 0.664233 1.100412 0.881995 1.313675 1.138555 1.155170 0.904041 1.873970 1.751322
112 10 2 0.478440 0.423952 0.695450 0.487862 0.817314 0.716990 0.862530 0.697971 1.740418 1.525287
116 7 2 1.094591 1.023486 1.861009 1.763009 2.630357 2.343457 2.265732 2.206268 3.405264 2.524538
117 7 3 1.098736 1.397965 2.117776 1.954245 2.228288 2.461178 2.365580 3.487947 3.947889 5.504458
118 7 3 2.610005 1.396805 5.235136 2.000327 3.845753 2.427679 4.516895 2.507190 5.320453 4.714881
119 7 1 1.314034 1.056131 2.576515 2.309098 2.974803 2.445155 2.682550 2.493119 6.634756 3.274715
120 8 1 5.165807 2.707019 14.706869 4.569217 10.584867 10.313995 12.534717 2.709187 41.808179 5.763557
121 8 3 2.106834 2.499743 2.337630 1.635385 5.056748 6.649725 4.264086 3.366017 5.499654 15.085404
122 8 2 1.656051 1.650607 2.435260 2.434730 2.359104 2.591340 2.514538 2.810677 3.454943 3.167971
123 8 3 1.423266 1.455854 2.429770 1.755007 2.635144 2.318085 2.301414 2.397018 2.912070 2.491556
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 0.609043 0.632157 1.018413 0.537546 1.460156 1.525649 1.675903 1.403234 2.254753 2.475076
128 10 2 0.530069 0.588660 0.705209 1.021425 0.804226 1.186484 0.880545 1.189103 2.032472 2.401670
129 10 3 0.517795 0.506713 0.741627 0.864771 0.935864 1.074788 0.996518 1.075367 1.827768 2.130851
130 10 3 0.780144 0.801306 1.564052 1.212535 1.735992 1.664012 1.566810 1.514555 2.232747 2.396832
135 12 2 0.928763 0.954743 1.421852 1.289609 2.287239 2.326740 2.140718 2.217493 3.614977 2.694896
136 12 2 1.208122 1.079756 1.699426 1.298916 2.104903 2.002487 3.816578 2.326968 2.513488 3.204614
137 7 3 5.575039 2.388967 23.125517 8.090394 15.898739 8.102525 5.139221 3.131343 8.104337 4.312430
138 7 1 1.091998 21.657807 1.750856 109.714592 2.268098 43.474161 2.322206 50.508772 2.859297 64.411993
140 13 2 4.304308 4.181402 12.931023 24.552455 11.643750 3.815108 4.762445 4.007315 4.394724 2.914714
141 13 2 10.008487 1.473938 16.684007 1.370260 36.753441 2.733404 20.389044 2.133694 16.101041 2.642151
142 13 2 2.251918 1.935239 3.353241 1.967235 3.129931 5.117801 1.413310 1.844688 2.401980 5.352046
143 14 2 0.406717 0.445467 0.612432 0.592207 0.704938 0.760287 0.677776 0.773271 1.390899 1.743409
144 14 3 0.199678 0.197456 0.254432 0.228297 0.394136 0.319709 0.319835 0.305694 0.490821 0.544761
145 14 3 0.221268 1.160107 1.259097 3.619871 1.270526 4.296182 0.173505 0.291625 0.275308 0.596308
150 15 1 0.362025 0.332261 1.378993 3.032665 0.948663 0.819323 0.312772 0.205309 0.376589 0.292137
155 12 2 1.939650 1.570095 5.665870 8.550328 2.382745 1.362715 1.892465 0.747696 2.765486 0.985351
156 12 3 0.801810 0.717812 1.138152 1.036428 1.618116 1.416872 1.309021 1.179083 2.038513 2.036101
157 12 3 0.685193 0.764281 1.079284 1.147005 1.388592 1.392910 1.279454 1.351613 2.304265 2.395539
158 12 3 1.019067 0.869737 2.287524 1.265928 2.570294 1.696492 2.107019 1.875290 3.147800 3.681390
160 13 3 1.909510 3.784133 9.472622 19.495990 5.025060 7.354410 1.977808 2.820842 1.897584 2.546647
161 13 0 2.806073 1.166450 2.635379 1.821717 4.596523 2.316415 4.108164 2.607190 7.321020 5.235079
162 13 0 1.175544 1.118194 1.747367 1.898076 2.297638 2.089810 2.314431 2.198121 2.221032 2.476400
163 14 2 0.588730 0.615428 0.927738 1.056498 0.980359 1.154250 1.130053 1.035005 1.733637 2.039415
164 14 2 0.405280 0.323794 0.537340 0.393426 0.773996 0.551270 0.720116 0.723733 1.483467 1.210740
165 14 0 0.526382 0.772856 0.588982 0.658471 1.586993 2.317341 0.566178 1.207074 0.915201 2.018125
166 14 0 0.314719 0.327553 0.181857 0.201876 0.417144 0.556220 0.573047 0.609905 0.682929 0.683532
167 15 1 0.296587 0.335277 0.484700 0.534797 0.323865 0.339449 0.476523 0.350490 1.009603 0.864312
168 15 2 0.233699 0.249810 0.385593 0.436266 0.258195 0.351674 0.392148 0.618111 1.132429 1.321133
169 15 2 0.276254 0.593201 0.446752 2.919275 0.355957 0.317676 0.412949 0.549225 1.151745 1.233542
170 15 2 0.247350 0.348582 0.202916 1.319032 0.581704 0.851249 0.385477 0.520840 0.876655 0.850558
176 12 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
177 12 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
178 12 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
179 12 1 1.238638 0.726697 1.463720 1.800406 2.190715 1.516592 4.486086 1.986334 3.591835 2.986918
180 13 3 1.285041 1.759164 6.041304 1.677416 3.498989 4.566391 2.033192 2.451271 1.949032 2.681636
181 13 3 1.689984 2.235492 1.496517 6.242329 5.112474 3.332106 2.149667 0.945719 2.856234 1.055501
182 13 0 1.820901 1.486342 3.552811 3.066349 4.834743 3.058008 1.315959 2.413546 1.488712 6.640183
183 13 1 1.069799 1.112737 2.057115 2.035621 2.324840 2.521765 1.974706 2.098840 3.214222 3.919375
184 14 0 0.215898 0.201371 0.229436 0.263584 0.291973 0.311236 0.271136 0.322056 0.714954 1.052751
185 14 1 0.632518 0.498805 0.969403 0.582972 1.137105 0.755304 1.169127 0.943340 2.179439 1.350394
186 14 1 0.131243 0.131027 0.222578 0.171223 0.252250 0.270763 0.286598 0.273395 0.483602 0.534060
187 14 1 0.415591 0.670499 0.734754 1.122420 0.769443 1.579610 1.029630 1.730098 3.205436 5.457035
189 15 3 0.224596 0.202145 0.170975 0.158034 0.654249 0.660251 0.155477 0.154181 0.314394 0.295729
190 15 3 0.209326 0.544824 0.655290 0.306055 0.351012 0.522818 0.152833 0.657900 0.286139 1.569637
191 15 3 0.404014 0.393823 0.464203 0.435741 0.621613 0.684309 0.709242 0.591138 1.276979 1.193786
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 0.416859 0.365177 0.118542 0.013568 0.263525 0.174799 0.067557 0.015427 0.053124 0.016840
206 19 0 0.383498 0.296928 0.017342 0.015563 0.182499 0.131944 0.018665 0.016736 0.018497 0.015502
207 19 1 0.375392 0.356067 0.018507 0.013829 0.180240 0.170854 0.015609 0.013726 0.015299 0.014758
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.364294 0.372413 0.017975 0.016588 0.174770 0.176687 0.012647 0.018372 0.015345 0.017957
224 19 1 0.324677 0.321471 0.007899 0.007416 0.154527 0.152716 0.014842 0.007642 0.026565 0.012303
241 19 3 nan nan nan nan nan nan nan nan nan nan
242 19 3 nan nan nan nan nan nan nan nan nan nan
243 19 3 nan nan nan nan nan nan nan nan nan nan
320 3 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
321 2 3 1.584767 2.043921 2.902585 2.499400 2.343498 2.437992 2.292094 2.359626 2.750696 2.323401
323 2 3 1.190679 3.073241 3.054914 5.824998 2.163019 3.933306 2.200073 2.046734 2.498337 2.666691
324 4 3 1.209436 1.686458 3.075725 4.179072 2.343869 2.513933 2.395341 2.050878 2.187997 2.538670
329 12 1 0.602313 0.564070 2.003286 1.361987 1.290014 1.225686 1.279418 1.051598 1.947200 1.310170
333 12 1 1.254355 1.215200 1.836501 1.622566 1.967131 3.252202 2.027174 1.860080 3.207647 2.569945
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 [ ]: