Generate XDS.INP: Difference between revisions

→‎The script: first implementation of MAR345
mNo edit summary
(→‎The script: first implementation of MAR345)
Line 57: Line 57:
# revision 0.38 . KD 2/2014 - change defaults for REFINE(IDXREF) and REFINE(INTEGRATE) such that more stable results are obtained for difficult datasets
# revision 0.38 . KD 2/2014 - change defaults for REFINE(IDXREF) and REFINE(INTEGRATE) such that more stable results are obtained for difficult datasets
# revision 0.39 . Keitaro 4/2014 - automatically set ROTATION_AXIS=-1 0 0 for MX225HS at SPring-8 BL32XU.
# revision 0.39 . Keitaro 4/2014 - automatically set ROTATION_AXIS=-1 0 0 for MX225HS at SPring-8 BL32XU.
REVISION="0.39 (14-April-2014)"
# revision 0.40 . Jan Gebauer /KD 4/2014 - simple implementation of MAR345 detector
REVISION="0.40 (15-April-2014)"
#                                                                                                             
#                                                                                                             
# usage: e.g. generate_XDS.INP "frms/mydata_1_???.img"                                                       
# usage: e.g. generate_XDS.INP "frms/mydata_1_???.img"                                                       
Line 124: Line 125:
grep -q BEAM_CENTER_X tmp2      && DET=adsc                                 
grep -q BEAM_CENTER_X tmp2      && DET=adsc                                 
head -n1 tmp2 | grep -q "^RAXIS" && DET=raxis
head -n1 tmp2 | grep -q "^RAXIS" && DET=raxis
# identify other detector types in the same way (MAR IP would be straightforward)
grep -q mar345 tmp2 && DET=MAR345                       
 
# identify other detector types in the same way  


# parse ASCII header of first frame
# parse ASCII header of first frame
Line 307: Line 310:


   X_RAY_WAVELENGTH=$(python -c 'import struct; f=open("'$FIRSTFRAME'","rb");f.seek(292);print "%.6f"%struct.unpack(">f",f.read(4))')
   X_RAY_WAVELENGTH=$(python -c 'import struct; f=open("'$FIRSTFRAME'","rb");f.seek(292);print "%.6f"%struct.unpack(">f",f.read(4))')
elif [ "$DET" == "MAR345" ]; then
 
echo  -ne "Data from a Mar345 image plate detector "
DETECTOR="MAR345  MINIMUM_VALID_PIXEL_VALUE=0  OVERLOAD=130000"
NX=`grep FORMAT tmp2 | awk '{print $2}'`
NY=$NX
if grep -q 'CENTER' tmp2; then
  echo Beam center found.
  ORGX=`grep 'CENTER' tmp2 | awk '{print $3}'`
  ORGY=`grep 'CENTER' tmp2 | awk '{print $5}'`
else
  echo No beam center was found. Setting beam center to the middle of the detector.
  ORGX=`echo $NX / 2 | bc`
  ORGY=`echo $NY / 2 | bc`
fi
DETECTOR_DISTANCE=`grep 'DISTANCE' tmp2 | awk '{print $2}'`             
X_RAY_WAVELENGTH=`grep 'WAVELENGTH' tmp2 | awk '{print $2}'`
OSCILLATION_RANGE=`grep 'PHI' tmp2 | awk '{print $5-$3}'`   
         
else
else
   echo should never come here
   echo should never come here
2,652

edits