Sample#
- class cbclib.Sample(rotation, z)[source]#
A convergent beam sample implementation. Stores position and orientation of the sample.
- Parameters
rotation (
Rotation) – rotation matrix, that defines the orientation of the sample.position – Sample’s position [m].
- detector_to_kout(x, y, setup, rec_vec=None, num_threads=1)[source]#
Project detector coordinates
(x, y)to the output wave-vectors space originating from the sample’s position.- Parameters
- Return type
- Returns
An array of output wave-vectors.
- classmethod import_dataframe(data)[source]#
Initialize a new
Sampleobject with apandas.Seriesarray. The array must contain the following columns:Rxx, Rxy, Rxz, Ryx, Ryy, Ryz, Rzx, Rzy, Rzz : Rotational matrix.
z : z coordinate [m].
- Parameters
data (
Series) – Apandas.Seriesarray.- Return type
- Returns
A new
Sampleobject.
- kin_to_sample(setup, kin=None, num_threads=1)[source]#
Project incident wave-vectors
kinto the sample plane.
- kout_to_detector(kout, setup, rec_vec=None, num_threads=1)[source]#
Project output wave-vectors originating from the sample’s position to the detector plane.
- Parameters
- Return type
- Returns
A tuple of x and y detector coordinates.
- rotate_basis(basis)[source]#
Rotate a
cbclib.Basisby therotationattribute.- Parameters
basis (
Basis) – Indexing solution basis vectors.- Return type
- Returns
A new rotated
cbclib.Basisobject.
- to_dataframe()[source]#
Export the sample object to a
pandas.Seriesarray.- Returns
Rxx, Rxy, Rxz, Ryx, Ryy, Ryz, Rzx, Rzy, Rzz : Rotational matrix.
z : z coordinate [m].
- Return type
A
pandas.Seriesarray with the following columns