Skip to content

Commit 14106f8

Browse files
Vignettes updated and working
1 parent 940868f commit 14106f8

12 files changed

+193
-209
lines changed

vignettes/Catchment_avg_ET_rainfall.Rmd

Lines changed: 176 additions & 189 deletions
Large diffs are not rendered by default.

vignettes/Catchment_avg_ET_rainfall.Rmd.orig

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,6 @@ The estimation of ET is undertaken within _AWAPer_ using the _evapotranspiration
5858
data(constants,package='Evapotranspiration')
5959
```
6060

61-
## Map the catchment boundaries
62-
To check that the catchment boundaries are located as expected, they are plotted over the DEM using the _raster_ package.
63-
64-
```{r}
65-
sp::plot(catchments, add =T)
66-
with(catchments[1,], text(sp::coordinates(catchments)[1,1],sp::coordinates(catchments)[1,2],
67-
labels = catchments$CatchID[1], pos = 1))
68-
with(catchments[2,], text(sp::coordinates(catchments)[2,1],sp::coordinates(catchments)[2,2],
69-
labels = catchments$CatchID[2], pos = 2))
70-
```
71-
7261
## Extract and map weekly total precipitation
7362
Here two features of _AWAPer_ are demonstrated: (i) the temporal aggregation of data, here set to weekly and (ii) the extraction of catchment spatial patterns. The first command extracts only precipitation data over the two catchments and calculates the weekly totals. The latter commands map the weekly precipitation.
7463

@@ -84,9 +73,11 @@ To extract the weekly total precipitation, _temporal.timestep_ is set to _'weekl
8473
weeklyPrecipData = extractCatchmentData(ncdfFilename=netCDF_filename,
8574
ncdfSolarFilename=netCDF_solar_filename,
8675
extractFrom=date.from, extractTo=date.to,
87-
catchments=catchments,
88-
getTmin = F, getTmax = F, getVprp = F, getSolarrad = F, getET = F,spatial.function.name = '',
89-
temporal.timestep = 'weekly', temporal.function.name = 'sum')
76+
locations=catchments,
77+
getTmin = F, getTmax = F, getVprp = F, getSolarrad = F, getET = F,
78+
spatial.function.name = '',
79+
temporal.timestep = 'weekly',
80+
temporal.function.name = 'sum')
9081

9182

9283
v = list("sp.polygons", catchments, col = "red",first=FALSE)
@@ -103,7 +94,7 @@ Here the estimation of PET was undertaken using Morton's wet-environment areal e
10394
climateData.daily = extractCatchmentData(ncdfFilename=netCDF_filename,
10495
ncdfSolarFilename=netCDF_solar_filename,
10596
extractFrom=date.from, extractTo=date.to,
106-
catchments=catchments, temporal.timestep = 'daily',
97+
locations=catchments, temporal.timestep = 'daily',
10798
temporal.function.name='sum',spatial.function.name='var',
10899
getTmin=T, getTmax=T, getVprp=T, getSolarrad=T, getET=T,
109100
ET.function='ET.MortonCRAE', ET.timestep = 'monthly',
@@ -135,8 +126,11 @@ for (i in 1:length(catchments$CatchID)) {
135126
# Rainfall
136127
plot(climateData.daily.date,
137128
climateData.daily$catchmentTemporal.sum$precip_mm[filt],
138-
type = "h", col = "#e31a1c", lwd = 3, mgp = c(2, 0.5, 0), ylim = c(0, 80), main=paste('Catchment ID',catchments$CatchID[i]),
139-
ylab = "", xlab = "2010", xaxs = "i", yaxt = "n", bty = "l", yaxs = "i")
129+
type = "h", col = "#e31a1c", lwd = 3, mgp = c(2, 0.5, 0),
130+
main=paste('Catchment ID',catchments$CatchID[i]),
131+
ylim = c(0, 80), ylab = "", xlab = "2010", xaxs = "i",
132+
yaxt = "n", bty = "l", yaxs = "i")
133+
140134
axis(side = 2, mgp = c(2, 0.5, 0), line = 0.5, at = seq(from = 0, to = 80, by = 20),
141135
labels = c("0", "20", "40", "60", "80mm"), col = "#e31a1c", col.axis = "#e31a1c")
142136

@@ -152,9 +146,12 @@ for (j in 1:length(climateData.daily.date)) {
152146

153147
# Plot evap data.
154148
par(new = TRUE)
155-
plot(climateData.daily.date, climateData.daily$catchmentTemporal.sum$ET_mm[filt], col = "#bc80bd", lwd = 2, ylab = "",
156-
ylim = c(0, 4), lty = 1, xlab = "", xaxs = "i", yaxt = "n", xaxt = "n", type = "l", bty = "n", yaxs = "i")
157-
axis(side = 2, line = 2.3, mgp = c(2, 0.5, 0), labels = c("0", "1", "2", "3", "4mm"), at = seq(from = 0, to = 4, by = 1), col = "#bc80bd", col.axis = "#bc80bd")
149+
plot(climateData.daily.date, climateData.daily$catchmentTemporal.sum$ET_mm[filt],
150+
col = "#bc80bd", lwd = 2, ylab = "", ylim = c(0, 4), lty = 1,
151+
xlab = "", xaxs = "i", yaxt = "n", xaxt = "n", type = "l", bty = "n", yaxs = "i")
152+
153+
axis(side = 2, line = 2.3, mgp = c(2, 0.5, 0), labels = c("0", "1", "2", "3", "4mm"),
154+
at = seq(from = 0, to = 4, by = 1), col = "#bc80bd", col.axis = "#bc80bd")
158155

159156
# Legend
160157
legend("topleft", cex = 0.8, lwd = 2, bty = "n", inset = c(0.01, -0.01),
6.79 KB
Loading
8.69 KB
Loading
5.32 KB
Loading
7.92 KB
Loading

vignettes/unnamed-chunk-5-1.png

-17.3 KB
Binary file not shown.

vignettes/unnamed-chunk-6-1.png

-7.79 KB
Binary file not shown.

0 commit comments

Comments
 (0)