diff options
Diffstat (limited to 'libcrystfel/src/image.c')
-rw-r--r-- | libcrystfel/src/image.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c index 8cfe3473..9474d266 100644 --- a/libcrystfel/src/image.c +++ b/libcrystfel/src/image.c @@ -1882,18 +1882,17 @@ ImageFeatureList *get_peaks_cxi_dtempl(const DataTemplate *dtempl, ss = buf_y[pk] + peak_offset; val = buf_i[pk]; - pn = data_template_find_panel(dtempl, fs, ss); - if ( pn < -1 ) { - ERROR("Peak not in panel!\n"); - continue; + if ( data_template_file_to_panel_coords(dtempl, + &fs, &ss, + &pn) ) + { + ERROR("Failed to convert %i,%i to " + "panel-relative coordinates\n", fs, ss); + } else { + image_add_feature(features, fs, ss, pn, + NULL, val, NULL); } - /* Convert coordinates to panel-relative */ - data_template_file_to_panel_coords(dtempl, &fs, &ss); - - image_add_feature(features, fs, ss, pn, - NULL, val, NULL); - } return features; @@ -2022,18 +2021,17 @@ ImageFeatureList *get_peaks_hdf5_dtempl(const DataTemplate *dtempl, ss = buf[tw*i+1] + peak_offset; val = buf[tw*i+2]; - pn = data_template_find_panel(dtempl, fs, ss); - if ( pn < -1 ) { - ERROR("Peak not in panel!\n"); - continue; + if ( data_template_file_to_panel_coords(dtempl, + &fs, &ss, + &pn) ) + { + ERROR("Failed to convert %i,%i to " + "panel-relative coordinates\n", fs, ss); + } else { + image_add_feature(features, fs, ss, pn, + NULL, val, NULL); } - /* Convert coordinates to panel-relative */ - data_template_file_to_panel_coords(dtempl, &fs, &ss); - - image_add_feature(features, fs, ss, pn, - NULL, val, NULL); - } free(buf); |