Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
swatdoctr
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christoph Schürz
swatdoctr
Commits
7943cc15
Commit
7943cc15
authored
2 years ago
by
Svajunas Plunge
Browse files
Options
Downloads
Patches
Plain Diff
plot_qtile updated
parent
45810f3f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
R/plot_ps_tile.R
+16
-3
16 additions, 3 deletions
R/plot_ps_tile.R
template.Rmd
+3
-3
3 additions, 3 deletions
template.Rmd
with
19 additions
and
6 deletions
R/plot_ps_tile.R
+
16
−
3
View file @
7943cc15
...
...
@@ -110,15 +110,28 @@ print_avannual_qtile <- function(sim_verify,
plot_qtile
<-
function
(
sim_verify
,
exclude_lum
=
c
(
"urhd_lum"
,
"urmd_lum"
,
"urml_lum"
,
"urld_lum"
,
"ucom_lum"
,
"uidu_lum"
,
"utrn_lum"
,
"uins_lum"
,
"urbn_lum"
)){
df
<-
print_avannual_qtile
(
sim_verify
,
exclude_lum
)
df
<-
sim_verify
$
hru_wb_aa
%>%
rename
(
id
=
unit
)
%>%
left_join
(
.
,
sim_verify
$
lum_mgt
,
by
=
"id"
)
%>%
filter
(
tile
!=
'null'
)
hru_frac
<-
paste0
(
as.character
(
round
(
100
*
count
(
df
)
/
count
(
sim_verify
$
hru_wb_aa
),
2
)),
" % HRUs are drained in this catchment."
)
df
<-
df
%>%
filter
(
!
lu_mgt
%in%
exclude_lum
)
%>%
select
(
id
,
qtile
,
lu_mgt
,
mgt
,
soil
)
%>%
arrange
(
qtile
,
id
)
fig
<-
ggplot
(
df
,
aes
(
x
=
qtile
))
+
geom_histogram
(
aes
(
y
=
..
density
..
),
color
=
"black"
,
fill
=
"blue"
,
breaks
=
seq
(
min
(
df
$
qtile
),
max
(
df
$
qtile
),
10
))
+
geom_histogram
(
aes
(
y
=
after_stat
(
density
)
),
color
=
"black"
,
fill
=
"blue"
,
breaks
=
seq
(
min
(
df
$
qtile
),
max
(
df
$
qtile
),
10
))
+
geom_density
(
alpha
=
.3
,
fill
=
"white"
,
linewidth
=
1
,
color
=
"grey25"
,
linetype
=
"twodash"
)
+
labs
(
title
=
"Tile drain flow density mm/year"
)
+
labs
(
title
=
"Tile drain flow density mm/year"
,
subtitle
=
hru_frac
,
caption
=
"Data in the figure represents only HRUs with active tile drainage."
)
+
theme_bw
()
+
theme
(
panel.border
=
element_blank
(),
axis.line
=
element_line
(
color
=
'black'
),
axis.title.x
=
element_blank
())
return
(
fig
)
}
This diff is collapsed.
Click to expand it.
template.Rmd
+
3
−
3
View file @
7943cc15
...
...
@@ -6,7 +6,7 @@
</style>
---
title: "
Your title
"
title: "
Jeziorka catchment
"
author: "name surname"
affiliation: "your affiliation"
email: "your@email"
...
...
@@ -41,7 +41,7 @@ add_kill_op(model_path)
##Running loop to get and save run_swat_verification function output for different plant stress options
for(ns in c(0:2)){
saveRDS(run_swat_verification(project_path = model_path, outputs = c('wb', 'mgt', 'plt'),
nostress = ns, keep_folder = TRUE), file = rpath[[ns]])}
nostress = ns, keep_folder = TRUE), file = rpath[[ns
+1
]])}
```
Before starting model verification `run_swat_verification()`results should be loaded in the memory. The first two steps require function results without plant stresses activate (`nostress = 1`).
...
...
@@ -149,7 +149,7 @@ if(length(mgt_report$schedule)>=sel_nb){
Selected case can be examined in figures plotting selected HRU variables. Following variables are available for plotting.
- *lai m^2/m^2 |average leaf area index during timestep*
- *lai m^2
^
/m^2
^
|average leaf area index during timestep*
- *bioms kg/ha |average total plant biomass during timestep*
- *yield kg/ha |harvested biomass yield (dry weight) during timestep*
- *residue kg/ha |average surface residue cover during timestep*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment