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

Re: Problem opening GRIB dataset using netCDF-Java



On Sep 23, 2013, at 08:39, john caron wrote:

> Im out of the country for another week so i cant check, but i fixed a similar 
> problem in the 4.3.19 release. Lansing can tell you where that is if you want 
> to try.

Do you mean 4.3.19 or 4.3.18?

The website lists 4.3.18 as the latest release. Unless I'm misunderstanding the 
way Github works, I don't see any mention of commits in thredds after the 
4.3.18 release date.


>> BTW: I commented last March that I had been having since the start of the 
>> year with GRIB temporary files popping up in the same directory as the GRIB 
>> file rather than in the cache dir specified by DiskCache.setRootDirectory(). 
>> I thought this was "fixed" in 4.3.18 but that was mistaken. On further 
>> exploration today, I found that a deliberate change was made in 4.3.15, as 
>> described at
>> http://www.unidata.ucar.edu/software/thredds/current/netcdf-java/reference/Caching.html
>> 
>> However, although that webpage states that as of 4.3.15 one should use 
>> DiskCache2 class to deal with GRIB files, the section terminates before 
>> providing an example of the DiskCache2 options. I did find an example in the 
>> source code for the TestGribDiskCache class which gave me the help I needed.
>> 
> 
> apologies, ill update that web page. so you did figure out what you needed 
> then?


Well, I have a mea culpa also. Despite my whining about the GRIB caching change 
being a surprise, I discovered late last week that your e-mail announcing 
4.3.15 specifically mentioned it.

Anyway, based on what I saw in the DiskCache2 source, I got things working the 
way I wanted. I found the following was sufficient.

  // Inform NJ where the cache is and to always use it.
    DiskCache.setRootDirectory  (cachepath);
    DiskCache.setCachePolicy    (true);

  // The following is necessary as of NJ 4.3.15 in order to prevent GRIB
  // temp files from cluttering up same directory as source GRIB files.
    DiskCache2 dc2 = new DiskCache2 (cachepath, false, 30, 30);
    dc2.setAlwaysUseCache (true);
    GribCollection.setDiskCache2 (dc2);


Thanks,
rbs


--
Robert B. Schmunk
Webmaster / Senior Systems Programmer
NASA Goddard Institute for Space Studies
2880 Broadway, New York, NY 10025