[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDFJava #MYG-785641]: Extracting data from a grib file



Hiya David,

Sure it's possible to extract a single parameter from a grib file. The process 
would involve creating an index for the 
grib file using Grib(1|2)WriteIndex and then using Grib(1|2|)GetData to extract 
the data. This process only extracts the
data for one grib record, so if the parameter is temperature on different 
pressure levels then one would have to extract
each level and then combine the data. There is detail information on the 
decoders web page at:

 http://www.unidata.ucar.edu/software/decoders/

There is an index tag on the page that explains the contents of a grib index, 
this information is needed to know what 
location in the file where the data resides. 

I must warn you that the package is currently being refactored and it's in 
testing now. Some of the index routines are being deprecated.

Also, the netcdf java package uses the grib package and it does all the grunt 
work for you. It's located at:

http://www.unidata.ucar.edu/software/netcdf-java

The toolsUI program on the page is a good example. It basically reads in the 
index without reading all the data, then it
extracts the data as needed. It's almost like a virtual netCDF file and it 
hides the details of the grib package.

There is tutorial at:
http://www.unidata.ucar.edu/software/netcdf-java/tutorial/index.html

I would investigate the grid dataset section.  


Robb...

Ticket Details
===================
Ticket ID: MYG-785641
Department: Support netCDF Java
Priority: High
Status: Open