[gradsusr] Help

Reto Stauffer Reto.Stauffer at student.uibk.ac.at
Sat Apr 28 14:22:27 EDT 2012


Hello Libin

Both file formats are possible. If you create it on your own i would  
suggest the NetCDF version because it is easyer to handle. Normally  
you should not need an additional ctl file. For nearly every  
programming language there are some NetCDF libraries or packages to  
write the NetCDF file. The most easy way for me was using the python  
"pupynere" (pure python netcdf reader) - or in newer python.numpy  
packages included in numpy.io.netcdf package.

Important: you have to use the COARDS NetCDF standard (link see  
below). Big benefit: you can open a netcdf file with grads without the  
controlfile using "sdfopen file.nc".

If you write a gribfile there are two perl scripts on the ncdp webpage  
(grib2ctl for grib1 file format, g2ctl for grib2 file format:  
http://www.cpc.ncep.noaa.gov/products/wesley/grib2ctl.html) to create  
a ".ctl" file from your gribfile. So for gribfiles the process is  
something like this:

a) create grib file
b) perl grib2ctl -verf file.grib > file.ctl
c) gribmap -i file.ctl
d) grads -> open file.ctl
(grib2ctl crates the controlfile, gribmap is a grads routine which  
maps the controlfile and creates a .idx file, then you can open the  
gribfile with "open file.ctl". If everything is ok you can plot the  
data now.

Probably those hints helps you to reach your goals

Best wishes and have a nice weekend
Reto, Innsbruck, Austria

pupynere: http://pypi.python.org/pypi/pupynere/
numpy: http://numpy.scipy.org/
netcdf libraries: http://www.unidata.ucar.edu/software/netcdf/
coards standard: http://ferret.wrc.noaa.gov/noaa_coop/coop_cdf_profile.html


Zitat von zjuyanlibin <zjuyanlibin at 163.com>:

> Dear GrADS users,
>
> I interpolated a station file into a fixed grid.
> How to output the interpolated data into a bin+ctl or netcdf file?
> Any suggestion is welcome.
>
> Regards,
>
> Libin





More information about the gradsusr mailing list