https://wiki.uni-konstanz.de/xds/index.php?title=Mccd_xdsparams.pl&feed=atom&action=historyMccd xdsparams.pl - Revision history2024-03-29T07:21:17ZRevision history for this page on the wikiMediaWiki 1.39.6https://wiki.uni-konstanz.de/xds/index.php?title=Mccd_xdsparams.pl&diff=2246&oldid=prevKay at 10:51, 28 June 20102010-06-28T10:51:17Z<p></p>
<a href="https://wiki.uni-konstanz.de/xds/index.php?title=Mccd_xdsparams.pl&diff=2246&oldid=2196">Show changes</a>Kayhttps://wiki.uni-konstanz.de/xds/index.php?title=Mccd_xdsparams.pl&diff=2196&oldid=prevKay: New page: The following is a script that I obtained from Ana Gonzalez (thanks a lot, Ana!) and which may be re-distributed according to the copyright and permission notice given. It is called mccd_x...2010-02-24T15:41:30Z<p>New page: The following is a script that I obtained from Ana Gonzalez (thanks a lot, Ana!) and which may be re-distributed according to the copyright and permission notice given. It is called mccd_x...</p>
<p><b>New page</b></p><div>The following is a script that I obtained from Ana Gonzalez (thanks a lot, Ana!) and which may be re-distributed according to the copyright and permission notice given.<br />
It is called mccd_xdsparams.pl and should be in your $PATH if you want to use my [[generate_XDS.INP]] script.<br />
<br />
#!/usr/bin/perl -w<br />
#<br />
#<br />
# Copyright 2004<br />
# by<br />
# The Board of Trustees of the<br />
# Leland Stanford Junior University<br />
# All rights reserved.<br />
#<br />
# Disclaimer Notice<br />
#<br />
# The items furnished herewith were developed under the sponsorship<br />
# of the U.S. Government. Neither the U.S., nor the U.S. D.O.E., nor the<br />
# Leland Stanford Junior University, nor their employees, makes any war-<br />
# ranty, express or implied, or assumes any liability or responsibility<br />
# for accuracy, completeness or usefulness of any information, apparatus,<br />
# product or process disclosed, or represents that its use will not in-<br />
# fringe privately-owned rights. Mention of any product, its manufactur-<br />
# er, or suppliers shall not, nor is it intended to, imply approval, dis-<br />
# approval, or fitness for any particular use. The U.S. and the Univer-<br />
# sity at all times retain the right to use and disseminate the furnished<br />
# items for any purpose whatsoever.<br />
#<br />
# Permission Notice<br />
#<br />
# Permission is hereby granted, free of charge, to any person obtaining a<br />
# copy of this software and associated documentation files (the "Software"),<br />
# to deal in the Software without restriction, including without limitation<br />
# the rights to use, copy, modify, merge, publish, distribute, sublicense,<br />
# and/or sell copies of the Software, and to permit persons to whom the<br />
# Software is furnished to do so, subject to the following conditions:<br />
#<br />
# The above copyright notice and this permission notice shall be included<br />
# in all copies or substantial portions of the Software.<br />
#<br />
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS<br />
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTA-<br />
# BILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO<br />
# EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,<br />
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR<br />
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR<br />
# THE USE OR OTHER DEALINGS IN THE SOFTWARE.<br />
#<br />
# MARCDD image header format<br />
#<br />
# TIFF header 1024 bytes<br />
# Private frame header 3072 bytes<br />
## file/header format parameters 256 bytes<br />
## data statistics 128 bytes<br />
## more statistics 256 bytes<br />
## goniostat parameters 128 bytes<br />
### xtal_to_detector int32 (mm*1000)<br />
### beam_x int32 (pixel*1000)<br />
### beam_y int32 (pixel*1000)<br />
## detector parameters 128 bytes<br />
### detector_type int32<br />
### pixelsize_x int32 (nanometers<br />
### pixelsize_y int32 (nanometers<br />
##X-ray source parameters 128 bytes<br />
<br />
die "ERROR: Missing Argument. \nUsage: $0 [options] <image_filename>\n" unless @ARGV;<br />
<br />
while ($_ = $ARGV[0], /^-/) {<br />
shift;<br />
last if /^--$/;<br />
# if (/^-D(.*)/) { $debug = $1 }<br />
if (/^-v/) { $verbose = 1 }<br />
# ... # other switches<br />
}<br />
<br />
open ( FILE, '<', $ARGV[0] ) or<br />
die ( "ERROR: Cannot open file" );<br />
<br />
seek ( FILE, 1024+80, 0 );<br />
read ( FILE , $size_fast, 4 );<br />
read ( FILE , $size_slow, 4 );<br />
<br />
seek ( FILE, 1024+256+128+256, 0 );<br />
<br />
read ( FILE , $xtal_to_detector, 4 );<br />
read ( FILE , $beam_x, 4 );<br />
read ( FILE , $beam_y, 4 );<br />
<br />
seek ( FILE, 1024+256+128+256+16, 0);<br />
<br />
read ( FILE , $exp, 4 ); #exp time x 1000<br />
<br />
seek ( FILE, 1024+256+128+256+44, 0);<br />
read ( FILE , $start_phi, 4 ); #start phi x 1000<br />
seek ( FILE, 1024+256+128+256+76, 0);<br />
read ( FILE , $end_phi, 4 ); #end phi x 1000<br />
<br />
seek ( FILE, 1024+256+128+256+128, 0 );<br />
<br />
read ( FILE , $detector_type, 4 );<br />
read ( FILE , $pixelsize_x, 4 );<br />
read ( FILE , $pixelsize_y, 4 );<br />
<br />
seek ( FILE, 1024+256+128+256+128+128+12, 0 );<br />
read ( FILE , $wavelength, 4 ); #wavelength x 10000<br />
<br />
close ( FILE );<br />
<br />
$size_fast = unpack ('i*' ,$size_fast);<br />
$size_slow = unpack ('i*' ,$size_slow);<br />
$xtal_to_detector =unpack('i*' ,$xtal_to_detector) / 1000;<br />
$detector_type =unpack('i*' ,$detector_type);<br />
$beam_x = unpack ('i*' ,$beam_x) / 1000 ; # pixels<br />
$beam_y = unpack ('i*' ,$beam_y) / 1000 ; # pixels<br />
$beam_xc = $size_fast - $beam_x ;<br />
$beam_yc = $size_fast - $beam_y ;<br />
$pixelsize_x = unpack ('i*' ,$pixelsize_x) / 1000000 ; # mm<br />
$pixelsize_y = unpack ('i*' ,$pixelsize_y) / 1000000 ; # mm<br />
$beam_x_mm = $beam_x * $pixelsize_x ; # mm<br />
$beam_y_mm = $beam_y * $pixelsize_y ; # mm<br />
$exp = unpack ('i*' ,$exp) / 1000 ; #seconds<br />
$start_phi = unpack ('i*' ,$start_phi); #mdeg<br />
$end_phi = unpack ('i*' ,$end_phi); #mdeg<br />
$osc = ($end_phi - $start_phi)/1000; # deg<br />
$wavelength = unpack ('i*' ,$wavelength)/100000 ; #A<br />
<br />
if ($verbose) {<br />
print "NX= ${size_fast} NY= ${size_slow} QX= ${pixelsize_x} QY= ${pixelsize_y} \n";<br />
print "DETECTOR_DISTANCE= ${xtal_to_detector} \n";<br />
print "ORGX= ${beam_xc} ORGY= ${beam_yc} \n";<br />
print "OSCILLATION_RANGE= ${osc} \n";<br />
print "X-RAY_WAVELENGTH= ${wavelength} \n";<br />
<br />
} else {<br />
print "$size_fast,$size_slow", "\n";<br />
print "$xtal_to_detector", "\n";<br />
print "$beam_x_mm,$beam_y_mm", "\n";<br />
print "$pixelsize_x", "\n";<br />
print "$exp","\n";<br />
print "$osc","\n";<br />
print "$wavelength","\n";<br />
}<br />
<br />
exit</div>Kay