Converts formatted sky co-ordinate values into double-precision values IRA_CTOD
Each input string can consist of a set of up to three " fields" . Each field starts with a numeric
value (which can have a fractional part) terminated by a character string. This character
string consists of an optional single character, called the terminator character, followed by
an arbitrary number of spaces The terminator character (if present) must be one of the
letters h,d,m,s or r. An h terminator indicates that the field value is in units of hours. A d
terminator indicates that the field value is in units of degrees. An r terminator indicates that
the field value is in units of radians. An m terminator indicates that the field value is in
units of minutes. An s terminator indicates that the field value is in units of seconds. The
interpretation of minutes and seconds depends on whether the value is a time value or an
angle value. The longitude value for equatorial sky co-ordinate systems (RA) is expected to
be a measure of time, all other co-ordinate values are expected to be a measure of angle.
These defaults are overriden if the first field is a " degrees" , " hours" or " radians" field
(as indicated by the presence of a d, h or r terminator character). The interpretation of
fields with no terminator character depends on which field is being considered. If the first
field has no terminator, it is assumed to be either a degrees or hours field. If the second
or third field has no terminator, it is assumed to be a seconds field if the previous field
was a minutes field, and a minutes field if the previous value was an hours or degrees
field.
In addition, an input string may contain a single field with no terminator character in an " encoded"
form. " Encoded" fields are identified by the fact that the field contains 5 or more digits to the left of
the decimal point (including leading zeros if necessary). These fields are decoded into hours or
degrees as follows: Any fractional part is taken as the fractional part of the seconds field,
the tens and units digits are taken as the integer part of the seconds field, the hundreds
and thousands digits are taken as the minutes fields, the remaining digits are taken as
the degrees or hours field. Thus -12345.4 would be interpreted as (- 1 hour 23 mins 45.4
seconds) or (- 1 degree 23 mins 45.4 seconds). The same value could also be specified as
1 23 45.5, -1h 23m 45.5s (if it represents a time value), or
1d 23 45.5 (if it represents an angular value).
The supplied values must be in their first order ranges (i.e. 0 to 2.PI for longitude values and -PI/2 to
PI/2 for
latitude values). Values outside these ranges cause an error to be reported, and the status
value IRA__RANGE is returned). The exception to this is if the string is prefixed with a "
" character,
in which case any numeric value may be supplied. In this case the supplied value is returned directly (e.g. if the
string "400D"
is given, the radian equivalent of 400 degrees will be returned, not 40 (=400-360) degrees). If either of the
input strings are blank the corresponding output value is set to the Starlink " BAD" value (VAL__BADD).
" BAD" value (VAL__BADD), but no error is reported. " BAD" value (VAL__BADD), but no error is reported. " Sky Coordinates" ). Any unambiguous
abbreviation will do.