-
Notifications
You must be signed in to change notification settings - Fork 24
Refl1D Architecture
- uses
bumps.parameter.Parameter
objects everywhere that parameters are needed - defines a class
refl1d.experiment.Experiment
that can be used as a model inbumps.fitproblem.FitProblem
- providing
nllf()
,residuals()
andparameters()
methods
- providing
- Slab objects with
- thickness
- roughness
- scattering length density (SLD)
- absorption (imaginary SLD)
- optional magnetism (direction and magnitude)
- sample is Stack made of Slab objects
- Neutron or X-Ray probe objects
- optional polarization (4 cross-sections "mm", "mp", "pm", "pp")
- angular resolution
- wavelength resolution
- optional datasets
- Q (momentum transfer)
- R (reflectivity, normalized to incident beam)
- dR (error on R column)
- dQ (resolution/uncertainty in Q column)
- optional incident_angle and wavelength (for fitting theta_offset)
The refl1d.experiment.Experiment
class is initialized with a sample and a probe object
and can be used as a model in bumps.fitproblem.FitProblem
First, a set of "profiles" is drawn based on the sample layers, where
"profile" means a smooth representation of these quantities as a function of
- rho (SLD)
- irho (absorption)
- rhoM (magnitude of magnetic SLD, if magnetism is defined)
- thetaM (direction of magnetism, if magnetism is defined)
reflectivity
function include
- the
$Q$ values at which to calculate (from the probe object) - a table of values of
-
$z$ , rho, irho, rhoM, thetaM for the sample
-
A Gaussian resolution kernel is applied to Probe
object) to account
for instrumental resolution effects.
Sometimes
Then
$residuals = (R_{data} - R_{calc}) / dR_{data}$ $nllf = \sum (residuals^2)$
Almost the same as bumps.cli, with a few custom functions adding profile uncertainty plots to
export
outputs
A WxPython
app that inherits nearly everything from bumps.gui
, and adds a few custom panels for plotting reflectivity and
profile
A webserver that inherits nearly everything from bumps.webview.server
, adding custom API calls for getting reflectivity data, and creating
profile plots (and profile uncertainty plots)
A Javascript app written largely with Vue.js components, where most of those components are pulled from the bumps.webview.client
library. Custom panels are added in panels.mjs