XDSGUI User tools: Difference between revisions

JKrahn (talk | contribs)
No edit summary
JKrahn (talk | contribs)
 
(One intermediate revision by the same user not shown)
Line 8: Line 8:
X=$(perl -e '
X=$(perl -e '
# Read IDXREF.LP to get refined beam center, save in $x, $y
# Read IDXREF.LP to get refined beam center, save in $x, $y
open(F,"<IDXREF.LP");
open(F,"<IDXREF.LP") or die;
while(<F>){
while(<F>){
   if(/BEAM +(\S*\d) +(\S*\d)/){ $x=$1; $y=$2; } # get X,Y beam
   if(/BEAM +(\S*\d) +(\S*\d)/){ $x=$1; $y=$2; } # get X,Y beam
}
}
# Read XDS.INP to get parameters needed to adjust for horizontal 2-theta offset (vertical offsets not supported)
# Read XDS.INP to get parameters needed to adjust for horizontal 2-theta offset (vertical offsets not supported)
open(F,"<XDS.INP");
open(F,"<XDS.INP") or die;
while(<F>){
while(<F>){
   if(/^[^!]*DETECTOR_DISTANCE= *(\S*\d)/){ $d=$1; } # d = detector distance
   if(/^[^!]*DETECTOR_DISTANCE= *(\S*\d)/) { $d=$1; } # d = detector distance
   if(/^[^!]*DIRECTION_OF_DETECTOR_X-AXIS= *(\S*\d) +\S*\d +(\S*\d)/){ $x1=$1; $x3=$2; } # x1,x3 = horizontal rotation part of X-axis
   if(/^[^!]*DIRECTION_OF_DETECTOR_X-AXIS= *(\S*\d) +\S*\d +(\S*\d)/) { $x1=$1; $x3=$2; } # x1,x3 = horizontal rotation part of X-axis
   if(/^[^!]*QX= *(\S*\d)/){$qx=$1;} # qx = detector resolution
   if(/^[^!]*QX= *(\S*\d)/) { $qx=$1;} # qx = detector resolution
}
}
printf "ORGX=%.2f ORGY=%.2f\n",$x-$x3/$x1*$d/$qx, $y;'
printf "ORGX=%.2f ORGY=%.2f\n",$x-$x3/$x1*$d/$qx, $y;'