Re: Ruby + NCL

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Wed, 28 May 2008 12:29:48 -0600

Hi Saji,

Here is the Perl NCL interface I mentioned. It implements 3 Perl
functions:

ncl_initialize
ncl_close
ncl_command

Basically it allows one-way communication with NCL. You can give it
commands
but cannot find out anything about its state. You would need to look
at the API
documentation in order to do anything more sophisticated.

The similar Python code we have is not organized as neatly right now.
I am going
to be looking at it within the next several weeks for other purposes.
I will try to bundle
it up in order to send it to you.
  -dave

On May 27, 2008, at 8:08 PM, Saji N. Hameed wrote:

> Hi Mary and David,
>
> Thanks for the quick response and the clarifications of the various
> Python interfaces to NCL. I really meant to say PyNGL, when I said
> PyNCL - thought a python interface would be called PyNCL :)
>
>> If you want to see examples of *very basic* uses of this API to
>> implement Perl or Python interfaces to NCL, let me know.
>
> Dave, I would very much like to see the examples.
>
> I also have been examining the HLU examples..They look more manageable
> to me.. Is there a way to wrap them in some C-code and then bind those
> wrappers with SWIG (I am quite ignorant about C...so this may be
> a very naive question )
>
>> Unfortunately, developing Ruby interfaces is not something that we
>> have time to add to our list right now. Developing NCL and the Python
>> bindings have kept us pretty busy so far!
>
> Mary, I understand. It is not worthwhile to develop bindings for
> all possible scripting languages..this may be left to interested users
> like me. Some examples on how to do this (Dave's suggestion) could be
> kept on the NCL website, however.
>
> Much thanks,
>
> saji
>
>
> * David Brown <dbrown_at_ucar.edu> [2008-05-27 15:36:34 -0600]:
>
>> Hi Saji,
>>
>> To follow up a bit on what Mary said, there is actually a C API
>> for NCL
>> that can
>> be used to create an interface to NCL from other languages. Very
>> basic
>> bindings
>> have been created for Perl and Python -- not this is not what
>> PyNCL or
>> PyNGL uses,
>> but it is a possible approach.
>> Check out http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/
>> NclApi.shtml.
>>
>> If you want to see examples of *very basic* uses of this API to
>> implement Perl or
>> Python interfaces to NCL, let me know.
>> -dave
>>
>>
>> On May 27, 2008, at 10:08 AM, Mary Haley wrote:
>>
>>> On Tue, 27 May 2008, Saji N. Hameed wrote:
>>>
>>>> Dear NCL Developers and all,
>>>>
>>>> We are developing a Ruby Rails + NCL based web application to
>>>> serve our climate forecast products. So far so good... we
>>>> use the "system" and similar functions in ruby to run NCL as a
>>>> child
>>>> process.
>>>>
>>>> Having heard about PyNCL I was wondering if a similar interface
>>>> to NCAR graphics could be made using Ruby. As a first step,
>>>> we have succeeded in using NArray and friends in ruby to
>>>> facilitate I/O and basic array operations.
>>>
>>> Hi Saji and others,
>>>
>>> Just to make sure things are clear here: PyNCL is something that
>>> Jeff
>>> Whitaker of NOAA created which allows you to create NCL plots of
>>> CDMS
>>> variables:
>>>
>>> http://www.cdc.noaa.gov/people/jeffrey.s.whitaker/python/
>>> pyncl.html
>>>
>>> Jeff has created several really useful Python modules, including an
>>> interface to Spherepack, a GRIB2 reader, and a nice mapping
>>> interface that ties into matplotlib:
>>>
>>> http://www.cdc.noaa.gov/people/jeffrey.s.whitaker/
>>>
>>> PyNGL (developed by Fred Clare and myself) is a set of Python
>>> bindings
>>> that mimic some of the generic gsn_xxxx plotting functions. These
>>> functions were written in C, and swig was used to wrap some of the
>>> underlying low-level codes (the routines in the HLU API library, to
>>> name a few).
>>>
>>> http://www.pyngl.ucar.edu/
>>>
>>> PyNIO (developed by Dave Brown) gives you a similar file I/O
>>> handling
>>> interface that NCL has, allowing you to open NetCDF, HDF4, GRIB1/
>>> GRIB2
>>> files with a single "Nio.open_file" call (similar to NCL's
>>> "addfile").
>>>
>>> http://www.pyngl.ucar.edu/Nio.shtml
>>>
>>> In the next release of PyNIO, we'll have some extensive coordinate
>>> subscripting capability.
>>>
>>>> We are aware that SWIG (http://www.swig.org/) can be used to
>>>> connect C programs with higher-level languages including
>>>> Ruby and Python. Could somebody provide advice and if possible
>>>> some help to develop a ruby binding for NCAR graphics?
>>>
>>> Unfortunately, developing Ruby interfaces is not something that we
>>> have time to add to our list right now. Developing NCL and the
>>> Python
>>> bindings have kept us pretty busy so far!
>>>
>>> When we go fully open source with PyNGL and PyNIO, you will be
>>> able to
>>> download the C programs we used for creating the plotting routines,
>>> and perhaps you can wrap these for Ruby.
>>>
>>> By the way, we are very interested in hearing people's ideas on
>>> these
>>> various scripting languages, especially as they are used in the
>>> scientific genre. If you don't want to post back to ncl-talk, feel
>>> free
>>> to email your comments to me, and I'll share them with the other
>>> NCL developers.
>>>
>>> --Mary
>>>
>>>
>>>> cheers,
>>>> saji
>>>>
>>>> --
>>>> Saji N. Hameed
>>>>
>>>> APEC Climate Center +82 51 668 7470
>>>> National Pension Corporation Busan Building 12F
>>>> Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 saji_at_apcc21.net
>>>> KOREA
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk_at_ucar.edu
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk_at_ucar.edu
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
> Saji N. Hameed
>
> APEC Climate Center +82 51 668 7470
> National Pension Corporation Busan Building 12F
> Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 saji_at_apcc21.net
> KOREA
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

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

Received on Wed May 28 2008 - 12:29:48 MDT

This archive was generated by hypermail 2.2.0 : Fri May 30 2008 - 15:30:01 MDT