します。エラー - のNetCDFこのデータは、CDO(毎週、毎日から補間)で私によって事前に処理されたR.にラスター形式にNOAA雪のデータ(NetCDFファイル)に変換しようとするラスター変換
library(raster)
library(ncdf4)
nc<-nc_open('NOAA_Snow_JanJune2016.nc')
# extract variable name, size and dimension
v <- nc$var[[1]]
size <- v$varsize
dims <- v$ndims
nt <- size[dims] # length of time dimension
lat <- nc$dim$latitude$vals # latitude position
lon <- nc$dim$longitude$vals # longitude position
# read sea ice variable
r<-list()
for (i in 1:nt) {
start <- rep(1,dims) # begin with start=(1,1,...,1)
start[dims] <- i # change to start=(1,1,...,i) to read timestep i
count <- size # begin with count=(nx,ny,...,nt), reads entire var
count[dims] <- 1 # change to count=(nx,ny,...,1) to read 1 tstep
dt<-ncvar_get(nc, varid = 'snow_cover_extent', start = start, count = count)
# convert to raster
r[i]<-raster(dt)
}
は、次のエラーを返します:
Error in ncvar_get_inner(ncid2use, varid2use, nc$var[[li]]$missval, addOffset, :
Error: variable has 3 dims, but start has 2 entries. They must match!
は誰が持っていたし、この問題を解決していますか?私はCDOでファイルを準備することが問題を引き起こしているのだろうかと思います。 (.NC)のデータがここにアクセスすることができます:
https://drive.google.com/file/d/0Bz0W7Ut_SNfjeE9ObXpySzJ5UWs/view?usp=sharing
多くの感謝!あなたのNCDFを探索する
属性見てみてくださいこの記事ではhttps://stackoverflow.com/questions/42982599/netcdf-to-raster-brick-unable-to-find-inherited-method-for-function-brick-for/43244622#comment74389320_43244622 –