HDF数据到TIFF栅格转换的问题

时间:2020-02-11 16:25:36

标签: raster r-raster hdf ncdf4 rhdf5

我有hdf5数据,我想将其转换为栅格,但是在代码的最后一行出现了错误。错误是 “错误(函数(类,fdef,mtable): 无法为签名““ array””“

找到函数“ raster”的继承方法
library(raster)
library(gdalUtils)
library(sp)
library(sf)
library(gdalUtilities)
library(rgdal)      
library(tiff)
library(ncdf4)
library(hdf5r)
library(hdfqlr)
#library(BiocManager)
#BiocManager::install("rhdf5")
#source("http://bioconductor.org/biocLite.R")
#biocLite("rhdf5")
library(rhdf5)
library(gdalUtils)
library(raster)
library(sf)
library(rasterVis)
library(emmeans)
library()
library(lsmeans)
library(biomod2)
library(reshape)
library(reshape2)
setwd("D://2R")
options(max.print = 99999999)

# set path and filename
hdf_path <- "D:/2R/"
hdf_name <- "1C.F19.SSMIS.XCAL2016-V.20150906-S011918-E030110.007356.V05A.hdf5"
hdf_file <- paste(hdf_path, hdf_name, sep="")
h5ls(hdf_file)
# read the attributes of Temperature
h5readAttributes(hdf_file, name = "S1/Tc")
# get lons and lats
lon <- h5read(hdf_file, "/S1/Longitude")
nlon <- length(lon)
nlon
head(lon); tail(lon)
lat <- h5read(hdf_file, "/S1/Latitude")
nlat <- length(lat)
nlat
head(lat); tail(lat)
# read the temperature data
h1 <- h5read(hdf_file, "S1/Tc")
class(h1); str(h1)
t<- raster(h1)

0 个答案:

没有答案