https://wiki.uni-konstanz.de/xds/index.php?title=Mccd_xdsparams.pl&feed=atom&action=history Mccd xdsparams.pl - Revision history 2024-03-29T07:21:17Z Revision history for this page on the wiki MediaWiki 1.39.6 https://wiki.uni-konstanz.de/xds/index.php?title=Mccd_xdsparams.pl&diff=2246&oldid=prev Kay at 10:51, 28 June 2010 2010-06-28T10:51:17Z <p></p> <a href="https://wiki.uni-konstanz.de/xds/index.php?title=Mccd_xdsparams.pl&amp;diff=2246&amp;oldid=2196">Show changes</a> Kay https://wiki.uni-konstanz.de/xds/index.php?title=Mccd_xdsparams.pl&diff=2196&oldid=prev Kay: 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 &quot;Software&quot;),<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 &quot;AS IS&quot;, 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 &quot;ERROR: Missing Argument. \nUsage: $0 [options] &lt;image_filename&gt;\n&quot; 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, &#039;&lt;&#039;, $ARGV[0] ) or<br /> die ( &quot;ERROR: Cannot open file&quot; );<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 (&#039;i*&#039; ,$size_fast);<br /> $size_slow = unpack (&#039;i*&#039; ,$size_slow);<br /> $xtal_to_detector =unpack(&#039;i*&#039; ,$xtal_to_detector) / 1000;<br /> $detector_type =unpack(&#039;i*&#039; ,$detector_type);<br /> $beam_x = unpack (&#039;i*&#039; ,$beam_x) / 1000 ; # pixels<br /> $beam_y = unpack (&#039;i*&#039; ,$beam_y) / 1000 ; # pixels<br /> $beam_xc = $size_fast - $beam_x ;<br /> $beam_yc = $size_fast - $beam_y ;<br /> $pixelsize_x = unpack (&#039;i*&#039; ,$pixelsize_x) / 1000000 ; # mm<br /> $pixelsize_y = unpack (&#039;i*&#039; ,$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 (&#039;i*&#039; ,$exp) / 1000 ; #seconds<br /> $start_phi = unpack (&#039;i*&#039; ,$start_phi); #mdeg<br /> $end_phi = unpack (&#039;i*&#039; ,$end_phi); #mdeg<br /> $osc = ($end_phi - $start_phi)/1000; # deg<br /> $wavelength = unpack (&#039;i*&#039; ,$wavelength)/100000 ; #A<br /> <br /> if ($verbose) {<br /> print &quot;NX= ${size_fast} NY= ${size_slow} QX= ${pixelsize_x} QY= ${pixelsize_y} \n&quot;;<br /> print &quot;DETECTOR_DISTANCE= ${xtal_to_detector} \n&quot;;<br /> print &quot;ORGX= ${beam_xc} ORGY= ${beam_yc} \n&quot;;<br /> print &quot;OSCILLATION_RANGE= ${osc} \n&quot;;<br /> print &quot;X-RAY_WAVELENGTH= ${wavelength} \n&quot;;<br /> <br /> } else {<br /> print &quot;$size_fast,$size_slow&quot;, &quot;\n&quot;;<br /> print &quot;$xtal_to_detector&quot;, &quot;\n&quot;;<br /> print &quot;$beam_x_mm,$beam_y_mm&quot;, &quot;\n&quot;;<br /> print &quot;$pixelsize_x&quot;, &quot;\n&quot;;<br /> print &quot;$exp&quot;,&quot;\n&quot;;<br /> print &quot;$osc&quot;,&quot;\n&quot;;<br /> print &quot;$wavelength&quot;,&quot;\n&quot;;<br /> }<br /> <br /> exit</div> Kay