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

mask nan in single band raster #63

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

12rambau
Copy link
Contributor

@12rambau 12rambau commented Apr 21, 2022

Fix #62
Capture d’écran 2022-04-21 à 23 11 22

I computed the alpha channel as it is done for rgb images.
My assomption is that single band dataset will always use np.nan as a nodata value.

At first I wanted to use:

alpha = np.where(das[0]==self._da.rio.nodata, 0, 1)

but if nodata is np.nan it always returns 1. If you know a trick that could work for any value + np.nan that would be great. if not, the assumption I made seems to be commonly accepted. e.g @giswqs use the same in the add_raster method of geemap: https://github.com/giswqs/geemap/blob/13c83f59ebc6790b531277c5908859d4cb5ec190/geemap/geemap.py#L3526

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.

is it possible to filter out some values when using the plot function ?
1 participant