sexagesimal

Alberto Micol Alberto.Micol at eso.org
Sat Sep 16 16:38:30 PDT 2006


Williams:
>
> Examples of valid IVOA sexagsimal positions, these parse to the  
> same thing:
> 5h 23m 0s, 35d 12m 23.23s
> 5h 23m 0s, 35°  12' 23.23"
> 5 23 0 35 12 23.22
> 5 23 0 35 +12 23.22
> 5dfds23,,,    ,,,,0;;;;;35kjdshhgf-12,    23.22
>
>
> California Institute of Technology
> 626 395 3670
>

Seaman:
> Not all sexigesimal values have three fields, many have two fields,  
> hh:mm.mmm, for instance.

Let me suggest the following 2 definitions:

1.- A (one) sexagesimal number is a sequence of up to 3 (minimum 1)  
groups of numbers
separated (followed) by an indefinite number of whatever characters  
except 0-9 + -
Only one group, ***the last one***, can be a float.
If none of the groups is a float, the sequence must contain 3 groups.
Only one group, the first one, can have a sign (+-).
The second and third groups are base-60.

2.- A pair of sexagesimal numbers is a sequence of two sexagesimal  
numbers.

The parser for this is quite easy to write (see perl attachement).

> We can allow the minutes to be float, but ask IRAF to add seconds:  
> hh:mm.mmm:00.
> There could be a translation in the XML to add the :00.

No need to support very weird and unused forms (hh:mm.mmm:00).
My definition allows only the last group to be float!

You'll get an error if you try my perl code:

%  sexagesimal.pl "12h 53.22m 00s"

While it works fine with:

%  sexagesimal.pl  "+2<sup>o</sup>:45.<sup>m</sup>"


Though, both Roy's and my definitions could be quite misleading:

%  sexagesimal.pl  "+2E2<sup>o</sup>:45.<sup>m</sup>"

returns: 2:2:45.   (2E2 != 200)

Alberto

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sexagesimal.pl
Type: text/x-perl-script
Size: 3695 bytes
Desc: not available
URL: <http://www.ivoa.net/pipermail/dm/attachments/20060917/79d1a804/attachment-0001.bin>
-------------- next part --------------







More information about the dm mailing list