Reflectivity
- class nexus.Reflectivity(experiment, sample, energy, angles, intensity_data=[], scaling='auto', background=0.0, offset=0.0, resolution=0.001, fit_weight=1.0, residual=<nexus.clib.cnexus.Log10; proxy of <Swig Object of type 'Residual *'> >, id='')
Bases:
FitMeasurement
Constructor for the
Reflectivity
class. Calculates the intensity of the experiment for one sample whose incidence angle is changed in reflection geometry.- Parameters:
id (string) – User identifier.
experiment (
Experiment
) – Experiment.sample (
Sample
) – Sample of theExperiment
whose angle is changed.energy (float) – X-ray energy (eV).
angles (list) – List of the angles (degree).
intensity_data (list or ndarray) – Intensity data for fitting.
scaling (float or
Var
or string) – Intensity scaling factor for fitting. Default isauto
.background (float or
Var
or string) – Background for fitting. Default is0
.or (offset (float) –
class:Var): Angular offset of the model. Default is
0
.New in version 1.1.0.
resolution (float or
Var
) – Resolution value for convolution (degree).fit_weight (float) – Relative weight for the const function in multi-measurement fitting.
residual (
Residual
) – Implementation of the residual calculation used for fitting.
- id
User identifier.
- Type:
string
- experiment
Experiment.
- Type:
- sample
Sample of the
Experiment
whose angle is changed.- Type:
- energy
X-ray energy (eV).
- Type:
float
- angles
List of the angles (degree).
- Type:
list
- result
List of intensity values.
- Type:
list
- intensity_data
Intensity data for fitting.
- Type:
list or ndarray
- data_size
Number of data points of experimental data.
- Type:
int
- offset (float or
class:Var): Angular offset of the model.
New in version 1.1.0.
- resolution_kernel
Weight of the Gaussian resolution same step size as detuning.
- Type:
list
- fit_weight
Relative weight for the const function in multi-measurement fitting.
- Type:
float
- Calculate()
Calculates the class method. Also callable via operator
()
.- Returns:
Array of float values.
- Return type:
ndarray
- Plot(data=True, residuals=True, velocity=False, datacolor='black', theorycolor='r', theorywidth=2, datalinestyle='none', datamarker='+', datamarkersize=2, datafillstyle='full', legend=True, errors=False, errorcap=2, name=None)
Plot the
Reflectivity
.New in version 1.0.3.
- Parameters:
data (bool) – Select if
intensity_data
should be plot.residuals (bool) – Select if
residuals
from fit should be plot.errors (bool) – select if error bars should be plot.
datacolor (string) – See matplotlib documentation.
theorycolor (string) – See matplotlib documentation.
theorywidth (float) – See matplotlib documentation.
datalinestyle (string) – See matplotlib documentation.
datamarker (string) – See matplotlib documentation.
datamarkersize (float) – See matplotlib documentation.
datafillstyle (string) – See matplotlib documentation.
legend (bool) – Select if legend should be plot when model and data are plot.
name (string) –
If given, the plot is saved under this name.
New in version 1.1.0.