
    9i7                     `    S S/r SSKJr   SSKJr  S rS	S jrS rg! \ a	    \" S5      ef = f)
imreadimread_collection    N)fitszAstropy could not be found. It is needed to read FITS files.
Please refer to https://www.astropy.org for installation
instructions.c                 4   [         R                  " U 5       nSnU H^  n[        U[         R                  5      (       d!  [        U[         R                  5      (       d  MC  UR
                  c  MR  UR
                  n  O   SSS5        U$ ! , (       d  f       W$ = f)a  Load an image from a FITS file.

Parameters
----------
fname : string
    Image file name, e.g. ``test.fits``.

Returns
-------
img_array : ndarray
    Unlike plugins such as PIL, where different color bands/channels are
    stored in the third dimension, FITS images are grayscale-only and can
    be N-dimensional, so an array of the native FITS dimensionality is
    returned, without color channels.

    Currently if no image is found in the file, None will be returned

Notes
-----
Currently FITS ``imread()`` always returns the first image extension when
given a Multi-Extension FITS file; use ``imread_collection()`` (which does
lazy loading) to get all the extensions at once.

N)r   open
isinstanceImageHDU
PrimaryHDUdata)fnamehdulist	img_arrayhdus       _/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/skimage/io/_plugins/fits_plugin.pyr   r      sx    4 
5	W 	C#t}}--C1Q1Q88' #I	 	 
  
	 s   ABB.B
Bc           	      r   [        U 5      nU[        La  U[        La  [        S5      eU[        La  U /n / nU  H  n[        R
                  " U5       n[        [        [        U5      5      U5       Hl  u  pg[        U[        R                  5      (       d!  [        U[        R                  5      (       d  ME   UR                  nUS:  d  MZ  UR                  XF45        Mn     SSS5        M     [        R                  " U[         US9$ ! [         a    UR                  5       n N`f = f! , (       d  f       M  = f)a  Load a collection of images from one or more FITS files

Parameters
----------
load_pattern : str or list
    List of extensions to load. Filename globbing is currently
    unsupported.
conserve_memory : bool
    If True, never keep more than one in memory at a specific
    time. Otherwise, images will be cached once they are loaded.

Returns
-------
ic : ImageCollection
    Collection of images.

z-Input must be a filename or list of filenamesr   N)	load_funcconserve_memory)typeliststr	TypeErrorr   r   ziprangelenr   r	   r
   sizeappendioImageCollectionFITSFactory)	load_patternr   intypeext_listfilenamer   nr   	data_sizes	            r   r   r   6   s   & ,FTfC/GHH T$~ H YYx GeCL17;c4==11ZT__5U5U/$'HH	 !1} 6 < !  ! K  % /$'HHJ	/ ! s7   A D'7DD'D'D$	!D'#D$	$D''
D6	c                    [        U [        5      (       d  [        S5      e[        U 5      S:w  a  [	        S5      eU S   nU S   n[        U[
        5      (       a  [        U[        5      (       d  [	        S5      e[        R                  " U5       nX2   R                  nSSS5        Wc  [        SU S	U S
35      eU$ ! , (       d  f       N%= f)a  Load an image extension from a FITS file and return a NumPy array

Parameters
----------
image_ext : tuple
    FITS extension to load, in the format ``(filename, ext_num)``.
    The FITS ``(extname, extver)`` format is unsupported, since this
    function is not called directly by the user and
    ``imread_collection()`` does the work of figuring out which
    extensions need loading.

zExpected a tuple   zExpected a tuple of length 2r      z&Expected a (filename, extension) tupleNz
Extension z of z has no data)r   tupler   r   
ValueErrorr   intr   r   r   RuntimeError)	image_extr#   extnumr   r   s        r   r   r   f   s     i''*++
9~788|Hq\Fx%%*VS*A*AABB	8	## 
 |ZxtH:\JKKK 
	s   B>>
C)T)	__all__
skimage.ior   
astropy.ior   ImportErrorr   r   r        r   <module>r5      sP   (
) $N-`!  
	 s    -