image_xpaset
- sherpa.astro.ui.image_xpaset(arg: str, data: str | bytes | None = None) None
Return the result of an XPA call to the image viewer.
Send a command to the image viewer.
- Parameters:
- arg
str A command to send to the image viewer via XPA.
- data
optional The data for the command.
- arg
- Raises:
sherpa.utils.err.DS9ErrThe image viewer is not running.
sherpa.utils.err.RuntimeErrIf the command is not recognized or could not be completed.
See also
image_closeClose the image viewer.
image_getregionReturn the region defined in the image viewer.
image_openCreate the image viewer.
image_setregionSet the region to display in the image viewer.
image_xpasetSend an XPA command to the image viewer.
Notes
The XPA access point of the ds9 image viewer lets commands and queries to be sent to the viewer.
Examples
Change the zoom setting of the active frame:
>>> image_xpaset('zoom 4')
Overlay the coordinate grid on the current frame:
>>> image_xpaset('grid yes')
Add the region file ‘src.reg’ to the display:
>>> image_xpaset('regions src.reg')
Create a png version of the image being displayed:
>>> image_xpaset('saveimage png /tmp/img.png')