simple_norm¶
- astropy.visualization.simple_norm(data, stretch='linear', power=1.0, asinh_a=0.1, min_cut=None, max_cut=None, min_percent=None, max_percent=None, percent=None, clip=False, log_a=1000, invalid=-1.0, sinh_a=0.3)[source]¶
Return a Normalization class that can be used for displaying images with Matplotlib.
This function enables only a subset of image stretching functions available in
ImageNormalize
.This function is used by the
astropy.visualization.scripts.fits2bitmap
script.- Parameters:
- data
ndarray
The image array.
- stretch{‘linear’, ‘sqrt’, :ref: ‘power’, log’, ‘asinh’, ‘sinh’}, optional
The stretch function to apply to the image. The default is ‘linear’.
- power
python:float
, optional The power index for
stretch='power'
. The default is 1.0.- asinh_a
python:float
, optional For
stretch='asinh'
, the value where the asinh curve transitions from linear to logarithmic behavior, expressed as a fraction of the normalized image. Must be in the range between 0 and 1. The default is 0.1.- min_cut
python:float
, optional The pixel value of the minimum cut level. Data values less than
min_cut
will set tomin_cut
before stretching the image. The default is the image minimum.min_cut
overridesmin_percent
.- max_cut
python:float
, optional The pixel value of the maximum cut level. Data values greater than
min_cut
will set tomin_cut
before stretching the image. The default is the image maximum.max_cut
overridesmax_percent
.- min_percent
python:float
, optional The percentile value used to determine the pixel value of minimum cut level. The default is 0.0.
min_percent
overridespercent
.- max_percent
python:float
, optional The percentile value used to determine the pixel value of maximum cut level. The default is 100.0.
max_percent
overridespercent
.- percent
python:float
, optional The percentage of the image values used to determine the pixel values of the minimum and maximum cut levels. The lower cut level will set at the
(100 - percent) / 2
percentile, while the upper cut level will be set at the(100 + percent) / 2
percentile. The default is 100.0.percent
is ignored if eithermin_percent
ormax_percent
is input.- clipbool, optional
If
True
, data values outside the [0:1] range are clipped to the [0:1] range.- log_a
python:float
, optional The log index for
stretch='log'
. The default is 1000.- invalid
python:None
orpython:float
, optional Value to assign NaN values generated by the normalization. NaNs in the input
data
array are not changed. For matplotlib normalization, theinvalid
value should map to the matplotlib colormap “under” value (i.e., any finite value < 0). IfNone
, then NaN values are not replaced. This keyword has no effect ifclip=True
.- sinh_a
python:float
, optional The scaling parameter for
stretch='sinh'
. The default is 0.3.
- data
- Returns:
- result
ImageNormalize
instance An
ImageNormalize
instance that can be used for displaying images with Matplotlib.
- result