Re: [Numpy-discussion] Optical autocorrelation calculated with numpy is slow

2009-03-31 Thread Jochen S
On Tue, Mar 31, 2009 at 8:54 PM, Jochen S cycoma...@gmail.com wrote: On Tue, Mar 31, 2009 at 7:13 AM, João Luís Silva jsi...@fc.up.pt wrote: Hi, I wrote a script to calculate the *optical* autocorrelation of an electric field. It's like the autocorrelation, but sums the fields instead of

Re: [Numpy-discussion] Optical autocorrelation calculated with numpy is slow

2009-03-31 Thread João Luís Silva
Charles R Harris wrote: That should work. The first two integrals are actually the same, but need to be E(t)*E(t).conj(). The second integral needs twice the real part of E(t)*E(t-tau).conj(). Numpy correlate should really have the conjugate built in, but it doesn't. Chuck It worked,

[Numpy-discussion] Optical autocorrelation calculated with numpy is slow

2009-03-30 Thread João Luís Silva
Hi, I wrote a script to calculate the *optical* autocorrelation of an electric field. It's like the autocorrelation, but sums the fields instead of multiplying them. I'm calculating I(tau) = integral( abs(E(t)+E(t-tau))**2,t=-inf..inf) with script appended at the end. It's too slow for my

Re: [Numpy-discussion] Optical autocorrelation calculated with numpy is slow

2009-03-30 Thread Anne Archibald
2009/3/30 João Luís Silva jsi...@fc.up.pt: Hi, I wrote a script to calculate the *optical* autocorrelation of an electric field. It's like the autocorrelation, but sums the fields instead of multiplying them. I'm calculating I(tau) = integral( abs(E(t)+E(t-tau))**2,t=-inf..inf) You may be

Re: [Numpy-discussion] Optical autocorrelation calculated with numpy is slow

2009-03-30 Thread Charles R Harris
On Mon, Mar 30, 2009 at 12:23 PM, Anne Archibald peridot.face...@gmail.comwrote: 2009/3/30 João Luís Silva jsi...@fc.up.pt: Hi, I wrote a script to calculate the *optical* autocorrelation of an electric field. It's like the autocorrelation, but sums the fields instead of multiplying