diff options
author | Thomas White <taw@physics.org> | 2014-12-15 13:40:33 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2014-12-15 13:40:33 +0100 |
commit | 1dc4b5ae9c42e13d49c85ae106e5b2d654451ef0 (patch) | |
tree | c8a522cc31c59bbba43b57ffe70b53ab41471a44 /src/dw-hdfsee.c | |
parent | 8fb240b7cc96f0b8fd866867a0317a274bd63aab (diff) |
hdfsee: Handle peak lists from old streams (without panel names)
Diffstat (limited to 'src/dw-hdfsee.c')
-rw-r--r-- | src/dw-hdfsee.c | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c index 72e3b435..d86d70cc 100644 --- a/src/dw-hdfsee.c +++ b/src/dw-hdfsee.c @@ -1088,23 +1088,41 @@ static void load_features_from_file(struct image *image, const char *filename) /* Try long peak format from stream */ r = sscanf(line, "%f %f %f %f %s", &fs, &ss, &d, &intensity, pn); - if ( r != 5 ) continue; + if ( r == 5 ) { - p = find_panel_by_name(image->det, pn); - if ( p == NULL ) { - ERROR("Unable to find panel %s " - "(no geometry file given?)\n", pn); - } else { + p = find_panel_by_name(image->det, pn); + if ( p == NULL ) { + ERROR("Unable to find panel %s " + "(no geometry file given?)\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; + /* 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, + "peak"); + } else if ( r == 4 ) { - image_add_feature(image->features, fs, ss, image, 1.0, "peak"); + p = find_orig_panel(image->det, fs, ss); + + if ( p == NULL ) { + ERROR("Unable to find panel " + "(no geometry file given?)\n"); + } 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, + "peak"); + + } } while ( rval != NULL ); |