aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-02-09 17:32:27 -0800
committerThomas White <taw@physics.org>2013-02-09 17:32:27 -0800
commit463ab1b598c3ca8a120989f8a26c480a67b66268 (patch)
tree3d514c274a6fbcea2d70ed202d687b17a4a0c023
parentac00ba6fabcd5fa64b73d79b5a6b783e8763238f (diff)
uncenter_cell: Free transformation if it's not needed by the caller
-rw-r--r--libcrystfel/src/cell-utils.c8
-rw-r--r--src/im-sandbox.h1
-rw-r--r--src/indexamajig.c5
3 files changed, 12 insertions, 2 deletions
diff --git a/libcrystfel/src/cell-utils.c b/libcrystfel/src/cell-utils.c
index 3ec9a9d6..ee51622b 100644
--- a/libcrystfel/src/cell-utils.c
+++ b/libcrystfel/src/cell-utils.c
@@ -424,14 +424,18 @@ UnitCell *uncenter_cell(UnitCell *in, UnitCellTransformation **t)
tt = uncentering_transformation(in, &new_centering, &new_latt);
if ( tt == NULL ) return NULL;
- if ( t != NULL ) *t = tt;
-
out = cell_transform(in, tt);
if ( out == NULL ) return NULL;
cell_set_lattice_type(out, new_latt);
cell_set_centering(out, new_centering);
+ if ( t != NULL ) {
+ *t = tt;
+ } else {
+ tfn_free(tt);
+ }
+
return out;
}
diff --git a/src/im-sandbox.h b/src/im-sandbox.h
index 540312ed..80ffc0ad 100644
--- a/src/im-sandbox.h
+++ b/src/im-sandbox.h
@@ -71,6 +71,7 @@ struct index_args
int integrate_found;
int include_peaks;
int include_reflections;
+ int res_cutoff;
};
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 57d599b5..908c1b6e 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -121,6 +121,8 @@ static void show_help(const char *s)
"-e, --image=<element> Use this image from the HDF5 file.\n"
" Example: /data/data0.\n"
" Default: The first one found.\n"
+" --res-cutoff Estimate the resolution limit of each pattern, and\n"
+" don't integrate reflections further out.\n"
"\n"
"\nFor time-resolved stuff, you might want to use:\n\n"
" --copy-hdf5-field <f> Copy the value of field <f> into the stream. You\n"
@@ -203,6 +205,7 @@ int main(int argc, char *argv[])
int integrate_found = 0;
int config_nopeaks = 0;
int config_norefls = 0;
+ int config_rescutoff = 0;
/* For ease of upgrading from old method */
char *scellr = NULL;
@@ -255,6 +258,7 @@ int main(int argc, char *argv[])
{"int-radius", 1, NULL, 14},
{"no-peaks-in-stream", 1, &config_nopeaks, 1},
{"no-refls-in-stream", 1, &config_norefls, 1},
+ {"res-cutoff", 1, &config_rescutoff, 1},
/* FIXME: Add '--no-peaks' and '--no-reflections' */
@@ -582,6 +586,7 @@ int main(int argc, char *argv[])
iargs.integrate_found = integrate_found;
iargs.include_peaks = !config_nopeaks;
iargs.include_reflections = !config_norefls;
+ iargs.res_cutoff = config_rescutoff;
create_sandbox(&iargs, n_proc, prefix, config_basename, fh,
use_this_one_instead, ofh, argc, argv);