Generate XDS.INP: Difference between revisions

fixes; start script with <pre> and end with </pre> for easier cut-and-paste
(replace the which stuff with whereis stuff)
(fixes; start script with <pre> and end with </pre> for easier cut-and-paste)
Line 1: Line 1:
This script should be in your $PATH as "generate_XDS.INP" .
This script should be in your $PATH as "generate_XDS.INP" .


#!/bin/bash
<pre>
#!/bin/bash
# purpose: generate XDS.INP
 
# revision 0.03 . Kay Diederichs 2/2010  
# purpose: generate XDS.INP
# revision 0.04 . Kay Diederichs 4/2010 - include alternative ORGX, ORGY calculations for ADSC
# revision 0.03 . Kay Diederichs 2/2010  
# revision 0.05 . Kay Diederichs 5/2010 - grep for "Corrected" in addition to "marccd" (needed for BESSY); a bit of error handling
# revision 0.04 . Kay Diederichs 4/2010 - include alternative ORGX, ORGY calculations for ADSC
# revision 0.06 . KD 6/2010 - add UNTRUSTED_RECTANGLE and UNTRUSTED_ELLIPSE; use `whereis catmar` and so on  
# revision 0.05 . Kay Diederichs 5/2010 - grep for "Corrected" in addition to "marccd"; needed for BESSY  
# tested with some datasets from ALS, SSRL, SLS, ESRF and BESSY; only MARCCD, ADSC/SMV, PILATUS detectors; for other detectors, values must be manually filled in.
# revision 0.06 . KD 6/2010 - add UNTRUSTED_RECTANGLE and UNTRUSTED_ELLIPSE; use `whereis catmar` and so on  
#
# revision 0.07 . KD 6/2010 - decide about ORGX/Y info in MAR header being pixels or mm; other fixes
# usage: e.g. generate_XDS.INP.rc "frms/mydata_1_???.img"
# tested with some datasets from ALS, SSRL, SLS and ESRF; only MARCCD, ADSC/SMV, PILATUS detectors; for other detectors, values must be manually filled in.
# make sure to have the two !
#
# the ? are wildcards for the frame numbers.
# usage: e.g. generate_XDS.INP "frms/mydata_1_???.img"
#
# make sure to have the two quotation marks !
# requirement for external programs(s):
# the ? are wildcards for the frame numbers.
# - for MARCCD detectors the "catmar" binary (which can be downloaded from http://www.marresearch.com/download.html) must be in $PATH
#
# - alternatively, the [[mccd_xdsparams.pl]] script (see http://strucbio.biologie.uni-konstanz.de/xdswiki/index.php/Mccd_xdsparams.pl ) will be used, courtesy of Ana Gonzalez.
# requirement for external programs(s):
#  
# - for MARCCD detectors the "catmar" binary (which can be downloaded from http://www.marresearch.com/download.html) must be in $PATH
# limitations:
# - alternatively, the [[mccd_xdsparams.pl]] script (see http://strucbio.biologie.uni-konstanz.de/xdswiki/index.php/Mccd_xdsparams.pl ) will be used, courtesy of Ana Gonzalez.
# - frame numbers are assumed to start with 1 and run consecutively
#  
#  
# limitations:
# known problems:
# - frame numbers are assumed to start with 1 and run consecutively
# - for ADSC detectors, there are at least three ways to obtain ORGX and ORGY values from the header (see below);
#  
# the "imgheader" program that I have delivers better values, but I don't know how and why.
# known problems:
# - for MarCCD detectors: don't know how to distinguish between header info in pixels or mm leads to ad-hoc BESSY treatment
# - 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)
# notes for debugging of the script:
#
# - add the -v option to the first line, to see where an error occurs (make sure no blank before #!/bin/bash -v  !)
# notes for debugging of the script:
# - comment out the removal of tmp1 and tmp2 in the last line
# - add the -v option to the first line, to see where an error occurs
#
# - comment out the removal of tmp1 and tmp2 in the last line
# ====== Start of script ======
#
#
# ====== Start of script ======
# defaults:
if [ "$1" == "help" ] || [ "$1" == "-help" ] || [ "$1" == "-h" ]; then
#
  echo usage: generate_XDS.INP \"frms/mydata_1_???.img\"  \(_with_ the quotation marks!\)
  exit
DETECTOR="XXX MINIMUM_VALID_PIXEL_VALUE=XXX OVERLOAD=XXX"
fi
ORGX=XXX
echo Full documentation, including complete detector templates and XDS binaries, can be found at
ORGY=XXX
echo http://www.mpimf-heidelberg.mpg.de/~kabsch/xds . More documentation: see XDSwiki
DETECTOR_DISTANCE=XXX
#
OSCILLATION_RANGE=XXX
# defaults:
X_RAY_WAVELENGTH=XXX
#
DETECTOR="XXX MINIMUM_VALID_PIXEL_VALUE=XXX OVERLOAD=XXX"
# see how we are called:
ORGX=XXX
NAME_TEMPLATE_OF_DATA_FRAMES="$1"
ORGY=XXX
DETECTOR_DISTANCE=XXX
# list frames matching the wildcards in NAME_TEMPLATE_OF_DATA_FRAMES; exit if none found
OSCILLATION_RANGE=XXX
ls -C1 $1 > tmp1 || exit 1
X_RAY_WAVELENGTH=XXX
 
# set upper limit of DATA_RANGE to number of frames (see "limitations" above)
# see how we are called:
DATA_RANGE=`wc -l tmp1 | awk '{print $1}'`
NAME_TEMPLATE_OF_DATA_FRAMES="$1"
 
# set upper limit of SPOT_RANGE to half of DATA_RANGE, but not less than 1
# list frames matching the wildcards in NAME_TEMPLATE_OF_DATA_FRAMES
SPOT_RANGE=`echo "scale=0; $DATA_RANGE/2" | bc -l`
ls -C1 $1 > tmp1 || exit 1
SPOT_RANGE=`echo "if ($SPOT_RANGE<1) 1;if ($SPOT_RANGE>1) $SPOT_RANGE" | bc -l`
 
# set upper limit of DATA_RANGE to number of frames (see "limitations" above)
echo DATA_RANGE=1 $DATA_RANGE
DATA_RANGE=`wc -l tmp1 | awk '{print $1}'`
 
# find out detector type
# set upper limit of SPOT_RANGE to half of DATA_RANGE, but not less than 1
DET=XXX
SPOT_RANGE=`echo "scale=0; $DATA_RANGE/2" | bc -l`
strings `head -1 tmp1` | egrep -q 'marccd|Corrected' && DET=mccd
SPOT_RANGE=`echo "if ($SPOT_RANGE<1) 1;if ($SPOT_RANGE>1) $SPOT_RANGE" | bc -l`
strings `head -1 tmp1` | grep -q PILATUS            && DET=pilatus
 
strings `head -1 tmp1` | grep -q BEAM_CENTER_X      && DET=adsc
echo DATA_RANGE=1 $DATA_RANGE
# identify other detector types in the same way (MAR IP would be straightforward)
 
# find out detector type
# parse ASCII header of first frame (except for MARCCD, which therefore requires catmar)
DET=XXX
strings `head -1 tmp1` | egrep -q 'marccd|Corrected' && DET=mccd
if [ "$DET" == "XXX" ]; then
strings `head -1 tmp1` | grep -q PILATUS            && DET=pilatus
  echo "this is not a MarCCD, ADSC/SMV or PILATUS detector - fill in XXX values manually!"
strings `head -1 tmp1` | grep -q BEAM_CENTER_X      && DET=adsc
  DETECTOR="XXX MINIMUM_VALID_PIXEL_VALUE=XXX OVERLOAD=XXX"
# identify other detector types in the same way (MAR IP would be straightforward)
 
# find parameters of first frame
# parse ASCII header of first frame (except for MARCCD, which therefore requires catmar)
elif [ "$DET" == "mccd" ]; then
 
if [ "$DET" == "XXX" ]; then
  DETECTOR="CCDCHESS MINIMUM_VALID_PIXEL_VALUE= 1 OVERLOAD= 65000"
  echo "this is not a MAR, ADSC/SMV or PILATUS detector - fill in XXX values manually!"
  echo this a a MARCCD detector
  DETECTOR="XXX MINIMUM_VALID_PIXEL_VALUE=XXX OVERLOAD=XXX"
  PROG=`whereis -b catmar`
 
  if [ "$PROG" != "catmar:" ]; then
# find parameters of first frame
elif [ "$DET" == "mccd" ]; then
      # inspect frame header and get rid of blanks in imgheader output:
 
      catmar `head -1 tmp1` | sed s/\ //g > tmp2
  DETECTOR="CCDCHESS MINIMUM_VALID_PIXEL_VALUE= 1 OVERLOAD= 65000"
  CATMAR=`whereis -b catmar`
      # find X_RAY_WAVELENGTH:
  if [ "$CATMAR" != "catmar:" ]; then
      X_RAY_WAVELENGTH=`grep Wavelength tmp2 | sed s/Wavelength.Ang]=//`
 
      # inspect frame header and get rid of blanks:
      # find QX, ORGX and ORGY:
      catmar `head -1 tmp1` | sed s/\ //g > tmp2
      QX=`grep Pixelsizex tmp2 | sed s/Pixelsizex=//`
 
      NX=`grep pixelsin1line tmp2 | sed s/#pixelsin1line=//`
      # find X_RAY_WAVELENGTH:
      X_RAY_WAVELENGTH=`grep Wavelength tmp2 | sed s/Wavelength.Ang]=//`
      ORGX=`grep Centerx tmp2 | sed s/Centerx=//`
 
      ORGX=`echo "scale=1; ($ORGX+50)/1000" | bc -l `
      # find QX, ORGX and ORGY:
      QX=`grep Pixelsizex tmp2 | sed s/Pixelsizex=//`
      ORGY=`grep Centery tmp2 | sed s/Centery=//`
      NX=`grep pixelsin1line tmp2 | sed s/#pixelsin1line=//`
      ORGY=`echo "scale=1; ($ORGY+50)/1000" | bc -l `
 
      ORGX=`grep Centerx tmp2 | sed s/Centerx=//`
      # find DETECTOR_DISTANCE and OSCILLATION_RANGE:
      ORGX=`echo "scale=1; ($ORGX+50)/1000" | bc -l `
      DETECTOR_DISTANCE=`grep Distance tmp2 | sed s/Distance.mm]=//`
 
      STARTING_PHI=`grep StartingPHI tmp2 | sed s/StartingPHI=//`
      ORGY=`grep Centery tmp2 | sed s/Centery=//`
      ENDING_PHI=`grep EndingPHI tmp2 | sed s/EndingPHI=//`
      ORGY=`echo "scale=1; ($ORGY+50)/1000" | bc -l `
      OSCILLATION_RANGE=`echo "scale=3; ($ENDING_PHI-$STARTING_PHI)/1000" | bc -l`
 
      # find DETECTOR_DISTANCE and OSCILLATION_RANGE:
  else
      DETECTOR_DISTANCE=`grep Distance tmp2 | sed s/Distance.mm]=//`
      PROG=`whereis -b mccd_xdsparams.pl`
      STARTING_PHI=`grep StartingPHI tmp2 | sed s/StartingPHI=//`
      if [ "$PROG" != "mccd_xdsparams:" ]; then
      ENDING_PHI=`grep EndingPHI tmp2 | sed s/EndingPHI=//`
        mccd_xdsparams.pl -v `head -1 tmp1` > tmp2
      OSCILLATION_RANGE=`echo "scale=3; ($ENDING_PHI-$STARTING_PHI)/1000" | bc -l`
        X_RAY_WAVELENGTH=`awk '/X-RAY_WAVELENGTH/{print $2}' tmp2`
 
        DETECTOR_DISTANCE=`awk '/DETECTOR_DISTANCE/{print $2}' tmp2`
  else
        ORGX=`awk '/ORGX/{print $2}' tmp2`
      CATMAR=`whereis -b mccd_xdsparams.pl`
        ORGY=`awk '/ORGY/{print $4}' tmp2`
      if [ "$CATMAR" != "mccd_xdsparams:" ]; then
        OSCILLATION_RANGE=`awk '/OSCILLATION_RANGE/{print $2}' tmp2`
        mccd_xdsparams.pl -v `head -1 tmp1` > tmp2
      else
        NX=`awk '/NX/{print $2}' tmp2`
        echo "could not find catmar or mccd_xdsparams.pl - fill XXX values manually!"
        QX=`awk '/QX/{print $6}' tmp2`
      fi
        X_RAY_WAVELENGTH=`awk '/X-RAY_WAVELENGTH/{print $2}' tmp2`
  fi
        DETECTOR_DISTANCE=`awk '/DETECTOR_DISTANCE/{print $2}' tmp2`
# at BESSY the header is different:  
        ORGX=`awk '/ORGX/{print $2}' tmp2`
  strings `head -1 tmp1` | grep -q Corrected && DET=mccdbessy
        ORGY=`awk '/ORGY/{print $4}' tmp2`
  if [ "$DET" == "mccdbessy" ]; then
        OSCILLATION_RANGE=`awk '/OSCILLATION_RANGE/{print $2}' tmp2`
      QX=`echo "scale=10; $QX/1000000" |bc -l `
      else
      ORGX=`echo "scale=1; $ORGX/$QX" | bc -l`
        echo "could not find catmar or mccd_xdsparams.pl - fill XXX values manually!"
      ORGY=`echo "scale=1; $ORGY/$QX" | bc -l`
      fi
  fi
  fi
# at most BLs, ORGX and ORGY are in pixels, but sometimes in mm ... guess:
elif [ "$DET" == "adsc" ]; then
  NXBYFOUR=`echo "scale=0; $NX/4" | bc -l `
  ORGXINT=`echo "scale=0; $ORGX/1" | bc -l `
  DETECTOR="ADSC MINIMUM_VALID_PIXEL_VALUE= 1 OVERLOAD= 65000"
  if [ $ORGXINT -lt $NXBYFOUR ]; then
  echo this is an ADSC detector. Obtaining ORGX, ORGY from the header depends on beamline setup.
    QX=`echo "scale=10; $QX/1000000" |bc -l `
  strings `head -1 tmp1` | sed s/\;// > tmp2
#    echo ORGX ORGY QX = $ORGX $ORGY $QX
    ORGX=`echo "scale=1; $ORGX/$QX" | bc -l`
      # find X_RAY_WAVELENGTH:
    ORGY=`echo "scale=1; $ORGY/$QX" | bc -l`
      X_RAY_WAVELENGTH=`grep WAVELENGTH tmp2 | sed s/WAVELENGTH=//`
    echo MARCCD detector: header ORGX, ORGY seem to be in mm ... converting to pixels
  else
      # find NX, QX, ORGX and ORGY:
    echo MARCCD detector: header ORGX, ORGY seem to be in pixel units
      NX=`grep SIZE1 tmp2 | tail -1 | sed s/SIZE1=//`
  fi
      QX=`grep PIXEL_SIZE tmp2 | sed s/PIXEL_SIZE=//`
 
      BEAM_CENTER_X=`grep BEAM_CENTER_X tmp2 | sed s/BEAM_CENTER_X=//`
elif [ "$DET" == "adsc" ]; then
      BEAM_CENTER_Y=`grep BEAM_CENTER_Y tmp2 | sed s/BEAM_CENTER_Y=//`
 
# fix 2010-04-26 - tell user about possible ORGX, ORGY alternatives - 
  DETECTOR="ADSC MINIMUM_VALID_PIXEL_VALUE= 1 OVERLOAD= 65000"
# at ESRF and ... (pls fill in!) the following should be used:
  echo this is an ADSC detector. Obtaining ORGX, ORGY from the header depends on beamline setup.
      ORGX=`echo "scale=1; $BEAM_CENTER_Y/$QX" | bc -l `
  strings `head -1 tmp1` | sed s/\;// > tmp2
      ORGY=`echo "scale=1; $BEAM_CENTER_X/$QX" | bc -l `
 
      echo ATTENTION: at ESRF BLs use: ORGX=$ORGX ORGY=$ORGY
      # find X_RAY_WAVELENGTH:
# this 2nd alternative convention should be used at the following beamlines (pls complete the list): ALS 5.0.3, ...
      X_RAY_WAVELENGTH=`grep WAVELENGTH tmp2 | sed s/WAVELENGTH=//`
      ORGX=`echo "scale=1; $NX-$BEAM_CENTER_X/$QX" | bc -l `
 
      ORGY=`echo "scale=1; $BEAM_CENTER_Y/$QX" | bc -l `
      # find NX, QX, ORGX and ORGY:
      echo ATTENTION: at e.g. ALS 5.0.3 use: ORGX=$ORGX ORGY=$ORGY  
      NX=`grep SIZE1 tmp2 | tail -1 | sed s/SIZE1=//`
# this 3rd alternative convention should be used at the following beamlines (pls complete the list): ALS 8.2.2, ...  
      QX=`grep PIXEL_SIZE tmp2 | sed s/PIXEL_SIZE=//`
      ORGX=`echo "scale=1; $BEAM_CENTER_X/$QX" | bc -l `
      BEAM_CENTER_X=`grep BEAM_CENTER_X tmp2 | sed s/BEAM_CENTER_X=//`
      ORGY=`echo "scale=1; $NX-$BEAM_CENTER_Y/$QX" | bc -l `
      BEAM_CENTER_Y=`grep BEAM_CENTER_Y tmp2 | sed s/BEAM_CENTER_Y=//`
      echo ATTENTION: at e.g. ALS 8.2.2 use: ORGX=$ORGX ORGY=$ORGY - this is now written to XDS.INP
# fix 2010-04-26 - tell user about possible ORGX, ORGY alternatives - 
# the latter alternative is written into the generated XDS.INP ! You have to correct this manually in XDS.INP, or adjust this script.
# at ESRF and ... (pls fill in!) the following should be used:
      # find DETECTOR_DISTANCE and OSCILLATION_RANGE:
      ORGX=`echo "scale=1; $BEAM_CENTER_Y/$QX" | bc -l `
      DETECTOR_DISTANCE=`grep DISTANCE tmp2 | sed s/DISTANCE=//`
      ORGY=`echo "scale=1; $BEAM_CENTER_X/$QX" | bc -l `
      OSCILLATION_RANGE=`grep OSC_RANGE tmp2 | sed s/OSC_RANGE=//`
      echo ATTENTION: at ESRF BLs use: ORGX=$ORGX ORGY=$ORGY  
# this 2nd alternative convention should be used at the following beamlines (pls complete the list): ALS 5.0.3, ...
elif [ "$DET" == "pilatus" ]; then
      ORGX=`echo "scale=1; $NX-$BEAM_CENTER_X/$QX" | bc -l `
  DETECTOR="DETECTOR=PILATUS  MINIMUM_VALID_PIXEL_VALUE=0  OVERLOAD= 1048576"
      ORGY=`echo "scale=1; $BEAM_CENTER_Y/$QX" | bc -l `
  echo this is a Pilatus detector
      echo ATTENTION: at e.g. ALS 5.0.3 use: ORGX=$ORGX ORGY=$ORGY  
  head -50 `head -1 tmp1` | sed s/#//> tmp2
# this 3rd alternative convention should be used at the following beamlines (pls complete the list): ALS 8.2.2, ...  
      ORGX=`echo "scale=1; $BEAM_CENTER_X/$QX" | bc -l `
      # find X_RAY_WAVELENGTH:
      ORGY=`echo "scale=1; $NX-$BEAM_CENTER_Y/$QX" | bc -l `
      X_RAY_WAVELENGTH=`grep Wavelength tmp2 | sed -e s/Wavelength// -e s/A// | awk '{print $1}'`
      echo ATTENTION: at e.g. ALS 8.2.2 use: ORGX=$ORGX ORGY=$ORGY - this is now written to XDS.INP
# the latter alternative is written into the generated XDS.INP ! You have to correct this manually in XDS.INP, or adjust this script.
      # find ORGX and ORGY:
      # find DETECTOR_DISTANCE and OSCILLATION_RANGE:
      ORGX=`grep Beam_xy tmp2 | sed -e s/\(// -e s/\)// -e s/\,// | awk '{print $2}'`
      DETECTOR_DISTANCE=`grep DISTANCE tmp2 | sed s/DISTANCE=//`
      ORGY=`grep Beam_xy tmp2 | sed -e s/\(// -e s/\)// -e s/\,// | awk '{print $3}'`
      OSCILLATION_RANGE=`grep OSC_RANGE tmp2 | sed s/OSC_RANGE=//`
 
      # find DETECTOR_DISTANCE and OSCILLATION_RANGE:
elif [ "$DET" == "pilatus" ]; then
      DETECTOR_DISTANCE=`awk '/distance/{print $2}' tmp2`
  DETECTOR="DETECTOR=PILATUS  MINIMUM_VALID_PIXEL_VALUE=0  OVERLOAD= 1048576"
      DETECTOR_DISTANCE=`echo "$DETECTOR_DISTANCE*1000" | bc -l`
  echo this is a Pilatus detector
  head -50 `head -1 tmp1` | sed s/#//> tmp2
      OSCILLATION_RANGE=`awk '/Angle/{print $2}' tmp2`
 
      # find X_RAY_WAVELENGTH:
else
      X_RAY_WAVELENGTH=`grep Wavelength tmp2 | sed -e s/Wavelength// -e s/A// | awk '{print $1}'`
  echo should never come here
 
  exit 1
      # find ORGX and ORGY:
fi
      ORGX=`grep Beam_xy tmp2 | sed -e s/\(// -e s/\)// -e s/\,// | awk '{print $2}'`
      ORGY=`grep Beam_xy tmp2 | sed -e s/\(// -e s/\)// -e s/\,// | awk '{print $3}'`
echo ORGX= $ORGX ORGY= $ORGY - check these values with adxv !
 
echo DETECTOR_DISTANCE= $DETECTOR_DISTANCE
      # find DETECTOR_DISTANCE and OSCILLATION_RANGE:
echo OSCILLATION_RANGE= $OSCILLATION_RANGE
      DETECTOR_DISTANCE=`awk '/distance/{print $2}' tmp2`
echo X-RAY_WAVELENGTH= $X_RAY_WAVELENGTH
      DETECTOR_DISTANCE=`echo "$DETECTOR_DISTANCE*1000" | bc -l`
 
# now we know everything that is required to write XDS.INP
      OSCILLATION_RANGE=`awk '/Angle/{print $2}' tmp2`
 
cat > XDS.INP << eof
else
JOB= XYCORR INIT COLSPOT IDXREF DEFPIX INTEGRATE CORRECT
  echo should never come here
ORGX= $ORGX ORGY= $ORGY ! check these values with adxv !
  exit 1
DETECTOR_DISTANCE= $DETECTOR_DISTANCE
fi
OSCILLATION_RANGE= $OSCILLATION_RANGE
 
X-RAY_WAVELENGTH= $X_RAY_WAVELENGTH
echo ORGX= $ORGX ORGY= $ORGY - check these values with adxv !
NAME_TEMPLATE_OF_DATA_FRAMES=$NAME_TEMPLATE_OF_DATA_FRAMES
echo DETECTOR_DISTANCE= $DETECTOR_DISTANCE
DATA_RANGE=1 $DATA_RANGE
echo OSCILLATION_RANGE= $OSCILLATION_RANGE
SPOT_RANGE=1 $SPOT_RANGE
echo X-RAY_WAVELENGTH= $X_RAY_WAVELENGTH
# BACKGROUND_RANGE=1 10 ! rather use defaults (first 5 degree of rotation)
 
# now we know everything that is required to generate XDS.INP
SPACE_GROUP_NUMBER=0                  ! 0 if unknown
 
UNIT_CELL_CONSTANTS= 70 80 90 90 90 90 ! put correct values if known
cat > XDS.INP << eof
INCLUDE_RESOLUTION_RANGE=50 0  ! after CORRECT, insert high resol limit; re-run CORRECT
JOB= XYCORR INIT COLSPOT IDXREF DEFPIX INTEGRATE CORRECT
ORGX= $ORGX ORGY= $ORGY  ! check these values with adxv !
FRIEDEL'S_LAW=FALSE    ! This acts only on the CORRECT step
DETECTOR_DISTANCE= $DETECTOR_DISTANCE
! If the anom signal turns out to be, or is known to be, very low or absent,
OSCILLATION_RANGE= $OSCILLATION_RANGE
  ! use FRIEDEL'S_LAW=TRUE instead (or comment out the line); re-run CORRECT
X-RAY_WAVELENGTH= $X_RAY_WAVELENGTH
NAME_TEMPLATE_OF_DATA_FRAMES=$NAME_TEMPLATE_OF_DATA_FRAMES
! remove the "!" in the following line:
! REFERENCE_DATA_SET=xxx/XDS_ASCII.HKL ! e.g. to ensure consistent indexing 
! STRICT_ABSORPTION_CORRECTION=TRUE
DATA_RANGE=1 $DATA_RANGE
! if the anomalous signal is strong: in that case, in CORRECT.LP the three
SPOT_RANGE=1 $SPOT_RANGE
! "CHI^2-VALUE OF FIT OF CORRECTION FACTORS" values are significantly> 1, e.g. 1.5
! BACKGROUND_RANGE=1 10 ! rather use defaults (first 5 degree of rotation)
 
! exclude untrusted areas of detector, e.g. beamstop shadow :
SPACE_GROUP_NUMBER=0                  ! 0 if unknown
! UNTRUSTED_RECTANGLE= 1800 1950 2100 2150 ! x-min x-max y-min y-max ! repeat
UNIT_CELL_CONSTANTS= 70 80 90 90 90 90 ! put correct values if known
! UNTRUSTED_ELLIPSE= 2034 2070 1850 2240 ! x-min x-max y-min y-max ! if needed
INCLUDE_RESOLUTION_RANGE=50 0 ! after CORRECT, insert high resol limit; re-run CORRECT
! parameters with changes wrt default values:
 
TRUSTED_REGION=0.00 1.2  ! partially use corners of detectors; 1.41421=full use
FRIEDEL'S_LAW=FALSE    ! This acts only on the CORRECT step
VALUE_RANGE_FOR_TRUSTED_DETECTOR_PIXELS=7000. 30000. ! often 8000 is ok
! If the anom signal turns out to be, or is known to be, very low or absent,
MINIMUM_ZETA=0.05        ! integrate close to the Lorentz zone; 0.15 is default
! use FRIEDEL'S_LAW=TRUE instead (or comment out the line); re-run CORRECT
STRONG_PIXEL=6          ! COLSPOT: don't find weak reflections; default is 3
 
REFINE(INTEGRATE)=CELL BEAM ORIENTATION
! remove the "!" in the following line:
! STRICT_ABSORPTION_CORRECTION=TRUE
! parameters specifically for this detector and beamline:
! if the anomalous signal is strong: in that case, in CORRECT.LP the three
DETECTOR= $DETECTOR
! "CHI^2-VALUE OF FIT OF CORRECTION FACTORS" values are significantly> 1, e.g. 1.5
!NX= 3072 NY= 3072  QX= 0.10260  QY= 0.10260 ! XDS finds this out by itself
!
DIRECTION_OF_DETECTOR_X-AXIS=1 0 0
! exclude (mask) untrusted areas of detector, e.g. beamstop shadow :
DIRECTION_OF_DETECTOR_Y-AXIS=0 1 0
! UNTRUSTED_RECTANGLE= 1800 1950 2100 2150 ! x-min x-max y-min y-max ! repeat
INCIDENT_BEAM_DIRECTION=0 0 1
! UNTRUSTED_ELLIPSE= 2034 2070 1850 2240 ! x-min x-max y-min y-max ! if needed
ROTATION_AXIS=1 0 0    ! at e.g. SERCAT ID-22 this needs to be -1 0 0
!
FRACTION_OF_POLARIZATION=0.98  ! better value is provided by beamline staff!
! parameters with changes wrt default values:
POLARIZATION_PLANE_NORMAL=0 1 0
TRUSTED_REGION=0.00 1.2  ! partially use corners of detectors; 1.41421=full use
eof
VALUE_RANGE_FOR_TRUSTED_DETECTOR_PIXELS=7000. 30000. ! often 8000 is ok
MINIMUM_ZETA=0.05        ! integrate close to the Lorentz zone; 0.15 is default
echo "XDS.INP is ready for use."
STRONG_PIXEL=6          ! COLSPOT: only use strong reflections (default is 3)
echo "After running xds, inspect BKGPIX.cbf and FRAME.cbf with XDS-Viewer!"
REFINE(INTEGRATE)=CELL BEAM ORIENTATION ! AXIS DISTANCE
rm tmp1 tmp2
 
! parameters specifically for this detector and beamline:
DETECTOR= $DETECTOR
!NX= 3072 NY= 3072  QX= 0.10260  QY= 0.10260 ! XDS finds this out by itself
DIRECTION_OF_DETECTOR_X-AXIS=1 0 0
DIRECTION_OF_DETECTOR_Y-AXIS=0 1 0
INCIDENT_BEAM_DIRECTION=0 0 1
ROTATION_AXIS=1 0 0    ! at e.g. SERCAT ID-22 this needs to be -1 0 0
FRACTION_OF_POLARIZATION=0.98  ! better value is provided by beamline staff!
POLARIZATION_PLANE_NORMAL=0 1 0
eof
 
echo XDS.INP is ready for use. The file has only the most important keywords.
echo After running xds, inspect at least BKGPIX.cbf and FRAME.cbf with XDS-Viewer!
rm tmp1 tmp2
 
</pre>
2,652

edits