bcdi.simulation: calculation of the diffraction intensity based on FFT or kinematical sum¶
simulation_utils¶
In Bragg geometry, calculation of the diffraction intensity based on FFT or kinematical sum. It can include a displacement field, noise, detector gaps etc… See Carnis et al. Scientific Reports 9, 17357 (2019) https://doi.org/10.1038/s41598-019-53774-2
In forward CDI geometry, calculation of the Bragg peak positions in 3D for a mesocrystal, knowing the unit cell and unit cell parameter. It can be used to fit experimental data.
API Reference¶
supportMaker¶
This module provides tools to create a simple support using polygons. It is possible to define distances in pixels or nanometers.
API Reference¶
Make a 3D polygon.
- bcdi.simulation.supportMaker.AddPolyCen(array, center, planes)¶
Make the polygon.
- Parameters
array – input array
center – origin of polygon
planes – array of planes
- bcdi.simulation.supportMaker.MakePoly(dims, planes)¶
Make a polygon.
- Parameters
dims – dimensions of array in pixels
planes – array of planes
- bcdi.simulation.supportMaker.MakePolyCen(dims, center, planes)¶
Make the polygon.
- Parameters
array – input array
center – origin of polygon
planes – array of planes
- bcdi.simulation.supportMaker.generatePlanesCuboid(x, y, z)¶
Make a cuboid of size x,y,z.
- bcdi.simulation.supportMaker.generatePlanesPrism(x, y)¶
Make a Prism of thickness x, y is somewhat arbitrary.
- bcdi.simulation.supportMaker.generatePlanesTetrahedra(x)¶
Make a tetrahedra of dimension x.
- bcdi.simulation.supportMaker.make_poly(dims, planes)¶
Make a polygon.
- Parameters
dims – dimensions of array in pixels
planes – array of planes
- bcdi.simulation.supportMaker.rot_planes(planes, rot)¶
Rotate planes with some rotation matrix.
something is wrong here if I import this it doesnt work
- class bcdi.simulation.supportMaker.supportMaker(rawdata, wavelength=None, detector_distance=None, detector_pixel_size=None, ang_step=None, braggAng=None, planes=None, planesDist=None, voxel_size=None)¶
A masking class for support creation.
- Parameters
rawdata – raw experimental data
wavelength – x-ray wavelength
detector_distance – sample to detector (m)
detector_pixel_size – detector pixel size - 2D (m)
ang_step – angular step (degrees)
braggAng – bragg angle (degrees)
planes – array of planes np.array([x,y,z])
planesDist – array of plane distance to origin (m)
voxel_size – set the voxel size to some arbitrary size, np.array([x,y,z]) (m)
- calc_voxel_size(wavelength=None, detDist=None, pixel_size=None, ang_step=None, braggAng=None)¶
Calculate the voxel size.
- get_planes()¶
Return planes array.
- get_planesDist()¶
Return planes distance from origin.
- get_support()¶
Return the generated support.
- set_planes(planes_list, plane_distance_origin_list)¶
Set the planes.
- set_support(rawdata)¶
Set the support to match rawdata dimensions.
- set_voxel_size(voxel_size)¶
Set the voxel size.