star-line

Structure for accelerating line importance sampling
git clone git://git.meso-star.fr/star-line.git
Log | Files | Refs | README | LICENSE

commit 8e7a5b5825d3ae39f99e1cca59be5b12632f41f2
parent edc2211881b3af77eb8fc4177b5439641d93c9b2
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed,  4 May 2022 16:42:23 +0200

Fix the computation of the line intensity

Diffstat:
Msrc/sln_line.c | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/sln_line.c b/src/sln_line.c @@ -76,6 +76,7 @@ line_profile_factor const struct molecule_params* mol_params = NULL; /* Miscellaneous */ + double iso_abundance; double density; /* In molec.cm^-3 */ double intensity, intensity_ref; /* In cm^-1/(molec.cm^2) */ double Q, Q_T, Q_Tref; /* Partition function */ @@ -122,9 +123,12 @@ line_profile_factor Q = Q_Tref/Q_T; /* Compute the intensity */ - intensity_ref = - shtr_line->intensity/isotope->abundance - * mol_params->isotopes_abundance[shtr_line->isotope_id_local]; + iso_abundance = mol_params->isotopes_abundance[shtr_line->isotope_id_local]; + if(iso_abundance < 0) { /* Use default abundance */ + intensity_ref = shtr_line->intensity; + } else { + intensity_ref = shtr_line->intensity/isotope->abundance*iso_abundance; + } intensity = line_intensity(intensity_ref, shtr_line->lower_state_energy, Q, tree->temperature, T_REF, nu_c);