• Stars
    star
    111
  • Rank 314,510 (Top 7 %)
  • Language
    Python
  • Created over 12 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python bindings for the PROSAIL canopy reflectance model




PROSAIL Python Bindings

J Gomez-Dans (NCEO & UCL) [email protected]

DOI

Build Status

Coverage Status codecov Anaconda-Server Badge PyPI version

Install using Anaconda

You should be able to easily install this using Anaconda (only tested on Linux!) with

conda install -c jgomezdans prosail

I think it might work on both Python 2.7 and 3.6. But I'm only a scientist, so expect car crashes!

Description

This repository contains the Python bindings to the PROSPECT and SAIL leaf and canopy reflectance models, respectively. Both models have been rewritten and coupled in Python, with some changes to improve on efficiency. The bindings implement the following models:

  • PROSPECT: versions 5 and D. Flexibility to add/modify leaf absorption profiles.
  • SAIL: FourSAIL version. The thermal extension of the model is also implemented, although this hasn't been widely tested.
  • Simple Lambertian soil reflectance model

I have used as a benchmark the codes available from Jussieu.

A recent(ish) review on the use of both RT models is availabe in this paper_.

Installing the bindings

The installation of the bindings is quite straightforward: unpack the distribution and run the following command

python setup.py install

This assumes that you have the following things installed:

Most of these things can be installed quite easily using Anaconda Python. In this case, you can probably just install everything you need with

  conda install python=2.7 numpy numba scipy
  pip install -U backports.functools_lru_cache

The bindings should then install without any issue.

Using the bindings

Once you import the bindings into the namespace with

import prosail

you can then run SAIL (using prescribed leaf reflectance and transmittance spectra, as well as canopy structure/soil parameters), PROSPECT and both (e.g. use PROSPECT to provide the spectral leaf optical properties).

run_sail

To run SAIl with two element arrays of leaf reflectance and transmittance sampled at 1nm between 400 and 2500 nm rho and tau, using a black soil (e.g. zero reflectance), you can just do

rho_canopy = prosail.run_sail(rho, tau, lai, lidfa, hspot, sza, vza, raa, rsoil0=np.zeros(2101))

Here, lai is the LAI, lidfa is the mean leaf angle in degrees, hspot is the hotspot parameter, sza, vza and raa are the solar zenith, sensor zenith and relative azimuth angles, and rsoil0 is set to an array of 0s to define the soil reflectance.

You have quite a few other options:

  • You can use a different way of specifying the leaf angle distribution (by default we use a Campbell distribution with one single parameter, but you might want to use the Verhoef distribution). The Verhoef distribution is selected by adding the extra keyword typelidf=1 and the two parameters are given by lidfa and the additional optional parameter lidfb.
  • You can use the internal soil spectrum model. This model is basically rho_soil = rsoil*(psoil*soil_spectrum1+(1-psoil)*soil_spectrum2). The first spectrum is a dry soil, the second one a wet one. You can also set the spectra using the soil_spectrum1 and soil_spectrum2 keywords.
  • By default, we return the surface directional reflectance, but you can choose other reflectance factors (e.g. BHR, DHR, HDR).

run_prospect

To calculate leaf reflectance and transmittance using the PROSPECT model, you can use the run_prospect function. You can select either the PROSPECT-5 or PROSPECT-D versions (by default, version 'D' is used). A call to this would look like:

lam, rho, tau = prosail.run_prospect(n, cab, car, cbrown, cw, cm, ant=8.0)

Where the parameters are all scalars, and have their usual PROSPECT meanings (see table below). ant stands for anthocyannins, which isn't present in PROSPECT-5.

To do the same for PROSPECT-5...

lam, rho, tau = prosail.run_prospect(n, cab, car, cbrown, cw, cm, prospect_version='5')

You can change a number of things when calling PROSPECT, but I can't be arsed documenting it now.

run_prosail

The marriage of heaven and hell, PROSPECT being fed into SAIL in one go! Same options as the two other functions put together:

rho_canopy = prosail.run_prosail(n, cab, car, cbrown, cw, cm, lai, lidfa, hspot, tts, tto, psi, \
                    ant=0.0, alpha=40.0, prospect_version='5', typelidf=2, lidfb=0.0, \
                    factor='SDR', rsoil0=None, rsoil=None, psoil=None, \
                    soil_spectrum1=None, soil_spectrum2=None)

The parameters

The parameters used by the models and their units are introduced below:

Parameter Description of parameter Units Typical min Typical max
N Leaf structure parameter N/A 0.8 2.5
cab Chlorophyll a+b concentration ug/cm2 0 80
caw Equivalent water thickiness cm 0 200
car Carotenoid concentration ug/cm2 0 20
cbrown Brown pigment NA 0 1
cm Dry matter content g/cm2 0 200
lai Leaf Area Index N/A 0 10
lidfa Leaf angle distribution N/A - -
lidfb Leaf angle distribution N/A - -
psoil Dry/Wet soil factor N/A 0 1
rsoil Soil brigthness factor N/A - -
hspot Hotspot parameter N/A - -
tts Solar zenith angle deg 0 90
tto Observer zenith angle deg 0 90
phi Relative azimuth angle deg 0 360
typelidf Leaf angle distribution type Integer - -

Specifying the leaf angle distribution

The parameter typelidf regulates the leaf angle distribution family being used. The following options are understood:

  • typelidf = 1: use the two parameter LAD parameterisation, where a and b control the average leaf slope and the distribution bimodality, respectively. Typical distributions are given by the following parameter choices:
LIDF type LIDFa LIDFb
Planophile 1 0
Erectophile -1 0
Plagiophile 0 -1
Extremophile 0 1
Spherical -0.35 -0.15
Uniform 0 0
  • typelidf = 2 Ellipsoidal distribution, where LIDFa parameter stands for mean leaf angle (0 degrees is planophile, 90 degrees is erectophile). LIDFb parameter is ignored.

The soil model

The soil model is a fairly simple linear mixture model, where two spectra are mixed and then a brightness term added:

rho_soil = rsoil*(psoil*soil_spectrum1+(1-psoil)*soil_spectrum2)

The idea is that one of the spectra is a dry soil and the other a wet soil, so soil moisture is then contorlled by psoil. rsoil is just a brightness scaling term.

More Repositories

1

get_modis

Downloading MODIS data from the USGS repository
Python
62
star
2

spsa

Simultaneous perturbation stochastic approximation Python code
Python
30
star
3

gp_emulator

Gaussian Process emulators in Python
Jupyter Notebook
16
star
4

eoldas

An Earth Observation Land Data Assimilation System (EO-LDAS)
Python
16
star
5

BRDF_modelling

BRDF modelling using linear kernel models
Jupyter Notebook
15
star
6

sixs

Python bindings for 6s. The 6S code is a basic RT code used for calculation of lookup tables in the MODIS atmospheric correction algorithm.
Fortran
12
star
7

sensitivity_analysis

Morrris, Campolongo and others' approach to sensitivity analysis of models
Python
9
star
8

phenology

Phenology practical for Geo124
Python
7
star
9

eoldas_ng

A data assimilation tool for land EO
Jupyter Notebook
6
star
10

SoilPlantAtmosphere

The SPA (Soil-Plant-Atmosphere) model of MWilliams et al.
Fortran
6
star
11

accra_wkshp

Materials for NCEO crop modelling, Earth Observation and DA workshop in Accra
Jupyter Notebook
6
star
12

brdf_kernels

BRDF kernels Python code
Python
5
star
13

gdal_notes

Some notes on using the GDAL executables and python bindings to process & analyse geospatial data
Python
5
star
14

BRDF_descriptors

Python
5
star
15

photosynthesis_practical

Photosynthesis modelling practical for UCL's Geography Geogg124 course
Jupyter Notebook
5
star
16

geog0133-practicals

Practicals for UCL's Department of Geography Geog0133: "Terrestrial Carbon: modelling and monitoring"
Jupyter Notebook
5
star
17

dalec_pf

A data assimilation experiment with the DALEC ecosystem model
Jupyter Notebook
4
star
18

KaFKA

Kascading Fast Kalman Assimilation
Python
4
star
19

julespy

A python driver to run the JULES model.
Python
4
star
20

barrax_2015

Material for the NERC STFC Field Spectroscopy Course
Python
4
star
21

geog_docker

Docker image for Geospatial Python teaching
Jupyter Notebook
4
star
22

modisficator

A python class to work with MODIS data
Python
4
star
23

globalbedo_prior

Code to produce the GlobAlbedo prior from MODIS data
Python
4
star
24

eoldas_release

Python
4
star
25

jgomezdans.github.com

HTML
4
star
26

fire_impacts_s2

Jupyter Notebook
3
star
27

twostream

The 2stream RT model
Fortran
3
star
28

sentinel_SRF

Sentinel2 and Sentinel3 Spectral Response Functions for Py6S
Python
3
star
29

sar_homework

Jupyter Notebook
3
star
30

semidiscrete

Python bindings for the semidiscrete RT model of Gobron et al.
Fortran
2
star
31

demo_ghana

A demo of the NCEO ODA Ghana collaboration
Jupyter Notebook
2
star
32

barrax_2017

Jupyter Notebook
2
star
33

New-Fires

2
star
34

radtran

A radiative transfer model project to ascertain the influence of vegetation structure on the TOC SIF signal.
PHP
2
star
35

two_stream

The 2stream inversion package (TIP) from JRC. Emulated. Regularised. Improved.
Jupyter Notebook
2
star
36

da_esa_wkshp

eoldas_ng distribution for ESA Land DA workshop at UCL
Python
2
star
37

dalec

A python version of the DALEC ecosystem model
Python
2
star
38

kaska_release

Python
2
star
39

geog0666

Jupyter Notebook
1
star
40

new_fires

Python
1
star
41

eoldas_examples

Python
1
star
42

Kiwa_BA

Kiwa burned area project
1
star
43

polasarpro

C++
1
star
44

migrate_db

A simple (and inefficient) python script to migrate from postgresql to sqlite
1
star
45

mauna_loa

Some simple model fitting with Python
Jupyter Notebook
1
star
46

EmulationEngine

Python
1
star
47

eoldas_ng_observations

Helper modules for dealing with satellite remote sensing observations for eoldas_ng
Python
1
star
48

firemafs

My firemafs code
Fortran
1
star
49

eoldas_user

The EOLDAS users' guide
1
star
50

eoldas_plots

The EOLDAS plotting code
Python
1
star
51

ensemble_wofost_assimilation

Python
1
star
52

pangeos_uq

Materials for the PANGEOS Uncertainty Quantification workshop
Jupyter Notebook
1
star