Check out the Hyperspy Workshop May 13-17, 2024 Online

sigma_clip#

Diffraction2D.sigma_clip(npt_rad=1028, npt_azim=512, mask=None, thres=3, max_iter=5, inplace=False, method='splitpixel', sum=False, correctSolidAngle=True, **kwargs)[source]#

Perform the 2D integration and perform a sigm-clipping iterative filter along each row. see the doc of scipy.stats.sigmaclip for the options.

Parameters:
  • npt_rad (int) – The number of radial points.

  • npt_azim (int) – The number of radial points

  • mask (boolean array or BaseSignal) – A boolean mask to apply to the data to exclude some points. If mask is a BaseSignal then it is iterated over as well.

  • inplace (bool) – If the signal is overwritten or copied to a new signal

  • method (str) – Can be “numpy”, “cython”, “BBox” or “splitpixel”, “lut”, “csr”, “nosplit_csr”, “full_csr”, “lut_ocl” and “csr_ocl” if you want to go on GPU. To Specify the device: “csr_ocl_1,2”

  • sum (bool) – If true the radial integration is returned rather then the Azimuthal Integration.

  • correctSolidAngle (bool) – Account for Ewald sphere or not. From PYFAI.

Other Parameters:
  • dummy (float) – Value for dead/masked pixels

  • delta_dummy (float) – Percision value for dead/masked pixels

  • correctSolidAngle (bool) – Correct for the solid angle of each pixel if True

  • dark (ndarray) – The dark noise image

  • flat (ndarray) – The flat field correction image

  • safe (bool) – Do some extra checks to ensure LUT/CSR is still valid. False is faster.

  • show_progressbar (bool) – If True shows a progress bar for the mapping function

Returns:

polar – A polar diffraction signal

Return type:

PolarDiffraction2D

Examples

Basic case using “2th_deg” units (no wavelength needed)

>>> ds.unit = "2th_deg"
>>> ds.set_ai()
>>> ds.get_radial_integral(npt=100, npt_rad=400)

Basic case using a curved Ewald Sphere approximation and pyXEM units (wavelength needed)

>>> ds.unit = "k_nm^-1" # setting units
>>> ds.set_ai(wavelength=2.5e-12)
>>> ds.get_radial_integral(npt=100,npt_rad=400)