schiff

Estimate the radiative properties of soft particless
git clone git://git.meso-star.com/schiff.git
Log | Files | Refs | README | LICENSE

commit 2477b0b901d47d8e5b4b3502430353943a954ba0
parent f7ce89531da8269e8f12108300b1d8ad1074bba1
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 18 Mar 2016 19:29:10 +0100

Add the -A option

Define the number of inverse cumulative phase function values.

Diffstat:
Msrc/schiff_args.c | 27++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/src/schiff_args.c b/src/schiff_args.c @@ -39,6 +39,9 @@ #include <stdarg.h> #include <yaml.h> +#define MIN_NANGLES 100 +#define MIN_NANGLES_INV 100 + #ifdef COMPILER_CL #include <getopt.h> #define strtok_r strtok_s @@ -54,7 +57,7 @@ print_help(const char* binary) { printf( "Usage: %s [OPTIONS] [FILE]\n" -"Estimate the radiative properties of micro organisms with an \"Approximation\n" +"Estimate the radiative properties of soft particles with an \"Approximation\n" "Method for Short Wavelength or High Energy Scattering\" (L. Schiff, 1956).\n" "Assume a small contrast on the relative refractive index of the particles.\n\n", binary); @@ -903,9 +906,27 @@ schiff_args_init ASSERT(argc && argv && args); *args = SCHIFF_ARGS_NULL; - while((opt = getopt(argc, argv, "a:d:g:G:hi:l:n:o:qw:")) != -1) { + while((opt = getopt(argc, argv, "a:A:d:g:G:hi:l:n:o:qw:")) != -1) { switch(opt) { - case 'a': res = cstr_to_uint(optarg, &args->nangles); break; + case 'a': + res = cstr_to_uint(optarg, &args->nangles); + if(res == RES_OK && args->nangles < MIN_NANGLES) { + fprintf(stderr, + "%s: expecting at least "STR(MIN_NANGLES)" scattering angles.\n", + argv[0]); + res = RES_BAD_ARG; + } + break; + case 'A': + res = cstr_to_uint(optarg, &args->nangles_inv); + if(res == RES_OK && args->nangles_inv < MIN_NANGLES_INV) { + fprintf(stderr, + "%s: expecting at least "STR(MIN_NANGLES_INV) + " inverse cumulative phase function values.\n", + argv[0]); + res = RES_BAD_ARG; + } + break; case 'd': res = cstr_to_uint(optarg, &args->ndirs); break; case 'g': res = cstr_to_uint(optarg, &args->nrealisations); break; case 'G': res = cstr_to_uint(optarg, &args->ngeoms_dump); break;