diff options
-rw-r--r-- | doc/man/indexamajig.1.md | 3 | ||||
-rw-r--r-- | src/im-sandbox.c | 2 | ||||
-rw-r--r-- | src/indexamajig.c | 17 | ||||
-rw-r--r-- | src/process_image.h | 1 |
4 files changed, 22 insertions, 1 deletions
diff --git a/doc/man/indexamajig.1.md b/doc/man/indexamajig.1.md index 229be44a..2c069c3f 100644 --- a/doc/man/indexamajig.1.md +++ b/doc/man/indexamajig.1.md @@ -580,6 +580,9 @@ INDEXING OPTIONS **--mille** : Write detector calibration data in Millepede-II format. +**--mille-dir=dirname** +: Write the Millepede-II data into _dirname_. + **--wavelength-estimate=m** **--camera-length-estimate=m** : Some indexing algorithms need to know the camera length or the wavelength of : the incident radiation in advance, e.g. to prepare an internal look-up table. diff --git a/src/im-sandbox.c b/src/im-sandbox.c index 27e33b8f..be13465c 100644 --- a/src/im-sandbox.c +++ b/src/im-sandbox.c @@ -368,7 +368,7 @@ static int run_work(const struct index_args *iargs, Stream *st, mille = NULL; if ( iargs->mille ) { char tmp[64]; - snprintf(tmp, 63, "mille-data-%i.bin", cookie); + snprintf(tmp, 63, "%s/mille-data-%i.bin", iargs->milledir, cookie); mille = crystfel_mille_new(tmp); } diff --git a/src/indexamajig.c b/src/indexamajig.c index 7f5504cd..ef25e396 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -726,6 +726,11 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) args->iargs.mille = 1; break; + case 417 : + free(args->iargs.milledir); + args->iargs.milledir = strdup(arg); + break; + /* ---------- Integration ---------- */ case 501 : @@ -971,6 +976,7 @@ int main(int argc, char *argv[]) args.iargs.n_threads = 1; args.iargs.data_format = DATA_SOURCE_TYPE_UNKNOWN; args.iargs.mille = 0; + args.iargs.milledir = strdup("."); argp_program_version_hook = show_version; @@ -1092,6 +1098,8 @@ int main(int argc, char *argv[]) "Estimate of the camera length, in metres."}, {"mille", 416, NULL, 0, "Generate data for detector geometry refinement using Millepede"}, + {"mille-dir", 417, "dirname", 0, + "Save Millepede data in folder"}, {NULL, 0, 0, OPTION_DOC, "Integration options:", 5}, {"integration", 501, "method", OPTION_NO_USAGE, "Integration method"}, @@ -1419,6 +1427,15 @@ int main(int argc, char *argv[]) free(args.outfile); free(args.indm_str); + r = mkdir(args.iargs.milledir, S_IRWXU); + if ( r ) { + if ( errno != EEXIST ) { + ERROR("Failed to create folder for Millepede data: %s\n", + strerror(errno)); + exit(1); + } + } + gsl_set_error_handler_off(); struct pf8_private_data *pf8_data = NULL; diff --git a/src/process_image.h b/src/process_image.h index eabd425a..50abbaa8 100644 --- a/src/process_image.h +++ b/src/process_image.h @@ -75,6 +75,7 @@ struct index_args float clen_estimate; int n_threads; int mille; + char *milledir; /* Integration */ IntegrationMethod int_meth; |