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 = 2459820
Date = 8-28-2022
data_path = "/mnt/sn1/2459820"
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 2459820.25314 and 2459820.66944
1862 diff files found between JDs 2459820.25314 and 2459820.66944

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.082723 0.990671 1.534398 1.658957 2.018452 1.984920 1.809440 1.885065 2.435368 2.353589
8 2 0 1.963994 50.734801 5.202391 154.103073 3.681053 184.946372 4.193710 188.186383 5.587760 223.959626
9 2 0 0.987547 0.919872 1.420986 1.243186 1.638398 1.979693 2.439990 2.180386 2.167298 2.219401
10 2 1 0.981294 1.075205 1.436437 1.537750 2.010369 2.400127 1.686766 2.789234 2.580013 3.286034
15 1 3 1.499212 1.355683 2.037292 1.227094 2.368058 2.193348 2.530807 1.904463 9.259818 6.233884
16 1 3 1.276662 1.127358 1.683407 1.429493 2.358866 1.883803 2.018660 1.736545 9.465205 2.982816
17 1 3 1.206659 1.119623 1.452817 1.226345 2.136608 2.093683 1.948215 1.780834 2.164850 2.342199
18 1 0 85.558112 34.871038 1.724506 11.905709 376.683870 152.322847 1.760248 1.828688 2.447229 2.025314
19 2 1 1.528521 1.145256 4.575405 3.144746 1.762537 1.782065 1.729413 1.745067 2.587432 2.043930
20 2 1 1.024031 1.027969 1.413004 1.282413 1.595254 2.113851 1.553361 1.780334 1.838498 2.338100
21 2 2 1.244866 0.897030 3.906597 1.221929 1.776073 1.853303 1.868091 1.845578 2.310492 2.119454
27 1 0 7.561516 5.740054 8.680776 22.174966 20.505512 10.627294 4.113470 2.458132 4.487498 1.894312
28 1 0 56.778227 2.213942 1.074353 1.289097 284.053561 2.231933 1.861869 2.448334 3.380349 4.471079
29 1 1 1.333513 1.187248 1.819115 1.623605 2.039963 2.292832 2.988475 3.383940 5.237369 4.160340
30 1 1 1.361704 1.095842 1.922225 1.385852 2.348828 1.977517 3.181651 2.917080 3.436695 7.285496
31 2 2 1.326810 1.412876 1.418510 1.285282 2.049220 2.289768 2.620438 5.189850 5.650012 16.468205
32 2 2 1.866597 2.609340 1.560644 1.336460 2.922146 3.947258 5.943340 8.278095 6.701744 10.223500
33 2 3 106.307818 1.008417 1.457860 2.163238 495.180567 1.895966 1.808124 1.939141 2.454016 2.495513
36 3 3 1.607422 1.371592 1.791218 1.323887 1.900133 2.086975 1.944008 1.559699 2.276210 2.369489
37 3 1 1.453109 0.966964 3.295092 1.435267 2.352951 2.063247 2.060962 1.890355 2.231816 2.219747
38 3 1 1.043792 1.270239 1.750015 1.513541 1.848115 2.780115 1.849166 2.416816 2.245123 2.587463
40 4 1 1.136886 1.293936 2.509178 1.688479 2.220452 2.906073 2.040297 2.113633 2.039575 2.294680
41 4 3 1.083075 1.400963 1.479200 2.065013 2.046919 2.348824 1.902597 1.657062 1.766016 1.905193
42 4 0 1.082677 1.035129 1.545097 1.319505 2.329714 2.152927 1.809580 1.819758 2.727815 4.743391
45 5 0 1.199656 1.195445 2.114788 1.485740 2.399830 1.982144 2.742917 2.048924 2.747375 2.243108
46 5 0 1.301916 1.093957 1.612951 1.631626 2.315345 2.020604 1.929664 1.868840 2.529037 2.254580
50 3 3 2.469305 1.154606 1.474384 1.298688 2.979722 1.966216 2.019369 1.835494 2.551236 1.975711
51 3 2 4.343449 1.007133 1.570297 1.721198 8.898644 2.072974 1.769480 1.944212 1.869271 2.843471
52 3 3 1.775056 1.669029 1.442872 2.681878 2.046241 2.804395 2.011006 2.436842 2.162309 2.700140
53 3 2 1.177451 1.446429 1.885578 2.979713 2.014577 3.718837 1.899771 3.122799 4.295273 4.646006
54 4 0 1.041035 0.954929 1.392593 1.167268 2.355245 2.128052 1.867700 1.636042 2.892217 2.795293
55 4 2 1.205695 1.106260 2.046565 1.416016 2.230964 2.081725 2.068974 1.862627 2.713488 2.225516
56 4 1 1.599652 1.242160 1.480262 1.399358 2.432123 2.154422 2.189366 1.681315 2.975674 2.521215
57 4 3 1.467385 2.693376 2.080767 5.798087 1.982292 4.455559 1.867038 2.066017 2.245861 3.024862
65 3 0 1.223253 1.005578 2.327231 1.444424 2.316112 2.041676 2.046638 1.743178 2.173440 2.242764
66 3 0 1.607546 1.041299 3.340907 1.772979 3.198723 2.180225 2.527126 1.618946 2.565339 2.330477
67 3 0 1.116686 1.060740 1.454988 1.600106 1.799871 2.188473 1.750030 1.838580 2.107076 2.333561
68 3 1 1.207895 1.048682 1.245814 1.893144 1.969471 1.933604 1.664782 1.827984 1.801111 3.667573
69 4 1 1.040370 1.146918 1.450797 2.489305 1.947802 2.231311 1.947643 2.168717 2.264027 2.289338
70 4 2 1.888452 1.806540 1.383414 1.453402 4.713652 3.308562 3.273102 3.867170 2.633503 3.133307
71 4 2 1.184117 1.312874 1.806755 1.360793 1.797523 1.961592 1.824100 1.602434 1.911473 1.748793
72 4 0 1.234470 1.272512 1.838962 2.035258 2.703836 2.208999 2.066911 2.111054 4.745736 4.859558
73 5 0 1.275759 4.772572 1.680477 5.889645 2.789895 14.559217 2.316618 1.873055 3.875035 1.964549
81 7 0 2.163800 1.958094 2.136365 1.507248 2.538150 3.004367 3.255505 3.059733 10.119802 5.588314
82 7 0 1.192529 1.125029 1.407600 1.363876 1.759696 2.538341 1.665093 1.905942 2.482165 2.781286
83 7 0 1.340046 1.212710 1.670371 4.041550 1.867283 1.837528 2.253852 2.215632 2.992606 2.315559
84 8 3 1.833390 2.085414 1.940623 1.711718 2.271535 3.310364 2.289634 2.626736 6.853174 8.616646
85 8 0 1.074582 1.112081 1.958161 1.249490 1.874431 1.916732 1.878297 2.237216 2.977304 4.583874
86 8 0 2.479951 1.470456 2.268725 1.390472 3.406435 2.459838 4.312466 5.007789 3.538154 5.587646
87 8 2 1.644571 1.512297 1.891714 1.641669 1.982544 2.330469 2.056827 2.923118 4.152156 5.229025
88 9 0 1.698182 62.709117 4.238268 236.585141 2.828483 171.127840 2.920333 180.616659 4.026243 254.362095
90 9 0 1.030850 1.197561 2.272848 1.986871 2.220012 2.536202 1.738472 1.650843 2.466755 2.420191
91 9 1 7.252746 49.025668 7.899666 157.263341 32.880095 179.117549 28.542098 176.521528 26.315943 217.059603
92 10 0 3.840185 2.909721 0.794520 0.985161 4.127040 2.705585 3.716086 2.460470 4.774650 2.851281
93 10 0 1.092328 0.976849 1.565679 1.260327 2.285029 1.898421 1.987841 1.799855 2.608538 2.234809
94 10 0 1.130663 1.336762 1.406723 2.202618 2.068907 3.092554 2.283196 2.788926 2.392503 3.191497
98 7 2 2.934885 0.983267 1.614554 2.010188 5.678333 2.344399 19.294972 1.803553 271.451525 2.700684
99 7 2 1.318217 1.547038 1.785907 1.633623 1.748952 2.295582 2.041223 2.323969 5.103404 24.461657
100 7 1 1.485937 1.327780 3.301850 2.006068 2.557866 2.324086 1.951940 1.811333 2.808470 2.353685
101 8 2 1.813054 1.613179 1.656941 1.707132 1.913915 1.869304 1.718693 1.810489 2.496916 3.127647
102 8 0 0.854638 0.676065 1.161232 2.025021 2.684512 1.516186 0.535265 0.531833 0.943098 0.671754
103 8 1 1.663414 1.265783 2.139845 1.468988 2.296731 2.012208 2.246785 1.745781 4.343863 2.069187
104 8 1 3.518591 1.422973 0.430895 1.373641 2.622848 2.004513 4.326474 1.558351 5.513922 2.013161
105 9 1 1.687458 1.267828 2.724490 1.668115 2.479122 2.133855 2.335160 2.125049 3.421523 2.956739
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 1.778310 40.426429 4.669163 100.833740 3.084533 153.691397 2.831257 156.771547 6.798513 180.239304
108 9 1 1.194814 0.869116 2.106302 1.834366 1.684248 1.680329 1.894203 1.701343 2.709046 1.911920
109 10 1 1.792650 2.304400 1.916282 1.614148 3.117835 4.849987 1.930988 2.167377 2.252420 2.435273
110 10 1 2.333201 2.506230 1.945831 2.139916 2.732374 4.175828 2.275949 3.757738 2.487472 2.599279
111 10 1 1.477152 1.187400 2.046733 1.437747 2.607358 2.336809 2.143198 1.639791 2.092150 1.745375
112 10 2 1.016053 1.216125 1.331654 1.980898 1.731586 2.141073 1.716852 1.867655 2.021675 2.340026
116 7 2 1.228589 1.032505 1.432143 1.305533 2.924764 1.912882 1.700552 1.731682 3.407127 2.135375
117 7 3 1.336430 1.290990 1.288373 1.563608 1.889367 1.834587 1.960206 2.438997 3.569892 4.553774
118 7 3 2.916967 1.457108 5.089083 1.688227 3.924782 2.157620 4.494762 1.832961 4.363148 3.811110
119 7 1 1.227857 0.991128 1.703457 1.687326 2.131925 1.995015 2.083001 1.763956 6.492831 3.224222
120 8 1 4.737612 2.464930 13.524127 3.965303 10.998117 2.577456 14.867392 1.841994 40.127325 2.803235
121 8 3 2.222582 2.523456 3.458111 1.542597 4.610914 6.564777 3.476865 2.285229 7.271248 9.153312
122 8 2 1.767317 1.828963 2.035741 1.916001 2.960722 3.683506 2.321523 2.247247 3.629121 4.809050
123 8 3 1.444244 1.517907 1.785394 1.639647 1.690725 2.315679 1.552696 1.874339 2.408917 2.953230
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 2.112251 1.547127 2.687005 1.610915 4.142448 4.266875 4.592432 3.884385 5.972349 5.626623
128 10 2 1.317223 1.129117 1.738044 2.006023 2.176296 2.548621 2.028149 2.066716 2.446429 2.513964
129 10 3 1.093115 0.948485 1.587341 1.472246 1.941346 1.850791 1.678338 1.789857 1.814797 2.158519
130 10 3 1.176229 1.115426 1.798845 1.410980 2.327753 2.032058 2.006033 1.542716 2.803812 2.061479
135 12 2 1.226465 1.155224 1.854552 1.360897 3.022726 2.430965 2.351994 2.454758 2.890679 2.139413
136 12 2 1.676560 1.335306 1.367614 1.438806 2.357132 2.165598 4.678762 2.750491 2.486858 3.942008
137 7 3 6.300579 2.433647 22.443179 7.132885 17.627153 3.567928 5.711899 2.409670 8.969173 3.428012
138 7 1 1.184243 39.786891 1.329200 151.538109 1.846698 124.898726 1.860058 130.457108 2.956965 139.448004
140 13 2 5.141675 9.139078 13.437645 51.598039 10.410976 5.370757 5.699756 15.429005 5.251331 33.115442
141 13 2 8.724274 1.409940 17.724646 1.317569 29.689711 2.609440 21.505152 1.855045 22.098540 2.436930
142 13 2 7.636443 2.459784 9.862674 2.603042 11.476219 2.712854 3.547306 2.366418 8.179488 6.001542
143 14 2 1.334965 1.058902 2.190066 1.200480 2.297917 1.823726 2.457134 1.836498 2.516586 2.092106
144 14 3 1.099623 1.313327 1.537238 1.328715 1.990968 1.869162 1.678573 1.875809 1.973661 2.644696
145 14 3 6.980696 8.893648 30.736102 28.414082 31.107520 27.881214 4.249590 1.819421 3.750051 1.883078
150 15 1 5.123959 16.291759 32.875984 78.485513 7.718833 16.909184 7.292905 31.947081 7.172352 53.002889
155 12 2 2.986860 5.719657 9.139020 25.924304 4.563324 5.855548 4.263229 3.502501 4.765703 2.772146
156 12 3 1.386579 1.405477 1.392766 2.993234 2.229187 2.399984 1.755899 2.159230 1.571792 2.617183
157 12 3 1.496404 1.247613 1.427332 1.427075 1.976293 2.006084 1.843841 1.742325 2.207064 2.079423
158 12 3 1.713898 1.224169 4.226904 1.386697 4.435617 2.350660 3.378351 2.308920 4.141569 2.875361
160 13 3 nan nan nan nan nan nan nan nan nan nan
161 13 0 4.489377 1.174322 1.433160 1.925713 5.724146 2.328825 3.618355 1.883976 6.863970 4.435123
162 13 0 1.183814 1.126857 1.550516 1.587961 2.174574 2.180763 1.870474 1.868628 1.861269 1.914299
163 14 2 1.163249 1.054242 2.068263 1.596370 1.919844 1.965654 1.949986 1.687281 2.196941 2.266031
164 14 2 1.126564 1.030210 1.575025 1.272104 2.088967 1.831883 2.124108 2.405105 2.337182 2.799911
165 14 0 4.583144 6.308248 4.745284 4.011580 14.009091 13.136112 3.981421 4.980830 23.971031 14.478804
166 14 0 1.582996 1.872100 1.565031 1.981093 2.165836 2.752640 2.356859 3.256319 2.096017 2.988302
167 15 1 3.475901 4.229374 2.148466 15.991955 4.213142 3.866521 2.216874 2.852628 3.739931 2.383242
168 15 2 2.150811 13.346274 5.679906 58.927753 3.455558 32.879607 5.669213 20.582490 8.427902 47.701536
169 15 2 1.849346 27.759979 4.447073 101.595064 2.981758 84.181883 3.156742 86.510452 4.817162 91.595375
170 15 2 2.552265 31.621742 4.903127 116.467011 4.910803 96.265314 6.731843 94.357798 8.274175 107.377551
176 12 0 1.087428 1.080187 1.665206 2.312176 2.068751 2.006984 2.020746 1.889459 2.684176 2.442773
177 12 0 1.241590 1.227979 1.443980 1.351297 2.030890 1.815008 1.669847 1.555853 2.011905 2.415869
178 12 0 1.071868 0.950248 1.332216 1.353149 1.685624 2.246723 1.691661 2.020388 2.168415 2.173347
179 12 1 1.604903 1.178408 1.283119 3.075734 2.598098 1.886762 4.624974 2.264067 2.911971 3.032529
180 13 3 nan nan nan nan nan nan nan nan nan nan
181 13 3 nan nan nan nan nan nan nan nan nan nan
182 13 0 3.540659 16.637298 8.165138 40.375042 14.351200 62.283316 2.735609 60.362882 4.554449 61.122600
183 13 1 1.387013 1.234190 1.670843 2.667186 2.982364 2.108691 1.872457 1.853133 2.422580 3.714819
184 14 0 1.071160 1.015738 1.314654 1.445339 1.971709 1.763778 1.697439 1.695373 3.753700 5.258420
185 14 1 1.058265 1.200349 1.288248 1.924746 1.905648 2.252058 1.792891 2.691704 2.101280 2.397782
186 14 1 1.053311 1.448368 1.380364 1.667327 2.031670 2.132213 1.958571 2.123593 2.357553 2.781302
187 14 1 1.315016 1.438670 1.526579 2.073171 2.228327 2.945938 3.418717 4.124306 8.541942 16.993904
189 15 3 1.268250 1.215372 1.647990 1.599874 2.196053 2.188519 1.743055 1.752620 1.691298 1.659100
190 15 3 5.669021 3.471450 16.376540 1.149409 8.540561 3.325086 4.170048 3.024751 4.551011 4.183016
191 15 3 1.133542 1.237973 3.675616 2.424247 1.832643 2.098581 1.677072 1.876228 1.703412 1.869111
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 0.066598 0.064143 0.043905 0.010232 0.090234 0.048276 0.028052 0.012709 0.027412 0.014868
206 19 0 0.062466 0.045860 0.011624 0.014482 0.043467 0.034433 0.013639 0.009980 0.014539 0.009225
207 19 1 0.057185 0.056364 0.014072 0.030599 0.049383 0.051683 0.011984 0.011139 0.013706 0.014630
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.066695 0.057346 0.012737 0.012411 0.047078 0.042230 0.011453 0.010196 0.013302 0.011428
224 19 1 0.042817 0.092420 0.007245 0.036465 0.036016 0.147310 0.015339 0.072189 0.038613 0.073080
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.301316 6.849995 15.548143 40.900579 11.415760 12.614899 11.228787 5.883102 8.983520 5.579619
321 2 3 1.507005 1.178234 1.931567 2.113767 2.188227 2.186469 1.763728 1.677106 2.147509 1.950268
323 2 3 2.122445 3.521794 3.961876 5.676270 3.984509 4.451489 1.969344 1.782491 2.171800 2.699541
324 4 3 1.524774 2.506689 4.021801 47.193002 1.691074 1.857153 1.738816 1.637011 1.974948 4.052200
329 12 1 1.237318 1.175895 4.629746 9.247118 1.867985 2.087943 1.528039 2.176631 1.996967 1.977971
333 12 1 1.639006 1.469883 2.077942 2.012917 2.396120 4.954851 1.877604 1.726659 2.036546 1.631323
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 [ ]: