soprano.calculate.xrd.sel_rules#

Providing an interface to selection rules for XRD peaks and various spacegroups.

Functions

get_sel_rule_from_hall(h)

Generate a function object that acts as a selection rule for XRD lines for the given symmetry group expressed in Hall number notation

get_sel_rule_from_international(n[, o])

Generate a function object that acts as a selection rule for XRD lines for the given symmetry group expressed in international number notation

soprano.calculate.xrd.sel_rules._evenq(x)[source]#

Returns True if x is even

soprano.calculate.xrd.sel_rules._ifq(cond, ifT, ifF)[source]#

Fortran-style ternary if

soprano.calculate.xrd.sel_rules._integerq(x)[source]#

Returns true if x is integer

soprano.calculate.xrd.sel_rules.get_sel_rule_from_hall(h)[source]#

Generate a function object that acts as a selection rule for XRD lines for the given symmetry group expressed in Hall number notation

Args:
h (int): Hall number of the required spacegroup
Returns:
rule_func (function< list<int> >
=> <bool>): a function that can be used to test triples of
Miller indices h,k,l to verify whether the
related plane gives rise or not to a peak
Raises:
RuntimeError: if the database of XRD selection rules or that of
Hall numbers was not properly loaded
ValueError: if the passed argument is invalid
soprano.calculate.xrd.sel_rules.get_sel_rule_from_international(n, o='all')[source]#

Generate a function object that acts as a selection rule for XRD lines for the given symmetry group expressed in international number notation

Args:
n (int): International number of the required spacegroup
o (Optional[int]): Sub-option of the required spacegroup
Returns:
rule_func (function< list<int> >
=> <bool>): a function that can be used to test triples of
Miller indices h,k,l to verify whether the
related plane gives rise or not to a peak
Raises:
RuntimeError: if the database of XRD selection rules was not properly
loaded
ValueError: if some of the passed arguments are invalid