Command Line Options

DS9 will process each command line option, one at a time, as the last step in the initialization process. Therefore, it is possible to use command line options as a little script. For example, the following command line option is used:

$ds9 -tile foo.fits -cmap Heat -zscale bar.fits -cmap I8

First DS9 is put in tile mode, then foo.fits is loaded. Then the colormap for foo.fits is changed to Heat. Next, a new frame is created and bar.fits is loaded. And finally, the colormap for bar.fits is changed to I8.

blue

For RGB frames, sets the current color channel to blue.
Syntax:
-blue
Example:
$ds9 -blue foo.fits

datacube

Controls FITS datacube.
Syntax:
-datacube [play|stop|next|prev|first|last]
          [#]
          [interval #]
Example:
$ds9 -datacube play
$ds9 -datacube last
$ds9 -datacube 3
$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.

export

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:
$ds9 -frame center
$ds9 -frame center 1
$ds9 -frame center all
$ds9 -frame clear
$ds9 -frame new
$ds9 -frame new rgb
$ds9 -frame delete
$ds9 -frame reset
$ds9 -frame refresh
$ds9 -frame hide
$ds9 -frame show 1
$ds9 -frame first
$ds9 -frame next
$ds9 -frame prev
$ds9 -frame last
$ds9 -frame frameno 4
$ds9 -frame 3

green

For RGB frames, sets the current color channel to green.
Syntax:
-green
Example:
$ds9 -green foo.fits

medatacube

Load multiple extension FITS file as a data cube.
Syntax:
-medatacube
Example:
$ds9 -medatacube foo.fits

mosaicimageiraf

Load entire FITS IRAF Mosaic image composed of multiple extensions in one FITS file.  All extensions that are FITS Images and are valid FITS Mosaic Images will be loaded.
Syntax:
-mosaicimageiraf filename
Example:
$ds9 -mosaicimageiraf fourshooter.fits

mosaiciraf

Load FITS IRAF Mosaic image segment.
Syntax:
-mosaiciraf filename
Example:
$ds9 -mosaiciraf amp1.fits amp2.fits

mosaicimagewcs

Load entire FITS WCS Mosaic image composed of multiple extensions in one FITS file.  All extensions that are FITS Images and are valid FITS Mosaic Images will be loaded.
Syntax:
-mosaicimagewcs filename
Example:
$ds9 -mosaicimagewcs fourshooter.fits

mosaicimagenextwcs

Load entire FITS WCS Mosaic image composed of multiple extensions in one FITS file with out clearing the current frame.  All extensions that are FITS Images and are valid FITS Mosaic Images will be loaded.
Syntax:
-mosaicimagenextwcs filename
Example:
$ds9 -mosaicimagewcs fourshooter.fits -mosaicimagenextwcs morefourshooter.fits

mosaicwcs

Load FITS WCS Mosaic image segment.
Syntax:
-mosaicwcs filename
Example:
$ds9 -mosaicwcs amp1.fits amp2.fits

mosaicimagewfpc2

Load FITS HST WFPC2 image in one FITS file.
Syntax:
-mosaicimagewfpc2 filename
Example:
$ds9 -mosaicimagewfpc2 hst.fits

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:
$ds9 -nameserver m31

$ds9 -nameserver name m31

$ds9 -nameserver server ned-sao
$ds9 -nameserver skyformat sexagesimal

orient

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 #] # change current 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:
$ds9 -plot new # empty plot widget

$ds9 -plot close # close last plot
$ds9 -plot ap1 close # close plot named 'ap1'

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

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

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

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

$ds9 -plot view discrete yes # current dataset

$ds9 -plot color discrete red # current dataset

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

prefs

Controls various preference settings.
Syntax:
prefs [mosaicfast yes|no]
      [bgcolor white|black|red|green|blue|cyan|magenta|yellow]
      [nancolor white|black|red|green|blue|cyan|magenta|yellow]
      [wcsprojection fits|aips]

Example:
$ds9 -prefs mosaicfast no
$ds9 -prefs bgcolor black
$ds9 -prefs nancolor red
$ds9 -prefs wcsprojection aips

red

For RGB frames, sets the current color channel to red.
Syntax:
-red
Example:
$ds9 -red foo.fits

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|colorbar [yes|no]


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

$ds9 -rgb lock bin yes # lock rgb channels for binning
$ds9 -rgb lock colorbar yes # lock rgb colorbar channels

rgbarray

Load entire RGB image composed of a 3D Array Data Cube that contains red, green, and blue channels.
Syntax:
-rgbarray filename
Example:
$ds9 -rgbarray rgb.arr[dim=200,zdim=3,bitpix=8]

rgbcube

Load entire RGB image composed of a 3D Data Cube that contains red, green, and blue channels.
Syntax:
-rgbcube filename
Example:
$ds9 -rgbcube rgb.fits

rgbimage

Load entire RGB image composed of 3 multiple extensions that contains red, green, and blue channels.
Syntax:
-rgbimage filename
Example:
$ds9 -rgbimage rgb.fits
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 <id> [<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>]]
     [mosaicimagewcs [key|shmid] <id> [<filename>]]
     [mosaicwcs [key|shmid] <id> [<filename>]]
     [mosaicimagewfpc2 [key|shmid] <id> [<filename>]]
     [rgbimage [key|shmid] <id> [<filename>]]
     [rgbcube [key|shmid] <id> [<filename>]
Example:
$ds9 -shm 102
$ds9 -shm key 102
$ds9 -shm shmid 102 foo[2]
$ds9 -shm array shmid 102 [dim=32,bitpix=-32]
$ds9 -shm mosaicimageiraf key 100 foo
$ds9 -shm mosaiciraf key 100 foo
$ds9 -shm mosaicimagewcs key 100 foo
$ds9 -shm mosaiciraf key 100 foo
$ds9 -shm mosaicimagewfpc2 key 100 foo
$ds9 -shm rgbimage key 100 foo
$ds9 -shm rgbcube key 100 foo