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] Netcdf Java : FileWriter2 how to

Hello guys!

First I'ld like to thank you for your library. It goes incredibly fast to
extract information from a GRIB file!

I am currently developing an application where I would like to store only
the relevant part of GRIB files and to create a sub file for each original
one (in any format supported by netcdf).

I found the classes FileWriter2 and NetcdfFileWriter but I have been
unsuccessful into making them work so far.

I managed to extract the relevant data for each variable I am interested in
by using a regular NetcdfFile and the section method.

I thought by using FileWriter2 I would merely have to call addVariable for
each section I created and then call write.
But I am facing issues with dimensions.

Basically if I do just that I receive an error saying that one of the
dimension on my variable does not exist.
I tried to access the underlying netcdfFileWriter and to add the 3
dimensions I am interested in but if I do so I get an error saying that
dimension name should be unique when I try to call addVariable on my
fileWriter.

Could you tell me what steps I should follow to be able to create a file
containing only my freshly extracted section?

Thanks!

Best regards,

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