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 = 2459822
Date = 8-30-2022
data_path = "/mnt/sn1/2459822"
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 2459822.25304 and 2459822.33603
372 diff files found between JDs 2459822.25304 and 2459822.33603

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.938899 0.952005 1.159012 1.445649 1.768606 2.015139 1.713481 1.889112 1.530550 1.918329
4 1 2 0.970860 0.959026 1.087892 1.247625 1.789450 2.269777 1.862987 2.359228 1.740939 1.871537
5 1 2 0.254887 0.273698 0.464535 0.367080 0.574104 0.510828 0.672393 0.562853 1.277108 1.370096
7 2 0 0.930700 0.937712 1.493461 1.556594 2.093929 1.744548 1.973700 1.652114 1.769752 1.728209
8 2 0 0.943601 4.165974 3.883052 9.433045 2.076987 16.369599 2.434475 21.506397 3.848767 25.054410
9 2 0 1.104229 0.998044 0.535472 0.434889 3.357653 2.908789 0.877720 0.644770 0.685542 0.606730
10 2 1 0.854152 0.972070 1.293072 1.288400 1.793227 1.897633 1.657992 2.240544 1.648445 2.201408
15 1 3 0.241616 0.236466 0.119284 0.108083 0.829570 0.812631 0.263421 0.253740 0.737618 0.563251
16 1 3 0.932473 1.039681 1.467011 1.329624 2.039600 2.039651 1.991468 2.081518 2.721499 2.182909
17 1 3 1.050960 1.044072 1.281254 1.188750 1.995371 1.894899 1.801891 1.723386 2.156740 1.995722
18 1 0 54.778679 17.485430 1.221150 1.413936 267.214925 68.773454 1.848746 2.057276 1.607370 2.219065
19 2 1 1.741545 1.033473 4.755966 2.455771 2.124406 1.899080 2.445053 2.060088 4.333421 2.572462
20 2 1 0.922744 0.884767 1.448974 1.268738 1.800119 1.917551 1.709190 1.732545 1.678551 1.747464
21 2 2 1.000081 0.880595 1.669434 1.165236 1.749026 1.877279 2.011875 1.758654 1.502842 1.547904
27 1 0 1.837215 1.370965 3.361245 6.201658 6.066704 2.781532 1.371550 0.825917 1.490205 0.733903
28 1 0 75.215444 1.325968 1.023167 1.501310 354.420089 2.121774 1.673522 1.955356 1.591574 2.254172
29 1 1 1.169806 1.050663 1.799213 1.466808 2.121640 2.007889 2.532513 2.737619 3.783812 3.609230
30 1 1 0.272710 0.309508 0.427535 0.392944 0.610970 0.575752 0.824043 0.922211 0.696534 1.954737
31 2 2 0.990300 1.223035 1.349359 1.330457 2.088891 2.219208 2.994125 6.368676 3.680227 11.055970
32 2 2 1.165834 1.532119 1.289326 1.146199 1.977516 2.665548 3.937959 6.206143 3.760663 5.912079
33 2 3 nan nan nan nan nan nan nan nan nan nan
36 3 3 1.473463 1.134941 1.773809 1.511279 1.881393 2.070760 2.131664 1.820804 1.431237 1.691644
37 3 1 1.121102 0.897615 1.512475 1.068179 2.472509 1.917124 1.909505 1.752793 2.158589 2.041907
38 3 1 0.992363 1.042117 1.668752 1.251314 2.086823 2.328724 2.021181 2.093074 1.625038 1.624704
40 4 1 0.927916 1.201289 1.729844 1.461617 1.923142 2.300188 1.885284 2.338392 1.562554 2.091761
41 4 3 0.896555 1.136782 1.201183 1.585466 1.856154 1.939861 1.642534 1.638473 1.423016 1.398485
42 4 0 1.062677 0.961991 1.461665 1.385388 2.249861 2.110745 2.044656 2.056916 1.987709 2.655064
45 5 0 1.213869 1.098409 2.527903 1.452629 3.174389 2.016431 3.008884 2.345948 2.735045 2.419974
46 5 0 1.276587 1.093828 1.521292 1.512460 3.015538 1.985385 2.171576 1.850601 1.980395 1.991295
50 3 3 1.900038 0.945015 1.168074 1.528693 2.628698 2.256025 2.456598 2.078747 2.693891 1.742511
51 3 2 0.905886 0.986716 2.661526 1.405295 1.936377 1.818223 1.899416 1.814418 1.637745 1.603675
52 3 3 1.201165 1.508357 1.470443 2.240905 2.069138 3.074172 2.136929 2.348522 1.750627 1.870191
53 3 2 1.013811 1.481403 1.943897 2.337724 2.138240 4.620687 2.055960 3.103768 2.414534 3.601535
54 4 0 1.233984 0.908289 1.335058 1.140114 2.712658 1.913354 2.039508 1.684067 2.022672 2.104231
55 4 2 0.933051 0.919132 1.711081 1.248642 1.862427 2.008070 2.154959 1.953849 2.374277 2.130013
56 4 1 1.088023 1.281428 1.485170 1.306591 2.466762 2.112801 2.389447 1.861896 3.091489 2.712500
57 4 3 1.052385 0.987920 1.798317 2.636033 2.063535 3.007506 1.805309 1.653838 1.715452 2.052641
65 3 0 1.118081 0.958181 2.184604 1.214404 2.495676 1.775415 2.320930 1.801427 1.878169 1.370575
66 3 0 1.274414 0.971424 2.532798 1.458123 2.947352 2.015827 2.569427 1.689971 2.150907 1.640634
67 3 0 0.918455 0.980015 1.630172 1.231964 1.990950 2.217162 2.018608 1.869119 1.739384 1.656168
68 3 1 0.926393 0.894355 1.291210 1.588971 1.989916 2.022823 1.723560 2.109102 1.888045 2.192822
69 4 1 0.895967 1.283665 1.228122 1.461563 1.829302 2.139666 1.837602 2.017727 1.538156 1.923328
70 4 2 1.524026 1.465255 1.449301 1.335197 3.884779 2.318507 2.604215 2.850151 1.983241 2.977891
71 4 2 1.055224 1.600393 1.391046 1.310089 2.005448 2.440057 1.739513 1.907397 1.462882 1.507126
72 4 0 1.246412 1.416990 1.556525 1.620839 2.930473 3.843281 1.797899 2.256352 2.717492 3.977714
73 5 0 0.967607 3.076726 1.372235 5.588236 2.186752 9.270553 1.775697 2.025960 1.831850 2.143713
81 7 0 1.198706 1.263206 1.682317 1.670922 1.859396 2.268047 2.229901 1.916334 12.789368 3.073848
82 7 0 1.001955 0.972123 1.219462 1.093833 1.613719 2.198608 1.680207 1.905054 1.707538 1.452088
83 7 0 0.887594 0.987720 1.609936 1.444392 2.159108 1.874538 1.948511 2.008392 1.789415 1.761009
84 8 3 1.948695 2.337245 1.760635 3.134916 3.905819 4.226992 2.845925 2.805624 4.182568 4.552480
85 8 0 0.958897 1.042346 1.784983 1.585128 1.934317 2.084406 1.907072 2.684394 2.597168 4.209146
86 8 0 1.968043 1.336100 2.385149 1.431859 4.385536 2.189283 4.817778 4.910109 5.482747 5.821483
87 8 2 1.482720 2.224586 1.579384 2.576650 2.432819 5.509649 1.908773 5.195232 1.795290 4.191608
88 9 0 3.517181 25.216861 14.850352 118.253809 9.038986 71.361403 10.514373 77.393728 15.603335 119.126104
90 9 0 0.977621 0.961951 1.242407 1.452014 1.970695 1.778449 1.739501 1.697734 1.902668 1.651611
91 9 1 3.072023 16.916062 12.160712 38.687301 7.935506 61.028223 9.227781 76.963327 12.646276 90.511149
92 10 0 3.121570 1.512730 0.690050 0.866506 2.265585 2.201885 2.592176 1.879560 2.613046 2.343951
93 10 0 0.867868 1.029527 1.535088 1.307440 2.337272 2.474021 1.801553 2.001405 2.166620 2.157651
94 10 0 0.884985 1.060196 1.282885 1.630861 1.983446 2.333633 1.944291 2.463650 2.114712 4.673519
98 7 2 1.080017 0.843037 1.524829 1.570372 2.580766 1.936481 2.547903 1.697219 5.508525 1.755530
99 7 2 0.977122 1.085286 1.552720 1.690036 1.948797 2.139617 1.906255 2.117775 4.606295 2.194310
100 7 1 nan nan nan nan nan nan nan nan nan nan
101 8 2 1.316289 1.446286 1.428000 1.527838 1.692229 2.011454 1.662720 2.069380 1.449889 2.194030
102 8 0 1.607328 1.032140 5.178133 4.746440 4.359023 2.209032 2.304854 2.146413 4.023928 2.215303
103 8 1 nan nan nan nan nan nan nan nan nan nan
104 8 1 nan nan nan nan nan nan nan nan nan nan
105 9 1 1.710996 0.973849 3.987593 1.655504 1.954074 1.793409 2.211335 2.088646 4.480824 1.799080
106 9 3 3.355946 1.172394 13.496150 1.383646 9.246417 2.176205 10.718459 3.105023 15.109782 1.574044
107 9 0 4.055755 11.465951 14.932191 24.506749 6.350086 46.170792 8.256360 62.213556 36.077224 66.897447
108 9 1 0.885847 0.879659 1.563999 1.334055 1.899061 1.986162 1.868478 1.818032 1.847250 1.448272
109 10 1 1.201698 1.356703 1.532864 1.888626 2.823000 2.845208 1.850039 1.775821 1.604322 1.512134
110 10 1 1.460316 1.804613 1.326116 1.134190 2.228665 2.001869 1.922157 2.000513 1.793311 1.739031
111 10 1 1.132133 1.119777 1.571179 1.385244 2.118480 2.429145 2.032288 1.875855 1.652476 1.802549
112 10 2 0.881172 0.875934 1.547159 1.074144 1.983603 1.988575 1.874192 1.694871 1.788001 1.644920
116 7 2 0.870547 0.860013 1.234983 1.295821 1.870967 1.988700 1.767475 1.737385 1.988839 1.567284
117 7 3 0.883118 1.011147 1.571525 1.417769 1.741027 1.821811 1.796712 2.421582 2.310446 3.555489
118 7 3 2.020021 0.959443 4.562103 1.441785 2.709950 1.912677 3.475182 1.864554 3.708000 2.864848
119 7 1 nan nan nan nan nan nan nan nan nan nan
120 8 1 nan nan nan nan nan nan nan nan nan nan
121 8 3 1.705252 1.935918 1.816804 1.418190 3.991211 4.676365 2.831663 2.400240 2.969482 12.386071
122 8 2 1.927543 1.493015 1.739787 1.931353 3.379446 2.378694 2.855567 3.210578 3.905216 4.475386
123 8 3 1.213200 1.172055 1.599572 1.583055 1.827612 2.077748 1.776240 2.170664 1.566898 1.711838
125 9 3 2.502606 1.028593 5.272728 1.675888 4.600988 1.884721 3.566190 2.222296 10.208778 2.197425
126 9 3 0.824390 1.580511 1.533929 3.353518 1.535754 3.065142 1.626083 1.966444 1.519639 2.068560
127 10 2 1.266991 1.483198 2.405828 1.382121 3.293899 3.446425 3.666211 3.217278 3.614588 3.504919
128 10 2 1.109650 1.089913 1.529627 1.739358 2.039755 2.420448 2.044168 2.045985 2.208847 3.150553
129 10 3 0.933386 0.903601 1.284314 1.392620 1.893560 2.008845 1.784823 1.862955 1.479456 1.785441
130 10 3 0.350911 0.313360 0.693028 0.446932 0.838445 0.641931 0.699845 0.613560 0.668602 0.609857
135 12 2 1.014136 1.099507 1.471989 1.278396 2.173897 2.221148 2.134564 2.483255 2.095356 1.766331
136 12 2 1.160363 1.180970 1.178228 1.363113 2.080489 2.013572 3.689561 1.968391 2.454931 2.133177
137 7 3 3.324173 21.037351 12.871110 73.289808 6.376414 62.749992 8.031977 73.165605 13.850288 95.782074
138 7 1 nan nan nan nan nan nan nan nan nan nan
140 13 2 3.269798 3.882028 13.637691 31.219497 6.318036 2.974900 2.786176 4.362066 4.518424 7.566114
141 13 2 6.460570 1.169658 9.438641 1.252605 22.825497 1.892457 12.243633 1.968984 9.908027 2.522052
142 13 2 5.847006 1.430297 8.260136 1.607755 7.399290 2.190614 3.160058 1.907042 4.282056 3.780652
143 14 2 1.060795 0.983202 2.134296 1.215133 2.038800 1.959689 2.471597 1.972424 1.899647 2.061522
144 14 3 0.268639 0.330448 0.388691 0.386587 0.587733 0.593124 0.498014 0.516861 0.413242 0.538749
145 14 3 3.873610 6.469111 21.745519 19.653578 19.876498 18.927584 3.044778 1.873576 2.801902 1.860129
150 15 1 1.238228 2.778856 8.365818 18.606165 2.299454 3.198071 1.965228 5.946444 3.075405 11.935124
155 12 2 2.762448 3.697334 8.627306 19.345912 3.854599 4.240257 2.858144 2.301091 3.320774 2.012638
156 12 3 1.150825 1.209910 1.269692 1.336995 2.289778 1.779172 1.801548 1.713173 1.664289 1.535951
157 12 3 1.132241 1.070544 1.508570 1.323478 1.888228 2.131374 1.958867 1.906592 1.672096 1.844962
158 12 3 1.175189 1.247291 2.467458 1.337114 3.060125 2.181052 2.409559 2.345624 2.393300 3.006042
160 13 3 3.373042 4.823583 13.386410 23.650098 6.836030 9.209265 3.384928 3.349586 2.909049 3.032988
161 13 0 2.107018 0.987521 1.433479 1.368150 4.238771 2.144965 3.428026 2.074065 5.347575 3.389292
162 13 0 0.978283 0.979518 1.391755 1.375792 1.874363 1.879774 1.811686 1.732696 1.593601 1.546587
163 14 2 0.959852 1.033504 1.520955 1.578871 1.928565 2.169174 1.907880 1.674149 1.666323 2.035281
164 14 2 0.951752 0.993297 1.276139 1.415269 2.152125 2.035647 1.896525 2.284790 1.867051 1.695271
165 14 0 4.523910 4.673384 2.727348 5.758995 16.456161 12.280609 2.813320 3.993276 5.858041 3.679145
166 14 0 2.006095 0.959111 1.317280 1.312740 2.682836 2.427485 3.413208 2.368940 2.937621 2.430899
167 15 1 5.749683 6.222237 2.005264 1.555620 26.201390 28.393341 2.880987 3.091625 2.977005 3.253054
168 15 2 3.345374 1.406545 12.559264 3.782492 10.556253 1.850530 13.130184 4.158559 15.108672 5.165034
169 15 2 3.423073 6.491246 11.693005 31.671279 7.199495 7.848019 8.336135 11.017234 12.639393 13.387465
170 15 2 0.967468 1.682772 4.025086 8.465517 2.331945 3.524545 3.046259 5.392760 4.405642 5.425056
176 12 0 0.865645 0.928728 1.416025 1.706985 1.717933 2.342159 1.994472 2.142102 1.935260 2.078302
177 12 0 0.994203 1.182650 1.313859 1.420475 1.844832 1.981082 1.866775 1.877946 1.856018 1.791103
178 12 0 0.975252 0.923174 1.273966 1.336938 1.896171 2.193485 1.861718 2.368935 1.687819 2.169733
179 12 1 1.340599 0.860258 1.295898 2.135390 2.470614 2.099135 4.080383 2.538729 3.445135 2.689668
180 13 3 2.205155 1.561291 10.063438 1.316691 5.545678 3.848200 3.531026 1.903672 3.205504 1.906010
181 13 3 1.831142 4.676826 1.057002 12.226801 2.655920 7.127235 1.938782 1.937537 2.109979 1.984320
182 13 0 7.588393 1.578139 13.406697 3.427227 19.002702 3.976196 3.125388 2.304945 3.059004 3.775637
183 13 1 1.069598 1.074152 1.503931 1.614945 2.574288 2.176941 1.891650 1.883101 2.051581 2.294022
184 14 0 0.891486 0.856896 1.215048 1.376857 1.917212 1.994035 1.693917 1.787242 1.392758 1.504690
185 14 1 0.933123 1.049704 1.388585 1.460363 2.321414 2.222475 2.070075 2.667636 1.954034 1.684490
186 14 1 0.939266 0.931473 1.452368 1.276633 1.980825 1.907759 1.945674 1.902428 1.762540 2.240259
187 14 1 1.033073 1.410117 1.302423 1.982193 2.079236 2.873939 2.423562 3.721899 3.063985 4.172546
189 15 3 0.234447 0.232254 0.124852 0.116872 0.781512 0.777006 0.210338 0.229657 0.134513 0.139049
190 15 3 2.845957 1.785108 11.213230 1.090567 5.087949 2.167158 2.857150 2.878509 2.956673 3.359372
191 15 3 0.764627 0.724672 0.362420 0.314442 0.578251 0.545434 0.970654 0.928977 0.421733 0.428578
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 0.263842 0.277178 0.079373 0.017934 0.187665 0.133492 0.057909 0.021410 0.045090 0.021048
206 19 0 0.292934 0.283630 0.021990 0.024635 0.140520 0.129471 0.023861 0.026257 0.026393 0.023050
207 19 1 0.278913 0.267741 0.019946 0.019032 0.134683 0.128791 0.019365 0.019399 0.019857 0.019402
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.310823 0.294267 0.025220 0.023573 0.152746 0.139648 0.028503 0.021803 0.024900 0.023085
224 19 1 0.239918 0.237780 0.028679 0.011060 0.115986 0.112926 0.026961 0.010861 0.049120 0.016300
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 5.296284 4.940677 12.245907 27.525748 7.618781 7.037333 5.893374 4.961062 12.975017 15.219886
321 2 3 nan nan nan nan nan nan nan nan nan nan
323 2 3 nan nan nan nan nan nan nan nan nan nan
324 4 3 1.037287 0.981518 1.655340 1.795773 1.631693 1.892747 1.753813 1.756131 1.657476 1.840947
329 12 1 1.004736 1.016718 1.857643 1.115360 2.381919 2.030914 2.051796 1.842646 1.780259 1.895766
333 12 1 1.484451 1.285903 1.696301 1.354368 2.450139 3.080612 1.784099 1.675680 1.915364 1.404776
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 [ ]: