Skip to content

Commit

Permalink
turned store_single_spectrum public for lineprofiling
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusSifft committed Nov 3, 2023
1 parent 5261bf1 commit d8de7f9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/signalsnap/spectrum_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ def save_spec(self, save_path):
self.S_stationarity_temp = None
pickle_save(save_path, self)

def __store_single_spectrum(self, single_spectrum, order):
def store_single_spectrum(self, single_spectrum, order):

"""
Helper function to store the spectra of single frames afterwards used for calculation of errors and overlaps.
Expand Down Expand Up @@ -1012,9 +1012,10 @@ def fourier_coeffs_to_spectra(self, orders, a_w_all_gpu, f_max_ind, f_min_ind,
single_spectrum = c1(a_w) / self.config.delta_t / single_window.mean() / single_window.shape[0]

elif order == 2:
print('a_w_all_gpu:', a_w_all_gpu.shape)
print(f_min_ind, f_max_ind)
a_w = af.lookup(a_w_all_gpu, af.Array(list(range(f_min_ind, f_max_ind))), dim=0)
if self.config.f_lists is None:
a_w = af.lookup(a_w_all_gpu, af.Array(list(range(f_min_ind, f_max_ind))), dim=0)
else:
a_w = a_w_all_gpu

if self.config.corr_data is not None:
a_w_all_corr = fft_r2c(window * chunk_corr_gpu, dim0=0, scale=1)
Expand Down Expand Up @@ -1046,7 +1047,7 @@ def fourier_coeffs_to_spectra(self, orders, a_w_all_gpu, f_max_ind, f_min_ind,

single_spectrum = self.c4(a_w, a_w_corr) / (self.config.delta_t * (single_window ** order).sum())

self.__store_single_spectrum(single_spectrum, order)
self.store_single_spectrum(single_spectrum, order)

def __prep_f_and_S_arrays(self, orders, f_all_in):
"""
Expand Down

0 comments on commit d8de7f9

Please sign in to comment.