<div dir="ltr"><div><div><div>Thanks!<br><br></div>You helped me a lot!<br><br></div>cheers,<br></div>Bruno<br></div><br><div class="gmail_quote"><div dir="ltr">El vie., 24 jun. 2016 a las 14:21, <<a href="mailto:astropy-request@scipy.org">astropy-request@scipy.org</a>> escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send AstroPy mailing list submissions to<br>
        <a href="mailto:astropy@scipy.org" target="_blank">astropy@scipy.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://mail.scipy.org/mailman/listinfo/astropy" rel="noreferrer" target="_blank">https://mail.scipy.org/mailman/listinfo/astropy</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:astropy-request@scipy.org" target="_blank">astropy-request@scipy.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:astropy-owner@scipy.org" target="_blank">astropy-owner@scipy.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of AstroPy digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. fftw3 (Bruno O. S?nchez)<br>
   2. Re: fftw3 (Marshall Perrin)<br>
   3. Re: fftw3 (Jens Melinder)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 24 Jun 2016 15:17:22 +0000<br>
From: Bruno O. S?nchez <<a href="mailto:bruno.sanchez.63@gmail.com" target="_blank">bruno.sanchez.63@gmail.com</a>><br>
To: <a href="mailto:astropy@scipy.org" target="_blank">astropy@scipy.org</a><br>
Subject: [AstroPy] fftw3<br>
Message-ID:<br>
        <<a href="mailto:CACJJhJxNM_0n_iVYU2yERq6HaJn8HKtaiBcp4KgNW%2BV6HQ8fcQ@mail.gmail.com" target="_blank">CACJJhJxNM_0n_iVYU2yERq6HaJn8HKtaiBcp4KgNW+V6HQ8fcQ@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hello guys,<br>
<br>
I am an astronomer from C?rdoba Argentina, and I work a lot with astropy. I<br>
have been working on proper coaddition of images with spatially variant<br>
PSF, and I am currently using the convolution from astropy and scipy.<br>
<br>
I've encountered some perfomance issues, and noticed that there is some<br>
previous discussion on the settings of astropy.convolution.convolve fft<br>
engines.<br>
<br>
I wonder if any of you have succeded in setting a fftw3 engine for<br>
convolution, and if you have a snippet for using it. The fftw3 planning<br>
stage confuses me, and I can't find a documentation on pyfftw3.<br>
<br>
Any clues you can give me for this would be greatly appreciated!<br>
<br>
Bruno SANCHEZ<br>
Observatorio Astron?mico de C?rdoba<br>
<br>
<br>
<br>
--<br>
Bruno<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://mail.scipy.org/pipermail/astropy/attachments/20160624/7c13e811/attachment-0001.html" rel="noreferrer" target="_blank">https://mail.scipy.org/pipermail/astropy/attachments/20160624/7c13e811/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Fri, 24 Jun 2016 17:07:14 +0000<br>
From: Marshall Perrin <<a href="mailto:mperrin@stsci.edu" target="_blank">mperrin@stsci.edu</a>><br>
To: Astronomical Python mailing list <<a href="mailto:astropy@scipy.org" target="_blank">astropy@scipy.org</a>><br>
Subject: Re: [AstroPy] fftw3<br>
Message-ID: <<a href="mailto:6C0C14D7-D52F-4E6C-B19C-28C94C4802FA@stsci.edu" target="_blank">6C0C14D7-D52F-4E6C-B19C-28C94C4802FA@stsci.edu</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Dear Bruno,<br>
<br>
We use pyfftw as an optional dependency in our poppy physical optics library.  Our application is for complex wavefront propagation rather than convolutions but it still shows how to use the library, including the planning setup which I agree is not that well explained. For example code you can look here:<br>
<a href="https://github.com/mperrin/poppy/blob/master/poppy/poppy_core.py" rel="noreferrer" target="_blank">https://github.com/mperrin/poppy/blob/master/poppy/poppy_core.py</a><br>
<a href="https://github.com/mperrin/poppy/blob/master/poppy/utils.py" rel="noreferrer" target="_blank">https://github.com/mperrin/poppy/blob/master/poppy/utils.py</a><br>
<br>
Cheers,<br>
<br>
 - Marshall<br>
<br>
<br>
On Jun 24, 2016, at 11:17 AM, Bruno O. S?nchez <<a href="mailto:bruno.sanchez.63@gmail.com" target="_blank">bruno.sanchez.63@gmail.com</a><mailto:<a href="mailto:bruno.sanchez.63@gmail.com" target="_blank">bruno.sanchez.63@gmail.com</a>>> wrote:<br>
<br>
Hello guys,<br>
<br>
I am an astronomer from C?rdoba Argentina, and I work a lot with astropy. I have been working on proper coaddition of images with spatially variant PSF, and I am currently using the convolution from astropy and scipy.<br>
<br>
I've encountered some perfomance issues, and noticed that there is some previous discussion on the settings of astropy.convolution.convolve fft engines.<br>
<br>
I wonder if any of you have succeded in setting a fftw3 engine for convolution, and if you have a snippet for using it. The fftw3 planning stage confuses me, and I can't find a documentation on pyfftw3.<br>
<br>
Any clues you can give me for this would be greatly appreciated!<br>
<br>
Bruno SANCHEZ<br>
Observatorio Astron?mico de C?rdoba<br>
<br>
<br>
<br>
--<br>
Bruno<br>
_______________________________________________<br>
AstroPy mailing list<br>
<a href="mailto:AstroPy@scipy.org" target="_blank">AstroPy@scipy.org</a><mailto:<a href="mailto:AstroPy@scipy.org" target="_blank">AstroPy@scipy.org</a>><br>
<a href="https://mail.scipy.org/mailman/listinfo/astropy" rel="noreferrer" target="_blank">https://mail.scipy.org/mailman/listinfo/astropy</a><br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://mail.scipy.org/pipermail/astropy/attachments/20160624/b20b0da9/attachment-0001.html" rel="noreferrer" target="_blank">https://mail.scipy.org/pipermail/astropy/attachments/20160624/b20b0da9/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Fri, 24 Jun 2016 19:21:09 +0200<br>
From: Jens Melinder <<a href="mailto:jens@astro.su.se" target="_blank">jens@astro.su.se</a>><br>
To: Astronomical Python mailing list <<a href="mailto:astropy@scipy.org" target="_blank">astropy@scipy.org</a>><br>
Subject: Re: [AstroPy] fftw3<br>
Message-ID: <<a href="mailto:72822D4A-C97C-4D3E-AAC1-AAF3A8196EF9@astro.su.se" target="_blank">72822D4A-C97C-4D3E-AAC1-AAF3A8196EF9@astro.su.se</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi Bruno,<br>
<br>
I?m using this version of pyfftw:<br>
<a href="https://github.com/pyFFTW/pyFFTW" rel="noreferrer" target="_blank">https://github.com/pyFFTW/pyFFTW</a> <<a href="https://github.com/pyFFTW/pyFFTW" rel="noreferrer" target="_blank">https://github.com/pyFFTW/pyFFTW</a>><br>
(There is another wrapper around as well, but that did not work for me). There are some problems building this inside a Ureka environment, but seems to be working fine in conda.<br>
<br>
This is well documented and works really well for me. In my testing I found this wrapper something like 3-4 times faster than the scipy/numpy fftw implementations (running on a single core, I?ve never gotten the hyperthreading to work with any of the FFTW implementations).<br>
<br>
The package also has a interfaces module that lets you use the pyfftw fftws inside a an astropy.convolution function call. Here is a code snippet from my code:<br>
<br>
import pyfftw<br>
from astropy.convolution import convolve_fft<br>
fftn=pyfftw.interfaces.numpy_fft.fftn<br>
ifftn=pyfftw.interfaces.numpy_fft.ifftn<br>
<br>
def fftwn(*dat):<br>
        return fftn(*dat,threads=1)<br>
<br>
def ifftwn(*dat):<br>
        return ifftn(*dat,threads=1)<br>
<br>
def conv(ima,kernel):<br>
    return convolve_fft(ima,kernel,boundary='wrap',fftn=fftwn,ifftn=ifftwn)<br>
<br>
You may not need the fftwn and ifftwn functions, if I remember correctly I only created those to be able to test the hyperthreading.<br>
<br>
Good luck!<br>
<br>
Cheers,<br>
Jens<br>
<br>
<br>
<br>
<br>
> 24 jun 2016 kl. 17:17 skrev Bruno O. S?nchez <<a href="mailto:bruno.sanchez.63@gmail.com" target="_blank">bruno.sanchez.63@gmail.com</a>>:<br>
><br>
> Hello guys,<br>
><br>
> I am an astronomer from C?rdoba Argentina, and I work a lot with astropy. I have been working on proper coaddition of images with spatially variant PSF, and I am currently using the convolution from astropy and scipy.<br>
><br>
> I've encountered some perfomance issues, and noticed that there is some previous discussion on the settings of astropy.convolution.convolve fft engines.<br>
><br>
> I wonder if any of you have succeded in setting a fftw3 engine for convolution, and if you have a snippet for using it. The fftw3 planning stage confuses me, and I can't find a documentation on pyfftw3.<br>
><br>
> Any clues you can give me for this would be greatly appreciated!<br>
><br>
> Bruno SANCHEZ<br>
> Observatorio Astron?mico de C?rdoba<br>
><br>
><br>
><br>
> --<br>
> Bruno<br>
> _______________________________________________<br>
> AstroPy mailing list<br>
> <a href="mailto:AstroPy@scipy.org" target="_blank">AstroPy@scipy.org</a><br>
> <a href="https://mail.scipy.org/mailman/listinfo/astropy" rel="noreferrer" target="_blank">https://mail.scipy.org/mailman/listinfo/astropy</a><br>
<br>
<br>
<br>
-----------------------------------<br>
Jens Melinder<br>
Department of Astronomy<br>
Stockholm University<br>
<a href="mailto:jens@astro.su.se" target="_blank">jens@astro.su.se</a><br>
+46 706471856<br>
<br>
<br>
<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://mail.scipy.org/pipermail/astropy/attachments/20160624/df02cb70/attachment.html" rel="noreferrer" target="_blank">https://mail.scipy.org/pipermail/astropy/attachments/20160624/df02cb70/attachment.html</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
AstroPy mailing list<br>
<a href="mailto:AstroPy@scipy.org" target="_blank">AstroPy@scipy.org</a><br>
<a href="https://mail.scipy.org/mailman/listinfo/astropy" rel="noreferrer" target="_blank">https://mail.scipy.org/mailman/listinfo/astropy</a><br>
<br>
<br>
------------------------------<br>
<br>
End of AstroPy Digest, Vol 117, Issue 10<br>
****************************************<br>
</blockquote></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">Bruno<br></div></div>