set_coord¶
-
sherpa.astro.ui.
set_coord
(id, coord=None)¶ Set the coordinate system to use for image analysis.
The default coordinate system - that is, the mapping between pixel position and coordinate value, for images (2D data sets) is ‘logical’. This function can change this setting, so that model parameters can be fit using other systems. This setting is also used by the notice2d and ignore2d series of commands.
Parameters: - id (int or str) – The data set to change. If not given then the default identifier is used, as returned by get_default_id.
- coord ({ 'logical', 'image', 'physical', 'world', 'wcs' }) – The coordinate system to use. The ‘image’ option is the same as ‘logical’, and ‘wcs’ the same as ‘world’.
See also
get_coord()
- Get the coordinate system used for image analysis.
guess()
- Estimate the parameter values and ranges given the loaded data.
ignore2d()
- Exclude a spatial region from an image.
notice2d()
- Include a spatial region of an image.
Notes
The function does not follow the normal Python standards for parameter use, since it is designed for easy interactive use. When called with a single un-named argument, it is taken to be the coord parameter. If given two un-named arguments, then they are interpreted as the id and coord parameters, respectively.
Any limits or values already set for model parameters, such as those made by guess, may need to be changed after changing the coordinate system.
The ‘logical’ system is one in which the center of the lower-left pixel has coordinates
(1, 1)
and the center of the top-right pixel has coordinates(nx, ny)
, for anx
(columns) byny
(rows) pixel image. The pixels have a side of length 1, so the first pixel covers the rangex=0.5
tox=1.5
andy=0.5
toy=1.5
.The ‘physical’ and ‘world’ coordinate systems rely on FITS World Coordinate System (WCS) standard [1]. The ‘physical’ system refers to a linear transformation, with possible offset, of the ‘logical’ system. The ‘world’ system refers to the mapping to a celestial coordinate system.
References
[1] http://fits.gsfc.nasa.gov/fits_wcs.html Examples
Change the coordinate system of the default data set to the world system (‘wcs’ is a synonym for ‘world’).
>>> set_coord('wcs')
Change the data set with the id of ‘m82’ to use the physical coordinate system.
>>> set_coord('m82', 'physical')