Re: [netcdf-java] Parsing GRIB2 files from NOAA

Hi again,

Ok...so if I understood correctly...I should be able to get the data
somehow right? Just asking because I'll need to know if I should stop right
now or keep using NetCDF-Java (which I think is great, by the way)

Regards,
Alejandro


On Thu, Jan 16, 2014 at 9:50 PM, John Caron <caron@xxxxxxxxxxxxxxxx> wrote:

> Hi Alejandro :
>
> well, thats complicated. the short answer is that we map collections of
> GRIB records to netcdf multidimensional arrays.
>
> you could read this as background:
>
>
> http://www.unidata.ucar.edu/blogs/developer/en/entry/dataset_schemas_are_lost_in
>
> you can use lower level GRIB APIs, but we dont support or document them,
> and you would have to read code to understand how to use them.
>
> download ToolsUI and use it to read your GRIB file so you get a sense of
> it:
>
>
> http://www.unidata.ucar.edu/software/thredds/v4.4/netcdf-java/documentation.htm
>
> Open in the Viewer tab; also open in IOSP/GRIB1(2)//GRIB1(2)Collection
> which shows you the underlying GRIB recordss.
>
>
> John
>
> On 1/16/2014 1:31 PM, Alejandro Villamarin wrote:
> > Hello John,
> >
> > Thanks for your quick response. I'm a newbie with both GRIB and NetCDF,
> > but I don't see a relationship between the NetcdfFile methods and the
> > GRIB structure (so far, I'm reading this:
> > http://www.wmo.int/pages/prog/www/DPS/FM92-GRIB2-11-2003.pdf). For
> instance:
> >
> > String filename = "gfs_4_20140115_1200_192.grb2";
> >          NetcdfFile ncfile = null;
> >          try {
> >              ncfile = NetcdfFile.open(filename);
> >
> >              List<Dimension> dimensions = new ArrayList<Dimension>();
> >              dimensions =  ncfile.getDimensions();
> >              Iterator<Dimension> iterator = dimensions.iterator();
> >              while (iterator.hasNext()){
> >                  Dimension current = iterator.next();
> >                  current.toString();
> >              }
> >
> > How are the dimensions mapped into the structure of a GRIB file? Same
> > goes for the getVariables() method...thus, that's why I was asking for a
> > full working example of parsing a GRIB file :)
> >
> > Regards,
> > Alejandro
> >
> >
> > On Thu, Jan 16, 2014 at 2:56 PM, John Caron <caron@xxxxxxxxxxxxxxxx
> > <mailto:caron@xxxxxxxxxxxxxxxx>> wrote:
> >
> >     Hi Alejandro:
> >
> >     You just open a GRIB file like its a netcdf file and access it
> >     through the netCDF API.
> >
> >     some tutorials are at:
> >
> >
> http://www.unidata.ucar.edu/software/thredds/v4.4/netcdf-java/tutorial/index.html
> >
> >     John
> >
> >
> >     On 1/16/2014 5:08 AM, Alejandro Villamarin wrote:
> >>     Hi there!
> >>
> >>     I'm wondering if I can use NetCDF-Java library to parse GRIB2
> >>     files. So far I'm able to open and display file contents from a
> >>     GRIB2 file, but I'm wondering if it is possible to actually parse
> >>     the file: go through the variables and get the values, basically.
> >>     If so...are there any examples?
> >>
> >>     Kind regards,
> >>     Alejandro
> >>
> >>
> >>     _______________________________________________
> >>     netcdf-java mailing list
> >>     netcdf-java@xxxxxxxxxxxxxxxx  <mailto:netcdf-java@xxxxxxxxxxxxxxxx>
> >>     For list information or to unsubscribe, visit:
> http://www.unidata.ucar.edu/mailing_lists/
> >
> >
> >     _______________________________________________
> >     netcdf-java mailing list
> >     netcdf-java@xxxxxxxxxxxxxxxx <mailto:netcdf-java@xxxxxxxxxxxxxxxx>
> >     For list information or to unsubscribe, visit:
> >     http://www.unidata.ucar.edu/mailing_lists/
> >
> >
>
  • 2014 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: