Re: Calling interface to NCL from Python - Ethan Alpert Python module.

From: Louis J. Wicker (Louis.Wicker AT XXXXXX)
Date: Mon Dec 23 2002 - 14:00:44 MST


All:

I have put a small tar file on my web site which demonstrates how to
create a Python/NCL program where Python is used to create the NCL
script. This is using a very simple library that Ethan Alpert wrote for
me a while back at SCD.

You can download it at: http://www.nssl.noaa.gov/~lwicker/testncl.tar

I am simply using one of the demonstration scripts to show how you build
a simple program.

Now, please check for where your GSUN is defined, the testncl.py script
defines where it is as part of an ncl load statement.

Also, remember, the ncl.so module is the new library and it is based on
Python2. So you need to be running that and also be on a RH Linux
system. I do not know if other Intel-based Linux systems will work.

Here is a quick example of using the lib:

$ python2

>>> import ncl

>>> ncl.command("a = 17.0")

(0) 17

>>>ncl.command("print(a)")

Variable: a
Type: float
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
(0) 17

Merry Xmas, and enjoy. Not sure if this adds a lot to what you already
have.

Lou Wicker

On Wed, 2002-12-18 at 16:03, Jeff Whitaker wrote:

> Lou: How about posting it on the web somewhere so we all can try it?
>
> -Jeff
>
> On Wed, 18 Dec 2002, Louis J. Wicker wrote:
>
> > I just want to remind everyone, especially those at SCD who are working
> > on stuff that Ethan Alpert already built me an interface that connects
> > Python to NCL via a Python module.
> >
> > You can compose and assemble NCL scripts in Python and then pass that
> > script to be executed by the NCL interpreter.
> >
> > There is no data being passed from Python to NCL, so its functionality
> > is limited, however, I found it to be a pretty useful library and was
> > able to build several interactive scripts with it.
> >
> > I have the Python module built for Python 2.x that runs only on Linux
> > OS. If people want to try it out, let me know.
> >
> > Lou Wicker
> >
> >

-- 

================================================ Dr. Louis J. Wicker Research Scientist, National Severe Storms Lab 1313 Halley Cir, Norman, OK 73069 E-mail: Louis.Wicker AT nssl.noaa.gov Phone: (405) 366-0416 / Fax: (405) 579-0808 Norman's Little River Zoo on SE 120th off Rt. 9: Your zoo for life! ===============================================

_______________________________________________ ncl-talk mailing list ncl-talk AT ucar.edu http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Mon Dec 30 2002 - 09:26:38 MST