NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
I am resending the code below, without the '*' John Caron wrote:
Adityarajsingh Santokhee wrote: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 aswell as section of it).most likely problem is you dont have write permission in the data directories, since we need to write an index file. however, on failure it should have defaulted over to writing in a temporary directory. probably theres no home directory for the tomcat user. If you cant fix those 2 problems, set the directory to something that the tomcat user has write privilege in, using:ucar.nc2.util.FileCache.setRootDirectory()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 thereaftercheck the attribute name for GRIB_param_number.I would make a HashMap HashMap gribHashMap = new HashMap(); for (int i=0; i<myVarList.size(); i++) { Variable myVar = (Variable) myVarList.get(i);String gribName = ncfile.findAttValueIgnoreCase(myVar, "GRIB_param_number", null);if (gribName != null) gribHashMap.put( gribName, myVar); } Then look it up viaVariable myVar = (Variable) gribHashMap.get( gribName);if ( myVar != null) { do_something(); }
netcdf-java
archives: