Generate XDS.INP: Difference between revisions

→‎The script: revision 0.24
(→‎The script: rev 0.23)
(→‎The script: revision 0.24)
Line 37: Line 37:
# revision 0.22 . KD 12/2011 - Pilatus 2M UNTRUSTED_RECTANGLE lines, SENSOR_THICKNESS from header
# revision 0.22 . KD 12/2011 - Pilatus 2M UNTRUSTED_RECTANGLE lines, SENSOR_THICKNESS from header
# revision 0.23 . KD 1/2012 - add UNTRUSTED_QUADRILATERAL, remove MINIMUM_ZETA (0.05 is default now)
# revision 0.23 . KD 1/2012 - add UNTRUSTED_QUADRILATERAL, remove MINIMUM_ZETA (0.05 is default now)
REVISION="0.23 (22-Jan-2012)"                                                                                 
# revision 0.24 . KD 3/2012 - remove revision 0.10 since XDS now takes much longer paths
REVISION="0.24 (28-Mar-2012)"                                                                                 
#                                                                                                             
#                                                                                                             
# usage: e.g. generate_XDS.INP "frms/mydata_1_???.img"                                                       
# usage: e.g. generate_XDS.INP "frms/mydata_1_???.img"                                                       
Line 77: Line 78:
SENSOR_THICKNESS=0                                                                                               
SENSOR_THICKNESS=0                                                                                               
# see how we are called:                                                                                         
# see how we are called:                                                                                         
NAME_TEMPLATE_OF_DATA_FRAMES="$1"                                                                              
NAME_TEMPLATE_OF_DATA_FRAMES="$1"
 
# check that the image template name does not exceed 72 characters
# and set a link if necessary                                   
if [ ${#1} -gt 72 ]; then                                       
    TMP_PATH=$(/bin/ls -C1 $1 $1.bz2 2>/dev/null | head -1)     
    TMP_FILENAME=$(basename ${TMP_PATH})                         
    if [ ${#TMP_FILENAME} -gt 65 ]; then                         
        echo "---> Unable to proceed: image filename "           
        echo "--->  \"${TMP_FILENAME}\""                         
        echo "---> exceeds 72 characters."                       
        echo "---> Please rename files or set links."           
        exit                                                     
    else                                                         
        echo "---> Warning: Template name exceeds 72 characters. Setting link \"images\""
        echo "              to image directory"                                         
        TMP_DIRNAME=$(dirname ${TMP_PATH})                                             
        if [ -e "images" ]; then                                                       
            echo "***  Error:  The file or directory \"images\" already exists. Please remove"
            echo "              and re-run."                                                 
            exit                                                                             
        else                                                                                 
            ln -s ${TMP_DIRNAME} images                                                       
        fi                                                                                   
        NAME_TEMPLATE_OF_DATA_FRAMES="images/${1##/*/}"                                       
# KD 30.3.11 I believe the previous line should be changed to:                               
#      NAME_TEMPLATE_OF_DATA_FRAMES="images/${TMP_FILENAME}"                                 
# but I have not had the time to properly test this                                           
        echo "              Using template filename \"${NAME_TEMPLATE_OF_DATA_FRAMES}\""     
    fi                                                                                       
fi                                                                                           
 
# 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  
Line 269: Line 239:


cat > XDS.INP << eof
cat > XDS.INP << eof
! written by generate_XDS.INP version $REVISION
JOB= XYCORR INIT COLSPOT IDXREF DEFPIX INTEGRATE CORRECT
JOB= XYCORR INIT COLSPOT IDXREF DEFPIX INTEGRATE CORRECT
ORGX= $ORGX ORGY= $ORGY  ! check these values with adxv !
ORGX= $ORGX ORGY= $ORGY  ! check these values with adxv !
2,652

edits