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

How to deal with NDVI as input #16

Closed
kvantricht opened this issue Oct 13, 2023 · 2 comments
Closed

How to deal with NDVI as input #16

kvantricht opened this issue Oct 13, 2023 · 2 comments

Comments

@kvantricht
Copy link
Contributor

I'm a little bit confused from the examples on how to deal with NDVI as input to Presto, using the following method:
https://github.com/nasaharvest/presto/blob/d498ba686bedafd113a0755c6d1927193769a920/presto/dataops/utils.py#L17:L28

It seems to not support NDVI as input while the current Presto encoder does. Any help with respect to how we can add NDVI would be appreciated!

@gabrieltseng
Copy link
Collaborator

Hi @kvantricht -

This seems like a bug in the function. I've fixed it in #18 - thanks for spotting this.

If you have your own NDVI values you would like to add, one way to do this is:

from presto import construct_single_presto_input
from presto.dataops.pipelines.s1_s2_era5_srtm import NORMED_BANDS

x, mask, dw = construct_single_presto_input(...)
x[:, NORMED_BANDS.index("NDVI")] = my_ndvi_values
mask[:, NORMED_BANDS.index("NDVI")] = 0

@kvantricht
Copy link
Contributor Author

Hi @gabrieltseng,

nice, thanks for fixing! I didn't realize NDVI would be automatically computed if B4 and B8 were provided, so that's convenient. I won't provide it myself then!

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