From ac40ac2f2b6c7785d58a4c4f08ff1702de7cc4ee Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 17 Sep 2020 13:06:41 +0200 Subject: Ensure that fs dimension has higher index than ss Reading from HDF5 cannot rearrange dimensions, only select a chunk. Therefore, the layout in memory needs to match the file. --- libcrystfel/src/datatemplate.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libcrystfel/src/datatemplate.c b/libcrystfel/src/datatemplate.c index 4c4f58fb..76a61893 100644 --- a/libcrystfel/src/datatemplate.c +++ b/libcrystfel/src/datatemplate.c @@ -841,6 +841,19 @@ static int dt_num_path_placeholders(const char *str) } +signed int find_dim(signed int *dims, int which) +{ + int i; + + for ( i=0; in_panels; i++ ) { struct panel_template *p = &dt->panels[i]; + signed int dim_fs = find_dim(p->dims, DIM_FS); + signed int dim_ss = find_dim(p->dims, DIM_SS); + + if ( (dim_fs<0) || (dim_ss<0) ) { + ERROR("Panel %s does not have dimensions " + "assigned to both fs and ss.\n", + p->name); + reject = 1; + } + + if ( dim_ss > dim_fs ) { + ERROR("Fast scan dimension must be lower than " + "slow scan (panel %s)\n", p->name); + reject = 1; + } if ( p->orig_min_fs < 0 ) { ERROR("Please specify the minimum FS coordinate for" -- cgit v1.2.3