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 = 2459785
Date = 7-24-2022
data_path = "/mnt/sn1/2459785"
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 2459785.25301 and 2459785.66931
1862 diff files found between JDs 2459785.25301 and 2459785.66931

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 4.992653 2.834412 1.328028 1.437674 4.106454 3.053994 1.560042 1.695340 1.718510 2.106734
4 1 2 0.801669 0.724500 1.420118 3.437065 1.127888 0.823174 1.120632 0.797056 1.853126 1.223794
5 1 2 1.160608 1.164753 1.963826 1.512009 1.921694 1.784697 2.687283 1.915870 8.660121 8.100923
7 2 0 1.355679 40.026976 2.027584 145.493133 2.022202 114.459950 2.717253 124.730866 3.681732 159.444812
8 2 0 1.071297 27.446721 2.362918 113.628718 2.210271 93.533673 3.042939 103.010212 3.645845 131.313560
9 2 0 1.127113 0.980845 2.946253 0.972316 2.098780 1.783469 4.466054 1.738045 3.559986 1.703999
10 2 1 0.989680 1.307286 1.439901 1.258448 1.726073 2.035211 1.706526 3.088817 2.658178 4.396329
15 1 3 1.441479 1.471971 1.926664 1.266517 2.224701 2.178514 1.946211 1.905142 6.089621 6.735165
16 1 3 1.284225 1.261017 1.776068 1.471760 2.196423 2.185883 1.843422 2.194021 9.988133 11.004819
17 1 3 1.334040 1.232257 1.377841 1.192999 2.214557 1.762293 1.719733 1.643993 2.619146 2.786168
18 1 0 93.548875 81.691892 1.654647 1.881202 445.705935 417.674204 1.459670 1.747179 2.319396 1.895331
19 2 1 1.095367 1.197045 1.387661 2.861053 1.906130 1.848031 1.918347 1.894296 1.915721 3.691236
20 2 1 1.158426 1.126450 1.538917 1.135041 1.974688 1.739498 1.874039 1.747031 2.141009 2.185181
21 2 2 1.048223 0.950482 1.021071 0.891290 1.809531 1.589632 1.838702 1.653142 2.345164 2.099910
27 1 0 0.417853 0.347816 0.935135 1.932919 1.116680 1.052662 0.607514 0.281207 0.554856 0.270172
28 1 0 102.169660 2.826819 1.517868 1.526316 493.840595 12.862895 1.541559 2.405590 3.471390 4.057126
29 1 1 1.235534 1.134987 1.668833 1.345954 1.883692 1.868983 2.458823 3.293169 4.651094 4.725590
30 1 1 0.779340 0.645396 1.262643 0.641194 1.339902 1.048755 2.030788 1.849531 1.699663 2.260181
31 2 2 1.130405 1.307387 1.644285 1.780270 1.730221 2.166778 2.187203 4.786654 3.643253 8.694579
32 2 2 0.685791 1.791223 1.003649 1.731009 1.127624 2.645572 2.000727 5.524509 1.772741 3.673168
33 2 3 nan nan nan nan nan nan nan nan nan nan
36 3 3 1.531147 1.681792 1.596660 1.481349 1.859576 2.081042 1.656683 1.801899 2.350979 2.553638
37 3 1 1.111189 1.170446 1.931988 1.600708 2.400741 1.911568 2.014406 1.968001 3.364168 3.901254
38 3 1 1.264853 1.271247 1.945720 1.821195 2.000500 2.118100 2.104568 2.607172 2.793044 2.964844
40 4 1 1.069239 1.133336 1.871300 1.262529 1.956697 1.899489 1.830013 2.116596 2.693733 2.813559
41 4 3 nan nan nan nan nan nan nan nan nan nan
42 4 0 1.148465 1.159191 1.228002 1.643968 2.073766 2.283497 1.553168 2.083095 3.465528 9.345775
45 5 0 1.725467 1.210321 3.122449 1.340473 4.131040 1.901929 3.994287 2.746804 4.168399 3.267872
46 5 0 1.705532 1.247919 1.502582 1.461830 2.943253 1.863284 2.109622 1.676571 2.909874 2.701583
50 3 3 1.697458 1.255679 1.901001 1.450271 1.851718 1.805737 1.949549 1.828570 2.218263 1.770325
51 3 2 4.124468 1.137092 13.831246 2.383252 8.162521 1.957852 6.977227 3.014076 8.996293 6.070926
52 3 3 4.775561 1.236849 15.490990 1.552397 3.960159 2.143394 5.744515 2.054931 5.709176 3.169911
53 3 2 1.252884 1.513583 2.702714 2.927773 2.637910 3.649929 2.496576 3.011138 4.710526 5.631158
54 4 0 1.241703 0.979482 1.707192 1.413336 2.915227 2.082254 2.142517 2.112309 3.211480 3.262922
55 4 2 1.065475 1.117231 1.741886 1.051052 2.068704 1.698034 1.963286 1.682761 2.723212 2.363805
56 4 1 1.533209 38.654329 2.079383 153.613075 3.131970 123.973659 3.842848 136.248937 4.915338 178.471528
57 4 3 nan nan nan nan nan nan nan nan nan nan
65 3 0 1.343995 1.230363 2.672118 1.229791 2.625814 1.991169 2.392749 1.988081 2.880644 2.645371
66 3 0 1.797625 1.201435 4.366863 1.723944 4.757955 2.292907 3.340693 1.790945 3.620403 3.040143
67 3 0 0.987125 1.182159 1.513862 1.373718 1.732237 2.031675 1.828882 1.761517 2.501742 2.223685
68 3 1 1.167070 1.107118 1.573028 1.660270 2.026617 1.740157 1.773075 2.057197 2.445575 3.111576
69 4 1 1.190118 26.877998 1.942059 101.921173 2.002026 94.107778 2.919812 83.245990 4.905357 138.203704
70 4 2 1.604925 1.531347 1.360401 1.480780 3.598336 2.401043 2.567740 2.621064 2.493360 3.317790
71 4 2 1.234546 1.372958 1.409268 1.457602 1.916657 2.105170 1.640449 1.895732 2.010603 2.015664
72 4 0 1.255859 1.467766 1.676523 1.585921 2.289909 2.182518 1.824768 1.828955 7.746911 5.817023
73 5 0 1.185485 1.261711 1.511996 1.334842 2.038415 1.929869 1.856212 1.919329 3.649975 4.446789
81 7 0 2.029401 1.476936 2.134099 1.527503 2.410107 2.093288 2.594301 1.789341 16.675960 5.403160
82 7 0 1.038811 1.165788 1.414532 1.040896 1.659942 1.791277 1.756558 1.695222 2.674010 2.330312
83 7 0 1.263684 2.204317 2.354529 11.612442 1.899402 3.422001 1.734517 3.030505 2.702539 7.685855
84 8 3 1.649827 1.653911 1.951999 2.261236 2.146134 1.968613 2.034185 1.819620 13.104227 15.415464
85 8 0 2.813522 1.076981 3.964040 1.335991 4.582254 1.613570 1.811760 1.557563 4.542296 2.501092
86 8 0 1.963709 1.488682 3.612055 1.338054 3.198242 1.905279 3.477547 3.166470 6.803439 5.619154
87 8 2 nan nan nan nan nan nan nan nan nan nan
88 9 0 2.579804 8.363859 12.190655 30.039911 5.841564 27.737650 5.735821 3.708092 8.046583 2.637417
90 9 0 12.085207 3.524193 3.976902 3.070832 18.871082 10.426923 33.696815 8.392257 31.202450 11.706543
91 9 1 4.197405 2.750114 11.633007 9.363770 4.663750 5.553643 6.990399 2.607631 8.805345 2.253643
92 10 0 3.739917 2.934700 0.562536 1.172237 5.033872 8.931341 2.424348 2.106427 3.822126 2.205552
93 10 0 1.226666 1.160406 1.445063 1.667430 2.048692 2.309324 1.714073 1.936983 2.329516 3.014258
94 10 0 1.034875 1.405353 1.502932 2.191433 1.758593 2.652736 1.993494 2.832758 2.451819 8.364828
98 7 2 1.263361 1.068997 1.694068 1.427202 2.314917 1.469765 2.276696 1.889537 6.169809 2.381036
99 7 2 1.065960 1.678559 1.258095 1.795113 1.515892 2.197080 1.619134 2.612138 2.628143 35.513592
100 7 1 1.430974 1.231839 1.674386 1.415351 2.313746 1.993646 1.803863 1.654806 2.753410 2.584121
101 8 2 nan nan nan nan nan nan nan nan nan nan
102 8 0 0.308496 0.263879 0.400117 1.615451 0.553414 0.404746 0.534654 0.461542 0.790595 0.638043
103 8 1 1.438225 1.102846 1.700872 1.557239 2.037358 1.827540 1.758318 1.667353 2.766176 2.506932
104 8 1 2.045327 1.474497 0.651011 1.836918 2.383319 1.765380 3.365527 1.756034 4.502704 2.497531
105 9 1 2.728748 2.105387 12.953780 6.131301 3.681889 4.594872 5.806474 2.244593 10.607484 2.186933
106 9 3 2.234639 2.029422 1.948126 1.504427 6.184403 3.876755 2.968408 3.663523 3.891082 3.122349
107 9 0 4.869339 5.787630 38.646604 45.103707 6.098569 3.965989 9.592990 11.043775 11.725442 12.411632
108 9 1 1.313113 1.226072 1.853727 1.208624 1.665314 1.548713 1.621984 1.646082 3.617837 2.499436
109 10 1 1.966643 1.544208 1.582097 1.482892 3.820493 2.863223 1.661554 1.810256 1.932254 2.004663
110 10 1 2.346506 2.778932 2.633735 1.423017 2.980870 2.835583 2.243079 2.738653 2.599945 2.057722
111 10 1 1.453258 1.284746 2.269127 1.379953 2.845197 2.108739 2.325244 1.654441 2.659946 1.850488
112 10 2 nan nan nan nan nan nan nan nan nan nan
116 7 2 1.032205 1.006619 1.398871 1.512030 1.874619 1.875606 1.797359 1.755435 3.399756 2.366819
117 7 3 1.272903 1.329569 1.712897 1.740336 1.909388 1.960424 1.859497 3.043880 3.228121 5.512069
118 7 3 1.178396 1.164125 1.623085 1.628626 1.967480 1.629475 1.900246 2.152407 2.074564 5.173520
119 7 1 0.964897 1.006467 1.347475 1.670831 1.805768 1.824819 1.702180 1.890790 3.109877 3.374950
120 8 1 7.030379 2.985152 9.007210 2.864733 7.669466 12.138196 10.937402 1.909940 28.606745 3.718494
121 8 3 2.107314 1.741751 2.820797 1.224310 5.168254 3.963205 2.941905 2.191198 6.237317 10.172002
122 8 2 nan nan nan nan nan nan nan nan nan nan
123 8 3 1.890042 1.510960 2.052553 1.677093 2.319399 1.842636 1.733855 1.829658 3.735712 3.261326
125 9 3 3.212039 3.352241 33.381227 10.283096 7.732284 4.680727 3.986821 1.932580 5.987752 2.295373
126 9 3 2.823026 2.037215 27.342415 6.360068 5.289103 4.941124 4.987849 2.442721 6.310446 2.493829
127 10 2 nan nan nan nan nan nan nan nan nan nan
128 10 2 nan nan nan nan nan nan nan nan nan nan
129 10 3 1.050867 1.099433 1.176449 1.212453 1.699538 1.847864 1.702857 1.801145 1.812910 2.549652
130 10 3 1.344308 1.356632 2.405025 2.108257 2.329337 2.152614 1.977387 1.669411 3.050039 2.833683
135 12 2 1.074926 1.083805 1.488070 1.280833 1.869730 1.772843 1.876678 1.773586 1.911812 1.577867
136 12 2 1.432123 1.316094 2.270782 1.288210 2.000388 1.879442 3.887214 2.421410 2.632245 3.310533
137 7 3 2.753872 2.982210 11.896599 15.610787 7.560577 3.834132 4.462760 2.081490 6.752987 1.912511
138 7 1 1.178266 5.326854 1.153893 3.499246 1.933050 4.213294 1.961685 2.176895 11.228756 3.543730
140 13 2 1.295935 1.326977 1.541346 1.806674 2.154529 2.091576 1.781669 1.907310 2.207024 3.489030
141 13 2 7.417267 1.335148 12.575150 1.286168 27.068746 2.062164 15.898896 1.824450 15.631090 2.385071
142 13 2 4.818363 3.052403 7.204411 2.282955 9.499365 12.301797 3.207066 2.060108 6.485994 5.524713
143 14 2 1.190310 1.097358 2.470684 1.316475 2.357851 1.650379 2.119303 1.852322 2.653369 2.687992
144 14 3 1.433356 1.366795 1.761456 1.233781 2.161777 2.043721 1.538203 1.917201 1.988881 2.340826
145 14 3 7.663917 4.071731 22.802765 24.103453 24.906691 13.840505 3.714119 1.883045 4.306572 2.069369
150 15 1 0.414879 1.099208 2.657454 6.912736 0.581276 1.664832 0.575210 1.300354 0.722606 1.856194
155 12 2 2.293211 2.380242 7.607680 18.817572 3.463122 3.083317 4.117670 3.457761 4.737025 1.890188
156 12 3 1.246650 1.194525 1.378198 1.378640 2.328515 2.029479 1.717107 1.753688 1.748945 1.708408
157 12 3 1.519781 1.191539 1.575760 1.214979 1.901083 1.886472 1.855204 1.936640 2.005434 1.927063
158 12 3 1.647197 1.066321 4.205343 1.065194 4.758040 1.752446 3.286052 1.971240 3.695953 3.687580
160 13 3 3.980795 4.419222 17.108617 36.550467 6.974502 7.065769 4.709359 5.296219 4.463438 4.998538
161 13 0 3.121699 1.233519 1.759650 1.564489 4.824869 1.918177 3.337076 1.905512 4.433008 4.187696
162 13 0 1.116599 1.225038 1.318014 1.472349 2.199825 2.059292 1.901806 2.346222 1.817024 2.496737
163 14 2 1.136595 1.165236 1.595673 1.525211 2.053996 1.954162 2.291215 1.760284 2.508681 2.516121
164 14 2 1.108287 1.117547 1.192410 1.587066 1.713548 2.003155 1.950569 4.073217 1.947330 3.024667
165 14 0 2.813577 6.610061 2.148367 7.010937 8.502405 15.630177 2.210242 3.519020 4.053276 3.981980
166 14 0 3.074914 3.099088 1.583245 1.097017 4.493528 4.678295 5.112127 3.991070 3.745206 3.764327
167 15 1 2.333054 13.567871 2.276014 75.167092 4.482885 3.108727 3.045742 3.894560 3.221766 3.236379
168 15 2 1.700341 3.630401 3.317457 17.225451 2.308245 7.537282 4.135227 6.564299 6.786905 14.035291
169 15 2 1.619431 21.279347 2.276777 104.817089 2.807246 35.625199 4.425211 35.985956 6.169237 49.305759
170 15 2 1.508398 23.201137 3.424532 106.444014 2.673942 49.723272 4.439175 42.277530 6.260190 66.309686
176 12 0 1.029783 1.000164 1.674438 2.598053 1.796406 1.762497 1.963159 1.655117 2.759626 2.960691
177 12 0 1.076053 1.221214 1.278514 1.439291 1.929455 1.946535 1.654714 1.789647 2.104531 2.650275
178 12 0 1.064531 1.128753 1.457241 1.548652 2.116923 1.939649 1.784055 2.225105 2.593961 2.861171
179 12 1 1.782149 0.986128 1.529673 1.202873 2.698286 1.816697 6.747822 2.514507 3.775885 2.599449
180 13 3 2.369635 1.473078 13.463046 1.408654 5.480492 2.426725 3.707923 1.786888 3.246012 2.181371
181 13 3 2.825489 5.400956 1.756036 10.980000 7.245437 9.276672 2.217138 1.783965 2.484131 1.823840
182 13 0 1.494387 5.318946 1.947466 18.561394 2.699241 16.144681 1.865077 13.683239 2.860700 18.912172
183 13 1 1.333170 1.268419 1.783181 1.914348 2.490775 1.919292 1.936678 1.892579 2.951339 3.492480
184 14 0 1.085262 0.979774 1.433652 1.584230 1.758829 1.787827 1.765495 1.704821 2.527141 4.110509
185 14 1 1.083784 1.307477 1.314632 2.504972 1.744984 1.959072 2.068145 2.791296 2.302031 2.633215
186 14 1 1.130923 1.076660 1.205458 1.139145 1.890571 1.676872 1.964913 1.762996 3.215799 2.720697
187 14 1 1.158495 1.324043 2.111584 2.087052 2.092856 2.802887 2.420887 3.881087 7.685205 11.707136
189 15 3 1.238670 1.309045 1.698188 1.195539 1.789719 1.857822 1.610582 1.507330 1.636279 1.660585
190 15 3 2.572121 1.371937 10.790628 0.538164 4.088055 1.327714 3.789639 1.638701 3.782344 2.676787
191 15 3 1.269394 1.547680 1.203321 1.210224 2.017744 2.342354 1.876013 2.295346 2.068722 1.810144
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 2.027995 0.899292 5.172362 1.857829 5.624507 1.635004 3.656369 2.076257 3.460494 2.370168
206 19 0 1.294248 1.171409 1.849190 2.537405 1.863786 1.958221 2.113107 1.815944 2.602095 1.895800
207 19 1 0.851103 0.811381 1.865457 2.039409 1.736869 1.521294 1.583311 2.146421 1.920366 2.144509
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.897309 1.249890 1.945142 1.832006 1.692310 1.758946 2.068999 1.745632 2.217231 1.904541
224 19 1 0.979451 3.659336 1.881326 13.666952 1.805799 14.582424 5.441899 15.101428 10.042813 19.707584
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.031300 5.966377 9.518211 38.747089 5.863582 10.790954 8.347604 4.161618 9.586453 18.132976
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 nan nan nan nan nan nan nan nan nan nan
329 12 1 0.954188 1.110417 3.226180 6.463349 1.648225 1.822499 1.862358 1.685266 2.243303 1.859025
333 12 1 1.700841 1.852205 1.775845 2.595859 2.287655 3.806431 1.592111 1.955773 1.842054 1.697645
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 [ ]: