comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDL kernel for IPython/Jupyter Notebooks
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
IDL kernel for IPython/Jupyter Notebooks [message #89213] Tue, 05 August 2014 02:30 Go to next message
lstagner89 is currently offline  lstagner89
Messages: 10
Registered: June 2014
Junior Member
Hello,

In recent weeks, the IPython team has decided to split the IPython project into two separate projects. The language agnostic portions of IPython i.e. the console, qtconsole, and notebook will become Project Jupyter. The python specific parts of IPython will still be called IPython but will be a language kernel for Jupyter. Here is a link to the [announcement](https://www.youtube.com/watch?v=JDrhn0-r9Eg&t=4m10s).

In preparation of this split, wrapper kernels were introduced into the current development version of IPython as an easy way to make language kernels. Using this new feature I made an IDL/GDL kernel.

The kernel has basic functionality such as inline plots but there is room for improvement.

I would appreciate testers since I did not have IDL available when I made the kernel.

I would also appreciate contributors to help improve the kernel.

I hope this will be a useful tool for the IDL community.

Regards,
Luke Stagner


Source: https://github.com/lstagner/idl_kernel

Demo Notebook: http://nbviewer.ipython.org/github/lstagner/idl_kernel/blob/ master/demo.ipynb

Wrapper Kernels: http://ipython.org/ipython-doc/dev/development/wrapperkernel s.html
Re: IDL kernel for IPython/Jupyter Notebooks [message #89214 is a reply to message #89213] Tue, 05 August 2014 03:57 Go to previous messageGo to next message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
Hi Luke,

this looks terrific! I'll try it when possible.

Cheers,

Fabien
Re: IDL kernel for IPython/Jupyter Notebooks [message #89217 is a reply to message #89213] Tue, 05 August 2014 10:53 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 8/5/14, 3:30 AM, Luke Stagner wrote:
> Hello,
>
> In recent weeks, the IPython team has decided to split the IPython
> project into two separate projects. The language agnostic portions of
> IPython i.e. the console, qtconsole, and notebook will become Project
> Jupyter. The python specific parts of IPython will still be called
> IPython but will be a language kernel for Jupyter. Here is a link to
> the
> [announcement](https://www.youtube.com/watch?v=JDrhn0-r9Eg&t=4m10s).
>
> In preparation of this split, wrapper kernels were introduced into
> the current development version of IPython as an easy way to make
> language kernels. Using this new feature I made an IDL/GDL kernel.
>
> The kernel has basic functionality such as inline plots but there is
> room for improvement.
>
> I would appreciate testers since I did not have IDL available when I
> made the kernel.
>
> I would also appreciate contributors to help improve the kernel.
>
> I hope this will be a useful tool for the IDL community.
>
> Regards, Luke Stagner
>
>
> Source: https://github.com/lstagner/idl_kernel
>
> Demo Notebook:
> http://nbviewer.ipython.org/github/lstagner/idl_kernel/blob/ master/demo.ipynb
>
> Wrapper Kernels:
> http://ipython.org/ipython-doc/dev/development/wrapperkernel s.html
>

Awesome! I got this working with IDL 8.3 and using the current Anaconda
Python distribution. In addition to idl_kernel, I had to install:

IPython 3.0-dev (get from https://github.com/ipython/ipython)
pexpect 3.3 (download from https://pypi.python.org/pypi/pexpect)
jsonpointer (easy_install)
jsonschema (easy_install)

It is working for my basic examples. There are three small issues I see
so far:

1. There are a few error messages at the command line where I
launched IPython.

2. It prints debug type messages like

.run /var/folders/3l/5497218j7x99gbh9xdh8fn500000gp/T/tmppbCisE

in the notebook after I execute a command.

3. I see a red flash before inline graphics appear in the notebook.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
Re: IDL kernel for IPython/Jupyter Notebooks [message #89219 is a reply to message #89217] Tue, 05 August 2014 12:14 Go to previous messageGo to next message
lstagner89 is currently offline  lstagner89
Messages: 10
Registered: June 2014
Junior Member
Thanks Mike,

> 1. There are a few error messages at the command line where I
>
> launched IPython.

I believe these are IPython errors. I expect they will be fixed before the 3.0 release

> 2. It prints debug type messages like
>
> .run /var/folders/3l/5497218j7x99gbh9xdh8fn500000gp/T/tmppbCisE
>
> in the notebook after I execute a command.

What the kernel does is that it writes the contents of a cell into a temporary file and then runs it. This allows the kernel to compile functions and procedures. I do not have the debug messages though since I have the kernel set !quiet=1. I'm not sure why you see it.

> 3. I see a red flash before inline graphics appear in the notebook.

This is actually an IDL graphics window popping up and then being destroyed. In the kernel a png of the plot is produced and is then sent to the notebook. I tried writing the png directly but it caused some issues.

1. Plot colors were not correct

I am not sure what caused this. It may have been a shortcoming of GDL

2. The ability to compile functions and procedures were lost.

Expressions needed to produce the png were written to the file before the cell input which is not allowed if the cell contains procedures. This could be solved by parsing the cell input and writing the procedures to the temporary file first or perhaps by using multiple execute statements

Inline plotting is an area that needs improvement. In addition to the issues I mentioned, if there are multiple plots in a cell then only the last one will be displayed (the rest will be in graphics window).

-Luke
Re: IDL kernel for IPython/Jupyter Notebooks [message #89283 is a reply to message #89219] Wed, 13 August 2014 17:56 Go to previous messageGo to next message
Pierre V. is currently offline  Pierre V.
Messages: 13
Registered: December 2006
Junior Member
>> 3. I see a red flash before inline graphics appear in the notebook.
>
>
> This is actually an IDL graphics window popping up and then being destroyed. In the kernel a png of the plot is produced and is then sent to the notebook. I tried writing the png directly but it caused some issues.
>

Have you thought of using the function call 'w = window(/buffer)'? This should give you the same results, but no window popping up.
Re: IDL kernel for IPython/Jupyter Notebooks [message #89284 is a reply to message #89283] Thu, 14 August 2014 02:54 Go to previous messageGo to next message
lstagner89 is currently offline  lstagner89
Messages: 10
Registered: June 2014
Junior Member
Thanks for the info. At the moment however I am trying to keep everything backwards compatible with the last version of IDL i.e. 7.0 . When version 9.0 comes out I may use your solution.

I think I may be able to solve the problem using pixmaps. Any suggestions on how to effectively do this would be welcome.


-Luke

On Wednesday, August 13, 2014 5:56:35 PM UTC-7, pierre.v...@gmail.com wrote:
>>> 3. I see a red flash before inline graphics appear in the notebook.
>
>>
>
>>
>
>> This is actually an IDL graphics window popping up and then being destroyed. In the kernel a png of the plot is produced and is then sent to the notebook. I tried writing the png directly but it caused some issues.
>
>>
>
>
>
> Have you thought of using the function call 'w = window(/buffer)'? This should give you the same results, but no window popping up.
Re: IDL kernel for IPython/Jupyter Notebooks [message #89288 is a reply to message #89284] Thu, 14 August 2014 07:21 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 8/14/14, 3:54 am, Luke Stagner wrote:
> Thanks for the info. At the moment however I am trying to keep
> everything backwards compatible with the last version of IDL i.e. 7.0
> . When version 9.0 comes out I may use your solution.
>
> I think I may be able to solve the problem using pixmaps. Any
> suggestions on how to effectively do this would be welcome.

Very easy. Use "window, /pixmap" to create and tvrd to get contents of
window into an array that you could write into an image file.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: checking if PS output file already open
Next Topic: Re: Is it possible to speed up the Interpolate command?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:44:26 PDT 2025

Total time taken to generate the page: 0.00579 seconds