PyGrADs: Importing NOAA Rainfall (.rt)/Exporting NetCDF

المشرف العام

Administrator
طاقم الإدارة
I am in the process of automating a workflow from downloading NOAA's Climate Prediction Center's Daily Rainfall data in Binary, using GrADS to convert and export to NetCDF, then arcpy to extract rainfall totals by a set grid. Currently, the process involves a GrADS script sandwiched by python scripts. The goal is to utilize PyGrADS for the GrADS script, but that is where I 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 gradsfrom pylab import titlefrom grads.gacore import GaCorega=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.

It may be rather simple or it may be impossible. There may very well be a better method than I am stuck on. Has anyone been down this road yet? Is this possible with Numpy?

Thanks,

Justin



أكثر...
 
أعلى