Skip to content

Instantly share code, notes, and snippets.

@emolch
Created April 10, 2017 08:21
Show Gist options
  • Save emolch/9714b57f5daee441c654379e36415a71 to your computer and use it in GitHub Desktop.
Save emolch/9714b57f5daee441c654379e36415a71 to your computer and use it in GitHub Desktop.
How download extract and save some topography data as .grd file for GMT.
from pyrocko import topo, gmtpy
wesn = (171., 176., -44., -40.)
for dem in ('ETOPO1', 'SRTMGL3'):
t = topo.get(dem, wesn)
gmtpy.savegrd(
t.x(), t.y(), t.data,
filename='topo_%s_%g_%g_%g_%g.grd' % ((dem, ) + wesn),
naming='lonlat')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment