Skip to main content

Analyze Landsat remote sensing images using xarray

Project description

xlandsat

Analyze Landsat remote sensing images using xarray

Documentation (latest)Contributing (how you can help)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 and analyzing Landsat scenes downloaded from USGS EarthExplorer with the power of xarray. We take care of reading the metadata from the *_MTL.txt files provided by EarthExplorer and organizing the bands into a single xarray.Dataset data structure for easier manipulation, processing, and visualization.

Example

Here's a quick example of loading and plotting this Landsat 9 scene from the city of Manaus, Brazil, which is where the Solimões (brown water) and Negro (black water) rivers merge to form the Amazon river:

import xlandsat as xls
import matplotlib.pyplot as plt

# Download a sample Landsat 9 scene in EarthExplorer format
path_to_scene_file = xls.datasets.fetch_manaus()

# Load the data from the file into an xarray.Dataset
scene = xls.load_scene(path_to_scene_file)

# Make an RGB composite as an xarray.DataArray
rgb = xls.composite(scene, rescale_to=[0.02, 0.2])

# Plot the composite using xarray's plotting machinery
rgb.plot.imshow()

# Annotate the plot with the rich metadata xlandsat adds to the scene
plt.title(f"{rgb.attrs['title']}\n{rgb.attrs['long_name']}")
plt.axis("scaled")
plt.show()
RGB image showing the city on the left and the black waters of the Negro river merging with the brown waters of the Solimões river

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.
  • For other satellites and more powerful features, use Satpy.

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.5.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

xlandsat-0.5.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file xlandsat-0.5.0.tar.gz.

File metadata

  • Download URL: xlandsat-0.5.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for xlandsat-0.5.0.tar.gz
Algorithm Hash digest
SHA256 6d8b8ad9876f72227e2bb06f556f5a815446c9a7b8f5aedbbd6b38aa4fd04a6f
MD5 5a8d89b32f31d8e902bc215ab94623e7
BLAKE2b-256 011c55e7fbc07193c1b72afc52ae4ccf350a71bdf3bf69b72b6c92cb250ca439

See more details on using hashes here.

File details

Details for the file xlandsat-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: xlandsat-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for xlandsat-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f76d773a2a71a4c076b6f407fbb867a52dbcb50383ad3fe3ebb293c17eee422
MD5 0c61f8e205c19a391a7db2596bae251e
BLAKE2b-256 6f13cf67568da1761be6591e74a136b5f62ca99349d6446c57c91d490dccceae

See more details on using hashes here.

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