Lab-0028: Difference between revisions

From CSDMS
No edit summary
No edit summary
Line 2: Line 2:
|Labtitle=Topography Data Component
|Labtitle=Topography Data Component
|LabCOModule=1 of 1
|LabCOModule=1 of 1
|LabDateContributedOrUpdated=2022-04-19
|LabDateContributedOrUpdated=2025-07-09
|LabDescriptionShort=Learn how to download and access land elevation data from OpenTopography with the CSDMS Topography data component.
|LabDescriptionShort=Learn how to download and access land elevation data from OpenTopography with the CSDMS Topography data component.
|LabCODuration=1.0 hrs
|LabCODuration=1.0 hrs
Line 8: Line 8:
|LabAssociatedLesson=Jupyter Notebook
|LabAssociatedLesson=Jupyter Notebook
|LabURLDownloadNotebook=https://github.com/csdms/bmi-topography/tree/main/examples
|LabURLDownloadNotebook=https://github.com/csdms/bmi-topography/tree/main/examples
|LabURLStartNotebook=https://jupyter.openearthscape.org/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fcsdms%2Fbmi-topography&urlpath=tree%2Fbmi-topography%2Fexamples&branch=main
|LabURLStartNotebook=https://jupyter.openearthscape.org/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fcsdms%2Fbmi-topography&urlpath=lab%2Ftree%2Fbmi-topography%2Fexamples%2FREADME-bmi-topography.ipynb%3Fautodecode&branch=main
|LabURL2StartNotebook=https://lab.openearthscape.org/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fcsdms%2Fbmi-topography&urlpath=tree%2Fbmi-topography%2Fexamples&branch=main
|LabURL2StartNotebook=https://explore.openearthscape.org/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fcsdms%2Fbmi-topography&urlpath=lab%2Ftree%2Fbmi-topography%2Fexamples%2FREADME-bmi-topography.ipynb%3Fautodecode&branch=main
}}
}}
{{LabContributorData
{{LabContributorData
|LabContributorName=Mark Piper
|LabContributorName=Mark Piper
|LabContributorInstitute=University of Colorado Boulder
|LabContributorInstitute=University of Colorado Boulder
|LabContributorURLPersonal=https://instaar.colorado.edu/people/mark-piper
|LabContributorURLPersonal=https://www.colorado.edu/instaar/mark-piper
}}
}}
{{LabIntro
{{LabIntro
Line 28: Line 28:
* COP30 (Copernicus Global DSM 30m)
* COP30 (Copernicus Global DSM 30m)
* COP90 (Copernicus Global DSM 90m)
* COP90 (Copernicus Global DSM 90m)
* EU_DTM (DTM 30m)
* GEDI_L3 (DTM 1000m)
* GEBCOIceTopo (Global Bathymetry 500m)
* GEBCOSubIceTopo (Global Bathymetry 500m)
* CA_MRDEM_DSM (DSM 30m)
* CA_MRDEM_DTM (DTM 30m)
as well as these USGS 3DEP raster datasets:
* USGS30m
* USGS10m
* USGS1m


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.
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.
Line 54: Line 66:
}}
}}
{{LabNotes
{{LabNotes
|LabNotesInstructions=<p>This lab can be run on the <em>lab</em> (for educators) and <em>jupyter</em> (for general use) instances of the OpenEarthscape JupyterHub: just click one of the links under the <strong>Run online using</strong> heading at the top of this page, then run the notebook in  the "CSDMS" kernel.</p>
|LabNotesInstructions=<p>This lab can be run on the <em>explore</em> (for educators) and <em>jupyter</em> (for general use) instances of EarthscapeHub: just click one of the links under the <strong>Run online using</strong> heading at the top of this page, then run the notebook in  the "CSDMS" kernel.</p>


<p>If you don't already have a JupyterHub account, follow the instructions to sign up at https://csdms.colorado.edu/wiki/JupyterHub. If you're an educator, you can get JupyterHub accounts for students--please contact us through the CSDMS Help Desk: https://csdms.github.io/help-desk.</p>
<p>If you don't already have an EarthscapeHub account, follow the instructions to sign up at https://csdms.colorado.edu/wiki/JupyterHub. If you're an educator, you can get EarthscapeHub accounts for you and your students--please contact us through the CSDMS Help Desk: https://csdms.github.io/help-desk.</p>
|LabNotesRequirements=If run locally, see installation instructions in the bmi-topography repository: https://github.com/csdms/bmi-topography.
|LabNotesRequirements=If run locally, see installation instructions in the bmi-topography repository: https://github.com/csdms/bmi-topography.
|LabAcknowledgements=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.
|LabAcknowledgements=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.
}}
}}
{{LabReferences
{{LabReferences
|LabReferences=Piper, M. (2021). CSDMS Topography data component (Version 0.3.1) (Computer software). https://doi.org/10.5281/zenodo.4608653.
|LabReferences=Piper, M. (2025). CSDMS Topography data component (Version 0.9.0) (Computer software). https://doi.org/10.5281/zenodo.4608652.
}}
}}
{{LabReferences
{{LabReferences
|LabReferences=Tucker, G. E., Hutton, E. W. H., Piper, M. D., Campforts, B., Gan, T., Barnhart, K. R., Kettner, A. J., Overeem, I., Peckham, S. D., McCready, L., and Syvitski, J., 2022: CSDMS: a community platform for numerical modeling of Earth surface processes, Geosci. Model Dev., 15, 1413–1439, https://doi.org/10.5194/gmd-15-1413-2022.
|LabReferences=Tucker, G. E., Hutton, E. W. H., Piper, M. D., Campforts, B., Gan, T., Barnhart, K. R., Kettner, A. J., Overeem, I., Peckham, S. D., McCready, L., and Syvitski, J., 2022: CSDMS: a community platform for numerical modeling of Earth surface processes, Geosci. Model Dev., 15, 1413–1439, https://doi.org/10.5194/gmd-15-1413-2022.
}}
}}

Revision as of 10:45, 9 July 2025

Topography Data Component

Duration
1.0 hrs
Updated
2025-07-09
Download
download
Run online using:
  1. Jupyter
  2. Lab
     

Contributor(s)
    Mark Piper at University of Colorado Boulder.

Introduction
Topography is a Python library for fetching and caching land elevation data using the OpenTopography REST API. Topography provides access to the following global raster datasets:
  • SRTMGL3 (SRTM GL3 90m)
  • SRTMGL1 (SRTM GL1 30m)
  • SRTMGL1_E (SRTM GL1 Ellipsoidal 30m)
  • AW3D30 (ALOS World 3D 30m)
  • AW3D30_E (ALOS World 3D Ellipsoidal, 30m)
  • SRTM15Plus (Global Bathymetry SRTM15+ V2.1)
  • NASADEM (NASADEM Global DEM)
  • COP30 (Copernicus Global DSM 30m)
  • COP90 (Copernicus Global DSM 90m)
  • EU_DTM (DTM 30m)
  • GEDI_L3 (DTM 1000m)
  • GEBCOIceTopo (Global Bathymetry 500m)
  • GEBCOSubIceTopo (Global Bathymetry 500m)
  • CA_MRDEM_DSM (DSM 30m)
  • CA_MRDEM_DTM (DTM 30m)

as well as these USGS 3DEP raster datasets:

  • USGS30m
  • USGS10m
  • USGS1m

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.

More information on Topography can found in its documentation: https://bmi-topography.readthedocs.io.

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 explore (for educators) and jupyter (for general use) instances of EarthscapeHub: just click one of the links under the Run online using heading at the top of this page, then run the notebook in the "CSDMS" kernel.

If you don't already have an EarthscapeHub account, follow the instructions to sign up at https://csdms.colorado.edu/wiki/JupyterHub. If you're an educator, you can get EarthscapeHub accounts for you and your students--please contact us through the CSDMS Help Desk: https://csdms.github.io/help-desk.


Requirements
If run locally, see installation instructions in the bmi-topography repository: https://github.com/csdms/bmi-topography.

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.

References
  • Piper, M. (2025). CSDMS Topography data component (Version 0.9.0) (Computer software). https://doi.org/10.5281/zenodo.4608652.
  • Tucker, G. E., Hutton, E. W. H., Piper, M. D., Campforts, B., Gan, T., Barnhart, K. R., Kettner, A. J., Overeem, I., Peckham, S. D., McCready, L., and Syvitski, J., 2022: CSDMS: a community platform for numerical modeling of Earth surface processes, Geosci. Model Dev., 15, 1413–1439, https://doi.org/10.5194/gmd-15-1413-2022.