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 = 2459815
Date = 8-23-2022
data_path = "/mnt/sn1/2459815"
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 2459815.25319 and 2459815.33618
372 diff files found between JDs 2459815.25319 and 2459815.33618

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 1.022600 0.945291 6.612825 4.561054 1.655969 1.787005 1.608014 1.724982 1.541246 1.601188
8 2 0 1.260480 12.730143 3.970031 29.354505 2.184596 52.743782 2.855758 58.845426 3.137009 71.012379
9 2 0 0.867408 0.859582 1.217909 1.042711 1.896004 1.861689 1.633936 1.793473 1.663481 1.572431
10 2 1 0.860635 0.925312 1.280303 1.692466 1.809231 1.876712 1.633757 2.314099 1.795367 1.690133
15 1 3 1.093060 1.262245 1.173026 1.254805 2.141573 2.863457 2.014866 2.597083 2.966312 3.986767
16 1 3 1.096079 1.116388 1.193261 1.018511 1.937634 1.948148 1.920731 1.972469 6.175010 4.644037
17 1 3 0.973491 0.890638 1.113287 0.903748 2.223605 1.681823 1.915123 1.700729 1.716321 1.592784
18 1 0 32.310747 8.215253 25.737148 7.165379 140.091796 26.068460 1.501350 1.799175 1.472624 1.775489
19 2 1 0.826905 0.939137 2.049326 2.210470 1.659596 1.923101 1.786154 1.808613 2.034369 2.539699
20 2 1 0.937226 0.897809 1.340120 1.003720 2.082459 1.870266 1.807357 1.796203 1.762547 1.699690
21 2 2 0.852378 0.844188 1.329272 0.927451 2.089492 1.689917 2.143275 1.788059 1.856829 1.650522
27 1 0 4.116745 3.809540 7.289455 17.577958 12.541523 5.509001 3.497300 1.951275 3.391263 1.814105
28 1 0 68.228408 2.059407 43.419891 1.311030 339.064114 9.376966 1.752005 1.863012 1.553238 2.280154
29 1 1 1.195709 0.996633 1.990140 1.269396 2.126580 2.060378 2.646594 2.807342 5.483454 3.735462
30 1 1 1.044384 0.998936 1.214649 0.964298 1.880038 1.755470 3.674755 3.261039 2.559913 6.125741
31 2 2 1.013823 1.136166 1.265833 1.039142 1.941260 2.143108 2.720677 6.341474 3.249853 8.688908
32 2 2 1.564510 1.310532 0.882595 1.043183 2.169512 2.722357 4.221176 5.747046 5.179100 8.185691
33 2 3 38.698038 0.977194 24.792761 1.146446 173.579678 2.039947 1.676366 1.773153 1.486436 1.741990
36 3 3 0.972911 0.871905 1.258071 1.281634 1.789800 1.997662 1.885870 1.790887 1.663849 1.698448
37 3 1 0.971712 0.943937 4.131213 1.601760 1.959100 1.868348 1.934290 1.875688 2.103925 2.248180
38 3 1 1.009690 1.235401 1.556408 1.616532 1.882551 2.157072 1.924638 2.208707 1.823328 2.136635
40 4 1 0.904778 1.057302 1.576629 1.191545 1.819286 2.169343 1.876029 1.957441 1.806943 1.968402
41 4 3 0.921297 0.998125 1.286995 2.726322 1.898838 1.751335 1.897071 1.878836 1.684251 1.877437
42 4 0 1.118957 1.081025 1.235039 1.197392 2.281028 2.044051 1.849753 1.879626 1.717599 2.552723
45 5 0 1.133921 1.143477 2.085869 1.081328 2.824574 1.679891 2.749276 1.882637 2.555927 1.679667
46 5 0 1.288352 1.157466 1.111142 1.189357 2.772235 2.071903 2.066262 1.719216 2.125243 2.114041
50 3 3 2.123697 1.065730 1.244360 1.217618 2.232889 1.771505 1.672207 1.870838 1.598974 1.700543
51 3 2 1.646468 0.988940 20.666136 1.381158 1.885938 2.090506 1.814270 1.949457 1.596306 1.780764
52 3 3 1.091179 1.148278 1.281355 1.338423 2.067796 1.826305 1.971825 1.836950 1.681761 1.559123
53 3 2 1.004005 1.197884 1.714308 1.544133 2.187355 2.464521 2.024293 2.219789 2.798214 2.657296
54 4 0 0.907052 1.067631 0.997912 0.881823 1.758312 1.937300 1.645335 1.724877 1.533390 1.704072
55 4 2 0.966895 1.019299 1.430657 1.053778 1.834583 1.661563 1.976649 1.658929 2.084165 1.685728
56 4 1 1.081432 1.055003 1.287777 1.284208 2.542272 1.850408 1.979800 1.825834 2.085025 1.741307
57 4 3 1.048080 1.077596 1.539195 3.562869 1.790990 3.238262 1.822251 1.634818 1.851595 2.692284
65 3 0 0.980579 1.064047 1.749211 0.889129 2.143717 1.632203 2.119665 1.540616 1.681842 1.367694
66 3 0 1.028377 1.033622 1.524726 1.305027 2.091191 1.754189 2.096434 1.661575 1.846562 1.579008
67 3 0 0.899501 1.008867 1.317336 1.108175 1.602565 1.634265 1.760926 1.471077 1.525088 1.492589
68 3 1 0.926409 1.040085 1.140134 1.376020 1.738283 1.662689 1.668197 1.950908 1.822871 1.868472
69 4 1 0.966267 1.152829 1.096014 1.434448 1.971808 2.209778 2.013227 2.167809 1.909197 1.910575
70 4 2 1.137528 1.274713 1.376806 1.319635 2.854157 2.426278 3.850374 2.640695 1.976266 1.973530
71 4 2 1.134698 1.011974 1.267105 0.942024 1.785572 1.717141 1.871918 1.513440 1.625972 1.546883
72 4 0 1.185839 1.526747 1.575424 1.581121 2.793524 3.817462 1.973486 2.369273 2.869731 3.889251
73 5 0 0.996803 2.300660 1.359147 4.784197 1.977626 6.465224 1.834001 1.828410 2.052069 1.802227
81 7 0 1.295666 1.073784 1.632572 1.122241 2.478588 1.928997 2.366368 1.927233 9.162441 2.980470
82 7 0 0.823871 1.028844 1.122536 1.267435 1.698146 2.012315 1.606234 2.006320 2.309234 2.900985
83 7 0 1.006582 0.959697 1.703723 2.789274 1.823150 1.905622 1.797972 1.858611 1.714221 1.667340
84 8 3 1.332440 1.284836 1.419490 1.474045 2.887509 2.916463 2.514267 2.275315 3.961716 3.397306
85 8 0 0.926315 1.172935 1.255544 1.334105 1.789110 1.933503 2.063606 2.709860 2.660317 4.240072
86 8 0 1.373595 1.185815 1.490177 1.212238 2.348166 1.969984 2.623126 2.757034 2.299202 2.724294
87 8 2 1.106546 2.606142 1.381710 1.947214 2.203028 5.300213 2.942741 13.659869 5.181776 8.963927
88 9 0 1.887335 23.299568 3.253338 140.653874 2.885959 71.704767 2.157072 75.296473 2.286847 112.680174
90 9 0 0.914600 0.966150 1.327883 1.127812 1.783824 1.649304 1.769479 1.686145 2.008298 1.615477
91 9 1 0.984020 16.107482 3.571432 47.853435 2.407412 60.107891 2.585277 62.838318 2.813998 78.867713
92 10 0 4.327508 1.838655 0.712645 0.975000 5.547216 5.667954 2.415843 2.210336 2.442657 2.559903
93 10 0 0.906422 0.931438 1.164431 0.863526 1.760512 1.751588 1.884119 1.683217 1.651202 1.664733
94 10 0 0.895764 1.137808 1.254620 1.656585 1.886153 2.362158 2.130535 2.435908 1.964652 3.425992
98 7 2 0.952022 0.958221 1.344030 1.253769 2.346468 1.732863 2.122458 1.564735 3.798591 1.464129
99 7 2 1.019118 0.936060 1.371307 1.244915 1.967361 1.832919 1.965233 1.670136 3.347448 1.940061
100 7 1 1.343152 1.058083 1.497875 1.551436 2.270045 2.172695 1.978325 1.865033 1.916121 1.768018
101 8 2 1.050981 1.025900 1.287104 1.369801 1.837805 1.795541 1.863942 1.949273 1.442217 1.837119
102 8 0 1.154696 1.772602 2.612752 10.689868 2.518237 2.621122 1.867291 5.000164 2.253414 5.418629
103 8 1 1.132798 0.945897 1.271439 1.156955 2.197340 1.744863 2.172964 1.886583 3.245336 1.584166
104 8 1 2.144834 0.862203 0.287589 1.231685 2.300085 1.926234 3.953410 1.777229 3.496820 1.819124
105 9 1 0.901266 0.977135 2.062255 1.498682 1.644370 1.922918 1.981148 1.948917 1.888623 2.004225
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 10.598226 3.219573 50.240258 17.205346 7.084617 2.843302 19.005130 6.163634 27.184463 11.392854
108 9 1 0.801331 0.991714 1.403137 1.081006 1.637813 1.836163 1.695342 1.932681 1.576040 1.699076
109 10 1 1.035828 1.048816 1.115392 1.335131 2.248758 2.041715 1.903790 2.094348 1.539576 1.879964
110 10 1 0.870273 1.448741 1.400582 1.444390 2.029615 2.170034 1.743440 1.922793 1.702333 1.492256
111 10 1 1.015632 1.077022 1.231919 1.217537 1.918269 2.048272 1.692171 1.522247 1.616702 1.382040
112 10 2 1.561685 2.346749 1.633076 6.001095 2.520708 3.169038 1.748617 1.787902 1.677394 1.785446
116 7 2 1.079757 0.938350 1.127167 0.969421 2.509406 1.733463 1.882466 1.670976 2.245588 1.381172
117 7 3 0.896574 1.048044 1.452707 1.539017 1.723981 1.927402 1.865188 2.526402 2.084802 3.506745
118 7 3 1.693217 0.982988 4.280462 1.380433 2.512384 1.873001 3.165067 2.036928 3.111733 2.639886
119 7 1 0.803150 0.807125 1.239140 1.433309 1.674659 1.594806 1.859497 1.717838 1.640105 1.688628
120 8 1 3.710281 1.468274 11.642380 2.427061 6.896263 5.514573 7.757265 1.427346 23.300212 1.646815
121 8 3 1.874116 1.833454 2.764358 1.253671 5.524097 4.391955 3.672749 2.512914 3.701782 7.833100
122 8 2 1.250756 1.091589 1.546090 1.495651 2.720857 1.717635 2.340903 2.317982 2.276058 2.909680
123 8 3 0.904338 0.930742 1.580630 1.169037 1.858256 1.776951 1.906221 1.765645 1.748592 1.646757
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.091566 1.220413 1.344852 1.055991 2.415222 2.624231 2.854599 3.107435 2.976999 3.879870
128 10 2 1.172846 1.079751 1.170637 1.052052 1.697775 1.898824 1.681540 1.843848 2.009139 2.255764
129 10 3 0.948932 0.982724 1.275036 1.235625 1.656641 1.838374 1.638834 1.865536 1.567303 1.917188
130 10 3 1.148749 1.168683 1.266052 1.036202 2.054886 1.823922 1.579684 1.690854 1.887442 2.023815
135 12 2 0.998645 1.002795 1.122182 1.063359 1.933655 1.916326 1.902475 1.852844 1.708791 1.661896
136 12 2 1.080276 0.999898 1.659761 1.410508 1.888968 1.568806 3.150972 2.091312 1.936330 1.816115
137 7 3 4.316296 21.445700 20.181502 71.716258 13.688934 79.225163 4.676123 79.155941 7.318813 104.882484
138 7 1 2.275486 5.464903 1.940631 5.540841 4.036387 7.139419 1.542741 3.652948 1.758686 6.730772
140 13 2 3.178407 6.370603 9.243630 36.830918 3.825911 3.787493 3.590681 11.355341 4.602387 24.279756
141 13 2 4.856636 1.055786 9.644582 1.118870 18.411330 2.067731 11.496278 1.687078 7.824406 1.908458
142 13 2 3.813155 1.808183 7.376013 1.753800 5.815584 6.972502 2.885326 1.871578 3.898027 3.474804
143 14 2 0.905938 1.021458 1.249553 1.113952 1.706078 1.939004 1.858507 1.912309 1.596605 1.811556
144 14 3 1.047085 1.039111 1.185656 1.191146 2.200737 1.892083 1.771112 1.685125 1.861138 2.154990
145 14 3 3.773433 5.081307 20.130357 18.039846 13.623020 12.389046 3.000884 1.964146 2.643355 2.007763
150 15 1 3.477079 6.374752 17.875862 41.741591 4.458127 7.865484 4.463912 14.382029 7.526450 29.286325
155 12 2 3.275541 2.870542 8.913448 15.154794 2.791170 4.469097 2.632903 4.192359 2.952618 2.031121
156 12 3 1.025366 1.051329 1.180245 1.354326 2.343248 1.811886 1.935428 1.759697 1.644070 1.606549
157 12 3 0.947676 0.849270 1.413604 1.213106 2.021732 1.917018 1.976630 1.885496 1.951578 1.763227
158 12 3 0.994018 0.978453 1.115521 1.130275 2.229266 1.965168 1.946612 1.920677 2.760453 3.007064
160 13 3 3.552693 6.115507 9.102280 24.975072 9.457043 11.705149 3.242386 3.959515 2.902145 3.051469
161 13 0 2.929437 1.050750 1.233276 1.104570 4.467660 2.080866 2.895806 1.747687 5.408107 3.762726
162 13 0 1.006154 0.916507 1.115585 1.151276 1.833296 1.892037 1.635949 2.011838 1.617916 1.798645
163 14 2 0.962658 0.942634 1.518708 1.327276 1.984284 1.563352 2.138251 1.773444 2.017538 2.666835
164 14 2 1.044181 0.853990 1.228177 0.988712 1.925105 1.586168 2.002976 2.635311 1.756271 1.835534
165 14 0 3.115449 2.412390 3.828932 4.009250 9.653838 6.057172 3.163251 4.935629 6.375670 6.250164
166 14 0 0.964127 1.272000 1.437766 1.340410 1.775469 2.242315 1.888438 2.240524 1.957455 2.875068
167 15 1 1.194306 3.186245 3.617713 2.338775 2.482402 1.700677 3.064530 1.891412 2.493132 1.943578
168 15 2 nan nan nan nan nan nan nan nan nan nan
169 15 2 nan nan nan nan nan nan nan nan nan nan
170 15 2 nan nan nan nan nan nan nan nan nan nan
176 12 0 0.866707 0.879263 1.399702 1.237979 1.981734 1.924027 1.954557 1.728515 2.284942 1.914770
177 12 0 0.991399 0.899055 1.169808 1.286781 1.742953 1.884872 1.627083 1.995149 1.959966 1.870741
178 12 0 0.930304 0.970461 1.022832 1.615251 1.699176 1.925833 1.773113 1.976111 1.459925 1.928649
179 12 1 1.190607 0.980369 1.242430 1.285372 2.339649 1.893174 4.263674 2.519678 2.586832 2.666036
180 13 3 2.029161 1.003430 8.440367 1.220060 5.277154 2.299573 3.127272 1.931112 2.817476 1.768699
181 13 3 2.818384 5.229841 1.206448 10.515994 4.398547 7.029558 2.102883 1.733688 2.106099 1.717942
182 13 0 5.473096 1.279196 11.536740 3.540890 17.773635 2.903612 2.865421 1.985297 2.749860 2.655366
183 13 1 1.037086 0.927349 0.980797 1.152355 1.900194 1.935310 1.525653 1.843908 1.866485 2.128053
184 14 0 0.933698 0.892555 1.026445 1.085170 1.733604 1.954587 1.691352 1.621292 2.231530 3.301256
185 14 1 0.994809 1.186529 1.179603 1.421019 1.934747 2.041213 1.993863 2.406291 1.933410 1.811432
186 14 1 0.898124 1.109894 0.919662 1.449449 1.993057 1.907871 1.985211 1.837912 1.836788 1.824662
187 14 1 0.855539 1.167978 1.210627 1.774520 1.904984 2.569293 2.180198 2.976469 4.520672 6.825619
189 15 3 1.022397 0.949500 1.153434 1.107400 1.940963 1.894058 1.804885 1.696619 1.797667 2.476092
190 15 3 3.295846 2.040350 13.532259 0.664469 4.952907 2.654482 3.201210 2.941196 3.065852 2.997193
191 15 3 0.934485 0.960708 0.894277 0.981764 1.868763 1.811660 1.948501 1.835317 1.801498 1.861206
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 0.109605 0.064701 0.075023 0.013965 0.150512 0.061763 0.049262 0.014207 0.038696 0.014303
206 19 0 0.071955 0.080374 0.015686 0.015498 0.070731 0.068056 0.017624 0.018012 0.016301 0.020286
207 19 1 0.061986 0.052044 0.014260 0.012586 0.059192 0.056918 0.014192 0.012426 0.015326 0.013081
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.065514 0.062387 0.016975 0.015222 0.068859 0.060611 0.018428 0.016864 0.016254 0.016917
224 19 1 0.034433 0.032250 0.008391 0.006944 0.035500 0.037226 0.010247 0.005845 0.017297 0.009444
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.930375 4.554371 14.061226 26.228617 6.742688 5.763243 8.375322 3.285861 7.984723 14.332489
321 2 3 1.121861 0.898564 1.805633 1.621016 1.661812 1.583208 1.639729 1.814278 1.656442 1.731728
323 2 3 1.129966 1.818286 2.873582 4.739633 2.005128 3.259488 2.188867 1.935880 1.884727 1.862484
324 4 3 1.011790 1.263577 1.849482 2.348631 2.035373 3.834813 1.793971 1.593094 1.791265 1.892781
329 12 1 1.327259 1.693052 9.931484 17.981038 2.137981 1.696277 1.748443 1.822010 1.663340 1.570323
333 12 1 1.689319 1.385472 2.191982 1.390252 2.200373 2.117710 1.696895 1.665908 1.612441 1.471405
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 [ ]: