Convert beam coordinate xyz
to machine coordinate uvw
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=Float64), | intent(in), | dimension(3) | :: | xyz | ||
real(kind=Float64), | intent(out), | dimension(3) | :: | uvw |
subroutine xyz_to_uvw(xyz, uvw)
!+ Convert beam coordinate `xyz` to machine coordinate `uvw`
real(Float64), dimension(3), intent(in) :: xyz
real(Float64), dimension(3), intent(out) :: uvw
real(Float64), dimension(3) :: origin
real(Float64), dimension(3,3) :: basis
origin = beam_grid%origin
basis = beam_grid%basis
uvw = matmul(basis,xyz)
uvw = uvw + origin
end subroutine xyz_to_uvw