star-line

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

commit d4ef211a5ab762b3d18ddbb60fe630c64c12210d
parent 5463146a7990feda607c7388ffc795b5c06fa732
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu, 19 Mar 2026 14:27:41 +0100

sln-slab: fix the realisation function

In the absence of absorption, the returned weight was wrong.

Diffstat:
Msrc/sln_slab.c | 9+++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/sln_slab.c b/src/sln_slab.c @@ -347,8 +347,8 @@ sample_line step[depth] = '\0'; if(cmd->args.verbose >= 1) { fprintf(stderr, - "error: ka < ka0 + ka1; %e < %e+%e; nu=%-21.20g cm^-1; node path: -%s\n", - ka_max, ka_max0, ka_max1, nu, step); + "error: ka < ka0 + ka1; %e < %e+%e; nu=%-21.20g cm^-1; node path: %c%s\n", + ka_max, ka_max0, ka_max1, nu, step[0] != '\0' ? '-' : ' ', step); } return NULL; } @@ -445,10 +445,7 @@ realisation(const struct cmd* cmd, struct ssp_rng* rng, double* out_weight) dst = ssp_ran_exp(rng, ka_max); /* Sample a traversal distance */ - if(dst > dst_remain) { /* No absorption in the slab */ - w = cmd->args.spectral_range[1] - cmd->args.spectral_range[0]; - break; - } + if(dst > dst_remain) { w=1.0; break; } /* No absorption in the slab */ /* Importance sampling of a line */ node = sample_line(cmd, rng, nu, &line_proba);