+
    LV-jf   ã                   óX   € R t ^ RItR	R ltR
R ltR
R ltR
R ltR
R ltR
R ltRR lt	R# )z-
Functions for acting on a axis of an array.
Nc                ó€   € \        R4      .V P                  ,          p\        WV4      WT&   V \        V4      ,          pV# )a´  Take a slice along axis 'axis' from 'a'.

Parameters
----------
a : numpy.ndarray
    The array to be sliced.
start, stop, step : int or None
    The slice parameters.
axis : int, optional
    The axis of `a` to be sliced.

Examples
--------
>>> import numpy as np
>>> from scipy.signal._arraytools import axis_slice
>>> a = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
>>> axis_slice(a, start=0, stop=1, axis=1)
array([[1],
       [4],
       [7]])
>>> axis_slice(a, start=1, axis=0)
array([[4, 5, 6],
       [7, 8, 9]])

Notes
-----
The keyword arguments start, stop and step are used by calling
slice(start, stop, step). This implies axis_slice() does not
handle its arguments the exactly the same as indexing. To select
a single index k, for example, use
    axis_slice(a, start=k, stop=k+1)
In this case, the length of the axis 'axis' in the result will
be 1; the trivial dimension is not removed. (Use numpy.squeeze()
to remove trivial axes.)
N)ÚsliceÚndimÚtuple)ÚaÚstartÚstopÚstepÚaxisÚa_sliceÚbs   &&&&&  Úi/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/scipy/signal/_arraytools.pyÚ
axis_slicer      s:   € ôH �T‹{ˆm˜aŸf™fÕ$€GÜ˜% tÓ,€G�MØ	Œ%�‹.Õ€AØ€Hó    c                ó   € \        V RVR7      # )z]Reverse the 1-D slices of `a` along axis `axis`.

Returns axis_slice(a, step=-1, axis=axis).
)r	   r
   éÿÿÿÿ)r   )r   r
   s   &&r   Úaxis_reverser   1   s   € ô
 �a˜b tÔ,Ð,r   c                ó   € V^8  d   V # WP                   V,          ^,
          8”  d,   \        RWP                   V,          ^,
          3,          4      h\        V ^ ^VR7      p\        W^ RVR7      p\        V RVR7      p\        V RV^,           ) RVR7      p\        P                  ! ^V,          V,
          V ^V,          V,
          3VR7      pV# )aØ  
Odd extension at the boundaries of an array

Generate a new ndarray by making an odd extension of `x` along an axis.

Parameters
----------
x : ndarray
    The array to be extended.
n : int
    The number of elements by which to extend `x` at each end of the axis.
axis : int, optional
    The axis along which to extend `x`. Default is -1.

Examples
--------
>>> import numpy as np
>>> from scipy.signal._arraytools import odd_ext
>>> a = np.array([[1, 2, 3, 4, 5], [0, 1, 4, 9, 16]])
>>> odd_ext(a, 2)
array([[-1,  0,  1,  2,  3,  4,  5,  6,  7],
       [-4, -1,  0,  1,  4,  9, 16, 23, 28]])

Odd extension is a "180 degree rotation" at the endpoints of the original
array:

>>> t = np.linspace(0, 1.5, 100)
>>> a = 0.9 * np.sin(2 * np.pi * t**2)
>>> b = odd_ext(a, 40)
>>> import matplotlib.pyplot as plt
>>> plt.plot(np.arange(-40, 140), b, 'b', lw=1, label='odd extension')
>>> plt.plot(np.arange(100), a, 'r', lw=2, label='original')
>>> plt.legend(loc='best')
>>> plt.show()
©r   r   r
   ©r   r   r	   r
   ©r   r
   ©r
   úXThe extension length n (%d) is too big. It must not exceed x.shape[axis]-1, which is %d.r   éþÿÿÿ©ÚshapeÚ
ValueErrorr   ÚnpÚconcatenate)ÚxÚnr
   Úleft_endÚleft_extÚ	right_endÚ	right_extÚexts   &&&     r   Úodd_extr&   9   sÐ   € ðH 	ˆ1„uØˆØ�7‰7�4�=˜1ÕÔÜð LàŸw™w t�}¨qÕ0Ð1õ2ó 3ð 	3ô ˜! 1¨1°4Ô8€HÜ˜!¨1°2¸DÔA€HÜ˜1 B¨TÔ2€IÜ˜1 B¨q°1­u¨X¸BÀTÔJ€IÜ
�.Š.˜!˜h�,¨Õ1ØØ˜i�-¨)Õ3ð5ð #ô$€Cð €Jr   c                ó.  € V^8  d   V # WP                   V,          ^,
          8”  d,   \        RWP                   V,          ^,
          3,          4      h\        W^ RVR7      p\        V RV^,           ) RVR7      p\        P                  ! VV V3VR7      pV# )aÙ  
Even extension at the boundaries of an array

Generate a new ndarray by making an even extension of `x` along an axis.

Parameters
----------
x : ndarray
    The array to be extended.
n : int
    The number of elements by which to extend `x` at each end of the axis.
axis : int, optional
    The axis along which to extend `x`. Default is -1.

Examples
--------
>>> import numpy as np
>>> from scipy.signal._arraytools import even_ext
>>> a = np.array([[1, 2, 3, 4, 5], [0, 1, 4, 9, 16]])
>>> even_ext(a, 2)
array([[ 3,  2,  1,  2,  3,  4,  5,  4,  3],
       [ 4,  1,  0,  1,  4,  9, 16,  9,  4]])

Even extension is a "mirror image" at the boundaries of the original array:

>>> t = np.linspace(0, 1.5, 100)
>>> a = 0.9 * np.sin(2 * np.pi * t**2)
>>> b = even_ext(a, 40)
>>> import matplotlib.pyplot as plt
>>> plt.plot(np.arange(-40, 140), b, 'b', lw=1, label='even extension')
>>> plt.plot(np.arange(100), a, 'r', lw=2, label='original')
>>> plt.legend(loc='best')
>>> plt.show()
r   r   r   r   r   r   )r   r    r
   r"   r$   r%   s   &&&   r   Úeven_extr(   n   s    € ðF 	ˆ1„uØˆØ�7‰7�4�=˜1ÕÔÜð LàŸw™w t�}¨qÕ0Ð1õ2ó 3ð 	3ô ˜!¨1°2¸DÔA€HÜ˜1 B¨q°1­u¨X¸BÀTÔJ€IÜ
�.Š.˜(ØØ#ð%ð #ô$€Cð €Jr   c                ó  € V^8  d   V # \        V ^ ^VR7      p^.V P                  ,          pWV&   \        P                  ! W@P                  R7      pWS,          p\        V RVR7      pWW,          p\        P
                  ! VV V3VR7      p	V	# )a7  
Constant extension at the boundaries of an array

Generate a new ndarray that is a constant extension of `x` along an axis.

The extension repeats the values at the first and last element of
the axis.

Parameters
----------
x : ndarray
    The array to be extended.
n : int
    The number of elements by which to extend `x` at each end of the axis.
axis : int, optional
    The axis along which to extend `x`. Default is -1.

Examples
--------
>>> import numpy as np
>>> from scipy.signal._arraytools import const_ext
>>> a = np.array([[1, 2, 3, 4, 5], [0, 1, 4, 9, 16]])
>>> const_ext(a, 2)
array([[ 1,  1,  1,  2,  3,  4,  5,  5,  5],
       [ 0,  0,  0,  1,  4,  9, 16, 16, 16]])

Constant extension continues with the same values as the endpoints of the
array:

>>> t = np.linspace(0, 1.5, 100)
>>> a = 0.9 * np.sin(2 * np.pi * t**2)
>>> b = const_ext(a, 40)
>>> import matplotlib.pyplot as plt
>>> plt.plot(np.arange(-40, 140), b, 'b', lw=1, label='constant extension')
>>> plt.plot(np.arange(100), a, 'r', lw=2, label='original')
>>> plt.legend(loc='best')
>>> plt.show()
r   ©Údtyper   r   r   )r   r   r   Úonesr+   r   )
r   r    r
   r!   Ú
ones_shaper,   r"   r#   r$   r%   s
   &&&       r   Ú	const_extr.       sŽ   € ðN 	ˆ1„uØˆÜ˜! 1¨1°4Ô8€HØ��q—v‘v•€JØˆtÑÜ�7Š7�:§W¡WÔ-€DØ�€HÜ˜1 B¨TÔ2€IØÕ €IÜ
�.Š.˜(ØØ#ð%ð #ô$€Cð €Jr   c                óÀ   € V^8  d   V # \        V P                  4      pWV&   \        P                  ! W0P                  R7      p\        P
                  ! W@V3VR7      pV# )a^  
Zero padding at the boundaries of an array

Generate a new ndarray that is a zero-padded extension of `x` along
an axis.

Parameters
----------
x : ndarray
    The array to be extended.
n : int
    The number of elements by which to extend `x` at each end of the
    axis.
axis : int, optional
    The axis along which to extend `x`. Default is -1.

Examples
--------
>>> import numpy as np
>>> from scipy.signal._arraytools import zero_ext
>>> a = np.array([[1, 2, 3, 4, 5], [0, 1, 4, 9, 16]])
>>> zero_ext(a, 2)
array([[ 0,  0,  1,  2,  3,  4,  5,  0,  0],
       [ 0,  0,  0,  1,  4,  9, 16,  0,  0]])
r*   r   )Úlistr   r   Úzerosr+   r   )r   r    r
   Úzeros_shaper1   r%   s   &&&   r   Úzero_extr3   ×   sQ   € ð4 	ˆ1„uØˆÜ�q—w‘w“-€KØ�ÑÜ�HŠH�[¯©Ô0€EÜ
�.Š.˜% EÐ*°Ô
6€CØ€Jr   c                óž   € V f   V'       g   \        R4      h V # \        P                  ! V 4      '       g   \        R4      h\        V 4      p V # )zæ
Check if the given sampling frequency is a scalar and raises an exception
otherwise. If allow_none is False, also raises an exception for none
sampling rates. Returns the sampling frequency as float or none if the
input is none.
z#Sampling frequency can not be none.z.Sampling frequency fs must be a single scalar.)r   r   ÚisscalarÚfloat)ÚfsÚ
allow_nones   &&r   Ú_validate_fsr9   ú   sM   € ð 
‚zßÜÐBÓCÐCð ð €Iô �{Š{˜2�ŠÜÐMÓNÐNÜ�2‹YˆØ€Ir   )NNNr   )r   )T)
Ú__doc__Únumpyr   r   r   r&   r(   r.   r3   r9   © r   r   Ú<module>r=      s7   ðñó ô'ôT-ô2ôj/ôd4ôn öFr   