Skip to content

charged

charged(attr="", mass=False, ne=False)

Filters the catalogue to species with a non-zero net charge and returns either the Specie objects or a chosen attribute of each. Preserves the relative catalogue order of the surviving species.

Parameters

attr : str, optional
Name of a Specie attribute to extract. If given, returns that attribute value for each charged species instead of the Specie object itself. Leave empty (default) to return the Specie objects.

Supported attributes are: charge elements exploded fidx index mass name serialized

mass : bool, optional
If True, returns the mass of each charged species. Equivalent to passing attr="mass". Default False.
ne : bool, optional
If True, excludes the electron species ("e-") from the result even though it is charged. Default False.

Returns

Vector[Specie or any]
Charged Specie objects in catalogue order, or the value of attr for each charged species if attr was given.