j2000_to_frame Function

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

rotation matrix from J2000 to the frame

Type Bound

moon_frame_interpolater

Arguments

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

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


Calls

proc~~j2000_to_frame~~CallsGraph proc~j2000_to_frame moon_frame_interpolater%j2000_to_frame evaluate evaluate proc~j2000_to_frame->evaluate 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_frame_interpolater%j2000_to_frame proc~frame_to_j2000 moon_frame_interpolater%frame_to_j2000 proc~frame_to_j2000->proc~j2000_to_frame

Source Code

    function j2000_to_frame(me, et) result(rot)
        !! rotation matrix from J2000 to the frame
        class(moon_frame_interpolater), intent(inout) :: me
        real(wp), intent(in) :: et
        real(wp) :: rot(3, 3)

        real(wp) :: roll, pitch, yaw_x, yaw_y, yaw
        integer :: iflag

        call me%roll_spline%evaluate (et, 0, roll, iflag); if (iflag/=0) error stop 'error computing roll spline.'
        call me%pitch_spline%evaluate(et, 0, pitch, iflag); if (iflag/=0) error stop 'error computing pitch spline.'
        call me%yaw_x_spline%evaluate(et, 0, yaw_x, iflag); if (iflag/=0) error stop 'error computing yaw_x spline.'
        call me%yaw_y_spline%evaluate(et, 0, yaw_y, iflag); if (iflag/=0) error stop 'error computing yaw_y spline.'
        yaw = atan2(yaw_y, yaw_x)

        ! convert to rotation matrix:
        call rpy_to_rot(roll, pitch, yaw, rot)

    end function j2000_to_frame