σ
ίΘ[c        	   @` sW  d  d l  m Z m Z m Z m Z d  d l Z d  d l Z d d l m	 Z	 m
 Z
 i d d 6d d 6d	 d 6Z i d d 6d
 d 6d d 6Z e d k rSxΎd d d g D]ͺZ e d j e   e d j g  d D] Z d e ^ qΛ   xde	 d e e  D]OZ e e e k  r8d d e d e d e d e f Z e d e d e d  d d e e e k rΪxΔ e
 d  d!  D]\ \ Z Z d j e e  Z e e j d e d e  j d d
   Z e d e d d qwWnT e d" d d d Z e e j d e d e  j d d
   Z e d e d d e   n  d d e d e d e d e f Z e d e d e  d d e e e k rνx² d# D]S Z d j e  Z e e j d e d e  j d d
   Z e d e d d qWnT e d$ d d d Z e e j d e d e  j d d
   Z e d e d d e   qω Wq’ Wn  d S(%   i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsNi   (   t   ranget   zipi   i   i   i   i   i
   u   __main__uD   
{}-dimensional arrays ('n' is the size of the image AND the kernel)u    u   nu   convolveu   convolve_fftu   %17suΐ   
import numpy as np
from astropy.convolution.convolve import convolve
from astropy.convolution.convolve import convolve_fft
array = np.random.random([%i]*%i)
kernel = np.random.random([%i]*%i)u   %16i:t   endu    u   _fftu   fft_pad=Falseu.   convolve{}(array, kernel, boundary='fill', {})t   stmtt   setupu   %17fu   skippedu,   convolve_fft(array, kernel, boundary='fill')u*   convolve{}(array, kernel, boundary='fill')(   u   nu   convolveu   convolve_fft(   u    u   _fft(   u    u   fft_pad=Falseu             skipped(   u    u   _fftu             skipped(   t
   __future__R    R   R   R   t   timeitt   numpyt   npt   extern.six.movesR   R   t   max_exponents_lineart   max_exponents_fftt   __name__t   ndimst   printt   formatt   joint   nt   iiR   t   intt   ffttypet   extrat	   statementt   mint   Timert   repeatt   besttime(    (    (    sM   lib/python2.7/site-packages/astropy/convolution/tests/test_convolve_speeds.pyt   <module>   sL   "	
*&"	**
&**w