问题
I am stuck on the Energy Balance calculation of the water package. The example code I am following is at this website https://cran.r-project.org/web/packages/water/vignettes/Landsat8.html. I am using my own data and am able to read both my original landsat image and the surface reflectance image with my area of interests (aoi). I get the following error when I use this code.
Energy.Balance <- METRIC.EB(image.DN = image, image.SR = image.SR,
plain=TRUE, aoi=aoi, n = 5, WeatherStation = WeatherStation,
ETp.coef = 1.2, sat="L8", alb.coeff = "Olmedo", LST.method = "SW",
LAI.method = "metric2010", Z.om.ws = 0.03, MTL = MTLfile)
Error in .local(x, ...):RasterLayer has no NA cells (for which to compute a distance)
回答1:
This sounds like a problem when searching for the anchor pixels. Can you try updating to the lastest version of water package (0.7) and adding anchors.method = 'flexible'
to function METRIC.EB()
?
来源:https://stackoverflow.com/questions/44349742/metric-eb-error-in-localx-rasterlayer-has-no-na-cells-for-which-to-co