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 = 2459790
Date = 7-29-2022
data_path = "/mnt/sn1/2459790"
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 2459790.25319 and 2459790.33618
372 diff files found between JDs 2459790.25319 and 2459790.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 1.454429 1.113189 1.449861 1.369587 2.297194 2.298381 1.746335 1.790578 1.296580 1.936411
4 1 2 1.065168 0.929624 6.734476 18.709296 2.437342 1.990498 1.886935 1.807139 1.909605 1.693611
5 1 2 0.989840 1.168681 1.518033 1.309915 1.968626 2.682043 2.366556 1.658453 3.920477 3.793541
7 2 0 1.079872 0.949701 1.514945 2.191335 2.316598 1.992450 1.646123 1.863733 1.688606 2.094643
8 2 0 1.497271 16.343470 4.745788 44.473296 2.128539 70.184201 2.331832 65.722247 2.942482 78.341677
9 2 0 0.888893 0.890164 1.374827 1.138449 1.934987 1.942038 1.903868 2.015267 1.567940 1.410926
10 2 1 0.928017 1.157664 1.631763 2.000309 2.020744 1.991273 1.659375 2.454383 1.918696 2.361078
15 1 3 1.235576 1.055429 1.511439 1.216446 2.573074 2.301469 1.697379 1.813568 4.117616 3.870144
16 1 3 1.018772 1.059095 1.594965 1.599707 2.383304 2.265004 1.813509 1.916598 4.829673 6.075536
17 1 3 1.076511 1.097589 1.161334 1.287468 2.188487 2.010253 1.564394 1.573602 1.589692 1.889053
18 1 0 84.574390 81.441261 1.248186 1.315970 394.414174 428.633072 1.540751 1.579071 1.372661 1.514832
19 2 1 0.876829 1.068969 1.584756 1.802370 1.986571 2.047762 1.625199 2.026175 2.873390 6.887704
20 2 1 0.853746 0.899330 1.629233 1.485828 1.831182 2.164584 1.746378 1.764660 1.564606 1.619557
21 2 2 0.961213 0.929841 1.386373 1.218555 2.515403 2.419727 2.192216 1.874038 1.518278 1.807933
27 1 0 2.732137 3.225925 7.169256 17.322886 9.534300 5.315240 3.500086 1.902336 3.850491 1.856991
28 1 0 88.838776 2.812759 0.912947 1.687648 445.988535 14.257654 1.836391 2.083821 1.774453 2.302215
29 1 1 1.072598 1.070328 1.348691 1.283795 2.596598 2.416000 2.280766 2.537503 4.626772 3.654096
30 1 1 1.130891 1.062754 1.980327 1.298464 2.737961 2.109267 2.824274 2.685341 1.905089 2.959358
31 2 2 0.950102 1.196981 1.368879 1.137586 2.186825 2.601439 2.236326 3.791255 2.642408 6.887822
32 2 2 1.114511 1.810723 1.122614 1.646294 2.496708 2.878379 3.384774 7.245845 2.537092 5.483275
33 2 3 86.031862 0.949076 1.276026 1.339853 397.013489 2.448374 1.561167 1.907021 1.456054 1.564873
36 3 3 1.439290 1.375046 1.699979 1.472088 2.257959 2.201605 1.578140 1.667279 1.357683 1.692053
37 3 1 1.218601 0.951868 5.235592 2.628355 3.239602 2.482649 2.514363 1.800669 2.578827 2.177647
38 3 1 0.938242 1.187604 1.970129 1.236016 2.346776 2.701550 1.701080 2.300601 1.494603 1.697161
40 4 1 1.008262 1.009059 1.699644 1.369189 2.470967 2.391873 1.732801 1.996540 1.460912 2.806025
41 4 3 0.988189 1.091383 1.255978 1.683715 2.412244 2.402547 1.607082 1.695383 1.371028 1.463507
42 4 0 1.021362 0.989224 1.320680 1.156800 2.608140 2.428660 1.657186 1.790233 1.844484 3.281205
45 5 0 1.294719 1.117991 2.870810 1.655774 2.648829 2.286834 2.225262 1.974785 2.126356 1.828389
46 5 0 1.860285 1.754883 1.537203 1.299621 3.703912 3.610850 2.031390 1.926527 1.968096 2.865961
50 3 3 2.824791 1.052997 1.281675 1.445249 2.783489 1.957325 2.507631 1.562660 2.776142 1.386871
51 3 2 6.432795 1.069253 19.368457 2.136950 8.815207 2.352435 4.596479 1.586914 6.138982 1.743642
52 3 3 7.865073 1.186084 27.292249 1.851474 7.949191 2.215812 4.967175 1.576460 5.669097 1.593112
53 3 2 1.029468 1.043880 2.003419 2.161806 2.680249 2.878755 1.799090 2.244669 2.289900 2.824207
54 4 0 1.040901 0.948283 1.278390 1.406628 2.839006 2.964545 1.856974 1.915391 2.170474 2.373560
55 4 2 1.032839 0.889937 1.612371 1.400978 2.286578 2.624700 1.694050 1.846428 1.814772 1.755513
56 4 1 1.110152 1.185395 1.276156 1.389699 2.301929 2.465946 2.043367 1.933465 1.986803 2.295313
57 4 3 0.990997 1.685361 1.325834 8.407380 2.354067 1.987333 1.632122 1.775395 1.313501 1.810411
65 3 0 1.178463 0.847893 2.501344 1.360543 2.606460 2.097923 1.974291 1.524887 1.785864 1.246722
66 3 0 1.340389 0.990112 3.146204 1.675398 3.668340 2.808717 2.335813 1.688506 2.094528 1.924583
67 3 0 1.028402 1.070990 1.418527 1.426991 2.264857 2.782513 1.584593 1.564949 1.372333 1.574171
68 3 1 1.124441 1.031849 1.381292 1.497880 2.712226 2.367232 1.706995 2.008711 1.743664 2.137550
69 4 1 1.069480 0.989177 1.486369 1.945907 2.416115 2.352568 1.990758 1.913778 1.797631 2.193598
70 4 2 1.235893 1.344809 1.558975 1.546686 3.395973 2.615922 1.891173 2.034377 1.514396 1.656892
71 4 2 1.079427 1.177080 1.335393 1.346150 2.291485 2.914783 1.575384 1.720788 1.415283 1.534052
72 4 0 1.084551 1.058502 1.593204 1.537911 2.754928 3.167350 1.755264 1.913578 4.753567 5.677764
73 5 0 1.122284 1.279472 1.573659 1.412878 2.212578 2.543829 1.729801 1.785915 2.009668 2.550395
81 7 0 1.395741 1.829857 1.726440 1.649241 2.281477 3.001309 2.538996 2.773704 6.205228 4.890689
82 7 0 1.102068 1.013674 1.448581 1.104693 2.208368 2.641300 1.664648 1.777591 1.674127 1.943128
83 7 0 1.281753 1.468525 1.737848 1.884842 2.564881 2.368686 1.863729 2.288874 1.776229 2.234972
84 8 3 1.370624 1.278082 1.527992 1.825472 2.080767 2.191738 1.706867 1.732939 4.104362 5.029029
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 1.369486 1.259106 1.921662 1.523649 2.153253 2.379838 2.014038 2.601543 2.923073 2.402921
88 9 0 2.144242 7.635805 14.275157 34.561676 4.673660 30.388215 4.255427 3.825401 7.449325 2.480398
90 9 0 8.703428 4.526334 2.948848 3.078146 14.245745 11.994153 37.227706 9.858891 32.308258 17.595590
91 9 1 3.401766 3.644202 14.161123 5.872918 4.672021 8.779437 6.394007 4.028625 8.265470 2.398117
92 10 0 2.825039 3.015008 0.497788 1.181650 4.271512 9.738975 2.717459 1.985301 2.415722 2.369642
93 10 0 1.121449 1.006418 1.632151 1.576406 2.469691 2.330687 1.616497 1.670309 1.546813 1.915626
94 10 0 0.993980 1.094862 1.382756 1.939665 2.400733 2.831324 1.732006 2.405846 1.667469 8.798045
98 7 2 nan nan nan nan nan nan nan nan nan nan
99 7 2 nan nan nan nan nan nan nan nan nan nan
100 7 1 1.260370 1.068094 1.751150 1.653198 2.413217 2.476812 1.743118 1.824525 2.057235 2.105969
101 8 2 1.455581 1.373490 1.700227 1.560428 2.278421 1.815701 2.038768 2.139944 1.896976 3.609379
102 8 0 nan nan nan nan nan nan nan nan nan nan
103 8 1 1.348766 0.986423 1.913555 1.399281 2.570341 2.855297 1.977280 1.870209 1.985922 1.763073
104 8 1 2.103226 1.353261 0.403113 1.506071 2.654679 2.253849 3.490262 1.388592 3.267418 1.468058
105 9 1 2.323473 2.245096 17.347273 6.295702 3.306668 6.738499 4.736198 2.071212 10.029006 2.731652
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 3.675913 2.843953 6.049079 28.760451 6.981182 3.311583 3.760782 4.173518 5.623064 8.994401
108 9 1 1.137925 1.092125 1.430918 1.621794 2.064853 2.631053 1.565341 1.917182 2.786196 2.446673
109 10 1 1.565616 1.421997 1.433747 1.701874 2.915964 3.411765 1.551600 1.918178 1.557209 1.920284
110 10 1 1.177747 1.543467 2.124441 3.910299 3.002744 3.592523 1.633386 2.720086 1.498205 1.979025
111 10 1 1.145653 1.153188 1.845460 1.228757 2.572545 2.258460 2.115446 1.740911 1.559798 1.576349
112 10 2 1.024499 1.115272 1.360619 1.477736 1.975818 2.367548 1.636053 1.733174 1.374910 1.482495
116 7 2 nan nan nan nan nan nan nan nan nan nan
117 7 3 1.075449 1.050327 1.667910 1.474486 2.175378 2.266032 1.889844 2.273073 2.194954 3.097636
118 7 3 1.077193 1.041113 1.622340 1.348803 2.519247 2.090638 1.771270 1.915066 1.677725 2.559134
119 7 1 1.020483 0.883619 1.354411 1.539628 2.505317 2.335052 1.812420 1.692859 4.276036 1.905500
120 8 1 5.753490 3.094718 12.658286 2.792557 8.387077 15.217385 9.866172 1.954708 26.403328 2.266854
121 8 3 1.700688 1.360905 1.876910 1.400703 3.859209 3.796021 2.464420 2.112528 4.143757 14.255392
122 8 2 2.166638 2.043295 1.781794 1.920299 4.574158 5.256984 3.662848 4.439426 5.583772 6.829538
123 8 3 1.483446 1.423636 1.610834 1.552031 2.339977 2.480464 1.493141 1.689486 1.637068 1.835177
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.271907 1.174451 2.391604 1.563355 2.928136 2.623888 2.723287 2.249268 2.515897 2.524078
128 10 2 0.995398 1.073294 1.408260 2.076939 2.544819 3.322386 1.830918 1.950307 2.106778 3.990788
129 10 3 0.948267 1.010358 1.353120 1.301767 2.219697 2.202085 1.599753 1.725291 1.252983 1.748912
130 10 3 1.340767 0.937634 2.753295 2.123859 3.222597 2.881036 2.449233 1.696497 2.056086 1.679543
135 12 2 0.954327 1.047042 1.469737 1.417895 2.131285 2.494722 1.694253 2.000738 1.544710 1.555451
136 12 2 1.332674 1.123165 2.741453 1.534629 3.179510 2.288678 3.481098 2.399234 1.574598 2.169800
137 7 3 3.432937 4.085938 3.573196 21.356533 9.905129 7.080242 3.881055 2.852121 5.815043 2.307990
138 7 1 1.001932 6.113068 1.513746 5.430595 2.981886 6.244560 1.810459 3.194833 6.662315 5.692854
140 13 2 1.199516 0.987503 1.588267 1.811401 2.795460 2.056513 1.624625 1.521820 1.529769 1.588220
141 13 2 8.705712 1.236755 18.281442 1.336538 31.620544 2.821925 20.965478 1.534343 13.230366 1.523231
142 13 2 2.797991 3.035119 7.645319 1.746774 7.441695 13.381476 2.765004 1.776313 4.255342 3.336349
143 14 2 1.138603 0.936782 2.131172 1.468291 2.998690 2.346667 2.250679 1.859487 1.900117 2.147606
144 14 3 1.274926 1.120966 1.671424 1.264847 3.219412 2.327459 1.980871 1.589862 2.009201 1.585563
145 14 3 5.128269 4.275449 21.046162 18.342062 17.051466 11.607564 3.278714 1.920399 2.906434 1.666469
150 15 1 2.674471 6.194007 23.220715 43.230723 3.932047 9.673826 4.053362 7.726447 4.978566 11.848787
155 12 2 2.894957 2.497836 9.964324 21.290579 4.055632 3.719349 3.318472 5.907773 3.436646 1.974305
156 12 3 1.423597 1.367002 2.000439 1.570940 3.168346 2.729184 2.133553 2.238621 2.115169 2.206114
157 12 3 1.512483 1.075959 4.673186 1.546656 2.706350 2.074502 2.584566 1.956577 2.981684 2.034713
158 12 3 1.437597 1.060692 3.923307 1.321654 3.822476 2.357049 2.636183 1.836679 2.307075 1.683364
160 13 3 4.744278 11.455361 17.220303 73.763344 6.313362 9.892428 5.853324 22.691657 7.559892 43.951430
161 13 0 nan nan nan nan nan nan nan nan nan nan
162 13 0 nan nan nan nan nan nan nan nan nan nan
163 14 2 1.084971 1.132772 1.682789 1.557956 2.525560 2.618556 1.935867 1.666842 1.422824 1.615855
164 14 2 0.943222 0.979734 1.596493 1.405459 2.676659 2.030711 1.898229 2.292993 1.946623 1.763179
165 14 0 2.538031 3.854583 2.075140 3.424445 7.435989 8.567514 2.059663 2.138998 2.646517 2.523143
166 14 0 1.959618 2.035906 1.750749 1.176832 4.233012 3.467765 4.614903 3.956559 3.467008 4.435818
167 15 1 2.060393 1.538862 2.212930 1.534288 2.928378 2.249691 3.280668 1.823510 2.651487 1.673633
168 15 2 1.710650 1.584866 4.662014 4.125080 3.081240 2.088262 5.104537 8.249216 9.103412 7.587598
169 15 2 1.554878 7.523948 4.925896 39.271839 2.559376 3.770583 3.077826 5.622157 4.527082 6.595350
170 15 2 1.806297 8.416045 4.497153 42.210063 2.864731 4.304914 3.896524 7.800146 6.853699 8.433839
176 12 0 0.941933 0.900685 1.397724 1.393808 2.117627 2.118215 1.738320 1.753969 1.596516 1.442698
177 12 0 0.988212 1.009466 1.481480 1.318946 2.315974 1.829546 1.609021 1.432437 1.701566 1.703352
178 12 0 1.068628 0.941441 1.547809 2.039694 2.382239 2.575484 1.716924 1.780538 1.819874 2.124841
179 12 1 1.650746 0.955095 1.599476 1.367996 2.721664 2.539070 5.382130 2.051372 2.732734 1.716378
180 13 3 2.124253 1.168334 14.730730 1.181226 4.986104 2.422153 3.475647 1.685283 3.202149 1.516708
181 13 3 1.824112 4.971462 1.156810 15.274304 5.557048 8.211098 2.086064 2.244454 2.292510 2.142129
182 13 0 nan nan nan nan nan nan nan nan nan nan
183 13 1 1.073080 1.024551 1.871829 1.506877 2.788699 2.632254 1.659281 1.646737 1.702329 2.076971
184 14 0 0.953517 0.940697 1.481028 1.359403 2.190169 2.547642 1.689174 1.914459 1.869007 2.339718
185 14 1 1.116386 1.209522 1.296733 2.180187 2.190566 2.645589 1.936581 3.223427 2.425095 2.352873
186 14 1 0.980043 0.892684 1.238902 1.414406 1.892442 2.178528 1.659500 1.604910 1.677656 2.395620
187 14 1 1.170381 1.272042 1.857656 1.930699 2.453183 2.432854 3.735257 3.796069 6.976249 6.344267
189 15 3 1.070289 1.209294 1.308410 1.171760 2.496857 2.213269 1.327107 1.564292 1.516725 2.023714
190 15 3 2.758924 1.827018 11.774152 0.817571 4.637979 3.377187 3.258414 2.670641 2.974599 3.470668
191 15 3 1.086044 0.970790 7.234887 4.741743 2.048240 2.251442 1.784657 1.671221 1.637476 1.558121
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.281334 0.894357 3.289131 1.567662 3.027719 1.691809 2.045817 1.648144 1.703212 1.535573
206 19 0 1.191628 1.047927 1.656830 2.278499 2.067278 2.139188 1.832551 1.782143 1.817063 1.629176
207 19 1 0.965308 0.973701 1.866232 1.916822 2.086346 1.920470 1.769453 1.710192 1.674978 1.748201
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.021213 0.846138 1.759243 1.628130 2.211827 1.877852 1.684554 1.595782 1.722402 1.584573
224 19 1 1.047252 1.041790 3.075001 3.481347 1.913541 2.670276 3.804364 3.023546 7.243661 4.665103
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.447155 5.758644 6.955696 27.998449 6.411945 8.777711 6.638245 3.051102 5.496119 13.063101
321 2 3 0.831244 0.984794 1.929968 2.540276 1.731322 1.901344 1.645484 1.885048 1.551015 1.835055
323 2 3 1.348548 1.081684 5.566837 5.211270 2.417925 3.324958 2.242095 1.758525 1.869976 1.972553
324 4 3 0.877415 1.096683 2.323118 1.720593 1.847259 1.862988 1.783745 1.691549 1.639976 1.804676
329 12 1 2.289871 2.835007 6.691379 28.174233 1.939970 2.037688 1.693537 1.622456 1.596436 1.928110
333 12 1 1.077732 1.003319 2.758254 1.880444 2.182480 2.291539 1.757326 1.513852 1.727294 1.467329
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 [ ]: