j2000_to_frame Function

private function j2000_to_frame(me, et) result(rot)

The rotation matrix from J2000 to the MOON_PA frame at et.

Type Bound

moon_pa_frame

Arguments

Type IntentOptional Attributes Name
class(moon_pa_frame), intent(inout) :: me
real(kind=wp), intent(in) :: et

ephemeris time [sec]

Return Value real(kind=wp), dimension(3,3)


Calls

proc~~j2000_to_frame~~CallsGraph proc~j2000_to_frame moon_pa_frame%j2000_to_frame db1val db1val proc~j2000_to_frame->db1val proc~rpy_to_rot rpy_to_rot proc~j2000_to_frame->proc~rpy_to_rot

Called by

proc~~j2000_to_frame~~CalledByGraph proc~j2000_to_frame moon_pa_frame%j2000_to_frame proc~frame_to_j2000 moon_pa_frame%frame_to_j2000 proc~frame_to_j2000->proc~j2000_to_frame

Source Code

    function j2000_to_frame(me, et) result(rot)

    class(moon_pa_frame),intent(inout) :: me
    real(wp),intent(in) :: et  !! ephemeris time [sec]
    real(wp),dimension(3,3) :: rot

    real(wp),dimension(n_splines) :: v  !! roll, pitch, cos(yaw), sin(yaw)
    integer :: j, iflag

    if (nx == 0) error stop 'error: the MOON_PA frame has not been initialized'
    do j = 1, n_splines
        call db1val(et, 0, tx(:,j), nx, kx, bcoef(:,j), v(j), iflag, me%inbvx(j), me%w0, extrap=.false.)
        if (iflag/=0) error stop 'error evaluating the MOON_PA spline.'
    end do
    call rpy_to_rot(v(1), v(2), atan2(v(4), v(3)), rot)

    end function j2000_to_frame