U
    e»{jI  ã                   @   sP   d dl mZ dgZddgZG dd„ dejƒZG dd„ dejƒZG dd„ dƒZdS )	é    ©ÚregistryÚ	NDIOMixinÚ
NDDataReadÚNDDataWritec                       s(   e Zd ZdZ‡ fdd„Zdd„ Z‡  ZS )r   a.  Read and parse gridded N-dimensional data and return as an NDData-derived
    object.

    This function provides the NDDataBase interface to the astropy unified I/O
    layer.  This allows easily reading a file in the supported data formats,
    for example::

      >>> from astropy.nddata import CCDData
      >>> dat = CCDData.read('image.fits')

    Get help on the available readers for ``CCDData`` using the``help()`` method::

      >>> CCDData.read.help()  # Get help reading CCDData and list supported formats
      >>> CCDData.read.help('fits')  # Get detailed help on CCDData FITS reader
      >>> CCDData.read.list_formats()  # Print list of available formats

    See also:

    - https://docs.astropy.org/en/stable/nddata
    - https://docs.astropy.org/en/stable/io/unified.html

    Parameters
    ----------
    *args : tuple, optional
        Positional arguments passed through to data reader. If supplied the
        first argument is the input filename.
    format : str, optional
        File format specifier.
    cache : bool, optional
        Caching behavior if file is a URL.
    **kwargs : dict, optional
        Keyword arguments passed through to data reader.

    Returns
    -------
    out : `NDData` subclass
        NDData-basd object corresponding to file contents

    Notes
    -----
    c                    s   t ƒ j||dd d� d S )NÚreadr   ©ÚsuperÚ__init__©ÚselfÚinstanceÚcls©Ú	__class__© úY/var/www/html/bwave/python/venv/lib/python3.8/site-packages/astropy/nddata/mixins/ndio.pyr
   6   s    zNDDataRead.__init__c                 O   s   | j j| jf|ž|ŽS ©N)r   r   Ú_cls©r   ÚargsÚkwargsr   r   r   Ú__call__:   s    zNDDataRead.__call__©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   Ú__classcell__r   r   r   r   r      s   *c                       s(   e Zd ZdZ‡ fdd„Zdd„ Z‡  ZS )r   aª  Write this CCDData object out in the specified format.

    This function provides the NDData interface to the astropy unified I/O
    layer.  This allows easily writing a file in many supported data formats
    using syntax such as::

      >>> from astropy.nddata import CCDData
      >>> dat = CCDData(np.zeros((12, 12)), unit='adu')  # 12x12 image of zeros
      >>> dat.write('zeros.fits')

    Get help on the available writers for ``CCDData`` using the``help()`` method::

      >>> CCDData.write.help()  # Get help writing CCDData and list supported formats
      >>> CCDData.write.help('fits')  # Get detailed help on CCDData FITS writer
      >>> CCDData.write.list_formats()  # Print list of available formats

    See also:

    - https://docs.astropy.org/en/stable/nddata
    - https://docs.astropy.org/en/stable/io/unified.html

    Parameters
    ----------
    *args : tuple, optional
        Positional arguments passed through to data writer. If supplied the
        first argument is the output filename.
    format : str, optional
        File format specifier.
    **kwargs : dict, optional
        Keyword arguments passed through to data writer.

    Notes
    -----
    c                    s   t ƒ j||dd d� d S )NÚwriter   r   r   r   r   r   r
   b   s    zNDDataWrite.__init__c                 O   s   | j j| jf|ž|Ž d S r   )r   r   Z	_instancer   r   r   r   r   f   s    zNDDataWrite.__call__r   r   r   r   r   r   >   s   #c                   @   s$   e Zd ZdZe e¡Ze e¡Z	dS )r   z™
    Mixin class to connect NDData to the astropy input/output registry.

    This mixin adds two methods to its subclasses, ``read`` and ``write``.
    N)
r   r   r   r   r   ZUnifiedReadWriteMethodr   r   r   r   r   r   r   r   r   j   s   
N)Z
astropy.ior   Ú__all__Z__doctest_skip__ZUnifiedReadWriter   r   r   r   r   r   r   Ú<module>   s
   3,