idlastro / Astronomical Utilities: TEN

[Source code]

NAME
TEN()
PURPOSE
Converts a sexagesimal number or string to decimal.
EXPLANATION
Inverse of the SIXTY() function.
CALLING SEQUENCES
X = TEN( [ HOUR_OR_DEG, MIN, SEC ] )
X = TEN( HOUR_OR_DEG, MIN, SEC )
X = TEN( [ HOUR_OR_DEG, MIN ] )
X = TEN( HOUR_OR_DEG, MIN )
X = TEN( [ HOUR_OR_DEG ] )      <--  Trivial cases
X = TEN( HOUR_OR_DEG )          <--
or
 = TEN(HRMNSC_STRING)
INPUTS
HOUR_OR_DEG,MIN,SEC -- Scalars giving sexagesimal quantity in 
        in order from largest to smallest.    
                 or
C_STRING - String giving sexagesmal quantity separated by
       spaces, commas or colons e.g. "10 23 34" or "-3:23:45.2"
       Any negative values should begin with a minus sign.
OUTPUTS
Function value returned = double real scalar, decimal equivalent of
input sexigesimal quantity.  For numeric input, a minus sign on any 
ro element of the input vector causes all the elements to be taken 
0.
EXAMPLES
IDL> print,ten(0,-23,34)
          --> -0.39277778
IDL> print,ten("-0,23,34")
          --> -0.39277778
PROCEDURE
Mostly involves checking arguments and setting the sign.
The procedure TENV can be used when dealing with a vector of 
sexigesimal quantities.
MODIFICATION HISTORY
Written by R. S. Hill, STX, 21 April 87       
Modified to allow non-vector arguments.  RSH, STX, 19-OCT-87
nize -0.0   W. Landsman/B. Stecklum   Dec 2005
with string input  W. Landsman Dec 2008
t comma separator in string input W. Landsman May 2017