uvw_to_xyz Subroutine

public subroutine uvw_to_xyz(uvw, xyz)

Convert machine coordinate uvw to beam coordinate xyz

Arguments

Type IntentOptional AttributesName
real(kind=Float64), intent(in), dimension(3):: uvw
real(kind=Float64), intent(out), dimension(3):: xyz

Called by

proc~~uvw_to_xyz~~CalledByGraph proc~uvw_to_xyz uvw_to_xyz proc~read_mc read_mc proc~read_mc->proc~uvw_to_xyz proc~neutron_mc neutron_mc proc~neutron_mc->proc~uvw_to_xyz proc~read_beam read_beam proc~read_beam->proc~uvw_to_xyz proc~npa_mc npa_mc proc~npa_mc->proc~uvw_to_xyz proc~neutron_f neutron_f proc~neutron_f->proc~uvw_to_xyz proc~fida_mc fida_mc proc~fida_mc->proc~uvw_to_xyz proc~read_distribution read_distribution proc~read_distribution->proc~read_mc program~fidasim fidasim program~fidasim->proc~neutron_mc program~fidasim->proc~read_beam program~fidasim->proc~npa_mc program~fidasim->proc~neutron_f program~fidasim->proc~fida_mc program~fidasim->proc~read_distribution

Contents

Source Code


Source Code

subroutine uvw_to_xyz(uvw,xyz)
    !+ Convert machine coordinate `uvw` to beam coordinate `xyz`
    real(Float64), dimension(3), intent(in)  :: uvw
    real(Float64), dimension(3), intent(out) :: xyz

    real(Float64), dimension(3) :: origin, uvw_p
    real(Float64), dimension(3,3) :: basis

    origin = beam_grid%origin
    basis = beam_grid%inv_basis
    uvw_p = uvw - origin
    xyz = matmul(basis,uvw_p)

end subroutine uvw_to_xyz