I am using QGIS 2.6 Brighton.
I am trying to run a Gavrilovic model in the modeller in QGIS. FYI: Gavrilovic model is a set of Imperical equations for sediment yield analysis.
The equations are as follows:
W = T * h * [pi] * sqrt(z^3) ..1
T = sqrt ( t/10 + 0.1 ) ..2
z = x * y * ( [phi] + sqrt (J) ) ..3
What I have in QGIS ?
I have raster layers of t
, h
, x
, y
, [phi]
, J
.
What do I need to do ?
- Calculate
z
as in equation 3; I have all required variables as rasters. - Calculate
T
fromt
as in equation 2. - Calculate
W
. - Now I need to change the values of
t
andh
rasters. Lets say for example, the existing values oft
need to be first changed by-15%, -10%, -5%, +5%, +10%, +15%.
And run the equations again to evaluate what will be the changes inW
with respect to change int
. Similar forh
. - Again I need to evaluate
W
for-15%, -10%, -5%, +5%, +10%, +15%
change inh
for each change int
.
To elaborate point no. 4 and 5.
Let us assume each raster has 4 cells. And these be the initial values of t and h.
t = 10, 12, 15, 12
h = 110, 100, 140, 90
Now for the sensitivity test, I need the values of t changed by -15%, -10% , -5%, +5%, +10%, +15%. And similar for h. 6 new
t
rasters will be created according to the percentage change and the values will be as follows fort
.
col A B C D E F G
initial_t -15% -10% -5% +5% +10% +15%
10 8.5 9 9.5 10.5 11 11.5
12 1.7 1.8 1.9 2.1 2.2 2.3
15 12.75 13.5 14.25 15.75 16.5 17.25
12 10.2 10.8 11.4 12.6 13.2 13.8
Similarly 6 new
h
rasters will be created, as follows:
col 1 2 3 4 5 6 7
initial_h -15% -10% -5% +5% +10% +15%
110 93.5 99 104.5 115.5 121 126.5
100 85 90 95 105 110 115
140 119 126 133 147 154 161
90 76.5 81 85.5 94.5 99 103.5
Now, I need to run equations 1 to 3
taking t
and h
in following fashion:
for p = col A to col G {
for q = col 1 to col 7 {
run equation 3
run equation 2
run equation 1
}
}
Note: I've heard changing values of raster and running this algorithm is easier in graphics modeller.
If not, I can create those 6 new rasters for t and h myself. I can use R for that. However if it can be done in QGIS (other than using raster calculator) it would be great if you can share the idea.
I need someone to tell me how can I set up a Graphics modeller
and perform these operations.
I am not familiar with python but I can find my way writing the code.