reflectivity  Reflectivity¶
Calculate reflectivity \(r(k_z)^2\) from slab model. 

Calculate reflectivity amplitude \(r(k_z)\) from slab model. 

Magnetic reflectivity for slab models. 

Returns the complex magnetic reflectivity waveform. 

Returns the average of magnetic reflectivity for all crosssections. 

Apply xdependent gaussian resolution to the theory. 
Basic reflectometry calculations
Slab model reflectivity calculator with optional absorption and roughness. The function reflectivity_amplitude returns the complex waveform. Slab model with supporting magnetic scattering. The function magnetic_reflectivity returns the complex reflection for the four spin polarization cross sections [++, +, +, –]. The function unpolarized_magnetic returns the expected magnitude for a measurement of the magnetic scattering using an unpolarized beam.
 refl1d.reflectivity.convolve(xi, yi, x, dx, resolution='normal')[source]¶
Apply xdependent gaussian resolution to the theory.
Returns convolution y[k] of width dx[k] at points x[k].
The theory function is a piecewise linear spline which does not need to be uniformly sampled. The theory calculation points xi should be dense enough to capture the “wiggle” in the theory function, and should extend beyond the ends of the data measurement points x. Convolution at the tails is truncated and normalized to area of overlap between the resolution function in case the theory does not extend far enough.
resolution is ‘normal’ (default) or ‘uniform’. Note that the uniform distribution uses the \(1\sigma\) equivalent distribution width which is \(1/\sqrt{3}\) times the width of the rectangle.
 refl1d.reflectivity.magnetic_amplitude(kz, depth, rho, irho=0, rhoM=0, thetaM=0, sigma=0, Aguide=90, H=0, rho_index=None)[source]¶
Returns the complex magnetic reflectivity waveform.
See
magnetic_reflectivity
for details.
 refl1d.reflectivity.magnetic_reflectivity(*args, **kw)[source]¶
Magnetic reflectivity for slab models.
Returns the expected values for the four polarization cross sections (++, +, +, –). Return reflectivity R^2 from slab model with sharp interfaces. returns reflectivities.
The parameters are as follows:
 kz (Å^{1})
points at which to evaluate the reflectivity
 depth (Å)
thickness of the individual layers (incident and substrate depths are ignored)
 rho (10^{6}Å^{2})
Scattering length density.
 irho (10^{6}Å^{2})
absorption. Defaults to 0.
 rho_m (microNb)
Magnetic scattering length density correction.
 theta_m (degrees)
Angle of the magnetism within the layer.
 sigma (Å)
Interface roughness between the current layer and the next. The final layer is ignored. This may be a scalar for fixed roughness on every layer, or None if there is no roughness.
 wavelength (Å)
Incident wavelength (only affects absorption). May be a vector. Defaults to 1.
 Aguide (degrees)
Angle of the guide field; 90 is the usual case
This function does not compute any instrument resolution corrections. Interface diffusion, if present, uses the NevotCroce approximation.
Use magnetic_amplitude to return the complex waveform.
 refl1d.reflectivity.reflectivity(*args, **kw)[source]¶
Calculate reflectivity \(r(k_z)^2\) from slab model.
 :Parameters :
 depthfloat[N]  Å
Thickness of the individual layers (incident and substrate depths are ignored)
 sigmafloat OR float[N1]  Å
Interface roughness between the current layer and the next. The final layer is ignored. This may be a scalar for fixed roughness on every layer, or None if there is no roughness.
 rho, irhofloat[N] OR float[N, K]  10^{6}Å^{2}
Real and imaginary scattering length density. Use multiple columns when you have kzdependent scattering length densities, and set rho_offset to select the appropriate one. Data should be stored in column order.
 kzfloat[M]  Å^{1}
Points at which to evaluate the reflectivity
 rho_indexinteger[M]
rho and irho columns to use for the various kz.
 Returns:
 R  float[M]
Reflectivity magnitude.
This function does not compute any instrument resolution corrections.
 refl1d.reflectivity.reflectivity_amplitude(kz=None, depth=None, rho=None, irho=0, sigma=0, rho_index=None)[source]¶
Calculate reflectivity amplitude \(r(k_z)\) from slab model.
 :Parameters :
 depthfloat[N]  Å
Thickness of the individual layers (incident and substrate depths are ignored)
 sigma = 0float OR float[N1]  Å
Interface roughness between the current layer and the next. The final layer is ignored. This may be a scalar for fixed roughness on every layer, or None if there is no roughness.
 rho, irho = 0: float[N] OR float[N, K]  10^{6}Å^{2}
Real and imaginary scattering length density. Use multiple columns when you have kzdependent scattering length densities, and set rho_index to select amongst them. Data should be stored in column order.
 kzfloat[M]  Å^{1}
Points at which to evaluate the reflectivity
 rho_index = 0integer[M]
rho and irho columns to use for the various kz.
 Returns:
 r  complex[M]
Complex reflectivity waveform.
This function does not compute any instrument resolution corrections.
 refl1d.reflectivity.unpolarized_magnetic(*args, **kw)[source]¶
Returns the average of magnetic reflectivity for all crosssections.
See
magnetic_reflectivity
for details.