--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/secrgroup/cb191f07-f2a4-43dd-94a7-c0cfc830722d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Chris
To unsubscribe from this group and stop receiving emails from it, send an email to secr...@googlegroups.com.
So I think the way to do this is the following:
- Make the resolution of the ‘density mask’ the resolution you would like for the cost surface
- Make the buffer of the ‘density mask’ larger such that all reasonable paths (i.e., least cost paths from activity centers of individuals with non-zero cap prob to the detectors) are contained within it
Chris
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/secrgroup/44354e44-bd71-420a-9f6e-804e23c27eca%40googlegroups.com.
## Apply user-provided distance function or matrix
## do not use if detector is one of
## polygonX, polygon, transectX, transect, telemetry
## The matrix distmat is passed to the C function secrloglik, etc.
if (is.null(details$userdist))
distmat <- -1
else {
if (is.null(covariates(session.mask)))
covariates(session.mask) <- data.frame(row.names = 1:m)
if ('noneuc' %in% userdistnames)
covariates(session.mask)$noneuc <- NE[1:m,,min(dim(NE)[3],sessnum)]
if ('D' %in% userdistnames)
covariates(session.mask)$D <- density
## pass miscellaneous unmodelled parameter(s)
if (nmiscparm > 0)
attr(session.mask, 'miscparm') <- miscparm
distmat <- valid.userdist (details$userdist,
detector(session.traps),
xy1 = session.traps,
xy2 = session.mask,
mask = session.mask,
sessnum = sessnum)
baddist <- (!is.finite(distmat)) | (distmat<0) | is.na(distmat)
if (any(baddist)) {
warning ("replacing infinite, negative and NA userdist values with 1e10")
distmat[baddist] <- 1e10
}
}
valid.userdist <- function (userdist, detector, xy1, xy2, mask, sessnum) {
if (is.null(userdist)) {
## default to Euclidean distance
result <- edist(xy1, xy2)
}
else {
if (any(detector %in% .localstuff$polydetectors)) {
stop ("userdist cannot be used with polygon detector types;")
}
if (is.function(userdist))
{
OK <- getuserdistnames(userdist) %in% names(covariates(mask))
if ((length(OK)>0) & !all(OK))
stop ("covariates required by userdist function not in mask : ",
paste(getuserdistnames(userdist)[!OK], collapse=','))
result <- do.call(userdist, c(list(xy1, xy2, mask)))
}
else {
if (is.character(userdist)) {
userdist <- get(userdist, pos=-1)
}
if (is.list(userdist) & !is.data.frame(userdist)) {
if (missing(sessnum))
stop("This use does not yet allow for session-specific userdist")
else
result <- userdist[[sessnum]]
}
else {
result <- userdist
}
}
if (!all(dim(result) == c(nrow(xy1), nrow(xy2))))
stop ("invalid distance matrix dim = ", dim(result)[1], ',', dim(result)[2])
baddist <- (!is.finite(result)) | (result<0) | is.na(result)
if (any(baddist)) {
warning ("replacing infinite, negative and NA userdist values with 1e10")
result[baddist] <- 1e10
}
}
result
}