[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDFJava #AGN-451004]: Converting Grib to NetCDF



Hi Pierre:

Have a look here:

http://www.unidata.ucar.edu/software/thredds/v4.5/netcdf-java/reference/faq.html#convert

John

> Hello,
> 
> I am upgrading the version of NetCDF I am using and so far I was using
> some classes to convert GRIB files to NetCDF files :
> 
> RandomAccessFile raf = new RandomAccessFile(args[0], "r");
> raf.order(0);
> int version = GribChecker.getEdition(raf);
> IOServiceProvider iosp = null;
> 
> if (version == 1) {
> iosp = new Grib1ServiceProvider();
> 
> } else if (version == 2) {
> iosp = new Grib2ServiceProvider();
> 
> } else {
> String errorMessage = args[0] + " is not a Grib file";
> throw new IOException(errorMessage);
> }
> 
> NetcdfFile ncfile = new MakeNetcdfFile(iosp, raf, args[0], null);
> NetcdfFile nc = FileWriter.writeToFile(ncfile, args[1]);
> nc.close();
> raf.close();
> 
> However Grib*ServiceProvider do not exist anymore.
> 
> Is there an easy way to do the same with the last versions of NetCDF
> ? Or would you advise me to directly read the GRIB files in order to
> get the information I am looking for ?
> 
> Thanks for your help and have a nice day,
> Regards,
> _______________________________________________________________________
> [Email_CBE.gif]Pierre Villard
> IT Consultant | Mission Critical Systems - Space
> Tel: +33 5 31 08 80 33
> 
> Capgemini Technology Services - Custom Software Development
> www.capgemini.com<http://www.capgemini.com/>
> 
> 109 avenue Eisenhower - BP53655 - 31036 Toulouse Cedex 1
> People matter, results count.
> Connect with Capgemini:
> [Picto_Blog]<http://www.capgemini.com/insights-and-resources/blogs>[twitter]<http://twitter.com/#!/capgeminifrance>[facebook]<http://www.facebook.com/capgeminifrance>[linkedin]<http://www.linkedin.com/groups/Capgemini-France-3849095>[Picto_Slideshare]<http://www.slideshare.net/capgemini>[Picto_YouTube]<http://www.youtube.com/capgeminimedia>
> _______________________________________________________________________
> Capgemini is a trading name used by the Capgemini Group of companies which 
> includes Capgemini Technology Services SAS,
> a company registered in France  (RCS : 479 766 842 - APE 6202 A NANTERRE)
> whose registered office is at Tour Europlaza - 20 avenue André Prothin - 
> 92927 Paris La Défense cedex
> 
> This message contains information that may be privileged or confidential and 
> is the property of the Capgemini Group. It is intended only for the person to 
> whom it is addressed. If you are not the intended recipient, you are not 
> authorized to read, print, retain, copy, disseminate, distribute, or use this 
> message or any part thereof. If you receive this message in error, please 
> notify the sender immediately and delete all copies of this message.
> 
> 

Ticket Details
===================
Ticket ID: AGN-451004
Department: Support netCDF Java
Priority: Normal
Status: Closed