Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

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

RE: Configuring GRIB tables in NetCDF




Tor,

Since this question has come up before, I created a web page at:

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


THis should answer all your questions.

RObb....






On Thu, 8 Oct 2009, Tor Christian Bekkvik wrote:

Hi,
The GribPDSParamTable.addParameterUserLookup call did not seem to help
in my case; the resulting parameter names/units reported for my gribfile
was still not affected.
Probable cause:
The addParameterUserLookup call only applies to GRIB-1
(ucar.grib.grib1.GribPDSParamTable), while my gribfile triggered the
GRIB-2 parser in NetCDF (from NetcdfDataset.openDataset(grib2file);)



Questions:
-1) Could Netcdf be instructed/hinted to prefer the GRIB-1 reader, when
possible ?  (JGRIB, a grib-1 reader, was able to read my file)

-2) Is there another way to configure GRIB tables (or parameter
interpretation) in NetCDF which now would work for both GRIB-1 and
GRIB-2 ?



Thanks,
-Tor C

-----Original Message-----
From: Robb Kambic [mailto:rkambic@xxxxxxxxxxxxxxxx]
Sent: 6. oktober 2009 21:02
To: Tor Christian Bekkvik
Cc: Gro Fonnes; netcdf-java; Kjell Røang
Subject: Re: Configuring GRIB tables in NetCDF

On Tue, 6 Oct 2009, Tor Christian Bekkvik wrote:

Hi, I have some questions regarding GRIB table configuration:
 
1) Is there a way to configure GRIBtables in NetCDF without
rebuilding
grib-6.0.jar in ncSrc-4.0.zip!\lib\release\ ?

Tor,

Yes, the following routine, in class GribPDSParamTable

/**
    * Reads in the list of tables available and stores them.
Does not actually
    * open the parameter tables files, nor store the list of
parameters, but
    * just stores the file names of the parameter tables.
    * Parameters for a table are read in when the table is
requested (in the
    * getParameterTable method).
    *
    * @param userGribTabList string of userlookup file
    * @throws IOException on read error
    */
   public static void addParameterUserLookup(String userGribTabList)


There is a sample file with the grib jar called userlookup.lst, it has the same syntax as tablelookup.lst. If the table name begins with /, http:, or file: then it looks for the file with the full path name, otherwise it assumes the table is in the resource directory. The tables are loaded according to site ID, subsite ID and table version number that's obtained from the data file. If you load a new table with the same configuration as one in tablelookup.lst file, your new configuration will over write the original configuration.

             GribPDSParamTable.addParameterUserLookup(
"/local/robb/trunk20090914/grib/resources/resources/grib/table
s/userlookup.lst");

2) Where can I find sourcecode for grib-6.0.jar (or later
versions) ? 
(the source will answer question 1, but is not included in
ncSrc-4.0.zip)
 

The source for the Grib decoder package is located on page: http://www.unidata.ucar.edu/software/decoders/ unders downloads.

The Grib package has just went under a major refactor to
implement the Ensemble data processing, so some APIs have be
deprecated. The deprecated APIs are going to be removed in a
future release so I suggest looking at the javaDocs for the changes.

RObb...




 
We occasionally have gribfiles using gribtables not defined in
grib*.jar. The only solution I currently know, is to unzip the
grib*.jar file and modify gribtable definitions inside 
\resources\grib\tables\tablelookup.lst.  (tablelookup.lst points to 
*.tab files in the same directory) This is not very user
friendly, so 
perhaps there is a java property or method call where you
can override some gribtable settings?
 
 
 
Thanks,
Tor C Bekkvik
 
--

Tor Christian Bekkvik
Scientist
Christian Michelsen Research AS
Phone: +47 55 57 42 28




============================================================== ================= Robb Kambic Unidata Program Center Software Engineer III Univ. Corp for Atmospheric Research rkambic@xxxxxxxxxxxxxxxx WWW: http://www.unidata.ucar.edu/ ============================================================== =================



=============================================================================== Robb Kambic Unidata Program Center Software Engineer III Univ. Corp for Atmospheric Research rkambic@xxxxxxxxxxxxxxxx WWW: http://www.unidata.ucar.edu/ ===============================================================================

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690