Spatial and Reciprocal Unit Cells
The unit cell defined by the two classes SpatialUnitCell and ReciprocalUnitCell is a special case of a full 3D unit cell, tailored for use in 2D crystallography: it's parameters are given by the two axis lengths A and B, the angle γ between them, and a thickness C which represents the third dimension along the z-axis.
The distinction between spatial and reciprocal unit cell is for convenience purposes, since one form is implicitly convertible to the other (see Examples below).
Interface
Construction
- SpatialUnitCell()
- Creates a default spatial unit cell with A, B and C of length 1.0, and an angle γ of 90 degrees.
- SpatialUnitCell(double A, double B, double gamma, double C=1.0)
- Creates a spatial unit cell with the given values for A, B and γ, plus an optional thickness C.
- SpatialUnitCell(ReciprocalUnitCell c)
- Creates a spatial unit cell from a reciprocal one.
- SpatialUnitCell(Lattice lat, Vec3 spatial_sampling, double C=1.0)
- Creates a spatial unit cell from a lattice object, using the provided spatial pixel sampling.
- ReciprocalUnitCell()
- Creates a default reciprocal unit cell with A, B and C of length 1.0, and an angle γ of 90 degrees.
- ReciprocalUnitCell(double A, double B, double gamma, double C=1.0)
- Creates a reciprocal unit cell with the given values for A, B and γ, plus an optional thickness C.
- ReciprocalUnitCell(SpatialUnitCell c)
- Creates a reciprocal unit cell from a spatial one.
- ReciprocalUnitCell(Lattice lat, Vec3 reciprocal_sampling, double C=1.0)
- Creates a spatial unit cell from a lattice object, using the provided reciprocal pixel sampling.
Parameter Getter/Setter
- double GetA()
- Returns either the spatial or reciprocal length of unit cell axis A
- double GetB()
- Returns either the spatial or reciprocal length of unit cell axis B
- double GetGamma()
- Returns either the spatial or reciprocal angle γ
Examples
import math, ex su=ex.SpatialUnitCell(85,112,radians(120)) ru=ex.ReciprocalUnitCell(su) # conversion spatial->reciprocal print "Reciprocal parameters: %g %g %g"%(ru.GetA(),ru.GetB(),ru.GetGamma()) su2=ex.SpatialUnitCell(ru) # conversion reciprocal->spatial
back to the ex module overview
