You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DSSAT library allows the user to create low-code scripts to run simulations with the DSSAT model. The library structure allows to execute the DSSAT model based on four input classes: `Crop`, `SoilProfile`, `WeatherStation` and `Management`.
2
+
DSSATTools library allows the user to create low-code scripts to run simulations
3
+
using the DSSAT modeling framework. The library structure allows to executes DSSAT
4
+
based on four input classes: `Crop`, `SoilProfile`, `Weather` and `Management`.
5
+
The simulation environment is managed by the `DSSAT` Class. There are three stages
6
+
for the simulation to be performed:
3
7
4
-
The simulation environment is represented by the `DSSAT` Class. There are three stages for the simulation to be excecuted:
5
-
#. Initialize a `DSSAT` instance
6
-
#. setup the simulation environment by using the `DSSAT.setup` method
7
-
#. run the simulation using the `DSSAT.run` method.
8
+
1. Initialize a `DSSAT` instance.
9
+
2. setup the simulation environment by using the `DSSAT.setup` method. When that
10
+
method is called a new directory is created in the provided location (a tmp
11
+
directory is default) and all the files that are necessary to run the model are
12
+
copied in that folder.
13
+
3. run the simulation calling `DSSAT.run` method. That method needs four
14
+
parameters to be pased. Each parameter indicates the crop, soil, weather, and management.
15
+
This step can be performed as many times as one wants.
16
+
4. close the environment using `DSSAT.close`. This removes the directory and the
17
+
files created during the environment setup.
8
18
9
-
During the environment setup (`DSSAT.setup`) a directory is created and all the static files required to run DSSAT are copied in that directory. This directory will be removed when the `DSSAT.close` method is called. After the environment has been set up, the `DSSAT.run` method can be called as many times as you want.
19
+
The next simple example illustrates how to run a simulation using the five
20
+
aforementioned classes:
10
21
11
-
Input clases are defined by sections and tabular subsections within some sections. Each section is an attribute of the input instance and is defined as an independent `RowBasedSection` class. This class inherits from `dict`, so you can modify any parameter in the section the same way that you'd modify a `dict`'s item.
>>> man = Management(planting_date=datetime(12, 3, 2020))
30
+
>>> dssat = DSSAT()
31
+
>>> dssat.setup()
32
+
>>> dssat.run(soil, wth, crop, man)
33
+
>>> growth = dssat.output["PlantGro"]
34
+
>>> dssat.close() # Terminate the simulation environment
12
35
13
-
All of the parameters and attributes of the four basic clases have the same name you find in the DSSAT files (Take a look at the .CDE files in https://github.com/DSSAT/dssat-csm-os/tree/develop/Data).
36
+
The parameters for ecach class are described in their doucmentation. It is very
37
+
important to highlight that this library will allow the user to run only one treatment
38
+
at a time. If the users are familiar to DSSAT, they must know that DSSAT allows to
39
+
define multiple treatments in the same experimental file.
40
+
41
+
All of the parameters for the four basic clases have the same names you find in
0 commit comments