NASA - Jet Propulsion Laboratory
    + View the NASA Portal
Search JPL
Jet Propulsion Laboratory Home Earth Solar System Stars & Galaxies Technology
Introduction Background Software Links

Auto-scaling

The auto-scaling algorithm aims to scale the image so that "noise-like" fluctuations around the zero level are visible but don't use up too much of the colour scale, so that bright features are visible rather than been completely saturated. The results depend on the current colour table and transfer function.

It works in two stages:

Stage 1: Robust estimate of image rms and mode

This stage may be quite time-consuming for large images, but its results are permanently recorded so it is not repeated if you need to re-run auto-scale.

Floating-point Not-a-Number (NaNs) and infinities are rejected as bad data. If more than 10−5 of the pixels are exactly zero, it is assumed that zero also marks bad data and these are rejected.

A first guess is made by finding the rms and mean of the good data. These are used to choose bins for a histogram, covering ± 2σ around the mean, with enough points in each bin to make random fluctuations unlikely to change the mode. If the modal bin falls in the outer 20% of the histogram, the histogram is re-made with finer bins, centred on the mode, and this is iterated if necessary.

The final mode is found by a quadratic fit to the five bins centred on the histogram peak. This is our estimate of the true zero level. The noise estimate is the one-sided rms below the mode. You can plot the histogram and quadratic fit if you run auto-scale from the Load FITS or Adjust scaling dialogs. For large HEALPix images it is quicker to run auto-scale when the data is first loaded, because then there is no need to process the large number of "off-sky" pixels which pad out the 2-D projected image.

NB: This algorithm will fail if the histogram is montonically decreasing, e.g. in MEM images.

Stage 2: Choose the range, zero and beta

The estimated zero level is set to the mode. The beta parameter for Asinh scaling is set to 2σ (1.5σ for the red-black-blue colour table).

The image is classified as positive, negative or neutral according to whether (max − mode) / (mode − min) is > 5, < 0.2, or in between. If neutral, the scale is set symmetrically around the mode; if positive it runs from mode − 3σ to a large positive value, and vice-versa for negative images. The scale is truncated at the actual minimum and maximum if this prescription exceeds them. The total range is chosen according to the colour table and transfer function in use. For linear scaling it varies from 50σ for the very contrasty "Cyclic" scale to 18σ for the "Red-black-blue" scale. The ranges are squared for the Sqrt function, and the whole data range is used for Asinh. Histogram equalization uses a nominal range of 400σ.


J. P. Leahy
Jodrell Bank Centre for Astrophysics, and
Osservatorio Astronomico di Trieste
jpl@jb.man.ac.uk
Privacy / Copyright
FIRST GOV Contact: NASA Home Page Site Manager:
Webmaster:

CL 03-2650