+
    [°³jÇ)  ã                   óx   € R t ^ RIHt ^ RIt^RIHtHt ^RIH	t	H
t
Ht . R
OtRR ltRR ltRR ltR tRR	 ltR# )zP
2D and nD Discrete Wavelet Transforms and Inverse Discrete Wavelet Transforms.
)ÚproductN)Údwt_axisÚ	idwt_axis)Ú	AxisErrorÚ_modes_per_axisÚ_wavelets_per_axisc                óJ  € \        V4      p\        P                  ! V 4      p \        V4      ^8w  d   \	        R4      hV P
                  \        \        P                  ! V4      4      8  d   \	        R4      h\        WW#4      pVR,          VR,          VR,          VR,          33# )ae  
2D Discrete Wavelet Transform.

Parameters
----------
data : array_like
    2D array with input data
wavelet : Wavelet object or name string, or 2-tuple of wavelets
    Wavelet to use.  This can also be a tuple containing a wavelet to
    apply along each axis in ``axes``.
mode : str or 2-tuple of strings, optional
    Signal extension mode, see :ref:`Modes <ref-modes>`. This can
    also be a tuple of modes specifying the mode to use on each axis in
    ``axes``.
axes : 2-tuple of ints, optional
    Axes over which to compute the DWT. Repeated elements mean the DWT will
    be performed multiple times along these axes.

Returns
-------
(cA, (cH, cV, cD)) : tuple
    Approximation, horizontal detail, vertical detail and diagonal
    detail coefficients respectively.  Horizontal refers to array axis 0
    (or ``axes[0]`` for user-specified ``axes``).

Examples
--------
>>> import numpy as np
>>> import pywt
>>> data = np.ones((4,4), dtype=np.float64)
>>> coeffs = pywt.dwt2(data, 'haar')
>>> cA, (cH, cV, cD) = coeffs
>>> cA
array([[ 2.,  2.],
       [ 2.,  2.]])
>>> cV
array([[ 0.,  0.],
       [ 0.,  0.]])

úExpected 2 axesz8Input array has fewer dimensions than the specified axesÚaaÚdaÚadÚdd)ÚtupleÚnpÚasarrayÚlenÚ
ValueErrorÚndimÚuniqueÚdwtn)ÚdataÚwaveletÚmodeÚaxesÚcoefss   &&&& ÚO/home/luca/screen-checking/.venv/lib/python3.14/site-packages/pywt/_multidim.pyÚdwt2r      sŽ   € ôR �‹;€DÜ�:Š:�dÓ€DÜ
ˆ4ƒy�A„~ÜÐ*Ó+Ð+Ø‡y�y”3”r—y’y “Ó'Ô'Üð  ó !ð 	!ô � Ó+€EØ��;˜˜t� e¨D¥k°5¸µ;Ð?Ð?Ð?ó    c                óŠ   € V w  pw  rVp\        V4      p\        V4      ^8w  d   \        R4      hRVRVRVRV/p \        WW#4      # )a:  
2-D Inverse Discrete Wavelet Transform.

Reconstructs data from coefficient arrays.

Parameters
----------
coeffs : tuple
    (cA, (cH, cV, cD)) A tuple with approximation coefficients and three
    details coefficients 2D arrays like from ``dwt2``.  If any of these
    components are set to ``None``, it will be treated as zeros.
wavelet : Wavelet object or name string, or 2-tuple of wavelets
    Wavelet to use.  This can also be a tuple containing a wavelet to
    apply along each axis in ``axes``.
mode : str or 2-tuple of strings, optional
    Signal extension mode, see :ref:`Modes <ref-modes>`. This can
    also be a tuple of modes specifying the mode to use on each axis in
    ``axes``.
axes : 2-tuple of ints, optional
    Axes over which to compute the IDWT. Repeated elements mean the IDWT
    will be performed multiple times along these axes.

Examples
--------
>>> import numpy as np
>>> import pywt
>>> data = np.array([[1,2], [3,4]], dtype=np.float64)
>>> coeffs = pywt.dwt2(data, 'haar')
>>> pywt.idwt2(coeffs, 'haar')
array([[ 1.,  2.],
       [ 3.,  4.]])

r	   r
   r   r   r   )r   r   r   Úidwtn)Úcoeffsr   r   r   ÚLLÚHLÚLHÚHHs   &&&&    r   Úidwt2r%   J   sV   € ðF Ñ€B‰ˆ�Ü�‹;€DÜ
ˆ4ƒy�A„~ÜÐ*Ó+Ð+à�B˜˜b $¨¨D°"Ð5€FÜ� $Ó-Ð-r   c                óP  € \         P                  ! V 4      p V P                  \         P                  ! R4      8X  d   \        R4      hV P                  ^8  d   \        R4      hVf   \        V P                  4      pV Uu. uF  qD^ 8  d   W@P                  ,           MTNK  	  pp\        W#4      p\        W4      pRV 3.p\        W6V4       FH  w  r‰p. p
V F8  w  r¼\        WÉW(4      w  rÞV
P                  VR,           V3VR,           V3.4       K:  	  T
pKJ  	  \        V4      # u upi )a¿  
Single-level n-dimensional Discrete Wavelet Transform.

Parameters
----------
data : array_like
    n-dimensional array with input data.
wavelet : Wavelet object or name string, or tuple of wavelets
    Wavelet to use.  This can also be a tuple containing a wavelet to
    apply along each axis in ``axes``.
mode : str or tuple of string, optional
    Signal extension mode used in the decomposition,
    see :ref:`Modes <ref-modes>`. This can also be a tuple of modes
    specifying the mode to use on each axis in ``axes``.
axes : sequence of ints, optional
    Axes over which to compute the DWT. Repeated elements mean the DWT will
    be performed multiple times along these axes. A value of ``None`` (the
    default) selects all axes.

    Axes may be repeated, but information about the original size may be
    lost if it is not divisible by ``2 ** nrepeats``. The reconstruction
    will be larger, with additional values derived according to the
    ``mode`` parameter. ``pywt.wavedecn`` should be used for multilevel
    decomposition.

Returns
-------
coeffs : dict
    Results are arranged in a dictionary, where key specifies
    the transform type on each dimension and value is a n-dimensional
    coefficients array.

    For example, for a 2D case the result will look something like this::

        {'aa': <coeffs>  # A(LL) - approx. on 1st dim, approx. on 2nd dim
         'ad': <coeffs>  # V(LH) - approx. on 1st dim, det. on 2nd dim
         'da': <coeffs>  # H(HL) - det. on 1st dim, approx. on 2nd dim
         'dd': <coeffs>  # D(HH) - det. on 1st dim, det. on 2nd dim
        }

    For user-specified ``axes``, the order of the characters in the
    dictionary keys map to the specified ``axes``.

Úobjectz"Input must be a numeric array-likezInput data must be at least 1DÚ ÚaÚd)r   r   ÚdtypeÚ	TypeErrorr   r   Úranger   r   Úzipr   ÚextendÚdict)r   r   r   r   r)   ÚmodesÚwaveletsr    ÚaxisÚwavÚ
new_coeffsÚsubbandÚxÚcAÚcDs   &&&&           r   r   r   v   s  € ôZ �:Š:�dÓ€Dà‡z�z”R—X’X˜hÓ'Ô'ÜÐ<Ó=Ð=Ø‡y�y�1„}ÜÐ9Ó:Ð:à‚|Ü�T—Y‘YÓˆÙ37Ó8±4¨a œUˆA—	‘	ŽM¨Ò)±4€DÐ8ä˜DÓ'€EÜ! 'Ó0€Hà�4ˆjˆ\€FÜ˜t¨uÖ5‰ˆ�4Øˆ
Û ‰JˆGÜ˜a dÓ1‰FˆBØ×Ñ ¨#¥¨rÐ2Ø '¨#¥¨rÐ2ð4ö 5ñ !ð Šñ 6ô �‹<Ðùò 9s   Â #D#c                 ó^  € V P                  4        UUu. uF  w  rVe   K  VNK  	  pppV'       d   \        RV R24      hV P                  4        UUu. uF"  w  r\        V4      \        R4      8:  d   K   VNK$  	  pppV'       d   \        RV R24      hV  Uu. uF  p\        V4      NK  	  pp\        \        P
                  ! V4      4      ^8”  d   \        R4      hV P                  4        UUu/ uF  w  rV\        P                  ! V4      bK  	  upp# u uppi u uppi u upi u uppi )Nz4The following detail coefficients were set to None:
zr
For multilevel transforms, rather than setting
	coeffs[key] = None
use
	coeffs[key] = np.zeros_like(coeffs[key])
r   zLThe following invalid keys were found in the detail coefficient dictionary: Ú.z4All detail coefficient names must have equal length.)Úitemsr   Úsetr   r   r   r   )r    ÚkÚvÚmissing_keysÚinvalid_keysÚkey_lengthss   &     r   Ú_fix_coeffsrC   ¼   s  € Ø"(§,¡,¤.Ô>¡.™$˜!°A—A�A¡.€LÑ>ßÜØCØˆnð ;ð;ó<ð 	<ð #)§,¡,¤.ô -¡.™$˜!Ü˜A›¤# d£)Ñ+÷ �A¡.€Lñ -çÜð'Ø'3 n°Að7ó8ð 	8ñ $*Ó*¡6˜a”3�q–6¡6€KÐ*Ü
Œ2�9Š9�[Ó!Ó" QÔ&ÜØBóDð 	Dð *0¯©¬Ô8©¡ ˆAŒr�zŠz˜!‹}Ò©Ò8Ð8ùó- ?ùó-ùò +ùó
 9s"   ”D¡DÁDÁ6DÂD$Ã2"D)c                óÂ  aa€ V P                  4        UUu/ uF  w  rEVf   K  WEbK  	  p ppV P                  4        UUu/ uF  w  rEVf   K  WEbK  	  p pp\        V 4      p \        R V  4       4      o V3R lV P                  4        4       p\        V4      o\        ;QJ d    T3R lT 4       F  '       g   K   RM	  RM! T3R lT 4       4      '       d   \        R4      hTf   \        S4      pSpM\        S4      pT Uu. uF  qˆ^ 8  d	   Y‡,           MTNK  	  pp\        Y#4      p	\        Y4      p
\        \        \        \        Y:T	4      4      4      4       EFG  w  pw  rÍpT^ 8  g   YÇ8¼  d   \        R	4      h/ p\!        R
TR7       Uu. uF  pRP#                  T4      NK  	  ppT Fð  pT P%                  TR,           R4      pT P%                  TR,           R4      pTe§   Te£   TP&                  TP&                  8w  dˆ   TP&                  P(                  R8X  g   TP&                  P(                  R8X  d   \*        P,                  pM\*        P.                  p\*        P0                  ! TTR7      p\*        P0                  ! TTR7      p\3        TTYÒT4      TT&   Kò  	  Tp EKJ  	  T R,          # u uppi u uppi   \         d    \        R4      hi ; iu upi u upi )aö  
Single-level n-dimensional Inverse Discrete Wavelet Transform.

Parameters
----------
coeffs: dict
    Dictionary as in output of ``dwtn``. Missing or ``None`` items
    will be treated as zeros.
wavelet : Wavelet object or name string, or tuple of wavelets
    Wavelet to use.  This can also be a tuple containing a wavelet to
    apply along each axis in ``axes``.
mode : str or list of string, optional
    Signal extension mode used in the decomposition,
    see :ref:`Modes <ref-modes>`. This can also be a tuple of modes
    specifying the mode to use on each axis in ``axes``.
axes : sequence of ints, optional
    Axes over which to compute the IDWT. Repeated elements mean the IDWT
    will be performed multiple times along these axes. A value of ``None``
    (the default) selects all axes.

    For the most accurate reconstruction, the axes should be provided in
    the same order as they were provided to ``dwtn``.

Returns
-------
data: ndarray
    Original signal reconstructed from input data.

Nc              3   ó8   "  € T F  p\        V4      x € K  	  R # 5i©N)r   )Ú.0Úkeys   & r   Ú	<genexpr>Úidwtn.<locals>.<genexpr>   s   é € Ð4©V cœ˜SŸ˜«Vùs   ‚c              3   óp   <"  € T F+  w  rVf   K  \        V4      S8X  g   K  VP                  x € K-  	  R # 5irF   )r   Úshape)rG   r>   r?   Úndim_transforms   &  €r   rI   rJ     s3   øé € ð G©N¡D AØô  Ü-0°«V°~Ñ-Eô  ˜Ÿž«Nùs   ƒ6�6¢6z8`coeffs` must contain at least one non-null wavelet bandc              3   ó,   <"  € T F	  qS8g  x € K  	  R # 5irF   © )rG   ÚsÚcoeff_shapes   & €r   rI   rJ   	  s   øé € Ð
2¡\ �Ö£\ùs   ƒTFz,`coeffs` must all be of equal size (or None)z!Axis greater than data dimensionsr   )Úrepeatr(   r)   r*   Úc)r+   )r<   rC   ÚmaxÚnextÚStopIterationr   Úanyr-   r   r   r   ÚreversedÚlistÚ	enumerater.   r   r   ÚjoinÚgetr+   Úkindr   Ú
complex128Úfloat64r   r   )r    r   r   r   r>   r?   Úcoeff_shapesr   r)   r1   r2   Ú
key_lengthr3   r4   r5   ÚcoefÚnew_keysrH   ÚLÚHr+   rQ   rM   s   &&&&                 @@r   r   r   Ö   sz  ù€ ð@  &Ÿ|™|œ~Ô?™~‘t�q°ŒdˆaŠd™~€FÑ?ð  &Ÿ|™|œ~Ô?™~‘t�q°ŒdˆaŠd™~€FÑ?ô ˜Ó €Fô Ñ4©VÓ4Ó4€Nð!ôG¨F¯L©L¬Nó Gˆä˜<Ó(ˆ÷ ƒsÔ
2¡\Ó
2‡s‡s‚sÔ
2¡\Ó
2×2Ò2ÜÐGÓHÐHà‚|Ü�^Ó$ˆØ‰ä�;ÓˆÙ.2Ó3©d¨˜AœˆAŽH 1Ò$©d€DÐ3ä˜DÓ'€EÜ! 'Ó0€HÜ)1Ü”œ3˜t¨uÓ5Ó6Ó7÷*9Ñ%ˆ
Ñ%�T à�!Œ8�t”|ÜÐ?Ó@Ð@àˆ
Ü.5°dÀ:Õ.NÓOÑ.N d�B—G‘G˜D–MÑ.NˆÐOãˆCØ—
‘
˜3 �9 dÓ+ˆAØ—
‘
˜3 �9 dÓ+ˆAØŠ} ¢Ø—7‘7˜aŸg™gÔ%à—w‘w—|‘| sÔ*¨a¯g©g¯l©l¸cÔ.AÜ "§¡™ä "§
¡
˜ÜŸ
š
 1¨EÔ2�AÜŸ
š
 1¨EÔ2�AÜ'¨¨1¨c¸Ó>ˆJ�s‹Oñ ð ‹ñ+*9ð. �"�:Ðùóm @ùó @øô ô !Üð  ó !ð 	!ð!üò 4ùò Ps-   –J1£J1¿J7ÁJ7Á3%J= ÄKÆKÊ=K)r   r%   r   r   )Ú	symmetric)éþÿÿÿéÿÿÿÿ)rf   N)Ú__doc__Ú	itertoolsr   Únumpyr   Ú_extensions._dwtr   r   Ú_utilsr   r   r   Ú__all__r   r%   r   rC   r   rO   r   r   Ú<module>ro      s?   ðñõ
 ã ç 1ß BÑ Bâ
,€ô2@ôj).ôXCòL9ö4Vr   