next up previous contents
Next: Overlay Files Up: Appendices Previous: Appendices   Contents

Subsections


Customization

There are various levels of customization of aipsview. Some type of customization can be implemented as environment variables, X-defaults resources, command line switches, and configuration files. Where it is possible to carry out the same customization in more than one manner, variables in the configuration files override, command line switches, which override X-defaults variables, which in turn override environment variables.


Environment variables

Several environment variables have been defined for customization of aipsview functionality. These control the display colors and hardcopy output file and device defaults. Environment variables may be set each time you start aipsview by typing setenv $<$variable name$>$ $<$value$>$, or by putting these in your .cshrc file.

AIPSVIEWRC
This is the name of the file containing the aipsview global variables that are read in (and written out by selecting the Update ~/.aipsviewrc, item from the options menu of the AIPS View window). By default this filename is ~/.aipsviewrc. If an explicit path is not included, the location of the specified file will be placed in the directory where aipsview was started.

AV_PAL_NUMCOLORS
Normally, aipsview will only use those colors that have not been previously allocated on the X server. This largely eliminates the annoying color flashing problem, at the cost of not having the full range (usually 256) of colors available for image display. This default may be overridden by the AV_PAL_NUMCOLORS environment variable:

AVAILABLE Use all currently non allocated colors (default).
BW Use all but colors allocated as black pixel and white pixel.
ALL Use all colors in colormap.
<#> Use <#> colors, where <#> is between 0 and the maximum number of colors.

Thus, setenv AV_PAL_NUMCOLORS 224 will cause aipsview to use 224 of the 256 colors generally available. If you want to get the maximum number of colors for image display but still be able to see aipsview text, it is strongly recommended that you use setenv AV_PAL_NUMCOLORS BW and start aipsview with aipsview -bg white (n.b., the default text or foreground color is black).

AV_CLIPTO_COLOR
When a pixel value is less than or greater than the range specified by the Data Slider (see Section 2.2.3), by default the value is set to black for each pixel data value that is too small and white if it is too large. These colors normally don't change when the colormap is edited. If the AV_CLIPTO_COLOR environment variable is set to 1 (i.e., setenv AV_CLIPTO_COLOR 1), aipsview will clip to the minimum and maximum indexes of the changeable colormap. This will not let you distinguish between a pixel with the maximum (minimum) data value in your allowed range and all higher (lower) pixel data values, but may produce a more pleasing display.

If AV_PAL_NUMCOLORS is set high enough that the black and white pixels are changeable, aipsview automatically assumes AV_CLIPTO_COLOR is 1.

AV_PG_FILE
This item lets you overrides aipsview's filename choice for images.

AV_PG_DEVICE
This overrides aipsview's PGPLOT device choice. This device will be the default for output images (see Section 2.3.1); output devices for profile hardcopies are selectable via the Profile Setup panel (see Section 2.3.2). The possible values for AV_PG_DEVICE are:

/PS PostScript file, landscape orientation.
/VPS PostScript file, portrait orientation.
/CPS Color PostScript file, landscape orientation.
/VCPS Color PostScript file, portrait orientation (default).

AV_PROFILE_FILENAME
This specifies a filename for PostScript output of profiles.


X-defaults Resources

If you wish, you may use a resource file for aipsview; instructions for doing this follow. If you are not familiar with X resource files, you might want to get your local guru to help. Note that although a resource file may be convenient for you, it is not necessary to use a resource file into order to run aipsview. A sample resource file (with the aipsview defaults specified) follows. An exclamation mark at the start of a line indicates a comment. To set your preferences for a particular resource, edit the value of the X resource variable. In order for the resource file to take effect, you can either merge it with your .Xdefaults file or place it in your own application defaults directory.

An example of how to create your own application defaults directory is the following (assuming you use csh):

Create a directory to put application default files into:

mkdir $HOME/.xdefaults

Copy the sample aipsview default file (below) to the $HOME/.xdefaults directory and call it aipsview.

Edit your .cshrc file to add ONE of these environment variables:

setenv XAPPLRESDIR $HOME/.xdefaults/ (note the trailing slash),

or

setenv XUSERFILESEARCHPATH $HOME/.xdefaults/%N

The first provides a directory to look for, the second is a path which can contain multiple directories. After editing the file, either log in again, execute source .cshrc, or just type the setenv command. The file will be read whenever you run aipsview.

If you merge this file with your .Xdefaults file, the values will be in effect whenever you display aipsview on the system running the X server that read the .Xdefaults file. If you create an application defaults directory, defaults in the directory are read when you run aipsview on the machine with the directory.

For more information, try man X and read the subsection application-specific files. The OPTIONS section gives some standard X command-line arguments.

! -------- AIPSVIEW DEFAULTS FILE -------
! ------------- DIRECTORIES -------------
! The directories where aipsview will look for data files and palettes.
*DataDirectory:                 /home/monet/baker/Data
*PaletteDirectory:              /home/monet/baker/Palettes
! ------- WINDOW SIZES (pixels) ---------
! Height, width, and size (size sets height and width) of the image window.
*DisplayHeight:                 256
*DisplayWidth:                  256
*DisplaySize:                   256
! Height and width of the X profile window.
*xProfile.height:               512
*xProfile.width:                512
! Height and width of the PGPLOT profile window.
*pgProfile.height:              512
*pgProfile.width:               512
! ---------------- COLORS ---------------
! Background and foreground colors for all parts of aipsview.
*background:                    gray
*foreground:                    black
! Color to use when a toggle button is selected.
*XmToggleButtonGadget.selectColor: yellow
! Foreground color for any arrow buttons.
*ArrowButton.foreground:        gray
! Background color for X profiles.
*xProfile.background:           blue
! ----------------- MISC -----------------
! Force aipsview to default to building the data panel outside of the
! image window.
*InfoPanel:                     OUTSIDE
! The colorVerbosity variable turns on reporting of colors used.
! Possible choices are:
!   0         no output
!   1         limited output
!   2         slightly more verbose output
! Numbers greater than 2 are not currently used.  A value of 1 will
! print something like:
!   # RO colors = 204. # RW colors = 27. # unallocated colors = 25.
! Which says that aipsview has allocated 204 colors as read only (RO),
! the image has been allocated 27 writable (RW) colors and there were
! 25 unallocated colors available for widgets.  A value of 2 will
! report a slightly more verbose output: 
!   # RO colors = 204. # RW colors = 27. # unallocated colors = 25.
!   System CMAP is using 204 of 256 colors.
!   numColors=0 minColors=16 numFreeColors=25
*colorVerbosity:                1
! Designate the default PGPLOT display device.  Possible choices are:
!   /PS       PostScript file, landscape orientation. 
!   /VPS      PostScript file, portrait orientation. 
!   /CPS      Color PostScript file, landscape orientation. 
!   /VCPS     Color PostScript file, portrait orientation (default).
*pgDevice:                      /VCPS
! ---------------- FONTS ----------------
! Designate particular fonts for aipsview.
*fontList:                      -*-helvetica-medium-r-normal-*-14-*-*-*-*-*-*-*
*menuBar*fontList:              -*-helvetica-bold-o-normal-*-14-*-*-*-*-*-*-*
*FontPlain*fontList:            -*-helvetica-medium-r-normal-*-14-*-*-*-*-*-*-*
*FontBold*fontList:             -*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*
*FontItalic*fontList:           -*-helvetica-medium-o-normal-*-14-*-*-*-*-*-*-*
*FontBoldItalic*fontList:       -*-helvetica-bold-o-normal-*-14-*-*-*-*-*-*-*


Command line switches

Standard X Window command line switches, such as changing the default foreground and background colors, will work. For example, you can start aipsview with yellow text on a light blue background typing aipsview -fg yellow -bg lightblue. Standard color names available on your machine can be found by typing showrgb at a system prompt.

There are several command line switches that set some global variables for aipsview. They override the corresponding variables in the X-defaults file. The following table shows the switches, the corresponding X-defaults resource and a short description.

Switch Argument Resource Description
-numColors (1) N/A Number of colormap colors to use.
-minColors <colors> N/A Minimum number of colors to allocate to image. Can't be set to less than 8.
-numFreeColors <colors> N/A Number of colors to leave free.
-colorVerbosity <level> colorVerbosity Colormap information aipsview reports.
-displayHeight <height> DisplayHeight Initial width of image window.
-displaySize <size> DisplaySize Set image window to be <size> x <size>.
-pgDevice <device name> pgDevice Use <device name> as PGPLOT output.
(1) Arguments to -numColors:
AVAILABLE Use all currently non allocated colors (default).
BW Use all but colors allocated as black pixel and white pixel.
ALL Use all colors in colormap.
<#> Use <#> colors, where <#> is between 0 and the maximum number of colors.


Example Configuration File

Here is an annotated example of an .aipsviewrc file:

# If the levels variable does not exist, nlevels is used to tell aipsview
# how many contour levels to generate. If levels exists, nlevels is
# ignored.
set aipsview(contour,nlevels) 4
# Note that there are no commas in the list of values.
set aipsview(contour,levels) { .1 .3 .5 .7 .9 }
set aipsview(contour,levelScale) 1.0
set aipsview(contour,levelsAreFractional) FALSE
# lineStyle can be one of SOLID, DASHED or DASHEDifNEGATIVE. DASHED really
# means look in the lineStyles array for a list containing the above three
# values.
set aipsview(contour,lineStyle) DASHEDifNEGATIVE
set aipsview(contour,lineStyles) DASHED SOLID DASHED SOLID
# This sets the Enable Blanking toggle of the contour window.
set aipsview(contour,blankingEnabled) TRUE
# This sets the Immediate Update toggle of the contour window.
set aipsview(contour,immediateUpdate) FALSE
# colorStyle can be one of RED, GREEN, BLUE, CYAN, MAGENTA, YELLOW,
# BLACK, WHITE OR MIXED. If it is MIXED, aipsview looks in the colorStyles
# array for a list of colors. MIXED is not valid in the colorStyles array.
set aipsview(contour,colorStyle) MIXED
set aipsview(contour,colorStyles) { WHITE RED GREEN BLUE CYAN MAGENTA YELLOW }
set aipsview(contour,labelContours) FALSE
set aipsview(contour,drawContours) TRUE
set aipsview(contour,drawTitle) FALSE
#
# The following are configurations for an individual data set
# (smallcube.fits).
#
# Change the number of marker type toggles for the profile hardcopy of
# the smallcube data set.
set smallcube.fits(profile,numMarkerToggleTypes) 16
# Let aipsview assign toggle type for toggles 0-13, but use Hershey's
# symbols 864 and 745 for markers 14 and 15, respectively.
set smallcube.fits(profile,markerToggleType14) 864
set smallcube.fits(profile,markerToggleType15) 745
# Specify the emphasis color for contours.
set smallcube.fits(contour,emphasisColor) RED
# Set the number of Markers and Captions to zero.
set smallcube.fits(imageAxis,numMarkers) 0
set smallcube.fits(imageAxis,numCaptions) 0

Notes on configuration files:

  1. lineStyles and colorStyles should have as many entries as levels. If there are more, they will be ignored. If less, aipsview will generate missing values.

  2. Case counts except for boolean values. RED is valid, red is not.

  3. The configuration file is a TCL script consisting of a series of set commands. The variable being set is an array whose name is the filename (with no extension) or aipsview for global variables. The index is a string composed of the module name, contour here, and the configuration option being set. Note that there are no spaces between the ``('' and the ``)''.

  4. Only one set command should be on a line and if a line is continued (via a backslash in the last column), the set and the variable must be on the first line.

  5. Data set specific parameters may be placed in the global file.

  6. Marker numbers always start with zero, regardless of whether the One Relative Indexing toggle off the Edit menu of the AIPS View window is set.


next up previous contents
Next: Overlay Files Up: Appendices Previous: Appendices   Contents