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

When no fill value is used, write TransparentPixel=-1 in ninjogeotiff headers #1931

Merged
merged 2 commits into from
Dec 10, 2021

Conversation

gerritholl
Copy link
Collaborator

@gerritholl gerritholl commented Dec 8, 2021

When an image with an alpha layer is written, fill value is not applicable. In the satpy source code, this is signalled by fill_value=None. However, this value None should not be written to the TransparentPixel tag. Instead, the standard calls for fill_value=-1 when a fill value is not applicable. This PR makes sure that when an image with an alpha layer is written, the GDALMetaData tag TransparentPixel will be written with the value of -1 by the ninjogeotiff writer.

When a fill value is not used, the ninjogeotiff writer should write -1
to the relevant TransparentPixel tag.
@codecov
Copy link

codecov bot commented Dec 8, 2021

Codecov Report

Merging #1931 (1fa096f) into main (a430f86) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1931   +/-   ##
=======================================
  Coverage   93.48%   93.48%           
=======================================
  Files         275      275           
  Lines       40741    40749    +8     
=======================================
+ Hits        38088    38096    +8     
  Misses       2653     2653           
Flag Coverage Δ
behaviourtests 4.83% <0.00%> (-0.01%) ⬇️
unittests 94.03% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
satpy/tests/writer_tests/test_ninjogeotiff.py 97.70% <100.00%> (+0.04%) ⬆️
satpy/writers/ninjogeotiff.py 99.19% <100.00%> (+0.01%) ⬆️

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 a430f86...1fa096f. Read the comment docs.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.001%) to 93.957% when pulling 1fa096f on gerritholl:ninjogeotiff-transparentpixel-none into a430f86 on pytroll:main.

@gerritholl gerritholl changed the title Write fill value -1 when not used When no fill value is used, write TransparentPixel=-1 in ninjogeotiff headers Dec 9, 2021
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.

LGTM

@mraspaud mraspaud merged commit a3eb5fe into pytroll:main Dec 10, 2021
@gerritholl gerritholl deleted the ninjogeotiff-transparentpixel-none branch December 10, 2021 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ninjogeotiff writer produces file with ninjo_TransparentPixel=None
3 participants