Skip to content

Commit

Permalink
Add an example to the README
Browse files Browse the repository at this point in the history
Include a simple example and output plot so that the README is a bit
more exciting.
  • Loading branch information
leouieda committed Dec 4, 2022
1 parent 6c9596b commit c4c064b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,30 @@ We take care of reading the metadata from the `*_MTL.txt` files provided by
EarthExplorer and organizing the bands into a single data structure for easier
manipulation, processing, and visualization.

## Example

Here's a quick example of loading this [Landsat 8 scene from the Brumadinho
tailings dam disaster in Brazil](https://doi.org/10.6084/m9.figshare.21665630.v1):

```python
import xlandsat as xls
import pooch # for downloading the sample scene

# Download the scene as a tar archive
path = pooch.retrieve(
"doi:10.6084/m9.figshare.21665630.v1/cropped-after.tar.gz",
known_hash="md5:4ae61a2d7a8b853c727c0c433680cece",
)
# Load the scene directly from the archive (no need to unpack it)
scene = xls.load_scene(path)
# Make an RGB composite and add it to the scene Dataset
scene = scene.assign(rgb=xls.composite(scene, rescale_to=[0, 0.2]))
# Plot the composite
scene.rgb.plot.imshow()
```

![RGB map showing the flooded plain after the dam collapse as light brown.]( https://raw.githubusercontent.com/compgeolab/xlandsat/main/doc/_static/readme-example.jpg)

## Project goals

* Loading single scenes in the EarthExplorer format.
Expand Down
Binary file added doc/_static/readme-example.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c4c064b

Please sign in to comment.