
SAOimage command line

The command line is the line you type when you first call the SAOimage
program.  Following the name of the program, you can include the name
of a file to read and/or various parameters and settings.  Except for
the filename, all settings are identified by a "switch" beginning with
a "-".  Some switches are sufficient by themselves, some switches must
be followed by a fixed number of arguments (usually numerical), and
some switches may be followed by arguments but do not require them.
These are explained below.

There is no required order to the switches.  The file name can also
appear anywhere on the command line (SAOimage assumes that any token
that is not part of a recognizable switch is the file name).

Many switches have two names, one literal and one abbreviated.  In such
cases the names are completely interchangeable.  The longer names might
be used in a script where a later reader might wonder what the switches
do.  The abbreviated names save typing on the command line.

Once SAOimage is running, you may enter a new command line, changing
some of the settings and/or reading in a new image from disk.  See "new"
in the "etc" menu section or 'N' in the keyboard section.  A few
switches cannot be changed from their initial settings (i.e. the display
server).

There are probably more switches than can fit on a normal command
line.  A method of tailoring with a default parameter file will
eventually be added.  The following is a list of the command line
switches for SAOimage:

-d <X server name>:<X server name extension>.<screen number> **
	Specify the name of the X display server.  This makes it
	possible to run the SAOimage program on a machine other than
	the one connected to your display screen, with no difference
	in appearance or use.  The default gets the server name from
	the DISPLAY environment variable.  See the "xhost" man page
	for more details.  This cannot be changed once SAOimage is
	running.
	Example: connect to the display server on cfa241
	  saoimage -d cfa241:0.0
	 or
	  saoimage -d 128.103.41.241:0.0

-g [<width>x<height>][{+-}<x>{+-}<y>] **
	Specify the size and/or the screen position of SAOimage.  The
	format is a standard X geometry statement.  Both size and
	position may be specified, or only the size or the position.
	Width and height refer to the dimensions of SAOimage's desktop
	window (see -dispsz for sizing just the image display window).
	+x and +y refer to the upper left corner in screen coordinates.
	-x positions the right edge from the right edge of the screen.
	-y would positions the lower edge from the bottom of the screen.
	Width and height below a minimum size are defaulted to the
	minimum.  Some window managers may alter the size and/or
	position slightly.  Once SAOimage is running, use the window
	managers size and move mechanisms to make any readjustments.
	Examples:
	a) create minimum sized SAOimage near upper left corner
	  saoimage -g 0x0+10+20
	b) create a 500x700 SAOimage window in the lower right corner
	  saoimage -g 500x700-5-5

-gd [<width>x<height>][{+-}<x>{+-}<y>] **
	Specify the size of the image display subwindow and/or the
	screen position of SAOimage.  The format is a standard X
	geometry statement.  This switch works like -g above, except
	that width and height (if given) are applied to the display
	subwindow.  The overall SAOimage window is sized accordingly.
	Example: create an SAOimage in the upper right with a display
	         window to exacly show a 320x512 FITS image
	  saoimage -G 320x512-5+0 m51.fits

-name <filename>
	This switch is only needed if the filename starts with a number
	or might otherwise be recognized as a switch.

-fits	Image file is a FITS file.  (If the image file name ends in .fits,
	this switch is not necessary).  Only T=SIMPLE array types are
	supported.  The header BITPIX card must be 8 (unsigned byte), 16
	(signed short), 32 (signed int), -32 (float), -64 (double), or
	-16 (unsigned short) (the latter two are not recognized standards).
	IEEE floats are not converted if that is not the machine format.

-dfits	Image file is a FITS file as above, but in unexpected byteswapped
	order.  The FITS standard is not swapped, but some naive VAX
	applications may swap it. (see -bswap)

-oif	Image file is an IRAF image header file in OIF format.  (If the
	image file name ends in .imh, this switch is not necessary).  IRAF
	STF and QPOE formats are not supported.  Complex data cannot be
	handled.  The data must have at least 2 dimensions.  Only the first
	plane of multidimensional images is read.  The data file is read
	directly by SAOimage (see -imtool/-pros below).

-chararray <width> <height>
-u1 <width> <height>
	Image file is an unsigned byte array file of the given dimensions.
	(If the file is square and has no added padding, the dimensions
	are not necessary).

-ushortarray <width> <height>
-u2 <width> <height>
	Image file is a unsigned short integer array file of the given
	dimensions.  (If the file is square and has no added padding, the
	dimensions are not necessary).

-shortarray <width> <height>
-i2 <width> <height>
	Image file is a signed short integer array file of the given
	dimensions.  (If the file is square and has no added padding, the
	dimensions are not necessary).

-longarray <width> <height>
-i4 <width> <height>
	Image file is a signed long integer array file of the given
	dimensions.  (If the file is square and has no added padding, the
	dimensions are not necessary).

-floatarray <width> <height>
-r4 <width> <height>
	Image file is a real*4 array file of the given dimensions.
	(If the file is square and has no added padding, the dimensions
	are not necessary).

-doublearray <width> <height>
-r8 <width> <height>
	Image file is a real*8 array file of the given dimensions.
	(If the file is square and has no added padding, the dimensions
	are not necessary).

-header <bytes>
-skip <bytes>
-sk <bytes>
	Skip over the given number of bytes at the head of the file before
	reading	data.  This is used to skip header information or the first
	image if two images are stored in one file.

-bswap	Switch the bytes order between big-endian and little-endian
	order.  This may be needed where data has been copied from
	another machine or if there is some confusion about the FITS
	file format.  This switch toggles the previous setting.

-scalebias <scale> <bias>
-sb <scale> <bias>
	The data in the image file should be scaled and biased to get
	the true image value (true_value = (scale * file_value) + bias).
	This cannot be used with the -fits image type (scale and bias
	are in the FITS header), nor with -imtool or -pros (they are
	passed by IRAF).

-ul	First pixel in file represents the upper left of the image
	(assuming the lines of input run left to right on the screen -
	see rotate, below).  (This switch does not override IRAF wcs
	image coordinates).
	
-ll	First pixel in file represents the lower left of the image.
	(assuming the lines of input run left to right on the screen -
	see rotate, below).  This is the IRAF standard and the SAOimage
	default.

-rotate <1,2,or 3>
-rot <1,2,or 3>
	Rotate the image 90, 180, or 270 degrees (respectively) before
	displaying it.  Rotation is applied after conversion to a lower
	left coordinate system (-ll) if such conversion is also requested.
	This is useful for images when the CCD was not mounted North-up.

-one	The file coordinate of the first pixel is (1,1).  The real coord-
	inates of the center of the first pixel are (1.0,1.0).  This is
	the IRAF standard and the default for SAOimage.  The second pixel
	is (2,1).

-zero	The file coordinate of the first pixel is (0,0).  The real coor-
	dinates center of the first pixel are (0.5,0.5) which makes the
	very edge 0.0.  This is the standard coordinate system for image
	displays, but not the default for SAOimage.  The second pixel is
	indexed (1,0).

-imtool
	Open the named input pipe and wait for input from IRAF.  In
	this mode, SAOimage emulates IRAF's imtool.  IRAF's image
	loading and cursor read-back functions are supported.  Unlike
	imtool, SAOimage has only one frame buffer; IRAF's frame buffer
	numbers are ignored.  This switch cannot be given when there
	is also a file name for reading on the same command line.
	Listening on the pipe is assumed to be requested in place
	of reading a file.  This is the default mode if SAOimage is
	started up with no file specified.

-pros
	This command is virtually identical to the -imtool switch
	above.  The difference occurs when the user writes the saved
	regions to a disk file.  Imtool emulation includes writing
	only an IRAF list file giving center coordinates only.  With
	-pros, SAOimage's normal region descriptor file will be
	written in place of the simpler list file.

-idev	Specify the name of the named pipe used for listening.  The
	default is /dev/imt1o, which is the default used by IRAF.

-odev	Specify the name of the named pipe used for sending feedback.
	The default is /dev/imt1i, which is the default used by IRAF.

-linear
	Set the scaling mode to linear scaling.

-wrap [<# of wraps within scaling range>]
	Set the scaling mode to wrapped linear, and set the number of
	wraps for this mode, if given.  (See scaling section)

-log [<exponent for e**n curve>]
	Set the scaling mode to log (exponential), and set the exponent
	for the curve function, if given.  (See scaling section)

-sqrt [<inverse of exponent for geometric curve>]
	Set the scaling function to sqrt (geometric), and set the
	inverse of the exponent for the X**(1/n) curve, if given.
	(See scaling section)

-histeq
	Set the scaling mode to hisstogram equalization.

-min [<minimum value for scaling>]
	Set the minimum for the image value range used to compute
	scaling.  The default is to take the minimum from the image
	shown in the display window.  -min with no value resets the
	default.  (If the minimum value in the displayed image is
	higher than the given minimum, the image's minimum vale is
	used for the scaling range.)

-max [<maximum value for scaling>]
	Set the maximum for the image value range used to compute
	scaling.  The default is to take the maximum from the image
	shown in the display window.  -max with no value resets the
	default.  (If the maximum value in the displayed image is
	higher than the given maximum, the image's maximum vale is
	used for the scaling range.)

-rmin [<minimum value for reading>]
	Set minimum value for reading from the image file.  This value
	is used as the minimum value when images are pre-scaled to fit
	the 16 bit (signed short) working buffer.  (See scaling section)

-rmax [<maximum value for reading>]
	Set maximum value for reading from the image file.  This value
	is used as the maximum value when images are pre-scaled to fit
	the 16 bit (signed short) working buffer.  (See scaling section)

-v 	Set verbose mode.  In verbose mode, informative statements are
	printed to the terminal window when various actions are taken.
	
-q 	Set quiet mode.  See -v above.	The default mode is to be verbose.

-lprbuttons
	Include the button menu in the hardcopy image (only on color
	workstations).  The default on color workstations includes the
	area above the button panel, but excludes the buttons.

-coord	Set coordinate tracking as the initial state.  In coordinate
-ct	tracking the coordinates of the mouse are printed in the lower
	part of the main display window.

-magnifier
-mt	Set magnifier tracking as the intial state.  With magnifier
	tracking, the magnifier window is continuously updated to show
	a magnification of the image the image under the mouse.

-mag <magnification>
	Set the magnification factor of the magnifier.  This
	factor relates the magnifier to the magnification of the
	display window.  The default is 4; the magnifier magnifies
	the image to 4 times the magnification of the main display
	window (but never less than zoom 1 of the original data).

-palette <# of colors in display colormap palette>
-p <#>	Specify the number of read/write color cells to reserve.  On
	color workstations, SAOimage reserves color cells in the default
	colormap for its own use (see the Color section).  SAOimage
	reserves as many color cells as it can get, up to the number
	given (the default is 200).  If the number given is negative,
	SAOimage comes up in overlay mode, using 1/2 + 2 of the color
	cells for overlays and graphics.  In verbose mode (see -v above)
	SAOimage tells you how many cells it is able to use for display
	colors.  This number can be re-entered at run-time, unless -p 1
	is given, in which case SAOimage stays in halftone mode.

-green **
-blue **
-red **	Set the color of all graphics to a primary (red, green, or blue).
	Some inexpensive systems use a monochrome monitor connected to
	one of the three color outputs on the computer.  That color must
	be specified to make the graphics visible.

-horizgraph **
-hg	Make the auxiliary color graph window can be wide, with a color
	bar along the bottom (the default).

-vertgraph **
-vg	Make the auxiliary color graph window tall, with a colorbar
	along the left side.

-panboxav
-panboxsum
-panboxsamp
-panboxmax
	These switches select the kind of image reduction used to fit
	a picture of the entire image into the pan window.  Each pixel
	is computed from a block of image pixels by averaging, summing,
	sampling, or taking the maximum.  The default is to show the
	maximum from each block.  (When zooming in the main display
	involves reduction, subsampling is always used).

-bordercolor <color-name> **
-bc <color-name>
	Specify the color of all subwindow borders.  Color name must be a
	recognized X color (there are many).  This is a style issue.
	Example: -bc green


** This switch is only effective on the initial start-up command line.
