Index Page
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Required Reading


   CSPICE_BODDEF Define a body name/ID code pair for later translation via 
   cspice_bodn2c or cspice_bodc2n.

   For important details concerning this module's function, please refer to
   the CSPICE routine boddef_c.



      name   the scalar string defining the name to associate to the ID value 

             The case and positions of blanks in a name are significant. 
             cspice_bodc2n returns the same string (case and space) most 
             recently mapped to a code. When 'name' consists of more than one 
             word, the words require separation by at least one blank.

             The kernel sub-system stores 'name' as described in the 
             cspice_boddef call, but creates an equivalence class based on 
             'name' for comparisons in cspice_bodn2c. This class ignores leading
             and trailing whitespace, compresses interior whitespace to a single
             space, and ignores character case.

             The following strings belong to the same equivalence 

                       'JUPITER BARYCENTER'
                       'Jupiter Barycenter'
                       'JUPITER BARYCENTER   '
                       'JUPITER    BARYCENTER'
                       '   JUPITER BARYCENTER'

             However, 'JUPITERBARYCENTER' is distinct from the names above.

      code   the integer defining the NAIF ID code corresponding
             to 'name'.
   the call:
      cspice_boddef, name, code
   performs the mapping assignment 
      'name' -> 'code' 
      'code' -> 'name'
   The 'code' -> 'name' assignment supersedes any other mapping for 'code'.


   Any numerical results shown for this example may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

      ;; Map a non-existent code and name to each other.   
      cspice_boddef, 'spud',  -69 
      ;; Retrieve the code for name 'spud'.
      cspice_bodn2c, 'spud', code, found
      ;; Check we found a mapping.
      if (found) then begin
         print, 'ID for spud : ' + string(code)
      endif else begin
         print, 'Found no mapping for spud.'
      ;; Retrieve the name for ID -69.
      cspice_bodc2n, -69, name, found
      ;; Check we found a mapping.
      if (found) then begin
         print, 'Name for -69: ' + name
      endif else begin
         print, 'Found no mapping for -69.'
   IDL outputs:
      ID for spud :          -69
      Name for -69: spud


   cspice_boddef is one of five related subroutines,

      cspice_bods2c      Body string to code
      cspice_bodc2s      Body code to string
      cspice_bodn2c      Body name to code
      cspice_bodc2n      Body code to name
      cspice_boddef      Body name/code definition

   cspice_bods2c, cspice_bodc2s, cspice_bodn2c, and cspice_bodc2n 
   perform translations between body names and their corresponding 
   integer ID codes which are used in SPICE files and routines.

   cspice_bods2c is a slightly more general version of cspice_bodn2c: 
   support for strings containing ID codes in string format enables a caller
   to identify a body using a string, even when no name is associated with 
   that body.

   cspice_bodc2s is a general version of cspice_bodc2n; the routine returns 
   either the name assigned in the body ID to name mapping or a string
   representation of the 'code' value if no mapping exists.

   cspice_boddef assigns a body name to ID mapping. The mapping has
   priority in name-to-ID and ID-to-name translations.

   Refer to NAIF_IDS.REQ for the list of name/code associations built
   into SPICE, and for details concerning adding new name/code
   associations at run time by loading text kernels.

Required Reading



   -Icy Version 1.0.1, 16-MAY-2009 (EDW) 

       Edit to Particulars section to document the cspice_bodc2s routine.
       Extended argument descriptions in the I/O section.

   -Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)


   body name/id code definition

Wed Apr  5 17:57:59 2017