Re: [netcdf-java] Getting forecast times from grib file

On 1/17/2011 8:16 AM, Alexander Berkes wrote:

I am really new to the netcdf-java library.

I am really stuck on getting the forecast times from a grib file.
Anything else works great (getting the lat/lon coordinate points,
getting the values or subsetting the grid...).

I tried the following:

String filename = "current.grb";

FmrcImpl forecasts = new FmrcImpl(filename);
List<Date>  forecastDates = forecasts.getForecastDates();

for(Date d : forecastDates){

But the above fails with a nullpointer exception on Object creation
(FmrcImpl forecasts = new FmrcImpl(filename);):
Exception in thread "main" java.lang.NullPointerException
     at ucar.nc2.dt.fmrc.FmrcImpl$Gridset.<init>(
     at ucar.nc2.dt.fmrc.FmrcImpl.init(
     at ucar.nc2.dt.fmrc.FmrcImpl.<init>(
     at ucar.nc2.dt.fmrc.FmrcImpl.<init>(
     at Test.main(

Please can anybody help me on this?

Best regards,


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

Hi Alex:

Dont use FmcImpl, use;


for some simple examples.

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