Skip to content

Commit

Permalink
revert back application of fft_filter_parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
rettigl committed Apr 16, 2024
1 parent aeb2f16 commit bee28be
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions specsanalyzer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,28 +135,15 @@ def convert_image(

if conversion_parameters["apply_fft_filter"]:
try:
fft_filter_params: dict = self._correction_matrix_dict["fft_tool_params"]
(amp, pos_x, pos_y, sig_x, sig_y) = (
fft_filter_params["amplitude"],
fft_filter_params["pos_x"],
fft_filter_params["pos_y"],
fft_filter_params["sigma_x"],
fft_filter_params["sigma_y"],
)
fft_filter_peaks = create_fft_params_dict(amp, pos_x, pos_y, sig_x, sig_y)
img = fourier_filter_2d(raw_img, fft_filter_peaks)
conversion_parameters["fft_filter_peaks"] = fft_filter_peaks
if "fft_filter_peaks" not in conversion_parameters.keys():
conversion_parameters["fft_filter_peaks"] = kwds.pop(
"fft_filter_peaks",
self._config["fft_filter_peaks"],
)
img = fourier_filter_2d(raw_img, conversion_parameters["fft_filter_peaks"])
except KeyError:
try:
if "fft_filter_peaks" not in conversion_parameters.keys():
conversion_parameters["fft_filter_peaks"] = kwds.pop(
"fft_filter_peaks",
self._config["fft_filter_peaks"],
)
img = fourier_filter_2d(raw_img, conversion_parameters["fft_filter_peaks"])
except KeyError:
img = raw_img
conversion_parameters["apply_fft_filter"] = False
img = raw_img
conversion_parameters["apply_fft_filter"] = False
else:
img = raw_img

Expand Down

0 comments on commit bee28be

Please sign in to comment.