Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://hea-www.harvard.edu/RD/saotng/xpa_list.html
Дата изменения: Unknown Дата индексирования: Mon Oct 1 23:56:26 2012 Кодировка: |
SAOtng has defined a number of Public Access Points through which XPA commands can be communicated with SAOtng. A list of public access points is displayed below. The current list can obtained by typing:
xpaget SAOtng
Each public access point can be accessed by means of the xpaset or xpaget command. For example, to change the colormap, type:
csh> echo "colormap I8" | xpaset SAOtngTo get the current colormap, type:
csh> xpaget SAOtng colormap I8
The programs imset and imget are provided as a convenience for use with SAOtng. These programs assume that the target is SAOtng and allow a more natural command structure. For example, to change the colormap using imset, type:
csh> imset colormap I8To get the current colormap, type:
csh> imget colormap I8
The following XPA commands are supported in SAOtng. Arguments enclosed in square brackets ([...]) are required, while those in curly brackets ({...}) are optional. Commands can have send and/or receive functionality, as described in each case:
echo "analysis entire" | xpaset SAOtngwill execute the minmax command whose help states "calculate the min and max of the entire file".
If the first argument of the send command is "add", then the argument that follows is assumed to be a filename containing commands to be added to the currently available routines. For example:
echo "analysis add new.cmds" | xpaset SAOtngwill add commands from the new.cmds file. See Analysis Routines in SAOtng for more information.
Receive: returns a list of the currently available analysis routines.
where parameters are used to describe the array dimensions and type. See Array File Specification for more information.| xpaset SAOtng array foo.arr 512 256 -32 or | xpaset SAOtng array foo.arr[xdim=512,ydim=256,bitpix=-32]
Note that the array access point is used only when a disk file is not available (e.g., when a program writes array data to stdout). Use the file public access point to send a file name to SAOtng.
If one or two numeric values are supplied, then these values are taken as the width and height of the frame. Autoconfig is turned on. If "manual" is specified and one or two numeric values are specified, then the values are taken as the width and height of the frame, but autoconfig is turned off to prevent this frame size from being overridden (manual override).
If "max" is specified and one or two numeric values also are specified, then autoconfig is turned on and the values are taken as the max width and height to which a frame can be configured. Note that 0 in this context means no maximum.
Receive: returns "true" or "false" and the max width and height for autoconfiguration. See Autoconfiguration of Frames for more information.
Receive: returns the current blocking factor and blocking preference:
bynars-49: xpaget SAOtng blocking block=2 pref=averageNB: The power of 2 restriction on blocking stems from the fact that we have had problems placing region markers exactly with non-power-of-2 blocking. If marker accuracy is not a problem and you wish to remove this restriction, set the environment variable SAOTNG_RESTRICT to false. With this setting, the blocking factor can be any positive integer.
Receive: returns the current setting for casting.
Receive: returns the colormap name for the current frame.
Receive: If "format" is specified as an option, return the current
display format. Otherwise, when this receive is executed, the SAOtng
cursor is changed to a blinking circle and SAOtng waits for the user
to position the mouse on an image position and press
Receive: get edge size of the current image.
Receive: get the value of an existing environment variable. A new-line
is returned is the variable does not exist. For example,
Receive: If no arguments are provided, the "file" receive access point
returns the FITS header for the currently displayed image. If the
option "raw_data" is specified, then the raw data for the currently
displayed image section is returned in FITS format. If the option
"display_data" is specified, then the display data for the currently
displayed image section is returned in FITS format. Otherwise, any
specified argument is assumed to be a FITS parameter and the value of
that parameter is returned.
Receive: get current x and y zoom factors and the x and y flip state:
Receive: returns the frame number of the current frame, as well as
the width and height of the current frame.
If the first argument of the send command is "add", then the argument
that follows is assumed to be a filename containing commands to be
added to the currently available marker routines. For example:
Receive: returns a list of the currently available marker analysis routines.
If "reset" is specified, then the image zoom is reset to 1 (or the
value of the -zoom switch) and the pan center is reset to the window
center. If "center" is specified, then the pan center only is reset
to the window center (zoom is left alone).
Receive: get current x and y zoom factors and the x and y flip state:
The "printer" can be a PostScript printer, a program such as
ghostview, or a disk file, depending on the "printer" options. These
printer options can be placed on the command line or they can
be set up with the "printer" access point. By default,
the output is piped to "lpr".
Receive: get the current printer specification.
If "ghostview" is specified, the output is sent to the ghostview program
for previewing. (This assumes the ghostview program is available).
If no ">" or "|" symbol is specified as part of the printer specification
string, the output is assumed to be a disk file and the PostScript is
redirected to this file:
Receive: get the current printer specification.
If no arguments are supplied, the current image is
redisplayed. By default, the image first is erased and then rescaled
before being displayed. Either erasing or rescaling can be turned
off.
If an image name is specified and that image has been loaded into
SAOtng, then it is redisplayed, rather than the current image. This
makes sense in tile mode, where multiple images are being displayed at
the same time but only one is "active". If an image other than the
current image is to be redisplayed, SAOtng will change frames to the
redisplayed image before redisplaying it. This can be turned off with
the "nosetframe" option (and is especially useful in tiling).
Receive: get the regions for the current frame. By default, region
marker coordinates are returned using the current WCS display format.
This can be overridden using one of the format keywords (assuming
appropriate WCS information is available for that FITS image). Thus,
for example, if the current format is HMS/DMS, you can retrieve region
markers in degrees using:
By default, regions are separated by new-lines. They also can be
returned separated by semi-colons by specifying the "\;" parameter.
See Region Markers for more information
about manipulating regions.
If "add" is specified as the first parameter, then the second argument is
taken as a filename of scale algorithms to add to the existing scaling
algorithms.
See Adding New Scaling Algorithms
for more information.
If "internal" is specified as the first parameter, then several internal
parameters can be set:
Receive: get the current scale algorithm.
Receive: get the current scaling limits for this image.
Receive: get the current section specification.
A selected point is used to specify a center around which to extract
an image. The technique used is to load an image using the "full" section,
so that all of the image is viewable. A point is then selected and the
image reloaded, so that the image section is displayed centered on that
point.
By default, the previous image is erased from the screen prior to display
of the new shared memory image. For some reason, someone wanted the
ability not to erase the previous image -- hence the "noerase" option.
Typically, the "shm" public access point is called once to set up the
shared memory connection. After that, "redisplay" is used to update
the display of the image.
WCS specification(s) can be sent to SAOtng using the xpaset command:
Additional special keywords specify the range of zoom1 coordinates for
which that WCS is valid. If no such limits are specified, the limits
default to (1, image dimensions), i.e. the entire image. If NAXIS1
and NAXIS2 are specified, then limits are (1, NAXIS1,NAXIS2). If
LOAXIS1 and/or LOAXIS2 are specified, these values are used as the low
value for the x and/or y dimension of the rectangle. If HIAXIS1
and/or HIAXIS2 are specified, these values are used as the high value
for the x and/or y dimension of the rectangle.
If "reset" is specified as a parameter, then previously specified WCS
descriptions are deleted and the WCS is set back to the file-based WCS.
This will be overridden by new WCS definitions that are sent at the same
time; otherwise the file-based WCS will be used. If "replace" is specified
as a parameter, then existing WCS definitions will be replaced by new ones
if the x,y limits match exactly. Otherwise, the new WCS definition will
be appended. If "append" is specified, new WCS definitions are appended.
The default is "reset".
To ensure that markers are zoomed and panned correctly, zoom factors
are restricted to powers of two. (Setting the SAOTNG_RESTRICT
environment variable to "false" will override this, but markers might
be zoomed and panned inaccurately.)
Receive: get current x and y zoom factors and the x and y flip state:
bynars-64: xpaget SAOtng coords
... wait for the user to position and mouse and press
The receive command can return the coordinate values in a format other
than the default by specifying that format as an option. For example,
the same position can be returned in degree format:
bynars-66: xpaget SAOtng coords degrees
204.241 -29.868 J2000 (283.0 263.0) 16496
bynars-84: xpaget SAOtng env TERM
dtterm
echo "zoom 2; colormap SLS" | xpaset SAOtng exec
However, this also is accomplished without the "exec" command:
echo "zoom 2; colormap SLS" | xpaset SAOtng
As shown above, the "exec" command is the default command to execute
when no other command is passed to xpaset.
Note that the "fits" access point is used only when a disk file is
not available (e.g., when a program writes FITS data to stdout).
Use the file public access point to send a file name to SAOtng.
beberly-315: xpaget SAOtng zoom
xmag=2
ymag=2
xflip=False
yflip=True
echo "help xpa_list.html" | xpaset SAOtng
echo "manalysis active" | xpaset SAOtng
on an IRAF QPOE file will execute the imcnts command whose help states
"counts -- number of events in the activeregion".
echo "manalysis add new.cmds" | xpaset SAOtng
will add commands from the new.cmds file.
See Marker Analysis Routines in SAOtng
for more information.
echo "message This is a test" | xpaset SAOtng
sends a test message, while:
cat ~/.cshrc | xpaset SAOtng message
sends my .cshrc file. Note that TCL looks at curly brackets within
the message in a funny way; they should be avoided in messages if
possible.
beberly-315: xpaget SAOtng zoom
xmag=2
ymag=2
xflip=False
yflip=True
lpr -Plpm -h
will print the PostScript on the printer lpm without the standard
header file.
/home/eric/foo.ps
will send the postscript output to a file. (Note that the command is
executed via the Borne shell, so the "~" character is not recognized.
Sorry!) If a ">" or "|" symbol is specified, then the output is redirected
or piped to the printer specification.
cat newrnames | xpaset SAOtng append
will add the contents of the newrnames file to the current mapping.
See Region Names and Colors for more
information about the region name/color mapping.
echo "regions 'c 250 250 10; box 150 200 10 20'" | xpaset SAOtng
or
cat new.reg | xpaset SAOtng regions
where new.reg might contain a list of regions separated by new-lines.
If WCS information is available for the current image, the coordinates
can be specified using RA/Dec in HMS/DMS or degrees (or whatever the
"natural" coordinate system of the image as specified by the FITS
header keywords:
echo "regions +circle(13:37:14.613,-29:56:15.05,27)" | xpaset SAOtng
xpaget SAOtng regions degrees
cat wcs.list | xpaset SAOtng wcs {options ...}
where the ASCII file wcs.list will contains one or more WCS specifications.
The format of each specification is a set of valid FITS keywords that
describe a WCS. Different WCS specifications are separated in the file by a
blank line. Thus, for example:
LOAXIS1 = 1
LOAXIS2 = 1
HIAXIS1 = 270
HIAXIS2 = 270
CRPIX1 = 257.75
CRPIX2 = 258.93
CRVAL1 = -201.94541667302
CRVAL2 = -47.45444
CDELT1 = -2.1277777E-4
CDELT2 = 2.1277777E-4
CTYPE1 = 'RA---TAN'
CTYPE2 = 'DEC--TAN'
LOAXIS1 = 271
LOAXIS2 = 271
CRPIX1 = 257.75
...
CTYPE2 = 'DEC--TAN'
Note that the WCS definitions can contain standard FITS 80-character
WCS card images, as shown above, or free-form name/value pairs without
the intervening "=" sign:
CRPIX1 257.75
CRPIX2 258.93
CRVAL1 -201.94541667302
CRVAL2 -47.45444
CDELT1 -2.1277777E-4
CDELT2 2.1277777E-4
CTYPE1 'RA---TAN'
CTYPE2 'DEC--TAN'
beberly-289: xpaget SAOtng xpaname
SAOtng.dsstest.fits
beberly-315: xpaget SAOtng zoom
xmag=2
ymag=2
xflip=False
yflip=True