| newcont | stsdas.graphics.stplot | newcont |
newcont -- Draw a contour plot of an image.
newcont image
This task will draw, trace, and smooth contours using bicubic polynomials, and is based on the FARBE package developed by Albrecht Preusser as published in the ACM Transactions on Mathematical Software, Vol. 15, No. 1, March 1989.
Contour "colors" can be arbitrarily set by specifying a list of contours. Logarithmic functions can be used to specify varying-spaced contour levels. The major advantage this routine has over plot.contour is that the contours are better smoothed and never cross themselves, producing a higher quality contour. This quality is gained, however, at the expense of speed.
The speed can be increased by decreasing the image resolution; this is done using the xres and yres parameters. When preserve = yes, the task automatically reduces the image in both directions by the same factor, which is the larger of (ncolumns / xres) or (nlines / yres). If the aspect ratio is not being preserved, the X and Y dimensions are independently reduced to the specified resolution. No reduction is done if both xres and yres are set to 0, if the input image is an image section, or if the image is smaller than xres by yres.
If the device viewport (i.e., the plotting area) is not set, a viewport will be automatically set and centered on the output device. When the fill parameter is set to "no" (the default), the viewport will be adjusted so that equal numbers of image pixels in X and Y will occupy equal lengths when plotted. That is, when fill = no, a unity aspect ratio is enforced, and square images are represented as square plots regardless of the device aspect ratio. On devices without square viewports (e.g., the vt640), a square image will appear extended when fill = yes. To completely fill the device viewport with contour lines, disable perimeter drawing and enable fill, and nothing but the contour map will be drawn.
Contour plots may be overlaid on a displayed image by setting the output device to "imd" for image display and the contouring parameters fill and perimeter to "yes" and "no" respectively. By default, green contours will be drawn on the image display. Other choices for device are "imdr", "imb", "imdy", "imdw" and "imdg" for red, blue, yellow, white and green output contours, respectively.
1) You can change the way negative contours are produced using the 'negative_color' parameter. 2) You can emphasize contours at specified intervals with the 'major_contour' and 'major_color' parameters. 3) You can specify colors for arbitrary contours using the contour list facility provided by the the 'list' parameter.
At the moment, the only IRAF graphics devices that can handle color are those that use the PostScript kernel, psikern. Consult the STSDAS installation guide about installing and using psikern. For more information about psikern, type "help psikern".
An ASCII text file can be used to contain contour and color values. This file is then passed to the task by passing its name, preceded by the "@" character. For example, "@filename".
The only requirement is that the contour values should be specified in consistently increasing order.
plev also interacts with the contour list (see above). If both plev and list are specified, then each value specified in the list is multiplied by plev and the dynamic range of the image to determine the contour levels.
If wcslab = yes, then instead of using standard pixel labelling around the contour edges, the wcslab routines are called and will use information stored in the image's MWCS (usually, Right Ascension and Declination). Type "help wcslab" for more information.
If usewcs = no, then the WCS is derived from an image or some other source. (See wcspar below).
Setting subsample=no, uses block averaging to achieve the target resolution.
If this is used (i.e., set to "yes"), then the scale box will be drawn to the right of the contour plot.
When rain = yes, the task will use a rainbow of colors for contrours, going from blue for low-valued contours to red for high-valued contrours. NOTE that colors are device-dependent.
If cont_mode = "line", then lines will be used to delimit contours.
If set to "fill", then newcont will produce a plot of filled regions, each region representing a different level. This only makes sense when each contour level is in a different color, as specified by either "rain = yes", or a color is defined for each level in a contour definition list (see the description of the list parameter above).
1. Draw a contour plot of a 512 square image on the graphics terminal. With the default values for xres and yres, the image would automatically be block averaged by a factor of 8 in X and Y.
st> newcont crab.5009
2. Repeat the previous example, but print the plot on a plotter as a background job:
st> newcont crab.5009 device=stdplot &
3. Place a ceiling at an intensity value of 500 to cut out a noise spike. Move the plot to the lower left corner of the display.
st> cont crab.5009 ceil=500 left=.1 right=.6 bottom=.1 top=.6
4. Overlay a contour plot of an image on the image that is currently displayed on the output device. Note that the contour parameters fill and perimeter must be on and off respectively.
st> display m51 1
st> cont m51 fill+ per- device=imd
5. Specify a list to be used as contour levels:
st> newcont m51 list="100,200,400,800,1600"
6. Specify a file containing a list of contour levels:
st> newcont m51 list="@contour.list"
7. Draw contours of every possible color at intervals of 10% of the dynamic range image:
st> newcont m51 plev=0.1 list="@contour.list"
where the contour.list file contains:
color=1, 1
color=2, 2
color=3, 3
color=4, 4
color=5, 5
color=6, 6
color=7, 7
color=8, 8
color=1, 9, 10
This file says that the first contour at 10% the image's dynamic range drawn in color 1. For the 20% level, the color will be drawn in color 2, etc.
8. Draw contours and label the edges of the graph with the image's MWCS information:
st> contour m51 wcslab+
If block averaging is used, the contour precision will be no better than the blocking factor. For example, if a contour map drawn with a block averaging factor of 8 is overlaid on an image of a starfield, contours drawn around stars in the field may not appear to be centered. This problem can be solved by increasing the plot resolution using the xres and yres parameters.
contour, surface, display, imdkern, imexamine, wcslab, disconlab, psikern