403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/scipy/signal/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/scipy/signal/__pycache__/_arraytools.cpython-311.pyc
�

d�cA��B�dZddlZd
d�Zdd�Zdd�Zdd�Zdd�Zdd	�ZdS)z-
Functions for acting on a axis of an array.
�N���c��td��g|jz}t|||��||<|t|��}|S)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
    --------
    >>> a = 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       �:/usr/lib/python3/dist-packages/scipy/signal/_arraytools.py�
axis_slicersC��D�T�{�{�m�a�f�$�G��%��t�,�,�G�D�M�	�%��.�.��A��H�c�&�t|d|���S)zeReverse the 1-D slices of `a` along axis `axis`.

    Returns axis_slice(a, step=-1, axis=axis).
    r)rr)r)rrs  r�axis_reverser/s��
�a�b�t�,�,�,�,rc�n�|dkr|S||j|dz
kr"td||j|dz
fz���t|dd|���}t||dd|���}t|d|���}t|d|d	zd|���}tjd	|z|z
|d	|z|z
f|�
��}|S)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
    --------
    >>> 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(arange(-40, 140), b, 'b', lw=1, label='odd extension')
    >>> plt.plot(arange(100), a, 'r', lw=2, label='original')
    >>> plt.legend(loc='best')
    >>> plt.show()
    ��XThe extension length n (%d) is too big. It must not exceed x.shape[axis]-1, which is %d.r�r	r
rr�r	r
rr�r	r�����r��shape�
ValueErrorr�np�concatenate)�x�nr�left_end�left_ext�	right_end�	right_ext�exts        r�odd_extr)7s���F	�1�u�u����1�7�4�=�1�����L��q�w�t�}�q�0�1�2�3�3�	3��!�1�1�4�8�8�8�H��!�1�1�2�D�A�A�A�H��1�B�T�2�2�2�I��1�B�q�1�u�X�B�T�J�J�J�I�
�.�!�h�,��1���i�-�)�3�5�#�$�$�$�C��Jrc��|dkr|S||j|dz
kr"td||j|dz
fz���t||dd|���}t|d|dzd|���}tj|||f|���}|S)	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
    --------
    >>> 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(arange(-40, 140), b, 'b', lw=1, label='even extension')
    >>> plt.plot(arange(100), a, 'r', lw=2, label='original')
    >>> plt.legend(loc='best')
    >>> plt.show()
    rrrrrrrrr)r"r#rr%r'r(s      r�even_extr+ks���D	�1�u�u����1�7�4�=�1�����L��q�w�t�}�q�0�1�2�3�3�	3��!�1�1�2�D�A�A�A�H��1�B�q�1�u�X�B�T�J�J�J�I�
�.�(��#�%�#�$�$�$�C��Jrc��|dkr|St|dd|���}dg|jz}|||<tj||j���}||z}t|d|���}||z}tj|||f|���}	|	S)a�
    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
    --------
    >>> 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(arange(-40, 140), b, 'b', lw=1, label='constant extension')
    >>> plt.plot(arange(100), a, 'r', lw=2, label='original')
    >>> plt.legend(loc='best')
    >>> plt.show()
    rrr��dtyperrr)rrr �onesr.r!)
r"r#rr$�
ones_shaper/r%r&r'r(s
          r�	const_extr1�s���L	�1�u�u����!�1�1�4�8�8�8�H���q�v��J��J�t��
�7�:�Q�W�-�-�-�D��h��H��1�B�T�2�2�2�I��y� �I�
�.�(��#�%�#�$�$�$�C��Jrc��|dkr|St|j��}|||<tj||j���}tj|||f|���}|S)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
    --------
    >>> 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]])
    rr-r)�listrr �zerosr.r!)r"r#r�zeros_shaper4r(s      r�zero_extr6�s_��2	�1�u�u����q�w�-�-�K��K����H�[���0�0�0�E�
�.�%��E�*��
6�
6�
6�C��Jr)NNNr)r)	�__doc__�numpyr rrr)r+r1r6�rr�<module>r:s���������%
�%
�%
�%
�P-�-�-�-�1�1�1�1�h.�.�.�.�b3�3�3�3�l�����r

Youez - 2016 - github.com/yon3zu
LinuXploit