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 fill value for integer datasets, fix band assignment #298

Merged
merged 5 commits into from
Sep 1, 2020

Conversation

pnuu
Copy link
Member

@pnuu pnuu commented Sep 1, 2020

Since some recent changes in Satpy resampling a of mix of float and integer datasets (e.g. when using BackgroundCompositor) in to one output was broken in two ways in XArrayResamplerBilinear.

  1. fill_value was set to np.nan even for the integer dataset
  2. if one of these datasets had RGBA and another RGB bands, sometimes there were problems assigning the correct bands to the output dataset after resampling.

I'm not entirely sure why this happens, but this fixes it.

  • Tests added
  • Tests passed
  • Passes git diff origin/master **/*py | flake8 --diff

@pnuu pnuu added the bug label Sep 1, 2020
@pnuu pnuu self-assigned this Sep 1, 2020
@codecov
Copy link

codecov bot commented Sep 1, 2020

Codecov Report

Merging #298 into master will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #298      +/-   ##
==========================================
+ Coverage   92.60%   92.65%   +0.04%     
==========================================
  Files          43       43              
  Lines        9077     9104      +27     
==========================================
+ Hits         8406     8435      +29     
+ Misses        671      669       -2     
Impacted Files Coverage Δ
pyresample/bilinear/xarr.py 94.84% <100.00%> (+0.86%) ⬆️
pyresample/test/test_bilinear.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc78bda...e17dd7b. Read the comment docs.

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

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

Thanks for the concise code and refactorings. Just the tests are missing.

pyresample/bilinear/xarr.py Outdated Show resolved Hide resolved
pyresample/bilinear/xarr.py Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Sep 1, 2020

Coverage Status

Coverage increased (+0.04%) to 92.652% when pulling e17dd7b on pnuu:bugfix_fill_value_and_bands into fc78bda on pytroll:master.

@pnuu
Copy link
Member Author

pnuu commented Sep 1, 2020

I believe everything is now tested.

@mraspaud mraspaud merged commit 46de898 into pytroll:master Sep 1, 2020
@pnuu pnuu deleted the bugfix_fill_value_and_bands branch September 2, 2020 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants