after converting MODIS NDVI and EVI (in HDF4 format) to tifs the values seem way too high (e.g. 2e+07), even after the multiplication with the scale factor (0.0001). As I can't access the data before the conversion, I'm not sure if the data changed or if the values are just generally too high. Can I just delete the last few digits (which are all zero anyways) or is there a mistake in my conversion?

Here is my code for the EVI-conversion:

i = 1
for (i in 1:96){
  # Get a list of sds names
  sds <- get_subdatasets(files_evi[i])
  # Isolate the name of the first sds
  filename <- names_evi[i]
  gdal_translate(sds[2], dst_dataset = filename)
  # Load the Geotiff created into R
  r <- raster(filename)
  path <- "C:/xxx/MODIS/EVI/"
  path <- paste(path, filename)
  writeRaster(r, path, format="GTiff", overwrite=TRUE)}

Any suggestions on how to fix this or how to access the data in a different way?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.