hikari.dataframes.base ====================== .. py:module:: hikari.dataframes.base Classes ------- .. autoapisummary:: hikari.dataframes.base.BaseFrame Module Contents --------------- .. py:class:: BaseFrame This class stores and manipulates basic information present in majority of crystallographic information files such as unit cell parameters stored in scalars and vectors. BaseFrame utilises the following notation for stored attributes: - The name begins from a unit cell property we are interested in: - "a", "b", "c" describe unit cell lengths/vectors *a*, *b*, *c*, - "al", "be", "ga" describe unit cell angles *alpha*, *beta*, *gamma*, - "v" describes unit cell volume, - "x", "y", "z" describe directions - normalised unit cell vectors. - "A", "G" describe stacked vector and metric matrix, respectively. - The unit cell parameter symbol is then followed by an underscore "_". - The name ends with a single letter denoting type of space and variable: - "d" (from Direct) denotes direct space scalars/matrices, - "r" (from Reciprocal) denotes reciprocal space scalars/matrices, - "v" (from Vector) denotes direct space vectors, - 'w" (similar to "v") denotes reciprocal space vectors. The values can be accessed by referencing a given attribute in the object, for example :class:`BaseFrame`. :attr:`a_d` stores information about the lattice constant *a* in direct space as a floating point, but :class:`BaseFrame`. :attr:`a_v` is a direct space vector. Available attributes have been once again presented in a table below: +----------+------------+------------------+------------------+------------+ | | Available | in direct | in reciprocal |Unit (^-1 in| | | constants | space | space |reciprocal) | +==========+============+==================+==================+============+ | Scalars | a, b, c | a_d, b_d, c_d | a_r, b_r, c_r | Angstrom | | +------------+------------------+------------------+------------+ | | al, be, ga | al_d, be_d, ga_d | al_r, be_r, ga_r | Radian | | +------------+------------------+------------------+------------+ | | v | v_d | v_r | Angstrom^3 | +----------+------------+------------------+------------------+------------+ | Vectors | a, b, c | a_v, b_v, c_v | a_w, b_w, c_w | Angstrom | | +------------+------------------+------------------+------------+ | | x, y, z | x_v, y_v, z_v | x_w, y_w, z_w | Angstrom | +----------+------------+------------------+------------------+------------+ | Matrices | A | A_d | A_r | Angstrom^2 | | +------------+------------------+------------------+------------+ | | G | G_d | G_r | Angstrom^2 | +----------+------------+------------------+------------------+------------+ .. py:attribute:: IMPORTED_FROM_CIF .. py:attribute:: orientation 3x3 matrix describing orientation of crystal during experiment. .. py:method:: edit_cell(**parameters) Edit direct space unit cell using a dictionary with the following keys: - "a" - for unit cell parameter *a* given in Angstrom, - "b" - for unit cell parameter *b* given in Angstrom, - "c" - for unit cell parameter *c* given in Angstrom, - "al" - for unit cell parameter *alpha* given in degrees or radians, - "be" - for unit cell parameter *beta* given in degrees or radians, - "ga" - for unit cell parameter *gamma* given in degrees or radians. This method is equivalent to manually setting all six unit cell parameters in direct space, :attr:`a_d`, :attr:`b_d`, :attr:`c_d`, :attr:`al_d`, :attr:`be_d`, :attr:`ga_d`, and then running a private method :meth:`_refresh_cell` to update other values. Please mind that the while the "a", "b" and "c" are always given in Angstrom, the angles might be given either in degrees or in radians. For details see function :func:`hikari.utility.math_tools.angle2rad`. It is not required for all previously stated keys to be present at each method call. If a key has not been given, previously provided and stored value is being used. If no value has been given, the default length values of 1.0 for *a*, *b*, *c* and default angle values of *pi/2* for *al*, *be*, *ga* are used instead. :param parameters: Values of unit cell parameters to be changed :type parameters: float .. py:method:: fill_from_cif_block(block, fragile=False) Import all data specified in :attr:`~.BaseFrame.IMPORTED_FROM_CIF` such as unit cell parameters and orientation matrix from provided instance of :class:`hikari.dataframes.cif.CifBlock` called `block`. Unless `fragile` is `True`, use defaults instead of rising KeyError. :param block: CifBlock containing imported information. :type block: hikari.dataframes.CifBlock :param fragile: If True, raise Error when any imported info is missing :type fragile: bool .. py:method:: _refresh_cell() Recalculate all vectors and scalars other than :attr:`a_d`, :attr:`b_d`, :attr:`c_d`, :attr:`al_d`, :attr:`be_d`, :attr:`ga_d` based on the currently stored values of the aforementioned six. .. py:property:: a_d Length of unit cell vector **a** in direct space. :rtype: float :type: return .. py:property:: b_d Length of unit cell vector **b** in direct space. :rtype: float :type: return .. py:property:: c_d Length of unit cell vector **c** in direct space. :rtype: float :type: return .. py:property:: al_d Angle between vectors **b** and **c** in degrees. :rtype: float :type: return .. py:property:: be_d Angle between vectors **c** and **a** in degrees. :rtype: float :type: return .. py:property:: ga_d Angle between vectors **a** and **b** in degrees. :rtype: float :type: return .. py:property:: v_d Unit cell volume in direct space. :rtype: float :type: return .. py:property:: a_v Unit cell vector **a** in direct space. :rtype: numpy.array :type: return .. py:property:: b_v Unit cell vector **b** in direct space. :rtype: numpy.array :type: return .. py:property:: c_v Unit cell vector **c** in direct space. :rtype: numpy.array :type: return .. py:property:: A_d Basis matrix A with vertically stacked direct space vectors. :rtype: np.array :type: return .. py:property:: G_d Direct space metric matrix [ai . aj]ij. :rtype: np.array :type: return .. py:property:: a_r Length of unit cell vector **a\*** in reciprocal space. :rtype: float :type: return .. py:property:: b_r Length of unit cell vector **b\*** in reciprocal space. :rtype: float :type: return .. py:property:: c_r Length of unit cell vector **c\*** in reciprocal space. :rtype: float :type: return .. py:property:: al_r Angle between vectors **b\*** and **c\*** in degrees. :rtype: float :type: return .. py:property:: be_r Angle between vectors **c\*** and **a\*** in degrees. :rtype: float :type: return .. py:property:: ga_r Angle between vectors **a\*** and **b\*** in degrees. :rtype: float :type: return .. py:property:: v_r Unit cell volume in reciprocal space. :rtype: float :type: return .. py:property:: a_w Unit cell vector **a\*** in reciprocal space. :rtype: numpy.array :type: return .. py:property:: b_w Unit cell vector **b\*** in reciprocal space. :rtype: numpy.array :type: return .. py:property:: c_w Unit cell vector **c\*** in reciprocal space. :rtype: numpy.array :type: return .. py:property:: A_r Basis matrix A\* with vertically stacked reciprocal space vectors. :rtype: np.array :type: return .. py:property:: G_r Reciprocal space metric matrix [ai\* . aj\*]ij. :rtype: np.array :type: return .. py:attribute:: SELLING_S6_TRANSFORMATIONS .. py:attribute:: SELLING_E3_TRANSFORMATIONS