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 = 2459804
Date = 8-12-2022
data_path = "/mnt/sn1/2459804"
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 2459804.25311 and 2459804.33610
372 diff files found between JDs 2459804.25311 and 2459804.33610

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.186824 1.246590 1.312105 1.271175 4.910212 2.844178 1.865514 1.728020 1.928323 2.160057
4 1 2 1.262130 4.607810 1.756338 1.519051 3.024295 2.704221 1.756646 1.982889 2.006480 2.079536
5 1 2 1.074816 1.300322 1.864201 1.154561 3.550309 3.426081 2.060171 1.854371 4.637851 4.779013
7 2 0 1.159669 1.010773 1.247433 1.940975 3.518547 2.340431 1.588125 1.848028 2.264141 2.860716
8 2 0 1.049044 4.353959 3.592705 27.459326 1.828256 13.821928 3.253853 6.540577 4.118291 25.852953
9 2 0 0.909854 1.023174 1.262872 1.028930 2.604782 2.752707 1.687940 2.082273 1.825696 1.828112
10 2 1 0.952211 1.260264 1.227503 1.183515 3.972769 4.330236 1.650532 2.060862 1.847210 2.383007
15 1 3 1.168769 1.122862 1.214038 1.078477 4.160334 2.864178 2.125364 1.789252 5.154625 4.122778
16 1 3 1.259981 1.109010 1.369416 1.123723 3.679454 2.089038 1.855078 1.572868 3.833395 2.089305
17 1 3 1.225481 0.979959 1.189740 1.046827 4.007622 2.325615 1.757553 1.544810 2.091091 2.026656
18 1 0 36.565712 15.367325 1.281019 1.346533 182.049506 61.752399 1.656390 1.704648 1.898530 1.864562
19 2 1 1.133594 1.048640 1.042223 1.311022 3.522597 2.372773 1.707653 1.756706 2.086884 3.399246
20 2 1 1.071391 1.061772 1.499050 0.863517 3.276863 2.393389 1.704254 1.721007 1.870160 1.788579
21 2 2 1.175559 1.301841 1.685501 1.102677 4.468284 5.377583 2.296375 1.835927 2.439990 2.466298
27 1 0 1.150947 3.141765 2.465617 11.143641 3.525995 5.004782 1.238055 1.158624 1.318496 1.570430
28 1 0 89.219151 3.711896 0.948518 1.411439 458.295840 19.604498 1.570164 1.903699 2.230389 2.354660
29 1 1 1.165645 1.194480 1.403818 1.163120 3.027598 2.137989 2.328658 2.506423 4.851054 3.994334
30 1 1 1.106300 1.070433 1.371945 1.262616 3.431675 2.174179 2.858459 2.708386 2.465784 4.773101
31 2 2 1.108768 1.320211 1.076442 1.034742 2.543412 2.278091 2.724387 5.570889 3.332930 10.199008
32 2 2 1.661710 2.880081 1.166813 1.176135 2.802378 2.304619 5.374406 6.808459 5.068371 6.846617
33 2 3 39.460951 1.415831 1.107909 1.429867 176.227222 4.783394 1.629275 1.768190 1.658607 2.121072
36 3 3 1.066849 1.066653 1.644240 1.345865 3.136397 2.283568 1.979898 1.881523 1.934090 1.723808
37 3 1 1.171250 1.042143 3.606739 1.907769 3.806788 2.203388 2.265351 2.106056 2.824504 3.006133
38 3 1 1.099378 1.417139 1.534816 1.414462 3.281678 3.340206 1.800614 2.662159 1.728264 2.182864
40 4 1 1.158709 1.276875 1.751044 1.126086 4.228973 4.120747 1.925392 2.024114 1.930344 1.891420
41 4 3 1.039696 1.092492 1.402357 1.701369 2.852758 2.887662 1.880026 1.896275 1.717454 1.797296
42 4 0 1.292998 1.106559 1.338433 1.318842 4.091794 2.767436 1.921826 2.186517 2.138481 4.012531
45 5 0 1.478157 1.259238 2.668989 1.202118 4.264166 2.437463 3.502518 2.108228 3.130917 2.345424
46 5 0 1.182326 1.159336 1.315098 1.341746 3.399147 3.064134 2.138227 1.861097 1.842841 1.805838
50 3 3 1.365333 1.102678 1.126388 1.423008 3.356771 1.955675 1.908276 1.955364 1.839320 1.658652
51 3 2 1.820671 1.132151 5.938651 1.649913 4.053214 2.463593 1.954197 1.886634 1.890681 1.832737
52 3 3 1.066084 1.090617 1.571493 1.780751 3.165019 2.314035 2.003292 1.999870 2.038471 2.109963
53 3 2 1.163902 1.300894 2.096254 1.721526 3.834850 3.162946 2.180856 2.480153 3.620784 3.357838
54 4 0 1.206566 1.201467 1.072586 1.194899 4.366232 3.912205 1.728232 2.091183 2.114048 2.660129
55 4 2 1.504398 1.165648 1.641492 1.251354 6.019024 3.887078 2.188462 1.915685 2.563047 2.032746
56 4 1 1.244999 1.373753 1.586121 1.445544 4.403291 4.099269 2.259258 1.944982 2.421877 2.191560
57 4 3 3.957084 2.149208 2.265558 9.724058 18.278727 2.256316 2.089680 1.980069 2.226224 2.063774
65 3 0 1.359788 1.153233 2.415858 1.116903 4.631361 2.720881 2.495515 1.852143 2.215355 1.787093
66 3 0 1.152046 1.125735 1.749916 1.314275 3.792730 2.661570 1.813680 1.813005 1.867726 1.837390
67 3 0 0.967247 1.081072 1.221772 1.237694 2.762376 2.238542 1.690219 1.899603 1.833077 1.732093
68 3 1 1.020018 1.150191 1.506231 1.410222 2.760584 2.265940 1.645590 1.970630 1.673812 1.941470
69 4 1 1.080182 1.201993 1.830435 1.453028 3.651410 3.581208 1.988418 1.828732 1.900926 1.800735
70 4 2 1.821019 1.324732 1.541579 1.352464 4.911934 2.827964 3.171527 2.040546 1.960216 2.122133
71 4 2 1.082675 1.151891 1.536565 1.263795 2.531478 2.667512 1.937975 1.729931 1.757920 1.631980
72 4 0 1.392900 1.549676 1.547579 1.638743 4.713893 4.561596 1.898007 2.107696 2.949788 4.800447
73 5 0 1.228904 2.179966 1.561134 5.378189 3.524288 5.666032 1.803837 1.997312 2.033392 2.049394
81 7 0 1.159940 1.660159 1.799019 1.364841 2.821126 3.084282 2.393573 3.457530 4.551194 5.191542
82 7 0 0.906093 1.183422 1.247649 1.143648 2.471871 2.250420 1.741350 1.767192 1.946399 2.006001
83 7 0 1.019107 1.069237 2.149221 3.153317 2.705250 2.148623 1.782903 2.101497 1.878562 2.095614
84 8 3 1.087429 1.063867 1.325779 1.353665 3.008077 2.617876 2.020327 1.507487 3.699638 3.868234
85 8 0 1.072519 1.207170 1.366936 1.313310 2.890865 2.657974 2.050510 2.371222 2.962194 3.959337
86 8 0 1.346068 1.015237 1.714190 1.284745 4.235025 2.350944 2.273041 2.326647 2.244206 2.189459
87 8 2 1.122947 1.191854 1.656406 1.483417 4.078681 2.480466 1.769389 2.533952 2.422880 2.382528
88 9 0 2.631188 6.251100 15.603031 41.074918 5.412519 35.532978 4.626874 4.965784 7.999861 3.085927
90 9 0 2.058177 1.363740 6.822887 14.987438 2.859123 2.016507 2.811553 1.882572 3.320346 1.956490
91 9 1 5.306613 5.643094 14.838986 17.386371 7.039186 11.136267 6.584762 4.004759 8.113822 2.530048
92 10 0 2.716752 3.508381 0.714234 1.221878 5.481969 15.919055 2.596256 2.546541 2.981019 3.176850
93 10 0 1.251171 1.236469 2.600904 1.195862 3.461149 2.404991 4.367895 1.991024 5.474582 2.022342
94 10 0 0.959648 1.259699 1.342697 2.149471 2.628546 4.053278 2.096316 2.893574 2.311202 4.788615
98 7 2 1.126364 0.966741 1.459347 1.293801 3.716596 1.762243 2.682202 1.787202 6.725543 1.817688
99 7 2 1.050940 1.088272 1.648419 1.658473 3.787259 2.969840 1.860142 1.876033 2.399930 4.280613
100 7 1 nan nan nan nan nan nan nan nan nan nan
101 8 2 1.125607 1.183296 1.142924 1.623577 3.010302 2.739139 1.769400 1.944219 1.766014 2.416754
102 8 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
103 8 1 1.114190 1.042892 1.689156 1.297115 2.577672 2.084940 2.463468 1.999436 3.425826 2.205771
104 8 1 1.962068 0.983855 0.299743 1.579399 2.838423 2.291650 3.911493 1.677377 3.396170 1.649070
105 9 1 2.492141 2.633361 17.882894 8.842988 3.730945 9.800588 5.330275 2.788930 11.955152 3.691592
106 9 3 3.110227 3.100856 11.656308 18.006929 4.374772 9.362791 3.409348 3.143887 6.288376 2.659504
107 9 0 3.668810 3.546165 35.683400 40.656445 7.880342 4.054512 3.097052 4.935174 5.974746 11.331140
108 9 1 1.943348 1.387057 10.391565 5.080225 2.732555 1.825415 3.855079 1.772371 4.060810 1.881163
109 10 1 nan nan nan nan nan nan nan nan nan nan
110 10 1 nan nan nan nan nan nan nan nan nan nan
111 10 1 nan nan nan nan nan nan nan nan nan nan
112 10 2 1.065234 1.470097 1.605272 2.560059 3.464756 2.858502 1.872095 1.774465 1.675002 1.803928
116 7 2 1.229210 0.981525 1.212953 1.118686 4.283107 2.386379 1.775469 1.652424 2.126361 1.928685
117 7 3 1.175034 1.264581 1.804749 1.442300 3.043068 2.144123 1.922741 2.391737 2.695771 3.816212
118 7 3 2.019724 1.090267 4.582930 1.499278 2.563730 2.169124 3.326472 2.216513 3.620527 3.232658
119 7 1 nan nan nan nan nan nan nan nan nan nan
120 8 1 4.245959 4.168102 12.544314 3.129358 7.349619 21.184755 9.252670 1.746198 23.345334 2.697332
121 8 3 1.494514 1.593120 1.434051 1.209977 5.273690 4.192873 2.262498 2.121517 4.675947 7.508993
122 8 2 1.173369 1.103790 1.473750 1.327743 3.795642 3.002549 1.966533 2.366846 2.328540 2.074736
123 8 3 1.049366 0.924353 1.416538 1.244290 2.598582 2.237111 1.745931 1.763793 2.174519 2.101724
125 9 3 4.624262 1.921886 49.533721 14.818558 14.025721 5.890636 3.870825 2.143242 6.481394 2.984251
126 9 3 3.700599 2.968184 40.208335 10.189639 7.815296 10.985048 4.690127 5.090240 6.529325 4.239513
127 10 2 1.527350 1.400991 2.580972 1.279214 4.797051 3.351407 3.669298 3.936880 4.127594 5.433403
128 10 2 1.125957 1.228769 1.579895 1.549584 3.064356 2.501064 1.929589 1.994300 2.141075 2.196595
129 10 3 0.994034 1.081319 1.437821 0.979733 2.160665 1.865850 1.789022 1.817811 1.830363 1.850938
130 10 3 1.659428 1.665095 2.125407 1.556404 4.697645 3.311323 2.291765 1.884851 2.503097 2.303493
135 12 2 1.237485 1.209857 1.509615 1.242369 4.545182 2.660457 2.231899 2.338876 2.045285 2.340396
136 12 2 1.413552 1.083806 2.386211 1.207491 4.055552 2.232251 3.998728 2.463257 2.461781 1.827893
137 7 3 4.438209 3.861693 20.326768 20.801274 10.843035 6.559489 4.405511 2.432126 6.844984 2.350292
138 7 1 nan nan nan nan nan nan nan nan nan nan
140 13 2 3.108676 3.942048 14.496524 33.550777 4.139579 3.107394 3.763352 5.075459 4.989605 8.406215
141 13 2 7.563428 1.187521 10.937647 1.200192 29.971626 2.824546 15.998289 1.947076 12.741012 1.871232
142 13 2 6.627169 4.220936 9.012272 1.833613 7.050592 20.729012 3.092459 1.753859 4.403019 3.699126
143 14 2 1.271990 1.103684 1.831497 1.027609 5.057696 2.889618 1.994778 1.724452 1.918361 1.552037
144 14 3 1.284432 1.182467 1.253746 1.226153 5.104179 2.799456 1.689389 1.656610 2.480295 2.476688
145 14 3 4.680808 4.220557 13.762190 17.995895 15.714040 15.950480 1.845641 1.544156 2.093378 2.192664
150 15 1 2.074455 1.443590 15.917059 18.276749 3.331847 2.422621 2.480150 1.081922 2.478152 1.205777
155 12 2 3.505648 3.180341 10.949443 18.942343 4.860489 4.683797 3.652997 4.596500 4.393383 2.196083
156 12 3 1.273420 1.108217 1.217945 1.343207 4.639772 2.578189 1.700399 1.870227 1.559337 1.644281
157 12 3 1.075917 0.947266 1.452915 1.088118 3.221330 2.702992 1.858763 1.831281 1.775541 1.587114
158 12 3 1.297631 1.185373 2.204430 1.494461 4.313755 3.960507 2.248477 2.081692 3.615571 2.604836
160 13 3 4.996703 13.012353 17.623162 78.670389 6.577722 11.570240 6.773215 23.966540 8.458734 46.108699
161 13 0 3.490850 1.164746 2.555805 1.095195 7.756716 2.370788 3.907410 1.696659 6.446606 4.395433
162 13 0 0.996861 0.956888 1.187599 1.288677 2.950154 2.319996 1.872241 1.801884 1.544599 1.777079
163 14 2 1.090951 1.045180 1.476961 1.279813 3.147304 2.401422 1.965853 1.823328 1.821777 2.102494
164 14 2 1.089169 1.032779 1.475811 1.250403 3.253461 3.106070 2.043927 2.595835 1.954956 2.178723
165 14 0 5.125795 6.094594 2.670238 5.645031 17.455309 18.012487 3.180301 2.881682 6.860745 4.922185
166 14 0 1.697682 2.171269 1.409671 1.538374 4.912987 3.459494 3.286944 3.186598 2.447441 2.452443
167 15 1 1.703036 4.562829 1.842543 33.182370 3.529900 2.597981 3.076236 1.686401 3.532815 2.883982
168 15 2 1.271461 1.352478 5.855912 7.038143 1.559659 1.403429 3.865364 4.900005 5.097039 4.656351
169 15 2 0.977544 3.092237 3.625980 26.001637 1.877032 1.613390 3.217652 3.740615 5.830707 5.626822
170 15 2 1.303994 5.583037 4.849734 41.861989 2.250788 4.742214 3.971229 4.279314 6.527749 11.035740
176 12 0 1.038682 1.020008 1.468693 1.230734 3.941489 2.271439 2.036807 1.677651 1.942453 1.623574
177 12 0 1.233067 0.917999 1.197511 1.334756 4.036387 2.015304 1.757987 1.735391 1.888517 2.061151
178 12 0 1.289538 1.109212 1.375077 1.534310 4.829555 3.020593 1.950193 2.038530 2.028056 2.314103
179 12 1 1.313105 1.030127 1.279028 1.189491 3.068200 2.295410 4.126367 2.142740 2.474097 2.204416
180 13 3 2.177210 1.092978 11.677907 1.203095 6.632620 2.420790 4.376845 1.991242 3.819803 1.827516
181 13 3 5.581424 4.453485 1.038919 13.619880 29.891139 5.919151 2.327384 2.069295 2.253068 3.464931
182 13 0 1.570838 2.110414 2.627515 10.342270 4.682703 3.823494 4.484684 4.349456 6.142906 7.004144
183 13 1 1.120992 1.052453 1.468647 1.710560 3.517465 2.652152 1.911167 1.885192 2.320019 2.903516
184 14 0 1.212624 0.991048 1.271504 1.189094 3.366179 2.441901 1.917469 1.801140 1.756815 2.302031
185 14 1 1.016201 1.110759 1.029443 1.499148 2.953551 3.145332 1.766097 2.547545 1.773752 1.961533
186 14 1 0.995800 1.154899 1.173517 1.307774 2.294140 2.767040 1.889168 1.827341 2.037201 2.543715
187 14 1 1.106373 1.184122 1.398622 1.615037 3.351013 2.960313 2.364890 3.615626 5.027614 8.633604
189 15 3 nan nan nan nan nan nan nan nan nan nan
190 15 3 nan nan nan nan nan nan nan nan nan nan
191 15 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.525810 0.923658 4.065662 2.000676 5.114362 1.992580 3.274711 1.837952 2.804586 2.219496
206 19 0 1.083272 1.087380 1.574565 1.705370 2.790585 3.133413 2.181206 1.869029 1.981848 1.920674
207 19 1 1.063308 0.945803 2.360178 2.665003 3.366575 2.290872 2.027283 2.239898 2.000381 2.068253
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.027504 0.951476 2.072891 1.654074 2.759484 2.174066 2.063466 1.840173 2.179581 1.973020
224 19 1 1.298262 1.314659 7.428665 6.594550 2.165291 2.758703 5.389958 4.057580 9.577756 6.272555
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 7.216464 4.792311 16.634119 28.439544 10.504084 6.356854 6.326234 6.371331 6.754600 6.076428
321 2 3 1.855970 1.791619 2.055179 1.943417 3.382908 2.073576 1.750948 2.239271 1.842538 2.001972
323 2 3 1.719595 1.232571 2.689829 4.242606 3.865538 3.721444 2.129072 1.931472 2.172740 1.950683
324 4 3 0.921557 1.184468 2.544489 2.263591 2.189134 2.323438 1.777090 1.839228 1.802938 2.009141
329 12 1 0.947473 1.069663 2.176307 6.518434 2.782483 2.191199 1.893715 1.921551 1.947496 1.514166
333 12 1 1.081384 1.340152 2.822825 1.469498 2.506303 2.268293 1.908498 1.894755 1.773275 1.650436
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 [ ]: