Skip to main content
`Ctrl`+`K`

# SymmetricInterval

class astropy.visualization.SymmetricInterval(radius=None, *, midpoint=0)

  Bases: `BaseInterval`

  Interval based on a symmetric radius away from a midpoint.

  Parameters:
    radius `python:float` or `python:None`

      The amount the interval extends to either side of the midpoint, so the total interval is twice this value. If None, the radius is automatically determined such that the resulting interval contains both the image minimum and maximum (ignoring NaNs).

    midpoint `python:float`, optional

      The midpoint of the symmetric interval. Defaults to zero.

  Methods Summary

  `__call__`(values[, clip, out]) | Transform values using this interval.
  `get_limits`(values) | Return the minimum and maximum value in the interval based on the values provided.

  Methods Documentation

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

    Transform values using this interval.

    The `vmin` and `vmax` values are determined by the `get_limits` method.

    The following transformation is then applied to the values:

    \[{\rm result} = \frac{{\rm values} - v_{\rm min}} {v_{\rm max} - v_{\rm min}}\]

    If `clip` is `True` (default), the result is then clipped to the [0:1] range.

    Parameters:
      values numpy:array_like

        The input values.

      clip bool, optional

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

      out `ndarray`, optional

        If specified, the output values will be placed in this array (typically used for in-place calculations).

    Returns:
      result `ndarray`

        The transformed values.

  get_limits(values)

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

    Parameters:
      values `ndarray`

        The image values.

    Returns:
      vmin, vmax `python:float`

        The mininium and maximum image value in the interval.