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 = 2459789
Date = 7-28-2022
data_path = "/mnt/sn1/2459789"
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 2459789.25301 and 2459789.33601
372 diff files found between JDs 2459789.25301 and 2459789.33601

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.502789 1.102564 1.338618 1.338669 1.744260 1.737828 1.614595 1.648294 1.210756 1.967600
4 1 2 0.971327 0.871249 4.040892 8.116715 1.986675 1.917842 1.985874 1.828281 1.646827 1.663652
5 1 2 1.021881 1.016986 2.722393 1.370178 1.689309 1.815256 2.238580 1.784470 4.181187 5.372028
7 2 0 1.630338 0.927067 4.908689 1.435851 1.905603 1.618262 1.825657 1.644884 1.832106 1.681418
8 2 0 2.039331 12.505106 9.418994 50.013155 3.403534 32.714273 3.709796 62.983098 5.371770 84.846916
9 2 0 1.529457 0.835590 5.085013 1.211254 1.815677 1.639097 2.077079 1.755023 1.862050 1.436938
10 2 1 2.566842 25.265069 11.594844 105.947269 5.446865 54.439552 6.057687 109.938512 9.670624 141.085316
15 1 3 nan nan nan nan nan nan nan nan nan nan
16 1 3 nan nan nan nan nan nan nan nan nan nan
17 1 3 nan nan nan nan nan nan nan nan nan nan
18 1 0 57.987796 20.830699 1.129847 1.192442 277.175727 89.191086 1.524711 1.668795 1.238920 1.378647
19 2 1 1.399574 9.795327 4.373034 44.909926 1.865387 31.292812 1.833105 31.572998 1.994335 62.733432
20 2 1 1.925288 0.979993 9.446395 1.948235 3.406279 1.741158 3.547948 1.778420 5.508708 2.048705
21 2 2 0.957328 0.863845 2.313235 1.272841 1.919887 1.731287 1.956998 1.844149 1.573740 1.679122
27 1 0 2.213892 3.718597 5.645052 18.367451 7.743762 5.589862 2.974774 1.973775 3.469668 1.771730
28 1 0 63.804604 0.860486 0.870224 1.512715 307.249903 1.834539 1.700421 1.826301 1.465882 2.150879
29 1 1 1.281767 1.061192 2.934832 1.311367 2.348817 1.781609 3.666913 2.848532 3.105004 2.886446
30 1 1 0.943196 0.991642 1.557529 1.862459 1.903485 1.888039 2.681654 2.472119 1.828025 3.195758
31 2 2 0.974095 1.161519 1.397389 1.460885 1.869852 2.205849 2.653572 5.522158 2.993188 8.831808
32 2 2 1.584814 2.120316 1.133344 1.261244 2.341670 2.265818 4.652556 5.080879 4.908446 7.125582
33 2 3 72.705975 0.873888 1.279254 1.674148 347.833216 1.651226 1.551802 1.866943 1.409625 1.682077
36 3 3 1.346193 1.342375 1.866268 1.356014 2.037800 1.928099 1.755888 1.631189 1.401021 1.450960
37 3 1 1.032729 0.907158 5.047635 3.555908 2.124412 1.923936 2.022372 1.896153 2.204596 2.406891
38 3 1 0.889050 1.006426 1.740868 1.501684 1.814638 2.068303 1.495019 2.082273 1.250190 1.907202
40 4 1 0.884949 0.956503 1.993653 1.297502 1.788576 1.717899 1.803387 1.744547 1.530651 2.101948
41 4 3 0.886284 1.062663 1.237080 2.077791 1.643352 1.671155 1.610109 1.637611 1.474863 1.444562
42 4 0 0.940062 0.964192 1.377113 1.371519 2.390441 2.383475 1.746944 2.152038 2.070506 4.028166
45 5 0 1.262059 0.971811 2.947366 1.567112 2.525452 1.665573 2.521368 1.960138 2.662403 1.916213
46 5 0 1.373114 1.188996 1.702873 1.390304 2.554651 1.850473 1.889513 1.789928 1.488717 1.728242
50 3 3 1.919718 0.994339 1.008259 1.061105 2.254269 1.545430 1.854818 1.597707 1.818326 1.396454
51 3 2 4.988115 0.973987 16.242706 1.547365 10.209934 1.802891 5.087455 1.750165 6.598525 2.454944
52 3 3 5.826108 1.203344 26.730915 1.712646 9.330685 1.896312 4.725836 1.833867 5.091831 2.007111
53 3 2 0.992168 1.161792 2.300094 2.608311 2.005087 2.936625 1.964036 2.674038 2.314480 3.552707
54 4 0 0.872340 0.884248 1.293431 1.017468 2.060680 1.652156 1.839598 1.554146 1.766953 1.575733
55 4 2 0.991712 1.478735 1.567545 1.400848 2.182301 1.959103 2.140318 1.828203 2.292782 1.786006
56 4 1 1.090435 1.290034 1.654685 1.803916 2.171492 2.119510 1.915772 2.007910 2.284709 3.040295
57 4 3 0.948523 1.730013 2.050369 8.476158 2.244062 1.956619 1.970884 1.937885 1.669458 2.136144
65 3 0 0.991061 0.828312 2.081681 1.345306 2.059991 1.778286 1.828486 1.624230 1.657590 1.340958
66 3 0 1.224541 0.911228 2.841040 1.471719 2.666700 1.986529 2.199254 1.582824 1.891183 1.739135
67 3 0 0.961405 0.991796 1.300244 1.403969 1.603323 1.755202 1.605568 1.582284 1.486514 1.444918
68 3 1 1.005030 0.935753 1.440584 1.590572 1.618404 1.844854 1.649192 1.842195 1.641704 2.107258
69 4 1 1.070855 0.971236 1.359867 2.177464 1.823424 2.075565 2.126235 2.251832 2.481185 2.689105
70 4 2 1.342974 1.470664 1.678462 1.586346 3.604953 2.785483 2.119076 2.982842 1.902015 2.195645
71 4 2 0.931249 1.119491 1.415072 1.430326 1.808485 1.868128 1.652286 1.656697 1.403152 1.483279
72 4 0 1.060537 1.102450 1.680121 1.355873 2.127580 2.759379 1.692800 1.689253 3.584601 3.889865
73 5 0 1.039789 1.194770 1.494242 1.178407 1.889596 1.892717 1.812834 1.676018 1.699834 1.710131
81 7 0 1.489397 1.336087 1.781797 1.626830 1.845143 2.004981 2.423498 2.092445 7.692466 3.248846
82 7 0 0.979366 0.878625 1.352679 1.173535 1.555112 1.800742 1.590665 1.799473 1.543013 1.767138
83 7 0 0.971127 1.427425 1.883634 7.506032 1.888602 3.103832 1.695169 3.053189 1.493108 6.486409
84 8 3 1.591055 1.423895 1.780244 1.873692 2.296939 2.457542 2.151555 1.918766 3.890596 3.732588
85 8 0 2.245136 0.839360 3.527176 1.357959 3.191590 1.817487 2.158563 1.637135 2.510255 1.463373
86 8 0 1.084205 1.084043 2.275072 1.602845 2.221857 1.691212 2.274318 3.032647 3.550045 3.545720
87 8 2 1.752493 1.544838 7.659725 5.520555 2.912029 3.647265 3.260810 3.346151 5.438766 7.541783
88 9 0 2.352805 7.559406 14.295527 32.255479 5.142792 23.771853 4.254373 3.291107 6.311756 2.208490
90 9 0 10.961699 4.195709 2.800208 3.193497 21.217512 11.410559 31.944602 11.589906 38.791820 21.252242
91 9 1 nan nan nan nan nan nan nan nan nan nan
92 10 0 2.042525 2.358780 0.551844 1.056173 3.263903 2.839876 2.228488 1.835894 2.072266 2.298283
93 10 0 1.061068 0.888151 1.642419 1.394330 1.863852 1.902324 1.710231 1.626328 1.584503 1.798753
94 10 0 0.889461 1.196926 1.402002 2.587555 1.950241 2.837077 2.040977 2.878159 2.396194 11.226471
98 7 2 1.072919 0.947161 1.859426 1.442126 2.133652 1.849689 2.069109 1.619870 3.429158 1.524489
99 7 2 0.942004 1.024000 1.435949 1.758659 1.824944 2.194640 1.621894 1.775578 3.409319 6.027233
100 7 1 1.373091 1.088136 2.132028 1.804439 2.577865 1.936573 1.825317 1.699522 1.692022 1.604099
101 8 2 2.002359 15.344358 8.046361 68.154268 2.917832 31.236828 3.191030 22.681698 5.076425 62.895205
102 8 0 0.875383 1.036772 1.605519 4.642967 1.798412 1.761420 1.726652 1.985797 1.628623 1.891355
103 8 1 1.321208 0.872349 1.963720 1.609691 1.978680 1.850792 1.755356 1.827308 2.174529 1.711771
104 8 1 1.654229 1.278848 0.469478 1.403811 2.662858 1.756845 3.883913 1.726439 3.382125 1.354465
105 9 1 nan nan nan nan nan nan nan nan nan nan
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 7.476168 31.736364 26.660927 228.129626 8.279018 22.573271 10.210575 82.544842 19.014029 158.248773
108 9 1 nan nan nan nan nan nan nan nan nan nan
109 10 1 1.617094 1.520447 1.609126 1.388279 3.575864 2.503315 1.790677 1.798561 1.591871 1.729581
110 10 1 0.991439 1.544063 1.939901 3.714244 2.484049 2.662162 1.833636 2.364846 1.500141 1.739578
111 10 1 0.996850 1.131958 1.861395 1.279199 2.354787 1.867043 1.992584 1.507944 1.627090 1.405303
112 10 2 0.856171 0.995605 1.297359 1.563779 1.764964 1.989683 1.675151 1.678422 1.549213 1.562983
116 7 2 0.778541 0.802498 1.285028 1.206007 1.643178 1.713328 1.664325 1.596598 1.712345 1.481103
117 7 3 0.967262 1.084026 1.711171 1.614224 1.786510 1.857709 1.683280 2.675045 1.937143 3.978786
118 7 3 0.991875 0.984870 1.474266 1.664232 1.575602 1.785112 1.628807 1.883963 1.467946 2.748088
119 7 1 1.126627 0.818594 1.430160 1.597897 2.149558 1.749803 2.406421 1.667881 9.207389 2.021885
120 8 1 6.201012 1.474039 11.561315 2.090377 7.279573 2.646789 9.216767 1.653727 26.096320 2.126903
121 8 3 1.446173 1.697964 2.520149 1.642994 3.412782 5.721077 2.488878 2.391757 2.898877 15.533738
122 8 2 2.878898 1.819837 8.584982 3.714228 6.610359 3.428520 5.678475 3.746635 7.877594 8.625802
123 8 3 1.422861 1.294391 1.670861 1.476998 1.724511 1.756197 1.562692 1.556124 1.467105 1.477317
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 1.020859 0.985393 2.059488 1.288252 2.086846 1.914788 2.046263 2.042896 1.786711 2.607521
128 10 2 0.892275 0.982595 1.442936 2.095703 1.899861 2.244607 1.882943 1.857161 1.741753 3.433114
129 10 3 0.885555 0.852116 1.420486 1.384423 1.645403 1.810838 1.537347 1.779179 1.392543 1.689128
130 10 3 1.057997 0.921040 2.290270 2.551743 2.202783 2.011076 2.093080 1.655395 2.343154 2.335061
135 12 2 0.827300 0.843243 1.685059 1.354182 1.730914 1.724536 1.560336 1.764449 1.397735 1.236688
136 12 2 1.202873 1.076065 2.594204 1.307366 2.056119 1.673373 3.332096 1.930878 2.013265 2.475776
137 7 3 3.463373 3.951853 2.928923 17.958720 10.892077 6.519510 4.153555 2.690843 6.584682 2.128035
138 7 1 0.965133 4.792833 1.654782 5.105855 2.174817 5.010293 2.038212 2.992223 7.172805 5.712744
140 13 2 1.068289 0.912449 1.235417 1.776233 1.660217 1.713130 1.617585 1.644905 1.650411 2.028651
141 13 2 7.630225 1.122891 18.591290 1.482735 25.508969 2.099447 15.854981 1.517820 12.119138 1.573131
142 13 2 5.303210 1.440436 7.128524 1.551874 5.248011 2.513474 2.668265 1.895051 4.083668 4.129634
143 14 2 0.959171 0.872301 2.252267 1.294015 2.107184 1.657401 2.136800 1.877853 1.803794 2.163021
144 14 3 1.114749 1.049455 1.233739 1.336727 2.110294 1.695713 1.547333 1.515092 1.711179 1.615609
145 14 3 3.192634 4.500710 22.753470 19.117291 20.160350 17.848469 3.136448 1.885061 2.992846 1.946774
150 15 1 2.715495 6.085879 18.691149 42.929037 4.220312 11.017032 3.669178 7.692363 5.010377 11.940908
155 12 2 2.937487 2.200765 9.171815 22.157384 4.292559 3.471258 3.236216 2.679857 3.554552 1.987616
156 12 3 2.063858 4.171654 9.596330 15.341951 4.628418 5.686786 4.359767 29.621005 5.440483 35.671229
157 12 3 1.959048 1.855068 8.715160 4.247149 4.267322 2.949537 4.177999 13.246310 5.365130 16.313908
158 12 3 1.716766 1.219024 7.016448 2.431981 3.541934 2.457886 3.388021 2.583640 6.439534 5.338340
160 13 3 5.104330 3.799075 10.764971 25.277097 6.283924 7.906787 3.606343 3.958108 3.184588 3.355894
161 13 0 2.242731 1.380244 1.981499 1.365847 4.010643 1.926911 2.559215 1.711678 3.275626 2.331742
162 13 0 0.969898 1.015511 1.464558 1.261850 1.912411 1.622262 1.904559 1.541059 1.363320 1.345230
163 14 2 0.967048 1.045670 1.668840 1.435041 1.728515 1.793540 1.744524 1.757463 1.532695 2.290923
164 14 2 0.878130 0.932619 1.449093 1.556186 1.884376 1.852665 1.748411 2.212964 1.548666 1.911531
165 14 0 4.511567 6.193785 6.369432 7.382298 15.831493 15.291360 3.471846 5.250656 9.871242 3.497767
166 14 0 1.075459 1.032643 1.764990 1.707738 2.275139 2.284699 1.978651 2.828580 2.144359 2.348201
167 15 1 2.052198 1.279388 3.136264 1.701742 2.747103 1.983958 3.000927 2.044147 3.725468 2.338638
168 15 2 1.817661 1.290401 7.008606 4.224895 3.870929 2.364676 4.553531 3.808149 6.991059 4.053069
169 15 2 1.927601 6.817745 8.345805 35.737746 3.212330 3.545391 4.144758 6.545679 7.472291 12.189990
170 15 2 2.448366 10.353363 10.483077 52.340653 5.097781 10.555952 6.101919 11.666100 10.266933 21.040201
176 12 0 0.805295 0.918250 1.281313 2.308874 1.625599 1.791087 1.854609 1.780413 1.481321 1.848150
177 12 0 0.914299 1.027605 1.553782 1.465534 1.757107 1.747511 1.666426 1.689620 1.582156 1.558393
178 12 0 0.894323 0.943380 1.589401 2.082179 1.747678 1.770972 1.755300 1.779811 1.453474 1.809595
179 12 1 1.376596 0.717886 1.441241 1.700238 2.053129 1.662504 4.066625 2.155753 2.231562 1.988015
180 13 3 1.939266 1.108504 12.362238 1.384896 4.744592 2.158182 3.081445 1.712306 2.927897 1.590999
181 13 3 1.117893 5.040114 1.395275 12.271676 3.489102 7.231327 2.002104 1.872681 2.514478 1.968430
182 13 0 1.290684 1.554020 1.949978 3.285771 2.505868 3.910305 2.029761 2.897710 2.798201 4.859351
183 13 1 0.978781 0.987620 1.450995 1.444284 2.338540 1.683189 1.718725 1.560684 1.659482 1.847477
184 14 0 0.804762 0.863286 1.575813 1.207510 1.686788 1.457384 1.933130 1.378538 1.579140 1.510727
185 14 1 0.874981 1.004996 1.240000 1.974570 1.614741 1.513380 1.706638 1.903779 1.620493 1.265994
186 14 1 0.863325 0.785602 1.557915 1.824525 1.881631 1.536691 1.581988 1.431791 2.152877 1.523477
187 14 1 1.478495 1.524371 5.307345 4.000278 2.809364 2.420677 4.122291 4.499812 13.257070 16.719222
189 15 3 1.009066 1.097656 1.899449 1.196429 1.903861 1.639346 1.463656 1.392861 1.595206 2.277203
190 15 3 3.224529 2.623640 13.122238 1.053242 4.998507 3.268254 3.452911 2.333469 3.186805 3.948657
191 15 3 0.901819 0.856768 1.225429 1.424137 1.771200 1.947468 1.700703 2.084176 1.680068 1.661971
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.440151 0.936635 4.190304 2.046188 3.816895 1.747741 2.700872 1.922931 2.033935 1.880977
206 19 0 1.180869 1.006914 1.841453 1.971403 1.982297 1.701928 2.312809 1.781050 2.225241 1.634523
207 19 1 0.806573 0.902298 1.822526 1.778129 1.681217 1.631250 1.806388 1.595976 1.820291 1.739754
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.952861 0.845616 1.933485 1.657100 1.801569 1.557337 1.645729 1.746582 1.710867 1.606687
224 19 1 1.251451 0.993981 5.110282 2.872668 2.344159 1.996005 4.284881 2.594923 8.357962 4.420368
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 4.261808 4.827229 9.232098 26.215383 6.770709 7.710003 6.151936 3.013565 5.890331 13.216920
321 2 3 0.826132 0.906638 2.033891 2.346844 1.795050 1.717118 1.751270 1.758348 1.604260 1.760213
323 2 3 1.078962 1.073661 2.144035 3.892882 1.668043 2.253328 1.700041 1.773900 1.820505 1.876405
324 4 3 1.367706 1.317944 4.305265 1.662684 1.677516 1.840499 1.752966 1.529097 1.922005 1.566465
329 12 1 0.995992 2.428376 5.927819 29.989713 1.698938 1.627910 1.787167 1.767918 1.612063 1.722658
333 12 1 1.063067 1.230112 2.456875 2.038592 2.026487 4.348656 1.619673 1.678793 1.500386 1.610077
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 [ ]: