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

add drop argument to spectralIndices #21

Closed
csaybar opened this issue Nov 7, 2021 · 6 comments
Closed

add drop argument to spectralIndices #21

csaybar opened this issue Nov 7, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@csaybar
Copy link
Member

csaybar commented Nov 7, 2021

Hi @davemlz, please 🙏 can you add a drop=False argument to ee_extra.Spectral.core.spectralIndices?

library(rgee)
library(rgeeExtra)

ee_Initialize()

S2 <- ee$ImageCollection('COPERNICUS/S2_SR')$first()
names(ee_ImageCollection_spectralIndex(S2, 'kernel'))

I got:

[1] "B1" "B2" "B3" "B4" "B5" "B6" "B7" "B8" "B8A" "B9"
[11] "B11" "B12" "AOT" "WVP" "SCL" "TCI_R" "TCI_G" "TCI_B" "QA10" "QA20"
[21] "QA60" "kEVI" "kNDVI" "kRVI" "kVARI"

I would like:
[1] "kEVI" "kNDVI" "kRVI" "kVARI"

@csaybar csaybar added the enhancement New feature or request label Nov 7, 2021
@davemlz
Copy link
Collaborator

davemlz commented Nov 7, 2021

Sure thing!

@davemlz davemlz self-assigned this Nov 7, 2021
davemlz added a commit that referenced this issue Nov 7, 2021
@davemlz
Copy link
Collaborator

davemlz commented Nov 7, 2021

Done!

@davemlz davemlz closed this as completed Nov 7, 2021
@csaybar csaybar reopened this Nov 7, 2021
@csaybar
Copy link
Member Author

csaybar commented Nov 7, 2021

drop=FALSE works great!

library(rgee)
library(rgeeExtra)

ee_Initialize()

s2 <- ee$ImageCollection$Dataset$COPERNICUS_S2_SR %>%
  ee$ImageCollection$first() %>%
  ee_ImageCollection_preprocess()

green_indices <- ee_ImageCollection_spectralIndex(s2, c("NDVI", "SAVI"), drop = FALSE)
names(green_indices)

[1] "B1" "B2" "B3" "B4" "B5" "B6" "B7" "B8" "B8A" "B9"
[11] "B11" "B12" "AOT" "WVP" "SCL" "TCI_R" "TCI_G" "TCI_B" "QA10" "QA20"
[21] "QA60" "NDVI" "SAVI"

drop=TRUE :(

library(rgee)
library(rgeeExtra)

ee_Initialize()

s2 <- ee$ImageCollection$Dataset$COPERNICUS_S2_SR %>%
  ee$ImageCollection$first() %>%
  ee_ImageCollection_preprocess()

green_indices <- ee_ImageCollection_spectralIndex(s2, c("NDVI", "SAVI"), drop = TRUE)

[1] "SAVI"

@csaybar
Copy link
Member Author

csaybar commented Nov 7, 2021

@davemlz

@davemlz
Copy link
Collaborator

davemlz commented Nov 7, 2021

Ahhhh no manches. Ya sé qué hice mal. Espera.

davemlz added a commit that referenced this issue Nov 7, 2021
@davemlz
Copy link
Collaborator

davemlz commented Nov 7, 2021

Ya! :)

@davemlz davemlz closed this as completed Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants