|
|||
NRAO Home > CASA > CASA Toolkit Reference Manual |
|
coordsys.findaxisbyname - Function
1.1.3 Find specified axis in coordinate system.
Description
Find the world axis based on its name. Matching is not case sensitive and
minimal match is supported, eg ”dec” will match ”Declination”. In addition, if
allowfriendlyname is True, other common terms will match the expected axis.
Currently supported are: ”spectral” matches frequency type axes, eg
”Frequency” or ”Velocity”, ”ra” matches ”Right Ascension”. These names
must be spelled out completely; eg ”spectral” rather than simply ”spec”. The
first matching axis (zero-based) number is returned. If no axis can be matched,
an exception is thrown.
Arguments
Inputs |
| ||
axisname |
| Name of axis to find. Minimal match supported
| |
| allowed: | string |
|
| Default: |
| |
allowfriendlyname |
| Support friendly naming. Eg ”spectral” will match
”frequency” or ”velocity”, ”ra” will match ”right
ascension”
| |
| allowed: | bool |
|
| Default: | true |
|
int
Example
# Find the declination axis
ia.open("myimage")
csys = ia.coordsys()
ia.done()
try:
dec_axis_number = csys.findaxisbyname("dec", False)
except Exception
print "Declination axis not found
# find the spectral axis
try:
spec_axis_number = csys.findaxisbyname("spectral", True)
except Exception:
print "Spectral axis could not be found.
__________________________________________________________________
More information about CASA may be found at the
CASA web page
Copyright © 2016 Associated Universities Inc., Washington, D.C.
This code is available under the terms of the GNU General Public Lincense
Home |
Contact Us |
Directories |
Site Map |
Help |
Privacy Policy |
Search