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 = 2459793
Date = 8-1-2022
data_path = "/mnt/sn1/2459793"
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 2459793.25302 and 2459793.33602
372 diff files found between JDs 2459793.25302 and 2459793.33602

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.160781 0.856146 1.333617 1.282804 1.704651 1.799310 1.684775 1.719850 1.400132 2.026512
4 1 2 0.870322 1.413574 2.516926 3.467080 1.729513 2.482529 1.518545 1.696720 1.896456 2.236538
5 1 2 0.855432 1.014402 1.546089 1.320124 1.691329 1.840329 1.771645 1.608875 4.219826 5.258839
7 2 0 0.963271 0.861781 1.278278 1.328036 1.574131 1.773293 1.672652 1.677086 1.687969 1.756317
8 2 0 2.165841 29.041607 6.006867 90.758164 4.742350 104.084976 4.706524 93.626609 4.423361 124.037713
9 2 0 0.811941 0.834334 2.227359 1.190268 1.549524 1.811297 1.677485 1.754315 1.717180 2.008698
10 2 1 1.078286 0.991046 2.523150 1.645806 2.378496 2.029399 2.323663 2.082563 2.779803 2.018635
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 79.497243 23.469101 1.366313 1.226051 386.916163 99.228798 1.697422 1.595732 2.044576 1.716125
19 2 1 0.924492 0.963539 1.497930 1.830222 1.702572 1.791029 1.810823 1.973784 2.251562 6.041457
20 2 1 0.826847 0.803234 1.220863 1.191561 1.466609 1.644363 1.570721 1.570047 1.427916 1.728611
21 2 2 0.930667 0.812846 1.153147 1.186154 1.715759 1.715583 1.487667 1.638712 1.450741 2.623433
27 1 0 4.562621 4.074318 7.530045 17.991799 11.698248 6.195536 2.458762 1.974594 4.078311 1.946114
28 1 0 67.333076 0.810477 0.789711 1.391804 299.082378 1.986037 1.702473 1.664784 2.040812 3.518026
29 1 1 0.959605 0.926467 1.556783 1.360056 1.913360 1.762807 2.161667 2.175998 2.485067 2.910771
30 1 1 0.943948 0.907635 1.358651 1.265412 1.708463 1.723466 2.251929 2.346321 1.886109 3.014520
31 2 2 0.877075 1.099474 1.390752 1.391551 1.774871 2.416390 2.822521 6.725171 3.121814 9.527181
32 2 2 1.064814 1.550246 0.955300 1.147862 1.884990 2.381717 3.464593 4.636308 3.496879 5.274297
33 2 3 93.323132 0.978676 1.241083 1.353028 432.186061 1.728524 1.595852 1.779499 1.756768 1.938571
36 3 3 1.271724 1.521735 1.920645 1.712098 2.074556 1.856134 1.902196 1.368371 1.887797 1.938615
37 3 1 0.964738 0.948929 4.049276 2.133506 2.099183 1.877320 1.838428 1.852685 2.344813 3.446197
38 3 1 0.882716 1.038416 1.491919 1.270469 1.705939 2.232399 1.481748 2.328108 1.626031 2.210612
40 4 1 0.957967 0.883834 1.696355 1.436148 1.847643 1.971927 1.586258 1.820908 1.583848 2.247280
41 4 3 0.778253 1.057569 1.348731 1.821256 1.818175 2.061030 1.660776 1.626121 1.421967 1.576743
42 4 0 0.935341 1.003866 1.241250 1.375629 2.151283 2.382807 1.809775 1.891827 1.915078 3.899710
45 5 0 1.745119 0.901943 4.901473 1.445340 5.369440 1.605697 3.362211 1.478750 2.980146 1.913574
46 5 0 1.181975 1.101401 1.353252 1.127932 2.622559 1.965310 1.611576 1.638811 1.740440 2.208428
50 3 3 1.465124 0.958439 1.805797 1.116020 2.016968 1.597959 1.773099 1.686243 1.800875 1.509856
51 3 2 4.512159 0.970720 17.505159 1.836714 9.644140 2.012246 5.013028 1.813728 6.374504 2.162818
52 3 3 8.768347 1.134030 27.753339 1.552133 8.400230 1.754542 4.205356 1.648182 5.289128 2.167912
53 3 2 0.830741 1.068293 1.782300 2.097826 1.962263 2.587818 1.778281 2.408976 2.163938 3.344726
54 4 0 0.892268 0.880282 1.311157 1.226894 2.233452 2.055851 2.029940 1.834225 2.338540 2.920184
55 4 2 0.922248 0.828831 1.466282 1.275161 1.740368 1.715321 1.990715 1.769224 2.016047 1.917945
56 4 1 1.087028 1.121699 1.416407 1.436942 1.965368 1.876834 2.076736 1.968289 2.325214 2.476836
57 4 3 0.960450 1.782503 1.620046 7.258602 2.048275 1.736734 1.693058 1.614243 1.662482 2.548400
65 3 0 1.121545 0.805746 2.618604 0.955007 2.636975 1.672037 2.186526 1.426735 2.164051 1.582957
66 3 0 1.226138 0.871448 2.805459 1.498912 2.602230 1.818877 2.138224 1.572919 1.874183 1.845067
67 3 0 0.813998 0.917055 1.427674 1.533980 1.943144 1.843657 1.674648 1.662189 1.764529 1.897601
68 3 1 0.926210 0.944731 1.286525 1.431091 1.735051 1.862408 1.528933 1.820664 1.642123 2.327312
69 4 1 1.081931 0.931997 1.297392 1.499887 1.966974 1.924204 1.933398 1.940124 2.002089 2.475446
70 4 2 1.214662 1.416223 1.546195 1.515787 2.326510 2.322825 2.269333 3.234753 2.188766 2.373541
71 4 2 1.132006 0.983961 1.320154 1.272873 1.811898 1.693803 1.628989 1.564547 1.588095 1.596652
72 4 0 0.985365 0.959387 1.676421 1.342642 1.945028 1.984980 1.606988 2.010310 2.927398 3.813288
73 5 0 1.115745 0.992166 1.594910 1.301105 2.056592 1.966049 1.805766 1.824076 1.952766 2.614380
81 7 0 1.263868 1.058388 2.162284 1.386268 2.168131 1.708609 2.285112 1.483362 8.319182 3.622096
82 7 0 0.938147 0.927457 1.443233 1.032334 1.788966 2.017923 1.716625 1.666718 1.878203 1.945801
83 7 0 0.909987 0.889278 2.632804 1.350321 1.854676 1.726022 1.867399 1.832249 2.199362 2.140860
84 8 3 1.283302 1.166707 1.619764 1.674337 1.813117 1.943149 1.745547 1.726729 3.161408 2.779193
85 8 0 0.833965 0.869761 1.961420 1.246248 1.820962 1.824523 1.851132 1.833426 2.401650 2.502069
86 8 0 0.865384 0.825799 1.469600 1.693922 1.733425 1.700549 1.886840 1.717827 1.814246 2.218293
87 8 2 1.129409 1.087088 1.389318 1.463979 1.624103 1.908360 1.581264 2.701443 2.091836 3.055134
88 9 0 2.060951 7.823256 13.860776 33.040180 6.080211 28.482576 4.182266 3.905428 7.042649 2.393142
90 9 0 9.606217 6.780363 4.729840 11.615071 26.812789 16.628191 15.656861 7.479189 31.056841 19.871204
91 9 1 3.198739 6.527120 12.386365 5.733343 4.665381 14.783650 5.758403 4.177240 7.205928 2.721893
92 10 0 3.156508 2.028289 0.762544 1.195086 3.402227 2.902680 2.737613 2.039297 3.039564 2.869282
93 10 0 1.052643 0.779235 1.203047 1.294740 2.064433 1.687691 1.872336 1.626786 2.210631 1.847981
94 10 0 0.887360 1.120489 1.361240 2.329704 1.801834 2.427830 1.945276 2.196779 1.759925 17.499666
98 7 2 3.147332 0.981293 1.712820 1.766975 6.776245 1.764360 18.393554 2.092859 92.678261 3.367915
99 7 2 0.945310 1.493078 1.713590 1.896934 1.975469 2.329724 1.874621 2.107397 3.860179 21.653889
100 7 1 0.972821 0.817344 1.187066 1.291989 1.750847 1.784340 1.617123 1.567836 1.709753 1.769712
101 8 2 1.271979 1.511958 1.460965 1.523771 1.820884 2.155322 1.790171 2.025718 1.788625 2.776971
102 8 0 0.782032 1.982903 1.999323 11.847195 1.704155 1.971830 1.738053 4.197429 2.054114 5.974535
103 8 1 1.258280 0.824078 1.713132 1.512265 1.874799 1.837044 1.731787 1.531295 1.910560 2.064264
104 8 1 1.834620 1.190915 0.397447 1.337048 2.459800 1.743041 3.208361 1.508510 3.549300 1.682141
105 9 1 1.984934 2.314493 16.760392 6.823151 3.219781 7.548365 5.125789 2.411119 9.952846 2.709396
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 3.837399 7.753594 14.319623 59.922648 6.731782 5.423720 4.294170 16.065560 8.422878 24.174891
108 9 1 1.120516 1.459046 1.669508 1.516413 3.038006 2.912254 1.524985 1.883506 1.790409 2.015262
109 10 1 2.108537 1.921627 1.478880 1.176725 6.241414 6.365865 1.626670 1.586306 1.645379 1.779365
110 10 1 0.870709 1.357707 1.431298 1.365872 1.842806 2.903767 1.445932 2.553803 1.404564 1.872545
111 10 1 0.956095 1.136495 1.644127 1.218866 2.028723 2.064283 1.737383 1.664061 1.631821 1.679053
112 10 2 0.880054 2.184809 1.268375 3.504013 1.640284 3.180627 1.698214 1.910407 1.529138 1.781280
116 7 2 0.871950 0.784451 1.785912 1.158039 1.820944 1.642244 1.762608 1.660435 2.588937 1.970069
117 7 3 0.980678 1.161766 1.514584 1.777298 1.784315 2.057438 1.849300 2.871162 2.476789 4.723892
118 7 3 0.941675 1.000301 1.353232 1.503827 1.796676 1.800849 1.597036 1.686769 1.687288 3.430448
119 7 1 0.936904 0.770001 1.287881 1.397667 2.042213 1.607998 1.804854 1.780871 3.798777 1.950632
120 8 1 6.471544 1.174026 10.919887 2.470643 7.128756 2.136910 8.871871 1.525991 25.558129 2.384091
121 8 3 1.504412 1.317136 1.718437 1.678782 3.918872 4.565835 2.270301 2.516656 2.742944 6.475239
122 8 2 2.030619 1.666809 1.668292 1.349887 3.869474 2.403419 3.050160 2.953203 5.593695 6.283508
123 8 3 1.553182 1.233471 1.699510 1.530141 1.897168 1.789988 1.830836 1.591828 2.153904 1.936349
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.463698 1.511535 2.186493 1.167309 3.130243 3.730686 3.699941 2.988830 4.534787 4.460381
128 10 2 0.807858 0.969382 1.364648 1.537047 1.709268 1.783010 1.640198 1.891379 1.977513 2.441637
129 10 3 0.924625 0.846466 1.399093 1.289439 1.649994 1.725242 1.660236 1.584521 1.548479 1.514127
130 10 3 1.154661 0.969509 2.080607 1.773616 2.398731 1.768557 2.284289 1.709572 2.136269 2.221653
135 12 2 0.934801 0.994585 1.377038 1.326563 1.864959 1.908625 1.785350 2.030966 1.812127 2.244813
136 12 2 0.971271 0.953969 1.388338 1.406502 1.726551 1.644966 3.000566 1.853826 2.231210 1.638941
137 7 3 3.379772 3.538238 3.308900 18.393367 9.920442 5.514142 3.379517 2.467182 5.544723 2.112680
138 7 1 0.992950 6.305491 1.451162 4.991197 2.017006 5.859021 1.874430 3.138803 5.247633 5.471437
140 13 2 0.994297 0.974590 1.326525 1.859614 1.636115 1.880058 1.554540 1.650498 1.549956 2.467623
141 13 2 6.991007 1.104057 14.460658 1.443156 22.822570 2.009705 11.969679 1.625092 10.138463 1.741848
142 13 2 5.081740 1.350670 7.174395 1.558857 5.722509 1.992333 2.855095 1.642665 3.784676 3.155206
143 14 2 0.894594 0.830099 2.076070 1.198144 2.086182 1.622274 1.801326 1.635924 1.755907 2.012613
144 14 3 1.276814 1.115757 1.449872 1.377982 2.170361 1.871305 1.702748 1.576266 1.643076 1.728269
145 14 3 3.639964 6.328962 21.864175 21.039345 18.756046 21.955768 3.167841 1.887261 2.818530 1.979572
150 15 1 2.391236 5.814440 21.089480 38.947091 3.673229 10.299651 3.121964 2.290239 2.713500 1.874893
155 12 2 1.968403 3.307682 7.472173 20.250888 2.325358 3.895046 3.148204 2.753624 3.520271 2.090530
156 12 3 1.277724 1.117055 1.416449 1.491635 2.221209 2.357496 1.682928 1.895803 1.425146 1.795803
157 12 3 1.148157 0.914642 1.585827 1.179003 2.029366 1.880785 1.652723 1.463006 1.799907 1.707459
158 12 3 1.081678 0.888984 1.918242 1.355489 2.723632 2.118073 2.024653 2.088747 2.616376 3.779432
160 13 3 nan nan nan nan nan nan nan nan nan nan
161 13 0 1.788705 1.043045 3.118824 1.323423 4.975068 1.997509 2.834853 1.734136 3.133795 2.826558
162 13 0 0.905546 0.934391 1.058475 1.324819 1.639461 1.757507 1.542169 1.718044 1.347066 2.106591
163 14 2 0.909953 1.005526 1.487883 1.485257 1.757359 1.872842 1.851343 1.716002 1.874071 2.985623
164 14 2 0.884853 0.889235 1.367776 1.407463 2.066773 1.862693 1.818990 2.599925 1.508844 2.166752
165 14 0 1.767716 1.938725 1.853588 2.776328 4.810811 4.419237 2.115515 2.464550 3.323009 4.635822
166 14 0 0.886627 1.007044 1.511327 1.481905 2.219913 1.952983 1.834383 2.287399 1.489136 1.689165
167 15 1 1.757061 3.165487 2.255577 12.731832 3.693761 3.034201 3.307224 3.067175 2.654634 2.114184
168 15 2 1.802865 1.630580 5.021566 4.750672 3.590594 2.352690 4.948535 6.692711 8.002919 7.066564
169 15 2 1.607187 14.571438 3.984331 67.265189 3.955190 31.783060 4.265040 27.197214 3.364115 42.624129
170 15 2 2.043491 17.012520 4.743282 79.285857 4.860102 45.805615 4.825810 36.248699 4.611057 59.702585
176 12 0 0.832939 0.859132 1.333847 1.406197 1.823526 1.847885 1.805986 1.734053 2.024556 1.960206
177 12 0 0.837906 1.039589 1.886837 1.265913 1.680691 1.686029 1.603234 1.614492 2.213636 1.777114
178 12 0 0.828902 0.831213 1.374886 1.209487 1.792159 1.817147 1.718888 1.640953 1.928481 1.687283
179 12 1 1.315453 0.785592 1.246584 2.434319 2.050418 1.671476 3.112165 1.888521 2.391651 2.024673
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.578675 1.809344 3.642704 3.759286 4.185817 5.535554 3.060670 4.231876 4.649114 6.935043
183 13 1 0.929705 0.915122 1.494497 1.549646 1.907068 1.662229 1.668720 1.698841 1.999978 2.027057
184 14 0 0.902781 0.809671 1.359209 1.396315 1.880883 1.691388 1.730528 1.917394 2.340179 3.625928
185 14 1 0.907297 1.040960 1.266784 2.260807 1.990455 2.063692 2.074531 2.988855 2.546745 2.628505
186 14 1 0.846103 0.923719 1.293047 1.463499 1.775928 1.793221 1.753965 1.759255 2.363416 2.488987
187 14 1 0.857562 1.044844 1.546350 2.120946 2.044346 2.485053 2.235536 2.643263 2.611734 4.954459
189 15 3 1.008910 1.057099 1.389045 1.455607 1.802528 2.028253 1.490711 1.744460 1.457486 1.978940
190 15 3 2.991900 1.996147 12.044902 1.269709 5.443781 2.445498 3.198764 2.244914 3.252299 3.155935
191 15 3 1.943004 1.005229 2.881978 1.884410 1.878978 1.762176 1.643569 1.631447 1.731836 1.707948
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.636858 0.945075 5.192729 1.569694 4.900649 1.683732 3.309284 1.647775 2.741372 1.885695
206 19 0 1.284939 1.069465 2.306342 2.130188 2.190903 1.894920 2.183110 1.760489 2.153979 1.490421
207 19 1 0.977529 0.902036 1.918488 1.737630 1.856039 1.895896 1.669310 1.776780 1.780737 1.790592
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.009876 1.025285 1.760966 2.050369 1.568870 2.023736 1.525865 1.687795 1.540078 1.798495
224 19 1 1.048690 4.177656 2.733652 9.003131 2.262022 19.704115 4.071332 16.417281 4.369260 20.807125
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.364627 4.360235 13.189142 32.543019 7.799521 7.681474 8.365598 5.935214 10.569620 17.421135
321 2 3 1.842439 0.948783 1.791763 2.381268 2.356171 1.606472 1.850565 1.734309 1.785900 1.899888
323 2 3 1.034068 1.244114 2.207425 3.370086 1.635788 3.002674 1.723010 1.640812 1.720823 1.860144
324 4 3 0.985153 1.130183 2.067560 1.672292 2.267831 2.391925 1.833253 1.692194 1.649745 1.806907
329 12 1 0.854762 1.665127 2.003156 6.169736 1.652055 1.711768 1.911238 1.647868 1.956222 2.107179
333 12 1 1.819404 0.960497 7.298171 1.565313 2.074909 2.405369 3.003781 1.617868 2.861584 1.690341
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 [ ]: