问题
Is there a way to convert a grib file into a NetCDF format on Windows?
I use a software named tkdegrib
but it catches one argument by one argument whereas I want all my grib's arguments in the same file.
Unfortunately, I can't use Linux.
回答1:
I would use Unidata's NetCDF-Java library.
It reads GRIB and GRIB2 files (as well as many others), and can write NetCDF files. And since it's Java, you don't have to build anything, and it works on all platforms. There is a ToolsUI application that you can use if you want a GUI, but more likely you want to do it from the command line using something like this:
java -Xmx512m -classpath netcdfAll-4.3.jar ucar.nc2.dataset.NetcdfDataset -in infile.grib2 -out outfile.nc
Good luck!
回答2:
If you have cygwin installed you can use CDO:
cdo -f nc copy file.grb file.nc
UPDATE: If you have Windows 10, it is now much easier to simply install ubuntu directly under windows, and then you can install CDO very easily with
sudo apt install cdo
回答3:
There is GDAL utility gdalwarp
, which can convert grib dataset into netCDF dataset.
The command for conversion is
gdalwarp -overwrite -to SRC_METHOD=NO_GEOTRANSFORM -t_srs EPSG:4326 input.grb -of netCDF output.nc
For more options of this utility can be searched on this link.
来源:https://stackoverflow.com/questions/17403928/convert-grib-to-netcdf-file