star-schiff

Library for estimating radiative properties
git clone git://git.meso-star.com/star-schiff.git
Log | Files | Refs | README | LICENSE

commit a9bc05a88c0322e1eb9c3a095de7e55952102bb6
parent 50f608d49311598fe30ebd099457e50eb1a7d791
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon,  4 Apr 2016 14:46:57 +0200

Fix the computation of the differential cross sections

The volume scaling was not fully handled in the computation of the
differential cross sections.

Diffstat:
Msrc/sschiff_estimator.c | 13++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/sschiff_estimator.c b/src/sschiff_estimator.c @@ -331,14 +331,9 @@ accum_differential_cross_section (struct integrator_context* ctx, const double plane_area, const double path_length[2], - float ray_org[2][3]) + const double delta_r)/* Length between the 2 ray origins in footprint space */ { - double delta_r; size_t iwlen; - float vec[3]; - - /* Compute the length between the 2 ray starting points in footprint space */ - delta_r = f3_len(f3_sub(vec, ray_org[0], ray_org[1])); FOR_EACH(iwlen, 0, ctx->nwavelengths) { double k_e_delta_r; @@ -430,7 +425,9 @@ accum_monte_carlo_weight f3_add(org, pos, f3_mulf(org, axis_z, lower[2])); do { + float vec[3]; double path_length[2]; + double delta_r; /* Uniformly sample a position onto the projection plane and use it as the * origin of the 1st ray to trace */ @@ -477,7 +474,9 @@ accum_monte_carlo_weight } /* Compute and accumulate the per scattering angle differential cross * section weight */ - accum_differential_cross_section(ctx, plane_area, path_length, ray_org); + delta_r = f3_len(f3_sub(vec, ray_org[0], ray_org[1])); + delta_r *= dist_scaling; + accum_differential_cross_section(ctx, plane_area, path_length, delta_r); } while(res != RES_OK && nfailures < MAX_FAILURES);