Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R phenex软件包中的modelNDVI()函数,用于平滑和分析不规则多年时间序列的其他软件包?_R_Time Series - Fatal编程技术网

R phenex软件包中的modelNDVI()函数,用于平滑和分析不规则多年时间序列的其他软件包?

R phenex软件包中的modelNDVI()函数,用于平滑和分析不规则多年时间序列的其他软件包?,r,time-series,R,Time Series,我有多个时间序列作为*.csv文件。它们都有日期的第一列和ndvi值的第二列。时间序列是不规则的,在30年的时间跨度之间缺少几年,并且值在每年内的间隔不是均匀的(不包括从一开始就与“ts”类和其他一些类一起工作)。我的系列中的每一年都有某种季节性振幅,我想用一个函数来拟合它。 对于那些熟悉物候学和遥感的人,我想基本上检索与所检索的指标相同的指标(对于包含足够值的年份)。我已经找到了这个包,包括函数modelNDVI(),我认为它正是我想要的——使用bise(最佳索引斜率提取)校正我的值,并使用S

我有多个时间序列作为*.csv文件。它们都有日期的第一列和ndvi值的第二列。时间序列是不规则的,在30年的时间跨度之间缺少几年,并且值在每年内的间隔不是均匀的(不包括从一开始就与“ts”类和其他一些类一起工作)。我的系列中的每一年都有某种季节性振幅,我想用一个函数来拟合它。
对于那些熟悉物候学和遥感的人,我想基本上检索与所检索的指标相同的指标(对于包含足够值的年份)。我已经找到了这个包,包括函数modelNDVI(),我认为它正是我想要的——使用bise(最佳索引斜率提取)校正我的值,并使用Savitzky Golay或非对称高斯平滑。我的数据基本上如下所示:

head(test) system.time_start X1 3 1985-01-17 01:00:00 0.04546319 6 1985-02-10 01:00:00 0.05106874 7 1985-02-18 01:00:00 0.10060238 8 1985-02-26 01:00:00 0.04757872 9 1985-03-06 01:00:00 0.03484827 11 1985-03-22 01:00:00 0.02705866 ... 2357 2015-11-17 01:00:00 0.04524300 2358 2015-11-17 01:00:00 0.04476613 2359 2015-11-25 01:00:00 0.03424461 2360 2015-11-25 01:00:00 0.05062974 2364 2015-12-11 01:00:00 0.09578227 2368 2015-12-27 01:00:00 0.09661864 头部(测试) 系统时间_开始X1 3 1985-01-17 01:00:00 0.04546319 6 1985-02-10 01:00:00 0.05106874 7 1985-02-18 01:00:00 0.10060238 8 1985-02-26 01:00:00 0.04757872 9 1985-03-06 01:00:00 0.03484827 11 1985-03-22 01:00:00 0.02705866 ... 2357 2015-11-17 01:00:00 0.04524300 2358 2015-11-17 01:00:00 0.04476613 2359 2015-11-25 01:00:00 0.03424461 2360 2015-11-25 01:00:00 0.05062974 2364 2015-12-11 01:00:00 0.09578227 2368 2015-12-27 01:00:00 0.09661864 显然modelNDVI()需要一个向量,所以:

test.vec在对一个类似的问题感到困惑之后,我意识到NDVI向量需要365/366天(正如您所发现的),但它也需要是一个
NDVI
类对象。查看
?bise1
示例代码


至于多年的应用,我无法发表评论。

在对类似问题感到困惑之后,我意识到NDVI向量需要365/366天长(正如您所发现的),但它也需要是一个
NDVI
类对象。查看
?bise1
示例代码


至于多年申请,我无法置评。

遇到了同样的问题。这是我的修复程序,它创建了一个365天长的向量,并根据ndvi.tiff文件(例如20160131_ndvi.tiff是2016年1月31日或一年中的31天)为我拥有数据的每一天添加ndvi值,但如果您已经拥有ndvi值及其各自的采集日期,则可以轻松地修改此值

library(raster)
library(plyr)
library(rgdal)
library(rgeos)
library(phenex)
library(lubridate)

ndvi.list <- list.files(path = ".", pattern = "*ndvi.tif$", ignore.case = TRUE, 
full.names = TRUE, recursive = TRUE)
ndvi.stack <- stack(ndvi.list)
ndvi_values <- matrix(0,0,366)

# find mean ndvi (e.g. within a shapefile boundaries)
ndvi <- extract(ndvi.stack, shapefile, fun=mean, df=TRUE)

#use filenames to retrieve data information from ndvi.tiff files (e.g. mine were 
called 20160210_NDVI.tif)
ndvicols <- names(ndvi.stack)  
ndvicols <- sub("X","",ndvicols) 
ndvicols <- sub("_NDVI","",ndvicols)
dates <- as.Date(ndvicols, format = "%Y%m%d")
doy <- lubridate::yday(dates)  

#create ndvi vector
vec <- rep(0, 365)
ndvi.vals <- as.vector(t(ndvi[,2:ncol(ndvi)]))
vec[doy] <- ndvi.vals

# create NDVI object, apply correction (e.g. BISE) and model values (e.g. Linear interpolation)
ndvi.list <- modelNDVI(ndvi.values=vec,
                    year.int=2016, multipleSeasons=FALSE, correction="bise",
                    method="LinIP", MARGIN=2, doParallel=FALSE, slidingperiod=10)

# create vector of modelled values
vec.mod <- ndvi.list[[1]]@modelledValues
库(光栅)
图书馆(plyr)
图书馆(rgdal)
图书馆(rgeos)
图书馆(菲尼克斯)
图书馆(lubridate)

ndvi.list也遇到了同样的问题。这是我的修复程序,它创建了一个365天长的向量,并根据ndvi.tiff文件(例如20160131_ndvi.tiff是2016年1月31日或一年中的31天)为我拥有数据的每一天添加ndvi值,但如果您已经拥有ndvi值及其各自的采集日期,则可以轻松地修改此值

library(raster)
library(plyr)
library(rgdal)
library(rgeos)
library(phenex)
library(lubridate)

ndvi.list <- list.files(path = ".", pattern = "*ndvi.tif$", ignore.case = TRUE, 
full.names = TRUE, recursive = TRUE)
ndvi.stack <- stack(ndvi.list)
ndvi_values <- matrix(0,0,366)

# find mean ndvi (e.g. within a shapefile boundaries)
ndvi <- extract(ndvi.stack, shapefile, fun=mean, df=TRUE)

#use filenames to retrieve data information from ndvi.tiff files (e.g. mine were 
called 20160210_NDVI.tif)
ndvicols <- names(ndvi.stack)  
ndvicols <- sub("X","",ndvicols) 
ndvicols <- sub("_NDVI","",ndvicols)
dates <- as.Date(ndvicols, format = "%Y%m%d")
doy <- lubridate::yday(dates)  

#create ndvi vector
vec <- rep(0, 365)
ndvi.vals <- as.vector(t(ndvi[,2:ncol(ndvi)]))
vec[doy] <- ndvi.vals

# create NDVI object, apply correction (e.g. BISE) and model values (e.g. Linear interpolation)
ndvi.list <- modelNDVI(ndvi.values=vec,
                    year.int=2016, multipleSeasons=FALSE, correction="bise",
                    method="LinIP", MARGIN=2, doParallel=FALSE, slidingperiod=10)

# create vector of modelled values
vec.mod <- ndvi.list[[1]]@modelledValues
库(光栅)
图书馆(plyr)
图书馆(rgdal)
图书馆(rgeos)
图书馆(菲尼克斯)
图书馆(lubridate)
ndvi.list