text stringlengths 81 112k |
|---|
Cosine function
Inputs:
-------
``x``: independent variable
``a``: amplitude
``omega``: circular frequency
``phi``: phase
``y0``: offset
Formula:
--------
``a*cos(x*omega + phi)+y0``
def Cosine(x, a, omega, phi, y0):
"""Cosine function
Inputs:
... |
Second order polynomial
Inputs:
-------
``x``: independent variable
``a``: coefficient of the second-order term
``b``: coefficient of the first-order term
``c``: additive constant
Formula:
--------
``a*x^2 + b*x + c``
def Square(x, a, b, c):
"""Second order... |
Third order polynomial
Inputs:
-------
``x``: independent variable
``a``: coefficient of the third-order term
``b``: coefficient of the second-order term
``c``: coefficient of the first-order term
``d``: additive constant
Formula:
--------
``a*x^3 + b*x^... |
Exponential function
Inputs:
-------
``x``: independent variable
``a``: scaling factor
``tau``: time constant
``y0``: additive constant
Formula:
--------
``a*exp(x/tau)+y0``
def Exponential(x, a, tau, y0):
"""Exponential function
Inputs:
-------
... |
Lorentzian peak
Inputs:
-------
``x``: independent variable
``a``: scaling factor (extremal value)
``x0``: center
``sigma``: half width at half maximum
``y0``: additive constant
Formula:
--------
``a/(1+((x-x0)/sigma)^2)+y0``
def Lorentzian(x, a, x0, si... |
Gaussian peak
Inputs:
-------
``x``: independent variable
``a``: scaling factor (extremal value)
``x0``: center
``sigma``: half width at half maximum
``y0``: additive constant
Formula:
--------
``a*exp(-(x-x0)^2)/(2*sigma^2)+y0``
def Gaussian(x, a, x0, ... |
PDF of a log-normal distribution
Inputs:
-------
``x``: independent variable
``a``: amplitude
``mu``: center parameter
``sigma``: width parameter
Formula:
--------
``a/ (2*pi*sigma^2*x^2)^0.5 * exp(-(log(x)-mu)^2/(2*sigma^2))
def LogNormal(x, a, mu, sigma):
... |
Radial integration (averaging) on the detector plane
Inputs:
data: scattering pattern matrix (np.ndarray, dtype: np.double)
dataerr: error matrix (np.ndarray, dtype: np.double; or None)
bcx, bcy: beam position, counting from 1
mask: mask matrix (np.ndarray, dtype: np.uint8)
... |
Azimuthal integration (averaging) on the detector plane
Inputs:
data: scattering pattern matrix (np.ndarray, dtype: np.double)
dataerr: error matrix (np.ndarray, dtype: np.double; or None)
bcx, bcy: beam position, counting from 1
mask: mask matrix (np.ndarray, dtype: np.uint8)
... |
Find all subdirectory of a directory.
Inputs:
startdir: directory to start with. Defaults to the current folder.
recursion_depth: number of levels to traverse. None is infinite.
Output: a list of absolute names of subfolders.
Examples:
>>> find_subdirs('dir',0) # returns just ['d... |
Find a (positive) peak in the dataset.
This function is deprecated, please consider using findpeak_single() instead.
Inputs:
x, y, dy: abscissa, ordinate and the error of the ordinate (can be None)
position, hwhm, baseline, amplitude: first guesses for the named parameters
curve: '... |
Find a (positive or negative) peak in the dataset.
Inputs:
x, y, dy: abscissa, ordinate and the error of the ordinate (can be None)
position, hwhm, baseline, amplitude: first guesses for the named parameters
curve: 'Gauss' or 'Lorentz' (default)
return_stat: return fitting statistic... |
Find multiple peaks in the dataset given by vectors x and y.
Points are searched for in the dataset where the N points before and
after have strictly lower values than them. To get rid of false
negatives caused by fluctuations, Ntolerance is introduced. It is the
number of outlier points to be tolerate... |
Find an asymmetric Lorentzian peak.
Inputs:
x: numpy array of the abscissa
y: numpy array of the ordinate
dy: numpy array of the errors in y (or None if not present)
curve: string (case insensitive): if starts with "Lorentz",
a Lorentzian curve will be fitted. If starts ... |
Read the next spec scan in the file, which starts at the current position.
def readspecscan(f, number=None):
"""Read the next spec scan in the file, which starts at the current position."""
scan = None
scannumber = None
while True:
l = f.readline()
if l.startswith('#S'):
sca... |
Open a SPEC file and read its content
Inputs:
filename: string
the file to open
read_scan: None, 'all' or integer
the index of scan to be read from the file. If None, no scan should be read. If
'all', all scans should be read. If a number, just the scan with th... |
Read abt_*.fio type files from beamline B1, HASYLAB.
Input:
filename: the name of the file.
dirs: directories to search for files in
Output:
A dictionary. The fields are self-explanatory.
def readabt(filename, dirs='.'):
"""Read abt_*.fio type files from beamline B1, HASYLAB.
... |
X-ray energy
def energy(self) -> ErrorValue:
"""X-ray energy"""
return (ErrorValue(*(scipy.constants.physical_constants['speed of light in vacuum'][0::2])) *
ErrorValue(*(scipy.constants.physical_constants['Planck constant in eV s'][0::2])) /
scipy.constants.nano /
... |
Name of the mask matrix file.
def maskname(self) -> Optional[str]:
"""Name of the mask matrix file."""
try:
maskid = self._data['maskname']
if not maskid.endswith('.mat'):
maskid = maskid + '.mat'
return maskid
except KeyError:
ret... |
Find beam center with the "gravity" method
Inputs:
data: scattering image
mask: mask matrix
Output:
a vector of length 2 with the x (row) and y (column) coordinates
of the origin, starting from 1
def findbeam_gravity(data, mask):
"""Find beam center with the "gravity" met... |
Find beam center with the "slices" method
Inputs:
data: scattering matrix
orig_initial: estimated value for x (row) and y (column)
coordinates of the beam center, starting from 1.
mask: mask matrix. If None, nothing will be masked. Otherwise it
should be of the same ... |
Find beam center using azimuthal integration
Inputs:
data: scattering matrix
orig_initial: estimated value for x (row) and y (column)
coordinates of the beam center, starting from 1.
mask: mask matrix. If None, nothing will be masked. Otherwise it
should be of the sa... |
Find beam center using azimuthal integration and folding
Inputs:
data: scattering matrix
orig_initial: estimated value for x (row) and y (column)
coordinates of the beam center, starting from 1.
mask: mask matrix. If None, nothing will be masked. Otherwise it
should ... |
Find beam with 2D weighting of semitransparent beamstop area
Inputs:
data: scattering matrix
pri: list of four: [xmin,xmax,ymin,ymax] for the borders of the beam
area under the semitransparent beamstop. X corresponds to the column
index (ie. A[Y,X] is the element of A from t... |
Find the beam by minimizing the width of a peak in the radial average.
Inputs:
data: scattering matrix
orig_initial: first guess for the origin
mask: mask matrix. Nonzero is non-masked.
rmin,rmax: distance from the origin (in pixels) of the peak range.
drive_by: 'hwhm' to mi... |
Find the beam by minimizing the width of a Gaussian centered at the
origin (i.e. maximizing the radius of gyration in a Guinier scattering).
Inputs:
data: scattering matrix
orig_initial: first guess for the origin
mask: mask matrix. Nonzero is non-masked.
rmin,rmax: distance fro... |
Find the beam by minimizing the width of a Gaussian centered at the
origin (i.e. maximizing the radius of gyration in a Guinier scattering).
Inputs:
data: scattering matrix
orig_initial: first guess for the origin
mask: mask matrix. Nonzero is non-masked.
rmin,rmax: distance fro... |
X (column) coordinate of the beam center, pixel units, 0-based.
def beamcenterx(self) -> ErrorValue:
"""X (column) coordinate of the beam center, pixel units, 0-based."""
try:
return ErrorValue(self._data['geometry']['beamposy'],
self._data['geometry']['beampos... |
Y (row) coordinate of the beam center, pixel units, 0-based.
def beamcentery(self) -> ErrorValue:
"""Y (row) coordinate of the beam center, pixel units, 0-based."""
try:
return ErrorValue(self._data['geometry']['beamposx'],
self._data['geometry']['beamposx.err'... |
Name of the mask matrix file.
def maskname(self) -> Optional[str]:
"""Name of the mask matrix file."""
mask = self._data['geometry']['mask']
if os.path.abspath(mask):
mask = os.path.split(mask)[-1]
return mask |
Error of the trapezoid formula
Inputs:
x: the abscissa
yerr: the error of the dependent variable
Outputs:
the error of the integral
def errtrapz(x, yerr):
"""Error of the trapezoid formula
Inputs:
x: the abscissa
yerr: the error of the dependent variable
Ou... |
Perform a nonlinear least-squares fit, using sastool.misc.fitter.Fitter()
Other arguments and keyword arguments will be passed through to the
__init__ method of Fitter. For example, these are:
- lbounds
- ubounds
- ytransform
- loss
- method
Returns: the... |
Calculate momenta (integral of y times x^exponent)
The integration is done by the trapezoid formula (np.trapz).
Inputs:
exponent: the exponent of q in the integration.
errorrequested: True if error should be returned (true Gaussian
error-propagation of the trapez... |
Calculate a scaling factor, by which this curve is to be multiplied to best fit the other one.
Inputs:
other: the other curve (an instance of GeneralCurve or of a subclass of it)
qmin: lower cut-off (None to determine the common range automatically)
qmax: upper cut-off (None... |
Insert fixed parameters in a covariance matrix
def _substitute_fixed_parameters_covar(self, covar):
"""Insert fixed parameters in a covariance matrix"""
covar_resolved = np.empty((len(self._fixed_parameters), len(self._fixed_parameters)))
indices_of_fixed_parameters = [i for i in range(len(self... |
Load a mask file.
def loadmask(self, filename: str) -> np.ndarray:
"""Load a mask file."""
mask = scipy.io.loadmat(self.find_file(filename, what='mask'))
maskkey = [k for k in mask.keys() if not (k.startswith('_') or k.endswith('_'))][0]
return mask[maskkey].astype(np.bool) |
Load a radial scattering curve
def loadcurve(self, fsn: int) -> classes2.Curve:
"""Load a radial scattering curve"""
return classes2.Curve.new_from_file(self.find_file(self._exposureclass + '_%05d.txt' % fsn)) |
Read a cbf (crystallographic binary format) file from a Dectris PILATUS
detector.
Inputs
------
name: string
the file name
load_header: bool
if the header data is to be loaded.
load_data: bool
if the binary data is to be loaded.
for_nexus: bool
if the array s... |
Read bdf file (Bessy Data Format v1)
Input
-----
filename: string
the name of the file
Output
------
the BDF structure in a dict
Notes
-----
This is an adaptation of the bdf_read.m macro of Sylvio Haas.
def readbdfv1(filename, bdfext='.bdf', bhfext='.bhf'):
"""Read bd... |
Read corrected intensity and error matrices (Matlab mat or numpy npz
format for Beamline B1 (HASYLAB/DORISIII))
Input
-----
filename: string
the name of the file
Outputs
-------
two ``np.ndarray``-s, the Intensity and the Error matrices
File formats supported:
------------... |
Save the intensity and error matrices to a file
Inputs
------
filename: string
the name of the file
Intensity: np.ndarray
the intensity matrix
Error: np.ndarray, optional
the error matrix (can be ``None``, if no error matrix is to be saved)
Output
------
None
d... |
Try to load a maskfile from a matlab(R) matrix file
Inputs
------
filename: string
the input file name
fieldname: string, optional
field in the mat file. None to autodetect.
Outputs
-------
the mask in a numpy array of type np.uint8
def readmask(filename, fieldname=None):
... |
Read an ESRF data file (measured at beamlines ID01 or ID02)
Inputs
------
filename: string
the input file name
Output
------
the imported EDF structure in a dict. The scattering pattern is under key
'data'.
Notes
-----
Only datatype ``FloatValue`` is supported right no... |
Read a version 2 Bessy Data File
Inputs
------
filename: string
the name of the input file. One can give the complete header or datafile
name or just the base name without the extensions.
bdfext: string, optional
the extension of the data file
bhfext: string, optional
... |
Read a two-dimensional scattering pattern from a MarResearch .image file.
def readmar(filename):
"""Read a two-dimensional scattering pattern from a MarResearch .image file.
"""
hed = header.readmarheader(filename)
with open(filename, 'rb') as f:
h = f.read(hed['recordlength'])
data = n... |
Write a version 2 Bessy Data File
Inputs
------
filename: string
the name of the output file. One can give the complete header or
datafile name or just the base name without the extensions.
bdf: dict
the BDF structure (in the same format as loaded by ``readbdfv2()``
bdfext: ... |
Re-bin (shrink or enlarge) a mask matrix.
Inputs
------
mask: np.ndarray
mask matrix.
binx: integer
binning along the 0th axis
biny: integer
binning along the 1st axis
enlarge: bool, optional
direction of binning. If True, the matrix will be enlarged, otherwise
... |
Fill up missing padding in a string.
This function makes sure that the string has length which is multiplication of 4,
and if not, fills the missing places with dots.
:param str padded_string: string to be decoded that might miss padding dots.
:return: properly padded string
:rtype: str
def fill_... |
Decode the result of querystringsafe_base64_encode or a regular base64.
.. note ::
As a regular base64 string does not contain dots, replacing dots with
equal signs does basically noting to it. Also,
base64.urlsafe_b64decode allows to decode both safe and unsafe base64.
Therefore th... |
Check if arg is an iterable (list, tuple, set, dict, np.ndarray, except
string!). If not, make a list of it. Numpy arrays are flattened and
converted to lists.
def normalize_listargument(arg):
"""Check if arg is an iterable (list, tuple, set, dict, np.ndarray, except
string!). If not, make ... |
Try to auto-detect the numeric type of the value. First a conversion to
int is tried. If this fails float is tried, and if that fails too, unicode()
is executed. If this also fails, a ValueError is raised.
def parse_number(val, use_dateutilparser=False):
"""Try to auto-detect the numeric type of the value.... |
Flatten a dict.
Inputs
------
original_dict: dict
the dictionary to flatten
separator: string, optional
the separator item in the keys of the flattened dictionary
max_recursion_depth: positive integer, optional
the number of recursions to be done. None is infinte.
Outpu... |
Return a random string of <Nchars> characters. Characters are sampled
uniformly from <randstrbase>.
def random_str(Nchars=6, randstrbase='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'):
"""Return a random string of <Nchars> characters. Characters are sampled
uniformly from <randstrbase>.
... |
getsamplenames revisited, XLS output.
Inputs:
fsns: FSN sequence
xlsname: XLS file name to output listing
dirs: either a single directory (string) or a list of directories, a la readheader()
whattolist: format specifier for listing. Should be a list of tuples. Each tuple
... |
Do a Shull-Roess fitting on the scattering data.
Inputs:
q: np.ndarray[ndim=1]
vector of the q values (4*pi*sin(theta)/lambda)
Intensity: np.ndarray[ndim=1]
Intensity vector
Error: np.ndarray[ndim=1]
Error of the intensity (absolute uncertainty, 1sigma)
... |
Maxwellian-like distribution of spherical particles
Inputs:
-------
r: np.ndarray or scalar
radii
r0: positive scalar or ErrorValue
mean radius
n: positive scalar or ErrorValue
"n" parameter
Output:
-------
the distribution fu... |
Find file in multiple directories.
Inputs:
filename: the file name to be searched for.
dirs: list of folders or None
use_pythonpath: use the Python module search path
use_searchpath: use the sastool search path.
notfound_is_fatal: if an exception is to be raised if the file ... |
Calculate the two-theta matrix for a scattering matrix
Inputs:
matrix: only the shape of it is needed
bcx, bcy: beam position (counting from 0; x is row, y is column index)
pixsizeperdist: the pixel size divided by the sample-to-detector
distance
Outputs:
the two th... |
Solid-angle correction for two-dimensional SAS images
Inputs:
twotheta: matrix of two-theta values
sampletodetectordistance: sample-to-detector distance
pixelsize: the pixel size in mm
The output matrix is of the same shape as twotheta. The scattering intensity
matrix should be... |
Solid-angle correction for two-dimensional SAS images with error propagation
Inputs:
twotheta: matrix of two-theta values
dtwotheta: matrix of absolute error of two-theta values
sampletodetectordistance: sample-to-detector distance
dsampletodetectordistance: absolute error of sample... |
Correction for angle-dependent absorption of the sample
Inputs:
twotheta: matrix of two-theta values
transmission: the transmission of the sample (I_after/I_before, or
exp(-mu*d))
The output matrix is of the same shape as twotheta. The scattering intensity
matrix should be ... |
Correction for angle-dependent absorption of the sample with error propagation
Inputs:
twotheta: matrix of two-theta values
dtwotheta: matrix of absolute error of two-theta values
transmission: the transmission of the sample (I_after/I_before, or
exp(-mu*d))
dtransmissio... |
Correction for the angle dependent absorption of air in the scattered
beam path.
Inputs:
twotheta: matrix of two-theta values
mu_air: the linear absorption coefficient of air
sampletodetectordistance: sample-to-detector distance
1/mu_air and sampletodetectordistance sho... |
Correction for the angle dependent absorption of air in the scattered
beam path, with error propagation
Inputs:
twotheta: matrix of two-theta values
dtwotheta: absolute error matrix of two-theta
mu_air: the linear absorption coefficient of air
dmu_air: error of t... |
Find file in the path
def find_file(self, filename: str, strip_path: bool = True, what='exposure') -> str:
"""Find file in the path"""
if what == 'exposure':
path = self._path
elif what == 'header':
path = self._headerpath
elif what == 'mask':
path = ... |
Search a file or directory relative to the base path
def get_subpath(self, subpath: str):
"""Search a file or directory relative to the base path"""
for d in self._path:
if os.path.exists(os.path.join(d, subpath)):
return os.path.join(d, subpath)
raise FileNotFoundEr... |
Load an exposure from a file.
def new_from_file(self, filename: str, header_data: Optional[Header] = None,
mask_data: Optional[np.ndarray] = None):
"""Load an exposure from a file.""" |
Calculate the sum of pixels, not counting the masked ones if only_valid is True.
def sum(self, only_valid=True) -> ErrorValue:
"""Calculate the sum of pixels, not counting the masked ones if only_valid is True."""
if not only_valid:
mask = 1
else:
mask = self.mask
... |
Calculate the mean of the pixels, not counting the masked ones if only_valid is True.
def mean(self, only_valid=True) -> ErrorValue:
"""Calculate the mean of the pixels, not counting the masked ones if only_valid is True."""
if not only_valid:
intensity = self.intensity
error = ... |
Calculate the two-theta array
def twotheta(self) -> ErrorValue:
"""Calculate the two-theta array"""
row, column = np.ogrid[0:self.shape[0], 0:self.shape[1]]
rho = (((self.header.beamcentery - row) * self.header.pixelsizey) ** 2 +
((self.header.beamcenterx - column) * self.header.... |
Return the q coordinates of a given pixel.
Inputs:
row: float
the row (vertical) coordinate of the pixel
column: float
the column (horizontal) coordinate of the pixel
Coordinates are 0-based and calculated from the top left corner.
def pixel_to_... |
Plot the matrix (imshow)
Keyword arguments [and their default values]:
show_crosshair [True]: if a cross-hair marking the beam position is
to be plotted.
show_mask [True]: if the mask is to be plotted.
show_qscale [True]: if the horizontal and vertical axes are to be
... |
Do a radial averaging
Inputs:
qrange: the q-range. If None, auto-determine. If 'linear', auto-determine
with linear spacing (same as None). If 'log', auto-determine
with log10 spacing.
pixel: do a pixel-integration (instead of q)
returnmask: i... |
Extend the mask with the image elements where the intensity is negative.
def mask_negative(self):
"""Extend the mask with the image elements where the intensity is negative."""
self.mask = np.logical_and(self.mask, ~(self.intensity < 0)) |
Extend the mask with the image elements where the intensity is NaN.
def mask_nan(self):
"""Extend the mask with the image elements where the intensity is NaN."""
self.mask = np.logical_and(self.mask, ~(np.isnan(self.intensity))) |
Extend the mask with the image elements where the intensity is NaN.
def mask_nonfinite(self):
"""Extend the mask with the image elements where the intensity is NaN."""
self.mask = np.logical_and(self.mask, (np.isfinite(self.intensity))) |
Sample-to-detector distance
def distance(self) -> ErrorValue:
"""Sample-to-detector distance"""
if 'DistCalibrated' in self._data:
dist = self._data['DistCalibrated']
else:
dist = self._data["Dist"]
if 'DistCalibratedError' in self._data:
disterr = se... |
Sample temperature
def temperature(self) -> Optional[ErrorValue]:
"""Sample temperature"""
try:
return ErrorValue(self._data['Temperature'], self._data.setdefault('TemperatureError', 0.0))
except KeyError:
return None |
Date of the experiment (start of exposure)
def date(self) -> datetime.datetime:
"""Date of the experiment (start of exposure)"""
return self._data['Date'] - datetime.timedelta(0, float(self.exposuretime), 0) |
X-ray flux in photons/sec.
def flux(self) -> ErrorValue:
"""X-ray flux in photons/sec."""
try:
return ErrorValue(self._data['Flux'], self._data.setdefault('FluxError',0.0))
except KeyError:
return 1 / self.pixelsizex / self.pixelsizey / ErrorValue(self._data['NormFactor'... |
Perform a non-linear least squares fit, return the results as
ErrorValue() instances.
Inputs:
x: one-dimensional numpy array of the independent variable
y: one-dimensional numpy array of the dependent variable
dy: absolute error (square root of the variance) of the dependent
... |
Perform a non-linear orthogonal distance regression, return the results as
ErrorValue() instances.
Inputs:
x: one-dimensional numpy array of the independent variable
y: one-dimensional numpy array of the dependent variable
dx: absolute error (square root of the variance) of the independ... |
Do a simultaneous nonlinear least-squares fit and return the fitted
parameters as instances of ErrorValue.
Input:
------
`xs`: tuple of abscissa vectors (1d numpy ndarrays)
`ys`: tuple of ordinate vectors (1d numpy ndarrays)
`dys`: tuple of the errors of ordinate vectors (1d numpy ndarrays or N... |
Perform a non-linear least squares fit
Inputs:
x: one-dimensional numpy array of the independent variable
y: one-dimensional numpy array of the dependent variable
dy: absolute error (square root of the variance) of the dependent
variable. Either a one-dimensional numpy array or ... |
Do a simultaneous nonlinear least-squares fit
Input:
------
`xs`: tuple of abscissa vectors (1d numpy ndarrays)
`ys`: tuple of ordinate vectors (1d numpy ndarrays)
`dys`: tuple of the errors of ordinate vectors (1d numpy ndarrays or Nones)
`func`: fitting function (the same for all the datasets... |
Make a string representation of the value and its uncertainty.
Inputs:
-------
``extra_digits``: integer
how many extra digits should be shown (plus or minus, zero means
that the number of digits should be defined by the magnitude of
the uncer... |
Sample a random number (array) of the distribution defined by
mean=`self.val` and variance=`self.err`^2.
def random(self: 'ErrorValue') -> np.ndarray:
"""Sample a random number (array) of the distribution defined by
mean=`self.val` and variance=`self.err`^2.
"""
if isinstance(se... |
Evaluate a function with error propagation.
Inputs:
-------
``func``: callable
this is the function to be evaluated. Should return either a
number or a np.ndarray.
``*args``: other positional arguments of func. Arguments which are
... |
Scattering form-factor amplitude of a sphere normalized to F(q=0)=V
Inputs:
-------
``q``: independent variable
``R``: sphere radius
Formula:
--------
``4*pi/q^3 * (sin(qR) - qR*cos(qR))``
def Fsphere(q, R):
"""Scattering form-factor amplitude of a sphere normalized to F(q... |
Generalized Guinier scattering
Inputs:
-------
``q``: independent variable
``G``: factor
``Rg``: radius of gyration
``s``: dimensionality parameter (can be 1, 2, 3)
Formula:
--------
``G/q**(3-s)*exp(-(q^2*Rg^2)/s)``
def GeneralGuinier(q, G, Rg, s):
"""Gene... |
Empirical Guinier-Porod scattering
Inputs:
-------
``q``: independent variable
``G``: factor of the Guinier-branch
``Rg``: radius of gyration
``alpha``: power-law exponent
Formula:
--------
``G * exp(-q^2*Rg^2/3)`` if ``q<q_sep`` and ``a*q^alpha`` otherwise.
... |
Empirical Porod-Guinier scattering
Inputs:
-------
``q``: independent variable
``a``: factor of the power-law branch
``alpha``: power-law exponent
``Rg``: radius of gyration
Formula:
--------
``G * exp(-q^2*Rg^2/3)`` if ``q>q_sep`` and ``a*q^alpha`` otherwise.
... |
Empirical Porod-Guinier-Porod scattering
Inputs:
-------
``q``: independent variable
``a``: factor of the first power-law branch
``alpha``: exponent of the first power-law branch
``Rg``: radius of gyration
``beta``: exponent of the second power-law branch
Formula:
... |
Empirical Guinier-Porod-Guinier scattering
Inputs:
-------
``q``: independent variable
``G``: factor for the first Guinier-branch
``Rg1``: the first radius of gyration
``alpha``: the power-law exponent
``Rg2``: the second radius of gyration
Formula:
--------
... |
Damped power-law
Inputs:
-------
``q``: independent variable
``a``: factor
``alpha``: exponent
``sigma``: hwhm of the damping Gaussian
Formula:
--------
``a*q^alpha*exp(-q^2/(2*sigma^2))``
def DampedPowerlaw(q, a, alpha, sigma):
"""Damped power-law
Inp... |
Scattering of a population of non-correlated spheres (radii from a log-normal distribution)
Inputs:
-------
``q``: independent variable
``A``: scaling factor
``mu``: expectation of ``ln(R)``
``sigma``: hwhm of ``ln(R)``
Non-fittable inputs:
--------------------
... |
Scattering of a population of non-correlated spheres (radii from a gaussian distribution)
Inputs:
-------
``q``: independent variable
``A``: scaling factor
``R0``: expectation of ``R``
``sigma``: hwhm of ``R``
``weighting``: 'intensity' (default), 'volume' or 'number'
... |
Sum of a Power-law, a Guinier-Porod curve and a constant.
Inputs:
-------
``q``: independent variable (momentum transfer)
``A``: scaling factor of the power-law
``alpha``: power-law exponent
``G``: scaling factor of the Guinier-Porod curve
``Rg``: Radius of gyration
... |
Empirical multi-part Guinier-Porod scattering
Inputs:
-------
``q``: independent variable
``G``: factor for the first Guinier-branch
other arguments: [Rg1, alpha1, Rg2, alpha2, Rg3 ...] the radii of
gyration and power-law exponents of the consecutive parts
Formula:
----... |
Empirical multi-part Porod-Guinier scattering
Inputs:
-------
``q``: independent variable
``A``: factor for the first Power-law-branch
other arguments: [alpha1, Rg1, alpha2, Rg2, alpha3 ...] the radii of
gyration and power-law exponents of the consecutive parts
Formula:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.