# http://pyrocko.org - GPLv3 # # The Pyrocko Developers, 21st Century # ---|P------/S----------~Lg----------
# from pyrocko.util import urlopen
Farr, T. G., and M. Kobrick, 2000, Shuttle Radar Topography Mission produces a wealth of data. Eos Trans. AGU, 81:583-585.
Farr, T. G. et al., 2007, The Shuttle Radar Topography Mission, Rev. Geophys., 45, RG2004, doi:10.1029/2005RG000183. (Also available online at http://www2.jpl.nasa.gov/srtm/SRTM_paper.pdf)
Kobrick, M., 2006, On the toes of giants-How SRTM was born, Photogramm. Eng. Remote Sens., 72:206-210.
Rosen, P. A. et al., 2000, Synthetic aperture radar interferometry, Proc. IEEE, 88:333-382. '''
self, name='SRTMGL3', data_dir=op.join(op.dirname(__file__), 'data', 'SRTMGL3'), raw_data_url='https://mirror.pyrocko.org/e4ftl01.cr.usgs.gov/' 'MEASURES/SRTMGL3.003/2000.02.11'):
self, name, 432001, 216001, 1201, 1201, num.dtype('>i2'), data_dir=data_dir, citation=citation, region=(-180., 180., -60., 60.))
else:
else:
# remote structure changed, we would have to clawl through # many pages. Now keeping tile index here: 'https://mirror.pyrocko.org/e4ftl01.cr.usgs.gov/' 'MEASURES/SRTMGL3.003/2000.02.11/available.list', fpath)
# url = self.raw_data_url + '/' # f = urlopen(url) # data = f.read().decode() # available = re.findall( # r'([NS]\d\d[EW]\d\d\d)\.SRTMGL3\.hgt', data) # # f.close() # # with open(fpath, 'w') as f: # f.writelines('%s\n' % s for s in available)
s.strip() for s in f.readlines() if re.match(r'^[NS]\d\d[EW]\d\d\d$', s.strip())]
# we have to follow the oauth redirect here... except Exception as e: raise e
for tn in self.available_tilenames(): fpath = self.tilepath(tn) if not op.exists(fpath): self.download_tile(tn)
else:
self.xmin + itx*self.stx, self.ymin + ity*self.sty, self.dx, self.dx, data)
if __name__ == '__main__': import sys
util.setup_logging('pyrocko.topo.srtmgl3', 'info')
if len(sys.argv) != 2: sys.exit('usage: python -m pyrocko.topo.srtmgl3 download')
if sys.argv[1] == 'download': srtmgl3 = SRTMGL3() srtmgl3.download() |