[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:
  1. A number
  2. 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:
RA H:M:S
Dec [+-]D:M:S
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'
 
This page is maintained by the CXC Optics Group
CXC logo

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email: cxcweb@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2013. All rights reserved.