a
    ߙfbH                     @   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__ 9lib/python3.9/site-packages/astropy/nddata/mixins/ndio.pyr
   6   s    zNDDataRead.__init__c                 O   s   | j j| jg|R i |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g|R i | 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,