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 'mitiff' writer not clipping enhanced data before scaling to 8 bit values #712
Fix 'mitiff' writer not clipping enhanced data before scaling to 8 bit values #712
Conversation
…ced values to mitiff
Codecov Report
@@ Coverage Diff @@
## master #712 +/- ##
==========================================
+ Coverage 79.99% 80.02% +0.02%
==========================================
Files 147 147
Lines 21471 21498 +27
==========================================
+ Hits 17176 17203 +27
Misses 4295 4295
Continue to review full report at Codecov.
|
Will try to add a test for this. |
tif = TIFF.open(os.path.join(self.base_dir, filename)) | ||
for image in tif.iter_images(): | ||
np.testing.assert_allclose(image, expected, atol=1.e-6, rtol=0) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you delete the file when the test is finished ? Or do you do that later ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think cleanup does that. Will check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tearDown removes the temp directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect. Merging.
After enhancement some data points may have values lower than 0.
Clip this to 0 before scaling to 8bit values.
This is needed in the mitiff writer as the 0 value is treated as nodata.