Skip to content
Snippets Groups Projects
Commit f416a956 authored by Danilo Ferreira de Lima's avatar Danilo Ferreira de Lima
Browse files

Convolving in the correct axis.

parent 49848125
No related branches found
No related tags found
1 merge request!7Improve fit
...@@ -444,9 +444,9 @@ class SelectRelevantLowResolution(TransformerMixin, BaseEstimator): ...@@ -444,9 +444,9 @@ class SelectRelevantLowResolution(TransformerMixin, BaseEstimator):
#widths = np.arange(10, 50, step=5) #widths = np.arange(10, 50, step=5)
#peak_idx = find_peaks_cwt(sum_low_res, widths) #peak_idx = find_peaks_cwt(sum_low_res, widths)
gaussian = np.exp(-0.5*(axis - sum_low_res.shape[0]//2)**2/20**2) gaussian = np.exp(-0.5*(axis - sum_low_res.shape[0]//2)**2/20**2)
gaussian /= np.sum(gaussian, axis=1, keepdims=True) gaussian /= np.sum(gaussian, axis=0, keepdims=True)
# apply it to the data # apply it to the data
smoothened = fftconvolve(sum_low_res, gaussian, mode="same", axes=1) smoothened = fftconvolve(sum_low_res, gaussian, mode="same", axes=0)
peak_idx = [np.argmax(smoothened)] peak_idx = [np.argmax(smoothened)]
if len(peak_idx) < 1: if len(peak_idx) < 1:
raise PromptNotFoundError() raise PromptNotFoundError()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment