class craftutils.observation.image.ZScaleInterval(astropy.visualization.interval.BaseInterval)

Interval based on IRAF’s zscale.

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

Original implementation: https://github.com/spacetelescope/stsci.numdisplay/blob/master/lib/stsci/numdisplay/zscale.py

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

Parameters

n_samplesint, optional

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

Changed in version 5.2: n_samples replaces the deprecated nsamples argument, which will be removed in the future.

contrastfloat, 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_rejectfloat, 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_npixelsint, optional

If there are less than min_npixels pixels remaining after the pixel rejection, then the returned values are the minimum and maximum of the data. Defaults to 5.

krejfloat, optional

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

max_iterationsint, optional

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

Public members

ZScaleInterval(n_samples=1000, contrast=0.25, max_reject=0.5, ...)

Initialize self. See help(type(self)) for accurate signature.

get_limits(values)

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

__call__(values, clip=True, out=None)

Transform values using this interval.

Properties

property nsamples

Deprecated since version 5.2: The nsamples attribute is deprecated and may be removed in a future version. Use n_samples instead.