def ioneq_one(self, stage, **kwargs):
"""
Calculate the equilibrium fractional ionization of the ion as a function of temperature.
Uses the `ChiantiPy.core.ioneq` module and does a first-order spline interpolation to the data. An
ionization equilibrium file can be passed as a keyword argument, `ioneqfile`. This can
be passed through as a keyword argument to any of the functions that uses the
ionization equilibrium.
Parameters
----------
stage : int
Ionization stage, e.g. 25 for Fe XXV
"""
tmp = ioneq(self.Z)
tmp.load(ioneqName=kwargs.get('ioneqfile', None))
ionization_equilibrium = splev(self.Temperature,
splrep(tmp.Temperature, tmp.Ioneq[stage-1,:], k=1), ext=1)
return np.where(ionization_equilibrium < 0., 0., ionization_equilibrium)
评论列表
文章目录