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

Continuous colormaps - exact range boundary values not displayed #55

Open
sebbelese opened this issue Feb 19, 2021 · 0 comments
Open

Continuous colormaps - exact range boundary values not displayed #55

sebbelese opened this issue Feb 19, 2021 · 0 comments

Comments

@sebbelese
Copy link

Hi,

Thanks for developing this nice software!

I noticed that the display of rasters with a continuous colormap was not including values exactly at the boundaries of the raster data range. This can be an issue for e.g. rasters having a lot of zeros as lower limit. If this is a bug, it can be fixed by modifying utils.py line 82 from:

        # Compute alpha channel from mask if available.
        if numpy.ma.is_masked(dat):
            alpha = 255 * numpy.logical_not(dat.mask) * (norm >= 0) * (norm <= 1)
        else:
            alpha = 255 * (norm > 0) * (norm < 1)

to

        # Compute alpha channel from mask if available.
        if numpy.ma.is_masked(dat):
            alpha = 255 * numpy.logical_not(dat.mask) * (norm >= 0) * (norm <= 1)
        else:
            alpha = 255 * (norm >= 0) * (norm <= 1)    #Just changed this line

Sorry for not making a proper merge request, but it is just a small change.

@sebbelese sebbelese changed the title Continuous colormaps - extreme values not displayed Continuous colormaps - exact range boundary values not displayed Feb 19, 2021
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

1 participant