Sei sulla pagina 1di 4

Water Management in a non stationary environment

BE interpolation 29 September 2017

Exploratory analysis of a rainfall event in Switzerland.


Interpolation methods of this event on the Reuss catchment.

A report is due for this practical work. Load your report within your group repository in
Chamilo for the 27th October at the latest.

The objectives of this tutorial are as follows:

a) To be able to process an exploratory analysis with and to interpret the results.

b) To understand the simple common interpolation methods: nearest neighbour method and inverse
distance weighting.

c) To be able to compute the mean rainfall on a catchment using several methods.

d) To compare the interpolated maps and the mean rainfall obtained with several raingauges densities.

Ex. 1 Exploratory analysis In this practical work we use three libraries of the gstat package and we
have first to call them with the commands

> library(gstat)
> library(sp)
> library(FNN)

We have to download the data called BE1.Rdata from Chamilo and store it in a folder. We import
the data in the session using the command

> # either change the current directory in R or set the path in the load command
> load("BE1.Rdata")

What type of object is df.P.200 ?


What is the size of this object ?
What are in the different columns ?
Extract the names of the raingauge stations.

We want now to visualize the location of the raingauge stations and the sub-bassin of interest with
the following commands

> # regular grid on the Swiss territory


> plot(grd,xlab="X-coordinates", ylab="Y-coordinates")
> # add the border of the Reuss catchment
> plot(basin.sp,border="maroon",lwd=2,add=T)
> # position of the raingauge stations
> points(df.P.200$x,df.P.200$y,cex=df.P.200$P/20,pch=19,col="blue")
> # legend
> legend("topleft",legend=c("10mm","50mm"), pch=19, col="blue",pt.cex=c(10,50)/20,bty="n")
Why is the options cex=df.P.200$P/20 used in the command points
Comment this event of precipitation.

The objective now is to make an exploratory analysis of the rainfall event (20th of November 2015)
for the 200 raingauge stations with the following steps :

Compute several statistical characteristics (min, max, mean, median, variance, interquartile-
range...)
Draw an histogram
Draw a boxplot
Draw a qqplot
Draw the empirical cumulative distribution function

Comment the results of the exploratory analysis.

Ex. 2 Interpolation methods on the Reuss catchment


We want now to interpolate this rainfall event on the Reuss catchment. We first visualize the
raingauge stations location with the following commands

> # set the color palette


> prec.palette <- colorRampPalette(c("white", "blue","yellow","red"), space = "rgb")
> # watershed border
> plot(basin.sp,border="maroon",xlab="X-coordinates", ylab="Y-coordinates")
> # location of the raingauge stations
> points(df.P.33$x,df.P.33$y,cex=df.P.33$P/20,pch=19,col="blue")
> # regular grid
> plot(grd,add=T)
> # legend
> legend("topleft",legend=c("10mm","50mm"),pch=19, col="blue", pt.cex=c(10,50)/20,bty="n")

We now perform the interpolation on all grid nodes using the nearest neighbour method.

> # get.knnx find the nearest neightbours (librarie KNN)


> knn.out = get.knnx(cbind(df.P.33$x,df.P.33$y), grd@coords, k=1)
> # rainfall for all grid points
> vec.P.knn = df.P.33$P[knn.out$nn.index]
># objet SpatialPixelsDataFrame
> grd.knn = SpatialPixelsDataFrame(grd,data.frame(P=vec.P.knn))
> # figure
> layout(matrix(c(1,2), nrow=1, ncol=2), widths=c(4,1), heights=c(1))
> image(grd.knn, col = prec.palette(100),asp=1, xlim=c(630000,720000),ylim=c(150000,270000),
xlab="X-coordinates", ylab="Y-coordinates")
> plot(basin.sp,border="maroon",lwd=2,add=T)
> points(df.P.33$x,df.P.33$y,cex=df.P.33$P/20,pch=19,col="black")
> breaks <- seq(min(grd.knn@data$P), max(grd.knn@data$P),length.out=100)
> image.scale(grd.knn@data$P, col=prec.palette(length(breaks)-1), breaks=breaks,
horiz=F,xlab="",ylab="")

Comment the obtained results.


Is this interpolation method accurate for precipitation?

We now perform the interpolation on all grid nodes using the inverse distance weighting (idw)
method.
> coordinates(df.P.33) = c("x","y")
> grd.idw = idw(P~1, locations = df.P.33, newdata = grd)
> # figure
> layout(matrix(c(1,2), nrow=1, ncol=2), widths=c(4,1), heights=c(1))
> image(grd.idw, col = prec.palette(100),
xlim=c(630000,720000),ylim=c(150000,270000),
xlab="X-coordinates", ylab="Y-coordinates")
> plot(basin.sp,border="maroon",lwd=2,add=T)
> points(df.P.33$x,df.P.33$y,cex=df.P.33$P/20,pch=19,col="black")
> breaks <- seq(min(grd.idw@data$var1.pred), max(grd.idw@data$var1.pred),length.out=100)
> image.scale(grd.idw@data$var1.pred, col=prec.palette(length(breaks)-1), breaks=breaks,
horiz=F,xlab="",ylab="")

Comment the obtained results.


Compare the idw map with the nearest neighbour map.

The objective is to compute the mean rainfall on the watershed using the nearest neighbour, the
inverse distance method and Thiessen polygons. Thiessen polygons are illustrated in Figure 1.

Figure 1: Thiessen polygons for the Reuss catchment

> # selection of the grids points inside the watershed


> coords.basin = basin.sp@polygons[[1]]@Polygons[[1]]@coords
> coords.grd = grd@coords
> is.grd.in.basin = point.in.polygon(coords.grd[,1],coords.grd[,2],
coords.basin[,1],coords.basin[,2])
> # nearest neighbour method
> P.knn <- P.knn <-mean(grd.knn@data$P[as.logical(is.grd.in.basin)])
> # inverse distance
> P.idw <- mean(grd.idw@data$var1.pred[as.logical(is.grd.in.basin)])
> # thiessen polygons
> Thiessen.Weights
> print(sum(Thiessen.Weights))
> P.TW <- sum(Thiessen.Weights*df.P.33$P)

Sort the Thiessen weights. What is the maximum weight ? To which polygon does it corre-
spond ?
Why are some Thiessen weights equal to zero ?
Compare the obtained results.

Ex. 3 Interpolation methods on the Reuss catchment using a subsample of stations


Same exercie as in exercice 2 using a subsample of seven stations indicated in Table 1.

Raingauge station Thiessen weight


Otelfingen 0.02835106
Disentis / Sedrun 0.21261932
Sarnen 0.40214280
Cham 0.10815601
Mettmenstetten 0.04814000
Sattel-Aegeri 0.18909495
Trun 0.01149586

Table 1: Name of the raingauge stations and associated weight

Figure 2 shows Thiessen polygons obtained with these stations.

Figure 2: Thiessen polygons obtained with seven stations for the Reuss catchment

Comment all the obtained results.


What is the effect of changing the raingauge density?

ACF+GE/25.09.2017

Potrebbero piacerti anche