diff --git a/src/geomtools/powder/powder.py b/src/geomtools/powder/powder.py index af7cb67eb87a8f6880ea42a50fdd1bbb82f9504e..824ae792eaf40747f772946b4aea4dbf5f085139 100644 --- a/src/geomtools/powder/powder.py +++ b/src/geomtools/powder/powder.py @@ -9,7 +9,7 @@ from .refine import fit_rings, refine_clen class PowderDiffraction: def __init__(self, geom, peaks, clen, wave_length, - min_area=30, sigma=7, snr=1, border_mask=None, + min_area=30, sigma=1.8, snr=1, border_mask=None, make_shadow_mask=True): self.geom = geom self.peaks = peaks @@ -34,8 +34,9 @@ class PowderDiffraction: threshold = threshold[slice_thr] self.shadow = make_shadow_mask(img, ~mask, threshold) + sig = self.sigma * 1e-3 / self.geom.pixel_size fg = threshold_gaussian( - self.geom, img, mask, self.shadow, self.sigma, self.snr) + self.geom, img, mask, self.shadow, sig, self.snr) fg = fg & self.border_mask