Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: coordsys.stokes - Function Up: coordsys - Tool Previous: coordsys.settelescope - Function


coordsys.setunits - Function



Package general
Module images
Tool coordsys


Set the axis units


Synopsis
setunits(value, type, overwrite, which)


Arguments

value in Units
    Allowed: Vector of strings
type in Which coordinate type ?
    Allowed: String from "direction", "stokes", "spectral", "linear", "tabular" or unset
    Default: All
overwrite in Overwrite linear or tabular coordinate units ?
    Allowed: Bool
    Default: F
which in Which coordinate if more than one of same type
    Allowed: Integer
    Default: First


Returns
T or fail



Description

Each axis associated with the Coordinate System has a unit. This function (short-hand name su) allows you to set new axis units.

You can set the units either for all axes (type=unset) or for just the axes associated with a particular coordinate type.

In general, the units must be consistent with the old units. When you change the units, the increment and reference value will be adjusted appropriately. However, for a linear or tabular coordinate, and only when you specify type='linear' or type='tabular' (i.e. you supply units only for the specified linear of tabular coordinate), and if you set overwrite=T, you can just overwrite the units with no further adjustments. Otherwise, the overwrite argument will be silently ignored. Use argument which to specify which coordinate if you have more than one of the specified type.

You can recover the current axis units with function units.



Example
- cs := coordsys(direction=T, spectral=T)
- cs.summary()
-
Direction reference : J2000
Spectral  reference : LSRK
Velocity  type      : RADIO
Rest frequency      : 1.42041e+09 Hz

Telescope        : ATCA
Observer         : Karl Jansky
Date observation : 2000/07/05/06:58:46

Axis Type      Name             Proj   Coord value at pixel    Coord incr Units
------------------------------------------------------------------------------- 
1    Direction Right Ascension   SIN  00:00:00.000     1.00 -6.000000e+01 arcsec
2    Direction Declination       SIN +00.00.00.000     1.00  6.000000e+01 arcsec
3    Spectral  Frequency              1.415000e+09     1.00  1.000000e+03 Hz
               Velocity               1.140944e+03     1.00 -2.110611e-01 km/s
-
- cs.setunits(value="deg rad mHz");
-
-
Direction reference : J2000
Spectral  reference : LSRK
Velocity  type      : RADIO
Rest frequency      : 1.42041e+12 mHz

Telescope        : ATCA
Observer         : Karl Jansky
Date observation : 2000/07/05/06:58:46

Axis Type      Name             Proj   Coord value at pixel    Coord incr Units
------------------------------------------------------------------------------- 
1    Direction Right Ascension   SIN  00:00:00.000     1.00 -6.000000e+01 arcsec
2    Direction Declination       SIN +00.00.00.000     1.00  6.000000e+01 arcsec
3    Spectral  Frequency              1.415000e+12     1.00  1.000000e+06 mHz
               Velocity               1.140944e+03     1.00 -2.110611e-01 km/s





next up previous contents index
Next: coordsys.stokes - Function Up: coordsys - Tool Previous: coordsys.settelescope - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01