L il\ddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl m Z ddlmZgd Zed d ej"d fd Zed ej"d fdZdZe ddZe ddZe ddZe ddZe ddddZe ddZy)N)normalize_axis_index)array_api_extra)special) _ni_support) _nd_image) docfiller)spline_filter1d spline_filtergeometric_transformmap_coordinatesaffine_transformshiftzoomrotatemirrorc |dks|dkDr tdtj|}tj|}t j |||}|rHt |j|||j|t |j|||j||S|dvrtj||d<|St j|}t||j}tj ||||||S)aG Calculate a 1-D spline filter along the given axis. The lines of the array along the given axis are filtered by a spline filter. The order of the spline must be >= 2 and <= 5. Parameters ---------- %(input)s order : int, optional The order of the spline, default is 3. axis : int, optional The axis along which the spline filter is applied. Default is the last axis. output : ndarray or dtype, optional The array in which to place the output, or the dtype of the returned array. Default is ``numpy.float64``. %(mode_interp_mirror)s Returns ------- spline_filter1d : ndarray The filtered input. See Also -------- spline_filter : Multidimensional spline filter. Notes ----- All of the interpolation functions in `ndimage` do spline interpolation of the input image. If using B-splines of `order > 1`, the input image values have to be converted to B-spline coefficients first, which is done by applying this 1-D filter sequentially along all axes of the input. All functions that require B-spline coefficients will automatically filter their inputs, a behavior controllable with the `prefilter` keyword argument. For functions that accept a `mode` parameter, the result will only be correct if it matches the `mode` used when filtering. For complex-valued `input`, this function processes the real and imaginary components independently. .. versionadded:: 1.6.0 Complex-valued support added. Examples -------- We can filter an image using 1-D spline along the given axis: >>> from scipy.ndimage import spline_filter1d >>> import numpy as np >>> import matplotlib.pyplot as plt >>> orig_img = np.eye(20) # create an image >>> orig_img[10, :] = 1.0 >>> sp_filter_axis_0 = spline_filter1d(orig_img, axis=0) >>> sp_filter_axis_1 = spline_filter1d(orig_img, axis=1) >>> f, ax = plt.subplots(1, 3, sharex=True) >>> for ind, data in enumerate([[orig_img, "original image"], ... [sp_filter_axis_0, "spline filter (axis=0)"], ... [sp_filter_axis_1, "spline filter (axis=1)"]]): ... ax[ind].imshow(data[0], cmap='gray_r') ... ax[ind].set_title(data[1]) >>> plt.tight_layout() >>> plt.show() rspline order not supportedcomplex_outputrr.) RuntimeErrornpasarray iscomplexobjr _get_outputr realimagarray_extend_mode_to_coderndimr)inputorderaxisoutputmoders b/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/scipy/ndimage/_interpolation.pyr r 0sL qyEAI788 JJu E__U+N  $ $VU4BDF E4dC E4dC  hhuos M//5#D%**5!!%fdC Mc|dks|dkDr tdtj|}tj|}t j |||}|rFt |j||j|t |j||j||S|dvr=|jdkDr.t|jD]}t||||||}|S|d|d<|S) a Multidimensional spline filter. Parameters ---------- %(input)s order : int, optional The order of the spline, default is 3. output : ndarray or dtype, optional The array in which to place the output, or the dtype of the returned array. Default is ``numpy.float64``. %(mode_interp_mirror)s Returns ------- spline_filter : ndarray Filtered array. Has the same shape as `input`. See Also -------- spline_filter1d : Calculate a 1-D spline filter along the given axis. Notes ----- The multidimensional filter is implemented as a sequence of 1-D spline filters. The intermediate arrays are stored in the same data type as the output. Therefore, for output types with a limited precision, the results may be imprecise because intermediate results may be stored with insufficient precision. For complex-valued `input`, this function processes the real and imaginary components independently. .. versionadded:: 1.6.0 Complex-valued support added. Examples -------- We can filter an image using multidimensional splines: >>> from scipy.ndimage import spline_filter >>> import numpy as np >>> import matplotlib.pyplot as plt >>> orig_img = np.eye(20) # create an image >>> orig_img[10, :] = 1.0 >>> sp_filter = spline_filter(orig_img, order=3) >>> f, ax = plt.subplots(1, 2, sharex=True) >>> for ind, data in enumerate([[orig_img, "original image"], ... [sp_filter, "spline filter"]]): ... ax[ind].imshow(data[0], cmap='gray_r') ... ax[ind].set_title(data[1]) >>> plt.tight_layout() >>> plt.show() rrrrrr(r).) rrrrrrr r r!r$ranger )r%r&r(r)rr's r*r r sr qyEAI788 JJu E__U+N  $ $VU4BDFejj%d;ejj%d;  FuzzA~%**% D E5$vD IE  MCjs Mr+c|dvrEd}|dk(rtj||d|}||fS|dk(rtj||d}|fSd }|}||fS) N)nearest grid-constant r2constant)r)constant_valuesr1edge)r)r)rpad)r%r)cvalnpadpaddeds r*_prepad_for_spline_filterr;sy ++ ? "VVE4j/35F 4<Y VVE4f5F 4< 4<r+c  | i} |dks|dkDr tdtj|}| |j}|jdkst |dkr tdtj |} tj|||| }| rt|||||| } t|j|f|jtj|d | t|j|f|jtj|d | |S|r3|dkDr.t|||\} } t| |tj| }nd} |}tj |}t#j||ddd||||| || |S) a Apply an arbitrary geometric transform. The given mapping function is used to find, for each point in the output, the corresponding coordinates in the input. The value of the input at those coordinates is determined by spline interpolation of the requested order. Parameters ---------- %(input)s mapping : {callable, scipy.LowLevelCallable} A callable object that accepts a tuple of length equal to the output array rank, and returns the corresponding input coordinates as a tuple of length equal to the input array rank. output_shape : tuple of ints, optional Shape tuple. %(output)s order : int, optional The order of the spline interpolation, default is 3. The order has to be in the range 0-5. %(mode_interp_constant)s %(cval)s %(prefilter)s extra_arguments : tuple, optional Extra arguments passed to `mapping`. extra_keywords : dict, optional Extra keywords passed to `mapping`. Returns ------- output : ndarray The filtered input. See Also -------- map_coordinates, affine_transform, spline_filter1d Notes ----- This function also accepts low-level callback functions with one the following signatures and wrapped in `scipy.LowLevelCallable`: .. code:: c int mapping(npy_intp *output_coordinates, double *input_coordinates, int output_rank, int input_rank, void *user_data) int mapping(intptr_t *output_coordinates, double *input_coordinates, int output_rank, int input_rank, void *user_data) The calling function iterates over the elements of the output array, calling the callback function at each element. The coordinates of the current output element are passed through ``output_coordinates``. The callback function must return the coordinates at which the input must be interpolated in ``input_coordinates``. The rank of the input and output arrays are given by ``input_rank`` and ``output_rank`` respectively. ``user_data`` is the data pointer provided to `scipy.LowLevelCallable` as-is. The callback function must return an integer error status that is zero if something went wrong and one otherwise. If an error occurs, you should normally set the Python error status with an informative message before returning, otherwise a default error message is set by the calling function. In addition, some other low-level function pointer specifications are accepted, but these are for backward compatibility only and should not be used in new code. For complex-valued `input`, this function transforms the real and imaginary components independently. .. versionadded:: 1.6.0 Complex-valued support added. Examples -------- >>> import numpy as np >>> from scipy.ndimage import geometric_transform >>> a = np.arange(12.).reshape((4, 3)) >>> def shift_func(output_coords): ... return (output_coords[0] - 0.5, output_coords[1] - 0.5) ... >>> geometric_transform(a, shift_func) array([[ 0. , 0. , 0. ], [ 0. , 1.362, 2.738], [ 0. , 4.812, 6.187], [ 0. , 8.263, 9.637]]) >>> b = [1, 2, 3, 4, 5] >>> def shift_func(output_coords): ... return (output_coords[0] - 3,) ... >>> geometric_transform(b, shift_func, mode='constant') array([0, 0, 0, 1, 2]) >>> geometric_transform(b, shift_func, mode='nearest') array([1, 1, 1, 1, 2]) >>> geometric_transform(b, shift_func, mode='reflect') array([3, 2, 1, 1, 2]) >>> geometric_transform(b, shift_func, mode='wrap') array([2, 3, 4, 1, 2]) Nrrrr!input and output rank must be > 0shaper)r&r) prefilter output_shapeextra_argumentsextra_keywordsr(r8r.)rrrr?r$lenrrrdictr r r!r;r float64r#r)r%mappingrAr(r&r)r8r@rBrCrkwargsr:r9filtereds r*r r sZ qyEAI788 JJu E{{  zzA~\*Q.>??__U+N  $ $VU,4BDFE #/&5%35 EJJ : !# :28 :EJJ : !# :28 : UQY0dC  rzz&*,  + +D 1D !!(GT4v"'tT?"02 Mr+c|dks|dkDr tdtj|}tj|}tj|r t d|j dd}|j dkst|dkr td|j d|j k7r tdtj|}tj|||| }|r~t||| } t|j|f|jtj|d | t|j|f|jtj|d | |S|r3|dkDr.t|||\} } t| |tj | } nd} |} tj"|}t%j&| d|dd||||| dd |S) aZ Map the input array to new coordinates by interpolation. The array of coordinates is used to find, for each point in the output, the corresponding coordinates in the input. The value of the input at those coordinates is determined by spline interpolation of the requested order. The shape of the output is derived from that of the coordinate array by dropping the first axis. The values of the array along the first axis are the coordinates in the input array at which the output value is found. Parameters ---------- %(input)s coordinates : array_like The coordinates at which `input` is evaluated. %(output)s order : int, optional The order of the spline interpolation, default is 3. The order has to be in the range 0-5. %(mode_interp_constant)s %(cval)s %(prefilter)s Returns ------- map_coordinates : ndarray The result of transforming the input. The shape of the output is derived from that of `coordinates` by dropping the first axis. See Also -------- spline_filter, geometric_transform, scipy.interpolate Notes ----- For complex-valued `input`, this function maps the real and imaginary components independently. .. versionadded:: 1.6.0 Complex-valued support added. Examples -------- >>> from scipy import ndimage >>> import numpy as np >>> a = np.arange(12.).reshape((4, 3)) >>> a array([[ 0., 1., 2.], [ 3., 4., 5.], [ 6., 7., 8.], [ 9., 10., 11.]]) >>> ndimage.map_coordinates(a, [[0.5, 2], [0.5, 1]], order=1) array([ 2., 7.]) Above, the interpolated value of a[0.5, 0.5] gives output[0], while a[2, 1] is output[1]. >>> inds = np.array([[0.5, 2], [0.5, 4]]) >>> ndimage.map_coordinates(a, inds, order=1, cval=-33.3) array([ 2. , -33.3]) >>> ndimage.map_coordinates(a, inds, order=1, mode='nearest') array([ 2., 8.]) >>> ndimage.map_coordinates(a, inds, order=1, cval=0, output=bool) array([ True, False], dtype=bool) rrrzComplex type not supportedrNr=z"invalid shape for coordinate arrayr>r&r)r@rDr.)rrrr TypeErrorr?r$rErrrFr r r!r;r rGr#rr ) r% coordinatesr(r&r)r8r@rArrIr:r9rJs r*r r vsP qyEAI788 JJu E**[)K {#455$$QR(L zzA~\*Q.>??uzz)?@@__U+N  $ $VU,4BDFE B K 6 WWT] 6.4 6 K 6 WWT] 6.4 6 UQY0dC  rzzM  + +D 1D !!(D+tT"(%tT4O Mr+c |dks|dkDr tdtj|}|3t|tjr |j }n |j }|j dkst|dkr tdtj|} tj|||| }| rt|||||} t|j|f|jtj|d | t|j|f|jtj|d | |S|r3|dkDr.t|||\} } t!| |tj"| } nd} |} tj$|}tj|tj" }|j d vs|j ddkr td |j dk(r|j d|j dzk(r|j d|j |j dzfvr|j d|j dzk(rcdg|j zdgz}tj&||j |k(s*d|j d|j d|}t)||d|j |j f}|d|j d|j f}|j d|j k7r td|j dk(r'|j d|j k7r td|j*j,s|j/}tj0||j }tj|tj" }|j dk7s|j ddkr td|j*j,s|j/}|j dk(r"t3j4| |||z ||||| d |St3j6| dd||||||| dd |S)a Apply an affine transformation. Given an output image pixel index vector ``o``, the pixel value is determined from the input image at position ``np.dot(matrix, o) + offset``. This does 'pull' (or 'backward') resampling, transforming the output space to the input to locate data. Affine transformations are often described in the 'push' (or 'forward') direction, transforming input to output. If you have a matrix for the 'push' transformation, use its inverse (:func:`numpy.linalg.inv`) in this function. Parameters ---------- %(input)s matrix : ndarray The inverse coordinate transformation matrix, mapping output coordinates to input coordinates. If ``ndim`` is the number of dimensions of ``input``, the given matrix must have one of the following shapes: - ``(ndim, ndim)``: the linear transformation matrix for each output coordinate. - ``(ndim,)``: assume that the 2-D transformation matrix is diagonal, with the diagonal specified by the given value. A more efficient algorithm is then used that exploits the separability of the problem. - ``(ndim + 1, ndim + 1)``: assume that the transformation is specified using homogeneous coordinates [1]_. In this case, any value passed to ``offset`` is ignored. - ``(ndim, ndim + 1)``: as above, but the bottom row of a homogeneous transformation matrix is always ``[0, 0, ..., 1]``, and may be omitted. offset : float or sequence, optional The offset into the array where the transform is applied. If a float, `offset` is the same for each axis. If a sequence, `offset` should contain one value for each axis. output_shape : tuple of ints, optional Shape tuple. %(output)s order : int, optional The order of the spline interpolation, default is 3. The order has to be in the range 0-5. %(mode_interp_constant)s %(cval)s %(prefilter)s Returns ------- affine_transform : ndarray The transformed input. Examples -------- Use `affine_transform` to stretch an image:: >>> from scipy.ndimage import affine_transform >>> from scipy.datasets import face >>> from matplotlib import pyplot as plt >>> import numpy as np >>> im = face(gray=True) >>> matrix = (0.5, 2) >>> im2 = affine_transform(im, matrix) >>> plt.imshow(im2) >>> plt.show() Rotate an image by 90 degrees and project it onto an expanded canvas:: >>> matrix = ((0, 1), (1, 0)) >>> im3 = affine_transform(im, matrix, output_shape=(1024, 1024)) >>> plt.imshow(im3) >>> plt.show() Offset the rotation so that the image is centred:: >>> output_shape = (1200, 1200) >>> offset = (np.array(im.shape) - output_shape) / 2 >>> im4 = affine_transform(im, matrix, offset=offset, output_shape=output_shape) >>> plt.imshow(im4) >>> plt.show() Notes ----- The given matrix and offset are used to find for each point in the output the corresponding coordinates in the input by an affine transformation. The value of the input at those coordinates is determined by spline interpolation of the requested order. Points outside the boundaries of the input are filled according to the given mode. .. versionchanged:: 0.18.0 Previously, the exact interpretation of the affine transformation depended on whether the matrix was supplied as a 1-D or a 2-D array. If a 1-D array was supplied to the matrix parameter, the output pixel value at index ``o`` was determined from the input image at position ``matrix * (o + offset)``. For complex-valued `input`, this function transforms the real and imaginary components independently. .. versionadded:: 1.6.0 Complex-valued support added. References ---------- .. [1] https://en.wikipedia.org/wiki/Homogeneous_coordinates rrrNrr=r>)offsetrAr&r)r@rDr.dtype)rr-z no proper affine matrix providedr-z6Expected homogeneous transformation matrix with shape z for image shape z", but bottom row was not equal to z&affine matrix has wrong number of rowsz)affine matrix has wrong number of columnszno proper offset providedF)rrr isinstancendarrayr?r$rErrrrFrr r!r;r rGr#all ValueErrorflags contiguouscopy_normalize_sequencer zoom_shiftr )r%matrixrPrAr(r&r)r8r@rrIr:r9rJexptdmsgs r*rrsd qyEAI788 JJu E fbjj )!<??__U+N  $ $VU,4BDFV,e96V 7FKK ggdm 7/5 7V 7FKK ggdm 7/5 7 UQY0dC  rzzM  + +D 1D ZZbjj 1F {{& FLLOa$7=>> qV\\!_ Q> \\!_UZZ!^ < < <<?ejj1n ,C%**$s*E66&,56 & ~->u{{mL::?B!o%  UZZ/0  [ejj[01 ||A%**$CDD {{aFLLOv{{:FGG << " "  , ,VUZZ @F ZZbjj 1F {{a6<<?Q.677 << " " {{aXvvf}fe!4u 6 M %%hdFF&,eT4t&* , Mr+c |dks|dkDr tdtj|}|jdkr tdtj|}t j |||}|r~ddlm}t|||} ||j|f|jtj|d | ||j|f|jtj|d | |S|r3|dkDr.t|||\} } t| |tj| } nd} |} t j|}t j ||j}|D cgc]} | }} tj|tj }|j"j$s|j'}t)j*| d |||||| d |Scc} w)a Shift an array. The array is shifted using spline interpolation of the requested order. Points outside the boundaries of the input are filled according to the given mode. Parameters ---------- %(input)s shift : float or sequence The shift along the axes. If a float, `shift` is the same for each axis. If a sequence, `shift` should contain one value for each axis. %(output)s order : int, optional The order of the spline interpolation, default is 3. The order has to be in the range 0-5. %(mode_interp_constant)s %(cval)s %(prefilter)s Returns ------- shift : ndarray The shifted input. See Also -------- affine_transform : Affine transformations Notes ----- For complex-valued `input`, this function shifts the real and imaginary components independently. .. versionadded:: 1.6.0 Complex-valued support added. Examples -------- Import the necessary modules and an exemplary image. >>> from scipy.ndimage import shift >>> import matplotlib.pyplot as plt >>> from scipy import datasets >>> image = datasets.ascent() Shift the image vertically by 20 pixels. >>> image_shifted_vertically = shift(image, (20, 0)) Shift the image vertically by -200 pixels and horizontally by 100 pixels. >>> image_shifted_both_directions = shift(image, (-200, 100)) Plot the original and the shifted images. >>> fig, axes = plt.subplots(3, 1, figsize=(4, 12)) >>> plt.gray() # show the filtered result in grayscale >>> top, middle, bottom = axes >>> for ax in axes: ... ax.set_axis_off() # remove coordinate system >>> top.imshow(image) >>> top.set_title("Original image") >>> middle.imshow(image_shifted_vertically) >>> middle.set_title("Vertically shifted image") >>> bottom.imshow(image_shifted_both_directions) >>> bottom.set_title("Image shifted in both directions") >>> fig.tight_layout() rrrrr=r)rrLrDr.rQNF)rrrr$rrrscipy.ndimage._interpolationrrFr r!r;r rGr#rZrWrXrYrr[)r%rr(r&r)r8r@r_shiftrIr:r9rJiis r*rrsR qyEAI788 JJu E zzA~>??__U+N  $ $VU> RF@E Buzz5S2774=SFSuzz5S2774=SFS UQY0dC  rzzM  + +D 1D  + +E5:: >E !RbS !E ! JJuBJJ /E ;; ! !  4tTu& M "s$ GF) grid_modec |dks|dkDr tdtj|}|jdkr tdt j ||j}t t|j|D cgc]\}} tt|| zc} }} tj|} t j||| | }td|Dr+|r)tj|dj!|}|S| r~dd lm} t'||| } | |j(|f|j(tj(|d | | |j*|f|j*tj*|d | |S|r3|dkDr.t-|||\}}t/||tj0| }nd}|}|r1d }|dk(rd}n|dk(rd}|t3j4d|d|ddt j6|}tj8| }tj8|j}|s |dz}|dz}tj:||tj<|jtj0|dk7}tj>|}tAjB||d |||||| |Scc} }w)a Zoom an array. The array is zoomed using spline interpolation of the requested order. Parameters ---------- %(input)s zoom : float or sequence The zoom factor along the axes. If a float, `zoom` is the same for each axis. If a sequence, `zoom` should contain one value for each axis. %(output)s order : int, optional The order of the spline interpolation, default is 3. The order has to be in the range 0-5. %(mode_interp_constant)s %(cval)s %(prefilter)s grid_mode : bool, optional If False, the distance from the pixel centers is zoomed. Otherwise, the distance including the full pixel extent is used. For example, a 1d signal of length 5 is considered to have length 4 when `grid_mode` is False, but length 5 when `grid_mode` is True. See the following visual illustration: .. code-block:: text | pixel 1 | pixel 2 | pixel 3 | pixel 4 | pixel 5 | |<-------------------------------------->| vs. |<----------------------------------------------->| The starting point of the arrow in the diagram above corresponds to coordinate location 0 in each mode. Returns ------- zoom : ndarray The zoomed input. Notes ----- For complex-valued `input`, this function zooms the real and imaginary components independently. .. versionadded:: 1.6.0 Complex-valued support added. Examples -------- >>> from scipy import ndimage, datasets >>> import matplotlib.pyplot as plt >>> fig = plt.figure() >>> ax1 = fig.add_subplot(121) # left side >>> ax2 = fig.add_subplot(122) # right side >>> ascent = datasets.ascent() >>> result = ndimage.zoom(ascent, 3.0) >>> ax1.imshow(ascent, vmin=0, vmax=255) >>> ax2.imshow(result, vmin=0, vmax=255) >>> plt.show() >>> print(ascent.shape) (512, 512) >>> print(result.shape) (1536, 1536) rrrrr=r>c3&K|] }|dk( yw)rN).0zs r* zzoom..Ms a16 s.)rrLrDr.Nr4r2wrapz grid-wrapz It is recommended to use mode = z instead of z when grid_mode is True.r-) stacklevelrQ)outwhere)"rrrr$rrZtuplezipr?introundrrrUxpxatsetr`rrFr r!r;r rGwarningswarnr#r"divide ones_likeascontiguousarrayrr[)r%rr(r&r)r8r@rcrbjjrAr_zoomrIr:r9rJ suggest_modezoom_divzoom_nominators r*rrsN qyEAI788 JJu E zzA~>??  * *4 E B ejj$Qv{{Q&Q ejj$Qv{{Q&Q UQY0dC  rzzM : *L V^&L  # MM3L>dVT+,   + +D 1Dxx %HXXekk*N A ! 99^XekkD#q= *D    %D 4vudD$"$ Mk Gs!K c 6tj|} | j} | dkr tdt |}t |dk7r tdt |D cgc]} t| jc} s td|ddkr |dxx| z cc<|ddkr |dxx| z cc<|ddks|ddks|d| k\s|d| k\r td|jtj|tj|} } tj| | g| | gg}tj| j}||}|rB|\}}|dd||gd|d|ggz}tj|dd zj!t"}n||}||dz dz z}|dz dz }||z }|}|||<t%|}tj&| }t)j*|| || }| dkrt-| |||||||| |St/j0t3| D cgc] } | |vr t5d gn t3|| "c} }t%|}|D]}| |}||}t-||||||||| !|Scc} wcc} w) a Rotate an array. The array is rotated in the plane defined by the two axes given by the `axes` parameter using spline interpolation of the requested order. Parameters ---------- %(input)s angle : float The rotation angle in degrees. axes : tuple of 2 ints, optional The two axes that define the plane of rotation. Default is the first two axes. reshape : bool, optional If `reshape` is true, the output shape is adapted so that the input array is contained completely in the output. Default is True. %(output)s order : int, optional The order of the spline interpolation, default is 3. The order has to be in the range 0-5. %(mode_interp_constant)s %(cval)s %(prefilter)s Returns ------- rotate : ndarray The rotated input. Notes ----- For complex-valued `input`, this function rotates the real and imaginary components independently. .. versionadded:: 1.6.0 Complex-valued support added. Examples -------- >>> from scipy import ndimage, datasets >>> import matplotlib.pyplot as plt >>> fig = plt.figure(figsize=(10, 3)) >>> ax1, ax2, ax3 = fig.subplots(1, 3) >>> img = datasets.ascent() >>> img_45 = ndimage.rotate(img, 45, reshape=False) >>> full_img_45 = ndimage.rotate(img, 45, reshape=True) >>> ax1.imshow(img, cmap='gray') >>> ax1.set_axis_off() >>> ax2.imshow(img_45, cmap='gray') >>> ax2.set_axis_off() >>> ax3.imshow(full_img_45, cmap='gray') >>> ax3.set_axis_off() >>> fig.set_layout_engine('tight') >>> plt.show() >>> print(img.shape) (512, 512) >>> print(img_45.shape) (512, 512) >>> print(full_img_45.shape) (724, 724) r-z!input array should be at least 2Dz&axes should contain exactly two valuesz'axes should contain only integer valuesrrz invalid rotation plane specified)r'g?r>N)rrr$rVlistrErUfloat is_integersortrcosdgsindgr"r?ptpastyperprnrrrr itertoolsproductr/slice)r%angleaxesreshaper(r&r)r8r@ input_arrr$axcs rot_matrix img_shapein_plane_shapeiyix out_boundsout_plane_shape out_center in_centerrPrAr planes_coordrNiaoas r*rrsD 5!I >>D ax<== :D 4yA~ABB 62b $$&6 7BCC Aw{ Q4 Aw{ Q4 Aw{d1gkT!W_Q4;<<IIK == u!5qAAq6B7$%J 9??+It_NBAq"b>$%r1b>#33 66*15;CCCH#D/! 3q89J!#q(I  #FL(L&L__Y/N  $ $VYl4BDF qyJ fdI 7" M!((d % "TzuT{muYr]/CC%&  0' ?K;'B $B RV_dI ? ? Mw7`%s  J7%J)NNrr4TrfN)Nrr4rT)rNNrr4rT))rrTNrr4rT)rrunumpyrscipy._lib._utilr scipy._librrrscipyrrr_ni_docstringsr __all__rGr r r;r r rrrrrfr+r*rs5>1-% M !"BJJ!U Un  (H HV   59+,=A;?N Nb ;<9=e eP =A():>o od DGe eP BEB&+B BJ GH04G Gr+