Convert grib to netcdf file

爷,独闯天下 提交于 2019-12-10 21:27:50

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!