Skip to content

Commit

Permalink
fixing typo & making backward compatible new median filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmejia committed Sep 16, 2024
1 parent 6a9980e commit 621aa19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions python/cextern/fast_median/fast_median.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
ndpointer(ctypes.c_double, flags="C_CONTIGUOUS"))
lib.median_filter_2d_double.restype = None

lib.median_filter_1d_float.argtypes = (ctypes.c_int,
lib.median_filter_1d_float.argtypes = (ctypes.c_int,
ctypes.c_int,
ctypes.c_int,
ndpointer(ctypes.c_float, flags="C_CONTIGUOUS"),
Expand Down Expand Up @@ -81,6 +81,6 @@ def fast_median_filter_1d(input, size=None):
return out
else:
def fast_median_filter_2d(input, size=None):
return median_filter(input, size=size)
return median_filter(input, size=size, mode="nearest")
def fast_median_filter_1d(input, size=None):
return median_filter(input, size=size)
return median_filter(input, size=size, mode="nearest")
2 changes: 1 addition & 1 deletion python/lvmdrp/core/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,7 @@ def medianImg(self, size, propagate_error=False):

new_data = fast_median_filter_2d(new_data, size)
if propagate_error and new_error is not None:
new_error = numpy.sqrt(fast_median_filter_2d(new_error ** 2, size, mode="nearest"))
new_error = numpy.sqrt(fast_median_filter_2d(new_error ** 2, size))

image = Image(data=new_data, error=new_error, mask=self._mask, header=self._header,
origin=self._origin, individual_frames=self._individual_frames, slitmap=self._slitmap)
Expand Down

0 comments on commit 621aa19

Please sign in to comment.