cspice_xfmsta |
|||

## AbstractCSPICE_XFMSTA transforms a state between coordinate systems. For important details concerning this module's function, please refer to the CSPICE routine xfmsta_c. ## I/OGiven: Arguments- input_state is a state vector in the input ('input_coord_sys') coordinate system representing position and velocity. All angular measurements must be in radians. Note: body radii values taken from the kernel pool are used when converting to or from geodetic or planetographic coordinates. It is the user's responsibility to verify the distance inputs are in the same units as the radii in the kernel pool, typically kilometers. input_coord_sys is the name of the coordinate system that the input state vector ('input_state') is currently in. 'input_coord_sys' may be any of the following: 'RECTANGULAR' 'CYLINDRICAL' 'LATITUDINAL' 'SPHERICAL' 'GEODETIC' 'PLANETOGRAPHIC' Leading spaces, trailing spaces, and letter case are ignored. For example, ' cyLindRical ' would be accepted. output_coord_sys is the name of the coordinate system that the state should be converted to. Please see the description of 'input_coord_sys' for details. body is the name or NAIF ID of the body associated with the planetographic or geodetic coordinate system. If one of the coordinate system choices is not geodetic or planetographic, 'body' may be an empty string (' '). Examples of accepted body names or IDs are: 'Earth' '399' Leading spaces, trailing spaces, and letter case are ignored. the call: ## ExamplesThe numerical results shown for these examples 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. Example(1): Find the apparent state of Phoebe as seen by CASSINI in the J2000 frame at 2004 Jun 11 19:32:00. Transform the state from rectangular to latitudinal coordinates. For verification, transform the state back from latitudinal to rectangular coordinates. Use the meta-kernel shown below to load the required SPICE kernels. KPL/MK File name: xfmsta_ex1.tm This meta-kernel is intended to support operation of SPICE example programs. The kernels shown here should not be assumed to contain adequate or correct versions of data required by SPICE-based user applications. In order for an application to use this meta-kernel, the kernels referenced here must be present in the user's current working directory. The names and contents of the kernels referenced by this meta-kernel are as follows: File name Contents --------- -------- cpck05Mar2004.tpc Planet orientation and radii naif0009.tls Leapseconds 020514_SE_SAT105.bsp Satellite ephemeris for Saturn 030201AP_SK_SM546_T45.bsp CASSINI ephemeris 981005_PLTEPH-DE405S.bsp Planetary ephemeris \begindata KERNELS_TO_LOAD = ( 'naif0009.tls' , '020514_SE_SAT105.bsp' , '030201AP_SK_SM546_T45.bsp', '981005_PLTEPH-DE405S.bsp', 'cpck05Mar2004.tpc' ) \begintext End of meta-kernel. Beginning of example program. ;; ;; Load kernels ;; cspice_furnsh, 'xfmsta_ex1.tm' ;; ;; Calculate the state at 2004 Jun 11 19:32:00 UTC. ;; cspice_str2et, '2004-JUN-11-19:32:00', et ;; ;; Calculate the apparent state of Phoebe as seen by ;; CASSINI in the J2000 frame. ;; cspice_spkezr, 'phoebe', et, 'iau_phoebe', 'lt+s', 'cassini', $ state_rec, ltime ;; ;; Transform the state from rectangular to latitudinal. ;; Notice that since neither the input nor output ;; coordinate frames are 'geodetic' or 'planetographic', ;; the input for the body name is a blank string. ;; ## ParticularsInput Order ------------------------------------------- The input and output states will be structured by the following descriptions. For rectangular coordinates, the state vector is the following in which X, Y, and Z are the rectangular position components and DX, DY, and DZ are the time derivatives of each. ISTATE = ( X, Y, Z, DX, DY, DZ ) For cylindrical coordinates, the state vector is the following in which R is the radius, LONG is the longitude, Z is the height, and DR, DLONG, and DZ are the time derivatives of each. ISTATE = ( R, LONG, Z, DR, DLONG, DZ ) For latitudinal coordinates, the state vector is the following in which R is the radius, LONG is the longitude, LAT is the latitude, and DR, DLONG, and DLAT are the time derivatives of each. ISTATE = ( R, LONG, LAT, DR, DLONG, DLAT ) For spherical coordinates, the state vector is the following in which R is the radius, COLAT is the colatitude, LONG is the longitude, and DR, DCOLAT, and DLONG are the time derivatives of each. ISTATE = ( R, COLAT, LONG, DR, DCOLAT, DLONG ) For geodetic coordinates, the state vector is the following in which LONG is the longitude, LAT is the latitude, ALT is the altitude, and DLONG, DLAT, and DALT are the time derivatives of each. ISTATE = ( LONG, LAT, ALT, DLONG, DLAT, DALT ) For planetographic coordinates, the state vector is the following in which LONG is the longitude, LAT is the latitude, ALT is the altitude, and DLONG, DLAT, and DALT are the time derivatives of each. ISTATE = ( LONG, LAT, ALT, DLONG, DLAT, DALT ) Input Boundaries ------------------------------------------- There are intervals the input angles must fall within if the input coordinate system is not rectangular. These intervals are provided below. Input variable Input meaning Input interval [rad] -------------- ------------- ------------------------ LONG Longitude 0 <= LONG < 2*pi LAT Latitude -pi/2 <= LAT <= pi/2 COLAT Colatitude 0 <= COLAT <= pi ## Required ReadingICY.REQ ## Version-Icy Version 1.0.0, 30-JAN-2012, SCK (JPL) ## Index_Entriesstate transformation between coordinate systems convert state |

Wed Apr 5 17:58:05 2017