cspice_sxform |
|||

## AbstractCSPICE_SXFORM returns the state transformation matrix from one frame to another at a specified epoch. For important details concerning this module's function, please refer to the CSPICE routine sxform_c. ## I/OGiven: from the scalar string name of a reference frame in which a state is known to the scalar string name of a reference frame in which it is desired to represent the state et the double precision scalar or N-vector of epochs in ephemeris seconds past the epoch of J2000 (TDB) at which the state transformation matrix should be evaluated. the call: ## ExamplesAny 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. ;; ;; Suppose you have geodetic coordinates of a station on the ;; surface of Earth and that you need the inertial (J2000) ;; state of this station. The following code fragment ;; illustrates how to transform the geodetic state of the ;; station to a J2000 state. ;; ;; ;; Load the SPK, PCK and LSK kernels. ;; cspice_furnsh, 'standard.tm' ;; ;; Define a geodetic longitude, latitude, altitude ;; coordinate set. These coordinates are defined in the ;; non-inertial, earth fixed frame "IAU_EARTH". ;; lon = 118.25d * cspice_rpd() lat = 34.05d * cspice_rpd() alt = 0.d ;; ;; Define a UTC time of interest. Convert the 'utc' string ;; to ephemeris time J2000. ;; utc = 'January 1, 1990' cspice_str2et, utc, et ;; ;; Retrieve the equatorial and polar axis of the earth (body 399). ;; cspice_bodvrd, 'EARTH', 'RADII', 3, abc equatr = abc[0] polar = abc[2] ;; ;; Calculate the flattening factor for earth. ;; f = ( equatr - polar ) / equatr ;; ;; Calculate the Cartesian coordinates on earth for the ;; location at 'lon', 'lat', 'alt'. ;; cspice_georec, lon, lat, alt, equatr, f, estate ;; ;; cspice_georec returned the position vector of the geodetic ;; coordinates, but we want the state vector. Since it is a fixed ;; location referenced in the "IAU_EARTH" frame, the location has ;; no velocity. We need to extend estate to a 6-vector, the final ;; three elements with value 0.d. ;; estate = [ temporary(estate) , dblarr(3) ] ;; ;; Retrieve the transformation matrix from "IAU_EARTH" ;; to "J2000" at epoch 'et'. ;; ## ParticularsNone. ## Required ReadingICY.REQ ROTATION.REQ FRAMES.REQ ## Version-Icy Version 1.1.1, 18-MAY-2005, EDW (JPL) Corrected the expression for the flattening factor, from: f = ( polar - equatr ) / equatr to f = ( equatr - polar ) / equatr -Icy Version 1.1.0, 26-OCT-2004, EDW (JPL) Added capability to process vector 'et' as input returning a 6x6xN 'xform' array. -Icy Version 1.0.0, 16-JUN-2003, EDW (JPL) ## Index_EntriesFind a state transformation matrix |

Wed Apr 5 17:58:04 2017