Topography is a Python library for fetching and caching NASA Shuttle Radar Topography Mission (SRTM) and JAXA Advanced Land Observing Satellite (ALOS) land elevation data using the OpenTopography REST API. Topography provides access to the following global raster datasets:
SRTM GL3 (90m)
SRTM GL1 (30m)
SRTM GL1 (Ellipsoidal)
ALOS World 3D (30m)
ALOS World 3D (30m, Ellipsoidal)
The library includes an API, CLI, and BMI that accept the dataset type, a latitude-longitude bounding box, and the output file format. Data are downloaded from OpenTopography and cached locally. The cache is checked before downloading new data. Data from a cached file can optionally be loaded into an xarray DataArray using the experimental open_rasterio method.
Classroom organization This lab includes examples of using the Topography data component in a Jupyter Notebook, in a shell script, and in a Python program. Try editing these examples to get data from different locations around the globe.
Learning objectives Skills
Use a command-line interface (CLI) for a Python library
Use an application programming interface (API) for a Python library
Use a Basic Model Interface (BMI)
Key concepts
Access data through a data component
Understand the difference between an API and a BMI, as well as their relative strengths
Lab notes This lab can be run on the CSDMS JupyterHub. (If you don't already have an account, follow the instructions to sign up at: https://csdms.colorado.edu/wiki/JupyterHub.) Run the lab notebooks by clicking the "start" link under the Run online heading at the top of this page. If you're an educator using this lab in a class, you can get CSDMS JupyterHub accounts for students. For more information, please contact us through the CSDMS Help Desk: https://csdms.github.io/help-desk.
Acknowledgements This work is supported by the National Science Foundation under Award No. 2026951, EarthCube Capabilities: Cloud-Based Accessible and Reproducible Modeling for Water and Sediment Research.