ESPA Tools
An open-source Python package for simple loading of Landsat imagery as NumPy arrays
Install
espatools is available from PyPI:
$ pip install espatools
Usage
We think espatools is easy to use; give it a try and let us know what you think!
See this Jupyter Notebook for a demonstration of some simple plotting after reading Landsat imagery.
# Import the espatools module for raster I/O
import espatools
# Use matplotlib for simple plotting
import matplotlib.pyplot as plt
# Set the XML metadata file
xmlfile = 'LC081210652018073101RT-SC20180802013328/LC08_L1TP_121065_20180731_20180731_01_RT.xml'
# Set up the reader
reader = espatools.RasterSetReader(filename=xmlfile)
# Perfrom the read!
raster = reader.Read()
That's it! you just read in a set of Landsat imagery and each band is accessible by name as a 2D NumPy array:
# Get the bands dictionary
bands = raster.bands
# Grab a band by name
aer = bands.get('sr_aerosol')
# Plot this band up!
plt.imshow(aer.data)
plt.title(aer.name)
plt.show()
The above code results in an image like below:
# Maybe you want the RGB bands as a 3D NumPy array
color = raster.GetRGB()
# You could plot this up:
plt.figure()
plt.imshow(color)
plt.title('color')
plt.show()
Metadata
Release files for espatools 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| espatools-0.0.3.tar.gz | 5.9 kB | Without provenance | Details for espatools-0.0.3.tar.gz |
Release files / espatools-0.0.3.tar.gz
| Download URL | espatools-0.0.3.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db468dc205279a1a7ba2677cf8853c8280b084d7211be51991529be01c6b81f2
|
|
BLAKE2b-256 checksum How to use checksums |
f64476ffded6b3711ce8025fd0a36ff6820a60b202d1f3cedfb60be23022dde5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.14
|
Security for espatools 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.