Command: | analysis load [filename] |
Menu: | Analysis - Load Analysis Commands |
Description: | Loads an external analysis menu in .ans format can be appended to Analysis - |
Command: | analysis clear |
Menu: | Analysis - Clear Analysis Commands |
Description: | Deletes the loaded menu.(Caution: this includes removing CIAO's DAX from the menu if in the CIAO environment). |
Analysis files can be autoloaded with Edit - Preferences - Analysis - Analysis File entries, if Edit - Preferences - Analysis - Analysis File - Autoload is enabled.
If Analysis - Analysis Command Log is selected, or Edit - Preferences - Analysis - Analysis Log - Show Command is selected, the commands are echoed to the analysis log.
The DS9 CL allows additional capabilities not present in the GUI:
Command: | analysis task [n] |
Menu: | - |
Description: | Run task [n] in th current analysis menu. The numbers are in order of task loading, starting with 0 |
Command: | analysis task [name] |
Menu: | - |
Description: | Run task in the current analysis menu with the given name. |
Command: | analysis message [text] |
Menu: | - |
Description: | Append a message to the output |
Command: | analysis text [text] |
Menu: | - |
Description: | Append text to the output |
Each file type known to DS9 can have user-defined analysis commands associated with it. These analysis commands are defined at start-up time , or loaded by the user, by means of an ASCII analysis description file. The analysis commands are available for execution, either via the Analysis Menu or the XPA point Analysis. In addition, commands may be bound to events, such as keystrokes or mouse clicks. This type of command is called a bind command.
DS9 searches for an analysis file named ds9.ans or ds9.analysis in the current directory and $HOME to be loaded at startup. In addition, DS9 will search the following directories for any analysis files to be loaded at startup in the form of *.ds9: the current directory, $HOME/bin, /usr/local/bin, /opt/local/bin, and /soft/saord/bin. Finally, the user may specify analysis files to be loaded at startup in the preferences analysis panel. The user may also load or clear current analysis commands via command line options or the Analysis menu.
When activated, either from the menu, XPA, or bound event, an analysis command first is macro-expanded to fill in user-defined arguments and then is executed externally. Results may be displayed in a separate text window, plot window, or in a image frame.
Task names may contain space characters. All lines may be indented. Also, the '#' character is a comment character. A separator can be inserted in the menu by specifying the following sequence '- - -'.
Example:
# this will insert a menu separator ---
The analysis file that defines the known analysis commands consists of comment and separator lines and one or more task descriptors, each of which has the following format:
The allowed command types are:
A menu command creates an menu option under the Analysis menu option, and can be invoked by the user via the GUI or XPA.
Example:
# Menu command example My Analysis Task *.fits menu $data | doit | $text
A button command creates an button option in the current buttonbar.
Example:
# Button command example My Analysis Task *.fits button $data | doit | $text
A web command allows the user to invoke the internal web browser from the analysis menu.
Example:
# web command example HTTP based * web http://hea-www.harvard.edu/RD/ds9/ref/index.htmlFile based * web file:/home/joye/index.html
The following macros are macro-expanded to fill in user-defined
arguments before the command is executed. Strings that contain
$
All strings that contain
For example:
The macros are:
Substitute the width, height, or depth of the data file in the command line.
Syntax:
Example:
Substitute the bitpix of the data file in the command line.
Syntax:
$bitpix
Example:
Data from the current frame becomes the input data to the command
string. This data is in the form of a FITS image. This macro can only
used at the beginning of the command string.
Syntax:
$data
Example:
Display an entry modal dialog. The returned string is substituted. If
cancel is selected, the command line is not executed.
Syntax:
Example:
Substitute the full path name of the directory where analysis file found.
Syntax:
$dir
Example:
Substitute the value of a shell environment variable.
Syntax:
Example:
Display the standard file dialog. Substitutes the returned pathname.
Argument specifies if an open file or save file dialog is invoked.
Syntax:
Example:
Substitute the filename of the data file in the command line. A full
filename includes any absolute or relative path. A root filename
contains no path. A (2D) subsection defines a subimage from xmin,ymin to
xmax,ymax. For Frame3D, a 2D subsection will also include the current
slice (PLANE=) parameter if not 1. A 3D subsection defines a subimage
from xmin,ymin,zmin to xmax,ymax,zmax and no PLANE parameter.
Syntax:
Example:
Combination of $filename and $regions macros. Generates a series of filenames, each with a region.
Syntax:
Example:
This macro differs from all other macros, including $url, in that no
subprocess pipe is created. Only HTTP is supported. The contents of the
url are retrieved and sent to $text, $plot, or $image. No other
processing is allowed. The primary purpose of this macro is to support
external analysis for the Windows platform, which has no subprocess
support.
Syntax:
Example:
The resulting image data is displayed in a DS9 frame. This macro should be
the last macro of a command line. The optional parameter indicates whether a new
frame - and what type of frame - is created for the new data. The macro is
removed from the command line before execution.
Syntax:
Example:
Display a message dialog box, with option buttons. After displaying the
message, the macro is removed from the command line before execution. If
cancel or no is selected, the command line is not executed.
Syntax:
Example:
Display a message dialog box, with option buttons. After displaying the
message, the button selected is substituted in the command line.
Syntax:
Example:
Expect no output or results from analysis task. Note: no error message
will be returned if the analysis task fails to execute correctly.
Syntax:
Example:
Substitute current pan location of the particular data file are returned. The default coordinate system is physical.
Syntax:
where:
Example:
Display data in plot window. This macro should be the last macro of a
command line. The data is read via STDIN and consist of a pair of
coordinates, with option error values. (xy, xyex, xyey, xyexey) Default
dimension is xy. The macro is removed from the command line before
execution.
For $plot(stdin) only:
The title, x axis label, and y axis label are assumed to be on the first
line of input, delimited with a new-line. However, if the data starts
with BEGINTEXT, all text between BEGINTEXT and ENDTEXT will be
removed from the data and displayed in a separate text dialog window,
with the remaining data, including the title, x axis label, and y axis
label, will be displayed in a plot window. Furthermore, if the data
contains the string ERROR, an error is assumed to have occurred and a
text dialog window is displayed only.
Syntax:
Example:
Substitute region definition in specified region format, coordinate
system, and coordinate format. The default coordinate system is
physical, default coordinate format degrees, and default region format
DS9. Arguments may appear in any order, as long as they are separated by
',' and no spaces. If one or more properties are specified, only
regions with all of the specified properties will be substituted.
Syntax:
where options are one of the following:
also, the old SAOTNG formats are also supported:
Example:
Display text in a text dialog window. This macro should be the last
macro of a command line. To display text from only STDOUT use '|' as the
pipe command. To display text from both STDOUT and STDERR, use '|&' as
the pipe command. No parameters are required. The macro is removed from
the command line before execution.
Syntax:
$text
Example:
URLs are processed and stored in a temporary file. Only HTTP and anonymous FTP are supported.
Syntax:
Example:
Returns the vo method.
Syntax:
Example:
Substitute the value at the location of the cursor of an bind event.
Syntax:
Example:
Substitute coordinates of an bind event. When a bind event is triggered,
the x,y coordinates of the mouse of the particular data file are
returned. The default coordinate system is physical. This macro is only
available for bind commands. For datacubes, the z coordinate is returned
based on the current slice selected.
Syntax:
where:
Example:
Returns the xpa access point name.
Syntax:
$xpa
Example:
Returns the xpa method.
Syntax:
$xpa_method
Example:
Creates an analysis buttonbar, in which button commands may be created.
After all buttons commands have been defined, use 'endbuttonbar' to
complete the definition.
Example:
The user may define their own HELP message. This message will be available
to the user as a menu item. An optional label maybe specified. The
default label is Help. When invoked, an text dialog window will appear,
containing the message. Multiple HELP items may be defined within a menu,
or across hierarchical menus.
Example:
The user may define his own macros or parameters to be evaluated before
the command line is executed. To do this, the user defines a parameter
segment that is referenced in the command line. Parameters maybe
displayed in a notebook style via use of the 'tab' 'endtab' keywords.
The parameter definition has the following format:
param
It can also use references to external parameter files:
The definition either consists of a number of variables, one per row, or
the name of a IRAF style parameter file. DS9 will look for the IRAF
parameter file in:
The following macros are supported if encounted in the default field:
Example:
param foo
var1 entry {Variable 1} {default} {this is a entry}
var2 text {Variable 2} {static} {this is text}
var3 checkbox {Variable 3} 1 {this is a checkbox}
var4 menu {Variable 4} {AAA|BBB|CCC} {this is a menu}
var5 combobox {Variable 5} {XXX|YYY|ZZZ} {this is a combobox}
var6 open {Variable 6} {default} {this is a open file dialog}
var7 save {Variable 7} {default} {this is a save file dialog}
endparam
param bar
tab {First Params}
var1 entry {Variable 1} {default} {this is a entry}
var2 text {Variable 2} {static} {this is text}
var3 checkbox {Variable 3} 1 {this is a checkbox}
var4 menu {Variable 4} {AAA|BBB|CCC} {this is a menu}
var5 combobox {Variable 5} {XXX|YYY|ZZZ} {this is a combobox}
endtab
tab {Second Params}
var6 open {Variable 6} {default} {this is a open file dialog}
var7 save {Variable 7} {default} {this is a save file dialog}
endtab
endparam
param foobar
var1 entry {filename} {$filename} {image filename}
var2 text {width} {$width} {image width}
var3 text {height} {$height} {image height}
var4 text {depth} {$depth} {image depth}
var5 entry {bitpix} {$bitpix} {image bitpix}
endparam
To use parameters, specify the param name at the beginning of your command line:
When the menu item is selected, the user will be presented with a dialog
box that contains entry, text, open, save, checkbox, or menu choices for
each variable specified. If the user clicks ok, the values are
substituted in the command line before execution.
The user may define hierarchical menus. Use this to organized crowded
menus. To do this, frame menu entries with 'hmenu
$$
$
that are not a macro name will not be affected.
echo "$$data $foo" | $text
will display a text dialog that contains "$data $foo"
$width
$height
$depth
echo "$width $height $depth" | $text
echo "$bitpix" | $text
$data | dosomething | $text
$entry(
echo "$entry(Enter something here)" | $text
echo "$dir" | $text
$env(
echo "$env(PATH)" | $text
$filedialog([open|save])
echo "$filedialog(open)" | $text
$filename # filename with extname, (2d) subsections, filters
$filename(root|root,base) # root filename withwith extname,no subsections, no filters)
$filename(full|full,base) # full filenamewith extname,no subsections, no filters)
dosomething $filename | $text
dosomething $filename(root) | $text
$filename[$regions]
$filename[$regions(
dosomething $filename[$regions] | $text
$geturl(http://
$geturl(http://foo.bar.edu/foo.html) | $text
$image
$image([new|rgb|3d|current])
doit | $image(new)
$message(
$message(okcancel,This is a Message)| doit | $text
$messageok(
echo "$messageok(okcancel,This is a Message)" | $text
$null
echo "Hello, world" > foo | $null
$pan
$pan(
coordinate system = [image|physical|detector|amplifier|wcs|wcsa...wcsz]
sky frame = [fk4|fk5|icrs|galactic|ecliptic]
sky format = [hms|sexagesimal|degrees]
echo $pan(fk5,sexagesimal) | $text
$plot
$plot(,,,)
$plot(
doit | $plot(This is aTitle,X Axis,Y Axis)
doit | $plot(stdin)
$regions
$regions(
regions format = [ds9|ciao|saotng|saoimage|pros|xy]
property = [include|exclude|source|background]
coordinate system = [image|physical|detector|amplifier|wcs]
sky frame = [fk4|fk5|icrs|galactic|ecliptic]
sky format = [sexagesimal|degrees]
$regions_pixels
$regions_degrees
$regions_hms
$include_regions
$include_regions_pixels
$include_regions_degrees
$include_regions_hms
$exclude_regions
$exclude_regions_pixels
$exclude_regions_degrees
$exclude_regions_hms
dosomething $regions | $text
dosomething $regions(pros) | $text
dosomething $regions(source,wcs,fk5) | $text
dosomething $regions(saotng,background,exclude,ecliptic,sexagesimal) | $text
doit | $text # stdout
doit |& $text # stdout and stderr
$url(http://
$url(http://legacy.gsfc.nasa.gov/rosat/data/p000s26b.img.Z) | uncompress | $image
$url(ftp://legacy.gsfc.nasa.gov/rosat/data/hri/images/rh100193_img.fits) | $image
$vo_method
echo '$vo_method' | $text
$value
echo "$value" | $text
$x
$x(
coordinate system = [image|physical|detector|amplifier|wcs|wcsa...wcsz]
sky frame = [fk4|fk5|icrs|galactic|ecliptic]
sky format = [hms|sexagesimal|degrees]
echo "$x $y" | $text
echo "$x $y $z" | $text
echo "$x(fk5,sexagesimal) $y(fk5,sexagesimal)" | $text
echo "$x(wcs) $y(wcs) $z(wcs)" | $text
echo '$xpa' | $text
echo '$xpa_method' | $text
Analysis files: Buttonbar
buttonbar
Hello
*.fits
button
echo "hello" | $text
World
*.fits
button
echo "world" | $text
endbuttonbar
Analysis files: Help
help Main Help
A help message may contain
multiple lines of description of the tasks
in the menu or menus
endhelp
Analysis files: Parameters
param
param
./
$width
$height
$depth
$bitpix
$filename
$filename[region]
$env
Parameter Test
*
menu
$param(foobar); echo "$var1 $var2 $var3 $var4 $var5" | $text
Analysis files: Hierarchical Menus