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 geotiff writer ignoring dtype argument #1733

Merged
merged 1 commit into from
Aug 18, 2021

Conversation

BENR0
Copy link
Collaborator

@BENR0 BENR0 commented Jun 21, 2021

@BENR0 BENR0 requested review from djhoese and mraspaud as code owners June 21, 2021 08:17
@codecov
Copy link

codecov bot commented Jun 21, 2021

Codecov Report

Merging #1733 (26085e1) into main (7b8eb8d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1733   +/-   ##
=======================================
  Coverage   92.83%   92.83%           
=======================================
  Files         260      260           
  Lines       38552    38561    +9     
=======================================
+ Hits        35791    35800    +9     
  Misses       2761     2761           
Flag Coverage Δ
behaviourtests 4.81% <0.00%> (-0.01%) ⬇️
unittests 93.38% <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_geotiff.py 98.03% <100.00%> (+0.16%) ⬆️
satpy/writers/geotiff.py 91.07% <100.00%> (+0.16%) ⬆️

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 7b8eb8d...26085e1. Read the comment docs.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 93.327% when pulling 26085e1 on BENR0:fix_geotiff_writer_dtype_bug into 7b8eb8d on pytroll:main.

@djhoese
Copy link
Member

djhoese commented Jun 21, 2021

While this definitely is a bug it seems to me that saving an unenhanced image with "unit8" is in most cases not really wanted because there will be clipping of the data. Maybe a warning should be added for the case when clipping possibly might occur?

I'm inclined to avoid the "annoying" warning and assume that the user understands what they are saying when they do this. But I don't feel that strongly. I'm also not sure how common this "most cases" is. For reflectance data this wouldn't be that bad (major loss of precision, but still). For BT data, yeah not good. For RGBs, yeah not great either probably.

If you want to add the warning go for it. If @mraspaud or @pnuu or @gerritholl have feelings about this, speak now.

@BENR0
Copy link
Collaborator Author

BENR0 commented Jun 21, 2021

I'm inclined to avoid the "annoying" warning and assume that the user understands what they are saying when they do this

I totally agree. I just suggested it because some users might not be aware and would wonder why their image looks so weird :-D. So if anyone want's me to add it I will, otherwise I am ok with how it is.

@gerritholl
Copy link
Member

In DWD we've been generating images with stretch="no" but I don't know how we've prevented problems with values not between 0 and 256.

@djhoese djhoese changed the title Fix geotiff writer ignoring dtype argument #1730 Fix geotiff writer ignoring dtype argument Aug 18, 2021
@djhoese
Copy link
Member

djhoese commented Aug 18, 2021

Seems I lost track of this. Thanks again @BENR0.

@djhoese djhoese merged commit 2c79eb9 into pytroll:main Aug 18, 2021
simonrp84 pushed a commit to simonrp84/satpy that referenced this pull request Nov 24, 2021
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.

geotiff writer ignores dtype argument, always writes float if enhance=False
4 participants