IonizationState

class plasmapy.particles.ionization_state.IonizationState(particle: plasmapy.particles.particle_class.Particle, ionic_fractions=None, *, T_e: Unit("K") = <Quantity nan K>, kappa: numbers.Real = inf, n_elem: Unit("1 / m3") = <Quantity nan 1 / m3>, tol: Union[float, int] = 1e-15)

Bases: object

Representation of the ionization state distribution of a single element or isotope.

Parameters
  • particle (ParticleLike) – A str or Particle instance representing an element, isotope, or ion; or an integer representing the atomic number of an element.

  • ionic_fractions (ndarray, list, tuple, or Quantity; optional) – The ionization fractions of an element, where the indices correspond to integer charge. This argument should contain the atomic number plus one items, and must sum to one within an absolute tolerance of tol if dimensionless. Alternatively, this argument may be a Quantity that represents the number densities of each neutral/ion. This argument cannot be specified when particle is an ion.

  • T_e (Quantity, keyword-only, optional) – The electron temperature or thermal energy per electron.

  • n_elem (Quantity, keyword-only, optional) – The number density of the element, including neutrals and all ions.

  • tol (float or integer, keyword-only, optional) – The absolute tolerance used by isclose when testing normalizations and making comparisons. Defaults to 1e-15.

Raises
  • ParticleError – If the ionic fractions are not normalized or contain invalid values, or if number density information is provided through both ionic_fractions and n_elem.

  • InvalidParticleError – If the particle is invalid.

Examples

>>> states = IonizationState('H', [0.6, 0.4], n_elem=1*u.cm**-3, T_e=11000*u.K)
>>> states.ionic_fractions[0]  # fraction of hydrogen that is neutral
0.6
>>> states.ionic_fractions[1]  # fraction of hydrogen that is ionized
0.4
>>> states.n_e  # electron number density
<Quantity 400000. 1 / m3>
>>> states.n_elem  # element number density
<Quantity 1000000. 1 / m3>

If the input particle is an ion, then the ionization state for the corresponding element or isotope will be set to 1.0 for that ion. For example, when the input particle is an alpha particle, the base particle will be He-4, and all He-4 particles will be set as doubly charged.

>>> states = IonizationState('alpha')
>>> states.base_particle
'He-4'
>>> states.ionic_fractions
array([0., 0., 1.])

Initialize an IonizationState instance.

Attributes Summary

T_e

Return the electron temperature.

Z_mean

Return the mean integer charge

Z_most_abundant

Return a list of the integer charges with the highest ionic fractions.

Z_rms

Return the root mean square integer charge.

atomic_number

Return the atomic number of the element.

base_particle

Return the symbol of the element or isotope.

element

Return the atomic symbol of the element.

integer_charges

Return an array with the integer charges.

ionic_fractions

Return the ionic fractions, where the index corresponds to the integer charge.

ionic_symbols

Return the ionic symbols for all charge states.

isotope

Return the isotope symbol for an isotope, or None if the particle is not an isotope.

kappa

Return the kappa parameter for a kappa distribution function for electrons.

n_e

Return the electron number density assuming a single species plasma.

n_elem

Return the total number density of neutrals and all ions.

number_densities

Return the number densities for each state.

tol

Return the absolute tolerance for comparisons.

Methods Summary

normalize()

Normalize the ionization state distribution (if set) so that the sum of the ionic fractions becomes equal to one.

summarize([minimum_ionic_fraction])

Print quicklook information for an IonizationState instance.

Attributes Documentation

T_e

Return the electron temperature.

Z_mean

Return the mean integer charge

Z_most_abundant

Return a list of the integer charges with the highest ionic fractions.

Examples

>>> He = IonizationState('He', [0.2, 0.5, 0.3])
>>> He.Z_most_abundant
[1]
>>> Li = IonizationState('Li', [0.4, 0.4, 0.2, 0.0])
>>> Li.Z_most_abundant
[0, 1]
Z_rms

Return the root mean square integer charge.

atomic_number

Return the atomic number of the element.

base_particle

Return the symbol of the element or isotope.

element

Return the atomic symbol of the element.

integer_charges

Return an array with the integer charges.

ionic_fractions

Return the ionic fractions, where the index corresponds to the integer charge.

Examples

>>> hydrogen_states = IonizationState('H', [0.9, 0.1])
>>> hydrogen_states.ionic_fractions
array([0.9, 0.1])
ionic_symbols

Return the ionic symbols for all charge states.

isotope

Return the isotope symbol for an isotope, or None if the particle is not an isotope.

kappa

Return the kappa parameter for a kappa distribution function for electrons.

The value of kappa must be greater than 1.5 in order to have a valid distribution function. If kappa equals inf, then the distribution function reduces to a Maxwellian.

n_e

Return the electron number density assuming a single species plasma.

n_elem

Return the total number density of neutrals and all ions.

number_densities

Return the number densities for each state.

tol

Return the absolute tolerance for comparisons.

Methods Documentation

normalize()None

Normalize the ionization state distribution (if set) so that the sum of the ionic fractions becomes equal to one.

This method may be used, for example, to correct for rounding errors.

summarize(minimum_ionic_fraction: numbers.Real = 0.01)None

Print quicklook information for an IonizationState instance.

Parameters

minimum_ionic_fraction (Real) – If the ionic fraction for a particular ionization state is below this level, then information for it will not be printed. Defaults to 0.01.

Example

>>> He_states = IonizationState(
...     'He',
...     [0.941, 0.058, 0.001],
...     T_e = 5.34 * u.K,
...     kappa = 4.05,
...     n_elem = 5.51e19 * u.m ** -3,
... )
>>> He_states.summarize()
IonizationState instance for He with Z_mean = 0.06
----------------------------------------------------------------
He  0+: 0.941    n_i = 5.18e+19 m**-3
He  1+: 0.058    n_i = 3.20e+18 m**-3
----------------------------------------------------------------
n_elem = 5.51e+19 m**-3
n_e = 3.31e+18 m**-3
T_e = 5.34e+00 K
kappa = 4.05
----------------------------------------------------------------