sisl.geom.AtomXYZ
- class sisl.geom.AtomXYZ
Bases:
AtomCategoryClassify atoms based on coordinates
- Parameters:
*args (
Shape) – any shape that implements Shape.within**kwargs –
keys are operator specifications and values are used in those specifications. The keys are split into 3 sections
<options>_<direction>_<operator>optionsare made of combinations of['a', 'f']i.e."af","f"or"a"are all valid. Anatakes the absolute value,fmeans a fractional coordinate. This part is optional.directionis anything that gets parsed insisl.utils.misc.directioneither one of{0, "X", "x", "a", 1, "Y", "y", "b", 2, "Z", "z", "c"}.operatoris a name for an operator defined in theoperatormodule.
For instance
a_z_lt=3.will be equivalent to the boolean operationnp.fabs(geometry.xyz[:, 2]) < 3..Optionally one need not specify the operator in which case one should provide an argument of two values.
For instance
c=(3., 6.)will be equivalent to the boolean operation3. <= geometry.xyz[:, 2]) <= 6..
- x, y, z, fx, fy, fz, ax, ay, az
Shortcuts for creating an
AtomXYZcategory.AtomXYZ.x(-2, 3) == AtomXYZ(x=(-2, 3)) AtomXYZ.fx < 3 == AtomXYZ.fx(None, 3) == AtomXYZ(f_x=(None, 3)) == AtomXYZ(f_x_lt=3)
- Type:
Methods
categorize(geometry[, atoms])Do categorization
is_class(name[, case])Query whether
nameis one of the keywords of this classkw(**kwargs)Create categories based on keywords
mask(*args, **kwargs)Boolean array which is true for the objects in this category
Attributes
Name of category
- ax
alias of
Atomax
- ay
alias of
Atomay
- az
alias of
Atomaz
- fx
alias of
Atomfx
- fy
alias of
Atomfy
- fz
alias of
Atomfz
- x
alias of
Atomx
- y
alias of
Atomy
- z
alias of
Atomz
- classmethod is_class(name, case=True)
Query whether
nameis one of the keywords of this classThe keywords are the
keyandaliasesclass arguments. Sub-classes may override this method for other matching rules.
- classmethod kw(**kwargs)
Create categories based on keywords
This will search through the inherited classes and return and & category object for all keywords.
Since this is a class method one should use this on the base category class in the given section of the code.
Each keyword matches a sub-class through
is_class, first case-sensitive, then case-insensitive. The value is passed to the matched class:Truecreates it without arguments (odd=True),a dict is passed as keyword arguments (
odd={}),anything else is passed as the single argument (
Z="C").
- Raises:
TypeError – if no keywords are given
ValueError – if a keyword matches no, or more than one, sub-class
- categorize(geometry, atoms=None)[source]
Do categorization
- Parameters:
geometry (Geometry)
atoms (AtomsIndex)
- mask(*args, **kwargs)
Boolean array which is true for the objects in this category
The arguments are the same as for
categorize. The parts of a composite category share their calculations, e.g. the neighbor search ofAtomNeighbors.- Returns:
1D boolean array, one value per categorized object.
- Return type:
- property name
Name of category