Skip to content

Commit 66b3022

Browse files
author
Jeffrey Reep
committed
add include_protons option to two_photon calculation, default to True
1 parent 27dc34c commit 66b3022

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

fiasco/io/sources/continuum_sources.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ class HSeqParser(GenericParser):
259259
-----
260260
* The parameter :math: `\psi_{\text{norm}}` (called :math: `A_{\text{sum}}` in CHIANTI) is a normalization factor of
261261
the integral of the spectral distribution function :math:`\psi(y)` from 0 to 1, such
262-
that :math: `\frac{1}{\psi_{\text{norm}}} \int_{0}^{1} \psi(y) dy = 2`.
262+
that :math: `\frac{1}{\psi_{\text{norm}}} \int_{0}^{1} \psi(y) dy = 2`. This normalization is only used For
263+
hydrogenic ions.
263264
"""
264265
filetype = 'hseq_2photon'
265266
dtypes = [int, float, int, float, float, float]

fiasco/ions.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,9 @@ def _karzas_cross_section(self, photon_energy: u.erg, ionization_energy: u.erg,
14691469

14701470
@needs_dataset('elvlc')
14711471
@u.quantity_input
1472-
def two_photon(self, wavelength: u.angstrom, electron_density: u.cm**(-3)) -> u.erg * u.cm**3 / u.s / u.angstrom:
1472+
def two_photon(self, wavelength: u.angstrom,
1473+
electron_density: u.cm**(-3),
1474+
include_protons=True) -> u.erg * u.cm**3 / u.s / u.angstrom:
14731475
r"""
14741476
Two-photon continuum emission of a hydrogenic or helium-like ion.
14751477
@@ -1512,7 +1514,8 @@ def two_photon(self, wavelength: u.angstrom, electron_density: u.cm**(-3)) -> u.
15121514
energy_dist = (A_ji * rest_wavelength * psi_interp) / (psi_norm * wavelength**3)
15131515

15141516
pe_ratio = proton_electron_ratio(self.temperature)
1515-
level_population = self.level_populations(electron_density)[:,:,1]
1517+
level_population = self.level_populations(electron_density,
1518+
include_protons=include_protons)[:,:,1]
15161519

15171520
# N_j(X+m) = N_j(X+m)/N(X+m) * N(X+m)/N(X) * N(X)/N(H) * N(H)/Ne * Ne
15181521
level_density = level_population * np.outer(self.ioneq * self.abundance * pe_ratio, electron_density)

0 commit comments

Comments
 (0)