Convert the NAIF SPICE ID code to the one used by the standish ephemeris.
Returns 0
if the body was not found.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | spice_id |
the ID code used by SPICE |
the ID code used by this module
pure function spice_id_to_standish_id(spice_id) result(old_id) implicit none integer,intent(in) :: spice_id !! the ID code used by SPICE integer :: old_id !! the ID code used by this module integer :: i !! counter !> ! The index of this array is the ID code. The value is the NAIF code. ! See: [NAIF Integer ID codes](http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/FORTRAN/req/naif_ids.html) integer,parameter,dimension(9) :: new_ids = & [ 199,& ! mercury 299,& ! venus 3, & ! earth-moon barycenter 499,& ! mars 599,& ! jupiter 699,& ! saturn 799,& ! uranus 899,& ! neptune 999] ! pluto !just a simple search of the list: ! [small enough that bisection search probably not worth it] do i=1,size(new_ids) if (new_ids(i)==spice_id) then old_id = i return end if end do !not found: old_id = 0 end function spice_id_to_standish_id