aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2024-01-10 16:43:29 +0100
committerThomas White <taw@physics.org>2024-01-10 16:47:51 +0100
commit185941439dd7aa7211a5d98b0a543d8ad717d65e (patch)
treef3d0827c2033a9590946656b187cdd19e50083bc /src
parent7c96ec848d3487d95b6733bbd4e29b5e2b77f5c6 (diff)
GUI: Track Millepede options through project
Note that the indexamajig option --max-mille-level isn't implemented yet.
Diffstat (limited to 'src')
-rw-r--r--src/gui_index.c7
-rw-r--r--src/gui_project.c12
-rw-r--r--src/gui_project.h2
3 files changed, 21 insertions, 0 deletions
diff --git a/src/gui_index.c b/src/gui_index.c
index aa2301ef..14f0906c 100644
--- a/src/gui_index.c
+++ b/src/gui_index.c
@@ -140,6 +140,8 @@ static void get_indexing_opts(struct crystfelproject *proj,
proj->indexing_params.exclude_nonhits = crystfel_indexing_opts_get_exclude_blanks(opts);
proj->indexing_params.exclude_peaks = crystfel_indexing_opts_get_exclude_peaks(opts);
proj->indexing_params.exclude_refls = crystfel_indexing_opts_get_exclude_reflections(opts);
+ proj->indexing_params.millepede = crystfel_indexing_opts_get_millepede(opts,
+ &proj->indexing_params.max_mille_level);
proj->indexing_params.metadata_to_copy = crystfel_indexing_opts_get_metadata_to_copy(opts,
&proj->indexing_params.n_metadata);
}
@@ -383,6 +385,9 @@ static void set_indexing_opts(struct crystfelproject *proj,
proj->indexing_params.exclude_peaks);
crystfel_indexing_opts_set_exclude_reflections(opts,
proj->indexing_params.exclude_refls);
+ crystfel_indexing_opts_set_millepede(opts,
+ proj->indexing_params.millepede,
+ proj->indexing_params.max_mille_level);
crystfel_indexing_opts_set_metadata_to_copy(opts,
proj->indexing_params.metadata_to_copy,
proj->indexing_params.n_metadata);
@@ -997,6 +1002,8 @@ static char **indexamajig_command_line(const char *geom_filename,
if ( indexing_params->exclude_nonhits ) add_arg(args, n_args++, "--no-non-hits-in-stream");
if ( indexing_params->exclude_peaks ) add_arg(args, n_args++, "--no-peaks-in-stream");
if ( indexing_params->exclude_refls ) add_arg(args, n_args++, "--no-refls-in-stream");
+ if ( indexing_params->millepede ) add_arg(args, n_args++, "--millepede");
+ if ( indexing_params->max_mille_level ) add_arg(args, n_args++, "--max-mille-level");
for ( i=0; i<indexing_params->n_metadata; i++ ) {
add_arg_string(args, n_args++, "copy-header",
indexing_params->metadata_to_copy[i]);
diff --git a/src/gui_project.c b/src/gui_project.c
index 32d6473c..c77e2704 100644
--- a/src/gui_project.c
+++ b/src/gui_project.c
@@ -429,6 +429,12 @@ static void parse_stream_opt(const char *key, const char *val,
if ( strcmp(key, "stream.exclude_refls") == 0 ) {
ip->exclude_refls = parse_int(val);
}
+ if ( strcmp(key, "stream.millepede") == 0 ) {
+ ip->millepede = parse_int(val);
+ }
+ if ( strcmp(key, "stream.max_mille_level") == 0 ) {
+ ip->max_mille_level = parse_int(val);
+ }
if ( strcmp(key, "stream.metadata") == 0 ) {
add_metadata_to_copy(ip, val);
}
@@ -1048,6 +1054,10 @@ int save_project(struct crystfelproject *proj)
proj->indexing_params.exclude_peaks);
fprintf(fh, "stream.exclude_refls %i\n",
proj->indexing_params.exclude_refls);
+ fprintf(fh, "stream.millepede %i\n",
+ proj->indexing_params.millepede);
+ fprintf(fh, "stream.max_mille_level %i\n",
+ proj->indexing_params.max_mille_level);
if ( proj->indexing_params.metadata_to_copy != NULL ) {
int i;
for ( i=0; i<proj->indexing_params.n_metadata; i++ ) {
@@ -1287,6 +1297,8 @@ int default_project(struct crystfelproject *proj)
proj->indexing_params.exclude_nonhits = 0;
proj->indexing_params.exclude_peaks = 0;
proj->indexing_params.exclude_refls = 0;
+ proj->indexing_params.millepede = 1;
+ proj->indexing_params.max_mille_level = 1;
proj->indexing_params.metadata_to_copy = NULL;
proj->indexing_params.n_metadata = 0;
proj->indexing_params.fix_profile_radius = 0.01e9;
diff --git a/src/gui_project.h b/src/gui_project.h
index 318f9453..6d704b81 100644
--- a/src/gui_project.h
+++ b/src/gui_project.h
@@ -87,6 +87,8 @@ struct index_params {
int exclude_refls;
char **metadata_to_copy;
int n_metadata;
+ int millepede;
+ int max_mille_level;
};
struct merging_params {