NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

[netcdf-java] Getting forecast times from grib file

Hello,

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){
    System.out.println(fd);
}
-----------------

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>(FmrcImpl.java:264)
    at ucar.nc2.dt.fmrc.FmrcImpl.init(FmrcImpl.java:133)
    at ucar.nc2.dt.fmrc.FmrcImpl.<init>(FmrcImpl.java:85)
    at ucar.nc2.dt.fmrc.FmrcImpl.<init>(FmrcImpl.java:81)
    at Test.main(Test.java:62)
---------------------

Please can anybody help me on this?


Best regards,

Alex




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