aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui_backend_local.c15
-rw-r--r--src/gui_project.c29
-rw-r--r--src/gui_project.h9
3 files changed, 41 insertions, 12 deletions
diff --git a/src/gui_backend_local.c b/src/gui_backend_local.c
index bbea063c..224d3415 100644
--- a/src/gui_backend_local.c
+++ b/src/gui_backend_local.c
@@ -448,6 +448,8 @@ static void *run_merging(const char *job_title,
struct local_merging_opts *opts = opts_priv;
GFile *hkl_gfile;
char *hkl;
+ char *hkl1;
+ char *hkl2;
snprintf(n_thread_str, 63, "%i", opts->n_threads);
args = merging_command_line(n_thread_str,
@@ -463,7 +465,18 @@ static void *run_merging(const char *job_title,
"crystfel.hkl");
hkl = g_file_get_path(hkl_gfile);
g_object_unref(hkl_gfile);
- add_merge_result(proj, strdup(job_title), hkl);
+
+ hkl_gfile = g_file_get_child(job->workdir,
+ "crystfel.hkl1");
+ hkl1 = g_file_get_path(hkl_gfile);
+ g_object_unref(hkl_gfile);
+
+ hkl_gfile = g_file_get_child(job->workdir,
+ "crystfel.hkl2");
+ hkl2 = g_file_get_path(hkl_gfile);
+ g_object_unref(hkl_gfile);
+
+ add_merge_result(proj, strdup(job_title), hkl, hkl1, hkl2);
return job;
}
diff --git a/src/gui_project.c b/src/gui_project.c
index cfede5e1..addf87bb 100644
--- a/src/gui_project.c
+++ b/src/gui_project.c
@@ -568,7 +568,7 @@ static void add_result(struct crystfelproject *proj,
char **streams,
int n_streams,
int selected,
- char *hkl)
+ char *hkl, char *hkl1, char *hkl2)
{
if ( (n_streams > 0) && (hkl == NULL) ) {
add_indexing_result(proj, results_name,
@@ -581,7 +581,7 @@ static void add_result(struct crystfelproject *proj,
} else if ( (hkl != NULL) && (n_streams == 0) ) {
add_merge_result(proj,
results_name,
- hkl);
+ hkl, hkl1, hkl2);
} else {
ERROR("Bad results %s (%i %s)\n",
@@ -599,6 +599,8 @@ static void read_results(FILE *fh, struct crystfelproject *proj)
int n_streams = 0;
char *results_name = NULL;
char *hkl = NULL;
+ char *hkl1 = NULL;
+ char *hkl2 = NULL;
int selected = 0;
int first = 1;
@@ -614,7 +616,7 @@ static void read_results(FILE *fh, struct crystfelproject *proj)
if ( !first ) {
add_result(proj, results_name,
streams, n_streams, selected,
- hkl);
+ hkl, hkl1, hkl2);
}
first = 0;
@@ -622,6 +624,8 @@ static void read_results(FILE *fh, struct crystfelproject *proj)
selected = 0;
streams = NULL;
hkl = NULL;
+ hkl1 = NULL;
+ hkl2 = NULL;
results_name = strdup(line+7);
}
@@ -640,11 +644,19 @@ static void read_results(FILE *fh, struct crystfelproject *proj)
hkl = strdup(line+7);
}
+ if ( strncmp(line, " HKL1 ", 7) == 0 ) {
+ hkl1 = strdup(line+8);
+ }
+
+ if ( strncmp(line, " HKL2 ", 7) == 0 ) {
+ hkl2 = strdup(line+8);
+ }
+
if ( strcmp(line, "-----") == 0 ) {
if ( !first ) {
add_result(proj, results_name,
streams, n_streams, selected,
- hkl);
+ hkl, hkl1, hkl2);
}
break;
}
@@ -889,6 +901,8 @@ int save_project(struct crystfelproject *proj)
for ( i=0; i<proj->n_merge_results; i++ ) {
fprintf(fh, "Result %s\n", proj->merge_results[i].name);
fprintf(fh, " HKL %s\n", proj->merge_results[i].hkl);
+ fprintf(fh, " HKL1 %s\n", proj->merge_results[i].hkl1);
+ fprintf(fh, " HKL2 %s\n", proj->merge_results[i].hkl2);
}
fprintf(fh, "-----\n");
@@ -1058,9 +1072,8 @@ int add_indexing_result(struct crystfelproject *proj,
}
-int add_merge_result(struct crystfelproject *proj,
- char *name,
- char *hkl)
+int add_merge_result(struct crystfelproject *proj, char *name,
+ char *hkl, char *hkl1, char *hkl2)
{
struct gui_merge_result *new_results;
@@ -1070,6 +1083,8 @@ int add_merge_result(struct crystfelproject *proj,
new_results[proj->n_merge_results].name = name;
new_results[proj->n_merge_results].hkl = hkl;
+ new_results[proj->n_merge_results].hkl1 = hkl1;
+ new_results[proj->n_merge_results].hkl2 = hkl2;
proj->merge_results = new_results;
proj->n_merge_results++;
diff --git a/src/gui_project.h b/src/gui_project.h
index 3458b928..b0431c04 100644
--- a/src/gui_project.h
+++ b/src/gui_project.h
@@ -126,7 +126,9 @@ struct gui_indexing_result
struct gui_merge_result
{
char *name;
- char *hkl;
+ char *hkl; /* Complete merged data */
+ char *hkl1; /* First half-split */
+ char *hkl2; /* Second half-split */
};
struct crystfelproject;
@@ -303,9 +305,8 @@ extern struct image *find_indexed_image(struct crystfelproject *proj,
extern struct gui_indexing_result *find_indexing_result_by_name(struct crystfelproject *proj,
const char *name);
-extern int add_merge_result(struct crystfelproject *proj,
- char *name,
- char *hkl);
+extern int add_merge_result(struct crystfelproject *proj, char *name,
+ char *hkl, char *hkl1, char *hkl2);
extern struct gui_merge_result *find_merge_result_by_name(struct crystfelproject *proj,
const char *name);