Re: [netcdf-java] Retrieve Init Date from Grib-File

Hi Jochen :

The problem is that the "Init-Date" isnt explicitly recorded in a GRIB file, unless they happened to put it in the "reference date". It appears that date is used for different purposes, but its unclear. It would be helpful to hear from data providers.

In GRIB-1 docs, there is:

"Reference time of data – date and time of start of averaging or accumulation period"

which is not obviously the runtime date.

wgrib is NCEP-centric, but it would be good to know what they do, and perhaps you could track down if its the correct thing to do for the data you are interested in.


On 11/15/2013 6:35 AM, Jochen Kähler wrote:
Hi all,

is there a way to retrieve the Init-Date from a Grib-File?

I thought GridCoordinateSystem.getRunTimeAxis() would be the correct method.

However, if I do about the following…

GridDataset dataset =;
GridDatatype grid = dataset.findGridDatatype("Relative_humidity_isobaric");"init={}", grid.getCoordinateSystem().getRunTimeAxis());

…I get…
2013-11-15 14:25:02,324 INFO : App - init=null

…while wgrib has successfully gathered those values:
Losty-MacBook:Desktop jkaehler$ ~/wgrib/wgrib -V dpd_test.grib
rec 1:0:date 2013111300 R kpds5=157 kpds6=100 kpds7=850 levels=(3,82) grid=255 
850 mb 6hr fcst:
   R=Relative humidity [%]

Initdate = 2013-11-13 00Z with leadtime 6h…

We've found the...

public final CalendarDate getReferenceDate() { … }

...from the which actually reads that init-date 
from the Grib file, but we haven’t found where it is used despite of some debug 

Many thanks in advance and Kind Regards,

netcdf-java mailing list
For list information or to unsubscribe, visit:

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