1

I'm an astronomer and just recived a lot, a LOT, of code writed on IDL, I use GDL to run it and works just fine (mostly), but I'm mainly a Ptyhon (2.7) user so would be nice to find a way to be able to call the IDL rutines from my Python scripts.

I'm aware of the idlpy bridge between IDL and Python, but it also works on GDL?

Thanks for the info

1 Answer 1

2

According to the GDL website, yes.

"GDL has also a Python bridge (Python code can be called from GDL; GDL can be compiled as a Python module)."

I haven't used it, so I can't say for sure whether or not it works, but here's what I found. The GDL documentation is rather bare, but does include some info. Calling Python from within GDL is briefly described on page 69. Calling GDL from Python is not documented there, though.

There's more info on using GDL from within Python on the GDL Github repository, including this example:

>>> import GDL
>>> print GDL.function("sin",(1,))
0.841470956802

And here's an example from elsewhere on the web:

>>> import numpy
>>> import GDL
>>> a = numpy.ndarray(10)
>>> GDL.pro("plot", a)
Sign up to request clarification or add additional context in comments.

3 Comments

How I can install GDL in order to be used as a python lirary? I cant import GDL....
I haven't been able to successfully install GDL yet, but you should be able to install it just for use as a python library. I think what you want to do is download GDL and use cmake with the following options: cmake -DPYTHON=OFF -DPYTHON_MODULE=ON The PYTHON_MODULE is what you want for importing GDL into python. PYTHON is for calling python within GDL. There are a bunch of other optional modules that you might also want to explicitly turn off, if you're only installing it to be used as a python library.
Somehow related question (because no-one seems to have an explanation as to how really install this module) stackoverflow.com/questions/48954138/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.