Skip to main content

Load Landsat remote sensing images into xarray

Project description

xlandsat

Load Landsat remote sensing images into xarray.

Documentation (latest)Documentation (main branch)CompGeoLab

Latest version on PyPI Latest version on conda-forge Test coverage status Compatible Python versions. DOI used for citations

About

xlandsat is Python library for loading Landsat scenes downloaded from USGS EarthExplorer into xarray.Dataset containers. 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:

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.

Project goals

  • Loading single scenes in the EarthExplorer format.
  • Provide some calculation, like composites, but leave most of the rest to the user and xarray.

Our goal is not to provide a solution for large-scale data processing. Instead, our target is smaller scale analysis done on individual computers. For cloud-based data processing, see the Pangeo Project.

Project status

xlandsat is ready for use but still changing. This means that we sometimes break backwards compatibility as we try to improve the software based on user experience, new ideas, better design decisions, etc. Please keep that in mind before you update xlandsat to a newer version.

We welcome feedback and ideas! This is a great time to bring new ideas on how we can improve the project. Submit issues on GitHub.

License

This is free software: you can redistribute it and/or modify it under the terms of the MIT License. A copy of this license is provided in LICENSE.txt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xlandsat-0.2.0.tar.gz (13.5 kB view hashes)

Uploaded Source

Built Distribution

xlandsat-0.2.0-py3-none-any.whl (13.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page