by Didier Renard » Thu Dec 13, 2012 11:32 am
Hi Celeste
Now I understand your question correctly.
As a matter of fact, my example was slightly too short as far as the explanations are concerned.
I recall my example first:
a <- db.create(flag.grid=T,nx=c(100,100,100))
a <- simtub(,a,model=model,nbtuba=1000)
dbmap <- vmap.grid(a,nx=30,ny=30)
dbmap <- vmap.grid(a,dbmap)
In the first line, I created a NEW (empty) grid Db (called "a") specifying its geometry (number of nodes, grid mesh, ...)
In the second line, I performed a Simulation using the Turning Bands method of a Random Function obeying to the variogram model (contained in the file "model").
This simulation is non-conditional (non conditionned by any data) as I simply wanted to reproduce the texture of the Random Function. The only parameter
that was specified is the number of bands used by the algorithm (argument "nbtuba"). The result of this simulation is atcked within the Grid Db (called "a").
Note that if you run this procedure several times, the different simulation outcomes will be stacked in the same Grid Db.
In the third line, I wanted to compute the variogram map using the fast FFT algorithm. The VMAP result is a regular grid.
I decided to create the VMAP grid (called "dbmap") specifying its geometry (nx=30 and ny=30). The VMAP grid must be "compatible"
with the grid containing the variable from which we wish to calculate the variogram map. This means that they must share:
- the space dimension
- the mesh of the grid in all directions
Only the count of meshes can be different.
Finally in the fourth line, I computed the VMAP of the variable contained in the Grid Db (called "a" and used as the first argument)
and stored it in the VMAP Db (called "dbmap"). Note that, as in many modules of RGeoS, there is no need to specify the variable (within the Grid Db "a")
on which the calculations should be performed: they are ALWAYS performed on the variable which is asigned the locator "z1".
Hope this will help.