Giter Site home page Giter Site logo

s2_toa_to_lai's Introduction

Feng Yin

Department of Geography, UCL

Build Status

Here, we use SIAC to do the atmospheric correction of Sentinel 2 TOA reflectance, then use inverse emulator to retrieve LAI from surface recflectance. These code will automatically download Sentinel 2 TOA reflectance data from Copernicus Open Access Hub and do atmospheric correction with SIAC and give per pixel LAI value at 20 meters resolution.

Requirements:

  1. A NASA Earthdata username and password and can be applied here.
  2. A Copernicus Open Access Hub username and password and can be applied here

Installation:

  1. Directly from github to get the most up to date version of it:
pip install https://github.com/MarcYin/S2_TOA_TO_LAI/archive/master.zip
  1. Using PyPI (This one is generally related to release)
pip install S2-TOA-TO-LAI
  1. Using anaconda from anaconda for 'better' package managements
conda install -c f0xy -c conda-forge s2-toa-to-lai

To save your time for installing GDAL:

conda uninstall gdal libgdal
conda update --all -c conda-forge
conda install -c conda-forge gdal>2.1,<2.4

Usage

  1. Using Sentinel 2 tiles directly:
from S2_TOA_TO_LAI import TOA2LAI_S2
TOA2LAI_S2(tiles = ['50SMG'], start='2018-01-02', end='2018-01-03')
  1. Using LatLon (Lat first then Lon) and this can be a 2D list of latlon:
from S2_TOA_TO_LAI import TOA2LAI_S2
TOA2LAI_S2(latlon = '35.4, 56.2', start='2018-01-02', end='2018-01-03')
  1. Using polygon from string(s) or (a) vector file(s):
from S2_TOA_TO_LAI import TOA2LAI_S2
aoi = 'POLYGON((115.79984234354565 39.41267418434987,115.81853363330639 39.41267418434987,115.81853363330639 39.42542974293974,115.79984234354565 39.42542974293974,115.79984234354565 39.41267418434987))' # or a vector file 
TOA2LAI_S2(aoi = aoi, start='2018-01-02', end='2018-01-03')

You can also specify cloud_cover but this may lead to losing of S2 observations due to a bad cloud mask from L1C data

s2_toa_to_lai's People

Contributors

marcyin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

s2_toa_to_lai's Issues

siac_output.json not created by SIAC

Using the current master I get an error towards the end of the TOA2LAI_S2 function. After atmospheric correction, it tries to read a file called siac_output.json in the S2 image folder (line 72 in TOA2LAI_S2::AC_LAI). However, this file isn't created by SIAC V2.3.5.

What am I missing? Lines 72-19 of TOA2LAI_S2 assume that siac_output.json is created in the S2 image folder after running SIAC_S2. Right?

Details: Windows 10, Python 3.6. Installed in virtual env as follows

pip install -U pylibjpeg-openjpeg
pip install numpy==1.19.3 #error with 1.19.4
pip install GDAL-3.1.4-cp36-cp36m-win_amd64.whl #Download gdal whl https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
pip install https://github.com/MarcYin/S2_TOA_TO_LAI/archive/master.zip

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.