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 = 2459799
Date = 8-7-2022
data_path = "/mnt/sn1/2459799"
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 2459799.25315 and 2459799.66945
1862 diff files found between JDs 2459799.25315 and 2459799.66945

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.288524 1.376921 1.478810 1.530658 2.330265 2.246543 1.701683 1.727123 1.939515 2.318249
4 1 2 1.219806 4.588639 1.415392 1.221421 2.131085 2.410590 1.772577 1.829657 2.645984 2.937279
5 1 2 0.983248 1.162754 2.061865 1.514129 1.812760 1.903233 2.156087 1.921451 6.669837 6.908962
7 2 0 1.035045 1.031907 1.383624 1.366597 2.005474 1.813712 1.753141 1.816626 2.607076 2.855467
8 2 0 1.595524 18.430380 3.666418 85.092674 3.794847 60.101112 3.288845 31.206826 4.753921 98.287277
9 2 0 0.992553 1.060872 1.297654 1.290242 1.896028 2.344560 2.359008 2.171983 2.989672 3.117089
10 2 1 0.979817 1.171222 1.862160 1.386222 2.046503 2.213866 1.901163 2.250822 3.054541 3.999794
15 1 3 1.166232 1.170277 1.496074 1.031077 1.926254 2.058526 1.836731 1.784631 7.508268 6.099824
16 1 3 1.425854 1.153485 1.527960 1.255487 1.944138 2.128816 1.821352 1.771669 6.215749 3.526449
17 1 3 1.285526 1.202139 1.545627 1.195500 2.206062 1.825726 1.904742 1.726822 2.375950 2.484677
18 1 0 79.915468 42.585675 1.397582 1.468813 365.914703 193.698577 1.494752 1.618645 2.800404 2.225248
19 2 1 1.309151 1.134317 1.964470 1.652187 2.148910 1.822568 2.631265 1.858802 6.327646 6.691303
20 2 1 0.981141 1.025952 1.622915 1.154811 1.702257 1.841640 1.639005 1.805628 2.261111 2.339933
21 2 2 1.124124 1.031036 1.321410 1.157404 1.910241 2.802998 2.150971 1.915132 1.913333 2.722409
27 1 0 4.032031 4.832796 9.612139 22.581977 17.944086 11.585244 4.701173 1.950016 5.442225 1.720475
28 1 0 104.150927 5.263332 1.519587 1.540903 464.032293 26.656856 1.684509 2.425281 4.116420 5.013768
29 1 1 1.412322 1.135391 1.635166 1.371929 2.077513 2.060660 2.541225 3.157680 6.295072 4.843158
30 1 1 1.224525 1.108230 1.679640 1.586472 2.142489 1.628144 3.260043 3.044557 2.787317 5.218118
31 2 2 1.063416 1.296957 1.338123 1.207584 1.856726 2.120029 2.692407 6.483927 4.545705 13.225208
32 2 2 1.614741 3.059066 1.036381 1.216589 3.168670 4.305641 3.844092 8.366073 4.395801 8.093595
33 2 3 nan nan nan nan nan nan nan nan nan nan
36 3 3 1.401823 1.382142 1.724977 1.371680 2.093122 2.063043 1.657936 1.525874 2.823036 2.526362
37 3 1 1.176967 1.079767 3.062995 2.493765 2.737798 2.208560 1.941727 1.971205 3.678824 5.478814
38 3 1 1.059743 1.230338 1.819324 1.389059 1.815491 2.264459 1.749788 2.223467 2.608313 2.924901
40 4 1 0.943715 1.276894 2.079204 1.574430 2.134528 2.636461 1.675351 2.237381 2.389844 2.686223
41 4 3 1.062210 1.374404 1.226567 1.776386 2.353596 2.381277 1.612293 1.849411 1.886304 2.197475
42 4 0 1.273684 1.170956 1.556897 1.179828 3.005012 2.169044 2.124023 2.075846 2.912342 6.178180
45 5 0 1.679481 1.381052 3.502775 1.486822 4.212485 1.928372 4.067078 2.557020 4.820845 3.383782
46 5 0 1.692344 1.509746 1.432272 1.322494 3.427594 2.397006 2.139722 1.642668 3.015231 2.776599
50 3 3 1.064234 4.115282 1.506128 0.846599 2.126908 4.516407 1.734037 2.391385 2.790938 2.997991
51 3 2 1.413327 1.160389 6.309439 1.562811 1.877834 1.879672 1.619490 1.732278 2.259534 3.202415
52 3 3 1.376313 1.642871 1.783304 2.325737 2.290452 2.497282 1.981048 2.216577 3.309287 3.025611
53 3 2 1.222802 1.295899 2.328834 2.157340 2.463446 2.916689 2.244705 2.423916 7.904300 5.483676
54 4 0 1.048422 1.095363 1.455963 1.269970 2.454906 2.451302 1.687499 1.787625 3.478387 3.187923
55 4 2 1.110675 1.121595 1.878135 1.392143 2.418290 1.985745 1.966775 2.005607 2.844569 2.491405
56 4 1 1.327538 1.267175 1.559125 1.519750 2.418195 2.004249 2.203823 1.902212 3.653467 2.781389
57 4 3 3.043759 2.104272 2.290790 11.380050 12.949128 2.977474 2.690530 1.992809 2.817129 1.870060
65 3 0 1.176056 1.153251 2.331990 1.037125 2.416761 2.150817 2.105688 1.642616 2.836639 2.501266
66 3 0 1.424623 1.205264 2.945742 2.000564 3.306051 2.692220 2.428507 1.971372 2.951083 3.042499
67 3 0 1.002580 1.141839 1.562480 1.449588 1.638322 2.132278 1.436937 1.643291 2.464515 2.365565
68 3 1 1.044432 1.179747 1.743947 1.799583 2.129232 2.643348 1.609899 2.060544 2.453541 3.422164
69 4 1 1.027035 1.252804 1.718302 2.334275 1.744761 2.241071 1.744687 2.128687 2.672110 2.507102
70 4 2 1.498796 1.615196 1.526151 1.715521 3.481497 2.683421 2.159751 2.325378 2.482733 3.541723
71 4 2 1.834297 1.345617 1.704070 1.416276 2.030842 2.184987 1.725938 1.797749 2.475471 2.084403
72 4 0 1.324227 1.533149 1.727971 1.727164 3.128292 3.527331 1.857738 1.826284 4.436293 6.486226
73 5 0 1.293187 1.662994 1.753466 1.290152 2.273012 2.591145 1.993978 1.884263 3.437760 4.739226
81 7 0 1.331250 1.978707 1.812773 1.866314 2.163136 3.499288 2.605733 4.858946 7.666899 10.381531
82 7 0 1.087705 1.162407 1.256615 1.166210 2.018548 1.998668 1.551804 1.598464 2.945838 2.290296
83 7 0 1.158056 1.373113 1.737847 3.670896 1.765465 1.791933 1.928770 2.093213 3.824620 3.180222
84 8 3 2.095890 2.132293 1.872783 2.382757 4.412972 5.105381 3.120749 2.963830 8.764891 6.772242
85 8 0 1.048566 1.160237 1.728555 1.431120 2.079300 1.900436 1.921235 2.087889 3.586644 4.215280
86 8 0 2.438100 1.671708 2.451208 1.301671 3.951250 2.255775 5.541957 6.343668 5.107870 7.181407
87 8 2 1.234163 2.032899 1.644069 1.856940 1.856655 3.239332 1.624666 3.849253 3.763266 4.591484
88 9 0 2.988231 8.724135 18.557416 54.501592 7.300042 52.754167 5.654176 7.058558 10.046928 5.236021
90 9 0 2.538872 1.398618 8.671505 19.609587 3.869569 2.526533 3.721390 1.853583 4.570721 2.012735
91 9 1 4.283491 7.913833 18.235539 18.423222 7.199940 16.632072 8.422603 5.620682 11.831741 3.214676
92 10 0 3.975978 4.486179 0.550549 1.085638 4.750676 19.931816 3.309667 2.742636 5.264099 3.235067
93 10 0 1.120731 1.043012 1.515272 1.423975 2.068588 2.123360 1.998599 2.014404 3.200783 3.770864
94 10 0 1.004174 1.248615 1.504058 2.277519 1.971784 2.721967 2.321941 2.796841 2.855745 3.373158
98 7 2 1.497373 1.086504 1.442517 1.487960 3.404901 2.034003 3.696732 1.944556 13.701496 3.036580
99 7 2 1.165386 1.792207 1.569612 1.868451 1.989079 2.304393 1.957915 2.553630 5.338477 31.141004
100 7 1 1.735471 1.420979 2.796653 2.323259 2.841095 2.760038 1.980156 1.914971 3.434630 3.501246
101 8 2 1.442896 1.513387 1.652011 1.880877 1.827541 1.966687 1.695141 1.851112 3.045069 3.828510
102 8 0 0.366603 0.198829 0.479805 0.758261 0.547374 0.372577 0.642868 0.364726 1.304437 0.587130
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 2.927551 3.104552 20.932029 8.940607 4.970545 9.740261 7.169408 2.745594 14.285914 4.984876
106 9 3 6.578568 5.577837 14.293458 20.891413 5.494179 16.890988 45.278642 11.346827 7.794079 2.508051
107 9 0 4.319511 4.105050 49.090121 49.096472 9.935927 4.794729 4.636045 6.378352 8.601531 14.425353
108 9 1 2.156581 1.283114 11.638472 6.355910 3.323381 2.060454 4.531640 1.780456 4.864846 1.801528
109 10 1 1.671467 2.092268 1.465178 1.411846 4.228934 5.271892 1.921257 1.934599 2.315120 2.659298
110 10 1 1.654441 2.353791 1.895937 0.935160 2.611820 2.909066 2.299567 2.633533 2.869104 2.113793
111 10 1 1.263591 1.194021 2.215684 1.201001 2.499219 2.063471 2.022978 1.643927 2.487667 1.836130
112 10 2 1.033670 2.450383 1.557311 4.104741 1.721535 2.511472 1.597608 1.706528 2.394914 2.858367
116 7 2 1.120430 1.070587 1.466090 1.393709 2.488726 3.034593 1.829615 1.617899 4.213343 3.416121
117 7 3 nan nan nan nan nan nan nan nan nan nan
118 7 3 nan nan nan nan nan nan nan nan nan nan
119 7 1 1.398609 0.910865 1.681219 1.577409 3.077455 1.649111 3.344582 1.702307 15.153298 3.188228
120 8 1 nan nan nan nan nan nan nan nan nan nan
121 8 3 1.514345 1.807770 1.656215 1.286493 3.218753 4.453947 2.105903 2.742050 4.886981 7.361664
122 8 2 1.505800 1.468508 1.827892 1.657472 2.427421 2.034518 2.107679 2.553454 4.021425 3.840814
123 8 3 1.521441 1.407047 1.583202 1.493654 1.974268 1.870135 1.830611 1.791436 3.916052 2.992633
125 9 3 5.309262 3.457406 54.429219 17.106859 16.690045 8.963800 4.027441 2.471626 7.438975 2.488147
126 9 3 4.231215 3.346088 46.152423 11.769188 8.713181 11.015946 6.147280 6.073600 8.026873 5.350330
127 10 2 1.747420 1.771357 2.349910 1.429569 3.986397 4.124725 4.941030 4.628948 5.312016 8.012487
128 10 2 1.183488 1.201356 1.589518 2.248840 1.914635 2.363047 1.786096 2.142836 2.951559 3.121894
129 10 3 1.027964 1.177963 1.503845 1.306538 1.756936 2.036687 1.663698 1.923977 2.120278 2.713791
130 10 3 1.419331 1.413973 2.388289 1.257198 2.812583 2.531848 2.386186 1.689891 3.231601 2.740656
135 12 2 1.070996 1.191858 1.617259 1.286325 2.066636 2.349944 1.903536 2.200178 2.400524 2.012541
136 12 2 1.437116 1.230636 3.682707 1.220891 2.386420 1.871319 4.578529 2.635581 2.955587 3.863740
137 7 3 nan nan nan nan nan nan nan nan nan nan
138 7 1 1.109636 9.448879 1.413784 6.762808 2.249363 9.398022 1.888927 4.358556 14.332574 12.456077
140 13 2 3.776842 7.521164 25.085761 67.392686 5.027475 4.002902 5.868833 14.509228 9.893933 28.345092
141 13 2 10.327694 1.394279 14.619125 1.328699 35.119000 2.313748 22.885361 1.805763 23.495874 2.425554
142 13 2 6.429989 4.507321 8.468976 2.578345 13.840785 21.805817 3.194266 2.098705 5.905347 4.541051
143 14 2 1.225810 1.060195 2.285566 1.394458 2.526541 1.956500 2.298092 1.946072 2.835667 2.246448
144 14 3 1.392957 1.312990 1.764109 1.228491 2.773920 1.883677 1.845109 1.804230 2.448319 2.771328
145 14 3 9.840156 7.316689 30.671787 26.500463 32.811751 22.286384 4.540291 1.818339 3.686643 1.921177
150 15 1 5.191729 16.117264 31.233847 73.605360 6.598118 13.935252 7.272547 29.334945 7.622890 50.837344
155 12 2 2.761604 6.799808 9.662062 26.340605 3.552004 5.376457 4.181168 4.319385 4.708951 2.095647
156 12 3 1.386558 1.364396 1.344629 1.342100 2.633011 2.436872 1.850548 1.892420 1.785889 1.984170
157 12 3 1.181134 1.138444 1.615170 1.353421 1.895499 1.980075 1.783857 1.946619 2.284211 2.348314
158 12 3 1.542356 1.235791 3.665521 1.134031 4.371977 2.722864 2.746015 2.214756 3.905641 2.997964
160 13 3 6.405549 17.000569 25.020232 104.221261 10.483549 16.300336 7.422915 31.858494 11.136454 61.470503
161 13 0 4.008381 1.403781 1.230477 1.595524 5.890035 2.899805 3.869670 1.639557 6.258151 5.115624
162 13 0 1.094044 1.205759 1.461805 1.323906 2.078913 1.841326 1.778301 1.522713 1.643516 1.649196
163 14 2 1.038972 1.163359 1.805559 1.585280 2.029207 2.357717 2.083335 2.009654 2.896303 3.230589
164 14 2 1.127806 1.070669 1.448912 1.312429 2.018249 2.413371 2.004508 2.822199 2.450460 2.973690
165 14 0 3.559890 2.425426 3.295767 3.274585 10.878927 7.060609 2.866912 4.171051 5.365024 7.270792
166 14 0 2.515924 2.396349 1.878438 1.428725 4.420508 5.033647 4.789817 4.244115 4.175355 3.476121
167 15 1 3.070301 3.648688 2.854009 8.262542 3.733747 3.534503 3.604514 2.425240 2.906189 1.968393
168 15 2 2.019897 1.719321 4.147309 2.220085 2.920558 1.985877 8.937338 11.298275 12.425536 11.781093
169 15 2 1.633618 17.227650 2.731660 92.619372 3.294339 4.414988 5.084229 8.665958 9.705224 16.023865
170 15 2 1.877447 17.592395 3.744031 93.652188 4.384654 14.220903 5.713945 11.748636 13.709141 25.227394
176 12 0 nan nan nan nan nan nan nan nan nan nan
177 12 0 nan nan nan nan nan nan nan nan nan nan
178 12 0 nan nan nan nan nan nan nan nan nan nan
179 12 1 1.560723 1.043035 1.394928 1.308186 2.532880 1.923763 3.645344 2.200483 3.457466 3.486902
180 13 3 2.795576 1.605226 15.708246 1.425205 7.536740 3.671207 5.093144 1.788061 4.831472 2.624528
181 13 3 4.367622 6.889621 1.242009 15.262072 17.186720 10.397320 2.052474 1.738369 2.383069 2.588502
182 13 0 1.502279 1.715329 2.907896 2.196625 4.310342 3.959978 2.529992 2.221206 3.342495 3.570391
183 13 1 1.198739 1.136934 1.826488 2.126355 2.849439 2.071514 1.903231 1.856082 2.778565 2.994383
184 14 0 1.037137 0.868039 1.237835 1.453065 1.843385 1.575927 1.691022 1.638781 2.873848 4.297802
185 14 1 1.061975 1.232626 1.167355 2.372288 1.956371 1.947946 2.033587 2.852386 2.641016 2.748584
186 14 1 1.021548 1.099527 1.130393 1.026614 1.654899 1.973528 1.918757 1.992496 2.615548 4.343725
187 14 1 1.111625 1.645006 1.532843 2.346453 2.423229 3.220264 3.464445 4.311918 9.931345 12.195277
189 15 3 1.155053 1.292951 1.545919 1.242400 1.855145 2.274886 1.716621 2.135841 1.802015 2.973758
190 15 3 4.416036 2.275574 15.682322 1.111350 6.872281 3.789446 4.238264 2.765176 4.626465 5.982037
191 15 3 1.119346 1.192800 1.418248 1.289673 2.051577 2.124859 1.870359 1.723619 2.043064 1.852228
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.512547 1.202540 3.591879 1.786712 3.768312 2.301065 2.577520 1.824002 2.864740 2.341077
206 19 0 1.279671 1.116139 1.948334 2.185596 1.840379 1.872788 2.220335 1.743463 2.443099 1.866537
207 19 1 0.981604 0.905822 2.272077 4.382116 1.768095 1.783338 1.841915 1.782694 2.004795 2.396330
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 1.045514 1.139554 1.972162 1.897186 1.913823 1.843360 1.824490 1.498830 2.263644 1.754763
224 19 1 1.053196 0.916578 2.200309 2.282572 2.076099 1.917542 5.030791 2.373775 12.116388 6.096219
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 6.270168 5.946675 14.477174 41.607930 10.034743 10.169082 9.190132 4.044541 9.604443 20.278686
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 0.993546 1.071055 1.856950 2.421373 1.660838 1.840678 1.898722 1.828347 1.858404 1.742491
329 12 1 1.257545 1.266913 1.667027 4.072985 1.726727 2.217160 1.628468 1.740955 2.175800 2.430040
333 12 1 1.164240 1.344251 1.867782 1.479941 2.005068 2.710116 1.976234 1.572048 2.060835 2.050757
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 [ ]: