| dispars | xapphot | dispars |
dispars -- Edit the image display parameters
dispars
The dispars parameters control the xguiphot image display algorithms. These parameters are used to map the image to the display window in coordinate and intensity space. The current image display algorithms are based on but not identical to the algorithms used by the IRAF display task.
Xguiphot only supports a single image display window. By default the image display window is erased before a new image is displayed (derase = "yes"). The user may choose not to erase the previous image display by setting derase = "no", although this option currently has little practical value.
By default (fill = "yes"), xguiphot spatially interpolates the image to fill the image display window in its largest dimension while preserving an aspect ratio of 1 to 1. When the display window is not automatically filled, the image is scaled by the magnification factors xmag and ymag and centered in the display window. If the number of image pixels exceeds the number of display pixels in the window only the central portion of the image which fills the window is loaded. The spatial interpolation algorithm is described in the section MAGNIFY AND FILL ALGORITHM.
There are several options for mapping the pixel values to the display values. There are two steps: selecting the mapping function or transform, and determining the range of image intensities to map to the full display range.
The mapping transform is set by the dztransform parameter. The most direct mapping is "none" which loads the image pixel values into the display without any transformation or range mapping. As most displays only use the lowest bits, this may result in a wrap-around effect for images with a range exceeding the display range. This is sometimes desirable because it produces a contoured image which is not saturated at the brightest or faintest points. The "none" algorithm is the fastest method of loading the display. Another transformation, "linear", maps the selected image range linearly to the full display range. The logarithmic transformation, "log", maps the image range linearly between 1 and 1000 and then maps the logarithm (base 10) linearly to the full display range. In the latter two transformations pixel values greater than the selected maximum display intensity are set to the maximum display value and pixel values less than the minimum intensity are set to the minimum display value.
If dztransform = "user", a look up table of intensity values and their corresponding greyscale levels is read from the file specified by the dlutfile parameter. From this information, a piecewise linear look up table containing 4096 discrete values is composed. The look-up table file is a text file containing two columns per line: column 1 contains the intensity, column 2 the desired greyscale output. The greyscale values specified by the user must match those available on the output device.
The method for setting the range of image pixel values is determined by the dzlimits parameter. By default xguiphot uses an automatic algorithm "median" which gives good results for most astronomical images. The automatic mapping algorithm is described in the section MEDIAN ALGORITHM and has two parameters, dznsample and dzcontrast .
If dzlimits = "image" then the the minimum and maximum pixel values in the image are taken from the image header or estimated from a subsample of the image pixels. This insures that the full range of the image is displayed but is generally slower than the "median" algorithm (because all the image pixels are sampled) and, for images with a large dynamic range, will generally show only the brightest parts of the image.
If dzlimits is "user" then the user must specify the intensity limits explicitly via the dz1 and dz2 parameters. If dz1 or dz2 are undefined then the "user" algorithm defaults to the "median" algorithm.
It is often desirable to load images with the same intensity transformations. The option repeat repeats the transformations from the previous image loaded.
The spatial interpolation algorithm magnifies (or demagnifies) the image along each axis by the desired amount. The fill option is a special case of magnification in that the magnification factors are set by the requirement that the image just fit the display window in its maximum dimension with an aspect ratio (ratio of magnifications) of 1. There are two requirements on the interpolation algorithm; all the image pixels must contribute to the interpolated image and the interpolation must be time efficient. The second requirement means that simple linear interpolation is used. If more complex interpolation is desired then tasks in the images package must be used to first interpolate the image to the desired size before loading the display frame.
If the magnification factors are greater than 0.5 (sampling step size less than 2) then the image is simply interpolated. However, if the magnification factors are less than 0.5 (sampling step size greater than 2) the image is first block averaged by the smallest amount such that magnification in the reduced image is again greater than 0.5. Then the reduced image is interpolated to achieve the desired magnifications. The reason for block averaging rather than simply interpolating with a step size greater than 2 is the requirement that all of the image pixels contribute to the displayed image. If this is not desired then the user can explicitly subsample using image sections. The effective difference is that with subsampling the pixel-to-pixel noise is unchanged and small features may be lost due to the subsampling. With block averaging pixel-to-pixel noise is reduced and small scale features still contribute to the displayed image.
The median algorithm is designed to display the image values near the median image value without the time consuming process of computing a full image histogram. This is particularly useful for astronomical images which generally have a very peaked histogram corresponding to the background sky in direct imaging or the continuum in a two dimensional spectrum.
A subset of the image is examined. Approximately 600 pixels are sampled evenly over the image. The number of lines is a user parameter, dznsample . The pixels are ranked in brightness to form the function I(i) where i is the rank of the pixel and I is its value. Generally the midpoint of this function (the median) is very near the peak of the image histogram and there is a well defined slope about the midpoint which is related to the width of the histogram. At the ends of the I(i) function there are a few very bright and dark pixels due to objects and defects in the field. To determine the slope a linear function is fit with iterative rejection;
I(i) = intercept + slope * (i - midpoint)
If more than half of the points are rejected then there is no well defined slope and the full range of the sample defines the intensity limits. Otherwise the endpoints of the linear function are used (provided they are within the original range of the sample):
z1 = I(midpoint) + (slope / zcontrast) * (1 - midpoint) z2 = I(midpoint) + (slope / zcontrast) * (npoints - midpoint)
As can be seen, the parameter zcontrast may be used to adjust the contrast produced by this algorithm.
1. List the image data dependent parameters.
xp> lpar dispars
2. Edit the image data dependent parameters.
xp> dispars
3. Edit the image data parameters and run xguiphot.
xp> epar xguiphot
... edit a few parameters
... move to the dispars parameter and type :e
... edit the dispars parameters and type :q
... finish editing other pset and task parameters
... type :go to startup the task
4. Save the current image data dependent parameter set in a text file call disnite1.par.
xp> dispars
... edit a few parameters
... type ":w disnite1.par" from within epar