Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
abc4f5a
some corrections
cyrilbz Sep 15, 2025
d450a7d
Added new and functional examples
cyrilbz Sep 15, 2025
344a94b
Update README.md
cyrilbz Sep 16, 2025
42b7b70
Merge branch 'master' into dev_cyril
pradal Sep 16, 2025
f60b848
Removing old example files + some cleaning
cyrilbz Sep 16, 2025
8eb0efe
changed French to English
cyrilbz Sep 16, 2025
45bfe5b
Update README.md
cyrilbz Sep 16, 2025
2822fa6
Update README.md
cyrilbz Sep 16, 2025
04a75e3
import plantGL removed
Sep 16, 2025
197280b
Merge branch 'dev_cyril' of https://github.com/openalea/PyRATP into d…
msaudreau Sep 16, 2025
d5071cf
added file (not working yet) for automatic grid creation from vgx
cyrilbz Sep 16, 2025
98948b1
Working example program for grid file creation from .vgx file
cyrilbz Sep 19, 2025
2eb5a0b
started notebook for PyRATP tutorial
cyrilbz Sep 19, 2025
67da900
Progresses in the tutorial and better (and smaller) printing of simul…
cyrilbz Sep 24, 2025
cddcffc
Update README.md with jupyter installation and a word about tutorials…
cyrilbz Sep 24, 2025
5876595
finished basic tutorial and added vtk visualisation through python an…
cyrilbz Sep 24, 2025
5576045
Merge branch 'dev_cyril' of github.com:openalea/PyRATP into dev_cyril
cyrilbz Sep 24, 2025
5787426
cleaned vtk file view
cyrilbz Sep 24, 2025
2b758a2
PyRATP viewer
cyrilbz Oct 3, 2025
0a45218
Corrected entity selection in PyRATP viewer
cyrilbz Oct 3, 2025
f2adf0d
updated notebook with PyRATP viewer
cyrilbz Oct 3, 2025
dcffb0a
updated module names with no upper case
cyrilbz Oct 3, 2025
1dc7bbd
First refactoring
pradal Dec 3, 2025
a585e32
changed example file name for safety
cyrilbz Dec 9, 2025
d1a8f56
Remove scons tools
pradal Dec 15, 2025
a05540f
remove old files
pradal Dec 15, 2025
3ab1b83
Update Documentation
pradal Dec 15, 2025
4625163
Remove empty files
pradal Dec 15, 2025
f1496a0
Update Python code
pradal Dec 15, 2025
ccdf214
Update doc
pradal Dec 15, 2025
6e03011
Update tutorials in visualea
pradal Dec 15, 2025
da50e2f
Update install files
pradal Dec 15, 2025
a66df89
Update install file with wralea
pradal Dec 15, 2025
0b674d5
Update data in visualea
pradal Dec 15, 2025
8263ae0
Update install python source
pradal Dec 15, 2025
560c99e
Install wralea packages with meson/pip
pradal Dec 15, 2025
7b5c1a5
Update test
pradal Dec 15, 2025
4940fd1
Update meson
pradal Dec 15, 2025
0e41a2d
Fix several bugs and deprecated features
pradal Dec 16, 2025
cffbebd
Up
pradal Dec 16, 2025
ad1feb8
Fix code and workflows
pradal Dec 16, 2025
95a271f
Merge branch 'master' into dev_cyril
pradal Dec 16, 2025
f9d979e
Fix an error on syntax in meson.build for Linux
pradal Dec 16, 2025
e5116e9
Merge branch 'dev_cyril' of https://github.com/openalea/PyRATP into d…
pradal Dec 16, 2025
609c4ca
added eol
baugetfa Dec 16, 2025
6c1d75a
Update README.md
baugetfa Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 0 additions & 67 deletions Makefile

This file was deleted.

39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ mamba create -n pyratp openalea.ratp -c conda-forge -c openalea3/label/rc
The rc channel corresponds to the latest build of PyRatp when the main channel is the
stable release.

### For developpers
### For developpers Linux (python modification only)
Editable install with conda/environment.yml is not functionning because of namespace conflict. A workaround is as follow:
1) download the repository and change to the root directory:
```shell
Expand All @@ -69,7 +69,7 @@ Editable install with conda/environment.yml is not functionning because of names
```
2) Create a conda environment with dependencies manually with:
```shell
mamba create -n pyratp -c openalea3 -c conda-forge openalea.plantgl openalea.mtg qtpy compilers meson-python gfortran openalea.mtg
mamba create -n pyratp -c openalea3 -c conda-forge openalea.plantgl openalea.mtg qtpy compilers meson-python gfortran scipy pytest jupyter
```
3) activate the environment: `mamba activate pyratp`

Expand All @@ -86,3 +86,38 @@ via the environment variable
export PYTHONPATH="$PWD/src":$PYTHONPATH
```


### For developpers (python and fortran modifications)
Editable install with conda/environment.yml is not functionning because of namespace conflict. A workaround is as follow:
1) download the repository and change to the root directory:
```shell
git clone https://github.com/openalea/PyRATP.git
cd PyRATP
```
2) Create a conda environment with dependencies manually:

Using MAC and Linux:
```shell
mamba create -n pyratp_dev -c conda-forge -c openalea3 openalea.plantgl openalea.mtg qtpy compilers meson-python scipy pytest jupyter
```
Using Windows:
```shell
mamba create -n pyratp_dev -c conda-forge -c openalea3 openalea.plantgl openalea.mtg qtpy m2w64-toolchain meson-python scipy pytest gfortran jupyter
```
4) activate the environment: `mamba activate pyratp_dev`

5) Compile everything:

```shell
pip install ./"[test]"
```

and after each modification of the python or Fortran part, run
```shell
pip install .
```
then restart your kernel (when using IPython) for your modifications to be taken into account.

6) Have a look at the notebooks and scripts in ```example/```!


6 changes: 3 additions & 3 deletions doc/user/index.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.. _pyratp_user:

PyRATP User Guide
#######################################
OpenAlea.RATP (former PyRATP) User Guide
#########################################

:Version: |version|
:Release: |release|
:Date: |today|

This manual details functions, modules, and objects included in
OpenAlea.PyRATP, describing what they are and what they do. For a complete
OpenAlea.RATP, describing what they are and what they do. For a complete
reference guide, see :ref:`pyratp_reference`.

.. warning::
Expand Down
28 changes: 14 additions & 14 deletions doc/user/manual.rst
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
Getting Started
################

Things to know about pyRATP ...
Things to know about OpenAlea.RATP ...
===============================
Based on a single Fortran90 program, the OpenAlea version of RATP is still implemented
in Fortran90 with some specificities:

- The RATP code is now divided into several Fortran90 modules which can be used as a Python library in the ALEA environment. A Fortran90 module includes public variables and subroutines, which are all accessible in the ALEA environment.
- The RATP code is now divided into several Fortran90 modules which can be used as a Python library in the ALEA environment. A Fortran90 module includes public variables and subroutines, which are all accessible in the OpenAlea environment.
- Input variables and files are managed in Python through dedicated python nodes available in the VisuAlea environment.
- The RATP core i.e. radiation balance, heat energy balance and leaf physiological models (transpiration and photosynthesis) are still Fortran90 modules and are not available for users.

First tutorial
==============

Load pyRATP
***********
Launch the Tuto1 composite node from the pyratp package (pyratp.demo.RATPTuto1):
Load OpenAlea.RATP
*******************
Launch the Tuto1 composite node from the openalea.ratp package (openalea.ratp.demo.RATPTuto1):

.. image:: Tuto1Image.png
:width: 30%
:align: center

The following workspace should open :

.. dataflow:: pyratp.demo RATPTuto_ToStart
.. dataflow:: openalea.ratp.demo RATPTuto_ToStart

This workspace is composed of:

Expand All @@ -36,9 +36,9 @@ Description of input files
--------------------------
Many input parameters are necessary to run RATP. It is out of the scope of this short tutorial to describe all this parameters. All information about these input files can be found in /LINK TO PDF ou WORD FILE/

Run pyRATP
**********
To run pyRATP click right on the node "DoAll" and run the node. All the input files will be read sequentially. The success of each step and the computational time should be highlighted in the console window as follow:
Run OpenAlea.RATP
******************
To run OpenAlea.RATP click right on the node "DoAll" and run the node. All the input files will be read sequentially. The success of each step and the computational time should be highlighted in the console window as follow:
::
VEGE3D OK
GRILLE OK
Expand All @@ -48,7 +48,7 @@ To run pyRATP click right on the node "DoAll" and run the node. All the input fi
MICROMETEO OK
Evaluation time: 3.07400012016

pyRATP outputs
OpenAlea.RATP outputs
**************
At the end of the computation, four output files are stored in the directory: C:\\tmpRATP\\Resul\\: data.txt, spatial.txt, tree.txt and VoxelsGrid.vgx .

Expand All @@ -61,20 +61,20 @@ Description of output files

Visualize output as 3D data
---------------------------
The pyRATP outputs can be visualized at the leaf scale or at the voxel scale.
The OpenAlea.RATP outputs can be visualized at the leaf scale or at the voxel scale.

#. 3D Voxel scale

To visualize the voxels you first have to extract from the entire spatial output data the variable to plot for a specific time step. Then write this data in a file according to the vtk format (to be use with the Paraview software) using the RATP2VOXELS python node.
The following data flow shows how to connect all the nodes and to define the day, the hour and the RATP variable to extract.

.. dataflow:: pyratp.demo RATPTuto_Visu3DOutputVoxels
.. dataflow:: OpenAlea.RATP.demo RATPTuto_Visu3DOutputVoxels

#. 3D leaf scale

To visualize the pyRATP outputs as 3D data you can either use plantGL method or python nodes dedicated to pyRATP In both case 3D plot are colored according to one variable output variable i.e. one which is stored in the spatial.txt file.
To visualize the OpenAlea.RATP outputs as 3D data you can either use plantGL method or python nodes dedicated to OpenAlea.RATP In both case 3D plot are colored according to one variable output variable i.e. one which is stored in the spatial.txt file.

.. dataflow:: pyratp.demo RATPTuto_Visu3DOutputLeaves
.. dataflow:: OpenAlea.RATP.demo RATPTuto_Visu3DOutputLeaves


TODO
Expand Down
2 changes: 1 addition & 1 deletion doc/user/overview.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The model PyRATP was designed to simulate the spatial distribution of radiation and leaf-gas
The model RATP (aka OpenAlea.RATP) was designed to simulate the spatial distribution of radiation and leaf-gas
exchanges within vegetation canopies as a function of canopy structure,
canopy microclimate and physical and physiological leaf
properties. The model uses a 3D representation of the canopy (i.e. an array
Expand Down
36 changes: 36 additions & 0 deletions example/View_data_frame.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 1 09:27:16 2025

@author: cbozonnet
"""

import pandas as pd
import os
from openalea.ratp.RATP2VTK import pyratpviewer
from openalea.ratp.grid import Grid

# data folder
datafolder = "data_pyratp"

# file names
grid_name = "grid3D-0_5m-vegestar.grd"
vegestar_file = "LOD6juin0.2.vgx"
coeff_allometric = 1
csv_name = "dfvox_20251001_093217.csv"

# read grid file
g = Grid()
g = Grid.read(os.path.join(datafolder, grid_name))

# fill up grid file from digitalisation (Vegestar file)
e, x, y, z, s, n = Grid.readVgx(os.path.join(datafolder, vegestar_file), coeff_allometric)
g, matching = Grid.fill_1(e, x, y, z, s, n, g)

# load data frame
df = pd.read_csv(os.path.join(csv_name ))

# viewer
pyratpviewer(g, df)

Loading
Loading