DS9 Reference Manual
Table of Contents

XPA Access Points

The XPA messaging system provides seamless communication between DS9 and other Unix programs, including X programs, Pearl, and Tcl/Tk. It also provides an easy way for users to communicate with DS9 by executing XPA client commands in the shell or by utilizing such commands in scripts. Because XPA works both at the programming level and the shell level, it is a powerful tool for unifying any analysis environment.

about

Get DS9 credits.
Syntax:
about
Example:
$xpaget ds9 about

analysis

Control external analysis tasks. Tasks are numbered as they are loaded, starting with 1. Can also be used to display a message and display text in the text dialog window. To plot data, use the plot xpa point. Current tasks can be cleared via the clear command and new tasks can be loaded via the load command.
Syntax:
analysis [<task number>]
         [clear]
         [clear][load <filename>]
         [message ok|okcancel|yesno {<message>}
         [entry {<message>}]
         [text]

Example:
$xpaget ds9 analysis
$xpaset -p ds9 analysis 0 # invoke first analysis task
$xpaset -p ds9 analysis clear
$xpaset -p ds9 analysis load my.analysis
$xpaset -p ds9 analysis clear load my.analysis
$xpaset -p ds9 analysis message ok '{This is a test}'
$xpaget ds9 analysis entry '{Please enter something}'
$cat my.analysis | xpaset ds9 analysis load
$cat foo.txt | xpaset ds9 analysis text

array

Load raw data array from stdin. If new is specified, a new frame is created first, before loading.
Syntax:
array [new][[xdim=<x>,ydim=<y>|dim=<dim>],zdim=<z>,bitpix=<b>,[skip=<s>]]
array [new] rgb [[xdim=<x>,ydim=<y>|dim=<dim>],zdim=<z>,bitpix=<b>,[skip=<s>]]
Example:
$cat foo.arr | xpaset ds9 array [dim=512,bitpix=16]
$cat rgb.arr | xpaset ds9 array rgb [dim=200,zdim=3,bitpix=8]

bin

Controls binning factor, binning buffer size, and  binning function for binning FITS bin tables. The access point blocking is provided for backward compatibility.
Syntax:
bin [about <x> <y>]
    [buffersize <value>]
    [cols <x> <y>]
    [factor <value>]
    [depth <value>]
    [filter <string>]
    [function average|sum]
    [to fit]
    [smooth yes|no]
    [smooth function boxcar|tophat|gaussian]
    [smooth radius <value>]
Example:
$xpaget ds9 bin about
$xpaget ds9 bin buffersize
$xpaget ds9 bin cols
$xpaget ds9 bin factor
$xpaget ds9 bin depth
$xpaget ds9 bin filter
$xpaget ds9 bin function
$xpaget ds9 bin smooth
$xpaget ds9 bin smooth function
$xpaget ds9 bin smooth radius
$xpaset -p ds9 bin about 4096 4096
$xpaset -p ds9 bin buffersize 512
$xpaset -p ds9 bin cols detx dety
$xpaset -p ds9 bin factor 4
$xpaset -p ds9 bin depth 10
$xpaset -p ds9 bin filter '{pha > 5}'
$xpaset -p ds9 bin function sum
$xpaset -p ds9 bin to fit
$xpaset -p ds9 bin smooth yes
$xpaset -p ds9 bin smooth boxcar
$xpaset -p ds9 bin smooth radius 3

blink

Select Blink Display Mode
Syntax:
blink
Example:
$xpaget ds9 blink
$xpaset -p ds9 blink

cmap

Controls the colormap for the current frame. The colormap name is not case sensitive. A valid contrast value is  from 0 to 10 and bias value from 0 to 1.
Syntax:
cmap [<colormap>]
     [file <filename>]
     [invert yes|no]
     [value <constrast> <bias>]
Example:
$xpaget ds9 cmap
$xpaget ds9 cmap file
$xpaget ds9 cmap invert
$xpaget ds9 cmap value
$xpaset -p ds9 cmap Heat
$xpaset -p ds9 cmap file foo.sao
$xpaset -p ds9 cmap invert yes
$xpaset -p ds9 cmap value 5 .5

contour

Controls contours in the current frame.
Syntax:
contour [yes|no]
        [copy]
        [paste <coordinate system> [<sky frame>] <color> <width>]
        [load <filename> <coordinate system> [<sky frame>] <color> <width>]
        [save <filename> <coordinate system> [<sky frame>]]
Example:
$xpaget ds9 contour
$xpaset -p ds9 contour yes
$xpaset -p ds9 contour copy
$xpaset -p ds9 contour paste wc fk4 red 2
$xpaset -p ds9 contour load foo.con wcs fk5 yellow 2
$xpaset -p ds9 contour save foo.con wc fk5

crosshair

Controls the current position of the crosshair in the current frame. DS9 is placed in crosshair mode when the crosshair is set.
Syntax:
crosshair [x y <coordinate system> [<sky frame>][<sky format>]]
Example:
$xpaget ds9 crosshair # get crosshair in physical coords
$xpaget ds9 crosshair wcs fk4 sexagesimal # get crosshair in wcs coords
$xpaset -p ds9 crosshair 100 100 physical # set crosshair in physical
$xpaset -p ds9 crosshair 345 58.8 wcs fk5 # set crosshair in wcs coords
$xpaset -p ds9 crosshair 23:01:00 +58:52:51 wcs fk5

cursor

Move mouse pointer or crosshair in image pixels in the current frame. Note, this will move selected Regions also.
Syntax:
cursor [x y]
Example:
$xpaset -p ds9 cursor 10 10

datacube

Controls FITS datacube.
Syntax:
datacube [play|stop|next|prev|first|last]
         [#]
         [interval #]
Example:
$xpaget ds9 datacube
$xpaget ds9 datacube interval
$xpaset -p ds9 datacube play
$xpaset -p ds9 datacube last
$xpaset -p ds9 datacube 3
$xpaset -p ds9 datacube interval 2

dss

Support for Digital Sky Survey. The first three options will download an image based on the name or specified fk5 coordinate. The remaining options are used to configure downloads.
Syntax:
dss [<object>]
    [name <object>]
    [coordinate <ra> <dec>] # in wcs fk5

    [server sao|stsci|eso]
    [survey dss|dss2red|dss2blue]
    [size <width> <height>] # in arcmin

Example:
$xpaget ds9 dss name
$xpaget ds9 dss coord
$xpaget ds9 dss server
$xpaget ds9 dss survey
$xpaget ds9 dss size
$xpaset -p ds9 dss m31
$xpaset -p ds9 dss name m31
$xpaset -p ds9 dss coord 00:42:44.404 +41:16:08.78
$xpaset -p ds9 dss server eso
$xpaset -p ds9 dss survey dss2red
$xpaset -p ds9 dss size 10 10

exit

Exit DS9.
Syntax:
exit
Example:
$xpaset -p ds9 exit

file

Load a FITS image, FITS Mosaic image(s), or array from a file into the current frame, or return the current file name(s) loaded for the current frame.
Syntax:
file [new][<filename>]
     [new][fits <filename>]
     [new][medatacube <filename>]

     [new][mosaicimageiraf <filename>]
     [new][mosaiciraf <filename>]
     [new][mosaicimagewcs <filename>]
     [new][mosaicwcs <filename>]
     [new][mosaicimagewfpc2 <filename>]
     [new][rgbcube <filename>]
     [new][rgbimage <filename>]
     [new][rgbarray <filename>[[xdim=<x>,ydim=<y>|dim=<dim>],zdim=<z>,bitpix=<b>,[skip=<s>]]]
     [new][array <filename>[[xdim=<x>,ydim=<y>|dim=<dim>],zdim=<z>,bitpix=<b>,[skip=<s>]]]
     [new][url <url>]
     [save <filename>]
     [save gz <filename>]
     [save resample <filename>]
     [save resample gz <filename>]
Example:
$xpaget ds9 file
$xpaset -p ds9 file foo.fits
$xpaset -p ds9 file fits foo.fits
$xpaset -p ds9 file medatacube foo.fits

$xpaset -p ds9 file mosaicimageiraf bar.fits
$xpaset -p ds9 file mosaiciraf foo.fits
$xpaset -p ds9 file mosaicimagewcs bar.fits
$xpaset -p ds9 file mosaicwcs foo.fits
$xpaset -p ds9 file mosaicimagewfpc2 hst.fits
$xpaset -p ds9 file rgbcube rgb.fits
$xpaset -p ds9 file rgbimage rgb.fits
$xpaset -p ds9 file rgbarray rgb.arr[dim=200,zdim=3,bitpix=8]
$xpaset -p ds9 file array array.arr[dim=512,bitpix=-32]
$xpaset -p ds9 file url 'ftp://foo.bar.edu/img.fits'
$xpaset -p ds9 file save foo.fits # save the current frame as FITS Image
$xpaset -p ds9 file save gz foo.fits.gz # save as compressed FITS Image
$xpaset -p ds9 file save resample foo.fits # save current pan/zoom/rotate as FITS Image
$xpaset -p ds9 file save resample gz foo.fits.gz # save as compressed FITS Image

fits

Load a FITS image from stdin into the current frame. Options can include the FITS extension or binning instructions. xpaget returns the FITS image in the current frame. If new is specified, a new frame is created before loading.
Syntax:
fits [type|image|table|resample] [gz]
     [new][<options>]
     [new][medatacube <options>]
     [new][mosaicimageiraf <options>]
     [new][mosaiciraf <options>]
     [new][mosaicimagewcs <options>]
     [new][mosaicwcs <options>]
     [new][mosaicimagewfpc2 <options>]
     [new][rgbcube <options>]
     [new][rgbimage <options>]

     [save resample gz <filename>]
Example:
$xpaget ds9 fits > foo.fits
$xpaget ds9 fits type
$xpaget ds9 fits image > foo.fits
$xpaget ds9 fits image gz > foo.fits.gz
$xpaget ds9 fits table > bar.fits
$xpaget ds9 fits table gz > bar.fits.gz
$xpaget ds9 fits resample > bar.fits
$xpaget ds9 fits resample gz > bar.fits.gz
$cat foo.fits | xpaset ds9 fits
$cat abc.fits | xpaset ds9 fits [2]
$cat bar.fits | xpaset ds9 fits new [bin=detx,dety]
$cat foo.fits | xpaset ds9 fits medatacube

$cat bar.fits | xpaset ds9 fits mosaicimageiraf
$cat bar.fits | xpaset ds9 fits mosaiciraf
$cat bar.fits | xpaset ds9 fits mosaicimagewcs
$cat bar.fits | xpaset ds9 fits mosaicwcs
$cat hst.fits | xpaset ds9 fits mosaicimagewfpc2
$cat rgb.fits | xpaset ds9 fits rgbcube
$cat rgb.fits | xpaset ds9 fits rgbimage

frame

Controls frame functions. Frames may be created, deleted, reset, and centered. While return the current frame number. If you goto a frame that does not exists, it will be created. If the frame is hidden, it will be shown. The 'frameno' option is available for backward compatibility.
Syntax:
frame [center [#|all]]
      [clear [#|all]]
      [new [rgb]]
      [delete [#|all]]
      [reset [#|all]]
      [refresh [#|all]]

      [hide [#|all]]
      [show [#|all]]

      [first]
      [next]
      [prev]
      [last]
      [frameno #]

      [#]
Example:
$xpaget ds9 frame # returns the id of the current frame
$xpaget ds9 frame frameno # returns the id of the current frame
$xpaget ds9 frame all # returns the id of all frames
$xpaget ds9 frame active # returns the id of all active frames
$xpaset -p ds9 frame center # center current frame
$xpaset -p ds9 frame center 1 # center 'Frame1'
$xpaset -p ds9 frame center all # center all frames
$xpaset -p ds9 frame clear # clear current frame
$xpaset -p ds9 frame new # create new frame
$xpaset -p ds9 frame new rgb # create new rgb frame
$xpaset -p ds9 frame delete # delete current frame
$xpaset -p ds9 frame reset # reset current frame
$xpaset -p ds9 frame refresh # refresh current frame
$xpaset -p ds9 frame hide # hide current frame
$xpaset -p ds9 frame show 1 # show frame 'Frame1'
$xpaset -p ds9 frame first # goto first frame
$xpaset -p ds9 frame next # goto next frame
$xpaset -p ds9 frame prev # goto prev frame
$xpaset -p ds9 frame last # goto last frame
$xpaset -p ds9 frame frameno 4 # goto frame 'Frame4', create if needed
$xpaset -p ds9 frame 3 # goto frame 'Frame3', create if needed

grid

Controls coordinate grid.
Syntax:
grid [yes|no]
     [load <filename>]
     [save <filename>]
     [system <coordinate system>]
     [sky <sky frame>]
     [skyformat <skyformat>]
     [type analysis|publication]
     [type axes interior|exterior]
     [type numerics interior|exterior]
     [view grid|axes|title|border|vertical yes|no]
     [view axes numbers|tickmarks|label yes|no]
Example:
$xpaget ds9 grid
$xpaget ds9 grid system
$xpaget ds9 grid sky
$xpaget ds9 grid skyformat
$xpaget ds9 grid type
$xpaget ds9 grid type axes
$xpaget ds9 grid type numerics
$xpaget ds9 grid view grid
$xpaget ds9 grid view axes
$xpaget ds9 grid view axes numbers
$xpaget ds9 grid view axes tickmarks
$xpaget ds9 grid view axes label
$xpaget ds9 grid view title
$xpaget ds9 grid view border
$xpaget ds9 grid view vertical
$xpaset -p ds9 grid yes
$xpaset -p ds9 grid load foo.grd
$xpaset -p ds9 grid save foo.grd
$xpaset -p ds9 grid system wcs
$xpaset -p ds9 grid sky fk5
$xpaset -p ds9 grid skyformat degrees
$xpaset -p ds9 grid type analysis
$xpaset -p ds9 grid type axes interior
$xpaset -p ds9 grid type numerics interior
$xpaset -p ds9 grid view grid yes
$xpaset -p ds9 grid view axes yes
$xpaset -p ds9 grid view axes numbers yes
$xpaset -p ds9 grid view axes tickmarks yes
$xpaset -p ds9 grid view axes label yes
$xpaset -p ds9 grid view title yes
$xpaset -p ds9 grid view border yes
$xpaset -p ds9 grid view vertical no

iconify

Toggles iconification.
Syntax:
iconify [yes|no]
Example:
$xpaget ds9 iconify
$xpaset -p ds9 iconify yes

iis

Set/Get IIS Filename.
Syntax:
iis [filename <filename> [#]]
Example:
$xpaget ds9 iis filename
$xpaget ds9 iis filename 4
$xpaset -p ds9 iis filename foo.fits
$xpaset -p ds9 iis filename bar.fits 4

lock

Lock frames.
Syntax:
lock [crosshairs none|wcs|wcsa...wcsz|physical|image]
Example:
$xpaset -p ds9 lock crosshairs wcs

lower

Will lower ds9 in the window stacking order.
Syntax:
lower
Example:
$xpaset -p ds9 lower

match

Match all other frames to the current frame.
Syntax:
match [frames wcs|physical|image]
      [colorbars]
      [scales]
Example:
$xpaset -p ds9 match frames wcs
$xpaset -p ds9 match colorbars
$xpaset -p ds9 match scales

minmax

This is how DS9 determines  the min and max data values from the data. SCAN will scan all data. SAMPLE will sample the data every n samples. DATAMIN and IRAFMIN will use the values of the keywords if present. In general, it is recommended to use SCAN unless your computer is slow or your data files are very large. Select the increment  interval for determining the min and max data values during sampling. The larger the interval, the quicker the process.
Syntax:
minmax [scan|sample|datamin|irafmin]
       [mode scan|sample|datamin|irafmin]
       [interval <value>]
Example:
$xpaget ds9 minmax mode
$xpaget ds9 minmax interval
$xpaset -p ds9 minmax scan
$xpaset -p ds9 minmax mode sample
$xpaset -p ds9 minmax interval 10

mode

Controls the first mouse button mode.
Syntax:
mode [pointer|crosshair|colorbar|pan|zoom|rotate|examine]
Example:
$xpaget ds9 mode
$xpaset -p ds9 mode crosshair

nameserver

Support Name Server functions. Coordinates are in fk5.
Syntax:
nameserver [<object>]
           [name <object>]
           [server ned-sao|ned-eso|simbad-sao|simbad-eso]
           [skyformat degrees|sexagesimal]

Example:
$xpaget ds9 nameserver server
$xpaget ds9 nameserver skyformat
$xpaset -p ds9 nameserver m31
$xpaset -p ds9 nameserver name m31
$xpaset -p ds9 nameserver server ned-sao
$xpaset -p ds9 nameserver skyformat sexagesimal

orient

Controls the orientation of the current frame.
Syntax:
orient [none|x|y|xy]
Example:
$xpaget ds9 orient
$xpaset -p ds9 orient xy

page setup

Controls Page Setup options.
Syntax:
page setup [orientation portrait|landscape]
           [pagescale scaled|fixed]
           [pagesize letter|legal|tabloid|poster|a4]
Example:
$xpaget ds9 page setup orientation
$xpaget ds9 page setup pagescale
$xpaget ds9 page setup pagesize
$xpaset -p ds9 page setup orientation portrait
$xpaset -p ds9 page setup pagescale scaled
$xpaset -p ds9 page setup pagesize poster

pan

Controls the current image cursor location for the current frame.
Syntax:
pan [x y <coordinate system> [<sky frame>][<sky format>]]
    [to x y <coordinate system> [sky frame>][<sky format>]
Example:
$xpaget ds9 pan # get current image coords
$xpaget ds9 pan wcs fk4 sexagesimal # get current wcs coords
$xpaset -p ds9 pan 200 200 image # pan relative
$xpaset -p ds9 pan to 400 400 physical # pan to physical coords
$xpaset -p ds9 pan to 13:29:55 47:11:50 wcs fk5 # pan to wcs coords

pixeltable

Display/Hide the pixel table.
Syntax:
pixeltable [yes|no]
Example:
$xpaget ds9 pixeltable
$xpaset -p ds9 pixeltable yes

plot

Display and configure data plots. All plot commands take an optional second command, the plot name. Use xpaget plot to retreive all plot names. If no plot name is specified, the last plot created is assumed. Plot data is assumed to be a pair of coordinates, with optional error values. The follow are valid data descriptions:
xy        x and y coordinates
xyex      x,y coordinates with x errors
xyey      x,y coordinates with y errors
xyexey    x,y coordinates with both x and y errors
To create a new plot, use the plot new command. If the second arg is stdin, the title, x axis title, y axis title, and dimension are assumed to be on the first line of the data.

Syntax:
plot [new]
     [new stdin]
     [new <title> <xaxis label> <yaxis label>  xy|xyex|xyey|xyexey]

plot [<plotname>] [load <filename> xy|xyex|xyey|xyexey]
     
[<plotname>] [save <filename>]
     
[<plotname>] [clear]
     
[<plotname>] [loadconfig <filename>]
     
[<plotname>] [saveconfig <filename>]
     
[<plotname>] [print]
     [<plotname>] [
print destination printer|file]
     [<plotname>] [print command <command>]
     [<plotname>] [print filename <filename>]
     [<plotname>] [print palette rgb|cmyk|gray]
     [<plotname>] [page orientation portrait|landscape]
     [<plotname>] [page pagescale scaled|fixed]
     [<plotname>] [page pagesize letter|legal|tabloid|poster|a4]
     
[<plotname>] [close]

     
[<plotname>] [graph grid yes|no]
     
[<plotname>] [graph scale linearlinear|linearlog|loglinear|loglog]
     [<plotname>] [graph range x|y auto yes|no]
     [<plotname>] [graph range x|y min <value>]
     [<plotname>] [graph range x|y max <value>]
     [<plotname>] [graph labels title|xaxis|yaxis <value>]

     [<plotname>] [font numbers|labels|title font times|helvetica|symbol|courier]
     [<plotname>] [font numbers|labels|title size <value>]
     [<plotname>] [font numbers|labels|title style plain|bold|italic]

     [<plotname>] [dataset #]

     
[<plotname>] [view discrete|line|step|quadratic|errorbar yes|no]

     
[<plotname>] [color discrete|line|step|quadratic|errorbar <color>]

     
[<plotname>] [line discrete circle|diamond|plus|cross]
     [<plotname>] [line line|step|quadratic|errorbar width <value>]
     [<plotname>] [line line|step|quadratic dash yes|no]
     [<plotname>] [line errorbar style yes|no]

Example:
$xpaget ds9 plot # return all plotnames

$xpaset -p ds9 plot new # empty plot widget
cat foo.dat | $xpaset ds9 plot new stdin # data file contains title and dimension
cat bar.dat | $xpaset ds9 plot new "The Title" "X" "Y" xy  # xy plot with titles

$xpaset -p ds9 plot ap1 close # close plot named 'ap1'

$xpaset -p ds9
plot load foo.dat xy # load new dataset with dimension xy
$xpaset -p ds9
plot save bar.dat # save current dataset
$xpaset -p ds9 plot clear # clear all datasets
$xpaset -p ds9 plot loadconfig foo.plt # load plot configuration
$xpaset -p ds9 plot saveconfig bar.plt # save current plot configuration
$xpaset -p ds9 plot print
$xpaset -p ds9
plot print destination file
$xpaset -p ds9 plot print command "lp"
$xpaset -p ds9 plot print filename "foo.ps"
$xpaset -p ds9 plot print palette rgb
$xpaset -p ds9 plot page orientation portrait
$xpaset -p ds9 plot page pagescale scaled
$xpaset -p ds9 plot pages pagesize letter
$xpaset -p ds9 plot close # close last plot

$xpaset -p ds9 plot graph grid yes
$xpaset -p ds9 plot graph scale loglog
$xpaset -p ds9 plot graph range x auto yes
$xpaset -p ds9 plot graph range x min 0
$xpaset -p ds9
plot graph range x max 100
$xpaset -p ds9
plot graph range y auto yes
$xpaset -p ds9
plot graph labels title "The Title"
$xpaset -p ds9
plot graph labels xaxis "X"
$xpaset -p ds9 plot graph labels yaxis "Y"

$xpaset -p ds9
plot font numbers font times
$xpaset -p ds9
plot font numbers size 12
$xpaset -p ds9
plot font numbers stype bold
$xpaset -p ds9 plot font labels font times
$xpaset -p ds9 plot font title font times

$xpaset -p ds9
plot dataset 2 # set current dataset to the second dataset loaded

$xpaset -p ds9 plot view discrete yes # current dataset

$xpaset -p ds9 plot color discrete red # current dataset

$xpaset -p ds9 plot line discrete cross # current dataset
$xpaset -p ds9
plot line step width 2 # current dataset
$xpaset -p ds9 plot line step dash yes # current dataset
$xpaset -p ds9
plot line errorbar style no # current dataset

prefs

Controls various preference settings.
Syntax:
prefs [mosaicfast yes|no]
Example:
$xpaget ds9 prefs mosaicfast no

print

Controls printing. Use print option to set printing options. Use print to actually print.
Syntax:
print [destination printer|file]
      [command <command>]
      [filename <filename>]
      [palette rgb|cmyk|gray]
      [level 1|2]
      [interpolate yes|no]
      [resolution 53|72|75|150|300|600]
Example:
$xpaget ds9 print destination
$xpaget ds9 print command
$xpaget ds9 print filename
$xpaget ds9 print palette
$xpaget ds9 print level
$xpaget ds9 print interpolate
$xpaget ds9 print resolution
$xpaset -p ds9 print
$xpaset -p ds9 print destination file
$xpaset -p ds9 print command '{gv -}'
$xpaset -p ds9 print filename foo.ps
$xpaset -p ds9 print palette cmyk
$xpaset -p ds9 print level 2
$xpaset -p ds9 print interpolate no
$xpaset -p ds9 print resolution 75

quit

Exit DS9.
Syntax:
quit
Example:
$xpaset -p ds9 quit

raise

Will raise ds9 in the window stacking order.
Syntax:
raise
Example:
$xpaset -p ds9 raise

regions

Controls regions in the current frame.
Syntax:
regions [fg|bg] [move front]
        [fg|bg] [move back]
        [fg|bg] [select all]
        [fg|bg] [select none]
        [fg|bg] [select group <groupname>]
        [fg|bg] [delete all]
        [fg|bg] [delect select]
        [fg|bg] [load <filename>]
        [fg|bg] [save <filename>]
        [format]
        [-format ds9|ciao|saotng|saoimage|pros|xy]
        [system]
        [-system image|physical|wcs|wcsa...wcsz]
        [sky]
        [-sky fk4|fk5|icrs|galactic|ecliptic]
        [skyformat]
        [-skyformat degrees|sexagesimal]
        [strip]
        [-strip yes|no]
        [shape <shape>]
        [color white|black|red|green|blue|cyan|magenta|yellow]
        [width <width>]
        [fg|bg] [include|exclude|source|background|selected]
        [fg|bg] [-prop select|edit|move|rotate|delete|fixed|include|source 1|0]
        [fg|bg] [groups]
        [fg|bg] [-group <tag>]
Example:
$xpaget ds9 regions
$xpaget ds9 regions bg
$xpaget ds9 regions -format ds9 -coord wcs -sky fk5 -skyformat sexagesimal -prop edit 1 -group foo
$xpaget ds9 regions format
$xpaget ds9 regions system
$xpaget ds9 regions sky
$xpaget ds9 regions skyformat
$xpaget ds9 regions strip
$xpaget ds9 regions shape
$xpaget ds9 regions color
$xpaget ds9 regions width
$xpaget ds9 regions source
$xpaget ds9 regions background
$xpaget ds9 regions include
$xpaget ds9 regions exclude
$xpaget ds9 regions selected
$xpaget ds9 regions groups
$echo "image; circle 100 100 20" | xpaset ds9 regions
$echo "image; circle 100 100 20" | xpaset ds9 regions bg
$echo "fk5; circle 13:29:55 47:11:50 .5'" | xpaset ds9 regions
$echo "physical; ellipse 100 100 20 40" | xpaset ds9 regions
$echo "box 100 100 20 40 25" | xpaset ds9 regions
$echo "image; line 100 100 200 400" | xpaset ds9 regions
$echo "physical; ruler 200 300 200 400" | xpaset ds9 regions
$echo "image; text 100 100 # text={Hello, World}" | xpaset ds9 regions
$echo "fk4; boxcircle point 13:29:55 47:11:50" | xpaset ds9 regions
$xpaset -p ds9 regions move back
$xpaset -p ds9 regions move front
$xpaset -p ds9 regions select all
$xpaset -p ds9 regions select none
$xpaset -p ds9 regions select group foo
$xpaset -p ds9 regions delete all

$xpaset -p ds9 regions delete select
$xpaset -p ds9 regions load foo.reg
$xpaset -p ds9 regions load regions.fits
$xpaset -p ds9 regions save foo.reg
$xpaset -p ds9 regions format ds9
$xpaset -p ds9 regions system wcs
$xpaset -p ds9 regions sky fk5
$xpaset -p ds9 regions skyformat degrees
$xpaset -p ds9 regions strip yes
$xpaset -p ds9 regions shape ellipse
$xpaset -p ds9 regions color red
$xpaset -p ds9 regions width 3

rgb

Create RGB frame and control RGB frame parameters.
Syntax:
rgb
 # empty
     [red|green|blue]
     [channel [red|green|blue]]
     [view [red|green|blue] [yes|no]]
     [system <coordinate system>]
     [lock scale|bin [yes|no]]

Example:
$xpaset -p ds9 rgb # create new rgb frame
$xpaset -p ds9 rgb red # set current channel to red
$
xpaset -p ds9 rgb channel red # set current channel to red
$xpaset -p ds9 rgb view blue no # turn off blue channel
$
xpaset -p ds9 rgb system wcs # set rgb coordinate system
$xpaset -p ds9 rgb lock scale yes # lock rgb channels for scaling
$xpaset -p ds9 rgb lock bin yes # lock rgb channels for binning

rotate

Controls the rotation angle (in degrees) of the current frame.
Syntax:
rotate [<value>]
       [to <value>]
Example:
$xpaget ds9 rotate
$xpaset -p ds9 rotate 45
$xpaset -p ds9 rotate to 30

saveas

Save image, with regions, contours and coordinate grids as raster image. Currently, the follow formats are supported: JPEG, TIFF, PGN, PPM.Please Note: Ghostscript is required for support of this feature. gs must be in your path for this function to work properly. If DS9 is unable to locate gs, an error message will be generated.
Syntax:
saveas [jpeg|tiff|png|ppm <filename>]
Example:
$xpaset -p ds9 saveas jpeg foo.jpg

scale

Controls the limits, color scale distribution, and use of DATASEC keyword.
Syntax:
scale [linear|log|squared|sqrt|histequ]
      [datasec yes|no]
      [limits <minvalue> <maxvalue>]
      [mode minmax|<value>|zscale|zmax]
      [scope local|global]
Example:
$xpaget ds9 scale
$xpaget ds9 scale datasec
$xpaget ds9 scale limits
$xpaget ds9 scale mode
$xpaget ds9 scale scope
$xpaset -p ds9 scale datasec yes
$xpaset -p ds9 scale histequ
$xpaset -p ds9 scale limits 1 100
$xpaset -p ds9 scale mode zscale
$xpaset -p ds9 scale mode 99.5
$xpaset -p ds9 scale scope local

shm

Load a shared memory segment into the current frame. id is the shared memory id, size is the size of the segment  in bytes. NOTE: unlike older versions of ds9, the size parameter is no longer needed.
Syntax:
shm [<key> [<filename>]]
    [key <key> [<filename>]]
    [shmid <id> [<filename>]]
    [array [key|shmid] <id> [xdim=<x>,ydim=<y>|dim=<dim>],bitpix=<b>,[skip=<s>]]
    [mosaicimageiraf [key|shmid] <id> [<filename>]]
    [mosaiciraf [key|shmid] <id> [<filename>]]
    [mosaicwcs [key|shmid] <id> [<filename>]]
    [mosaicimagewfpc2 [key|shmid] <id> [<filename>]]
    [rgbimage [key|shmid] <id> [<filename>]]
    [rgbcube [key|shmid] <id> [<filename>]
    [startload|finishload]

Example:
$xpaget ds9 shm
$xpaset -p ds9 shm 102
$xpaset -p ds9 shm shmid 102 foo[2]
$xpaset -p ds9 shm array shmid 102 [dim=32,bitpix=-32]
$
xpaset -p ds9 shm mosaicimageiraf key 100 foo
$xpaset -p ds9 shm mosaiciraf key 100 foo
$
xpaset -p ds9 shm mosaicimagewcs key 100 foo
$
xpaset -p ds9 shm mosaiciraf key 100 foo
$
xpaset -p ds9 shm mosaicimagewfpc2 key 100 foo
$
xpaset -p ds9 shm rgbimage key 100 foo
$xpaset -p ds9 shm rgbcube key 100 foo
$xpaset -p ds9 shm startload # start a multiple load sequence without updating the display
$xpaset -p ds9 shm finishload # finish multiple load sequence

single

Select Single Display mode
Syntax:
single
Example:
$xpaget ds9 single
$xpaset -p ds9 single
 

source

Source tcl code from a file.
Syntax:
source [filename]
Example:
$xpaset -p ds9 source foo.tcl

tcl

Execute one tcl command
Syntax:
tcl [<tcl command>]
Example:
$echo 'puts "Hello, World"' | xpaset ds9 tcl

tile

Controls the tile display mode.
Syntax:
tile [yes|no]
     [mode grid|column|row]
     [grid]
     [grid mode [automatic|manual]]
     [grid layout <row> <col>]
     [grid gap <pixels>]
     [row]
     [column]
Example:
$xpaget ds9 tile
$xpaget ds9 tile mode
$xpaget ds9 tile grid mode
$xpaget ds9 tile grid layout
$xpaget ds9 tile grid gap
$xpaset -p ds9 tile
$xpaset -p ds9 tile mode row
$xpaset -p ds9 tile grid
$xpaset -p ds9 tile grid mode manual
$xpaset -p ds9 tile grid layout 5 5
$xpaset -p ds9 tile grid gap 10
$xpaset -p ds9 tile row
$xpaset -p ds9 tile column

update

Updates the current frame or region of frame. In the second form, the first argument is the number of the fits HDU (starting with 1) and the remaining args are a bounding box in IMAGE coordinates. By default, the screen is updated the next available idle cycle. However, you may force an immediate update by specifying the NOW option.
Syntax:
update []
       [# x1 y1 x2 y2]
       [now]
       [now # x1 y1 x2 y2]
       [on]
       [off]

Example:
$xpaset -p ds9 update
$xpaset -p ds9 update 1 100 100 300 400
$xpaset -p ds9 update now
$xpaset -p ds9 update now 1 100 100 300 400
$xpaset -p ds9 update off # delay refreash of the screen while loading files
$xpaset -p ds9 update on # be sure to turn it on when you are finished loading

version

Returns the current version of DS9.
Syntax:
version
Example:
$xpaget ds9 version

view

Controls the GUI.
Syntax:
view  [info yes|no]
      [panner yes|no]
      [magnifier yes|no]
      [buttons yes|no]
      [colorbar yes|no]
      [horzgraph yes|no]
      [vertgraph yes|no]
      [image|physical|wcs|wcsa...wcsz yes|no]
      [red yes|no]
      [green yes|no]
      [blue yes|no]

Example:
$xpaget ds9 view info
$xpaget ds9 view horzgraph
$xpaget ds9 view wcsa
$xpaset -p ds9 view info no
$xpaset -p ds9 view horzgraph yes
$xpaset -p ds9 view wcsa yes
$xpaset -p ds9 view red yes
$xpaset -p ds9 view green no
$xpaset -p ds9 view blue yes

vo

Invoke an connection to a Virtual Observatory site.
Syntax:
vo <url>
Example:
$xpaget ds9 vo
$xpaset -p ds9 vo chandra-ed.havard.edu

wcs

Controls the World Coordinate System for the current frame. If the wcs system, skyframe, or skyformat is modified, the info panel, compass, grid, and alignment will be modified accordingly. Also, using this access point, a new WCS specification can be loaded and used by the current image regardless of the WCS that was contained in the image file. WCS specification can be sent to DS9 as an ASCII file . Please see WCS for more information.

Syntax:
wcs [wcs|wcsa...wcsz]
    [system wcs|wcsa...wcsz]
    [sky fk4|fk5|icrs|galactic|ecliptic]
    [skyformat degrees|sexagesimal]
    [align yes|no]
    [reset]
    [replace file <filename>]
    [append file <filename>]
    [replace]
    [append]
Example:
$xpaget ds9 wcs
$xpaget ds9 wcs system
$xpaget ds9 wcs sky
$xpaget ds9 wcs skyformat
$xpaget ds9 wcs align
$xpaset -p ds9 wcs wcs
$xpaset -p ds9 wcs system wcs
$xpaset -p ds9 wcs sky fk5
$xpaset -p ds9 wcs skyformat sexagesimal
$xpaset -p ds9 wcs align yes
$xpaset -p ds9 wcs reset
$xpaset -p ds9 wcs replace file foo.wcs
$xpaset -p ds9 wcs append file foo.wcs
$cat foo.wcs | xpaset ds9 wcs replace
$cat foo.wcs | xpaset ds9 wcs append
$echo "OBJECT = 'foobar'" | xpaset ds9 wcs append

web

Display specified URL in the web display.
Syntax:
web <url>
Example:
$xpaget ds9 web
$xpaset -p ds9 web <url>

zoom

Controls the current zoom value for the current frame.
Syntax:
zoom [<value>]
     [to <value>]
     [to fit]
Example:
$xpaget ds9 zoom
$xpaset -p ds9 zoom 2
$xpaset -p ds9 zoom to 4
$xpaset -p ds9 zoom to fit