CSPICE_CONVRT performs a conversion from a measurement in
one unit set to the corresponding measure in another unit
set.
For important details concerning this module's function, please refer to
the CSPICE routine convrt_c.
Given:
x is a number representing a measurement in the units
specified by `in'.
in represents the units associated with a measurement x.
Acceptable units are:
Angles: "RADIANS"
"DEGREES"
"ARCMINUTES"
"ARCSECONDS"
"HOURANGLE"
"MINUTEANGLE"
"SECONDANGLE"
Metric Distances: "METERS"
"M"
"KILOMETERS"
"KM"
"CENTIMETERS"
"CM"
"MILLIMETERS"
"MM"
English Distances: "FEET"
"INCHES"
"YARDS"
"STATUTE_MILES"
"NAUTICAL_MILES"
Astrometric Distances: "AU"
"PARSECS"
"LIGHTSECS"
"LIGHTYEARS" julian lightyears
Time: "SECONDS"
"MINUTES"
"HOURS"
"DAYS"
"JULIAN_YEARS"
"TROPICAL_YEARS"
"YEARS" (same as julian years)
The case of the string `in' is not significant.
the call:
cspice_convrt, x, in, out, y
returns:
y represents the units desired for the measurement `x'.
See the description of `in'.
The case of the string `out' is not significant.
NOTE: 'x' and 'y' must be uniquely named variables.
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.
Example(1):
;;
;; Convert 300 miles (statute miles) to kilometers.
;;
dist_sm = 300.d
cspice_convrt, dist_sm, 'statute_miles', 'km', dist_km
print, dist_km
IDL outputs:
482.80320
Example(2):
;;
;; Determine the number of lightyears in a parsec.
;;
one_parsec = 1.d
cspice_convrt, one_parsec, 'parsecs', 'lightyears', lightyears
print, lightyears
IDL outputs:
3.2615638
This routine converts a measurement x given in units specified by
in to the equivalent value y in units specified by out.
If a unit is not recognized, an error message is produced that
indicates which one was not recognized.
If input and output units are incompatible (for example angle
and distance units) and error message will be produced stating
the requested units and associated types.
ICY.REQ
Icy Version 1.0.1, 11JAN2017, EDW (JPL)
Header update to correspond to current SPICELIB/CSPICE version.
Icy Version 1.0.0, 16JUN2003, EDW (JPL)
convert units
