Re: Call Python from NCL

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Oct 13 2011 - 14:09:43 MDT

I'm afraid there's no way to do this, unless somebody else has written such an interface.

You might be able to use a method similar to calling Fortran from NCL, except instead of
the NGCALLF line which calls the Fortran routine, you would need a line to call the Python code.

You can look at an example I added recently showing how to call a C code from NCL.
This method "cheats" by using a Fortran stub to create a C wrapper code with
"wrapit77", and then you can modify the wrapper as needed.

See:

http://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml#Example_6

For more gory details about calling C and Fortran from NCL, which might help with the Python interface:

http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclExtend.shtml#BuiltIn

--Mary

On Oct 13, 2011, at 12:46 PM, Lunde, Bruce N CIV NAVOCEANO, NP1 wrote:

> Hello,
>
> I realize that methods exist to call NCL from Python (PyNGL, etc.),
> but is there a way to call Python from NCL ?
>
> I'm interested in calling Python from NCL in the same way that
> Fortran can be called from NCL, such that items in memory can
> be passed back and forth.
>
> Thanks, Bruce
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Oct 13 14:09:50 2011

This archive was generated by hypermail 2.1.8 : Tue Oct 18 2011 - 09:42:15 MDT