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

Problem with GRIB files

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: Problem with GRIB files
  • Date: Fri, 6 May 2005 19:12:16 +0100

Hello,

I have a few questions concerning reading GRIB files using the netcdf2.2
library:

1. are there any problems when using the grib.jar library with jakarta tomcat
server ? Netcdf files can be correctly read and data extracted. Grib files can
be opened only but it is failing each time i wish to extract data (all data as
well as section of it).

2. Are there any easier ways to reading data for a particular variable using its
internal name instead of the variable name. Currently, I have to get list of
all variables and then for each variable get its attributes and thereafter
check the attribute name for GRIB_param_number.

e.g:

for (int i=0; i<myVarList.size(); i++)
{
                Variable myVar = (Variable) myVarList.get(i);
                List attList = myVar.getAttributes();
                        
                for (int j=0; j<attList.size(); j++)
                {
                        Attribute att = (Attribute) attList.get(j);
                        if (att.getName().equals("GRIB_param_number")) 
                        {
                                //get the correct variable
                                if (att.getNumericValue().intValue() == var)
                                {
                                 .......
                                }
                        }
                }
}

Thanks in advance,

Adit.