ncl via python

From: Jeff Whitaker (jswhit AT XXXXXX)
Date: Tue Dec 17 2002 - 15:27:38 MST


Folks:

I've written a simple python module to allow ncl scripts to be imbedded in
python programs. It's a kludge - data is transferred to ncl via netcdf or
ascii text files - but it works. I've been using it for about 6 months to
create ncl plots from within python scripts. I know there are much more
elegant solutions being discussed on pyncl list, but I thought there might
be some who would appreciate something that works now, however crude.

See http://www.cdc.noaa.gov/~jsw/python/ncl.html

Needs the Scientific, Numeric modules.

There are two functions, writegrids (for writing a Numeric array to a
netCDF file to be read by ncl) and nclrun (for executing an ncl script,
stored as multi-line string in python).

To run a couple of examples, execute the module as a standalone script
(i.e "python ncl.py"). The example code is at the end of the module,
after "if __name__ == '__main__':".

Comments/suggestions are welcome.

-Jeff

 --
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/CDC1 FAX : (303)497-6449
325 Broadway Web : http://www.cdc.noaa.gov/~jsw
Boulder, CO, USA 80305-3328 Office: Skaggs Research Cntr 1D-124

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



This archive was generated by hypermail 2b29 : Wed Dec 18 2002 - 10:13:29 MST