Skip to content

Commit

Permalink
slightly improve SRTM documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Winkel committed Jul 28, 2017
1 parent cc14896 commit 9193205
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 8 deletions.
30 changes: 28 additions & 2 deletions docs/pathprof/download_srtm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,34 @@ to download missing tiles during run-time::
from pycraf.pathprof import SrtmConf
SrtmConf.set(srtm_dir='/path/to/srtmdir')

Please see the `~pycraf.pathprof.SrtmConf` class reference for further
details.
Alternatively, if only a temporary change of the config is desired,
one can use `~pycraf.pathprof.SrtmConf` as a context manager::

with SrtmConf.set(srtm_dir='/path/to/srtmdir'):
# do stuff

Afterwards, the old settings will be re-established.

It is also possible to allow downloading of missing *.hgt* files::

SrtmConf.set(download='missing')

The default download server will be `server='nasa_v2.1'`. One could
also use the (very old) data (`server='nasa_v1.0'`) or inofficial
tiles from `viewfinderpanoramas.org
<http://viewfinderpanoramas.org/>`_ (`server='viewpano'`)::

SrtmConf.set(server='viewpano')

Of course, one can set all of these options simultaneously::

with SrtmConf.set(
srtm_dir='/path/to/srtmdir',
download='missing',
server='viewpano'
):

# do stuff

Download links
==============
Expand Down
6 changes: 3 additions & 3 deletions notebooks/03a_path_propagation_basic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"With pycraf it is very easy to query SRTM data for arbitrary positions. However, you will need to have SRTM data in a local directory and set the `SRTMDATA` environment variable appropriately (see installation instructions)."
"With pycraf it is very easy to query SRTM data for arbitrary positions. However, you will need to have to download such SRTM data, either in advance or during your session. Please see the [documentation](https://bwinkel.github.io/pycraf/pathprof/download_srtm.html) for more details."
]
},
{
Expand Down Expand Up @@ -673,9 +673,9 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [Root]",
"display_name": "Python [default]",
"language": "python",
"name": "Python [Root]"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
15 changes: 12 additions & 3 deletions pycraf/pathprof/srtm.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ class SrtmConf(utils.MultiState):
with SrtmConf.set(srtm_dir='/path/to/srtmdir'):
# do stuff
Afterwards, the old settings will be re-established.
It is also possible to allow downloading of missing '.hgt' files::
Afterwards, the old settings will be re-established. It is also possible
to allow downloading of missing '.hgt' files::
SrtmConf.set(download='missing')
Expand All @@ -91,6 +90,16 @@ class SrtmConf(utils.MultiState):
also use the (very old) data (`server='nasa_v1.0'`) or inofficial
tiles from viewfinderpanorama (`server='viewpano'`).
Of course, one can set all of these options simultaneously::
with SrtmConf.set(
srtm_dir='/path/to/srtmdir',
download='missing',
server='viewpano'
):
# do stuff
URLS:
- `nasa_v2.1 <https://dds.cr.usgs.gov/srtm/version2_1/SRTM3/>`__
Expand Down

0 comments on commit 9193205

Please sign in to comment.