[gradsusr] PyGrads for exporting to NetCDF

Justin Koppa justin.koppa at gmail.com
Thu Jul 2 09:42:51 EDT 2015


Hello,

I am trying to bring in my GrADS script to python for a complete process
automation, but am struggling.

The GrADS script looks something like this:

'open /TestContrl.ctl'
'define precip = rain'
'display precip'
'set sdfwrite 20150311.nc'
'sdfwrite precip'

The big question, how do I do that in Python? This is what I have so far:

import grads
from pylab import title
from grads.gacore import GaCore
ga=GaCore(Bin='grads')
ga.open('Control.ctl')
ga("d rain")

But from here I have only found how to export a .png, display contours of
the data, but have not discovered a call for exporting to NetCDF.  Is this
possible?

Any guidance would be greatly appreciated.

Thanks,

Justin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20150702/ffab360c/attachment.html 


More information about the gradsusr mailing list