Basis#
- class cbclib.Basis(a_vec, b_vec, c_vec)[source]#
An indexing solution, defined by a set of three unit cell vectors.
- Parameters
- contents()#
Return a list of the attributes stored in the container that are initialised.
- generate_hkl(q_abs)[source]#
Return a set of reflections lying inside of a sphere of radius
q_absin the reciprocal space.
- get(attr, value=None)#
Retrieve a dataset, return
valueif the attribute is not found.
- classmethod import_ini(ini_file)#
Initialize the container object with an INI file
ini_file.
- classmethod import_matrix(mat)[source]#
Return a new
Basisobject, initialised by a stacked matrix of three basis vectors.
- classmethod import_spherical(mat)[source]#
Return a new
Basisobject, initialised by a stacked matrix of three basis vectors written in spherical coordinate system.
- items()#
Return (key, value) pairs of the datasets stored in the container.
- Return type
- Returns
(key, value) pairs of the datasets stored in the container.
- keys()#
Return a list of the attributes available in the container.
- lattice_constants()[source]#
Return lattice constants \(a, b, c, \alpha, \beta, \gamma\). The unit cell length are unitless.
- Return type
- Returns
An array of lattice constants.
- reciprocate()[source]#
Calculate the basis of the reciprocal lattice.
- Return type
- Returns
The basis of the reciprocal lattice.
- replace(**kwargs)#
Return a new container object with a set of attributes replaced.
- static str_to_list(strings)#
Convert strings to a list of strings.
- to_ini(ini_file)#
Save all the attributes stored in the container to an INI file
ini_file.- Parameters
ini_file (
str) – Path to the ini file.
- to_spherical()[source]#
Return a stack of unit cell vectors in spherical coordinate system.
- Return type
- Returns
A matrix of three stacked unit cell vectors in spherical coordinate system.
- values()#
Return the attributes’ data stored in the container.
- Return type
- Returns
List of data stored in the container.