Preparing the SAMIR parameter csv file
All the SAMIR model parameters are written in a csv file. Here is an example of such a file:
ClassName |
scale_factor |
Default |
class1 |
class2 |
class3 |
class4 |
class5 |
class6 |
class7 |
ClassNumber |
1 |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
FmaxFC |
1000 |
1 |
|||||||
Fslope |
1000 |
1.4 |
|||||||
Foffset |
1000 |
-0.075 |
|||||||
Plateau |
1 |
0 |
|||||||
Kcb_max |
1000 |
1.15 |
|||||||
Kslope |
1000 |
1.2 |
|||||||
Koffset |
1000 |
-0.24 |
|||||||
Zsoil |
1 |
2000 |
|||||||
Ze |
1 |
300 |
|||||||
Init_RU |
1000 |
0.87 |
|||||||
DiffE |
1 |
1 |
|||||||
DiffR |
1 |
5 |
|||||||
REW |
1 |
0 |
|||||||
minZr |
1 |
150 |
|||||||
maxZr |
1 |
600 |
|||||||
p |
1000 |
0.55 |
|||||||
FW |
1000 |
1 |
|||||||
Irrig_auto |
1 |
1 |
|||||||
Irrig_man |
1 |
0 |
|||||||
Kcb_stop_irrig |
1 |
0.5 |
Here is how the file is organised:
model parameters are located in the first column (row header), a row contains the values of a parameter for different classes.
the file contains three header columns: the parameter name (
ClassName
leftmost), the scale factors (scale_factor
used to manage data types in the SAMIR calculations) and the default (Default
) parameter values column.the other columns have the
ClassName
as a header and contain the different parameter values. If a cell is empty, it will take theDefault
column value.the
ClassNumber
row should not be changed for thescale_factor
andDefault
columns. For the classes, it should correspond to the integer values contained in the land cover raster.
You can have different parameter files, the file to use for a simulation is set in the json configuration file. This csv table is then loaded in an object as a pandas DataFrame
attribute with the following function:
- class modspa_pixel.parameters.params_samir_class.samir_parameters(paramFile: str)[source]
Load all parameters for multiples classes in one object.
Attributes
- .table:
pd.DataFrame
pandas DataFrame
with all paramters (rows) for all classes (columns)It also contains :
a
scale_factor
column (first column) that allows to convert all parameters to integer values for reduced memory usagea
Default
column (second column) that contains default values to fill in missing values
Example of the parameter table:
scale_factor Default class1 class2 class3 ClassName ClassNumber 1 0.00 1.00 2.000 3.000 FminNDVI 1000 0.20 0.20 0.100 0.100 FmaxNDVI 1000 0.90 0.90 0.900 0.900 FminFC 1000 0.90 0.90 0.900 0.900 FmaxFC 1000 1.00 0.90 1.000 1.000 Fslope 1000 1.40 1.50 1.500 1.500 Foffset 1000 -0.10 -0.10 -0.100 -0.100 Plateau 1 70.00 70.00 70.000 70.000 KminNDVI 1000 0.10 0.10 0.100 0.100 KmaxNDVI 1000 0.90 0.90 0.900 0.900 KminKcb 1000 0.00 0.20 0.000 0.000 KmaxKcb 1000 0.98 1.00 1.100 1.100 Kslope 1000 1.60 1.60 1.600 1.600 Koffset 1000 -0.10 -0.10 -0.100 -0.100 Zsoil 1 2000.00 1600.00 1550.000 1550.000 ... ... ... ... ... ... Kcmax 1000 1.15 1.15 1.15 1.15 Fc_stop 1000 0.15 0.15 0.15 0.15 Start_date_Irr 1 0.00 0.00 0.00 0.00 p_trigger 1 0.00 0.00 0.00 0.00
- .table:
Methods
This object is used to build a raster for each parameter (spatialized parameters) in the SAMIR functions.