diff options
author | Thomas White <taw@physics.org> | 2014-10-24 17:08:08 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2014-10-24 17:08:08 +0200 |
commit | b91982acc7ba011a343b3021676ae196949228b2 (patch) | |
tree | 77290bdd7a57b6d125ab23a2b6cac70dd155a31a /src | |
parent | 5b1bd4c46b6137a78ce9641c7113baac704db42a (diff) |
hdfsee: More peak fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/dw-hdfsee.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c index 4dd04940..d22f83c6 100644 --- a/src/dw-hdfsee.c +++ b/src/dw-hdfsee.c @@ -1039,14 +1039,23 @@ static void load_features_from_file(struct image *image, const char *filename) snprintf(name, 31, "%i %i %i", h, k, l); p = find_panel_by_name(image->det, pn); - /* Convert coordinates to match rearranged panels in - * memory */ - fs = fs-p->orig_min_fs+p->min_fs; - ss = ss-p->orig_min_ss+p->min_ss; + if ( p == NULL ) { + + ERROR("Unable to find panel %s\n", pn); + + } else { + + /* Convert coordinates to match rearranged + * panels in memory */ + fs = fs-p->orig_min_fs+p->min_fs; + ss = ss-p->orig_min_ss+p->min_ss; + + } image_add_feature(image->features, fs, ss, image, 1.0, strdup(name)); continue; + } /* Try long peak format from stream */ @@ -1064,10 +1073,11 @@ static void load_features_from_file(struct image *image, const char *filename) fs = fs - p->orig_min_fs + p->min_fs; ss = ss - p->orig_min_ss + p->min_ss; - image_add_feature(image->features, fs, ss, - image, 1.0, "peak"); } + image_add_feature(image->features, fs, ss, image, 1.0, "peak"); + + } while ( rval != NULL ); } |