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 = 2459798
Date = 8-6-2022
data_path = "/mnt/sn1/2459798"
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 2459798.25320 and 2459798.33619
372 diff files found between JDs 2459798.25320 and 2459798.33619

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 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 0.810161 0.850867 1.497562 2.079194 1.899887 1.691323 1.815601 1.860400 1.735998 1.957911
8 2 0 2.753698 3.305760 10.083649 18.022969 6.588210 9.340627 6.798082 5.074147 8.853777 17.900264
9 2 0 0.821606 0.838204 1.374277 1.185435 1.832244 1.796237 1.898710 1.852716 1.580544 1.896222
10 2 1 0.791743 0.903786 1.520798 1.741114 1.624912 1.867176 1.656508 2.466515 2.012293 2.479644
15 1 3 0.928277 1.007557 1.221022 1.130577 1.707076 2.163148 1.974124 2.022875 2.445906 2.234739
16 1 3 1.064556 0.992178 1.364975 1.045183 1.909945 1.774795 1.850636 1.664138 3.449127 2.025740
17 1 3 0.978921 0.911208 1.200087 1.046158 1.918604 1.615082 1.610068 1.465661 1.554598 1.762510
18 1 0 56.466239 12.369695 7.944585 4.390306 265.216182 51.870524 1.371954 1.683943 1.323325 1.536387
19 2 1 0.806871 0.809024 1.276172 1.302560 1.521158 1.787635 1.551278 1.735903 1.419936 1.756149
20 2 1 0.792045 0.858113 1.322378 1.126326 1.594209 1.798844 1.561937 1.846893 1.471333 1.614809
21 2 2 0.849422 0.794036 1.507435 0.939140 1.738133 1.482197 2.079676 1.658154 1.720868 1.609969
27 1 0 4.853714 4.128061 6.792327 18.945216 13.321346 6.473531 3.407256 2.291690 3.299412 2.058924
28 1 0 79.327250 0.894189 12.251089 1.528928 425.501017 2.220304 1.594949 1.951912 1.684134 2.320181
29 1 1 1.074441 0.857779 2.259451 1.146679 2.104488 1.480374 2.732537 2.360916 4.795567 2.134574
30 1 1 0.825352 0.831121 1.273320 1.494131 1.559019 1.815816 2.093188 2.077744 1.887484 3.989224
31 2 2 1.156555 1.065841 2.613526 2.074983 2.103742 1.679654 2.920867 4.813162 2.916073 7.392263
32 2 2 1.321137 2.104485 0.867461 1.279745 2.187691 1.867771 4.077995 5.264905 3.943506 6.377788
33 2 3 59.524414 0.823113 5.565909 1.148353 264.586642 1.788827 1.494618 1.707910 1.398321 1.811647
36 3 3 1.001631 1.129538 1.437775 1.299116 1.664474 1.740145 1.572909 1.559035 1.230398 1.310535
37 3 1 0.945862 0.884646 5.200044 2.176948 2.199717 1.846265 1.756868 1.861803 1.954443 2.209236
38 3 1 0.822956 1.069472 1.474001 1.250414 1.733349 2.171544 1.737386 2.210217 1.486884 1.674843
40 4 1 0.829858 1.111929 1.497677 1.202139 1.978988 2.012918 1.865141 1.975831 1.611702 1.982865
41 4 3 0.850220 0.971562 1.185748 3.013770 1.864097 1.618040 1.712241 1.595107 1.423437 2.140158
42 4 0 1.005489 0.953416 1.128912 1.211998 2.158437 1.932453 1.657646 1.906346 1.964850 3.554714
45 5 0 1.407535 0.993407 3.086525 1.468827 3.829101 1.909450 3.542267 2.216411 3.056317 2.170232
46 5 0 0.848788 0.895946 1.218829 1.182572 1.770424 1.788115 1.569963 1.680909 1.415945 1.842758
50 3 3 1.432456 0.868685 1.561856 1.231461 1.865860 1.743518 1.789520 1.668370 1.790476 1.439740
51 3 2 1.057621 0.917466 1.811655 1.657930 1.805465 1.892100 1.639825 1.576774 1.385908 1.549709
52 3 3 1.089207 1.166741 1.448193 1.885235 2.040288 2.185302 1.853411 2.002854 1.670565 1.672801
53 3 2 0.837264 0.846757 1.815204 1.389885 1.933399 1.858106 1.809774 1.812564 2.630509 2.315339
54 4 0 0.839123 0.839625 1.110192 1.119768 1.921249 2.032610 1.813177 1.707365 1.796501 1.817889
55 4 2 0.896018 0.856510 1.441795 1.121764 1.735962 1.793545 2.011729 1.924397 2.169582 1.617047
56 4 1 1.047919 1.112920 1.197501 1.440776 2.037613 2.048677 1.873485 1.958946 2.157868 2.500158
57 4 3 1.139783 1.973891 1.372833 9.081457 1.931832 2.235610 1.754678 1.815337 1.691633 2.031637
65 3 0 0.857307 0.816640 1.464524 1.050840 1.905129 1.675054 1.734848 1.535968 1.496377 1.420318
66 3 0 1.008674 0.849582 1.534852 1.353805 1.932274 1.813154 1.797909 1.721224 1.686616 1.799878
67 3 0 0.857169 0.873355 1.283995 1.385597 1.631230 1.747066 1.745319 1.677005 1.560071 1.463870
68 3 1 0.911881 0.885238 1.502576 1.305754 1.844715 1.611254 1.724485 1.628256 1.914475 1.806555
69 4 1 0.825619 0.875039 1.267103 1.257902 1.716595 1.773745 1.652397 1.905180 1.396589 1.577813
70 4 2 1.135921 1.025109 1.300790 1.468080 2.784800 1.996160 2.436663 1.950378 1.529666 1.778138
71 4 2 1.106677 1.084244 1.430265 1.125932 1.788128 1.941431 1.553216 1.697353 1.527785 1.492026
72 4 0 1.020636 1.088322 1.535724 1.479317 2.160713 2.764317 1.761868 2.002344 2.530649 3.445984
73 5 0 0.994990 1.005232 1.327841 1.134007 1.847547 2.133500 1.569273 1.766033 2.240775 3.170678
81 7 0 1.268412 1.026855 1.592269 1.340293 1.851296 1.908349 2.178039 1.766776 7.493308 2.944360
82 7 0 0.831108 1.029043 1.124346 1.055639 1.511979 1.632087 1.713562 1.532681 1.826039 1.780212
83 7 0 1.240272 1.938125 4.601213 2.114997 1.752939 1.707187 1.714907 2.079146 1.695935 1.863097
84 8 3 1.097948 1.071492 1.447882 2.058288 1.978040 2.146026 1.806163 1.817697 2.793732 2.626992
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 0.989345 0.935192 1.519561 1.183202 1.681248 1.675515 1.580633 2.309877 1.697503 1.628200
88 9 0 2.345982 5.965681 15.825888 37.535171 5.627870 38.505830 4.187932 4.399480 7.203638 2.535200
90 9 0 1.778438 1.212049 5.907187 12.205333 2.486109 2.219819 2.568172 1.932385 2.821903 2.098117
91 9 1 2.962028 5.466821 12.737952 5.066362 5.380013 14.470207 5.500448 4.015627 7.376434 2.548881
92 10 0 2.558951 1.499481 0.655729 0.938570 1.842601 2.559431 2.659613 2.150738 2.710608 2.505690
93 10 0 0.968661 0.864229 1.432151 1.254799 1.898429 1.944343 1.761153 1.725106 1.595423 2.161086
94 10 0 0.855023 1.098311 1.529484 3.012888 1.899182 3.033896 2.022897 3.184691 2.220344 4.573487
98 7 2 1.867468 0.855056 1.381419 1.550028 4.013430 1.871099 7.066426 1.996717 67.606349 2.341089
99 7 2 0.846194 0.822450 1.355245 1.381460 1.637423 1.553400 1.774148 1.444872 3.656247 1.658811
100 7 1 1.200404 1.056353 1.466609 1.380367 2.098151 1.696944 1.627012 1.631902 1.507484 1.453821
101 8 2 1.018986 0.991679 1.340266 1.597014 1.844877 1.563294 1.756532 1.796976 1.593063 1.778074
102 8 0 nan nan nan nan nan nan nan nan nan nan
103 8 1 1.064667 0.809094 1.584039 1.341631 2.009644 1.690294 1.743353 1.720490 2.359048 1.454664
104 8 1 1.586802 1.063747 0.361711 1.287424 1.883667 1.493242 3.810685 1.525137 3.318755 1.329208
105 9 1 2.544217 2.168148 15.665138 6.200207 2.558863 6.865782 4.649854 2.130642 10.585370 2.336615
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 3.144579 3.128950 5.320640 37.048925 6.410181 3.690385 3.132746 4.211442 4.992823 10.433832
108 9 1 1.860398 1.222590 9.622029 5.033648 2.506914 1.885272 3.479758 1.853928 3.614471 1.911150
109 10 1 1.388780 1.083673 1.187240 1.492906 2.831108 2.317338 1.722511 1.873161 1.618995 1.818915
110 10 1 0.841234 1.466690 1.611621 3.448615 2.076735 2.338183 1.731830 2.430645 1.613061 1.837224
111 10 1 0.918778 1.036521 1.594614 1.047466 1.883233 1.909181 1.937775 1.530810 1.711367 1.549482
112 10 2 0.988983 1.620893 1.166142 1.243281 1.557569 2.080519 1.542776 1.792549 1.280508 1.529887
116 7 2 0.775410 0.772667 1.593911 0.994900 2.195303 1.650905 1.899995 1.583813 2.049480 1.585615
117 7 3 0.882438 0.983830 1.536868 1.155004 1.557298 1.460602 1.666356 2.149355 1.874331 3.149959
118 7 3 0.917703 0.964510 1.520847 1.399708 1.712312 1.727067 1.934754 2.027499 1.677970 3.041562
119 7 1 1.089202 0.727309 1.407746 1.468096 2.723747 1.730739 2.657293 1.697532 11.739528 1.728059
120 8 1 3.697021 1.014489 11.087929 2.490959 8.315814 2.088487 8.882816 1.583548 22.539851 1.738377
121 8 3 1.268938 1.225155 1.855931 1.234455 3.176712 3.076953 2.361389 2.081926 3.288920 8.432261
122 8 2 1.425946 1.536846 1.429356 1.367334 3.049185 3.743562 2.135041 1.799622 3.880943 3.684062
123 8 3 1.140056 0.997461 1.373810 1.602544 1.944286 1.851817 1.594143 1.745959 2.046902 1.793668
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.321790 1.356642 1.683989 1.081829 3.244581 3.237142 3.028415 3.837759 3.298340 4.498857
128 10 2 0.811440 0.923256 1.252227 1.331114 1.688764 1.956709 1.549891 1.901964 1.997238 1.903422
129 10 3 0.850019 0.875488 1.233547 1.008882 1.599659 1.598212 1.577732 1.652026 1.480519 1.406143
130 10 3 1.024445 1.018006 1.734671 1.798899 2.192804 1.661670 2.072736 1.589991 1.933684 1.792200
135 12 2 0.875232 0.943121 1.552277 1.231791 1.926287 1.962833 2.072999 2.266868 1.771175 1.993456
136 12 2 1.130924 0.958259 0.949219 1.222581 2.080297 1.737913 4.238661 2.237679 2.762892 2.050542
137 7 3 3.770986 3.888998 2.588872 20.085937 9.755530 6.878459 3.661391 2.372193 5.839916 2.265472
138 7 1 0.840204 6.722135 1.163864 5.579043 2.004558 6.502527 1.645798 3.406347 4.875952 5.664919
140 13 2 2.138088 2.585106 8.048840 16.582700 3.571612 2.111602 2.655766 2.124364 2.815859 1.823257
141 13 2 2.134177 1.086897 3.824971 1.256627 6.628580 2.168697 4.446372 1.694832 3.560576 1.814458
142 13 2 5.959309 1.218937 8.296859 1.401730 6.269682 2.039622 3.041170 1.579477 3.850937 3.600899
143 14 2 0.846703 0.824155 1.566789 1.382706 1.800157 1.775620 1.817426 1.761600 1.476770 1.584109
144 14 3 1.131363 1.029100 1.424827 1.294521 2.051233 1.704418 1.596160 1.755132 1.699425 1.684052
145 14 3 3.832624 4.286693 22.732412 18.689852 22.858760 14.382976 2.976686 1.844513 2.844576 1.826486
150 15 1 3.504338 10.354892 23.831554 49.223373 4.730826 9.171388 4.769396 19.397145 5.200991 34.497327
155 12 2 2.563904 4.297398 10.316182 22.645644 4.324891 3.978301 3.282780 2.408783 3.746624 2.118479
156 12 3 0.987580 0.968643 1.238291 1.557953 1.993014 1.758698 1.688056 1.658429 1.536720 1.624017
157 12 3 0.961310 0.885490 1.622220 1.229004 1.836520 2.005645 1.778978 1.652170 1.576677 1.632053
158 12 3 1.045593 0.854299 1.850209 1.866598 2.311524 2.087017 2.004667 2.003359 2.357266 2.088007
160 13 3 4.188091 12.048057 14.877471 66.737374 7.869853 11.791870 4.048355 20.162277 7.177442 38.656076
161 13 0 1.918435 0.946656 1.222726 1.416167 3.692227 1.771043 3.123720 1.979634 6.764950 4.337497
162 13 0 0.919940 0.869452 1.253413 1.107363 1.823491 1.722144 1.690954 1.702515 1.487920 2.061287
163 14 2 0.818243 0.902111 1.315671 1.126245 1.563974 1.867079 1.669694 1.653062 1.643139 3.654935
164 14 2 0.843837 0.824113 1.250304 1.104452 1.844883 1.694148 1.673119 2.061482 1.939185 1.675721
165 14 0 2.418783 2.013542 3.111426 2.168457 7.262214 5.469950 3.227060 4.356662 4.131828 5.618217
166 14 0 0.877555 1.066103 1.396868 1.455573 2.004309 1.990425 1.861870 2.448677 1.821575 2.144238
167 15 1 2.091516 1.225630 2.663253 1.755150 3.936850 1.939533 3.505052 2.162651 3.146012 2.101607
168 15 2 2.383835 1.124344 7.934039 2.277755 5.267396 1.437515 6.977887 4.543094 9.337964 3.567843
169 15 2 1.911101 5.015491 5.441736 33.075681 4.265258 2.142223 4.262934 4.833011 6.842974 8.412748
170 15 2 2.277116 7.036797 6.501024 44.361144 5.086098 2.506314 5.074280 4.977530 8.345116 7.346517
176 12 0 0.742382 0.782792 1.235846 0.978736 1.684545 1.750387 1.657893 1.683507 1.511780 1.600097
177 12 0 0.848171 0.907738 1.671207 1.196296 2.045081 1.605014 1.765277 1.592076 1.966569 1.436224
178 12 0 0.872745 0.830153 1.322217 1.592505 1.838033 1.823953 1.565989 1.724922 1.493275 1.616528
179 12 1 1.202390 0.792105 1.211583 1.632124 2.061649 1.749732 2.693044 2.141038 2.384695 1.965530
180 13 3 2.214663 1.115261 9.797417 1.143099 5.378228 2.165186 3.281493 1.706229 3.175155 1.733400
181 13 3 1.188995 5.227975 1.015340 9.754492 3.755645 8.535388 1.922827 1.929281 1.897132 1.893861
182 13 0 0.930461 1.214769 1.298922 2.444376 2.276678 2.693568 1.859570 1.865062 1.697653 2.716235
183 13 1 0.912067 0.896636 1.425945 1.521981 2.222031 1.923487 1.620140 1.930667 1.744587 2.209483
184 14 0 0.859085 0.796370 1.066481 1.226350 1.545082 1.642471 1.530699 1.576130 1.352610 1.676873
185 14 1 0.826044 1.271226 1.213352 1.477407 1.807930 1.820084 1.828726 2.233437 1.727529 1.661771
186 14 1 0.795567 0.902061 1.148617 1.756529 1.639322 1.876878 1.710576 1.714503 1.585819 1.928788
187 14 1 0.840238 1.016885 1.529548 1.533652 1.776987 2.299115 2.182756 2.850903 3.118517 5.817571
189 15 3 0.876014 1.131574 1.186476 1.091928 1.633838 1.436161 1.657745 1.746545 1.574387 1.431136
190 15 3 4.066733 2.341453 12.988282 1.515450 5.659623 3.440398 2.864729 2.995560 3.226219 4.870405
191 15 3 0.954762 0.894849 1.243990 1.345785 1.908871 1.925624 1.659757 1.760048 1.634744 1.524947
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 0.973580 0.894259 2.735276 1.703205 1.834737 1.482538 2.106790 1.741699 2.025395 1.761754
206 19 0 1.160335 1.033812 1.757835 1.787103 1.705530 1.869929 1.730663 1.843621 1.947867 1.630937
207 19 1 0.846141 0.966517 1.591020 1.885754 1.484607 1.579449 1.634156 1.613953 1.603466 1.727441
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.978382 1.087809 1.967230 4.511514 1.923400 1.568580 1.631313 1.701250 1.633734 1.630973
224 19 1 1.356220 0.769858 4.737166 2.075686 3.236532 1.617069 5.007348 1.885490 7.090550 2.928727
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.376522 4.321617 14.168613 26.487412 6.618350 6.120761 5.765167 3.033081 6.930820 15.112814
321 2 3 1.441925 0.880846 1.711811 2.893727 1.867000 1.718398 1.663477 2.033839 1.632583 1.828989
323 2 3 1.031038 0.859654 2.562080 3.921601 1.777108 3.056957 1.837746 1.793237 1.805970 1.702312
324 4 3 0.847455 0.961817 2.384418 1.743634 1.796467 1.420193 1.812321 1.847205 1.713783 1.820646
329 12 1 0.953478 1.317594 1.696088 5.473105 1.685085 1.707340 1.654900 1.638100 1.745361 1.741221
333 12 1 1.121259 1.347279 2.556501 1.362772 1.799880 2.334854 1.574225 1.637550 1.747535 1.309592
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 [ ]: