comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Any interest in an IDL to Python interface?
items: Re: Any interest in an IDL to Python interface?

Any interest in an IDL to Python interface?
type: item
description: We're thinking of coming out with product that acts as a bridge between IDL and Python, and are trying to get an idea of how much of a demand there is for this sort of thing. It would make Python modules usable directly from IDL. Some simple usage examples, meant to show how the interface works, rather than why you might want to use Python from IDL. Using the Python Imaging Library to load an image, rotate it, and then place it in an IDL array. IDL> numpy=pyimport('numpy') Loaded DLM: PYTHONFROMIDL. IDL> pilimage=pyimport('PIL.Image') IDL> img=pilimage->open('scan.jpeg') IDL> img=img->rotate(30) IDL> imgarr=numpy->array(img) IDL> help, imgarr IMGARR BYTE = Array[3, 850, 864] IDL> tv, imgarr, /true, order=1 Defining and calling an arbitrary python function. IDL> py=pyimport('__main__') IDL> py->exec, "def mulbytwo(a):"+string(10b)+" return [x*2 for x in a]" IDL> print, py->mulbytwo([1,2,3,4,5]) 2 4 6 8 10 Features of the interface: Python objects (including modules) appear in IDL as IDL objects. Automatic conversion of method parameters from IDL variables to the appropriate python type. Automatic conversion of return values to IDL types. The Python environment runs in the same process as IDL, so parameter passing is fast. Automatic garbage collection of IDL objects that represent Python objects, so calling OBJ_DESTROY is not required. This makes the objects behave more Python like, so that you can do things like "img=((pilimage->open('scan.jpeg'))->rotate(30))->convert('L') " without leaking objects or having to call HEAP_GC. Would anyone find this useful? Thanks Jason Ferrara Jacquette Consulting, Inc.
creator: Jason Ferrara
date: 2008-02-28T16:00:30-00:00

Re: Any interest in an IDL to Python interface?
type: item
description: On Mar 2, 6:57 pm, Michael Aye <kmichael....@googlemail.com> wrote: > On Mar 1, 3:49 am, metachronist <rkombi...@gmail.com> wrote: > > > >> On Feb 29, 9:42 am, Jason Ferrara <jason.ferr...@jacquette.com> wrote: > >>> On Feb 28, 12:13 pm, Reimar Bauer <R.Ba...@fz-juelich.de> wrote: > >>>> Hi > >>>> it could be nice if something like that is added for all supported OS >>>> versions not only for windows. > >>> Its our plan to support Windows, Linux, and Mac. > >>>> python has lots of interesting libraries and is used as scripting >>>> language in many programs (OpenOffice.org, Blender, Maya, PyMOL, Gimp, etc.) > >>>> The problem will be the price or do you have considered to share it free >>>> of charge? > >>> It would be a commercial product. The pricing hasn't been determined >>> yet. > >>>> And another question has to be discussed too. What of idl will be left >>>> over if such a powerful programming language will be added to idl. >>>> For example this will give us the possibility to use QT4 for widgets. Or >>>> we never again do get "the sky is falling down miracle" because of the >>>> decimal data type. Or we can use pythons standalone webserver or lots of >>>> math libraries free of charge. > >>>> One has to ask himself if an idl program is mostly based on python >>>> modules why he has to use idl and does not do the whole job in python >>>> then? There are not much differences between both languages. > >>>> How would the development of idl been continued if we as user could >>>> always use other libs? > >>> I don't see this as being an issue. > >>> Each language has its own strengths and weaknesses. Its not a one >>> size >>> fits all thing. Interoperability between languages means you can mix >>> and >>> match as best solves your problem, rather than having to pick one and >>> then struggle with it for the things its not good with. > >>> And more libraries accessible from IDL makes IDL more useful, not >>> less. > >> First of all this is an excellent idea.. But…
creator: Anthony[1]
date: 2008-03-03T09:19:39-00:00

Re: Any interest in an IDL to Python interface?
type: item
description: GDL http://sourceforge.net/projects/gnudatalanguage has this functionality. Actually both ways: One can call python from GDL similar as described and GDL can be compiled as a python module. The drawback is that GDL only supports python numarray yet. Cheers, Marc On Feb 28, 5:00 pm, Jason Ferrara <jason.ferr...@jacquette.com> wrote: > We're thinking of coming out with product that acts as a bridge > between IDL and Python, and are trying to get an idea of how much of a > demand there is for this sort of thing. > > It would make Python modules usable directly from IDL. > > Some simple usage examples, meant to show how the interface works, > rather than why you might want to use Python from IDL. > > Using the Python Imaging Library to load an image, rotate it, and then > place it in an IDL array. > IDL> numpy=pyimport('numpy') > Loaded DLM: PYTHONFROMIDL. > IDL> pilimage=pyimport('PIL.Image') > IDL> img=pilimage->open('scan.jpeg') > IDL> img=img->rotate(30) > IDL> imgarr=numpy->array(img) > IDL> help, imgarr > IMGARR BYTE = Array[3, 850, 864] > IDL> tv, imgarr, /true, order=1 > > Defining and calling an arbitrary python function. > IDL> py=pyimport('__main__') > IDL> py->exec, "def mulbytwo(a):"+string(10b)+" return [x*2 for x > in a]" > IDL> print, py->mulbytwo([1,2,3,4,5]) > 2 4 6 8 10 > > Features of the interface: > > Python objects (including modules) appear in IDL as IDL objects. > > Automatic conversion of method parameters from IDL variables to the > appropriate python type. > > Automatic conversion of return values to IDL types. > > The Python environment runs in the same process as IDL, so parameter > passing is fast. > > Automatic garbage collection of IDL objects that represent Python > objects, so calling OBJ_DESTROY is not required. This makes the > objects behave more Python like, so that you can do things like > "img=((pilimage->open('scan.jpeg'))->rotate(30))->convert('L') " > without leaking objects or having to call HEAP_GC. > > Would anyone find thi…
creator: m_schellens
date: 2008-03-03T14:12:48-00:00

Re: Any interest in an IDL to Python interface?
type: item
description: m_schellens@hotmail.com schrieb: > GDL > http://sourceforge.net/projects/gnudatalanguage > > has this functionality. > Actually both ways: One can call python from GDL similar as described > and GDL can be compiled as a python module. > The drawback is that GDL only supports python numarray yet. > yeah but because it is completly open source someone who is interested could help to implement some other modules. Btw. do you have done a request for gdl as a summer of code project? cheers Reimar > > > On Feb 28, 5:00 pm, Jason Ferrara <jason.ferr...@jacquette.com> wrote: >> We're thinking of coming out with product that acts as a bridge >> between IDL and Python, and are trying to get an idea of how much of a >> demand there is for this sort of thing. >> >> It would make Python modules usable directly from IDL. >> >> Some simple usage examples, meant to show how the interface works, >> rather than why you might want to use Python from IDL. >> >> Using the Python Imaging Library to load an image, rotate it, and then >> place it in an IDL array. >> IDL> numpy=pyimport('numpy') >> Loaded DLM: PYTHONFROMIDL. >> IDL> pilimage=pyimport('PIL.Image') >> IDL> img=pilimage->open('scan.jpeg') >> IDL> img=img->rotate(30) >> IDL> imgarr=numpy->array(img) >> IDL> help, imgarr >> IMGARR BYTE = Array[3, 850, 864] >> IDL> tv, imgarr, /true, order=1 >> >> Defining and calling an arbitrary python function. >> IDL> py=pyimport('__main__') >> IDL> py->exec, "def mulbytwo(a):"+string(10b)+" return [x*2 for x >> in a]" >> IDL> print, py->mulbytwo([1,2,3,4,5]) >> 2 4 6 8 10 >> >> Features of the interface: >> >> Python objects (including modules) appear in IDL as IDL objects. >> >> Automatic conversion of method parameters from IDL variables to the >> appropriate python type. >> >> Automatic conversion of return values to IDL types. >> >> The Python environment runs in the same process as IDL, so parameter >> passing is fast. >> >> Automatic garbage collection of IDL objects that represent Pyt…
creator: R.Bauer
date: 2008-03-03T14:26:00-00:00

Re: Any interest in an IDL to Python interface?
type: item
description: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 m_schellens@hotmail.com schrieb: > GDL > http://sourceforge.net/projects/gnudatalanguage > > has this functionality. > Actually both ways: One can call python from GDL similar as described > and GDL can be compiled as a python module. > The drawback is that GDL only supports python numarray yet. > > Cheers, > Marc btw. it was quite easy to install on my olpc XO yum install gdl plplot it seems not such easy on my SuSE box. cheers Reimar > > > On Feb 28, 5:00 pm, Jason Ferrara <jason.ferr...@jacquette.com> wrote: >> We're thinking of coming out with product that acts as a bridge >> between IDL and Python, and are trying to get an idea of how much of a >> demand there is for this sort of thing. >> >> It would make Python modules usable directly from IDL. >> >> Some simple usage examples, meant to show how the interface works, >> rather than why you might want to use Python from IDL. >> >> Using the Python Imaging Library to load an image, rotate it, and then >> place it in an IDL array. >> IDL> numpy=pyimport('numpy') >> Loaded DLM: PYTHONFROMIDL. >> IDL> pilimage=pyimport('PIL.Image') >> IDL> img=pilimage->open('scan.jpeg') >> IDL> img=img->rotate(30) >> IDL> imgarr=numpy->array(img) >> IDL> help, imgarr >> IMGARR BYTE = Array[3, 850, 864] >> IDL> tv, imgarr, /true, order=1 >> >> Defining and calling an arbitrary python function. >> IDL> py=pyimport('__main__') >> IDL> py->exec, "def mulbytwo(a):"+string(10b)+" return [x*2 for x >> in a]" >> IDL> print, py->mulbytwo([1,2,3,4,5]) >> 2 4 6 8 10 >> >> Features of the interface: >> >> Python objects (including modules) appear in IDL as IDL objects. >> >> Automatic conversion of method parameters from IDL variables to the >> appropriate python type. >> >> Automatic conversion of return values to IDL types. >> >> The Python environment runs in the same process as IDL, so parameter >> passing is fast. >> >> Automatic garbage collection of IDL objects that represent Python >> obje…
creator: R.Bauer
date: 2008-03-03T16:36:48-00:00