interpolationpoints: Interpolates daily meteorology over a landscape

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Interpolates meteorological data on spatial points/pixels/grid using an object of class MeteorologyInterpolationData-class.

Usage

1
2
3
4
5
6
7
8
9
interpolationpoints(object, points, dates = NULL, export = FALSE,
                    exportDir = getwd(), exportFormat = "meteoland/txt",
                    metadatafile = "MP.txt", verbose=TRUE)
interpolationpixels(object, pixels, dates, export = FALSE,
                  exportDir=getwd(), exportFormat = "netCDF",
                  metadatafile = "MG.txt", verbose=TRUE)
interpolationgrid(object, grid, dates, export = FALSE,
                  exportDir=getwd(), exportFormat = "netCDF",
                  metadatafile = "MG.txt", verbose=TRUE)

Arguments

object

An object of class MeteorologyInterpolationData-class.

points

An object of class SpatialPointsTopography-class.

pixels

An object of class SpatialPixelsTopography-class representing the target landscape.

grid

An object of class SpatialGridTopography-class representing the target landscape.

dates

An object of class Date. If this is NULL then all dates in object are processed.

export

If export = FALSE the result of interpolation is stored in memory. Otherwise the result is written in the disk (using the format specified in exportFormat).

exportDir

Output directory for interpolated meteorology data.

exportFormat

Export format for meteorological data (see writemeteorologypoint).

metadatafile

The name of the ascii text file that will store the meta data describing all written files.

verbose

Boolean flag to print process information.

Details

If CRS projection is different between object and points/pixels/grid, the function transforms the coordinates of points/pixels/grid to adapt them to the CRS of object.

Value

If export = FALSE, function interpolationpoints returns an object of SpatialPointsMeteorology-class. If export = TRUE, the function returns an object of class SpatialPointsDataFrame-class containing the meta data of the files written in the disk.

If export = FALSE, function interpolationpixels returns an object of SpatialPixelsMeteorology-class. If export = TRUE, the function writes the results in files and a data.frame with columns 'dir' and 'filename' is returned.

If export = FALSE, function interpolationgrid returns an object of SpatialGridMeteorology-class. If export = TRUE, the function writes the results in files and a data.frame with columns 'dir' and 'filename' is returned.

Author(s)

Miquel De Cáceres Ainsa, CTFC

References

Thornton, P.E., Running, S.W., White, M. A., 1997. Generating surfaces of daily meteorological variables over large regions of complex terrain. J. Hydrol. 190, 214–251. doi:10.1016/S0022-1694(96)03128-9.

De Caceres M, Martin-StPaul N, Turco M, Cabon A, Granda V (2018) Estimating daily meteorological data and downscaling climate models over landscapes. Environmental Modelling and Software 108: 186-196.

See Also

penman, SpatialPointsTopography-class, SpatialGridTopography, SpatialPixelsTopography, MeteorologyInterpolationData

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
data(examplegridtopography)
data(exampleinterpolationdata)

####### INTERPOLATION on particular POINTS 

#Creates spatial topography points from the grid
p = 1:2
spt = as(examplegridtopography, "SpatialPointsTopography")[p]

#Interpolation of two points for the whole time period (2000-2003)
mp = interpolationpoints(exampleinterpolationdata, spt)

#Plot interpolated meteorological series
meteoplot(mp,1, ylab="Mean temperature")

####### INTERPOLATION on PIXELS 
# Creates spatial topography pixels as a subset of grid pixels
# and select pixels at maximum distance of 2km from center
spt = as(examplegridtopography,"SpatialPointsTopography")
cc = spt@coords
center = 5160
d = sqrt((cc[,1]-cc[center,1])^2+(cc[,2]-cc[center,2])^2)
spxt = as(spt[which(d<2000)], "SpatialPixelsTopography") 

# Interpolation of meteorology over pixels for two days
ml = interpolationpixels(exampleinterpolationdata, spxt,
                       as.Date(c("2001-02-03", "2001-06-03")))
                       
#Plot PET corresponding to 2001-06-03
spplot(ml,2,"PET")

####### INTERPOLATION over a complete GRID 
#Interpolation of meteorology over a grid for two days
ml = interpolationgrid(exampleinterpolationdata, examplegridtopography,
                       as.Date(c("2001-02-03", "2001-06-03")))
#Plot PET corresponding to 2001-06-03
spplot(ml,2,"PET")

miquelcaceres/meteoland documentation built on May 8, 2019, 11:57 p.m.