我想使用以下方法对陆地卫星图像进行辐射校正:
radiocorr(x, gain, offset, Grescale, Brescale, sunelev, satzenith, edist, Esun,
Lhaze, method = "apparentreflectance")
我对每个波段进行了校正,如下所示:
B1 <- readGDAL("_X20060509_B_1.tif")
B1.ar<-radiocorr(x = B1, Grescale = 0.76583, Brescale = -2.28583, sunelev = 43.99853366,
satzenith = 0, edist = 1.0095786, Esun = 1983, method = "apparentreflectance")
writeGDAL(B1.ar, "C:/Users/Documents/ Reflectance/B1.tif", drivername="GTiff")
如何使一项功能自动执行对六个波段的校正?我试过这个功能:
atmcor <- function(img, i) {
x<-img[[i]]
Grescale<-gain[i,2]
Brescale<-bias[i,2]
sunelev<-sunelevation[i,2]
satzenith=0
edist<-edistance[i,2]
Esun<-Esun[1,2]
method = "apparentreflectance"
B.ar<-radiocorr(x, Grescale, Brescale, sunelev, satzenith, edist, Esun, method)
return(B.ar)
}
ATMCOR <- atmcor(landsat_stack, 1)
但是,我得到了这个错误:(数组错误(x,c(长度(x),1L),if(!is.null(names(x)))list(names(x),:'dimnames'的长度[1] 不等于数组范围)