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 = 2459752
Date = 6-21-2022
data_path = "/mnt/sn1/2459752"
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 2459752.25299 and 2459752.33598
372 diff files found between JDs 2459752.25299 and 2459752.33598

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 171.841503 95.423187 471.978101 243.672942 4.363478 7.234213 3.390954 16.615737 1.318745 27.005637
1 0 0 143.209804 88.756586 312.062329 234.224499 2.954425 2.984189 1.365266 3.046490 1.390579 1.936846
2 0 0 97.187878 83.296917 225.183739 204.899840 2.439689 3.734320 2.608319 9.398008 2.135120 3.115616
3 1 2 nan nan nan nan nan nan nan nan nan nan
4 1 2 nan nan nan nan nan nan nan nan nan nan
5 1 2 nan nan nan nan nan nan nan nan nan nan
7 2 0 1.003531 0.887442 1.858572 1.766139 2.047441 1.876840 1.706550 1.855348 2.109257 2.355335
8 2 0 2.294758 28.082354 6.889397 119.784446 6.192508 82.391694 4.914373 40.574263 9.127721 126.695165
9 2 0 0.830639 0.782110 1.629561 1.595391 1.591050 1.770991 1.890181 1.944327 2.102664 1.852022
10 2 1 0.841616 3.831439 1.777731 7.105054 1.620977 1.819020 1.881950 28.144499 2.530565 37.736101
11 0 1 88.690382 331.782569 256.566624 556.031008 16.452392 184.173732 28.545019 798.765105 13.402602 1066.456420
12 0 1 156.476624 245.044594 432.045008 915.596140 113.808129 148.552468 45.080136 759.444102 423.053095 913.301576
13 0 1 117.028369 187.448644 251.676132 452.965134 35.468527 86.443507 10.590770 433.651760 184.342494 652.575990
14 0 2 116.109503 140.633487 424.981560 1846.944062 28.475187 105.294673 27.393748 120.307755 79.879605 855.865777
15 1 3 1.204924 1.044696 1.756319 1.517012 2.152430 2.098548 2.539960 2.262230 11.468179 10.541464
16 1 3 1.125844 1.085091 1.961222 1.588475 2.122036 2.290891 2.191115 2.486418 10.065216 7.647575
17 1 3 1.182384 0.917361 1.793721 1.761754 1.767673 1.908399 1.620139 1.952669 1.815184 3.741477
18 1 0 31.366208 1.874693 1.193702 1.411786 118.297853 5.665479 1.330432 1.812748 1.789852 1.748726
19 2 1 1.378254 0.917632 3.689882 1.716004 3.559033 1.576356 3.385497 2.003839 5.876335 4.679951
20 2 1 0.833136 0.810198 1.762452 1.465948 1.517707 1.566383 1.577009 1.595194 1.880168 1.921403
21 2 2 1.087665 1.000045 1.610927 2.046487 2.038224 1.881270 2.002331 4.231710 2.023004 6.059610
23 0 2 86.532093 95.534192 238.927652 253.685471 7.218698 12.482169 1.656789 4.502647 1.993529 6.179356
24 0 2 70.481254 141.442337 180.036632 363.518376 1.748752 4.119796 0.878460 1.388136 0.902887 1.267537
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 0.000000 3258.412968 0.000000 0.000000 0.000000 1784.653491 0.000000 0.000000
27 1 0 49.405425 161.730793 1.112480 5.450756 185.830160 582.212078 1.652618 1.794671 2.214083 1.883260
28 1 0 0.889756 54.101359 1.493143 1.399096 1.704772 210.953551 1.821242 1.799972 2.119439 2.239788
29 1 1 1.099618 0.987417 2.115215 1.597010 2.082818 1.666407 2.863597 2.420243 3.953677 2.590206
30 1 1 1.139161 0.931574 1.967102 1.824093 1.964922 1.737491 2.476533 3.232716 5.864314 5.439141
31 2 2 0.927529 0.901911 1.580068 1.760911 1.788597 1.843046 1.870394 2.486166 1.985609 3.116868
32 2 2 1.657508 2.120192 2.046622 1.566237 2.959527 3.284537 7.934314 12.535927 12.062750 14.544504
33 2 3 31.658753 0.856932 1.979415 1.721926 148.547240 1.901942 1.886510 2.030851 2.447208 2.534234
36 3 3 1.280862 1.230893 1.843387 1.676917 1.810487 2.058711 1.937414 1.959470 1.902706 2.466002
37 3 1 0.928256 0.791724 1.975850 1.407536 1.975550 1.664039 2.066300 2.006667 6.070233 4.757485
38 3 1 0.987530 1.187023 1.852883 1.429003 1.736818 2.311319 2.281639 2.582866 2.338487 2.467978
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.852327 0.927568 1.894153 1.830855 2.017489 2.027142 1.938141 2.271321 2.171260 2.957253
41 4 3 0.889574 1.050677 1.681945 1.759761 1.770691 2.615121 1.892467 1.948480 1.797162 1.884644
42 4 0 0.880832 0.843116 1.568601 1.567462 1.598846 1.689629 1.648576 1.952368 11.300368 13.132229
45 5 0 3.099193 0.897595 17.871876 1.846123 4.550627 1.855722 3.416739 2.046249 3.161343 2.272398
46 5 0 1.240117 0.991306 2.006065 1.701661 3.112665 2.103394 1.899975 2.366586 2.148436 2.651753
50 3 3 1.124731 0.824788 1.693209 1.675817 1.880608 1.871569 2.181042 1.966423 2.997412 2.276660
51 3 2 nan nan nan nan nan nan nan nan nan nan
52 3 3 1.653837 1.243246 1.945925 1.521014 2.291845 1.707129 2.463460 1.872765 3.580317 2.833621
53 3 2 nan nan nan nan nan nan nan nan nan nan
54 4 0 1.156904 1.282744 1.942986 1.764091 2.588673 2.043599 2.117382 2.508653 2.613616 3.226919
55 4 2 nan nan nan nan nan nan nan nan nan nan
56 4 1 1.074891 0.837347 1.809036 1.715119 1.710603 1.861101 1.650951 1.815532 1.903432 2.046956
57 4 3 0.959327 0.863820 2.374076 1.301022 2.253262 1.761173 1.978212 1.784882 2.349099 1.965446
65 3 0 1.309715 0.841064 3.171037 1.710247 2.809527 1.976627 2.517460 1.916785 3.199390 2.637824
66 3 0 1.151936 10.026248 1.876131 37.439369 1.884583 30.407401 1.923604 13.730416 2.843684 48.924881
67 3 0 0.996533 0.829168 1.835749 1.690362 1.739943 2.027767 1.804544 1.820727 1.844285 1.976040
68 3 1 1.018670 0.794348 1.572135 1.462572 1.598356 1.533541 1.605004 1.652122 1.716195 1.909930
69 4 1 0.876973 0.895257 1.617077 1.876557 1.676911 1.635839 1.545949 1.820980 2.159383 2.076252
70 4 2 nan nan nan nan nan nan nan nan nan nan
71 4 2 nan nan nan nan nan nan nan nan nan nan
72 4 0 0.986702 1.031531 1.880663 1.780510 2.013170 2.324507 1.855486 2.161725 5.347257 4.779842
73 5 0 1.037754 1.093869 1.445315 1.604447 1.981778 1.842239 1.906451 2.336927 4.401743 7.214551
81 7 0 1.163441 0.853505 2.025805 1.634253 1.916853 1.666710 2.357415 1.824621 9.877269 5.125227
82 7 0 1.013759 0.847098 1.771303 1.589275 1.868570 1.935695 1.676368 1.724056 3.710214 3.561450
83 7 0 2.839067 5.175936 11.603812 16.238104 3.228522 14.950126 4.004576 2.186912 4.905005 2.035076
84 8 3 1.345925 1.112250 1.812872 1.752022 1.846280 1.950736 1.900447 2.336604 11.421806 15.295607
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.962696 2.116710 3.823993 1.488132 4.318941 3.521182 5.914232 17.000668 13.373947 14.931298
88 9 0 nan nan nan nan nan nan nan nan nan nan
89 9 2 nan nan nan nan nan nan nan nan nan nan
90 9 0 nan nan nan nan nan nan nan nan nan nan
91 9 1 nan nan nan nan nan nan nan nan nan nan
92 10 0 2.448778 1.850317 9.130629 9.151813 3.207186 2.698454 2.343666 1.927214 3.450182 1.879102
93 10 0 4.173322 1.876519 9.940883 2.043130 7.564141 1.758182 4.182973 1.897826 3.761889 2.191128
94 10 0 0.956545 1.031296 1.626891 1.783060 1.843721 2.015806 2.813501 3.786280 3.906704 5.150180
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 4.505235 9.563350 18.832509 14.904579 9.539919 30.281210 3.997045 2.375889 4.487804 4.177078
101 8 2 1.632358 1.360060 1.690518 1.865265 1.887897 2.869456 1.847576 2.114459 2.315430 2.850724
102 8 0 nan nan nan nan nan nan nan nan nan nan
103 8 1 1.217286 0.842375 1.818979 1.576264 1.778823 1.931679 1.804328 2.078691 2.829813 2.683739
104 8 1 1.145037 1.161809 1.880196 1.714145 1.649856 1.815745 1.737756 1.631685 2.526401 2.204151
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 nan nan nan nan nan nan nan nan nan nan
108 9 1 nan nan nan nan nan nan nan nan nan nan
109 10 1 2.911507 2.556283 1.974996 1.763741 9.801233 10.067685 1.854128 1.821442 2.110771 1.791158
110 10 1 2.497565 0.816933 3.100541 1.611346 3.724266 1.751544 3.856440 1.742566 2.913637 1.836435
111 10 1 0.948168 0.908237 1.775976 1.705148 1.878481 1.959861 1.806785 1.876800 1.926634 1.692317
112 10 2 2.444184 0.943413 7.982151 1.663919 6.111202 1.865027 3.699382 2.715924 4.602641 3.216508
116 7 2 nan nan nan nan nan nan nan nan nan nan
119 7 1 2.037554 2.624648 2.191511 18.553282 7.179065 5.727473 2.688105 1.864224 6.280277 2.290595
120 8 1 5.398164 1.906259 8.253427 1.909406 6.045835 2.515819 7.676374 1.927313 22.475745 2.748098
121 8 3 1.764300 1.623591 2.166866 2.001206 3.913559 3.555022 2.089045 2.334479 4.330086 8.063861
122 8 2 1.532920 1.195454 2.003024 1.892115 2.206041 1.998524 2.247445 2.460835 6.024398 4.154926
123 8 3 1.206594 0.973308 1.789649 1.900807 2.133913 1.795100 1.841862 2.188322 3.306160 3.810649
124 9 2 nan nan nan nan nan nan nan nan nan nan
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.420969 1.731285 2.692562 1.739958 2.481752 4.993846 3.262805 4.347624 4.421664 4.806820
128 10 2 0.860067 0.965439 1.904562 2.776187 1.961444 2.356150 2.192617 2.235581 3.430582 3.509158
129 10 3 nan nan nan nan nan nan nan nan nan nan
130 10 3 nan nan nan nan nan nan nan nan nan nan
135 12 2 0.916100 0.829579 1.908595 1.646374 1.683690 1.764042 1.963621 1.718468 2.047663 2.361296
136 12 2 1.375397 0.981689 4.379475 1.766074 1.926053 1.774398 3.964787 3.055600 2.534390 2.621911
138 7 1 1.098430 0.879416 1.758219 1.700012 1.853380 1.652761 2.031582 2.191666 11.970228 16.075616
140 13 2 1.536949 0.975324 2.084417 1.709975 1.986995 1.944817 1.985767 1.915835 1.832925 2.175135
141 13 2 5.129972 1.199563 21.363529 1.488368 21.455042 2.482526 10.991747 2.135794 11.598534 2.622935
142 13 2 3.291840 0.981140 6.031435 1.789703 5.294685 1.712536 2.592656 1.686884 3.530406 1.970380
143 14 2 1.060015 0.831131 2.484220 1.650314 2.112637 1.900989 2.033570 1.782226 2.337729 3.389024
144 14 3 1.209846 1.052329 1.559882 1.697650 2.503563 2.306760 1.631761 1.908836 2.509772 3.171610
145 14 3 0.864736 0.880927 1.814010 1.492893 1.756851 1.716026 1.757525 1.889420 2.201647 2.465340
150 15 1 2.638770 5.824138 14.069883 41.797223 5.497120 9.513004 3.311984 7.496491 3.935176 9.556558
155 12 2 2.561861 2.558722 5.177416 18.797407 2.951191 3.813581 3.248211 6.424720 3.024169 2.122179
156 12 3 1.275540 1.181163 1.796745 1.685643 3.267734 2.793175 2.366735 2.166683 2.032395 2.897451
157 12 3 1.244027 0.957391 1.871594 1.694567 2.858699 2.131600 2.456860 1.914570 2.330035 2.561879
158 12 3 1.520075 0.975580 3.284738 1.698990 5.211255 2.458390 2.728315 2.052347 4.015137 7.344539
160 13 3 1.766798 1.465422 1.932338 1.729176 3.947862 1.901967 1.889806 1.784382 2.093515 2.212462
161 13 0 2.573895 0.890472 1.631065 1.621023 3.608190 1.964520 3.017608 1.992620 2.449778 2.622504
162 13 0 1.172123 0.927485 2.525656 1.673647 2.552467 2.500546 2.195185 2.131925 2.962344 6.175257
163 14 2 0.968533 0.874874 1.819512 1.543194 1.731207 1.530666 2.088998 1.888653 2.348460 2.899086
164 14 2 0.953600 0.853088 1.806226 1.710619 1.839245 1.868476 2.122508 3.465630 2.541708 3.228581
165 14 0 1.318923 1.043601 2.520921 1.977301 2.587552 2.590956 2.426522 2.434904 2.939491 2.812828
166 14 0 2.100142 2.028872 1.559497 1.560270 2.959315 4.144221 3.466148 4.885260 2.336817 4.466463
167 15 1 2.525005 18.208762 2.393612 98.518476 3.024188 3.090383 3.567781 4.403594 2.937416 4.459700
168 15 2 2.284110 1.674247 5.546277 3.649813 5.250947 2.884294 7.104069 8.878239 13.416695 12.936004
169 15 2 1.322647 16.803420 2.708365 82.137776 2.661629 41.090534 4.173658 20.905925 4.533738 63.417983
170 15 2 1.430055 18.325596 2.949013 85.315626 2.975579 26.829126 4.443515 15.692138 4.133911 41.096311
176 12 0 0.925465 0.832770 1.685189 1.612763 1.789129 1.624285 2.343235 2.091895 2.845571 3.381326
177 12 0 0.911597 0.940938 1.799158 1.764945 1.853952 1.837050 2.155189 1.885127 2.706022 2.202455
178 12 0 0.938911 0.885527 1.860685 1.384903 1.885291 1.701097 1.870608 2.070252 2.584255 2.309358
179 12 1 1.406529 0.838852 1.862761 1.668051 2.436179 1.684399 4.311059 2.242452 6.556972 3.223043
180 13 3 2.091401 4.251822 14.037314 1.814562 3.062293 12.409673 3.080132 4.696213 2.573206 12.748882
181 13 3 1.062662 0.971100 1.651389 1.390970 1.972963 2.503263 1.840772 1.728479 1.932111 1.868502
182 13 0 0.959827 1.346618 1.830075 2.398637 1.934935 3.184084 1.832566 2.468219 2.476130 3.274383
183 13 1 1.087154 0.916711 1.805301 1.727507 2.543308 1.940760 2.119705 2.109092 3.221308 3.312890
184 14 0 0.816677 0.795275 1.589848 1.803980 1.675761 1.726852 1.590072 1.894985 2.048374 2.554100
185 14 1 1.591289 1.431539 2.258044 1.961823 2.525798 2.578082 2.789661 3.473665 3.190932 2.463279
186 14 1 1.022525 0.912002 1.767576 1.733514 1.796976 1.757385 2.052596 2.398246 3.514649 4.265831
187 14 1 1.039800 1.132158 1.846308 3.065823 1.784925 2.842827 1.940110 3.467527 7.917734 12.283634
189 15 3 0.993522 1.000892 1.707994 1.692137 1.819733 1.826789 1.970633 2.201899 1.898160 2.381694
190 15 3 1.577266 3.140750 1.505343 1.862023 1.871279 2.875817 2.334245 3.204928 3.047018 3.473930
191 15 3 1.035312 1.020324 2.353272 1.883519 2.309547 2.383160 1.967880 1.851826 2.261340 2.331667
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 nan nan nan nan nan nan nan nan nan nan
321 2 3 1.148420 0.900023 1.752640 1.757658 1.580595 2.069921 1.722940 1.911988 1.865447 1.762399
323 2 3 0.887601 2.999468 2.225961 3.540819 1.703754 3.519093 1.882101 1.781077 1.920372 2.957727
324 4 3 0.867841 12.010830 2.325085 55.965465 2.149721 1.762840 2.291289 1.811907 2.312723 3.532458
329 12 1 0.848676 0.883725 1.851017 3.245483 1.644485 2.034496 1.853590 1.632430 1.715327 1.868365
333 12 1 0.947372 1.420589 1.944808 3.375176 1.591872 4.429846 1.483455 1.830484 1.812384 2.084458
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 [ ]: