The gbx index is specific to each file, so cant be shared between files. A
description is at
http://www.unidata.ucar.edu/software/decoders/grib/javadoc/IndexFormat.txt
this page has some info on how to create indexes:
http://www.unidata.ucar.edu/software/decoders/
let me know if thats not clear enough.
TDS = "THREDDS Data Server"
Bill Moninger wrote:
> Hi John,
>
> thanks for your quick response.
>
> If I'm going to use a single index (to save time), it can't be named
> <filename>.gbx, because I want to use one index file for multiple grib
> files, so I can save the time of making an index each time I read a
> similar file. I'm assuming the index is a property of the particular
> fields that are in a file, but not values in the field. If the indices
> differ depending on the data in the files, then this obviously won't work.
>
> If it can work, then I'd like to specify a specific index file, like
> 'RR.gbx' to work for all the RR (Rapid Refresh model, actually) files.
>
> By the way, what is "TDS"?
>
> -Bill
>
> On 2/9/2009 4:14 PM, John Caron wrote:
>> 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
>