Skip to main content

Biophysical parameter calculator for Landsat 8 data

Project description

Satellite Image Index Calculation Python Package

Vegetation Index Calculation

Welcome to the Vegetation Index Calculation Python Package! This package provides advanced features for calculating various vegetation indices from satellite imagery, allowing users to efficiently analyze vegetation patterns and dynamics. Whether you are a researcher, a data scientist, or an environmental enthusiast, this package will empower you to gain valuable insights into vegetation health and distribution.

Features

  • Wide Range of Vegetation Indices: The package offers a comprehensive selection of popular vegetation indices, including NDVI (Normalized Difference Vegetation Index), EVI (Enhanced Vegetation Index), SAVI (Soil Adjusted Vegetation Index), and more. Each index has been carefully implemented to ensure accurate and reliable results.

  • Batch Processing: The package is designed for efficiency, allowing you to process large batches of satellite images in parallel. This feature significantly speeds up the analysis and enhances productivity.

  • Visualization Tools: Visualize the calculated vegetation indices using built-in plotting functions. These visualizations aid in understanding the spatial distribution and temporal changes of vegetation in the study area.

  • Data Preprocessing: The package offers data preprocessing utilities, including AOI masking and cloud masking, to ensure the quality of input satellite imagery before index calculation.

Installation

To install the Vegetation Index Calculation package, you can use pip:

pip install RSensePy

Getting Started

Once the package is installed, check out the example notebook to get started with vegetation index calculation and visualization. The notebook provides step-by-step guidance on loading satellite imagery, calculating vegetation indices, and generating informative visualizations.

import RSensePy
RSensePy.help()

# Create RSensePy Image Object
RSensePyObj = RSensePy.L8("path//to//the//Landsat8//Image//Folder")

Getting Image Metadata

Once the RSensePy object created users can get meta data by calling the meta function.

RSensePyObj.meta()

Index calculation basics

Features

  • Cloud Masking: RSensePy incorporates cloud masking capabilities, allowing accurate NDVI computation by accounting for cloudy regions within satellite imagery.

  • Save Location: Users can conveniently specify the directory where computed NDVI outputs will be saved, promoting organized data management and easy access for further analysis.

  • AOI Integration: The package seamlessly integrates shapefiles or Bounding box for targeted analysis. By providing a shapefile location, users can focus computation on specific geographic regions, enhancing analysis precision.

  • Optional Visualization: RSensePy provides an optional visualization feature, enabling users to visualize the calculated NDVI outputs spatially and gain insights into vegetation health distribution in grayscale.

  • Custom normalized difference calculation: RSensePy provides an optional visualization feature, enabling users to visualize the calculated NDVI outputs spatially and gain insights into vegetation health distribution in grayscale.

# Clip the Image with external shapefile
# If cloud masking is required, set the cloud parameter to True, else False
# If visualization is required, set the visualise parameter to True, else False
RSensePyObj.NDVI(cloud=True, save_location="output/Location/path", shp_location="shapefile/location/path", visualise=False)
# Clip the Image with bounding box coordinated
# bbox = [minX, minY, maxX, maxY]
bbox = [13.490206, 48.3355,14.076421, 48.007881]
RSensePyObj.NDVI(cloud=True, save_location="output/Location/path", bbcoord=bbox, visualise=False)

Supported Indices and Object Methods

  • Normalized Difference Vegetation Index (NDVI): NDVI()
  • Enhanced Vegetation Index (EVI): EVI()
  • Normalized Difference Water Index (NDWI): NDWI()
  • Normalized Burn Ratio (NBR): NBR()
  • Normalized Difference Built-Up Index (NDBI): NDBI()
  • Green Normalized Difference Vegetation Index (GNDVI): GNDVI()
  • Green Leaf Index (GLI): GLI()
  • Soil Adjusted Vegetation Index (SAVI): SAVI()
  • Green Soil Adjusted Vegetation Index (GSAVI): GSAVI()
  • Green Chlorophyll Index (GLI): GLI()
  • Visible Atmospherically Resistant Index (VARI): VARI()

Example Usage

import RSensePy

# Load image and initialize ImageObject (similar to previous example)
image = RSensePy.L8("path//to//the//Landsat8//Image//Folder")

# Calculate NDVI using RSensePy
image.NDVI(cloud=True, save_location=output_location, shp_location=shapefile_location, visualise=False)

# Calculate EVI using RSensePy
image.EVI(cloud=True, save_location=output_location, shp_location=shapefile_location, visualise=False)

# Calculate NDWI using RSensePy
image.NDWI(cloud=True, save_location=output_location, shp_location=shapefile_location, visualise=False)

# ... Repeat for other indices ...

Calculate Normalised Difference between two bands

Below example shows how to calculate normalised difference between band 4 and band 5

import RSensePy
# Access individual Landsat bands using object attributes
band1 = RSensePyObj.b1
band2 = RSensePyObj.b2
...
...
band6 = RSensePyObj.b6
band7 = RSensePyObj.b7

RSensePyObj.norm_dif(cloud=True, save_location=output/Location/path,shp_location=shapefile/location/path, band1= RSensePyObj.b4, band2= RSensePyObj.b5, visualise=True)

Get capabilities of the RSensePy

Provide information about which Indexes can be calculated. Note - At the moment only Landsat 8 images are supported.

import RSensePy
RSensePy.getCapabilities()

Contributing

We welcome contributions from the community! If you would like to contribute to the package, please contact the developers for more information.

Bug Reports and Support

If you encounter any issues or have questions regarding the package, please submit a bug report or question in the Issues section of this repository.

License

Copyright (c) 2023, E.M.R.D Ekanayaka - Opeyemi Kazim

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

RSensePy-0.0.2.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

RSensePy-0.0.2-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file RSensePy-0.0.2.tar.gz.

File metadata

  • Download URL: RSensePy-0.0.2.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for RSensePy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8a6b9ca831bc8fee85b291bc9ead65356cc646cbd3c5f837b36a55c440d5625b
MD5 326c6b658a6c4b53d47d1893ce16ca45
BLAKE2b-256 e79526565d7128ef91d5bdef5d09ed4f08a3d83e7a4a45495ae1c7ad17ddf24f

See more details on using hashes here.

File details

Details for the file RSensePy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: RSensePy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for RSensePy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8617c68cebe335c73677a73bcf9e782afcfcb441712a74a836ebb833dcaf2ab6
MD5 dbf214381783be6786f40699741e480f
BLAKE2b-256 33ed1756174dedee4998dabe1ae98c7a1186371eac032b52d37836f6c63cfeea

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