GithubHelp home page GithubHelp logo

tharlestsa / ndvi-cog Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 68 KB

The NDVI Time-Series Analyzer is a Python script that calculates and visualizes the Normalized Difference Vegetation Index (NDVI) for given geospatial points over a specified time range using Sentinel-2 L2A imagery.

License: MIT License

Python 100.00%
cog ndvi-index time-series earth-search

ndvi-cog's Introduction

NDVI Time-Series Analyzer

The NDVI Time-Series Analyzer is a Python script that calculates and visualizes the Normalized Difference Vegetation Index (NDVI) for given geospatial points over a specified time range using Sentinel-2 L2A imagery.

NDVI Time-Series Analyzer

Dependencies

  • os
  • numpy
  • pandas
  • geopandas
  • plotly.express
  • scipy
  • datetime
  • satsearch
  • shapely
  • rio_tiler
  • loguru
  • joblib

Setup

  1. Ensure you have all the dependencies installed.
  2. Clone/download the repository.

How to Use

  1. Prepare a GeoJSON file named points.geojson in the root directory. This should contain the geospatial points you want to analyze.
  2. Adjust the start_year and end_year variables at the end of the script to set your desired date range.
  3. Run the script.

Features

  • get_pixel_value(urls, lon, lat, datetime): Retrieves the pixel value for specified bands at the given coordinates.

  • process_period(id, start_year, end_year, geometry): Processes a specified date range for a given point, fetching and analyzing satellite data.

  • plot_ndvi(df): Calculates, smoothes, and visualizes the NDVI values over time.

  • execute(start_year, end_year, geojson_file): Main execution function that reads in the GeoJSON data and triggers the data processing and visualization.

Constants Configuration

  • STAC_API_URL: URL for the STAC API.
  • COLLECTION: Name of the satellite data collection.
  • CLOUD_COVER_LIMIT: Maximum acceptable cloud cover percentage for satellite data.

Notes

  • This script currently only supports points in the GeoJSON file.
  • Ensure that the points.geojson file has a column named 'ID'.
  • Data fetching and processing may take some time depending on the date range and number of points.

ndvi-cog's People

Contributors

tharlestsa avatar

Stargazers

Robin Cole avatar Euhid Aman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.