aboutsummaryrefslogtreecommitdiff
path: root/src/indexamajig.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/indexamajig.c')
-rw-r--r--src/indexamajig.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 6cf9cd15..c365048a 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -260,18 +260,24 @@ static void *process_image(void *pargsv)
image.hits = NULL;
image.n_hits = 0;
+ /* View head-on (unit cell is tilted) */
+ image.orientation.w = 1.0;
+ image.orientation.x = 0.0;
+ image.orientation.y = 0.0;
+ image.orientation.z = 0.0;
+
STATUS("Processing '%s'\n", image.filename);
result = malloc(sizeof(*result));
if ( result == NULL ) return NULL;
+ result->peaks_sane = 0;
+ result->hit = 0;
hdfile = hdfile_open(filename);
if ( hdfile == NULL ) {
- result->hit = 0;
return result;
} else if ( hdfile_set_first_image(hdfile, "/") ) {
ERROR("Couldn't select path\n");
- result->hit = 0;
return result;
}
@@ -291,17 +297,7 @@ static void *process_image(void *pargsv)
if ( config_noisefilter ) {
filter_noise(&image, data_for_measurement);
} else {
-
- int x, y;
-
- for ( x=0; x<image.width; x++ ) {
- for ( y=0; y<image.height; y++ ) {
- float val;
- val = image.data[x+image.width*y];
- data_for_measurement[x+image.width*y] = val;
- }
- }
-
+ memcpy(data_for_measurement, image.data, data_size);
}
/* Perform 'fine' peak search */
@@ -329,13 +325,11 @@ static void *process_image(void *pargsv)
}
/* No cell at this point? Then we're done. */
- result->peaks_sane = 0;
if ( image.indexed_cell == NULL ) goto done;
/* Sanity check */
if ( !peak_sanity_check(&image, image.indexed_cell) ) {
STATUS("Failed peak sanity check.\n");
- result->peaks_sane = 0;
goto done;
} else {
result->peaks_sane = 1;
@@ -372,6 +366,7 @@ static void *process_image(void *pargsv)
done:
free(image.data);
+ free(image.flags);
free(image.det.panels);
image_feature_list_free(image.features);
free(image.hits);