get_azimuthal_integral2d#
- Diffraction2D.get_azimuthal_integral2d(npt, npt_azim=360, mask=None, radial_range=None, azimuth_range=None, inplace=False, method='splitpixel_pyxem', sum=False, correctSolidAngle=True, **kwargs)[source]#
Creates a polar reprojection using pyFAI’s azimuthal integrate 2d. This method is designed with 2 cases in mind. (1) the signal has pyxem style units, if a wavelength is not provided no account is made for the curvature of the Ewald sphere. (2) the signal has pyFAI style units, in which case the detector kwarg must be provided.
- Parameters:
npt (int) – The number of radial points to calculate
npt_azim (int) – The number of azimuthal points to calculate
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.
radial_range (None or (float, float)) – The radial range over which to perform the integration. Default is the full frame
azimuth_range (None or (float, float)) – The azimuthal range over which to perform the integration. Default is from -pi to pi
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”. For pure pyxem based methods use “splitpixel_pyxem”.
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
max_workers (int) – The number of streams to initialize.
- Returns:
polar – A polar diffraction signal, when inplace is False, otherwise None
- Return type:
Examples
Basic case using “2th_deg” units (no wavelength needed)
>>> ds.unit = "2th_deg" >>> ds.get_azimuthal_integral2d(npt_rad=100)
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_azimuthal_integral2d(npt_rad=100)