2,684
edits
No edit summary |
(use od instead of catmar/mccd_xdsparams.pl) |
||
Line 7: | Line 7: | ||
# 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 | ||
# revision 0.08 . KD 6/2010 - fixes for Pilatus 6M | # revision 0.08 . KD 6/2010 - fixes for Pilatus 6M | ||
# revision 0.09 . KD 6/2010 - get rid of requirement for mccd_xdsparams.pl and/or catmar | # revision 0.09 . KD 6/2010 - get rid of requirement for mccd_xdsparams.pl and/or catmar; rather use "od" | ||
# tested with some datasets from ALS, SSRL, SLS and ESRF; only | # 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. | # for other detectors, values marked with XXX must be manually filled in. | ||
# | # | ||
Line 21: | Line 21: | ||
# the ? are wildcards for the frame numbers. | # the ? are wildcards for the frame numbers. | ||
# | # | ||
# | # two external programs that can read MAR headers: | ||
# - for MARCCD detectors the "catmar" binary (which can be downloaded from http://www.marresearch.com/download.html) | # - for MARCCD detectors the "catmar" binary (which can be downloaded from http://www.marresearch.com/download.html) | ||
# - | # - the [[mccd_xdsparams.pl]] script (see http://strucbio.biologie.uni-konstanz.de/xdswiki/index.php/Mccd_xdsparams.pl ) | ||
# | # | ||
# 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 78: | Line 78: | ||
# identify other detector types in the same way (MAR IP would be straightforward) | # identify other detector types in the same way (MAR IP would be straightforward) | ||
# parse ASCII header of first frame | # parse ASCII header of first frame | ||
if [ "$DET" == "XXX" ]; then | if [ "$DET" == "XXX" ]; then | ||
Line 87: | Line 87: | ||
elif [ "$DET" == "mccd" ]; then | elif [ "$DET" == "mccd" ]; then | ||
DETECTOR="CCDCHESS MINIMUM_VALID_PIXEL_VALUE= 1 OVERLOAD= | DETECTOR="CCDCHESS MINIMUM_VALID_PIXEL_VALUE= 1 OVERLOAD= 65500" | ||
# use first frame of dataset to obtain parameters | |||
MARFRAME=`head -1 tmp1` | |||
# offsets are documented; values can be find in mccd_xdsparams.pl script | |||
let SKIP=1024+80 | |||
NX=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $MARFRAME | head -1 | awk '{print $2}') | |||
let SKIP=$SKIP+4 | |||
NY=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $MARFRAME | head -1 | awk '{print $2}') | |||
let SKIP=1024+256+128+256 | |||
DETECTOR_DISTANCE=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $MARFRAME | head -1 | awk '{print $2}') | |||
DETECTOR_DISTANCE=`echo "scale=3; $DETECTOR_DISTANCE/1000" | bc -l` | |||
let SKIP=$SKIP+4 | |||
ORGX=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $MARFRAME | head -1 | awk '{print $2}') | |||
ORGX=`echo "scale=2; $ORGX/1000" | bc -l ` | |||
let SKIP=$SKIP+4 | |||
ORGY=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $MARFRAME | head -1 | awk '{print $2}') | |||
ORGY=`echo "scale=2; $ORGY/1000" | bc -l ` | |||
let SKIP=1024+256+128+256+44 | |||
PHISTART=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $MARFRAME | head -1 | awk '{print $2}') | |||
let SKIP=1024+256+128+256+76 | |||
PHIEND=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $MARFRAME | head -1 | awk '{print $2}') | |||
OSCILLATION_RANGE=`echo "scale=3; ($PHIEND-$PHISTART)/1000" | bc -l` | |||
let SKIP=1024+256+128+256+128+4 | |||
QX=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $MARFRAME | head -1 | awk '{print $2}') | |||
QX=`echo "scale=10; $QX/1000000" |bc -l ` | |||
let SKIP=$SKIP+4 | |||
QY=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $MARFRAME | head -1 | awk '{print $2}') | |||
QY=`echo "scale=10; $QY/1000000" |bc -l ` | |||
let SKIP=1024+256+128+256+128+128+12 | |||
X_RAY_WAVELENGTH=$(od -t dI --skip-bytes=$SKIP --read-bytes=4 $MARFRAME | head -1 | awk '{print $2}') | |||
X_RAY_WAVELENGTH=`echo "scale=5; $X_RAY_WAVELENGTH/100000" | bc -l` | |||
# at most BLs, ORGX and ORGY are in pixels, but sometimes in mm ... guess: | # at most BLs, ORGX and ORGY are in pixels, but sometimes in mm ... guess: | ||
NXBYFOUR=`echo "scale=0; $NX/4" | bc -l ` | NXBYFOUR=`echo "scale=0; $NX/4" | bc -l ` | ||
ORGXINT=`echo "scale=0; $ORGX/1" | bc -l ` | ORGXINT=`echo "scale=0; $ORGX/1" | bc -l ` | ||
if [ $ORGXINT -lt $NXBYFOUR ]; then | if [ $ORGXINT -lt $NXBYFOUR ]; then | ||
ORGX=`echo "scale=1; $ORGX/$QX" | bc -l` | ORGX=`echo "scale=1; $ORGX/$QX" | bc -l` | ||
ORGY=`echo "scale=1; $ORGY/$ | ORGY=`echo "scale=1; $ORGY/$QY" | bc -l` | ||
echo MARCCD detector: header ORGX, ORGY seem to be in mm ... converting to pixels | echo MARCCD detector: header ORGX, ORGY seem to be in mm ... converting to pixels | ||
else | else | ||
Line 155: | Line 151: | ||
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 210: | Line 206: | ||
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 238: | Line 234: | ||
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: | ||
Line 252: | Line 248: | ||
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! | ||
rm tmp1 tmp2 | rm -f tmp1 tmp2 | ||
</pre> | </pre> |