midraed / water

R package to calculate surface energy balance models
24 stars 20 forks source link

skipping area of interest and loading entire image #38

Closed abhilash25 closed 5 years ago

abhilash25 commented 5 years ago

Hi all, this package is very useful however I am facing some issues during its application. Since I am new with R language, it is a bit difficult for me to fix things.

  1. How can I escape the area of interest and load the entire raster image?
  2. what are the prerequisites for the digital elevation model to be used during processing the data?
  3. I had to move my data to extdata else before that it was showing error "subscript out of bounds"

I would really appreciate if anyone could help me solve this issue.

thank you

midraed commented 5 years ago

How can I escape the area of interest and load the entire raster image?

Just don't use an "aoi". But, it would take a lot of time and a lot of RAM memory,. Besides, Results are limited to 30km from the weather station location. You can override this using extraParameters in METRIC.EB() function. Please check the help file.

what are the prerequisites for the digital elevation model to be used during processing the data?

Same cell size and extent than landsat image. I recommend using SRTM prepared with prepareSRTMdata() function

I had to move my data to extdata else before that it was showing error "subscript out of bounds"

You can have your data in any folder, just use your working folder. Please read about the path parameter present in many functions including loadImage()

abhilash25 commented 5 years ago

I have tried changing path for loadImage() but the error is constantly persisted "subscript out of bounds". Can you tell me what mistake am i committing?

code: library(water) aoi <- createAoi(topleft = c(500000, -3644000), bottomright = c(526000, -3660000)) setwd("C:/water-master/water-master/inst/data/test_R_metric") getwd()

---- warning=FALSE, fig.width = 7---------------------------------------

raw_data_folder <- "C:/test_R_metric" image <- loadImage(path="raw_data_folder", sat="L8") image.SR <- loadImageSR(path=raw_data_folder)

error**** image <- loadImage(path="raw_data_folder", sat="L8") Error in image_list[[1]] : subscript out of bounds

image.SR <- loadImageSR(path=raw_data_folder) Error in .local(.Object, ...) :

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