writeToVTK: Write MKDE to an ASCII Visualization Tool Kit (VTK)...

Description Usage Arguments Details Value Author(s) Examples

View source: R/mkdeFunctions.R

Description

Write the MKDE to a VTK file.

Usage

1
writeToVTK(mkde.obj, fname, description="3D MKDE", cumprob=FALSE)

Arguments

mkde.obj

3D MKDE object created with initialize3DMKDE and density initialized with initializeDensity

fname

The patch and file name for output VTK file

description

A character string with a brief description that will be placed in the header of the VTK file

cumprob

Indicate whether to write the voxel probabilities of cumulative probabilities.

Details

This function writes a VTK structured grid file for a 3D MKDE that can be used in 3D visualization tools such as MayaVI or ParaView

Value

No value is returned

Author(s)

Jeff A. Tracey, PhD
USGS Western Ecological Research Center, San Diego Field Station
[email protected]
James Sheppard, PhD
San Diego Zoo Institute for Conservation Research
[email protected]

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
library(raster)
data(condor)
condor <- condor[1:10,] # simply to make example run more quickly
mv.dat <- initializeMovementData(condor$time, condor$x, condor$y, 
z.obs=condor$z, sig2obs=25.0, sig2obs.z=81.0, t.max=65.0)

data(condordem120)
# next two lines reduce extent of 2D space to speed execution of example
tmp <- extent(c(range(condor$x) + c(-100, 100), range(condor$y) + c(-100, 100)))
condordem120 <- crop(condordem120, tmp)

cell.sz <- mean(res(condordem120))
ext <- extent(condordem120)
nx <- ncol(condordem120)
ny <- nrow(condordem120)
mkde.obj <- initializeMKDE3D(ext@xmin, cell.sz, nx, ext@ymin, cell.sz,
ny, min(values(condordem120), na.rm=TRUE), cell.sz, 25)

# note: we use a raster coarse integration time step so the
# example runs faster
dens.res <- initializeDensity(mkde.obj, mv.dat, integration.step=10.0)
mkde.obj <- dens.res$mkde.obj
mv.dat <- dens.res$move.dat

# Save as VTK file
writeToVTK(mkde.obj, "condor_3dMKDE.vtk",
description="Example California condor 3D MKDE")

mkde documentation built on May 2, 2019, 6:46 a.m.