diffcalc.hkl.constraints¶
Module handling constraint information for diffractometer calculations.
Classes
|
Collection of angle constraints for diffractometer calculations. |
- class diffcalc.hkl.constraints.Constraints(constraints: Collection[Tuple[str, float] | str] | None = None)[source]¶
Collection of angle constraints for diffractometer calculations.
Three constraints are required for calculations of miller indices and the corresponding diffractometer positions. Allowed configurations include at most one of the reference and the detector type constraint and up to three of the sample type constraints.
List of the available constraint combinations:
1 x samp, 1 x ref and 1 x det: all
- 2 x samp and 1 x ref: chi & phi
chi & eta chi & mu mu & eta mu & phi eta & phi
- 2 x samp and 1 x det: chi & phi
mu & eta mu & phi mu & chi eta & phi eta & chi bisect & mu bisect & eta bisect & omega
- 3 x samp: eta, chi & phi
mu, chi & phi mu, eta & phi mu, eta & chi
- Attributes:
a_eq_bConstraint for setting alpha = beta.
allGet all angle names and values.
alphaConstraint for alpha angle.
asdictGet all constrained angle names and values.
astupleGet all constrained angle names and values.
betaConstraint for beta angle.
betainConstraint for betain angle.
betaoutConstraint for betaout angle.
bin_eq_boutConstraint for betain = betaout.
bisectConstraint for bisect mode.
chiConstraint for chi angle.
deltaConstraint for delta angle.
etaConstraint for eta angle.
muConstraint for mu angle.
nazConstraint for naz angle.
nuConstraint for nu angle.
omegaConstraint for omega angle.
phiConstraint for phi angle.
psiConstraint for psi angle.
qazConstraint for qaz angle.
Methods
clear()Remove all constraints.
Check if current constraint set is implemented.
is_fully_constrained([con])Check if configuration is fully constrained.
Object for setting diffractometer angle constraints.
- Attributes:
a_eq_bConstraint for setting alpha = beta.
allGet all angle names and values.
alphaConstraint for alpha angle.
asdictGet all constrained angle names and values.
astupleGet all constrained angle names and values.
betaConstraint for beta angle.
betainConstraint for betain angle.
betaoutConstraint for betaout angle.
bin_eq_boutConstraint for betain = betaout.
bisectConstraint for bisect mode.
chiConstraint for chi angle.
deltaConstraint for delta angle.
etaConstraint for eta angle.
muConstraint for mu angle.
nazConstraint for naz angle.
nuConstraint for nu angle.
omegaConstraint for omega angle.
phiConstraint for phi angle.
psiConstraint for psi angle.
qazConstraint for qaz angle.
Methods
clear()Remove all constraints.
Check if current constraint set is implemented.
is_fully_constrained([con])Check if configuration is fully constrained.
- property all: Dict[str, float | bool | None]¶
Get all angle names and values.
- Returns:
Dictionary with all angle names and values.
- Return type:
Dict[str, Union[float, bool, None]]
- property asdict: Dict[str, float | bool]¶
Get all constrained angle names and values.
- Returns:
Dictionary with all constrained angle names and values.
- Return type:
Dict[str, Union[float, bool]]
- property astuple: Tuple[Tuple[str, float] | str, ...]¶
Get all constrained angle names and values.
- Returns:
Tuple with all constrained angle names and values.
- Return type:
Tuple[Union[Tuple[str, float], str], …]
- property delta: float | None¶
Constraint for delta angle.
- property nu¶
Constraint for nu angle.
- property qaz¶
Constraint for qaz angle.
- property naz¶
Constraint for naz angle.
- property a_eq_b¶
Constraint for setting alpha = beta.
- property alpha¶
Constraint for alpha angle.
- property beta¶
Constraint for beta angle.
- property psi¶
Constraint for psi angle.
- property bin_eq_bout¶
Constraint for betain = betaout.
- property betain¶
Constraint for betain angle.
- property betaout¶
Constraint for betaout angle.
- property mu¶
Constraint for mu angle.
- property eta¶
Constraint for eta angle.
- property chi¶
Constraint for chi angle.
- property phi¶
Constraint for phi angle.
- property bisect¶
Constraint for bisect mode.
- property omega¶
Constraint for omega angle.
- is_fully_constrained(con: _Constraint | None = None) bool[source]¶
Check if configuration is fully constrained.
- Parameters:
con (_Constraint, default = None) – Check if there are available constraints is the same category as the input constraint. If parameter is None, check for all constraint categories.
- Returns:
True if there aren’t any constraints available either in the input constraint category or no constraints are available.
- Return type:
bool