[Last Change: 13 Feb 2012 (rev 4)]
Physical Quantities
Many of the parameters passed to the
Lua
SAOTrace
interface are
physical quantities, e.g. quantities that have
units. In some cases the parameters may be expressed without units and a default set of units will be implicitly assumed. When units are required, or when the default units are not suitable, it is possible to explicitly specify units.
Specifying units
To explicitly specify a unit, pass the parameter as a
Lua
list with two elements:
- A number
- A unit specification
Unit specifications are simply strings which contain an SI unit with an optional multiplicative prefix.
Either element in the list may be specified either as a literal quantity or as a variable, e.g.
position = { 3, "meter" }
n = 3
u = "meter"
position = { n, u }
Supported Quantities
Distances
Explicit units for both angular and linear distances are supported.
{ 3, "meter" }
{ 5, "degrees" }
{ 20, "arcseconds" }
{ 2, "parsecs" }
Time
Units of time are supported.
{ 2, "kiloseconds" }
Celestial Coordinates
Special support for conversion of celestial coordinates in sexagesimal units is provided where noted. The coordinates must be specified as a
Lua
string, and should have the following form:
where
H and
M are integers and
S may be a floating point number. The declination may have an optional sign prefixed to it. For example:
ra = '7:57:47.348'
dec = '-60:47:15.46'