Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image.SR <- loadImageSR(path=raw_data_folder, aoi=aoi) #53

Open
Omar87senjar opened this issue Nov 9, 2022 · 0 comments
Open

image.SR <- loadImageSR(path=raw_data_folder, aoi=aoi) #53

Omar87senjar opened this issue Nov 9, 2022 · 0 comments

Comments

@Omar87senjar
Copy link

Hello everyone
I have tried to load image.SR for Landsat 8 on data in 2022, this issue is the first time has happened to me. For data in 2021 it did not happen when loading image.SR.

image.SR <- loadImageSR(path=raw_data_folder, aoi=aoi)

Error in .local(.Object, ...) :

Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", :
Cannot create a RasterLayer object from this file. (file does not exist)

I have tried to solve this issue by using the code below

files <- list.files(path = raw_data_folder

  •                 , pattern = "_sr_band+[2-7].tif$", full.names = T)
    

files <- list.files(path = raw_data_folder

  • , pattern = "_SR_B+[2-7].tif$", full.names = T)

files <- list.files(path = system.file("March1422", package="water")

  •                 , pattern = "_SR_B+[2-7].(TIF|tif)$", full.names = T)
    

stack1 <- list()
for(i in 1:6){

  • stack1[i] <- raster(files[i])}
    

Warning messages:
1: In [<-(*tmp*, i, value = raster(files[i])) :
implicit list embedding of S4 objects is deprecated
2: In [<-(*tmp*, i, value = raster(files[i])) :
implicit list embedding of S4 objects is deprecated
3: In [<-(*tmp*, i, value = raster(files[i])) :
implicit list embedding of S4 objects is deprecated
4: In [<-(*tmp*, i, value = raster(files[i])) :
implicit list embedding of S4 objects is deprecated
5: In [<-(*tmp*, i, value = raster(files[i])) :
implicit list embedding of S4 objects is deprecated
6: In [<-(*tmp*, i, value = raster(files[i])) :
implicit list embedding of S4 objects is deprecated

image.SR <- do.call(stack, stack1)
image.SR <- crop(image.SR, aoi)
image.SR <- image.SR / 10000
bandnames <- c("B", "G", "R", "NIR", "SWIR1", "SWIR2")
image.SR <- saveLoadClean(imagestack = image.SR,

  •                       stack.names = bandnames, 
    
  •                       file = "image.SR", 
    
  •                       overwrite=TRUE)
    

Error in saveLoadClean(imagestack = image.SR, stack.names = bandnames, :
could not find function "saveLoadClean"

When i tried to run METRIC.EB, the new issue is happened

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 calcAnchors(image = image.TOAr, Ts = Ts, LAI = LAI, plots = T, :
Not enough pixels with the conditions for anchor pixels. I
found 0 cold pixels and 0 hot pixels.
In addition: Warning messages:
1: In calcAnchors(image = image.TOAr, Ts = Ts, LAI = LAI, plots = T, :
anchor method names has changed. Old names (CITRA-MCBx) are
deprecated. Options now include 'best', 'random' and 'flexible'
2: In max(Ts[albedo >= 0.13 & albedo <= 0.15 & NDVI >= 0.1 & NDVI <= :
no non-missing arguments to max; returning -Inf
Can you help me, please?
thank you for your understanding and cooperation
Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant