commit 419fa74ef25bdf88fd18d4de96c90e35f5f2620d
parent 24e085623af95c4b400e079aa343819ce1ca7dd3
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 29 Oct 2015 08:13:34 +0100
Update the -s option
The radius and sigma arguments of used by spherical mesh lognormal
distribution are no more optionals.
Diffstat:
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/schiff_args.c b/src/schiff_args.c
@@ -48,7 +48,7 @@ print_help(const char* binary)
{
printf(
"Usage: %s [OPTION]... [FILE]\n"
-"Estimate the radiative properties of micro organism with an \"Approximation\n"
+"Estimate the radiative properties of micro organisms with an \"Approximation\n"
"Method for Short Wavelength or High Energy Scattering\" (L. Schiff, 1956).\n\n",
binary);
printf(
@@ -68,13 +68,11 @@ print_help(const char* binary)
" -o OUTPUT write results to OUTPUT. If not defined, write results to\n"
" stdout.\n");
printf(
-" -s [R[:S[:N]] the micro organisms are spherical meshes discretised in N\n"
-" points along 2PI. Their radius is distributed with respect to a\n"
+" -s R:S[:N] the micro organisms are spherical meshes discretised in N\n"
+" slices along 2PI. Their radius is distributed with respect to a\n"
" lognormal distribution:\n"
" 1/(ln(S)*x*sqrt(2PI)) * exp(-(ln(x)-ln(R))^2 / (2*ln(S)^2))\n"
-" Default is %g:%g:%u.\n",
- SCHIFF_DISTRIBUTION_SPHERE_DEFAULT.radius,
- SCHIFF_DISTRIBUTION_SPHERE_DEFAULT.sigma,
+" By default N is %u.\n",
SCHIFF_DISTRIBUTION_SPHERE_DEFAULT.nthetas);
printf(
" -w A[:B]... list of wavelengths to integrate in meter. At least one\n"
@@ -118,13 +116,17 @@ schiff_args_init
case 's':
res = cstr_to_list_double(optarg, list, &len, 3);
if(res == RES_OK) {
- args->distribution.sphere = SCHIFF_DISTRIBUTION_SPHERE_DEFAULT;
- if(len > 0) args->distribution.sphere.radius = list[0];
- if(len > 1) args->distribution.sphere.sigma = list[1];
- if(len > 2) {
- args->distribution.sphere.nthetas = (unsigned)list[2];
- if((double)args->distribution.sphere.nthetas != list[2])
- res = RES_BAD_ARG;
+ if(len < 2) {
+ res = RES_BAD_ARG;
+ } else {
+ args->distribution.sphere = SCHIFF_DISTRIBUTION_SPHERE_DEFAULT;
+ args->distribution.sphere.radius = list[0];
+ args->distribution.sphere.sigma = list[1];
+ if(len > 2) {
+ args->distribution.sphere.nthetas = (unsigned)list[2];
+ if((double)args->distribution.sphere.nthetas != list[2])
+ res = RES_BAD_ARG;
+ }
}
}
break;