I have a .CUB map from the USGS, the Mars MOLA image, which is about 46000x23000 pixels and 2GB. I am trying to convert it from .CUB to .TIF but I want to keep it 16 bit.
I ran:
gdalinfo -stats Mars_MGS_MOLA_DEM_mosaic_global_463m.cub
Output:
STATISTICS_MAXIMUM=21241
STATISTICS_MEAN=-720.52571146212
STATISTICS_MINIMUM=-8201
STATISTICS_STDDEV=2976.6805556461
Then I ran:
gdal_translate -scale -8201 21241 1 65536 -a_nodata 0 Mars_MGS_MOLA_DEM_mosaic_global_463m.cub Mars_Bump_16bit.tif
The output image, the four volcanoes on Mars, are not white, they are flat and gray, it's like the tops of the volcanoes were outside the range and were truncated.
If I run:
gdal_translate -scale -8201 21241 1 255 -ot byte -a_nodata 0 Mars_MGS_MOLA_DEM_mosaic_global_463m.cub Mars_Bump_8bit.tif
It generates an image where the volcanoes are NOT truncated.
What am I doing wrong for 16bit to 16bit?
gdalinfo -statson the tif files? – AndreJ May 08 '17 at 06:07