SAXS.Models.Formfactors#
SAXS/Models/FormFactors.py
The term “form factor” is used in two different ways in the literature: 1. The form factor amplitude F(q), which is the Fourier transform of the scattering length density. 2. The form factor intensity P(q), which is the square of the amplitude.
In this module, we use “form factor intensity” to refer to the intensity P(q), which is the square of the amplitude F(q).
- nquad_vec(f, limits)#
Vectorized version of scipy.integrate.nquad. Integrate a function of multiple variables over given limits. This is borrowed from a scipy issue.
- Parameters:
f (callable) – The integrand function. It must accept as many arguments as there are integration variables.
limits (list of tuples) – The integration limits for each variable. Each tuple should contain the lower and upper limits for the corresponding variable.
- Returns:
result – The result of the integration.
- Return type:
float or array-like
- homogeneous_sphere(q, R)#
Calculate the form factor intensity of a homogeneous sphere.
- Parameters:
q (float or array-like) – The scattering vector magnitude.
R (float) – The radius of the sphere.
- Returns:
P – The form factor intensity of the homogeneous sphere.
- Return type:
float or array-like
- sphere_volume(R)#
Calculate the volume of a sphere.
- Parameters:
R (float) – The radius of the sphere.
- Returns:
V – The volume of the sphere.
- Return type:
float
- spherical_shell(q, R, r)#
Calculate the form factor intensity of a spherical shell.
- Parameters:
q (float or array-like) – The scattering vector magnitude.
R (float) – The outer radius of the shell.
r (float) – The inner radius of the shell.
- Returns:
P – The form factor intensity of the spherical shell.
- Return type:
float or array-like
- ellipsoid_of_revolution(q, R, epsilon)#
Calculate the form factor intensity of an ellipsoid of revolution.
- Parameters:
q (float or array-like) – The scattering vector magnitude.
R (float) – The semi-major axis of the ellipsoid.
epsilon (float) – The aspect ratio of the ellipsoid.
- Returns:
P – The form factor intensity of the ellipsoid of revolution.
- Return type:
float or array-like
- tri_axial_ellipsoid(q, a, b, c)#
Calculate the form factor intensity of a tri-axial ellipsoid.
- Parameters:
q (float or array-like) – The scattering vector magnitude.
a (float) – The semi-major axis of the ellipsoid.
b (float) – The semi-minor axis of the ellipsoid in the x-y plane.
c (float) – The semi-minor axis of the ellipsoid in the z direction.
- Returns:
F – The form factor intensity of the tri-axial ellipsoid.
- Return type:
float or array-like