Re: [Numpy-discussion] numpy, H, and struct: numpy bug?

2008-03-04 Thread Emanuele Olivetti
Just tried on a 32bit workstation (both CPU and OS): I get an error, as before, using python2.5: --- a.py:5: DeprecationWarning: struct integer overflow masking is deprecated b=struct.pack(10H,*a) Traceback (most recent call last): File a.py, line 5, in module b=struct.pack(10H,*a) File

Re: [Numpy-discussion] preparing to tag NumPy 1.0.5 on Wednesday

2008-03-04 Thread Alan G Isaac
Alan G Isaac wrote: I never got a response to this: URL:http://projects.scipy.org/pipermail/scipy-dev/2008-February/008424.html (Two different types claim to be numpy.int32.) On Mon, 03 Mar 2008, Travis E. Oliphant apparently wrote: It's not a bug :-) There are two c-level types that

Re: [Numpy-discussion] numpy and roundoff(?)

2008-03-04 Thread Lisandro Dalcin
Damian Eads wrote: One used -mfpmath=sse, and the other, -mfpmath=387. Keeping them both the same cleared the discrepancy. Oh yes! I think you got it... On 3/3/08, Christopher Barker [EMAIL PROTECTED] wrote: Was it really a significant difference, or just noticeable? I hope not, that

Re: [Numpy-discussion] numpy and roundoff(?)

2008-03-04 Thread Christopher Barker
Lisandro Dalcin wrote: And yes, in my case the cummulative differences leaded to different iteration counts in a matrix-free Newton-Krylov method. Of course, the final answer was as as accurate as the tolerances for the nonlinear solver. OK, so significant differences in iteration counts, but

Re: [Numpy-discussion] numpy.correlate with phase offset 1D data series

2008-03-04 Thread Ray Schumacher
Thank you for the input! It sounds like Fourier methods will be fastest, by design, for sample counts of hundreds to thousands. I currently do steps like: Im1 = get_stream_array_data() Im2 = load_template_array_data(fh2) ##note: len(im1)==len(im2) Ffft_im1=fftpack.rfft(Im1)

Re: [Numpy-discussion] numpy.correlate with phase offset 1D data series

2008-03-04 Thread Ray Schumacher
At 03:28 PM 3/3/2008, Ann wrote: Sounds familiar. If you have a good signal-to-noise ratio, you can get subpixel accuracy by oversampling the irfft, or better but slower, by using numerical optimization to refine the peak you found with argmax. the S/N here is poor, and high data rates work

[Numpy-discussion] argmin min on ndarrays

2008-03-04 Thread Pierre GM
All, Let a b be two ndarrays of the same shape. I'm trying to find the elements of b that correspond to the minima of a along an arbitrary axis. The problem is trivial when axis=None or when a.ndim=2, but I'm getting confused with higher dimensions: I came to the following solution that looks

Re: [Numpy-discussion] argmin min on ndarrays

2008-03-04 Thread Anne Archibald
On 04/03/2008, Pierre GM [EMAIL PROTECTED] wrote: All, Let a b be two ndarrays of the same shape. I'm trying to find the elements of b that correspond to the minima of a along an arbitrary axis. The problem is trivial when axis=None or when a.ndim=2, but I'm getting confused with higher

Re: [Numpy-discussion] argmin min on ndarrays

2008-03-04 Thread Pierre GM
Anne, Thanks a lot for your suggestion. Something like if axis is None: return b.flat[a.argmin()] else: return numpy.choose(a.argmin(axis),numpy.rollaxis(b,axis,0)) seems to do the trick fairly nicely indeed. The other solutions you suggested would require too much ad hoc adaptation.

Re: [Numpy-discussion] argmin min on ndarrays

2008-03-04 Thread Anne Archibald
On 04/03/2008, Pierre GM [EMAIL PROTECTED] wrote: Anne, Thanks a lot for your suggestion. Something like if axis is None: return b.flat[a.argmin()] else: return numpy.choose(a.argmin(axis),numpy.rollaxis(b,axis,0)) seems to do the trick fairly nicely indeed. The other

Re: [Numpy-discussion] argmin min on ndarrays

2008-03-04 Thread Pierre GM
Anne, I should have provided the link before, but this is very useful for answering this kind of question: http://www.scipy.org/Numpy_Functions_by_Category Great link indeed, that complements well the example list: http://www.scipy.org/Numpy_Example_List Thanks again !