
    IR-e`                     ,    d dl Z d dlZddgZddZd ZdS )    Ndeserialize_classwcs_info_strTc                    t          | t                    rt          |           dk    rt          d          | d                             dd          \  }}t          j        |          }t          ||          }t          d | d         D                       }t          d | d         	                                D                       }|r ||i |S |||fS )	z*
    Deserialize classes recursively.
       z Expected a tuple of three valuesr   .   c              3   b   K   | ]*}t          |t                    rt          |          n|V  +d S N
isinstancetupler   ).0args     8lib/python3.11/site-packages/astropy/wcs/wcsapi/utils.py	<genexpr>z$deserialize_class.<locals>.<genexpr>   sP        FI*S%"8"8A#c         c              3   p   K   | ]1\  }}t          |t                    r|t          |          fn||fV  2d S r
   r   )r   keyvals      r   r   z$deserialize_class.<locals>.<genexpr>   s`        S# *4C)?)?O$$%%c3Z     r      )
r   r   len
ValueErrorrsplit	importlibimport_modulegetattrdictitems)tpl	constructmoduleklassargskwargss         r   r   r   
   s    c5!! =SXX]];<<<FMM#q))MFE$V,,FFE""E  MPQRV    D   a&,,..    F
  #ud%f%%%dF""r   c           
      V   | j         j         d}|d                    | j        | j                  z  }|d| j         dz  }| j        pd}| j        p	d| j        z  }t          dt          t          | j                                      t          dt          d | j
        D                                 }t          dt          t          t          |                                        }|d	t                    z   d
z                       d          dz   d	t          |          z   d
z                       d          z   dz   d	t          |          z   d
z                       d          z   dz   dz   z  }t          | j                  D ]}|d	t                    z   dz                       |          dz   d	t          |          z   d
z                       | j
        |         pd          z   dz   ||         dt          d           z   n-d	t          |          z   dz                       ||                   z   dz   d                    t          | j        d n| j        |                   dz             z   z  }|dz  }t          dt          t          | j                                      }t          dt          d | j        D                                 }t          dt          d | j        D                                 }	|d	t          |          z   d
z                       d          dz   d	t          |          z   d
z                       d          z   dz   d	t          |	          z   d
z                       d          z   dz   dz   z  }t          | j                  D ]Ί| j                 pd}
| j                 pd}| j                 pd}|d	t          |          z   dz                                 dz   d	t          |          z   d
z                       |
          z   dz   d	t          |	          z   d
z                       |          z   dz   d                    |dz             z   z  }|dz  }t          dt          t          | j                                      |dz  }|d|z  dz   d t          | j        d!z  d"z
            z   d
z                       d          z   dz   z  }|d	t          |          z   d
z                       d          d#                    fd$t          | j                  D                       z   dz   z  }| j        }t%          j        |j        d%&          d'|<   d(| <   t          | j                  D ]f|d	t          |          z   dz                                 d#                    fd)t          | j                  D                       z   dz   z  }gd                    d* |                                D                       S )+Nz Transformation

z:This transformation has {} pixel and {} world dimensions

zArray shape (Numpy order): z

)r   r
   	   c              3   4   K   | ]}t          |          V  d S r
   r   r   xs     r   r   zwcs_info_str.<locals>.<genexpr>4   s(       F FAQ F F F F F Fr   {0:s}z	Pixel Dim  z	Axis Namez	Data sizezBounds
zg}Nonez     z{:s}
c              3   <   K   | ]}|t          |          ndV  d S Nr   r(   r)   s     r   r   zwcs_info_str.<locals>.<genexpr>N   s0      LL!s1vvvALLLLLLr      c              3   <   K   | ]}|t          |          ndV  d S r1   r(   r)   s     r   r   zwcs_info_str.<locals>.<genexpr>Q   s0      VV1!-AQVVVVVVr   z	World DimzPhysical TypezUnits
unknownd}r   z+Correlation between pixel and world axes:

 z{0:^   r    c                 f    g | ]-}d dt                    z   dz                       |          z   .S )r-   r+   r5   strformat)r   ipixpixel_dim_widths     r   
<listcomp>z wcs_info_str.<locals>.<listcomp>u   sN     8 8 8 US%9%99D@HHNNN 8 8 8r   U3)dtypeyesnoc                 v    g | ]5}d dt                    z   dz                       |f                   z   6S )r-   z{0:>r,   r:   )r   r=   iwrl
matrix_strr>   s     r   r?   z wcs_info_str.<locals>.<listcomp>   sZ     < < <  #o*>*>!>!E M MjY]_cYcNd e ee < < <r   c                 6    g | ]}|                                 S  )rstrip)r   ls     r   r?   z wcs_info_str.<locals>.<listcomp>   s     999Qahhjj999r   )	__class____name__r<   pixel_n_dimworld_n_dimarray_shapepixel_shapemaxr   r;   pixel_axis_namesrangepixel_boundsworld_axis_namesworld_axis_physical_typesworld_axis_unitsjoinaxis_correlation_matrixnpemptyshape
splitlines)wcssrO   rP   pixel_nam_widthpixel_siz_widthr=   world_dim_widthworld_nam_widthworld_typ_widthnametypunitmatrixrE   rF   r>   s                 @@@r   r   r   $   s    =!666A	G	N	N
 
 A 	<s	<	<	<<A /)TK/>Ws%>K !SS_!5!56677O!S F F1E F F FFFGGO!SS%5%5!6!67788O 53'''$.
6
6{
C
Cd
JS)))D088EEFHLMS)))D088EEFHLM  A co&& i i	us?+++d2::4@@4G_---4<<S=QRV=W=a[abbceij(3D(9(A3t99$$_---4<<[=NOOQ TXX c#*:*B$$HXY]H^__bffgg	h 	i IA
 !SS_!5!56677O	3LLs7KLLLLL O 
CVV8UVVVVV O
 53'''$.
6
6{
C
Cd
JS)))D088EEFHLMS)))D088IIJLPQ  A co&& 	, 	,#D)3V+D1;V#D)6Y 	
us?+++d2::4@@4G_---4<<TBBCEIJ_---4<<SAABDHI dTk**+ 	, IA !SS_!5!56677O	88A #
$
&c#/A-1222T9AA+NNO A 53'''$.
6
6{
C
CGG 8 8 8 8 %co 6 68 8 8 9 99  A (F&,d333JJvJwco&&  	us?+++d2::4@@ < < < < < <$)#/$:$:< < < = ==  	 9999!,,..999:::r   )T)r   numpyrZ   __all__r   r   rH   r   r   <module>rk      s[           
/# # # #4d; d; d; d; d;r   