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

Wrong Error when algorithm is NA #9

Closed
RAJohansen opened this issue Jun 20, 2018 · 3 comments
Closed

Wrong Error when algorithm is NA #9

RAJohansen opened this issue Jun 20, 2018 · 3 comments
Assignees

Comments

@RAJohansen
Copy link
Owner

RAJohansen commented Jun 20, 2018

MM12NDCI is not available as a landsat8 algorithm (i.e. it is NA), but the error states the problem is because I chose the wrong satellite. We need to change that error to say "MM12NDCI is NA for landsat8" or "MM12NDCI is not available for the selected satellite, please chose an appropriate algorithm"

Example Code:
Harsha_ndci <- wq_calc(raster_stack = Harsha, alg = "MM12NDCI", sat = "landsat8")

Error Code:
Error in wq_calc(raster_stack = Harsha, alg = "MM12NDCI", sat = "landsat8") :
Unknown satellite or instrument.Please provide one of: 'worldview2', 'sentinel2', 'landsat8', 'modis', or 'meris'

@Nowosad
Copy link
Collaborator

Nowosad commented Jun 21, 2018

Reproducible error:

library(raster)
#> Loading required package: sp
library(waterquality)

l8 = stack(system.file("raster/L8_Taylorsville.tif", package = "waterquality"))
l8_ndci = wq_calc(raster_stack = l8, alg = "MM12NDCI", sat = "landsat8")
#> Error in wq_calc(raster_stack = l8, alg = "MM12NDCI", sat = "landsat8"): Unknown satellite or instrument.Please provide one of: 'worldview2', 'sentinel2', 'landsat8', 'modis', or 'meris'

Created on 2018-06-20 by the reprex package (v0.2.0).

@Nowosad
Copy link
Collaborator

Nowosad commented Jun 21, 2018

@RAJohansen How about this:

library(raster)
#> Loading required package: sp
library(waterquality)

l8 = stack(system.file("raster/L8_Taylorsville.tif", package = "waterquality"))
l8_ndci = wq_calc(raster_stack = l8, alg = "MM12NDCI", sat = "landsat8")
#> Error in wq_calc(raster_stack = l8, alg = "MM12NDCI", sat = "landsat8"): Some of the algorithms are not available for the selected satellite.
#> Please provide appropriate algorithms' names

Created on 2018-06-20 by the reprex package (v0.2.0).

@RAJohansen
Copy link
Owner Author

Good!

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

2 participants