Generate XDS.INP: Difference between revisions

→‎The script: version 0.26
m (→‎The script: add REFINE(CORRECT) , and add (?) to comment to ROTATION_AXIS for two BLs)
(→‎The script: version 0.26)
Line 38: Line 38:
# 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.24 . KD 3/2012 - remove revision 0.10 since XDS now takes much longer paths
# revision 0.24 . KD 3/2012 - remove revision 0.10 since XDS now takes much longer paths
# revision 0.25 . KD 3/2012 - remove revision 0.22 for PSI Pilatus 2M; see http://www.globalphasing.com/autoproc/wiki/index.cgi?TroubleShootingKnownIssues
# revision 0.25 . KD 3/2012 - remove revision 0.22 for PSI Pilatus 2M; see http://www.globalphasing.com/autoproc/wiki/index.cgi?
REVISION="0.25 (30-Mar-2012)"                                                                                 
# revision 0.26 . KD 7/2012 - Mac-compatibility: replace od flags --skip-bytes= and --read-bytes= with -j and -N (thanks to Oliver Clarke for working this out!)
TroubleShootingKnownIssues
REVISION="0.26 (02-Jul-2012)"                                                                                 
#                                                                                                             
#                                                                                                             
# usage: e.g. generate_XDS.INP "frms/mydata_1_???.img"                                                       
# usage: e.g. generate_XDS.INP "frms/mydata_1_???.img"                                                       
Line 50: Line 52:
# known problems:                                                                                             
# known problems:                                                                                             
# - for ADSC detectors, there are at least three ways to obtain ORGX and ORGY values from the header (see below);
# - for ADSC detectors, there are at least three ways to obtain ORGX and ORGY values from the header (see below);
# - the same might be a problem for MAR headers, too (not sure about this)                                      
# - the same might be a problem for MAR headers, too (not sure about this)  
# - on Mac OS X, Xcode (from http://developer.apple.com/tools/xcode) might be needed - not sure about this                             
#                                                                                                                 
#                                                                                                                 
# notes for debugging of the script:                                                                             
# notes for debugging of the script:                                                                             
Line 119: Line 122:
   # use first frame of dataset to obtain parameters               
   # use first frame of dataset to obtain parameters               


   # offsets are documented; values can be find in mccd_xdsparams.pl script
   # offsets are documented; values can be found in mccd_xdsparams.pl script
   let SKIP=1024+80                                                         
   let SKIP=1024+80                                                         
   NX=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $FIRSTFRAME | head -1 | awk '{print $2}')
   NX=$(od -t dI -j $SKIP -N 4 $FIRSTFRAME | head -1 | awk '{print $2}')
   let SKIP=$SKIP+4                                                                         
   let SKIP=$SKIP+4                                                                         
   NY=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $FIRSTFRAME | head -1 | awk '{print $2}')
   NY=$(od -t dI -j $SKIP -N 4 $FIRSTFRAME | head -1 | awk '{print $2}')


   let SKIP=1720
   let SKIP=1720
   DETECTOR_DISTANCE=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $FIRSTFRAME | head -1 | awk '{print $2}')
   DETECTOR_DISTANCE=$(od -t dI -j $SKIP -N 4 $FIRSTFRAME | head -1 | awk '{print $2}')
   DETECTOR_DISTANCE=`echo "scale=3; $DETECTOR_DISTANCE/1000" | bc -l`                                     
   DETECTOR_DISTANCE=`echo "scale=3; $DETECTOR_DISTANCE/1000" | bc -l`                                     
                                                                                                            
                                                                                                            
   let SKIP=1024+256+128+256+4                                                                             
   let SKIP=1024+256+128+256+4                                                                             
   ORGX=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $FIRSTFRAME | head -1 | awk '{print $2}')             
   ORGX=$(od -t dI -j $SKIP -N 4 $FIRSTFRAME | head -1 | awk '{print $2}')             
   ORGX=`echo "scale=2; $ORGX/1000" | bc -l `                                                               
   ORGX=`echo "scale=2; $ORGX/1000" | bc -l `                                                               
   let SKIP=$SKIP+4                                                                                         
   let SKIP=$SKIP+4                                                                                         
   ORGY=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $FIRSTFRAME | head -1 | awk '{print $2}')             
   ORGY=$(od -t dI -j $SKIP -N 4 $FIRSTFRAME | head -1 | awk '{print $2}')             
   ORGY=`echo "scale=2; $ORGY/1000" | bc -l `                                                               
   ORGY=`echo "scale=2; $ORGY/1000" | bc -l `                                                               


   let SKIP=1024+256+128+256+44
   let SKIP=1024+256+128+256+44
   PHISTART=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $FIRSTFRAME | head -1 | awk '{print $2}')
   PHISTART=$(od -t dI -j $SKIP -N 4 $FIRSTFRAME | head -1 | awk '{print $2}')
   let SKIP=1024+256+128+256+76                                                                   
   let SKIP=1024+256+128+256+76                                                                   
   PHIEND=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $FIRSTFRAME | head -1 | awk '{print $2}')   
   PHIEND=$(od -t dI -j $SKIP -N 4 $FIRSTFRAME | head -1 | awk '{print $2}')   
   OSCILLATION_RANGE=`echo "scale=3; ($PHIEND-($PHISTART))/1000" | bc -l`                         
   OSCILLATION_RANGE=`echo "scale=3; ($PHIEND-($PHISTART))/1000" | bc -l`                         
                                                                                                  
                                                                                                  
   let SKIP=1024+256+128+256+128+4                                                                 
   let SKIP=1024+256+128+256+128+4                                                                 
   QX=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $FIRSTFRAME | head -1 | awk '{print $2}')       
   QX=$(od -t dI -j $SKIP -N 4 $FIRSTFRAME | head -1 | awk '{print $2}')       
   QX=`echo "scale=10; $QX/1000000" |bc -l `                                                       
   QX=`echo "scale=10; $QX/1000000" |bc -l `                                                       
   let SKIP=$SKIP+4                                                                               
   let SKIP=$SKIP+4                                                                               
   QY=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $FIRSTFRAME | head -1 | awk '{print $2}')       
   QY=$(od -t dI -j $SKIP -N 4 $FIRSTFRAME | head -1 | awk '{print $2}')       
   QY=`echo "scale=10; $QY/1000000" |bc -l `                                                       
   QY=`echo "scale=10; $QY/1000000" |bc -l `                                                       


   let SKIP=1024+256+128+256+128+128+12
   let SKIP=1024+256+128+256+128+128+12
   X_RAY_WAVELENGTH=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $FIRSTFRAME | head -1 | awk '{print $2}')
   X_RAY_WAVELENGTH=$(od -t dI -j $SKIP -N 4 $FIRSTFRAME | head -1 | awk '{print $2}')
   X_RAY_WAVELENGTH=`echo "scale=5; $X_RAY_WAVELENGTH/100000" | bc -l`                                     
   X_RAY_WAVELENGTH=`echo "scale=5; $X_RAY_WAVELENGTH/100000" | bc -l`                                     


2,651

edits