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

Update construct_single_presto_input to unmask NDVI if its calculated #18

Merged
merged 3 commits into from
Oct 13, 2023

Conversation

gabrieltseng
Copy link
Collaborator

Before, NDVI would always be masked in construct_single_presto_input. However, if B4 and B8 band values are passed NDVI can be calculated by S1_S2_ERA5_SRTM.normalize.

This PR unmasks NDVI if its calculated by S1_S2_ERA5_SRTM.normalize.

if normalize:
keep_indices = [idx for idx, val in enumerate(BANDS) if val != "B9"]
mask = mask[:, keep_indices]
x = S1_S2_ERA5_SRTM.normalize(x)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment here that .normalize includes x = x[:, keep_indices]? :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added!

@gabrieltseng gabrieltseng merged commit 613265e into main Oct 13, 2023
1 check passed
@gabrieltseng gabrieltseng deleted the ndvi-in-construct-single-presto-input branch October 13, 2023 21:24
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

Successfully merging this pull request may close these issues.

2 participants