You can subscribe to this list here.
2000 
_{Jan}
(8) 
_{Feb}
(49) 
_{Mar}
(48) 
_{Apr}
(28) 
_{May}
(37) 
_{Jun}
(28) 
_{Jul}
(16) 
_{Aug}
(16) 
_{Sep}
(44) 
_{Oct}
(61) 
_{Nov}
(31) 
_{Dec}
(24) 

2001 
_{Jan}
(56) 
_{Feb}
(54) 
_{Mar}
(41) 
_{Apr}
(71) 
_{May}
(48) 
_{Jun}
(32) 
_{Jul}
(53) 
_{Aug}
(91) 
_{Sep}
(56) 
_{Oct}
(33) 
_{Nov}
(81) 
_{Dec}
(54) 
2002 
_{Jan}
(72) 
_{Feb}
(37) 
_{Mar}
(126) 
_{Apr}
(62) 
_{May}
(34) 
_{Jun}
(124) 
_{Jul}
(36) 
_{Aug}
(34) 
_{Sep}
(60) 
_{Oct}
(37) 
_{Nov}
(23) 
_{Dec}
(104) 
2003 
_{Jan}
(110) 
_{Feb}
(73) 
_{Mar}
(42) 
_{Apr}
(8) 
_{May}
(76) 
_{Jun}
(14) 
_{Jul}
(52) 
_{Aug}
(26) 
_{Sep}
(108) 
_{Oct}
(82) 
_{Nov}
(89) 
_{Dec}
(94) 
2004 
_{Jan}
(117) 
_{Feb}
(86) 
_{Mar}
(75) 
_{Apr}
(55) 
_{May}
(75) 
_{Jun}
(160) 
_{Jul}
(152) 
_{Aug}
(86) 
_{Sep}
(75) 
_{Oct}
(134) 
_{Nov}
(62) 
_{Dec}
(60) 
2005 
_{Jan}
(187) 
_{Feb}
(318) 
_{Mar}
(296) 
_{Apr}
(205) 
_{May}
(84) 
_{Jun}
(63) 
_{Jul}
(122) 
_{Aug}
(59) 
_{Sep}
(66) 
_{Oct}
(148) 
_{Nov}
(120) 
_{Dec}
(70) 
2006 
_{Jan}
(460) 
_{Feb}
(683) 
_{Mar}
(589) 
_{Apr}
(559) 
_{May}
(445) 
_{Jun}
(712) 
_{Jul}
(815) 
_{Aug}
(663) 
_{Sep}
(559) 
_{Oct}
(930) 
_{Nov}
(373) 
_{Dec}

S  M  T  W  T  F  S 




1

2
(3) 
3

4

5

6
(2) 
7
(3) 
8

9

10
(1) 
11

12
(1) 
13
(2) 
14
(3) 
15

16
(2) 
17
(1) 
18

19

20

21
(1) 
22
(2) 
23
(1) 
24
(3) 
25
(1) 
26

27

28
(5) 
29
(2) 
30
(1) 
31


From: Gerard Vermeulen <gvermeul@gr...>  20020530 07:19:08

Announcing PyQwtsip324_041 PyQwt = FAST and EASY data plotting for Python, Numeric and Qt! PyQwt is a set of Python bindings for the Qwt C++ class library. The Qwt library extends the Qt framework with widgets for scientific and engineering applications. It contains QwtPlot, a 2d plotting widget, and widgets for data input/output such as and QwtCounter, QwtKnob, QwtThermo and QwtWheel. PyQwt requires and extends PyQt, a set of Python bindings for Qt. PyQwt requires Numeric. Numeric extends the Python language with new data types that make Python an ideal language for numerical computing and experimentation (maybe less efficient than MatLab, but more expressive). The home page of PyQwt is http://gerard.vermeulen.free.fr NEW and IMPORTANT FEATURES of PyQwtsip324_041: 1. requires PyQt3.2.4 and sip3.2.4. 2. implements practically all public and protected member functions of Qwt0.4.1. 3. compatible with Numeric21.0 and lower. 4. simplified setup.py script for Unix/Linux and Windows. 5. *.exe installer for Windows (requires Qt2.3.0NC). 6. HTML documentation with installation instructions and a reference listing the Python calls to PyQwt that are different from the corresponding C++ calls to Qwt. 7. Tested on Linux with Qt2.3.1 and Qt3.0.4. Tested on Windows with Qt2.3.0NC. Gerard Vermeulen 
From: Konrad Hinsen <hinsen@cn...>  20020529 08:12:40

Pearu Peterson <pearu@...> writes: > an array with 0 rank. It seems that the Numeric documentation is missing > (though, I didn't look too hard) the following rules of thumb: > > If `a' is rank 1 array, then a[i] is Python scalar or object. [MISSING] Or rather:  If `a' is rank 1 array with elements of type Int, Float, or Complex, then a[i] is Python scalar or object. [MISSING]  If `a' is rank 1 array with elements of type Int16, Int32, Float32, or Complex32, then a[i] is a rank 0 array. [MISSING]  If `a' is rank > 1 array, then a[i] is a subarray a[i,...] The rank0 arrays are the #1 question topic for users of my netCDF interface (for portability reasons, netCDF integer arrays map to Int32, not Int, so scalar integers read from a netCDF array are always rank0 arrays), and almost everybody initially claims that it's a bug, so some education seems necessary. Konrad.   Konrad Hinsen  EMail: hinsen@... Centre de Biophysique Moleculaire (CNRS)  Tel.: +332.38.25.56.24 Rue Charles Sadron  Fax: +332.38.63.15.17 45071 Orleans Cedex 2  Deutsch/Esperanto/English/ France  Nederlands/Francais  
From: eric <eric@en...>  20020529 06:37:12

Hey Larry, I actually thought, as you did, that indexing the array returns an element converted to a scalar  and it does in the "default" cases when you don't specify a nonstandard typecode. After testing, it looks like values that are representable as native Python types ('l', 'd', and 'D') are returned as actual values while nonstandard types are returned as views into the array. Is this intentional? It is dangerous to have the behavior change based on the type. It seems they should all be views or they should all be converted to a scalar. Here is your test code modified to test all Numeric types: import Numeric def test_index(typecode): print 'typcode:', typecode a = Numeric.zeros((2, 2), typecode) n = a[1, 1] # fetch interesting value from array print n a[1, 1] = 10 # change array print n # blam print type(n) # huh print print 'Numeric version:', Numeric.__version__ for t in ['i','1','s','l','f','d','F','D']: test_index(t) And here is the output. Look at the types returned. C:\home\ej\wrk\junk>python num_index.py Numeric version: 21.0 typcode: i 0 10 <type 'array'> typcode: 1 0 10 <type 'array'> typcode: s 0 10 <type 'array'> typcode: l 0 0 <type 'int'> typcode: f 0.0 10.0 <type 'array'> typcode: d 0.0 0.0 <type 'float'> typcode: F 0j (10+0j) <type 'array'> typcode: D 0j 0j <type 'complex'> eric  Original Message  From: "Larry Denneau" <larryd@...> To: <numpydiscussion@...> Sent: Tuesday, May 28, 2002 1:13 PM Subject: [Numpydiscussion] Bug: extremely misleading array behavior > Hello, > > I recently discovered the following behavior when fetching values > from a Numeric array. Can somebody offer some insight? > > #1) > > import Numeric > > a = Numeric.zeros((2, 2), 'i') > n = a[1, 1] # fetch interesting value from array > print n > a[1, 1] = 10 # change array > print n # blam > print type(n) # huh > > [bash]$ python 1.py > 0 > 10 > <type 'array'> > > but > > #2) > > import Numeric > > a = Numeric.zeros((2,), 'i') > n = a[1] > print n > a[1] = 10 > print n > print type(n) > > [bash]$ python 2.py > 0 > 0 > <type 'int'> > > #2 works the way one would expect, and #1 does not (n changes). > They should at least both behave the same. :) At a minimum, naive > use of arrays can lead to confusing or disastrous results, since > a single value fetched from an array can change behind your back. > > It appears n is aliased into a, but preserves its value when a is > deleted (with del(a)). What happens to the "rest of" a? > > I'm using Python 2.2, Numeric21.0, on both Unix and Win32. > > Thanks, > Larry > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 2528 in Las Vegas  http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Numpydiscussion mailing list > Numpydiscussion@... > https://lists.sourceforge.net/lists/listinfo/numpydiscussion > 
From: Pearu Peterson <pearu@ce...>  20020528 20:31:09

Hi Larry, On Tue, 28 May 2002, Larry Denneau wrote: > All the Numpy documentation examples (see > http://pfdubois.com/numpy/html2/numpy6.html#pgfId36033, "Getting and > Stting Array Values") use the [x, y] notation instead of [x][y], so I > would consider this a bug in the documentation, since the [x, y] > method leads to unexpected behavior. If you look the section "Slicing Arrays" then a[1] is actually a[1,:], that is, an one dimensional array. From your description, a[1,1] must be an array with 0 rank. It seems that the Numeric documentation is missing (though, I didn't look too hard) the following rules of thumb: If `a' is rank 1 array, then a[i] is Python scalar or object. [MISSING] If `a' is rank > 1 array, then a[i] is a subarray a[i,...] > I'm still curious what happens to the original array when > > n=a[1, 1] > del(a) I think the original array `a' is not actually deleted until `n' gets deleted. If I recall correctly, then `n' is a subarray of `a' so that internally it contains only a reference to `a' in the sense that a.data==n.data but strides and dimension arrays differ. Pearu 
From: Larry Denneau <larryd@pa...>  20020528 20:03:28

Pearu Peterson said: > > On Tue, 28 May 2002, Larry Denneau wrote: > > > Hello, > > > > I recently discovered the following behavior when fetching values > > from a Numeric array. Can somebody offer some insight? > > > > #1) > > > > import Numeric > > > > a = Numeric.zeros((2, 2), 'i') > > n = a[1, 1] # fetch interesting value from array > > print n > > a[1, 1] = 10 # change array > > print n # blam > > print type(n) # huh > > > > [bash]$ python 1.py > > 0 > > 10 > > <type 'array'> [ deleted] > Use > > a[1][1] = 10 > > and the output will be > > 0 > 0 > <type 'int'> > > I find it is an useful feature in Numeric to have both behaviours of > either using a[1,1] or a[1][1]. You may want to dig into Numeric's > userguide to get a more detailed explanation of the differences. > > Regards, > Pearu Hi Pearu, I assume you mean n = a[1][1] which produces the expected behavior. All the Numpy documentation examples (see http://pfdubois.com/numpy/html2/numpy6.html#pgfId36033, "Getting and Stting Array Values") use the [x, y] notation instead of [x][y], so I would consider this a bug in the documentation, since the [x, y] method leads to unexpected behavior. I'm still curious what happens to the original array when n=a[1, 1] del(a) but that may have to wait until I have time to peruse the Numeric source. Thanks, Larry 
From: Pearu Peterson <pearu@ce...>  20020528 19:52:31

On Tue, 28 May 2002, Pearu Peterson wrote: <snip> > Use > > a[1][1] = 10 > Oops, I meant n = a[1][1] Pearu 
From: Pearu Peterson <pearu@ce...>  20020528 19:40:17

On Tue, 28 May 2002, Larry Denneau wrote: > Hello, > > I recently discovered the following behavior when fetching values > from a Numeric array. Can somebody offer some insight? > > #1) > > import Numeric > > a = Numeric.zeros((2, 2), 'i') > n = a[1, 1] # fetch interesting value from array > print n > a[1, 1] = 10 # change array > print n # blam > print type(n) # huh > > [bash]$ python 1.py > 0 > 10 > <type 'array'> > > but > > #2) > > import Numeric > > a = Numeric.zeros((2,), 'i') > n = a[1] > print n > a[1] = 10 > print n > print type(n) > > [bash]$ python 2.py > 0 > 0 > <type 'int'> > > #2 works the way one would expect, and #1 does not (n changes). > They should at least both behave the same. :) At a minimum, naive > use of arrays can lead to confusing or disastrous results, since > a single value fetched from an array can change behind your back. Use a[1][1] = 10 and the output will be 0 0 <type 'int'> I find it is an useful feature in Numeric to have both behaviours of either using a[1,1] or a[1][1]. You may want to dig into Numeric's userguide to get a more detailed explanation of the differences. Regards, Pearu 
From: Larry Denneau <larryd@pa...>  20020528 17:13:22

Hello, I recently discovered the following behavior when fetching values from a Numeric array. Can somebody offer some insight? #1) import Numeric a = Numeric.zeros((2, 2), 'i') n = a[1, 1] # fetch interesting value from array print n a[1, 1] = 10 # change array print n # blam print type(n) # huh [bash]$ python 1.py 0 10 <type 'array'> but #2) import Numeric a = Numeric.zeros((2,), 'i') n = a[1] print n a[1] = 10 print n print type(n) [bash]$ python 2.py 0 0 <type 'int'> #2 works the way one would expect, and #1 does not (n changes). They should at least both behave the same. :) At a minimum, naive use of arrays can lead to confusing or disastrous results, since a single value fetched from an array can change behind your back. It appears n is aliased into a, but preserves its value when a is deleted (with del(a)). What happens to the "rest of" a? I'm using Python 2.2, Numeric21.0, on both Unix and Win32. Thanks, Larry 
From: Roman Suzi <rnd@on...>  20020525 12:10:49

On Tue, 21 May 2002, Roman Suzi wrote: >hello, > >I've found that the following fragment of code gives an error while with >other shapes of b there is no problem: ... > The mentioned behaviour looks like a bug, because > a[1:3,1:2] and b have the same shape and according to docs > b must be copied to aslice 1:1... > > Numeric is version 21.0, Python 2.1 under Linux RedHat 7.2. > > Thank you in advance! For the record:  the bug is fixed in CVS. Thank you, guys! Sincerely yours, Roman Suzi  \_ Russia \_ Karelia \_ Petrozavodsk \_ rnd@... \_ \_ Saturday, May 25, 2002 \_ Powered by Linux RedHat 7.2 \_ \_ "... All the world's a stage, and I missed rehearsal." \_ 
From: John J. Lee <jjl@po...>  20020524 21:28:53

On Thu, 23 May 2002, Jonathan M. Gilligan wrote: > I submitted this to the Sourceforge bug tracker, but wanted also to let this > list know, as this is a potentially nasty bug. > > MLab.std() gives completely incorrect answers for multidimensional arrays > when axis != 0. [...] There was a earlier bug with this function  is there a regression test to make sure this change doesn't fail the way it did before? John 
From: Paul Barrett <B<arrett@st...>  20020524 13:11:03

Eric Hagemann wrote: > Hey All, > > Doing my first install on a linux system (Mandrake 8.2 on a PPC). > > I downloaded the *.tar.gz and unzip/untarred it. I enter the command > 'python setup.py install' and get the following error > > "open '/usr/lib/python2.2/config/Makefile' (No such file or directory)" > > This is the python that comes with mandrake. I have been able to download > and install a new version of python2.2 and sucessfully install Numpy there > but I was wondering what I needed to do to get it running in the 'base' > python install > > any pointers ? Yes, you need to install the libpython2.2devel RPM. It contains this file.  Paul Barrett, PhD Space Telescope Science Institute Phone: 4103384475 ESS/Science Software Group FAX: 4103384767 Baltimore, MD 21218 
From: Eric Hagemann <ehagemann@co...>  20020524 00:34:59

Hey All, Doing my first install on a linux system (Mandrake 8.2 on a PPC). I downloaded the *.tar.gz and unzip/untarred it. I enter the command 'python setup.py install' and get the following error "open '/usr/lib/python2.2/config/Makefile' (No such file or directory)" This is the python that comes with mandrake. I have been able to download and install a new version of python2.2 and sucessfully install Numpy there but I was wondering what I needed to do to get it running in the 'base' python install any pointers ? Cheers Eric 
From: Jonathan M. Gilligan <jonathan.gilligan@va...>  20020523 08:51:27

I submitted this to the Sourceforge bug tracker, but wanted also to let this list know, as this is a potentially nasty bug. MLab.std() gives completely incorrect answers for multidimensional arrays when axis != 0. >>> foo array([[[ 1., 1., 1.], [ 2., 2., 2.], [ 3., 3., 3.]], [[ 1., 4., 4.], [ 2., 5., 5.], [ 3., 6., 6.]]]) >>> std(foo) array([[ 0. , 2.12132034, 2.12132034], [ 0. , 2.12132034, 2.12132034], [ 0. , 2.12132034, 2.12132034]]) >>> std(foo, 1) array([[ 0., 0., 0.], [ 0., 0., 0.]]) The following should fix the problem (but I haven't tested it extensively): def std(m,axis=0): """std(m,axis=0) returns the standard deviation along the given dimension of m. The result is unbiased with division by N1. If m is of integer type returns a floating point answer. """ x = asarray(m) n = float(x.shape[axis]) x2 = mean(x * x, axis) x = mean(x, axis) return sqrt((x2  x * x) * n /(n1.0)) Jonathan Gilligan 
From: Tariq Rashid <tariq_rashid@li...>  20020522 20:59:00

i'm interested in this too? in fact i am willing to help write some wavelet tools for python  but you'll have to be patient as i've only just started on my PyObjects et al ... and i'm not an expert either  just very interested and entheusiastic! Tariq Rashid Original Message From: numpydiscussionadmin@... [mailto:numpydiscussionadmin@...]On Behalf Of numpydiscussionrequest@... Sent: 22 May 2002 20:05 To: numpydiscussion@... Subject: Numpydiscussion digest, Vol 1 #463  1 msg Send Numpydiscussion mailing list submissions to numpydiscussion@... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/numpydiscussion or, via email, send a message with subject or body 'help' to numpydiscussionrequest@... You can reach the person managing the list at numpydiscussionadmin@... When replying, please edit your Subject line so it is more specific than "Re: Contents of Numpydiscussion digest..." Today's Topics: 1. Q: Wavelet tools with Python (Zaur Shiboukhov) ____ Message: 1 Date: Wed, 22 May 2002 15:27:49 +0400 From: Zaur Shiboukhov <szport@...> To: numpydiscussion@... Organization: RI Applied Mathematics and Automation RAS Subject: [Numpydiscussion] Q: Wavelet tools with Python How is about wavelet tools with Python? Zaur ____ _______________________________________________ Numpydiscussion mailing list Numpydiscussion@... https://lists.sourceforge.net/lists/listinfo/numpydiscussion End of Numpydiscussion Digest 
From: Zaur Shiboukhov <szport@fr...>  20020522 11:34:30

How is about wavelet tools with Python? Zaur 
From: Roman Suzi <rnd@on...>  20020521 17:19:20

hello, I've found that the following fragment of code gives an error while with other shapes of b there is no problem:  #!/usr/bin/python2 from Numeric import * from Matrix import * a = Matrix(zeros([4,4])) b = Matrix(ones([2,1])) print a, a.shape print b, b.shape q = a[1:3,1:2] print q, q.shape a[1:3,1:2] = b  resulting in:  Matrix([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]) (4, 4) Matrix([[1], [1]]) (2, 1) Matrix([[0], [0]]) (2, 1) Traceback (most recent call last): File "./numpybug.py", line 11, in ? a[1:3,1:2] = b File "/usr/lib/python2.1/sitepackages/Numeric/Matrix.py", line 180, in __setitem__ def __setitem__(self, index, value): self.array[index] = asarray(squeeze(value),self._typecode) ValueError: matrices are not aligned for copy  The mentioned behaviour looks like a bug, because a[1:3,1:2] and b have the same shape and according to docs b must be copied to aslice 1:1... Numeric is version 21.0, Python 2.1 under Linux RedHat 7.2. Thank you in advance! Sincerely yours, Roman Suzi  \_ Russia \_ Karelia \_ Petrozavodsk \_ rnd@... \_ \_ Saturday, May 18, 2002 \_ Powered by Linux RedHat 7.2 \_ 
From: eric <eric@en...>  20020517 15:24:22

I'm happy to announce that Enthought is developing a platform independent plotting library for Python. The Chaco project, as it is named, is funded by the Space Telescope Science Institute (STScI) and licensed under a BSD style open source license. Chaco is designed for presentation quality scientific 2D graphics on a variety of output devices. The initial targets are wxPython, TkInter, Mac OS X, and PDF for hard copy output. It's design is extensible so that other backends, such as OpenGL, can be added. Currently, the lowlevel API for wxPython, Mac OS X, and PDF are operational. The high level graphics objects will be developed over the coming months. Chaco is hosted at the SciPy site. For more information visit: http://www.scipy.org/site_content/chaco People are invited to comment on and contribute to the project. Chaco's discussion list is: scipychaco@... To subscribe, go to the mailing list's info page: http://scipy.net/mailman/listinfo/scipychaco thanks, eric jones  Eric Jones <eric at enthought.com> Enthought, Inc. [www.enthought.com and http://www.scipy.org] (512) 5361057 
From: Edward C. Jones <edcjones@er...>  20020516 21:03:37

Here are some documentation problems with Numeric (20.2.0). I use the html form of the documentation. 1. descr>elsize is not documented. 2. The documentation for PyArray_FromDimsAndData says This function should only be used to access global data that will never be freed (like FORTRAN common blocks). The document writer copied this from the source code internal documentation. As far as I can tell, this is wrong. I suggest The object returned by this function contains a pointer to a preexisting block of data. If you delete the data before the Python reference count has dropped to zero, you will have a dangling pointer which is usually a disaster. One safe way to do this is to Py_DECREF the object in the same C function where it was created. 3. By a semiautomated application of grep and Python, I have found the following functions which appear to be in the C API and are not documented. Note that PyArray_FromDimsAndData and PyArray_CopyArray can be combined to do the C level equivalent of arr[a:b,c:d] = something PyArray_ArgMax multiarraymodule.c:extern PyObject *PyArray_ArgMax(PyObject *op) { PyArray_ArgSort multiarraymodule.c:extern PyObject *PyArray_ArgSort(PyObject *op) { PyArray_BinarySearch multiarraymodule.c:extern PyObject *PyArray_BinarySearch(PyObject *op1, PyObject *op2) { PyArray_CONTIGUOUS arrayobject.c:#define PyArray_CONTIGUOUS(m) (ISCONTIGUOUS(m) ? Py_INCREF(m), m : \ PyArray_Choose multiarraymodule.c:extern PyObject *PyArray_Choose(PyObject *ip, PyObject *op) { PyArray_Concatenate multiarraymodule.c:extern PyObject *PyArray_Concatenate(PyObject *op) { PyArray_Converter arrayobject.c:extern int PyArray_Converter(PyObject *object, PyObject **address) { PyArray_CopyArray arrayobject.c:int PyArray_CopyArray(PyArrayObject *dest, PyArrayObject *src) { PyArray_CopyObject arrayobject.c:int PyArray_CopyObject(PyArrayObject *dest, PyObject *src_object) { PyArray_Correlate multiarraymodule.c:extern PyObject *PyArray_Correlate(PyObject *op1, PyObject *op2, int mode) { PyArray_FromDimsAndDataAndDescr arrayobject.c:PyObject *PyArray_FromDimsAndDataAndDescr(int nd, int *d, PyArray_FromScalar arrayobject.c:PyObject *PyArray_FromScalar(PyObject *op, int type) { PyArray_InnerProduct multiarraymodule.c:extern PyObject *PyArray_InnerProduct(PyObject *op1, PyObject *op2) { PyArray_Item arrayobject.c:extern PyObject * PyArray_Item(PyObject *op, int i) { PyArray_NBYTES arrayobject.h:#define PyArray_NBYTES(mp) ((mp)>descr>elsize * PyArray_SIZE(mp)) PyArray_Put arrayobject.c:extern PyObject *PyArray_Put(PyObject *self0, PyObject *indices0, PyArray_PutMask arrayobject.c:extern PyObject *PyArray_PutMask(PyObject *self0, PyObject *mask0, PyArray_Repeat multiarraymodule.c:extern PyObject *PyArray_Repeat(PyObject *aop, PyObject *op, int axis) { PyArray_Resize arrayobject.c:static PyObject * PyArray_Resize(PyArrayObject *self, PyObject *shape) { PyArray_Sort multiarraymodule.c:extern PyObject *PyArray_Sort(PyObject *op) { PyArray_TYPES arrayobject.h:enum PyArray_TYPES { PyArray_CHAR, PyArray_UBYTE, PyArray_SBYTE, PyArray_ToList arrayobject.c:static PyObject *PyArray_ToList(PyObject *self) { PyArray_Transpose multiarraymodule.c:extern PyObject *PyArray_Transpose(PyArrayObject *ap, PyObject *op) { PyArray_compare_lists arrayobject.c:extern int _PyArray_compare_lists(int *l1, int *l2, int n) { arrayobject.c:extern int _PyArray_compare_lists(int *l1, int *l2, int n) { multiarraymodule.c:extern PyObject *PyArray_Sort(PyObject *op) { 
From: Paul F Dubois <paul@pf...>  20020516 18:56:35

Pyfort version 8.0a1 is now in CVS for testing. A new user interface helps scientists create packages. Packages can be uninstalled. A GUI interface is provided for creating new packages and managing their compilation and installation. Documentation for the new features will be available shortly at pyfortran.sf.net. 
From: <peter.chang@no...>  20020514 15:52:49

On Tue, 14 May 2002, Johan Fredrik =D8hman wrote: > Sure, > Kasdin, N.J. and Walter, T. (1992), Discrete Simulation of Power Law No= ise, > 1992, IEEE Frequency Control Symposium, p. 274283. >=20 > This C program shown there, and thus my python program returns an finit= e > vector of noise. Now, let's assume that I want more noise, how can I > concatenate another vector ? In the case of PWH (Phase white noise) t= his > is quite simple, but the other cases are more obscure. Anybody knows w= hat > is a valid procedure to create "more noise"... Look in "Fast Algorithms for DSP" by Richard E Blahut, p284 (AddisonWesley, Mass. 1985) ISBN 0201101556 or "Numerical Recipes in C", p543 (CUP, 2nd Ed, 1992).=20 What you're doing is convolving a random stream with a FIR filter via=20 FFTs. To apply to a larger stream, you need to convolve by sections using= =20 either the overlapsave or the overlapadd method. Regards, Peter 
From: <johanfo@oh...>  20020514 12:03:42

Sure, Kasdin, N.J. and Walter, T. (1992), Discrete Simulation of Power Law Noise, 1992, IEEE Frequency Control Symposium, p. 274283. This C program shown there, and thus my python program returns an finite vector of noise. Now, let's assume that I want more noise, how can I concatenate another vector ? In the case of PWH (Phase white noise) this is quite simple, but the other cases are more obscure. Anybody knows what is a valid procedure to create "more noise"...  JFØ  Original Message  From: "Hartley, Ed" <e.hartley@...> To: <numpydiscussion@...> Sent: Tuesday, May 14, 2002 10:03 AM Subject: [Numpydiscussion] Noise Simulation > Hi > interesting discussion please could you quote the complete reference to > this > > I have based my routine on the document "Discrete simulation of power low > > noise", IEEE International Frequency Control Symposium 2729 > > > Regards > Ed Hartley > Research Fellow > Computing Department > Lancaster University > Lancaster > UK LA1 4YR > Phone +44 (0) 1524 593675 > Fax +44 (0) 1524 593608 > > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: bandwidth@... > _______________________________________________ > Numpydiscussion mailing list > Numpydiscussion@... > https://lists.sourceforge.net/lists/listinfo/numpydiscussion > > 
From: Hartley, Ed <e.hartley@la...>  20020514 08:03:30

Hi interesting discussion please could you quote the complete reference to this > I have based my routine on the document "Discrete simulation of power low > noise", IEEE International Frequency Control Symposium 2729 > Regards Ed Hartley Research Fellow Computing Department Lancaster University Lancaster UK LA1 4YR Phone +44 (0) 1524 593675 Fax +44 (0) 1524 593608 
From: <johanfo@oh...>  20020513 09:21:16

First, I would like to say I have solved the problem myself, but thanks to those who tried to help me :). The error was related to the way the NR realft() function interpreted the parameters. realft(data[],length,1) I thought length was how long the data array is. However the routine reads and uses data TWICE the length !! :/ Now, back to the side note. Yes, colored noise is quite interesting. It has applications especially in clock simulations. I have based my routine on the document "Discrete simulation of power low noise", IEEE International Frequency Control Symposium 2729 This is a document not found on the internet, but if you ask your university or library they might have it. In the appendix of this document there is a sample C program which simulates power law noise. Now that my python port of this is working you can have the code :) The parameters to the noiseGen are: points = number of points to generate X = the array in which to add the noise¨ Qd = The noise variance b = the power law variable. f^(b + 2). Where f is the frequency. i.e b = 0 gives what is called white phase noise b=1 gives white flicker noise b=2 white frequency noise (phase random walk noise) b=3 flicker frequency noise (pink noise) b=4 random walk frequency noise Noninteger values of b is also allowed, .i.e 2.5 ############################################################################ ## # MODULE NAME: Colored Noise Module # AUTHOR: Johan Fredrik Øhman # # This module should simulate the colored noise found in clocks # ############################################################################ ## import math, FFT, RNG, sys, emath, Numeric __gausian = RNG.NormalDistribution(0, 1) gausian = RNG.CreateGenerator(0, __gausian) def noiseGen(points, X, Qd, b): mhb = b / 2.0 Qd = math.sqrt(Qd) # Deviation of the noise hfb = [0] * (points * 2) wfb = [0] * (points * 2) hfb[0] = 1.0 wfb[0] = Qd * gausian.ranf() for i in range(1, len(wfb)/2): # Generate hk coefficients hfb[i] = hfb[i1]/float(i) * (i1 + mhb) # Fille wk with white noise wfb[i] = Qd * gausian.ranf() hfb = FFT.real_fft(hfb) wfb = FFT.real_fft(wfb) # Multiply the complex vectors # Convolation wfb = wfb * hfb wfb = FFT.inverse_real_fft(wfb) for i in range(0,len(wfb)/2): X[i] += wfb[i] if __name__ == '__main__': X = [0] * (2**7) noiseGen(2**7, X, 1, 4) c = 0 for i in X: print c ,i c += 1 > Hi Johan, > > > I'm not expecting anybody to look at the whole programs, so I have just cut > > out the important part (however, the complete source is included at the > > bottom of this mail. The program is creating colored noise) > > As a side note, this is a pretty neat function. Can you give > me a reference for it? I would like to know exactly what is > going on... > > > The problem is (most likely) that the C program uses a library called > > "Numerical Recipes". In this library there is a function called realft(). > > I don't know these FFT functions all that well, but there is a distinct > > difference from the NR (Numerical Recipies) realft() and the FFT.real_fft() > > function of Numerical Python. This is best illustrated by an example: > > Assume a list/array of 1024 integers. If you put this array through > > FFT.real_fft() you get a 513 long array as a result. The NR realft() gives > > a 2048 long array. Now, since C cannot deal with complex numbers it has to > > use two entries for each number. Still the array is much larger than the > > Numpy version. > > > > Anybody know why ? > > Well, the FFT module returns an array that contains only the > positive frequencies (from 0 freq (i.e. the DC value) to the > Nyquist) from the realvalued FFT. This is N/2+1 values if N > is the number of points in the realvalued FFT. > > The Numerical Recipes (NR) routine should return N/2 values > (although you actually get _N_ floats back instead of N/2 > complex numbers  these are the real and imaginary > components). NR also packs the Nyquist and DC components into > the first two floats (i.e. the first complex number). This way > you still get all the information, but in the same number of > floats as the original array. If this is confusing, I > recommend reading the section on how NR packs its FFT arrays. > The book can be found online at: > > http://www.ulib.org/webRoot/Books/Numerical_Recipes/bookcpdf.html > > > wfb and hfb are equal length. Is this a legal way to convolve using > > FFT.real_fft() ? > > > > wfb = FFT.real_fft(wfb) > > hfb = FFT.real_fft(hfb) > > > > for i in range(0, len(wfb)): > > wfb[i] = wfb[i] * hfb[i] > > > > wfb = FFT.inverse_real_fft(wfb) > > Yes. But it is not very efficient because of the for loop. I > have modified your code to make it arraybased (i.e. using the > wonderful features of Numeric). Notice that all the for loops > are gone (or at least hidden somewhere underneath in the C > implementation...). I _think_ it does what you want it to do, > and the only notquitesointuitive thing is the > umath.multiply.accumulate call, which performs th > recurrencelike multiplications in the hfb forloop. > > Cheers, > > Scott > >  > > import umath, Numeric, FFT, RandomArray, sys > > def noiseGen(points, Qd, b): > mhb = b/2.0 > Qd = umath.sqrt(Qd) # Deviation of the noise > hfb = Numeric.ones(points, 'd') > indices = Numeric.arange(len(hfb)1, typecode='d') > hfb[1:] = (mhb+indices)/(indices+1.0) > hfb = umath.multiply.accumulate(hfb) > wfb = Qd*RandomArray.standard_normal(points) > return FFT.inverse_real_fft(FFT.real_fft(wfb)*FFT.real_fft(hfb)) > > if __name__ == '__main__': > X = noiseGen(2**5, 1, 2) > for x in X: print x > >  > >  > Scott M. Ransom Address: McGill Univ. Physics Dept. > Phone: (514) 3986492 3600 University St., Rm 338 > email: ransom@... Montreal, QC Canada H3A 2T8 > GPG Fingerprint: 06A9 9553 78BE 16DB 407B FFCA 9BFA B6FF FFD3 2989 > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: bandwidth@... > _______________________________________________ > Numpydiscussion mailing list > Numpydiscussion@... > https://lists.sourceforge.net/lists/listinfo/numpydiscussion > > 
From: Scott Ransom <ransom@ph...>  20020513 02:46:58

Hi Johan, > I'm not expecting anybody to look at the whole programs, so I have just cut > out the important part (however, the complete source is included at the > bottom of this mail. The program is creating colored noise) As a side note, this is a pretty neat function. Can you give me a reference for it? I would like to know exactly what is going on... > The problem is (most likely) that the C program uses a library called > "Numerical Recipes". In this library there is a function called realft(). > I don't know these FFT functions all that well, but there is a distinct > difference from the NR (Numerical Recipies) realft() and the FFT.real_fft() > function of Numerical Python. This is best illustrated by an example: > Assume a list/array of 1024 integers. If you put this array through > FFT.real_fft() you get a 513 long array as a result. The NR realft() gives > a 2048 long array. Now, since C cannot deal with complex numbers it has to > use two entries for each number. Still the array is much larger than the > Numpy version. > > Anybody know why ? Well, the FFT module returns an array that contains only the positive frequencies (from 0 freq (i.e. the DC value) to the Nyquist) from the realvalued FFT. This is N/2+1 values if N is the number of points in the realvalued FFT. The Numerical Recipes (NR) routine should return N/2 values (although you actually get _N_ floats back instead of N/2 complex numbers  these are the real and imaginary components). NR also packs the Nyquist and DC components into the first two floats (i.e. the first complex number). This way you still get all the information, but in the same number of floats as the original array. If this is confusing, I recommend reading the section on how NR packs its FFT arrays. The book can be found online at: http://www.ulib.org/webRoot/Books/Numerical_Recipes/bookcpdf.html > wfb and hfb are equal length. Is this a legal way to convolve using > FFT.real_fft() ? > > wfb = FFT.real_fft(wfb) > hfb = FFT.real_fft(hfb) > > for i in range(0, len(wfb)): > wfb[i] = wfb[i] * hfb[i] > > wfb = FFT.inverse_real_fft(wfb) Yes. But it is not very efficient because of the for loop. I have modified your code to make it arraybased (i.e. using the wonderful features of Numeric). Notice that all the for loops are gone (or at least hidden somewhere underneath in the C implementation...). I _think_ it does what you want it to do, and the only notquitesointuitive thing is the umath.multiply.accumulate call, which performs th recurrencelike multiplications in the hfb forloop. Cheers, Scott  import umath, Numeric, FFT, RandomArray, sys def noiseGen(points, Qd, b): mhb = b/2.0 Qd = umath.sqrt(Qd) # Deviation of the noise hfb = Numeric.ones(points, 'd') indices = Numeric.arange(len(hfb)1, typecode='d') hfb[1:] = (mhb+indices)/(indices+1.0) hfb = umath.multiply.accumulate(hfb) wfb = Qd*RandomArray.standard_normal(points) return FFT.inverse_real_fft(FFT.real_fft(wfb)*FFT.real_fft(hfb)) if __name__ == '__main__': X = noiseGen(2**5, 1, 2) for x in X: print x   Scott M. Ransom Address: McGill Univ. Physics Dept. Phone: (514) 3986492 3600 University St., Rm 338 email: ransom@... Montreal, QC Canada H3A 2T8 GPG Fingerprint: 06A9 9553 78BE 16DB 407B FFCA 9BFA B6FF FFD3 2989 
From: <johanfo@oh...>  20020512 21:37:46

Hi there. I have a problem related to the fft routine in numpy. I'm trying to port a short C program to python, however it has turned out to be a little more complicated than initally thought. I'm not expecting anybody to look at the whole programs, so I have just cut out the important part (however, the complete source is included at the bottom of this mail. The program is creating colored noise) The problem is (most likely) that the C program uses a library called "Numerical Recipes". In this library there is a function called realft(). I don't know these FFT functions all that well, but there is a distinct difference from the NR (Numerical Recipies) realft() and the FFT.real_fft() function of Numerical Python. This is best illustrated by an example: Assume a list/array of 1024 integers. If you put this array through FFT.real_fft() you get a 513 long array as a result. The NR realft() gives a 2048 long array. Now, since C cannot deal with complex numbers it has to use two entries for each number. Still the array is much larger than the Numpy version. Anybody know why ? wfb and hfb are equal length. Is this a legal way to convolve using FFT.real_fft() ? wfb = FFT.real_fft(wfb) hfb = FFT.real_fft(hfb) for i in range(0, len(wfb)): wfb[i] = wfb[i] * hfb[i] wfb = FFT.inverse_real_fft(wfb)  JFØ ==================== PYTHON ==================== import math, FFT, RNG, sys __gausian = RNG.NormalDistribution(0, 1) gausian = RNG.CreateGenerator(0, __gausian) def noiseGen(points, X, Qd, b): mhb = b / 2.0 Qd = math.sqrt(Qd) # Deviation of the noise hfb = [0] * points wfb = [0] * points hfb[0] = 1.0 wfb[0] = Qd * gausian.ranf() for i in range(1, len(wfb)): # Generate hk coefficients hfb[i] = hfb[i1]/float(i) * (i1 + mhb) # Fille wk with white noise wfb[i] = Qd * gausian.ranf() wfb = FFT.real_fft(wfb) hfb = FFT.real_fft(hfb) print hfb # Multiply the complex vectors # Convolation for i in range(0, len(wfb)): wfb[i] = wfb[i] * hfb[i] wfb = FFT.inverse_real_fft(wfb) for i in range(0,len(wfb)): X[i] += wfb[i] if __name__ == '__main__': X = [0] * (2**10) noiseGen(2**10, X, 1, 2) for i in X: print i ========================== C Program ========================== #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #include "c/numrec.h" #include "c/NRutil.h" void f_beta(int n_pts, float X[], float Q_d, float b, int *idum){ int i,nn; float *hfb,*wfb; float mhb,wr,wi; nn = n_pts * 2; mhb = b / 2.0; Q_d = sqrt(Q_d); hfb = vector(1,nn); wfb = vector(1,nn); hfb[1] = 1.0; wfb[1] = Q_d * gasdev(idum); for(i=2; i<=n_pts; i++){ hfb[i] = hfb[i1]*(mhb+(float)(i2))/((float)(i1)); wfb[i] = Q_d * gasdev(idum); } for(i=n_pts;i <= nn; i++){ hfb[i] = 0.0; wfb[i] = 0.0; } realft(hfb, n_pts,1); realft(wfb, n_pts,1); wfb[1]=wfb[1]*hfb[1]; wfb[2]=wfb[2]*hfb[2]; for(i=3; i<= nn; i += 2){ wr = wfb[i]; wi = wfb[i+1]; wfb[i] = wr*hfb[i]wi*hfb[i+1]; wfb[i+1] = wr*hfb[i+1]+wi*hfb[i]; } realft(wfb, n_pts, 1); for(i=1; i <=n_pts;i++){ X[i] += wfb[i]/((float)n_pts); } free_vector(hfb,1,nn); free_vector(wfb,1,nn); } int main(){ int length22; int i; int idum = 210310212; float *X; X = vector(1,1024); f_beta(1024, X, 1, 2, &idum); for(i=1;i<=1024;i++){ printf("%f\n",X[i]); } return 0; }  Johan Fredrik Øhman 