diff options
author | Thomas White <taw@physics.org> | 2020-12-18 12:17:21 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-12-18 12:17:21 +0100 |
commit | 21c67699d352cb95549a225694575db2808d8a91 (patch) | |
tree | 9e95132317ac396334dfc336879d8e8cc796635d /libcrystfel/src/image.c | |
parent | 9da7f1b3f6a4245eb0c35fb32d32c60d60538eb2 (diff) |
Add peak_list_type in geometry file
Diffstat (limited to 'libcrystfel/src/image.c')
-rw-r--r-- | libcrystfel/src/image.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c index d50bcf43..54171321 100644 --- a/libcrystfel/src/image.c +++ b/libcrystfel/src/image.c @@ -938,19 +938,45 @@ ImageFeatureList *image_read_peaks(const DataTemplate *dtempl, { if ( is_hdf5_file(filename) ) { - const char *ext; - ext = filename_extension(filename, NULL); - if ( strcmp(ext, ".cxi") == 0 ) { + enum peak_layout layout; + + if ( dtempl->peak_list_type == PEAK_LIST_AUTO ) { + + const char *ext; + ext = filename_extension(filename, NULL); + + if ( strcmp(ext, ".cxi") == 0 ) { + layout = PEAK_LIST_CXI; + } else if ( strcmp(ext, ".h5") == 0 ) { + layout = PEAK_LIST_LIST3; + } else { + ERROR("Couldn't determine peak list layout.\n"); + ERROR("Specify peak_layout = cxi or list3n in geometry file.\n"); + return NULL; + } + + } else { + layout = dtempl->peak_list_type; + } + + switch ( layout ) { + + case PEAK_LIST_CXI : return image_hdf5_read_peaks_cxi(dtempl, filename, event, half_pixel_shift); - } else { + case PEAK_LIST_LIST3 : return image_hdf5_read_peaks_hdf5(dtempl, filename, event, half_pixel_shift); + + default : + ERROR("Invalid peak list type %i\n", layout); + return NULL; + } } else { |