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

some corrected reflectant value of TOA Band 5 seems out of range #59

Open
grace747 opened this issue Mar 9, 2020 · 0 comments
Open

Comments

@grace747
Copy link

grace747 commented Mar 9, 2020

I used topCor() on 62 stack of TOA Band 5 Landsat 8 image and I provided 62 MTL files which are sort to match the order of 62 stack of TOA Band 5.

But 32 output files of corrected TOA Band 5 are out of range (ie: reflectance value between -134.381 to 203.657. I did the same topCor () for TOA Band 4 Landsat 8 and the 62 output files seem to be in correct reflectance range. Can anyone tell me what when wrong? Advice are very much appreciated. Thanks

My codes are as follows:

dem_kam <-raster("E:/R/DEM/Kam_DEMslopeAspct_rad.tif")
#path to directory with folders
path1 <- "E:/R/C_crrctn/kam_c_crrctn/B5_tif/"
path2 <- "E:/R/C_crrctn/kam_c_crrctn/MTL/"
path3 <- "E:/R/C_crrctn/kam_c_crrctn/B5_C/"

#get file names using list.files() function
toa_stack <-list.files(path1, pattern=".tif$",full.names=T)
#print(path2)
mtl_stack <-list.files(path2,pattern =".txt$",full.names =T)

#Loop over every stack in filelist
for(i in 1:length(toa_stack)) {
print(i)

#stack image i
img <- raster(toa_stack[i])
mtl <- file.path(mtl_stack[i])
print(img)
print(mtl)
#calc corrected B5 for image i
B5_C <- topCor(img, dem = dem_kam, metaData = mtl, method = "C")

#export raster
writeRaster(B5_C, file.path(path3,names(img)), format="GTiff",
bylayer=TRUE, overwrite=T)
}

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