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 = 2459758
Date = 6-27-2022
data_path = "/mnt/sn1/2459758"
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 2459758.25312 and 2459758.33611
372 diff files found between JDs 2459758.25312 and 2459758.33611

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 118.544350 88.924706 285.569727 230.128177 5.524786 13.148951 2.681537 20.758743 1.347277 35.913247
1 0 0 123.849684 97.563350 250.589047 245.355686 2.340587 2.568505 1.253954 2.498837 1.373957 1.736066
2 0 0 80.772498 107.617729 206.606621 256.506991 2.274231 3.720249 2.787966 8.922015 2.256123 3.063583
3 1 2 1.354019 2.226931 1.595599 1.758169 2.263697 2.255885 2.141391 2.215720 5.175213 4.161032
4 1 2 1.156130 0.894674 1.861490 1.366522 1.938798 1.664790 1.898548 1.698644 2.088533 1.606551
5 1 2 0.993297 0.979280 1.788551 1.432983 1.854989 1.575051 2.388936 2.058436 8.210823 9.183365
7 2 0 1.003863 0.840441 1.644863 1.558872 1.764632 1.784506 1.902238 1.719271 2.071814 2.233149
8 2 0 1.248307 20.143932 2.676657 47.530620 3.236721 72.534136 2.284294 86.589526 4.309757 101.114737
9 2 0 0.908302 0.931686 1.731709 1.604105 1.672414 1.985264 2.553774 2.581618 2.440973 2.769995
10 2 1 0.877755 13.935889 1.597727 13.334254 1.787061 55.878354 1.827400 64.826406 2.319556 71.685237
11 0 1 106.208613 387.784221 264.049283 3392.364145 5.935081 242.672038 6.835640 1033.822103 2.024175 522.305555
12 0 1 346.663763 184.929353 1009.222844 700.265077 127.758121 219.285697 594.787960 611.747356 259.883282 147.993568
13 0 1 118.988394 148.962189 240.905357 167.726743 28.374944 70.280206 58.213863 339.459511 46.052198 132.313342
14 0 2 98.615961 280.574785 455.145969 1195.606219 28.170709 518.185298 38.645007 466.656782 23.533006 121.330074
15 1 3 1.314776 0.971678 1.743070 1.563656 2.501673 2.128013 2.427921 2.405779 11.070740 11.324583
16 1 3 0.943458 0.868340 1.747027 1.508086 1.851619 1.714035 1.731061 1.723041 5.526175 3.400575
17 1 3 1.058969 0.904947 1.800972 1.524208 2.323512 1.709448 1.909764 1.907573 2.231613 2.851677
18 1 0 43.185299 2.021621 21.484873 1.630569 200.351426 5.462687 1.649238 1.887838 2.185977 1.896162
19 2 1 0.893985 0.858719 1.404554 1.640098 1.692736 1.814783 1.553261 1.869263 1.575756 2.647398
20 2 1 0.849724 0.848779 1.771632 1.555845 1.845799 1.848162 1.663038 1.805604 1.983949 2.961794
21 2 2 0.927895 0.758259 1.520836 1.473581 1.743554 1.581433 2.112410 2.049095 1.893950 2.318021
23 0 2 103.136563 136.506534 276.911791 303.012908 5.726324 5.426265 1.416597 2.300519 1.717657 1.174636
24 0 2 75.990357 80.540902 175.087810 197.534786 1.628433 7.325189 0.686461 2.054338 0.922351 1.883986
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 3226.963754 0.000000 0.000000 0.000000 0.000000 0.000000 1211.433096 0.000000
27 1 0 76.627789 88.058881 35.653030 23.873649 361.877157 412.485620 1.681811 1.915533 2.394124 1.809950
28 1 0 1.256730 89.819632 2.324006 52.298628 3.085068 430.217206 2.041475 1.748884 2.682129 2.407106
29 1 1 nan nan nan nan nan nan nan nan nan nan
30 1 1 nan nan nan nan nan nan nan nan nan nan
31 2 2 0.946891 0.981828 1.794916 1.523737 1.922027 1.991199 2.425857 3.953227 3.057367 7.873143
32 2 2 0.975163 2.593481 1.666239 1.575399 1.861133 4.408043 2.802457 11.030682 2.935103 5.845608
33 2 3 33.056985 0.812168 24.798835 1.670299 162.866264 1.843781 1.821201 1.845699 2.336369 2.455383
36 3 3 1.246883 1.251494 1.818604 1.554709 1.632647 2.098397 1.738034 1.780508 1.839205 2.799453
37 3 1 1.136875 0.855134 2.049703 1.510798 2.807828 2.044024 2.249461 1.892632 4.327175 3.609263
38 3 1 0.940334 1.068598 1.941902 1.483505 1.860548 2.026607 2.469198 2.578111 2.330810 2.725966
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.878667 0.923679 1.688774 1.653418 1.773024 2.163687 1.860951 2.121646 2.122686 5.281006
41 4 3 1.011681 1.086019 1.858486 2.050919 1.979005 2.512247 1.980609 2.135568 2.014852 2.351325
42 4 0 1.065772 0.942549 1.758128 1.690949 2.914606 2.551773 2.093243 2.307164 9.266652 11.895093
45 5 0 2.172895 0.955563 19.215716 1.524338 3.184178 1.581078 3.156821 1.681145 3.257225 1.927383
46 5 0 1.849058 1.075462 1.714361 1.634589 3.492286 2.309521 1.934280 1.848968 2.726424 3.102452
50 3 3 1.107738 0.828719 1.941231 1.460994 2.010764 1.846353 2.038336 1.762759 2.255732 2.125196
51 3 2 0.988332 0.810766 2.045609 2.498110 1.933318 1.820127 1.750185 2.041039 4.158669 4.285183
52 3 3 6.133227 1.108643 17.731655 1.808763 3.940902 1.981417 3.618629 2.168581 4.556468 3.908727
53 3 2 1.111630 0.969576 3.581832 2.670952 2.743238 2.416825 2.588233 2.245204 5.391972 5.273926
54 4 0 1.321398 1.162143 1.711862 1.754267 2.967329 2.559250 1.956976 2.772043 3.933963 6.247978
55 4 2 0.877334 0.901580 1.675485 1.581543 1.745933 1.742573 2.223258 1.875977 2.637775 2.123227
56 4 1 1.057510 0.977927 1.825298 1.560138 2.046343 2.086774 2.035578 1.759950 2.390298 2.437505
57 4 3 1.014612 0.982640 2.170064 1.380973 2.321429 2.004248 1.822275 1.660280 2.132672 1.799631
65 3 0 1.114630 0.804745 2.844941 1.649361 2.305709 1.741096 1.998676 1.896691 2.334863 2.172866
66 3 0 1.351730 0.893189 4.305429 1.907751 3.348025 2.044212 3.090998 1.743281 3.455022 4.025945
67 3 0 1.031016 0.827197 1.527952 1.844710 1.708977 1.861687 1.631457 1.706203 1.666070 2.170487
68 3 1 1.065348 0.782506 1.710313 1.639870 1.748872 1.728400 1.674219 1.867218 2.037057 2.229243
69 4 1 0.880752 0.834428 1.566058 1.845749 1.776742 1.694725 1.684107 2.025403 2.249348 3.122857
70 4 2 1.415667 1.511056 1.847801 1.797402 3.051681 2.306566 2.995104 3.802436 2.188656 3.372803
71 4 2 0.963927 0.941155 1.917399 2.057203 1.882510 1.890428 1.941112 1.777452 2.151310 2.064586
72 4 0 1.021334 0.956890 1.774881 1.683186 2.138593 2.097516 1.757124 1.938865 3.284707 4.949129
73 5 0 1.054384 1.099632 1.625627 1.534632 2.257337 2.212064 1.897931 1.857109 4.629261 5.015910
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.386001 1.130299 1.565785 1.657312 1.490400 2.067901 1.776139 2.052926 6.371999 7.265181
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.119254 1.225271 1.726565 1.831490 1.645004 1.851967 1.869600 2.422704 3.606409 3.563654
88 9 0 2.438986 8.852417 15.954062 30.536079 7.691301 30.154262 4.946686 3.803632 7.091235 3.142171
89 9 2 nan nan nan nan nan nan nan nan nan nan
90 9 0 7.864379 3.675343 3.080101 2.182017 14.276218 7.556142 34.208105 10.872966 56.547852 23.413902
91 9 1 3.799147 4.636814 14.237117 10.822330 6.385310 10.917238 5.728111 3.432624 7.863661 2.238864
92 10 0 3.246227 1.867493 10.372376 9.264877 4.200336 3.052902 3.017592 1.889873 3.734965 1.836321
93 10 0 4.155572 1.610113 8.730098 1.986250 7.182865 1.657427 3.761594 2.123113 3.149942 2.166658
94 10 0 0.928315 1.212635 1.688091 3.117564 2.087344 3.096763 2.525203 4.306875 3.062974 19.265726
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 1.577032 1.225481 1.669795 1.709568 1.713646 1.900320 1.676234 2.050365 2.232504 4.359137
102 8 0 nan nan nan nan nan nan nan nan nan nan
103 8 1 1.231811 0.920557 1.679462 1.604206 1.694731 1.797687 1.664713 1.663843 1.961168 2.148174
104 8 1 2.142619 1.185532 2.704527 1.859316 1.883603 1.997637 2.484619 1.885581 8.936491 2.402020
105 9 1 2.425313 4.220941 17.378854 6.538074 3.510761 10.727428 6.569850 2.054972 10.420393 2.506943
106 9 3 1.257560 1.164534 1.607218 1.980853 2.586226 2.018773 2.325289 2.731087 2.614496 2.168393
107 9 0 7.169547 31.472754 35.354694 176.352989 7.411405 19.085773 10.613141 68.501255 10.674577 67.114043
108 9 1 1.104845 0.870993 1.745105 1.675040 1.775955 1.773953 1.840465 1.870494 2.852919 2.684198
109 10 1 2.005875 1.691003 1.890137 1.935507 3.173026 4.798935 1.581694 1.986760 2.035391 2.464572
110 10 1 1.246423 1.608676 2.110367 1.357146 2.468846 3.755148 1.929631 3.394172 2.000871 2.598901
111 10 1 1.125482 0.924876 2.514626 1.512168 2.373544 1.699843 2.216155 1.788523 2.127924 1.616495
112 10 2 nan nan nan nan nan nan nan nan nan nan
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 4.816466 2.124985 8.330410 1.707426 5.063328 2.173486 7.209082 1.671171 20.237328 2.335863
121 8 3 1.854411 1.681653 1.950693 1.564991 3.712861 4.817492 2.628990 2.771230 4.607578 26.911997
122 8 2 1.541700 1.260796 1.886890 1.600443 2.424983 2.343094 1.968384 2.027110 2.957872 3.278248
123 8 3 1.259108 1.000431 1.830479 1.718624 1.901611 1.691305 1.773795 1.821421 2.848159 2.853423
124 9 2 nan nan nan nan nan nan nan nan nan nan
125 9 3 4.078115 2.931802 38.712614 11.350784 14.207695 6.635471 3.043468 1.836787 4.904563 2.050180
126 9 3 3.797325 2.727097 38.956194 8.655352 5.534926 12.362350 4.980250 4.542204 5.326311 3.651160
127 10 2 nan nan nan nan nan nan nan nan nan nan
128 10 2 nan nan nan nan nan nan nan nan nan nan
129 10 3 1.040912 0.790825 1.843054 1.331590 2.155550 1.604870 1.832479 1.601454 1.737005 2.416038
130 10 3 1.369093 1.686347 2.932028 14.424421 2.093347 1.933238 2.082466 2.000493 3.323071 1.889838
135 12 2 1.330437 1.364260 1.900832 1.624495 2.121414 2.742906 3.024164 3.422662 2.498468 4.121308
136 12 2 1.428520 0.965880 2.531095 1.653381 2.180579 1.896993 5.272191 2.769401 2.901888 3.655958
138 7 1 nan nan nan nan nan nan nan nan nan nan
140 13 2 1.083846 0.980907 1.910863 1.839686 2.100280 1.984404 1.963173 2.364666 2.443749 4.216797
141 13 2 5.768750 1.065067 19.924805 1.686471 20.367322 1.990031 12.511998 2.322065 11.398348 3.234583
142 13 2 2.566452 1.050417 6.179367 1.992157 6.904571 2.285669 2.467359 1.999219 3.318609 2.081685
143 14 2 1.058885 0.796773 2.757653 1.589237 2.173212 1.590370 2.118117 1.749757 2.356689 2.969729
144 14 3 1.345321 1.122014 1.426133 1.588226 2.293543 2.147647 1.662801 1.696705 2.208259 2.485611
145 14 3 3.513711 3.094721 14.246577 19.585778 12.958831 13.858696 2.536153 1.778671 2.525971 1.894762
150 15 1 3.605394 3.317323 18.381707 39.386628 6.460679 6.279137 3.645380 3.712738 2.953481 1.986558
155 12 2 3.321025 2.693993 7.989328 24.279601 3.825282 4.395328 3.200945 3.011042 3.295796 2.181734
156 12 3 1.272682 1.065769 1.846464 1.597233 2.756466 2.177094 1.975298 1.777697 2.005339 1.981325
157 12 3 1.149938 0.989479 1.533941 1.768379 1.980828 2.265921 1.909676 2.264257 1.756297 2.395140
158 12 3 1.195228 0.843580 3.963111 1.790834 3.433545 1.861453 2.554046 1.863283 2.610857 2.020408
160 13 3 nan nan nan nan nan nan nan nan nan nan
161 13 0 1.462814 1.135368 1.722261 1.480001 3.115073 2.356887 2.462988 1.706086 2.372451 2.652331
162 13 0 0.924079 0.952540 1.796870 1.479651 2.063622 1.826375 1.821599 2.030691 2.018888 3.020109
163 14 2 0.980216 0.900770 1.945324 1.648843 2.068475 1.753131 2.662252 1.740481 2.576968 4.467523
164 14 2 1.018068 0.861806 1.884348 1.697764 1.995793 1.858161 2.326986 3.332367 3.993004 2.915328
165 14 0 3.862243 3.009417 5.698541 5.264774 11.936032 8.738703 4.263824 5.567025 7.858550 10.302686
166 14 0 1.003719 1.448082 1.737186 1.723471 2.139840 2.807759 2.051016 2.625978 2.395014 3.482741
167 15 1 2.439180 2.439207 1.791720 1.938824 2.608721 2.833867 2.374604 2.103761 2.407653 2.238581
168 15 2 1.380170 0.993057 3.082415 1.922496 2.518005 1.740325 3.171250 3.195809 5.073833 3.142628
169 15 2 0.956321 9.259891 1.945698 43.653832 1.859724 4.162007 2.180319 5.452088 3.684940 11.827959
170 15 2 1.430447 11.396393 2.345808 56.427286 2.628920 13.773172 3.390361 16.885918 4.962455 18.457885
176 12 0 0.891909 0.887159 1.583040 1.792847 1.847482 1.989472 1.911325 2.327029 2.514207 2.588712
177 12 0 0.931496 0.950960 1.829917 1.706163 1.949948 1.753234 1.975209 1.621020 2.088668 2.673078
178 12 0 1.004768 0.968116 1.521757 1.495402 2.095487 1.962266 1.951803 2.163285 2.372059 1.977237
179 12 1 1.401622 0.804134 1.617140 1.679292 2.635304 1.816425 3.663659 2.379048 4.566041 2.858674
180 13 3 nan nan nan nan nan nan nan nan nan nan
181 13 3 nan nan nan nan nan nan nan nan nan nan
182 13 0 1.223797 1.558750 2.187529 2.315338 3.598723 3.958505 2.388944 2.332027 2.857575 2.902365
183 13 1 1.066185 0.972721 1.597389 1.672470 2.601672 2.324989 1.821871 1.969384 1.954962 2.341918
184 14 0 0.913045 0.860207 1.646668 1.655579 1.732113 1.776944 2.104465 2.000659 4.655465 7.301409
185 14 1 1.186327 1.466094 1.787338 2.167334 2.250061 3.495833 2.601222 3.080842 3.295855 6.127363
186 14 1 1.079389 0.993651 1.812145 1.726555 2.105026 1.681554 2.042914 2.080136 3.730382 4.806727
187 14 1 1.918877 1.544489 6.847367 2.711904 5.440757 2.992401 4.430125 3.788227 6.769232 13.490508
189 15 3 0.998334 1.098838 1.713108 1.713115 1.850422 2.094797 1.774250 2.140149 1.852773 2.881916
190 15 3 2.803419 3.648215 1.523855 1.375199 3.020581 3.201212 2.637989 3.026648 4.565450 3.977675
191 15 3 1.096500 1.097968 3.941503 2.339331 2.098577 2.458481 1.763370 2.439904 2.262042 2.456266
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 4.970397 4.905118 10.974791 24.449369 5.332058 5.264563 5.706718 2.952260 6.045448 6.854036
321 2 3 0.931423 0.880102 1.754218 2.905570 1.754409 1.826065 1.663671 1.940741 1.934238 2.098212
323 2 3 0.885893 1.979524 2.844541 4.426045 1.540070 2.789707 1.682349 1.962562 1.894294 2.807541
324 4 3 0.833722 4.859219 2.019741 22.354539 1.904341 1.768870 1.867009 1.720971 1.780482 1.975830
329 12 1 0.856051 1.018733 1.995080 3.467947 1.780742 2.152535 1.940590 1.836674 2.018703 2.458674
333 12 1 0.772357 1.034042 1.895865 1.870729 2.108471 3.291269 1.774190 1.810399 1.985867 2.176071
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 [ ]: