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
Error message while computing spectral indices #6
Comments
Looks like this needs more careful heuristics on my side --> I'll refine that in one of the next versions. It should only occur though when EVI or EVI2 are to be calculated and extreme values are unknown. For now please set the data range beforehand, i.e. run this once after you load the data, ## Reads the raster once to get accurate minimum and maximum values
landsat_data <- setMinMax(landsat_data)
# And then as usual
indices <- spectralIndices(landsat_data, blue = 1, green=2, red =3 )
|
Thanks for your reply ! I did as advised and now I et the following warning message:
Also only the following indices are being calculated:
|
Yes that is what it is supposed to tell you, when your data do not look like reflectance values and yes, it will calculate the remaining indices. EVI and EVI2 rely on parameters which are defined for reflectance values only (ranging from 0 to 1). However, if your data are not reflectances, but digital numbers (DN), for example, EVI is not defined and hence will not be calculated. |
oh ok I understand. Did you see my edit ? EVI is not the only one not being computed. Excuse me if my questions may sound stupid, but as I already said, I'm pretty new to all this. |
Only EVI and EVI2 should be skipped in this case. Are there any others missing? |
Yes, only 13 indices are being returned. According to the help file for the You can see the ones that are being returned in my second question in this issue. |
Thanks, that was indeed a bug. I've updated the package. The next release is not yet due. To calculate the missing indices for now please install the current Github version. |
Ok, thanks. Where can I find the Github version ? |
Awesome, thanks a lot! |
sorry to bother you again, but now (after installing the latest GitHub version) i get 19 indices instead of 20 (total number of indices is 22 according to the help file, so without the two EVI indices a total of 20 indices should be returned, right?). |
I guess you did not specify the coefficients swir2coc (completely open canopy) and swir2ccc (completely closed canopy) which are required in order to calculate NDVIC. I probably should make this more clear in the documentation. |
ok, I understand. Thanks again for helping me out! |
@bleutner : |
I created a raster stack (landsat_data) with 6 layers, each of which represents one band.I also saved the names of the layers in a vector (names_landsat). Now I want to calculate the spectral indices with the following code:
Unfortunately R returns the following error message:
I have absolutely zero clue what that means as I am pretty new to this package.
I would be very grateful if somebody could give me any kind of help.
Thanks.
The text was updated successfully, but these errors were encountered: