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

Table of contents

Procedure Abstract Required_Reading Keywords Brief_I/O Detailed_Input | Detailed_Output Parameters Exceptions Files Particulars Examples | Restrictions Literature_References Author_and_Institution Version Index_Entries

#### Procedure

       frmnam_c (Frame to Name)

       void frmnam_c ( SpiceInt      frcode,
                       SpiceInt      frnlen,
                       SpiceChar *   frname  )

#### Abstract

       Retrieve the name of a reference frame associated with a SPICE ID
       code.

#### Required_Reading

       FRAMES

#### Keywords

       FRAMES

#### Brief_I/O

       VARIABLE  I/O  DESCRIPTION
       --------  ---  --------------------------------------------------
       frcode     I   an integer code for a reference frame
       frnlen     I   Maximum length of output string.
       frname     O   the name associated with the reference frame.

#### Detailed_Input

       frcode      is an integer code for a reference frame.

       frnlen      is the maximum number of characters that can be accommodated in
                   the output string. This count includes room for the terminating
                   null character. For example, if the maximum allowed length of
                   the output string `frnnm', including the terminating null, is 33
                   characters, then `frnlen' should be set to 33.

#### Detailed_Output

       frname      is the name associated with the reference frame. It will
                   be returned left justified.

                   If `frcode' is not recognized as the name of a known
                   reference frame, `frname' will be returned as an empty
                   string.

                   If `frname' is not sufficiently long to hold the name, it
                   will be truncated on the right.

                   All reference frame names are 32 or fewer characters in
                   length. Thus declaring `frname' to be SpiceChar[33] will
                   ensure that the returned name will not be truncated.

#### Parameters

       None.

#### Exceptions

       1)  If `frcode' is not recognized as the name of a known reference
           frame, `frname' will be returned as a blank.

       2)  If `frname' is not sufficiently long to hold the name, it will
           be truncated on the right.

       3)  If the `frname' output string pointer is null, the error
           SPICE(NULLPOINTER) is signaled.

       4)  If the `frname' output string has length less than two
           characters, the error SPICE(STRINGTOOSHORT) is signaled, since
           the output string is too short to contain one character of
           output data plus a null terminator.

#### Files

       None.

#### Particulars

       This routine retrieves the name of a reference frame associated
       with a SPICE frame ID code.

       The ID codes stored locally are scanned for a match with `frcode'.
       If a match is found, the name stored locally will be returned
       as the name for the frame.

       If `frcode' is not a member of the list of internally stored
       ID codes, the kernel pool will be examined to see if the
       variable

          FRAME_idcode_NAME

       is present (where idcode is the decimal character equivalent
       of `frcode'). If the variable is located and it has both
       character type and dimension 1, the string value of the
       kernel pool variable is returned as the name of the reference
       frame.

       Note that because the local information is always examined
       first and searches of the kernel pool are performed only
       after exhausting local information, it is not possible to
       override the local name for any reference frame that is
       known by this routine.

#### Examples

       The numerical results shown for this example may differ across
       platforms. The results depend on the SPICE kernels used as
       input, the compiler and supporting libraries, and the machine
       specific arithmetic implementation.

       1) Given a SPICE frame ID, retrieve its associated frame name.

          Example code begins here.

          /.
             Program frmnam_ex1
          ./
          #include <stdio.h>
          #include "SpiceUsr.h"

          int main( )
          {
             /.
             Local constants
             ./
             #define NAMELEN         33

             SpiceInt                frcode = 13000;

             /.
             Local variables
             ./
             SpiceChar               frname [NAMELEN];

             /.
             What frame name maps to ID code 13000?
             ./
             frmnam_c ( frcode, NAMELEN, frname );

             if ( !iswhsp_c(frname) )
             {
                printf ( "Frame ID  : %d\n", (int)frcode );
                printf ( "Frame name: %s\n", frname      );
             }
             else
             {
                printf ( "ID code %d not recognized as a SPICE frame ID\n",
                         (int)frcode                                      );
             }

             return ( 0 );
          }

          When this program was executed on a Mac/Intel/cc/64-bit
          platform, the output was:

          Frame ID  : 13000
          Frame name: ITRF93

#### Restrictions

       None.

#### Literature_References

       None.

#### Author_and_Institution

       N.J. Bachman        (JPL)
       J. Diaz del Rio     (ODC Space)
       B.V. Semenov        (JPL)
       W.L. Taber          (JPL)
       E.D. Wright         (JPL)

#### Version

       -CSPICE Version 1.1.0, 10-AUG-2021 (JDR)

           Changed the input argument name "lenout" to "frnlen" for consistency
           with other routines.

           Edited the header to comply with NAIF standard. Added complete code
           example.

       -CSPICE Version 1.0.3, 12-JUL-2016 (EDW)

           Edit to example program to use "%d" with explicit casts
           to int for printing SpiceInts with printf.

       -CSPICE Version 1.0.2, 08-JAN-2014 (BVS)

           Fixed typo in -Examples (frname_c -> frmnam_c). Reordered
           header sections.

       -CSPICE Version 1.0.1, 26-MAR-2003 (NJB)

           Fixed description of exception (4):  replaced "frnlen-1"
           with "frnlen." Removed spurious word "clock" from string
           description.

       -CSPICE Version 1.0.0, 13-AUG-2001 (NJB) (WLT)

#### Index_Entries

       Frame idcode to frame name translation

#### Link to routine frmnam_c source file frmnam_c.c

    Fri Dec 31 18:41:06 2021