ZScaleInterval

class astropy.visualization.ZScaleInterval(nsamples=1000, contrast=0.25, max_reject=0.5, min_npixels=5, krej=2.5, max_iterations=5)[source]

Bases: astropy.visualization.BaseInterval

Interval based on IRAF’s zscale.

http://iraf.net/forum/viewtopic.php?showtopic=134139

Original implementation: https://trac.stsci.edu/ssb/stsci_python/browser/stsci_python/trunk/numdisplay/lib/stsci/numdisplay/zscale.py?rev=19347

Licensed under a 3-clause BSD style license (see AURA_LICENSE.rst).

Parameters:
nsamples : int, optional

The number of points in the array to sample for determining scaling factors. Defaults to 1000.

contrast : float, optional

The scaling factor (between 0 and 1) for determining the minimum and maximum value. Larger values increase the difference between the minimum and maximum values used for display. Defaults to 0.25.

max_reject : float, optional

If more than max_reject * npixels pixels are rejected, then the returned values are the minimum and maximum of the data. Defaults to 0.5.

min_npixels : int, optional

If less than min_npixels pixels are rejected, then the returned values are the minimum and maximum of the data. Defaults to 5.

krej : float, optional

The number of sigma used for the rejection. Defaults to 2.5.

max_iterations : int, optional

The maximum number of iterations for the rejection. Defaults to 5.

Methods Summary

get_limits(self, values) Return the minimum and maximum value in the interval based on the values provided.

Methods Documentation

get_limits(self, values)[source]

Return the minimum and maximum value in the interval based on the values provided.

Parameters:
values : ndarray

The image values.

Returns:
vmin, vmax : float

The mininium and maximum image value in the interval.