Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A report is due for this practical work. Load your report within your group repository in
Chamilo for the 27th October at the latest.
b) To understand the simple common interpolation methods: nearest neighbour method and inverse
distance weighting.
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")
We want now to visualize the location of the raingauge stations and the sub-bassin of interest with
the following commands
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
We now perform the interpolation on all grid nodes using the nearest neighbour method.
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="")
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.
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.
Figure 2: Thiessen polygons obtained with seven stations for the Reuss catchment
ACF+GE/25.09.2017