2,718
edits
(fix QX scaling in case of mccd_xdsparams.pl usage; add code of mccd_xdsparams.pl) |
(revision 0.08) |
||
Line 2: | Line 2: | ||
<pre> | <pre> | ||
#!/bin/bash | #!/bin/bash | ||
# purpose: generate XDS.INP | # purpose: generate XDS.INP | ||
# revision 0.03 . Kay Diederichs 2/2010 | # revision 0.03 . Kay Diederichs 2/2010 | ||
# revision 0.04 . Kay Diederichs 4/2010 - include alternative ORGX, ORGY calculations for ADSC | # revision 0.04 . Kay Diederichs 4/2010 - include alternative ORGX, ORGY calculations for ADSC | ||
# revision 0.05 . Kay Diederichs 5/2010 - grep for "Corrected" in addition to "marccd"; needed for BESSY | # revision 0.05 . Kay Diederichs 5/2010 - grep for "Corrected" in addition to "marccd"; needed for BESSY | ||
# revision 0.06 . KD 6/2010 - add UNTRUSTED_RECTANGLE and UNTRUSTED_ELLIPSE; use `whereis catmar` and so on | # 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 | # revision 0.07 . KD 6/2010 - decide about ORGX/Y info in MAR header being pixels or mm; other fixes | ||
# 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. | # revision 0.08 . KD 6/2010 - fixes for Pilatus 6M | ||
# tested with some datasets from ALS, SSRL, SLS and ESRF; only MARCCD, ADSC/SMV, PILATUS 6M detectors; | |||
# for other detectors, values marked with XXX must be manually filled in. | |||
# | # | ||
# usage: e.g. generate_XDS.INP "frms/mydata_1_???.img" | # usage: e.g. generate_XDS.INP "frms/mydata_1_???.img" | ||
Line 18: | Line 21: | ||
# requirement for external programs(s): | # 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 | # - 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 ) | # - alternatively, the [[mccd_xdsparams.pl]] script (see http://strucbio.biologie.uni-konstanz.de/xdswiki/index.php/Mccd_xdsparams.pl ) may be used (courtesy of Ana Gonzalez). | ||
# | # | ||
# limitations: | # limitations: | ||
# - frame numbers are assumed to start with 1 and run consecutively | # - frame numbers are assumed to start with 1 and run consecutively | ||
# | # | ||
# 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); | ||
Line 36: | Line 39: | ||
exit | exit | ||
fi | fi | ||
# | # | ||
# defaults: | # defaults: | ||
Line 52: | Line 53: | ||
# list frames matching the wildcards in NAME_TEMPLATE_OF_DATA_FRAMES | # list frames matching the wildcards in NAME_TEMPLATE_OF_DATA_FRAMES | ||
ls -C1 $1 > tmp1 || exit 1 | # don't accept the "direct beam" shot at SLS/Pilatus | ||
ls -C1 $1 | grep -v "_00000.cbf" > tmp1 || exit 1 | |||
# we can continue - the frames are found | |||
echo Full documentation, including complete detector templates and XDS binaries, can be found at | |||
echo http://www.mpimf-heidelberg.mpg.de/~kabsch/xds . More documentation: see XDSwiki | |||
# set upper limit of DATA_RANGE to number of frames (see "limitations" above) | # set upper limit of DATA_RANGE to number of frames (see "limitations" above) | ||
Line 92: | Line 98: | ||
QX=`grep Pixelsizex tmp2 | sed s/Pixelsizex=//` | QX=`grep Pixelsizex tmp2 | sed s/Pixelsizex=//` | ||
QX=`echo "scale=10; $QX/1000000" |bc -l ` | QX=`echo "scale=10; $QX/1000000" |bc -l ` | ||
NX=`grep pixelsin1line tmp2 | sed s/#pixelsin1line=//` | NX=`grep pixelsin1line tmp2 | sed s/#pixelsin1line=//` | ||
Line 148: | Line 153: | ||
BEAM_CENTER_X=`grep BEAM_CENTER_X tmp2 | sed s/BEAM_CENTER_X=//` | BEAM_CENTER_X=`grep BEAM_CENTER_X tmp2 | sed s/BEAM_CENTER_X=//` | ||
BEAM_CENTER_Y=`grep BEAM_CENTER_Y tmp2 | sed s/BEAM_CENTER_Y=//` | BEAM_CENTER_Y=`grep BEAM_CENTER_Y tmp2 | sed s/BEAM_CENTER_Y=//` | ||
# fix 2010-04-26 - tell user about possible ORGX, ORGY alternatives - | # fix 2010-04-26 - tell user about possible ORGX, ORGY alternatives - | ||
# at ESRF and ... (pls fill in!) the following should be used: | # at ESRF and ... (pls fill in!) the following should be used: | ||
ORGX=`echo "scale=1; $BEAM_CENTER_Y/$QX" | bc -l ` | ORGX=`echo "scale=1; $BEAM_CENTER_Y/$QX" | bc -l ` | ||
ORGY=`echo "scale=1; $BEAM_CENTER_X/$QX" | bc -l ` | ORGY=`echo "scale=1; $BEAM_CENTER_X/$QX" | bc -l ` | ||
echo ATTENTION: at ESRF BLs use: ORGX=$ORGX ORGY=$ORGY | 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, ... | # this 2nd alternative convention should be used at the following beamlines (pls complete the list): ALS 5.0.3, ... | ||
ORGX=`echo "scale=1; $NX-$BEAM_CENTER_X/$QX" | bc -l ` | ORGX=`echo "scale=1; $NX-$BEAM_CENTER_X/$QX" | bc -l ` | ||
ORGY=`echo "scale=1; $BEAM_CENTER_Y/$QX" | bc -l ` | ORGY=`echo "scale=1; $BEAM_CENTER_Y/$QX" | bc -l ` | ||
echo ATTENTION: at e.g. ALS 5.0.3 use: ORGX=$ORGX ORGY=$ORGY | echo ATTENTION: at e.g. ALS 5.0.3 use: ORGX=$ORGX ORGY=$ORGY | ||
# this 3rd alternative convention should be used at the following beamlines (pls complete the list): ALS 8.2.2, ... | # 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 ` | ORGX=`echo "scale=1; $BEAM_CENTER_X/$QX" | bc -l ` | ||
ORGY=`echo "scale=1; $NX-$BEAM_CENTER_Y/$QX" | bc -l ` | ORGY=`echo "scale=1; $NX-$BEAM_CENTER_Y/$QX" | bc -l ` | ||
Line 167: | Line 172: | ||
elif [ "$DET" == "pilatus" ]; then | elif [ "$DET" == "pilatus" ]; then | ||
DETECTOR=" | DETECTOR="PILATUS MINIMUM_VALID_PIXEL_VALUE=0 OVERLOAD= 1048576 QX=0.172 QY=0.172 !PILATUS 6M" | ||
echo this is a Pilatus detector | echo this is a Pilatus detector | ||
head -50 `head -1 tmp1` | sed s/#//> tmp2 | head -50 `head -1 tmp1` | sed s/#//> tmp2 | ||
Line 203: | Line 208: | ||
X-RAY_WAVELENGTH= $X_RAY_WAVELENGTH | X-RAY_WAVELENGTH= $X_RAY_WAVELENGTH | ||
NAME_TEMPLATE_OF_DATA_FRAMES=$NAME_TEMPLATE_OF_DATA_FRAMES | NAME_TEMPLATE_OF_DATA_FRAMES=$NAME_TEMPLATE_OF_DATA_FRAMES | ||
! REFERENCE_DATA_SET=xxx/XDS_ASCII.HKL ! e.g. to ensure consistent indexing | ! REFERENCE_DATA_SET=xxx/XDS_ASCII.HKL ! e.g. to ensure consistent indexing | ||
DATA_RANGE=1 $DATA_RANGE | DATA_RANGE=1 $DATA_RANGE | ||
SPOT_RANGE=1 $SPOT_RANGE | SPOT_RANGE=1 $SPOT_RANGE | ||
Line 211: | Line 216: | ||
UNIT_CELL_CONSTANTS= 70 80 90 90 90 90 ! put correct values if known | UNIT_CELL_CONSTANTS= 70 80 90 90 90 90 ! put correct values if known | ||
INCLUDE_RESOLUTION_RANGE=50 0 ! after CORRECT, insert high resol limit; re-run CORRECT | INCLUDE_RESOLUTION_RANGE=50 0 ! after CORRECT, insert high resol limit; re-run CORRECT | ||
FRIEDEL'S_LAW=FALSE ! This acts only on the CORRECT step | FRIEDEL'S_LAW=FALSE ! This acts only on the CORRECT step | ||
Line 230: | Line 236: | ||
MINIMUM_ZETA=0.05 ! integrate close to the Lorentz zone; 0.15 is default | MINIMUM_ZETA=0.05 ! integrate close to the Lorentz zone; 0.15 is default | ||
STRONG_PIXEL=6 ! COLSPOT: only use strong reflections (default is 3) | STRONG_PIXEL=6 ! COLSPOT: only use strong reflections (default is 3) | ||
REFINE(INTEGRATE)=CELL BEAM ORIENTATION ! AXIS DISTANCE | REFINE(INTEGRATE)=CELL BEAM ORIENTATION ! AXIS DISTANCE | ||
! parameters specifically for this detector and beamline: | ! parameters specifically for this detector and beamline: | ||
DETECTOR= $DETECTOR | DETECTOR= $DETECTOR | ||
!NX= 3072 NY= 3072 QX= 0.10260 QY= 0.10260 ! XDS finds this out by itself | !NX= 3072 NY= 3072 QX= 0.10260 QY= 0.10260 ! XDS finds this out by itself (not for Pilatus) | ||
DIRECTION_OF_DETECTOR_X-AXIS=1 0 0 | DIRECTION_OF_DETECTOR_X-AXIS=1 0 0 | ||
DIRECTION_OF_DETECTOR_Y-AXIS=0 1 0 | DIRECTION_OF_DETECTOR_Y-AXIS=0 1 0 | ||
Line 242: | Line 248: | ||
POLARIZATION_PLANE_NORMAL=0 1 0 | POLARIZATION_PLANE_NORMAL=0 1 0 | ||
eof | eof | ||
echo XDS.INP is ready for use. The file has only the most important keywords. | 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! | echo After running xds, inspect at least BKGPIX.cbf and FRAME.cbf with XDS-Viewer! |