standish_r_func Subroutine

private subroutine standish_r_func(me, et, targ, obs, r, status_ok)

Return the position of the targ body relative to the obs body, in the inertial frame [ICRF].

This is the function that can be used in the ephemeris_class.

position of targ w.r.t. obs [km]

Type Bound

standish_ephemeris

Arguments

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

ephemeris time [sec]

type(celestial_body), intent(in) :: targ

target body

type(celestial_body), intent(in) :: obs

observer body

real(kind=wp), intent(out), dimension(3) :: r

position of targ w.r.t. obs [km]

logical, intent(out) :: status_ok

true if there were no problems


Calls

proc~~standish_r_func~~CallsGraph proc~standish_r_func standish_ephemeris%standish_r_func proc~standish_rv_func standish_ephemeris%standish_rv_func proc~standish_r_func->proc~standish_rv_func proc~ec2eq ec2eq proc~standish_rv_func->proc~ec2eq proc~et_to_jd et_to_jd proc~standish_rv_func->proc~et_to_jd proc~helio helio proc~standish_rv_func->proc~helio proc~spice_id_to_standish_id spice_id_to_standish_id proc~standish_rv_func->proc~spice_id_to_standish_id proc~calcelements calcelements proc~helio->proc~calcelements proc~el2op el2op proc~helio->proc~el2op proc~op2ec op2ec proc~helio->proc~op2ec proc~tbl tbl proc~helio->proc~tbl proc~kepler kepler proc~calcelements->proc~kepler

Source Code

    subroutine standish_r_func(me,et,targ,obs,r,status_ok)

    implicit none

    class(standish_ephemeris),intent(inout) :: me
    real(wp),intent(in)                     :: et         !! ephemeris time [sec]
    type(celestial_body),intent(in)         :: targ       !! target body
    type(celestial_body),intent(in)         :: obs        !! observer body
    real(wp),dimension(3),intent(out)       :: r          !! position of targ w.r.t. obs [km]
    logical,intent(out)                     :: status_ok  !! true if there were no problems

    real(wp),dimension(6) :: rv  !! full state vector [km, km/s]

    call me%get_rv(et,targ,obs,rv,status_ok)
    if (status_ok) then
        r = rv(1:3)  !! position of targ w.r.t. obs [km]
    else
        r = zero
    end if
    end subroutine standish_r_func