Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | fitting | |
Tool | functionfitter |
csys | in | The Coordinate System | |
Allowed: | Coordsys tool | ||
axis | in | The axis of the Coordinate System that we are plotting | |
Allowed: | Integer | ||
Default: | 1 |
By default, when you set data into the Functionfitter tool (with functions setdata or setdatafromtable) a tabular Coordinate System is created internally. This maps between pixel index and the x world value (with units specified in the above function calls). This Coordinate System is used by the plotting function plot.
This function allows you to set a diffferent Coordinate System. For example, if the units of the x-data are frequency, then, rather than using the internal Tabular Coordinate System, you could set a Spectral Coordinate System and then you will be able to convert to and from velocity units with the plotting interface. You would need to correctly fill in the Spectral Coordinate System with funtions from the coordsys tool.
Note that at this point, the plotting interface has no impact on the x-space in which the fit is done. The fitting is always done in with the original x (abcissa) vector that you set.
- include 'functionfitter.g' - ff := functionfitter() - x := 1:10 - y := 3 + 2*x - ff.setdata (x,y) - ff.setfunction ('p0+p1*x') - ff.fit() - ff.plot() # Plots a linear axis - - include 'coordsys.g' - cs := coordsys(spectral=T) # Default spectral coordinate - ff.setcoordsys(cs) - ff.plot() # Plots a spectral axis with velocity conversions