Re: [Numpy-discussion] interpolation in numpy

2009-07-09 Thread Thomas Hrabe
ow, numpy doesn't have any 3D interpolation routines, so > you'll have to install scipy. Interp2d will only interpolate slices of your > data, not the whole volume. > > -Joe > > On Thu, Jul 9, 2009 at 8:42 AM, Thomas Hrabe wrote: >> >> Hi all, >> >&g

[Numpy-discussion] interpolation in numpy

2009-07-09 Thread Thomas Hrabe
Hi all, I am not a newbie to python and numpy, but however, I kinda do not find a proper solution for my interpolation problem without coding it explicitly myself. All I want to do is to increase the resolution of an tree dimensional array. I have a volume 'a' a = numpy.random.rand(3,3,3) now,

Re: [Numpy-discussion] Numpy array flags - BUG?

2008-09-12 Thread Thomas Hrabe
Thank you, first tests work. Thomas Travis E. Oliphant wrote: > > Thomas Hrabe wrote: >> Hello everyone, >> >> I must report odd behaviour of the numpy arrays regarding the flags set >> for >> each array object in C++. >> Please have a look at the f

[Numpy-discussion] C to Fortran Conversion

2008-09-11 Thread Thomas Hrabe
Hi all, this post might not really belong into this forum, but as the functions I am looking for are member of numpy, I thought I might drop a message at this point. I am looking for some functions/ a library converting C aligned arrays to Fortran, due to the flags problem I mentioned recently in

Re: [Numpy-discussion] Numpy array flags - BUG?

2008-09-11 Thread Thomas Hrabe
I tried another approach, creating an array in python with >>>import numpy; >>>a = numpy.zeros((2,2),order="C"); >>>a.flags.num 1285 and setting the flags within C++ to 1286. The value remains the same (1285) after setting it to 1286 in embedded C. PyArg_ParseTuple(args, "O!",&PyArray_Type, &ar

[Numpy-discussion] Numpy array flags - BUG?

2008-09-11 Thread Thomas Hrabe
Hello everyone, I must report odd behaviour of the numpy arrays regarding the flags set for each array object in C++. Please have a look at the following code: static PyObject* test(PyObject* self,PyObject* args){ int s[2]; s[0] = 1; s[1] = 1; char* value = (cha

Re: [Numpy-discussion] arrays : c aligmen to fortran and back

2008-08-04 Thread Thomas Hrabe
public C/C++ code available... ??? I would like to have this python call in my C code (without calling an embedded function or so). xf = np.asfortranarray(x) Thank you very much, Thomas -Original Message- From: [EMAIL PROTECTED] on behalf of Thomas Hrabe Sent: Mon 8/4/2008 2:14 PM To

Re: [Numpy-discussion] arrays : c aligmen to fortran and back

2008-08-04 Thread Thomas Hrabe
Thomas Hrabe <[EMAIL PROTECTED]>: > I need to convert a 3d array from c alingment to fortran and was wandering > for the simplest code available. > Its all about python and an interfaced C++ program, which, however, > processes fortran aligned arrays. > > Is there a simple

[Numpy-discussion] arrays : c aligmen to fortran and back

2008-08-03 Thread Thomas Hrabe
Hi all, I need to convert a 3d array from c alingment to fortran and was wandering for the simplest code available. Its all about python and an interfaced C++ program, which, however, processes fortran aligned arrays. Is there a simple code from converting an array arr = numpy.array((30,20,10)

Re: [Numpy-discussion] embedded arrays- still an issue

2008-06-24 Thread Thomas Hrabe
thon Betreff: Re: [Numpy-discussion] embedded arrays On Fri, Jun 6, 2008 at 17:10, Thomas Hrabe <[EMAIL PROTECTED]> wrote: > Hi all, > > while writing a extension module in C++ for python & numpy, I find a strange > error. > > I can send and retrieve numpy arrays to and

Re: [Numpy-discussion] embedded arrays - continued

2008-06-19 Thread Thomas Hrabe
15:27 An: Discussion of Numerical Python Betreff: Re: [Numpy-discussion] embedded arrays On Fri, Jun 6, 2008 at 17:10, Thomas Hrabe <[EMAIL PROTECTED]> wrote: > Hi all, > > while writing a extension module in C++ for python & numpy, I find a strange > error. > > I

Re: [Numpy-discussion] embedded arrays

2008-06-06 Thread Thomas Hrabe
Furthermore, I sometimes get a Segmentation fault Illegal instruction and sometimes it works It might be a memory leak, due to the segfault and the arbitrary behavior.? Best -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] im Auftrag von Thomas Hrabe Gesendet: Fr 06.06.2008 15:10 An

[Numpy-discussion] embedded arrays

2008-06-06 Thread Thomas Hrabe
Hi all, while writing a extension module in C++ for python & numpy, I find a strange error. I can send and retrieve numpy arrays to and from my module. But python stops if I do the following: a = numpy.array([[1.1,2,3],[4,5,6]]) PM.put(a,'a') //send a to the module b = PM.get('a') //get a ide

Re: [Numpy-discussion] osX leopard linker setting

2008-05-22 Thread Thomas Hrabe
By the way, whats a lazy pointer anyway? -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] im Auftrag von Thomas Hrabe Gesendet: Do 22.05.2008 11:22 An: numpy-discussion@scipy.org Betreff: [Numpy-discussion] osX leopard linker setting Hi, does anybody know the linker settings for

[Numpy-discussion] osX leopard linker setting

2008-05-22 Thread Thomas Hrabe
Hi, does anybody know the linker settings for python c modules on osX ? i have the original xcode3 tools installed -> gcc 4.0.1 I use '-bundle -flat_namespace' for linking now, but I get ld: can't insert lazy pointers, __dyld section not found for inferred architecture ppc Does anybody know

Re: [Numpy-discussion] 1.1.0rc1 OSX Installer - please test

2008-05-21 Thread Thomas Hrabe
iBook G4 osX 10.5.2 hope this helps! Numpy is installed in /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy Numpy version 1.1.0rc1 Python version 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] Found 18/18 tests for nu

Re: [Numpy-discussion] (SPAM) Re:embeddedPyArray_FromDimsAndDataSegmentationFault

2008-05-20 Thread Thomas Hrabe
ti, 2008-05-20 kello 13:36 -0700, Thomas Hrabe kirjoitti: > Thats what PyErr_Print() prints. > Python is initialised, for sure > > Traceback (most recent call last): > File "/usr/global/python32/lib/python2.4/site-packages/numpy/__init__.py", > lin > e 34, in ?

Re: [Numpy-discussion] embeddedPyArray_FromDimsAndDataSegmentationFault

2008-05-20 Thread Thomas Hrabe
al Python Subject: Re: [Numpy-discussion] embeddedPyArray_FromDimsAndDataSegmentationFault On Tue, May 20, 2008 at 2:01 PM, Thomas Hrabe <[EMAIL PROTECTED]> wrote: > After all, I figured how to create an numpy in C with the help below. > > If called in C, import_array() but actually _import_array()

Re: [Numpy-discussion] embedded PyArray_FromDimsAndDataSegmentationFault

2008-05-20 Thread Thomas Hrabe
- From: [EMAIL PROTECTED] on behalf of Robert Kern Sent: Wed 5/14/2008 5:12 PM To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] embedded PyArray_FromDimsAndDataSegmentationFault On Wed, May 14, 2008 at 6:40 PM, Thomas Hrabe <[EMAIL PROTECTED]> wrote: >>I didn't

Re: [Numpy-discussion] dimension aligment

2008-05-20 Thread Thomas Hrabe
] dimension aligment On Tue, May 20, 2008 at 11:47 AM, Thomas Hrabe <[EMAIL PROTECTED]> wrote: > > Hi all, > > just a simple question regarding the alignment of dimensions: > > > given a 3d array > a = > numpy.array([[[1,2,3],[4,5,6]],[[7,8,9],[10,11,12]],[

[Numpy-discussion] dimension aligment

2008-05-20 Thread Thomas Hrabe
Hi all, just a simple question regarding the alignment of dimensions: given a 3d array a = numpy.array([[[1,2,3],[4,5,6]],[[7,8,9],[10,11,12]],[[13,14,15],[16,17,18]],[[19,20,21],[22,23,24]]]) a.shape returns (4,2,3) so I assume the first digit is the 3rd dimension, second is 2nd dim and thi

Re: [Numpy-discussion] embedded PyArray_FromDimsAndDataSegmentationFault

2008-05-14 Thread Thomas Hrabe
>But for the most part, it's much better to drive your C code using >Python than the other around. True, the other way arround works fine. Will investigate further tomorrow, because its a must have feature... Thanks <>___ Numpy-discussion mailing list

Re: [Numpy-discussion] embedded PyArray_FromDimsAndDataSegmentation Fault

2008-05-14 Thread Thomas Hrabe
>I didn't know a person could write a stand-alone program using NumPy >this way (can you?) Well, this is possible when you embed python and use the "simple" objects such as ints, strings, Why should it be impossible to do it for numpy then? My plan is to send multidimensional arrays from C t

[Numpy-discussion] embedded PyArray_FromDimsAndData Segmentation Fault

2008-05-14 Thread Thomas Hrabe
Hi all, the PyArray_FromDimsAndData is still cousing me headaches. Is there anybody out there finding the error of the following code? #include "Python.h" #include int main(int argc,char** argv) { int dimensions = 2; void* value = malloc(sizeof(double)*100); int* si

[Numpy-discussion] Embedding Python - data exchange && no Boost

2008-05-07 Thread Thomas Hrabe
Hi all, I am writing an embedded python application in C/C++ with the following features: 1. The user is able to execute python commands (works fine with PyRun_SimpleString) 2. I want the user to be able to load C objects from C into the current python interpreter, so that the user is able to

[Numpy-discussion] Compilation problems - bizzare

2008-05-05 Thread Thomas Hrabe
Hi all, currently, I am writing a box of modular functions for exchanging python & matlab objects (nd arrays in particular). I am facing an odd problem which I can not explain to myself: I use PyArg_ParseTuple(args, "O!s",&PyArray_Type, &array,&na) for parsing the array and a string. This funct

Re: [Numpy-discussion] access ndarray in C++

2008-04-23 Thread Thomas Hrabe
] on behalf of Christopher Barker Sent: Wed 4/23/2008 1:15 PM To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] access ndarray in C++ Christopher Barker wrote: > Thomas Hrabe wrote: > I'd poke around the wiki, and this mailing list archives, for more examples. Th

Re: [Numpy-discussion] access ndarray in C++

2008-04-23 Thread Thomas Hrabe
thout using a custom hack. Finally, my primary aim is to access 3dimensional arrays of floats in C. Best, Thomas -Original Message- From: [EMAIL PROTECTED] on behalf of Thomas Hrabe Sent: Tue 4/22/2008 2:38 PM To: numpy-discussion@scipy.org Subject: [Numpy-discussion] access ndarray in C

[Numpy-discussion] access ndarray in C++

2008-04-22 Thread Thomas Hrabe
Hi all! I am currently developing a python module in C/C++ which is supposed to access nd arrays as defined by the following command in python a = numpy.array([1,1,1]) I want to access the array the following way and use the nd array data for further processing in C. mymod.doSthg(a) The exam