33
edits
(rev 0.65) |
|||
Line 82: | Line 82: | ||
# revision 0.63 . Keitaro 13/04/2016 Set UNTRUSTED_RECTANGLE=s for EIGER 9M and 16M (KD). | # revision 0.63 . Keitaro 13/04/2016 Set UNTRUSTED_RECTANGLE=s for EIGER 9M and 16M (KD). | ||
# revision 0.64 . KD 16/06/2016 reverse phi @APS 19ID (reported by Wolfram Tempel) | # revision 0.64 . KD 16/06/2016 reverse phi @APS 19ID (reported by Wolfram Tempel) | ||
REVISION="0. | # revision 0.65 . Keitaro 07/09/2016 Fix for "too many arguments" problem in ls | ||
REVISION="0.65 (07-Sep-2016)" | |||
# | # | ||
# usage: e.g. generate_XDS.INP "/file/system/frms/mydata_1_???.img" | # usage: e.g. generate_XDS.INP "/file/system/frms/mydata_1_???.img" | ||
Line 121: | Line 122: | ||
SENSOR_THICKNESS=0 | SENSOR_THICKNESS=0 | ||
TRUSTED_REGION="0.0 1.2 ! partially use corners of detector (0 1.4143: use all pixels)" | TRUSTED_REGION="0.0 1.2 ! partially use corners of detector (0 1.4143: use all pixels)" | ||
dname=`echo "$1" | xargs dirname` | |||
test "${dname}" == "" && dname="." | |||
bname=`echo "$1" | xargs basename` | |||
# see how we are called: | # see how we are called: | ||
NAME_TEMPLATE_OF_DATA_FRAMES="$ | NAME_TEMPLATE_OF_DATA_FRAMES="${dname}/${bname}" | ||
# list frames matching the wildcards in NAME_TEMPLATE_OF_DATA_FRAMES | # list frames matching the wildcards in NAME_TEMPLATE_OF_DATA_FRAMES | ||
# don't accept the "direct beam" shot at SLS/Pilatus PX-I and PX-II | # don't accept the "direct beam" shot at SLS/Pilatus PX-I and PX-II | ||
# cope with blanks in directory / file name | # cope with blanks in directory / file name | ||
IFS=$'\n' | IFS=$'\n' | ||
find $dname -name "$bname" -or -name "${bname}.bz2" -or -name "${bname}.gz" -or -name "${bname}.xz" | egrep -v "_00000.cbf|_000.img" | sort > tmp1 | |||
if [ ! -s tmp1 ] | if [ ! -s tmp1 ] | ||
then | then | ||
Line 141: | Line 146: | ||
else | else | ||
# Find the first '?' position and the number of '?' to determine DATA_RANGE=. | # Find the first '?' position and the number of '?' to determine DATA_RANGE=. | ||
pos1=`echo "$ | pos1=`echo "$NAME_TEMPLATE_OF_DATA_FRAMES" | awk '{print index($0, "?")}'` | ||
pos2=`echo "$ | pos2=`echo "$NAME_TEMPLATE_OF_DATA_FRAMES" | sed -e "s/[^\?]//g" | awk '{print length+'$pos1' - 1'}` | ||
data_first=`cat tmp1 | cut -b $pos1-$pos2 | head -n1|bc` | data_first=`cat tmp1 | cut -b $pos1-$pos2 | head -n1|bc` | ||
data_last=`cat tmp1 | cut -b $pos1-$pos2 | tail -n1|bc` | data_last=`cat tmp1 | cut -b $pos1-$pos2 | tail -n1|bc` |
edits