|
|||
NRAO Home > CASA > CASA Toolkit Reference Manual |
|
coordsys.setincrement - Function
1.1.3 Set the increment
Description
Each axis associated with the Coordinate System has a reference value,
reference pixel and an increment (per pixel). These are used in the mapping
from pixel to world coordinate.
This function allows you to set a new increment. You should not do this on ”stokes” axes unless you are an adept or a big risk taker.
You can set the increments either for all axes (type=unset) or for just the axes associated with a particular coordinate type.
You may supply the increments in all of the formats described in the formatting discussion.
In addition, you can also supply the increments as a quantity of vector of doubles. For example qa.quantity([-1,2],’arcsec’).
You can recover the current increments with function increment.
Arguments
Inputs |
| ||
value |
| Increments | |
| allowed: | any |
|
| Default: | variant
|
|
type |
| Coordinate type: ”direction”, ”stokes”, ”spectral”,
”linear”, ”tabular”. Leave empty for all
| |
| allowed: | string |
|
| Default: |
|
|
bool
Example
"""
#
print "\t----\t setincrement Ex 1 \t----"
csys=cs.newcoordsys(direction=T, spectral=T)
rv = csys.increment(format=’q’)
print rv
# {’ar_type’: ’absolute’, ’pw_type’: ’world’,
# ’quantity’: {’*1’: {’value’: -1.0, ’unit’: "’"},
# ’*2’: {’value’: 1.0, ’unit’: "’"},
# ’*3’: {’value’: 1000.0, ’unit’: ’Hz’}}}
rv2 = qa.quantity(’4kHz’);
csys.setincrement(value=rv2, type=’spec’)
print csys.increment(type=’spec’, format=’q’)
#{’ar_type’: ’absolute’, ’pw_type’: ’world’,
# ’quantity’: {’*1’: {’value’: 4000.0, ’unit’: ’Hz’}}}
csys.setincrement(value=’5kHz’, type=’spec’)
print csys.increment(type=’spec’, format=’q’)
#{’ar_type’: ’absolute’, ’pw_type’: ’world’,
# ’quantity’: {’*1’: {’value’: 5000.0, ’unit’: ’Hz’}}}
print csys.increment(format=’q’)
#{’ar_type’: ’absolute’, ’pw_type’: ’world’,
# ’quantity’: {’*1’: {’value’: -1.0, ’unit’: "’"},
# ’*2’: {’value’: 1.0, ’unit’: "’"},
# ’*3’: {’value’: 5000.0, ’unit’: ’Hz’}}}
csys.setincrement (value="-2’ 2’ 2e4Hz")
print csys.increment(format=’q’)
#{’ar_type’: ’absolute’, ’pw_type’: ’world’,
# ’quantity’: {’*1’: {’value’: -2.0, ’unit’: "’"},
# ’*2’: {’value’: 2.0, ’unit’: "’"},
# ’*3’: {’value’: 20000.0, ’unit’: ’Hz’}}}
#
"""
In the example we first recover the increments as a vector of
quantities. We then create a quantity for a new value for the spectral
coordinate increment. Note we use units of kHz whereas the spectral
coordinate is currently expressed in units of Hz. We then set the
increment for the spectral coordinate. We then recover the increment
again; you can see 4kHz has been converted to 4000Hz. We also show
how to set the increment using a string interface.
__________________________________________________________________
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