writeToXDMF: Write 3D MKDE to XDMF XML wrapper and binary data file.

View source: R/mkdeFunctions.R

writeToXDMFR Documentation

Write 3D MKDE to XDMF XML wrapper and binary data file.

Description

Write the MKDE to a XDMF files.

Usage

writeToXDMF(mkde.obj, fname, nodat="NA", cumprob=FALSE)	

Arguments

mkde.obj

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

fname

The path and base file name for output XDMF files

nodat

A no data character string that will be written in place of no data values.

cumprob

Indicate whether to write the voxel probabilities of cumulative probabilities.

Details

This function writes XDMF XML wrapper and binary data file.

Value

No value is returned

Author(s)

Jeff A. Tracey, PhD
USGS Western Ecological Research Center, San Diego Field Station
jatracey@usgs.gov
James Sheppard, PhD
San Diego Zoo Institute for Conservation Research
jsheppard@sandiegozoo.org
Amit Chourasia, MS
San Diego Supercomputer Center
amit@sdsc.edu

Examples

library(raster)
data(condor)
condor <- condor[1:20,] # 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)
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

# Write file (note no file extension!)
writeToXDMF(mkde.obj, "condor_3dMKDE")

# Clean up files
unlink("condor_3dMKDE.dat")
unlink("condor_3dMKDE.xdmf")

mkde documentation built on July 9, 2023, 6:41 p.m.