Installation

Setting a Python environment

We recommend an installation with conda.

  1. Create a conda environment with miniconda3

    conda create -n myenvname python=3 openalea.mtg openalea.plantgl alinea.caribu alinea.astk numpy=1.20.3 pandas pytest sphinx sphinx-rtd-theme -c conda-forge -c openalea3
    
  2. Place yourself in the created environment: conda activate myenvname

Note

virtual sensors and soilmesh in Caribu > 8.0.10 are working correctly

Installation of Needed Packages

PyRATP

  1. Git console:

    git clone -b update_mobidiv https://github.com/mwoussen/PyRATP
    
  2. Installation in the conda environment (in folder PyRATP)

    make mode=develop
    make clean
    

RiRi5

  1. Git console:

    git clone https://github.com/glouarn/riri5
    
  2. Installation in the conda environment (in folder riri5)

    python setup.py develop
    

LightVegeManager

  1. Git console:

    git clone https://github.com/mwoussen/lightvegemanager
    
  2. Installation in the conda environment (in folder lightvegemanager)

    python setup.py develop
    

Quickstart

Small test to quickly test the tool. LightVegeManager needs at least a geometric information and a light model to call between "ratp", "caribu" or "riri5".

from lightvegemanager.LVM import LightVegeManager

# one triangle as a geometric element
# we write our triangle in a CaribuScene format
organ_id = 001
triangle_vertices = [(0,0,0), (1,0,0), (1,1,1)]
triangle = {organ_id : [triangle_vertices]}
geometry = { "scenes" : [triangle] }

# surfacic lighting with CARIBU
lighting = LightVegeManager(lightmodel="caribu")

# build the scene
lighting.build(geometry)

# compute lighting
energy = 500
hour = 15
day = 264 # 21st september
lighting.run(energy, hour, day)

# output
print(lighting.elements_outputs)

See also

For more details on default values, see LightVegeManager_defaultvalues