astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v5.2.1 »
- Data Visualization (`astropy.visualization`) »
- ImageNormalize

# ImageNormalize

class astropy.visualization.mpl_normalize.ImageNormalize(data=None, interval=None, vmin=None, vmax=None, stretch=<astropy.visualization.stretch.LinearStretch object>, clip=False, invalid=-1.0)

  Bases: `Normalize`

  Normalization class to be used with Matplotlib.

  Parameters:
    data `ndarray`, optional

      The image array. This input is used only if `interval` is also input. `data` and `interval` are used to compute the vmin and/or vmax values only if `vmin` or `vmax` are not input.

    interval `BaseInterval` subclass instance, optional

      The interval object to apply to the input `data` to determine the `vmin` and `vmax` values. This input is used only if `data` is also input. `data` and `interval` are used to compute the vmin and/or vmax values only if `vmin` or `vmax` are not input.

    vmin, vmax `python:float`, optional

      The minimum and maximum levels to show for the data. The `vmin` and `vmax` inputs override any calculated values from the `interval` and `data` inputs.

    stretch `BaseStretch` subclass instance

      The stretch object to apply to the data. The default is `LinearStretch`.

    clip bool, optional

      If `True`, data values outside the [0:1] range are clipped to the [0:1] range.

    invalid `python:None` or `python:float`, optional

      Value to assign NaN values generated by this class. NaNs in the input `data` array are not changed. For matplotlib normalization, the `invalid` value should map to the matplotlib colormap “under” value (i.e., any finite value < 0). If `None`, then NaN values are not replaced. This keyword has no effect if `clip=True`.

  Parameters:
    vmin, vmax `python:float` or `python:None`

      If vmin and/or vmax is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e., `__call__(A)` calls `autoscale_None(A)`.

    clip bool, default: `python:False`

      If `True` values falling outside the range `[vmin, vmax]`, are mapped to 0 or 1, whichever is closer, and masked values are set to 1. If `False` masked values remain masked.

      Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is `clip=False`.

  Notes

  Returns 0 if `vmin == vmax`.

  Methods Summary

  `__call__`(values[, clip, invalid]) | Transform values using this normalization.
  `inverse`(values[, invalid]) |

  Methods Documentation

  __call__(values, clip=None, invalid=None)

    Transform values using this normalization.

    Parameters:
      values numpy:array_like

        The input values.

      clip bool, optional

        If `True`, values outside the [0:1] range are clipped to the [0:1] range. If `None` then the `clip` value from the `ImageNormalize` instance is used (the default of which is `False`).

      invalid `python:None` or `python:float`, optional

        Value to assign NaN values generated by this class. NaNs in the input `data` array are not changed. For matplotlib normalization, the `invalid` value should map to the matplotlib colormap “under” value (i.e., any finite value < 0). If `None`, then the `ImageNormalize` instance value is used. This keyword has no effect if `clip=True`.

  inverse(values, invalid=None)