resample-scidbst-methods: Regrid / Resample operator for scidbst objects

Description Usage Arguments Value Note See Also Examples

Description

This function changes the resolution of certain dimensions of the scidbst object. 'Regrid' is in this case the targeted scidb operation and reflects a more general regrid approach. 'Resample' is based on the respective function of the raster package. The latter will simply perform a regrid on the spatial dimensions. The grid parameter reflects the number of cells per dimension that are used as a block for resampling. As for the current development of scidb, the aggregation functions are quite limited (min/max, average, sum, standard deviation) and do not support more elaborated function like bilinear interpolation. The resample method performs the same operation as regrid, but it is limited to change the spatial resoultion.

Usage

1
2
3
4
5
6
7
8
## S4 method for signature 'scidbst'
regrid(x, grid, expr)

## S4 method for signature 'scidbst,Raster'
resample(x, y, af = "avg")

## S4 method for signature 'scidbst,scidbst'
resample(x, y, af = "avg")

Arguments

x

The scidbst object

y

target object

af

(optional) aggregation function applied to every attribute on the grid, or a quoted SciDB aggregation expression

Value

scidbst object with new resolution information (adapted affine transformation)

Note

For information on the aggregation statements in scidb have a look on the supported AFL functions (SciDB 15.12 Doc). To make the query formulation easier we allow also to pass the aggregation function name of the AFL function as parameter "af", which will be used on all attributes.

See Also

regrid,scidb-method for original regrid function, resample for the original resample function

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
scidbconnect(...)
scibdst.obj = scidbst(array_name)
# 50x50 upscaling with scidb expression as aggregation function
regridded = regrid(scidbst.obj,c(50,50,1),"avg(attribute1)") #resample (upscaling 50x50 dimension units, here dimensions: y,x,time)
# 50x50 upscaling with sum aggregation function
regridded = regrid(scidbst.obj,c(50,50,1),sum) #resample (upscaling 50x50 dimension units, here dimensions: y,x,time)

r = raster(scidbst.obj, nrows=300, ncols=200) # resample by setting the number of rows and columns of the target
resampled = resample(scidbst.obj,r,"avg(attribute1)")
resampled2 = resample(scidbst.obj,r,"sum") # aggregation function applied on all attributes

## End(Not run)

flahn/scidbst documentation built on May 16, 2019, 1:15 p.m.