Created
October 15, 2018 00:27
-
-
Save spestana/876fcd2ca1fbac441f28243bdc406c22 to your computer and use it in GitHub Desktop.
Quick convert NetCDF (GOES imagery) to png images files using gdal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
set NCdir=%1 | |
for /R %NCdir% %%f in (*.nc) do ( | |
gdal_translate -ot float32 -unscale -CO COMPRESS=deflate NETCDF:"%%f":Rad "%NCdir%%%~nf.tif" | |
gdal_translate -ot Byte -of png -scale 0 650 0 255 "%NCdir%%%~nf.tif" "%NCdir%%%~nf.png" | |
gdalwarp -t_srs EPSG:4326 -dstnodata -999.0 "%NCdir%%%~nf.tif" "%NCdir%%%~nf_geo.tif" | |
gdal_translate -ot Byte -of png -scale 0 650 0 255 "%NCdir%%%~nf_geo.tif" "%NCdir%%%~nf_geo.png" | |
) | |
endlocal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment