# http://pyrocko.org - GPLv3 # # The Pyrocko Developers, 21st Century # ---|P------/S----------~Lg----------
name='SRTMGL3', data_dir=op.join(topo_data_dir, 'SRTMGL3'))
name='SRTMGL3_D2', base=srtmgl3, ndeci=2, data_dir=op.join(topo_data_dir, 'SRTMGL3_D2'))
name='SRTMGL3_D4', base=srtmgl3_d2, ndeci=2, data_dir=op.join(topo_data_dir, 'SRTMGL3_D4'))
name='SRTMGL3_D8', base=srtmgl3_d4, ndeci=2, ntx=1001, nty=1001, data_dir=op.join(topo_data_dir, 'SRTMGL3_D8'))
name='ETOPO1', data_dir=op.join(topo_data_dir, 'ETOPO1'))
name='ETOPO1_D2', base=etopo1, ndeci=2, data_dir=op.join(topo_data_dir, 'ETOPO1_D2'))
name='ETOPO1_D4', base=etopo1_d2, ndeci=2, data_dir=op.join(topo_data_dir, 'ETOPO1_D4'))
name='ETOPO1_D8', base=etopo1_d4, ndeci=2, data_dir=op.join(topo_data_dir, 'ETOPO1_D8'))
srtmgl3, srtmgl3_d2, srtmgl3_d4, srtmgl3_d8]
etopo1, etopo1_d2, etopo1_d4, etopo1_d8]
for dem in dems: if isinstance(dem, dataset.DecimatedTiledGlobalDataset): dem.make_all_missing()
return name
raise Exception('invalid cpt name')
raise Exception('cpt file does not exist: %s' % fn)
import matplotlib.pyplot as plt
west, east, south, north = tile.positive_region(region)
fig = plt.gcf()
for idem, dem_ in enumerate(dems): fig.add_subplot(len(dems), 1, idem+1) t = dem_.get(region) if t: plt.pcolormesh(t.x(), t.y(), t.data) plt.title(dem_.name) plt.xlim(west, east) plt.ylim(south, north)
plt.show()
return [dem.name for dem in dems]
raise UnknownDEM(dem_name)
''' Get elevation at given point.
Tries to use SRTMGL3, falls back to ETOPO01 if not available. '''
for dem in ['SRTMGL3', 'ETOPO1']: r = get(dem, (lon, lat)) if r is not None and r != 0: return r
if __name__ == '__main__': # comparison((-180., 180., -90, 90), dems=[etopo1_d8]) util.setup_logging('topo', 'info') comparison((30, 31, 30, 31), dems=[srtmgl3, srtmgl3_d2]) |