From fcffbf23484f1227b3732d9e5b587d431a91e4d3 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 31 Mar 2023 15:36:27 +0200 Subject: Reject mask if good/bad bits are specified without location This should avoid surprises if the location is accidentally missed out. --- libcrystfel/src/datatemplate.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libcrystfel/src/datatemplate.c b/libcrystfel/src/datatemplate.c index 0ddbe107..504f0514 100644 --- a/libcrystfel/src/datatemplate.c +++ b/libcrystfel/src/datatemplate.c @@ -1351,6 +1351,16 @@ DataTemplate *data_template_new_from_string(const char *string_in) j, p->name); reject = 1; } + + if ( (mt->good_bits || mt->bad_bits) + && (mt->filename == NULL) + && (mt->data_location == NULL) ) + { + ERROR("You have specified good/bad bits for " + "mask %i of panel %s, but not the mask " + "location.\n", j, p->name); + reject = 1; + } } } -- cgit v1.2.3