aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2024-01-10 16:34:28 +0100
committerThomas White <taw@physics.org>2024-01-10 16:34:28 +0100
commit7c96ec848d3487d95b6733bbd4e29b5e2b77f5c6 (patch)
tree7cfb3f9c173a9a08bad38045a41cbaa1ad0b48ad /src
parente13b2276d3949b3e7a185ddc8479ac65bfdfbf18 (diff)
CrystFELIndexingOpts: Add Millepede output options
Diffstat (limited to 'src')
-rw-r--r--src/crystfelindexingopts.c35
-rw-r--r--src/crystfelindexingopts.h8
2 files changed, 43 insertions, 0 deletions
diff --git a/src/crystfelindexingopts.c b/src/crystfelindexingopts.c
index d1cf515f..50a36748 100644
--- a/src/crystfelindexingopts.c
+++ b/src/crystfelindexingopts.c
@@ -734,6 +734,7 @@ static GtkWidget *stream_parameters(CrystFELIndexingOpts *io)
GtkCellRenderer *renderer;
GtkWidget *button;
GtkWidget *hbox;
+ GtkWidget *label;
box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 8);
gtk_container_set_border_width(GTK_CONTAINER(box), 8);
@@ -759,6 +760,24 @@ static GtkWidget *stream_parameters(CrystFELIndexingOpts *io)
gtk_widget_set_tooltip_text(io->no_refls_in_stream,
"--no-refls-in-stream");
+ io->millepede = gtk_check_button_new_with_label("Write calibration data for detector alignment");
+ gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(io->millepede),
+ FALSE, FALSE, 4.0);
+ gtk_widget_set_tooltip_text(io->millepede, "--mille");
+
+ hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
+ gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(hbox),
+ FALSE, FALSE, 0.0);
+ label = gtk_label_new("Maximum refinement level:");
+ gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label),
+ FALSE, FALSE, 16.0);
+ io->max_mille = gtk_spin_button_new_with_range(0.0, 9.0, 1.0);
+ gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(io->max_mille),
+ FALSE, FALSE, 4.0);
+ gtk_widget_set_tooltip_text(io->max_mille, "--max-mille-level");
+ i_disable_if_not(io->millepede, io->max_mille);
+ i_disable_if_not(io->millepede, label);
+
io->copy_metadata_store = gtk_list_store_new(1, G_TYPE_STRING);
treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(io->copy_metadata_store));
@@ -1055,6 +1074,14 @@ int crystfel_indexing_opts_get_exclude_reflections(CrystFELIndexingOpts *opts)
}
+int crystfel_indexing_opts_get_millepede(CrystFELIndexingOpts *opts,
+ int *pmax_level)
+{
+ *pmax_level = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(opts->max_mille));
+ return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(opts->millepede));
+}
+
+
char **crystfel_indexing_opts_get_metadata_to_copy(CrystFELIndexingOpts *opts,
int *pn)
{
@@ -1381,6 +1408,14 @@ void crystfel_indexing_opts_set_integration_radii(CrystFELIndexingOpts *opts,
}
+void crystfel_indexing_opts_set_millepede(CrystFELIndexingOpts *opts,
+ int enable, int max_level)
+{
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(opts->max_mille), max_level);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(opts->millepede), enable);
+}
+
+
void crystfel_indexing_opts_set_metadata_to_copy(CrystFELIndexingOpts *opts,
char *const *headers,
int n)
diff --git a/src/crystfelindexingopts.h b/src/crystfelindexingopts.h
index 567bdb8e..e87d2dac 100644
--- a/src/crystfelindexingopts.h
+++ b/src/crystfelindexingopts.h
@@ -96,6 +96,8 @@ struct _crystfelindexingopts
GtkWidget *exclude_nonhits;
GtkWidget *no_peaks_in_stream;
GtkWidget *no_refls_in_stream;
+ GtkWidget *millepede;
+ GtkWidget *max_mille;
GtkListStore *copy_metadata_store;
};
@@ -133,6 +135,8 @@ extern int crystfel_indexing_opts_get_exclude_peaks(CrystFELIndexingOpts *opts);
extern int crystfel_indexing_opts_get_exclude_reflections(CrystFELIndexingOpts *opts);
extern char **crystfel_indexing_opts_get_metadata_to_copy(CrystFELIndexingOpts *opts,
int *n);
+extern int crystfel_indexing_opts_get_millepede(CrystFELIndexingOpts *opts,
+ int *pmax_level);
extern double crystfel_indexing_opts_get_fixed_profile_radius(CrystFELIndexingOpts *opts,
int *active);
extern double crystfel_indexing_opts_get_fixed_divergence(CrystFELIndexingOpts *opts);
@@ -191,6 +195,10 @@ extern void crystfel_indexing_opts_set_exclude_peaks(CrystFELIndexingOpts *opts,
int flag);
extern void crystfel_indexing_opts_set_exclude_reflections(CrystFELIndexingOpts *opts,
int flag);
+
+extern void crystfel_indexing_opts_set_millepede(CrystFELIndexingOpts *opts,
+ int enable, int max_level);
+
extern void crystfel_indexing_opts_set_fixed_profile_radius(CrystFELIndexingOpts *opts,
int active,
double val);