Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1488 |
|
Package | general | |
Module | images | |
Tool | coordsys |
value | in | Reference value | |
Allowed: | Vector of doubles, vector of quantities, quantity of vector of doubles, vector of string, record | ||
type | in | Which coordinate type ? | |
Allowed: | String from "direction", "stokes", "spectral", "linear", "tabular" or unset | ||
Default: | All |
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 (short-hand name srv) allows you to set a new reference value. You should not do this on "stokes" axes unless you are an adept or a big risk taker.
You may supply the reference value in all of the formats described in the formatting discussion.
You can recover the current reference value with function referencevalue.
Note that the value argument should be one of the specified possibilitioes. Especially a measure will be accepted, but will have a null effect, due to the interpretation as a generic record.
- cs := coordsys(direction=T, spectral=T) - rv := cs.referencevalue(format='q') - rv [__*0=[value=0, unit='], __*1=[value=0, unit='], __*2=[value=1.415e+09, unit=Hz]] - - rv2 := rv[3]; - rv2.value := 2.0e9; - cs.setreferencevalue(type='spec', value=rv2) - cs.referencevalue(format='n') [0 0 2e+09]To set a new direction reference value, the easiest way, given a direction measure dr would be:
- cs.setreferencevalue(type='direction', value=dm.getvalue(dr))
In the example we first recover the reference value as a vector of quantities.
We then select out the value for the spectral coordinate, change it,
and set it back in the Coordinate System. We then recover the
reference value again, but this time just as a vector of doubles. In
the case of the dircetion, we set the value from a known direction measure.