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

Support more style range options #883

Merged
merged 3 commits into from
Jul 5, 2022
Merged

Support more style range options #883

merged 3 commits into from
Jul 5, 2022

Conversation

manthey
Copy link
Member

@manthey manthey commented Jul 5, 2022

No description provided.

output = (output * 65535 / 255).astype(numpy.uint16)
elif dtype == 'float':
output /= 255
print(axis, output.shape)
Copy link
Contributor

Choose a reason for hiding this comment

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

remove print statement?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks.

@banesullivan
Copy link
Contributor

I'm curious when full is wanted/needed?

@banesullivan
Copy link
Contributor

I suppose I've had a few float rasters but the data range was always much larger than 255 and thus the tiles would come back looking a single color. Setting full to 1 might still have the same issue?

@manthey
Copy link
Member Author

manthey commented Jul 5, 2022

I'm curious when full is wanted/needed?

The specific use case is that we have a file with multiple images that are conceptually a matrix of channel, z value (altitude), time value, and xy sample position, all in 16-bit uint format. We want to make a max-merge for each distinct combination other than z. When we specify a style like {bands: [{frame: 0}, {frame 5}, {frame 10}]}, if we don't specify the min/max values, they default to auto. But, for 16-bit uint, auto resolves to min/max, whereas we want 0/full-range.

I think this means we either need to introduce a new term to avoid using the current default (hence full) OR make a breaking change.

@manthey
Copy link
Member Author

manthey commented Jul 5, 2022

I suppose I've had a few float rasters but the data range was always much larger than 255 and thus the tiles would come back looking a single color. Setting full to 1 might still have the same issue?

Yes -- this is a problem where data sources don't actually indicate what their valid range is. You can read EVERY pixel and find the min/max, but that is expensive. You can do this at a low resolution (which is what is currently done), which is only a guess. Some datatypes imply a min/max (uint8 -> [0,255], uint16 -> [0,65535]), but some don't (float). Even then, I've seen data in uint16 which is really uint12 or uint14 with the high bits zeroed. I'm not sure we have a decent general solution.

@banesullivan
Copy link
Contributor

All makes sense! Thanks for the explanation!

@manthey manthey merged commit 959f50d into master Jul 5, 2022
@manthey manthey deleted the style-minmax-full branch July 5, 2022 20:21
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