Re: [netcdf-java] using pre-defined grib index files

Hi Bill:

If you create the indexes externally, the library will use them (they better be 
right!). They must
be named <filename>.gbx, and placed in the DiskCache.setRootDirectory().

For Grib files, I just noticed that theres some more stuff you have to do. In 
4.0, the policy is set
seperately from DiskCache. So you need to call

  GribServiceProvider.setIndexAlwaysInCache( true); // force use the cache for 
grib index

You probably also want to set

  GribServiceProvider.setIndexExtendMode( IndexExtendMode.none); // never write 
an index
  GribServiceProvider.setIndexSyncMode( IndexExtendMode.none); // never sync 
the index

this means that the index will never be created by the library, which is needed 
if you are in a
multi-threaded situation like on a server. This is what the TDS does.

Ill add this to the docs.

Id like to hear what is your use case that might require this?


Bill Moninger wrote:
> Hello,
> 
> I understand that I can use
> DiskCache.setRootDirectory("grib_data");
> to set a directory where grib index files will be stored. This allows me
> to read and process grib files from a read-only directory.
> 
> However, I recall reading that it is possible to use a pre-defined index
> file to save the time involved in generating an index file. In spite of
> a lot of looking I haven't (re)found the documentation that tells me how
> to do it.
> 
> My question: how do I tell the netcdf4 reader to use a specified index
> file (and one that is in a different directory than the data files)?
> 
> -Bill


  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: