Table of contents
CSPICE_BODC2N returns the body name corresponding to an input numeric ID
value.
Given:
code the scalar integer SPICE code for a body: a planet, satellite,
barycenter, spacecraft, asteroid, comet, or other ephemeris
object.
help, code
LONG = Scalar
the call:
cspice_bodc2n, code, name, found
returns:
name the scalar string name associated with `code'.
help, name
STRING = Scalar
If `code' has more than one translation, then the most recently
defined name corresponding to `code' is returned. `name' will
have the exact format (case and blanks) as when the name/code
pair was defined.
found a scalar boolean flagging if the kernel subsystem translated
`code' to a corresponding name; true if `code' has a
translation.
help, found
BOOLEAN = Scalar
Otherwise, found is false.
MAXL is the maximum allowable length of a body name. The
current value of this parameter is 36.
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.
1) Find the name that corresponds to the NAIF ID code -77.
Example code begins here.
PRO bodc2n_ex1
;;
;; Query for the name mapped to -77.
;;
code = -77
cspice_bodc2n, code, name, found
;;
;; Respond if found.
;;
if ( found ) then begin
print, 'Name corresponding to code: ', name
endif else begin
print, 'No name corresponding to code: ', code
endelse
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, the output was:
Name corresponding to code: GALILEO ORBITER
cspice_bodc2n 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.
1) If there is any problem with the body name-ID mapping kernel
variables present in the kernel pool, an error is signaled by
a routine in the call tree of this routine.
2) If the input argument `code' is undefined, an error is
signaled by the IDL error handling system.
3) If the input argument `code' is not of the expected type, or
it does not have the expected dimensions and size, an error is
signaled by the Icy interface.
4) If any of the output arguments, `name' or `found', is not a
named variable, an error is signaled by the Icy interface.
Body-name mappings may be defined at run time by loading text
kernels containing kernel variable assignments of the form
NAIF_BODY_NAME += ( <name 1>, ... )
NAIF_BODY_CODE += ( <code 1>, ... )
See naif_ids.req for details.
None.
ICY.REQ
NAIF_IDS.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.2, 31-MAY-2021 (JDR)
Edited the header to comply with NAIF standard. Added example's problem
statement.
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections.
Removed reference to the routine's corresponding CSPICE header from
-Abstract section.
Added arguments' type and size information in the -I/O section.
-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)
body id code to name
|