2,652
edits
No edit summary |
(warning) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Attention: this program needs to be modified to read the "new format" (since 2013) of XPARM.XDS. | |||
To be compiled with e.g. | |||
gfortran -C get_rot_from_xparm.f90 -o get_rot_from_xparm | |||
<pre> | <pre> | ||
Line 7: | Line 12: | ||
real rotation(3),beam(3),detector_x(3),detector_y(3),x,xyz(3) | real rotation(3),beam(3),detector_x(3),detector_y(3),x,xyz(3) | ||
real, parameter :: r2d=57.2957795 | real, parameter :: r2d=57.2957795 | ||
character | character*1 :: axnam(3)=(/'a','b','c'/) | ||
open(1,file='XPARM.XDS') | open(1,file='XPARM.XDS') | ||
Line 31: | Line 36: | ||
xyz=xyz/x | xyz=xyz/x | ||
x=dot_product(xyz,rotation) | x=dot_product(xyz,rotation) | ||
print*,axnam(i),' axis | print*,'angle between ',axnam(i),' axis and ROTATION_AXIS: ',acos(x)*r2d | ||
x=dot_product(xyz,detector_x) | x=dot_product(xyz,detector_x) | ||
print*,axnam(i),' axis | print*,'angle between ',axnam(i),' axis and DETECTOR_X-AXIS: ',acos(x)*r2d | ||
x=dot_product(xyz,detector_y) | x=dot_product(xyz,detector_y) | ||
print*,axnam(i),' axis | print*,'angle between ',axnam(i),' axis and DETECTOR_Y-AXIS: ',acos(x)*r2d | ||
x=dot_product(xyz,beam) | x=dot_product(xyz,beam) | ||
print*,axnam(i),' axis | print*,'angle between ',axnam(i),' axis and INCIDENT_BEAM DIRECTION:',acos(x)*r2d | ||
end do | end do | ||
end | end |