a
    ß™fb®  ã                   @   sT   d Z ddlmZ ddlmZ ddlmZ ddlmZ dgZ	G dd„ deeeeƒZ
dS )	zA
This module implements a class based on NDData with all Mixins.
é   )ÚNDData)ÚNDSlicingMixin)ÚNDArithmeticMixin)Ú	NDIOMixinÚ	NDDataRefc                   @   s   e Zd ZdZdS )r   a  Implements `NDData` with all Mixins.

    This class implements a `NDData`-like container that supports reading and
    writing as implemented in the ``astropy.io.registry`` and also slicing
    (indexing) and simple arithmetics (add, subtract, divide and multiply).

    Notes
    -----
    A key distinction from `NDDataArray` is that this class does not attempt
    to provide anything that was not defined in any of the parent classes.

    See also
    --------
    NDData
    NDArithmeticMixin
    NDSlicingMixin
    NDIOMixin

    Examples
    --------
    The mixins allow operation that are not possible with `NDData` or
    `NDDataBase`, i.e. simple arithmetics::

        >>> from astropy.nddata import NDDataRef, StdDevUncertainty
        >>> import numpy as np

        >>> data = np.ones((3,3), dtype=float)
        >>> ndd1 = NDDataRef(data, uncertainty=StdDevUncertainty(data))
        >>> ndd2 = NDDataRef(data, uncertainty=StdDevUncertainty(data))

        >>> ndd3 = ndd1.add(ndd2)
        >>> ndd3.data  # doctest: +FLOAT_CMP
        array([[2., 2., 2.],
               [2., 2., 2.],
               [2., 2., 2.]])
        >>> ndd3.uncertainty.array  # doctest: +FLOAT_CMP
        array([[1.41421356, 1.41421356, 1.41421356],
               [1.41421356, 1.41421356, 1.41421356],
               [1.41421356, 1.41421356, 1.41421356]])

    see `NDArithmeticMixin` for a complete list of all supported arithmetic
    operations.

    But also slicing (indexing) is possible::

        >>> ndd4 = ndd3[1,:]
        >>> ndd4.data  # doctest: +FLOAT_CMP
        array([2., 2., 2.])
        >>> ndd4.uncertainty.array  # doctest: +FLOAT_CMP
        array([1.41421356, 1.41421356, 1.41421356])

    See `NDSlicingMixin` for a description how slicing works (which attributes)
    are sliced.
    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   ú?lib/python3.9/site-packages/astropy/nddata/nddata_withmixins.pyr      s   6N)r
   Znddatar   Zmixins.ndslicingr   Zmixins.ndarithmeticr   Zmixins.ndior   Ú__all__r   r   r   r   r   Ú<module>   s   