Commit 8405d69f authored by Thomas Vincent's avatar Thomas Vincent

Use copy of silx median filter instead of xsocs' one to add NaN support

parent 66df4d5a
......@@ -41,9 +41,7 @@ import multiprocessing.sharedctypes as mp_sharedctypes
import numpy as np
import xrayutilities as xu
# from scipy.signal import medfilt2d
from ...util.filt_utils import medfilt2D
from ...util.medianfilter import medfilt2d
from ...util.histogramnd_lut import histogramnd_get_lut, histogramnd_from_lut
# from silx.math import histogramnd
from ...io import XsocsH5, QSpaceH5, ShiftH5
......@@ -1382,6 +1380,9 @@ def _to_qspace(th_idx,
# sum_axis_2 = 1
avg_weight = 1. / (image_binning[0] * image_binning[1])
# Set OpenMP to use a single thread (for median filter)
os.environ["OMP_NUM_THREADS"] = "1"
rc = None
errMsg = None
try:
......@@ -1471,9 +1472,10 @@ def _to_qspace(th_idx,
# intensity = medfilt2d(intensity, 3)
if medfilt_dims[0] != 1 or medfilt_dims[1] != 1:
intensity = medfilt2D(intensity,
kernel=medfilt_dims,
n_threads=None)
intensity = medfilt2d(intensity,
medfilt_dims,
mode='constant',
cval=0)
t_medfilt += time.time() - t0
t0 = time.time()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment