diff options
author | Thomas White <taw@physics.org> | 2013-02-09 18:13:15 -0800 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2013-02-09 18:13:15 -0800 |
commit | 11fe97d53a627fd5caf067bd9fe8f967cf3a72df (patch) | |
tree | 52ed158e5fc2728517746bb5a6cee8a149fed500 /src | |
parent | c32039235d2638b4b96daaf23f50353e7762134b (diff) |
Fussiness, formatting and SPOT
Diffstat (limited to 'src')
-rw-r--r-- | src/im-sandbox.c | 15 | ||||
-rw-r--r-- | src/im-sandbox.h | 12 | ||||
-rw-r--r-- | src/indexamajig.c | 40 |
3 files changed, 31 insertions, 36 deletions
diff --git a/src/im-sandbox.c b/src/im-sandbox.c index cefdeeb9..69b22cfc 100644 --- a/src/im-sandbox.c +++ b/src/im-sandbox.c @@ -182,9 +182,6 @@ static void process_image(const struct index_args *iargs, { float *data_for_measurement; size_t data_size; - int config_cmfilter = iargs->config_cmfilter; - int config_noisefilter = iargs->config_noisefilter; - IndexingMethod *indm = iargs->indm; int check; struct hdfile *hdfile; struct image image; @@ -258,16 +255,14 @@ static void process_image(const struct index_args *iargs, return; } - if ( config_cmfilter ) { - filter_cm(&image); - } + if ( iargs->cmfilter ) filter_cm(&image); /* Take snapshot of image after CM subtraction but before * the aggressive noise filter. */ data_size = image.width * image.height * sizeof(float); data_for_measurement = malloc(data_size); - if ( config_noisefilter ) { + if ( iargs->noisefilter ) { filter_noise(&image, data_for_measurement); } else { memcpy(data_for_measurement, image.data, data_size); @@ -303,7 +298,7 @@ static void process_image(const struct index_args *iargs, image.data = data_for_measurement; /* Index the pattern */ - index_pattern(&image, indm, iargs->ipriv); + index_pattern(&image, iargs->indm, iargs->ipriv); pargs->n_crystals = image.n_crystals; @@ -334,8 +329,8 @@ static void process_image(const struct index_args *iargs, /* Integrate all the crystals at once - need all the crystals so that * overlaps can be detected. */ - integrate_reflections(&image, iargs->config_closer, - iargs->config_bgsub, + integrate_reflections(&image, iargs->closer, + iargs->bgsub, iargs->min_int_snr, iargs->ir_inn, iargs->ir_mid, diff --git a/src/im-sandbox.h b/src/im-sandbox.h index f7951c04..a454d867 100644 --- a/src/im-sandbox.h +++ b/src/im-sandbox.h @@ -43,12 +43,12 @@ enum { struct index_args { UnitCell *cell; - int config_cmfilter; - int config_noisefilter; - int config_verbose; - int config_satcorr; - int config_closer; - int config_bgsub; + int cmfilter; + int noisefilter; + int verbose; + int satcorr; + int closer; + int bgsub; float threshold; float min_gradient; float min_snr; diff --git a/src/indexamajig.c b/src/indexamajig.c index 4d0b227a..ee173c6a 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -179,12 +179,12 @@ int main(int argc, char *argv[]) /* Defaults */ iargs.cell = NULL; - iargs.config_cmfilter = 0; - iargs.config_noisefilter = 0; - iargs.config_verbose = 0; - iargs.config_satcorr = 1; - iargs.config_closer = 0; - iargs.config_bgsub = 1; + iargs.cmfilter = 0; + iargs.noisefilter = 0; + iargs.verbose = 0; + iargs.satcorr = 1; + iargs.closer = 0; + iargs.bgsub = 1; iargs.tols[0] = 5.0; iargs.tols[1] = 5.0; iargs.tols[2] = 5.0; @@ -233,20 +233,20 @@ int main(int argc, char *argv[]) {"image", 1, NULL, 'e'}, /* Long-only options with no arguments */ - {"filter-cm", 0, &iargs.config_cmfilter, 1}, - {"filter-noise", 0, &iargs.config_noisefilter, 1}, - {"verbose", 0, &iargs.config_verbose, 1}, - {"no-sat-corr", 0, &iargs.config_satcorr, 0}, - {"sat-corr", 0, &iargs.config_satcorr, 1}, - {"no-check-prefix", 0, &config_checkprefix, 0}, - {"no-closer-peak", 0, &iargs.config_closer, 0}, - {"closer-peak", 0, &iargs.config_closer, 1}, - {"basename", 0, &config_basename, 1}, - {"bg-sub", 0, &iargs.config_bgsub, 1}, - {"no-bg-sub", 0, &iargs.config_bgsub, 0}, - {"no-peaks-in-stream", 0, &iargs.stream_peaks, 0}, - {"no-refls-in-stream", 0, &iargs.stream_refls, 0}, - {"res-cutoff", 0, &iargs.res_cutoff, 1}, + {"filter-cm", 0, &iargs.cmfilter, 1}, + {"filter-noise", 0, &iargs.noisefilter, 1}, + {"verbose", 0, &iargs.verbose, 1}, + {"no-sat-corr", 0, &iargs.satcorr, 0}, + {"sat-corr", 0, &iargs.satcorr, 1}, + {"no-check-prefix", 0, &config_checkprefix, 0}, + {"no-closer-peak", 0, &iargs.closer, 0}, + {"closer-peak", 0, &iargs.closer, 1}, + {"basename", 0, &config_basename, 1}, + {"bg-sub", 0, &iargs.bgsub, 1}, + {"no-bg-sub", 0, &iargs.bgsub, 0}, + {"no-peaks-in-stream", 0, &iargs.stream_peaks, 0}, + {"no-refls-in-stream", 0, &iargs.stream_refls, 0}, + {"res-cutoff", 0, &iargs.res_cutoff, 1}, {"integrate-saturated",0, &iargs.integrate_saturated,1}, {"use-saturated", 0, &iargs.use_saturated, 1}, {"no-revalidate", 0, &iargs.no_revalidate, 1}, |