|LabNotesInstructions=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://github.com/csdms/help-desk.
|LabNotesInstructions=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.
|LabNotesRequirements=If run locally, see installation instructions in the bmi-geotiff repository: https://github.com/csdms/bmi-geotiff.
|LabNotesRequirements=If run locally, see installation instructions in the bmi-geotiff repository: https://github.com/csdms/bmi-geotiff.
|LabAcknowledgements=This work is supported by the National Science Foundation under Award No. 1831623, Community Facility Support: The Community Surface Dynamics Modeling System (CSDMS).
|LabAcknowledgements=This work is supported by the National Science Foundation under Award No. 1831623, Community Facility Support: The Community Surface Dynamics Modeling System (CSDMS).
GeoTiff is a Python library for accessing data and metadata from a GeoTIFF file through an API or a BMI.
The bmi-geotiff library accepts a filepath or an URL to a GeoTIFF file. Data are loaded into an xarray DataArray using the experimental open_rasterio method. The API is wrapped with a Basic Model Interface (BMI), which provides a standard set of functions for coupling with data or models that also expose a BMI.
Classroom organization This lab includes examples of using the GeoTiff data component in a Jupyter Notebook, in a shell script, and in a Python program. Try editing these examples to download, open, and display data from other GeoTIFF files.
Learning objectives Skills
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. 1831623, Community Facility Support: The Community Surface Dynamics Modeling System (CSDMS).