aboutsummaryrefslogtreecommitdiff
path: root/src/dw-hdfsee.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-03-15 10:41:35 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:20 +0100
commitbe49b97c792edc33d908965823f73f33b830d557 (patch)
tree50a3a1eea924b6347e92ec46c6d67f2ba1c22787 /src/dw-hdfsee.c
parent0f1a16a196ffed32eab9ede885de6d73928c718f (diff)
More work on new stream format
Diffstat (limited to 'src/dw-hdfsee.c')
-rw-r--r--src/dw-hdfsee.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index 55a06fef..4d8f586c 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -695,29 +695,32 @@ static void load_features_from_file(struct image *image, const char *filename)
do {
char line[1024];
- float x, y, df;
+ float intensity, sigma, res, fs, ss;
+ char phs[1024];
int r;
+ int cts;
signed int h, k, l;
rval = fgets(line, 1023, fh);
if ( rval == NULL ) continue;
chomp(line);
- /* Try long format (output of pattern_sim --near-bragg) */
- r = sscanf(line, "%i %i %i %f (at %f,%f)",
- &h, &k, &l, &df, &x, &y);
- if ( r == 6 ) {
+ /* Try long format (from stream) */
+ r = sscanf(line, "%i %i %i %f %s %f %f %i %f %f",
+ &h, &k, &l, &intensity, phs, &sigma, &res, &cts,
+ &fs, &ss);
+ if ( r == 10 ) {
char name[32];
snprintf(name, 31, "%i %i %i", h, k, l);
- image_add_feature(image->features, x, y, image, 1.0,
+ image_add_feature(image->features, fs, ss, image, 1.0,
strdup(name));
continue;
}
- r = sscanf(line, "%f %f", &x, &y);
+ r = sscanf(line, "%f %f", &fs, &ss);
if ( r != 2 ) continue;
- image_add_feature(image->features, x, y, image, 1.0, NULL);
+ image_add_feature(image->features, fs, ss, image, 1.0, NULL);
} while ( rval != NULL );
}