Skip to content

Instantly share code, notes, and snippets.

@GitHubEmploy
Created April 17, 2022 19:16
Show Gist options
  • Save GitHubEmploy/3dbc55cd2ac52a7591367e05c666c655 to your computer and use it in GitHub Desktop.
Save GitHubEmploy/3dbc55cd2ac52a7591367e05c666c655 to your computer and use it in GitHub Desktop.
import rasterio
import numpy as np

mars = rasterio.open('Mars_MGS_MOLA_DEM_mosaic_global_463m.tif')
mars = mars.read()

print(mars.shape)
print(np.amin(mars[0]))
print(np.amax(mars[0]))
print(np.amax(mars[0]) + abs(np.amin(mars[0])))
(1, 23040, 46080)
-8201
21241
29442
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment