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

Fix scale and offset application when only one is available. #183

Merged
merged 2 commits into from
Oct 24, 2022

Conversation

sharkinsspatial
Copy link
Contributor

I noted this issue recently when working with several datasets which have scales=(0.0001,) but offsets=(0.0,) resulting in the default rescale=True not applying the scale value.

To facilitate future testing of rio_reader functionality, I'd also propose incorporating some file based integration tests similar to those used in rioxarray which might cover these types of edge cases.

Copy link
Owner

@gjoseph92 gjoseph92 left a comment

Choose a reason for hiding this comment

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

Thanks—agreed this should have been an or. Small nit that these are in-place operations to avoid copying the array unnecessarily.

stackstac/rio_reader.py Outdated Show resolved Hide resolved
stackstac/rio_reader.py Outdated Show resolved Hide resolved
@gjoseph92 gjoseph92 merged commit 71a8362 into gjoseph92:main Oct 24, 2022
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