使用“移动”包计算突发利用率分布的体积面积

如何解决使用“移动”包计算突发利用率分布的体积面积

我将 brownian.bridge.dyn() 函数应用于“MoveBurst”对象。然后我重新标准化了这个对象,以便突发段总和为 1 并避免舍入问题。我现在想使用 getVolumeUD() 函数计算 UD 的体积,但这似乎不起作用,因为重新标准化的 UD 属于“list”类。

代码如下:

library(move)
    
move.ind <- move(x=ind$Lon,y=ind$Lat,time=ind$Datetime,proj=CRS("+proj=longlat +datum=WGS84"),data=ind,animal=ind$Tag,sensor="VR2W")

move.ind$LocationError = 1 

r.ind <- spTransform(move.ind,center=TRUE)

TimeDiff <- timeLag(r.ind,units="hours")
r.ind$TimeDiff <- append(0,TimeDiff)

e <- 5000
xUTM.ind <- raster(xmn=min(ind$NewEastingUTM)-e,xmx=max(ind$NewEastingUTM)+e,ymn=min(ind$NewNorthingUTM)-e,ymx=max(ind$NewNorthingUTM)+e,crs =CRS("+proj=utm +zone=17 +datum=WGS84"),resolution=50)

x.ind <- raster(xmn=min(DET$NewEastingUTM),xmx=max(DET$NewEastingUTM),ymn=min(DET$NewNorthingUTM),ymx=max(DET$NewNorthingUTM),crs=CRS("+proj=utm +zone=17 +datum=WGS84"))
proj4string(x.ind)

newTemplate <- projectExtent(xUTM.ind,proj4string(x.ind))

ones = rep(1,(newTemplate@ncols*newTemplate@nrows))
xAEQD.ind <- setValues(newTemplate,ones)

rNew.ind <- spTransform(r.ind,proj4string(xAEQD.ind))

bursted <- burst(rNew.ind,c('normal','long')[1+(timeLag(rNew.ind,units = 'hours')>4)]) 

bursted_dbbmm <- brownian.bridge.dyn(bursted,burstType='normal',raster = xAEQD.ind,location.error = "LocationError",time.step = 5,ext = 3,window.size = 29)

tmp <- calc(bursted_dbbmm,sum)
dbbmmlist <- new(".UD",tmp/sum(values(tmp)))

cont.ind <- getVolumeUD(dbbmmlist)

伪代码如下所示:

ind <- structure(list(Datetime = structure(c(1343535240,1343539560,1343543880,1343548200,1343622480,1343625120,1343628540,1343630280,1343634600,1343640660,1343644980,1343655360,1343656200,1343661360,1343665680,1343671740,1343707200,1343709780,1343711520,1343714100,1343715840,1343717520,1343718420,1343721000,1343721840,1343722740,1343723580,1343725320,1343727060),class = c("POSIXct","POSIXt"),tzone = "US/Eastern"),Tag = c(437L,437L,437L),Lat = c(25.73785,25.73779,25.73822,25.73803,25.7387,25.73772,25.73842,25.73759,25.73693,25.73765,25.73781,25.73819,25.73975,25.73766,25.73758,25.73799,25.74314,25.73943,25.74317,25.7407,25.74324,25.73739,25.74175,25.71287,25.73699,25.73749,25.74292,25.73809,25.743,25.74249
),Lon = c(-79.24489,-79.24543,-79.24039,-79.24479,-79.24606,-79.24551,-79.23763,-79.24604,-79.24535,-79.24622,-79.24678,-79.24583,-79.24725,-79.2454,-79.24459,-79.24632,-79.24553,-79.24629,-79.24731,-79.24647,-79.24724,-79.24652,-79.24577,-79.24749,-79.24636,-79.24537,-79.24547,-79.24742,-79.24582,-79.2464,-79.24771),NewEastingUTM = c(676052.593850702,675998.505006306,676503.524589617,676062.361342852,675933.957732871,675990.581885337,676780.134256345,675937.599356069,676007.79854611,675919.451865544,675863.032391998,675957.784408548,675813.022339476,676001.706417219,676082.426966281,675909.522121439,675988.177486275,675904.342388974,675807.473799857,675886.239923252,675812.627071404,675881.120633141,675964.982682709,675786.000042484,675941.884041032,676005.703553397,675994.93392188,675791.30042537,675958.935010342,675893.512994838,675762.839399625),NewNorthingUTM = c(2847824.10140759,2847816.73427449,2847871.10249762,2847844.17392274,2847916.6963574,2847808.8734514,2847896.95405131,2847793.76586291,2847721.57691275,2847800.1720647,2847817.14869788,2847860.50938921,2848031.42006168,2847802.37392041,2847844.44095791,2847792.28461383,2847838.75526749,2848408.21836108,2847995.89296004,2848411.30139552,2848136.66700018,2848418.98875582,2847771.97165951,2848252.64452269,2845055.05409167,2847728.1965547,2847783.44921703,2848382.34136664,2847849.44550836,2848392.56348938,2848334.32268777)),row.names = c(NA,31L),class = "data.frame")

解决方法

我已尝试重现您的问题。但是,您的代码似乎无法直接运行(DET 不存在,您的数据包含缺失数据),因此我使用一些不同的设置对其进行了修复。但是,这并没有显示您的问题(使用 move 的开发版本):

library(move)
#> Loading required package: geosphere
#> Loading required package: sp
#> Loading required package: raster
#> Loading required package: rgdal
#> rgdal: version: 1.5-23,(SVN revision 1121)
#> Geospatial Data Abstraction Library extensions to R successfully loaded
#> Loaded GDAL runtime: GDAL 3.0.4,released 2020/01/28
#> Path to GDAL shared files: /usr/share/gdal
#> GDAL binary built with GEOS: TRUE 
#> Loaded PROJ runtime: Rel. 6.3.1,February 10th,2020,[PJ_VERSION: 631]
#> Path to PROJ shared files: /usr/share/proj
#> Linking to sp version:1.4-5
#> To mute warnings of possible GDAL/OSR exportToProj4() degradation,#> use options("rgdal_show_exportToProj4_warnings"="none") before loading rgdal.


ind <- structure(list(Datetime = structure(c(
  1343535240,1343539560,1343543880,1343548200,1343622480,1343625120,1343628540,1343630280,1343634600,1343640660,1343644980,1343655360,1343656200,1343661360,1343665680,1343671740,1343707200,1343709780,1343711520,1343714100,1343715840,1343717520,1343718420,1343721000,1343721840,1343722740,1343723580,1343725320,1343727060
),class = c(
  "POSIXct","POSIXt"
),tzone = "US/Eastern"),Tag = c(
  437L,437L,437L
),Lat = c(
  25.73785,25.73779,25.73822,25.73803,25.7387,25.73772,25.73842,25.73759,25.73693,25.73765,25.73781,25.73819,25.73975,25.73766,25.73758,25.73799,25.74314,25.73943,25.74317,25.7407,25.74324,25.73739,25.74175,25.71287,25.73699,25.73749,25.74292,25.73809,25.743,25.74249
),Lon = c(
  -79.24489,-79.24543,-79.24039,-79.24479,-79.24606,-79.24551,-79.23763,-79.24604,-79.24535,-79.24622,-79.24678,-79.24583,-79.24725,-79.2454,-79.24459,-79.24632,-79.24553,-79.24629,-79.24731,-79.24647,-79.24724,-79.24652,-79.24577,-79.24749,-79.24636,-79.24537,-79.24547,-79.24742,-79.24582,-79.2464,-79.24771
),NewEastingUTM = c(
  676052.593850702,675998.505006306,676503.524589617,676062.361342852,675933.957732871,675990.581885337,676780.134256345,675937.599356069,676007.79854611,675919.451865544,675863.032391998,675957.784408548,675813.022339476,676001.706417219,676082.426966281,675909.522121439,675988.177486275,675904.342388974,675807.473799857,675886.239923252,675812.627071404,675881.120633141,675964.982682709,675786.000042484,675941.884041032,676005.703553397,675994.93392188,675791.30042537,675958.935010342,675893.512994838,675762.839399625
),NewNorthingUTM = c(
  2847824.10140759,2847816.73427449,2847871.10249762,2847844.17392274,2847916.6963574,2847808.8734514,2847896.95405131,2847793.76586291,2847721.57691275,2847800.1720647,2847817.14869788,2847860.50938921,2848031.42006168,2847802.37392041,2847844.44095791,2847792.28461383,2847838.75526749,2848408.21836108,2847995.89296004,2848411.30139552,2848136.66700018,2848418.98875582,2847771.97165951,2848252.64452269,2845055.05409167,2847728.1965547,2847783.44921703,2848382.34136664,2847849.44550836,2848392.56348938,2848334.32268777
)),row.names = c(NA,31L),class = "data.frame")


ind<-ind[-28,][-10,]


move.ind <- move(
  x = ind$Lon,y = ind$Lat,time = ind$Datetime,proj = CRS("+proj=longlat +datum=WGS84"),data = ind,animal = ind$Tag,sensor = "VR2W"
)

move.ind$LocationError <- 1

r.ind <- spTransform(move.ind,center = TRUE)

rNew.ind <- spTransform(r.ind,CRS("+proj=utm +zone=17 +datum=WGS84"))

bursted <- burst(rNew.ind,c("normal","long")[1 + (timeLag(rNew.ind,units = "hours") > 4)])

bursted_dbbmm <- brownian.bridge.dyn(bursted,raster = 50,burstType = "normal",# raster = xAEQD.ind,location.error = "LocationError",time.step = 5,ext = 3,window.size = 15,margin = 7
)
#> Warning in proj4string(object): CRS object has comment,which is lost in output
#> Warning in .local(object,raster,location.error = location.error,ext = ext,:
#> Some burst are omitted for variance calculation since there are not segements of
#> interest
#> Warning in FUN(X[[i]],...): CRS object has comment,which is lost in output
#> Computational size: 9.3e+06
#> Warning in FUN(X[[i]],which is lost in output
#> Computational size: 2.3e+06

tmp <- calc(bursted_dbbmm,sum)
dbbmmlist <- new(".UD",tmp / sum(values(tmp)))

cont.ind <- getVolumeUD(dbbmmlist)

reprex package (v2.0.0) 于 2021 年 7 月 13 日创建

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)&gt; insert overwrite table dwd_trade_cart_add_inc &gt; select data.id, &gt; data.user_id, &gt; data.course_id, &gt; date_format(
错误1 hive (edu)&gt; insert into huanhuan values(1,&#39;haoge&#39;); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive&gt; show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 &lt;configuration&gt; &lt;property&gt; &lt;name&gt;yarn.nodemanager.res