https://github.com/hcdp/ndvi_gee

Containers for pulling and querying NDVI data

https://github.com/hcdp/ndvi_gee

Science Score: 21.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
    Organization hcdp has institutional domain (hawaii.edu)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.9%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Containers for pulling and querying NDVI data

Basic Info
  • Host: GitHub
  • Owner: HCDP
  • Language: Python
  • Default Branch: main
  • Size: 12.7 KB
Statistics
  • Stars: 0
  • Watchers: 4
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created almost 2 years ago · Last pushed almost 2 years ago
Metadata Files
Readme

README.md

README Overview This repository contains two Python scripts and a Flask web application that together enable downloading of NDVI (Normalized Difference Vegetation Index) images from Google Earth Engine for specified regions and dates. Files in the Repository

  1. fetch-ndvi.py - This script performs the following: • Authenticates with Google Earth Engine. • Defines regions of interest. • Fetches MODIS satellite data, processes it to calculate NDVI, and masks clouds. • Exports the processed NDVI images to local folders.

  2. app.py - This script sets up a Flask web server to: • Serve a simple "Hello, World!" message on the root route. • Provide endpoints for downloading the latest or specific dated NDVI images as ZIP archives.

Prerequisites Ensure you have the following installed: • Python 3.x • Required Python packages (can be installed via pip install -r requirements.txt): • geemap • earthengine-api • seleniumbase • Flask

Google Earth Engine Authentication Both scripts require authentication with Google Earth Engine. This involves using Selenium to automate the authentication process. Ensure you have a Google Earth Engine account and the necessary credentials. Setup Instructions

  1. Install Python Packages

Then, install the packages using: • pip install -r requirements.txt

  1. Google Earth Engine Authentication • Create a google cloud service account and export a key file as JSON. • Name this file credentials.json and copy to the api folder. Running the Scripts

  2. Running the NDVI Processing Script Execute ndvi.py to start the NDVI image processing and export: • python ndvi.py

  3. Running the Flask Web Server Run app.py to start the Flask web server: • python app.py

The server will start on http://127.0.0.1:5000/. Flask Endpoints • Root Endpoint Accessing http://127.0.0.1:5000/ will return a simple "Hello, World!" message. • Download Latest Folder Accessing http://127.0.0.1:5000/download/latest will allow you to download the latest NDVI folder as a ZIP file. • Download Specific Folder Accessing http://127.0.0.1:5000/download/spc_date/ will allow you to download the NDVI folder nearest to the specified date (format: YYYY-MM-DD) as a ZIP file. Directory Structure • Exported Images NDVI images are exported to folders named with the end date in the format YYYY-MM-DD. Each region of interest will have its own subdirectory within this folder. Additional Information Error Handling Both scripts have basic error handling to ensure the process completes even if some steps fail. Adjust the try-except blocks as necessary for more robust error reporting. Customization Modify the region coordinates, date ranges, and other parameters in ndvi.py as needed for your specific use case. The Flask app can also be extended with additional routes or functionality as required.

NDVI

Owner

  • Name: Hawaii Climate Data Portal
  • Login: HCDP
  • Kind: organization

GitHub Events

Total
Last Year

Dependencies

.github/workflows/build-api.yml actions
  • actions/checkout v4 composite
  • docker/login-action v3 composite
.github/workflows/build-data-pull.yml actions
  • actions/checkout v4 composite
  • docker/login-action v3 composite
api/Dockerfile docker
  • python 3.10 build
data_pull/Dockerfile docker
  • python 3.10 build
api/requirements.txt pypi
  • flask *
  • gunicorn *
data_pull/requirements.txt pypi
  • earthengine-api *
  • geemap *