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

Add two luminance sharpening compositors #503

Merged
merged 9 commits into from Nov 23, 2018

Conversation

pnuu
Copy link
Member

@pnuu pnuu commented Nov 15, 2018

This PR adds two compositors that can be used to apply luminance from a VIS channel to RGB composites.

  1. LuminanceSharpeninCompositor: replaces the luminance via RGB -> YCbCr -> RGB conversion
  2. SandwichCompositor: multiplies the RGB channels with the reflectance (scaled to [0.0, 1.0])

Example composites for SEVIRI included are: vis_sharpened_ir and ir_sandwich

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

@pnuu pnuu added enhancement code enhancements, features, improvements component:compositors labels Nov 15, 2018
@pnuu pnuu self-assigned this Nov 15, 2018
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 74.094% when pulling 88340bc on feature-luminance-compositor into 6fc2669 on master.

@coveralls
Copy link

coveralls commented Nov 15, 2018

Coverage Status

Coverage increased (+0.1%) to 74.569% when pulling 75800da on feature-luminance-compositor into 5dc74d2 on master.

@codecov
Copy link

codecov bot commented Nov 15, 2018

Codecov Report

Merging #503 into master will increase coverage by 0.08%.
The diff coverage is 97.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #503      +/-   ##
==========================================
+ Coverage   74.48%   74.56%   +0.08%     
==========================================
  Files         136      136              
  Lines       18328    18399      +71     
==========================================
+ Hits        13651    13720      +69     
- Misses       4677     4679       +2
Impacted Files Coverage Δ
satpy/tests/compositor_tests/__init__.py 98.45% <100%> (+0.35%) ⬆️
satpy/composites/__init__.py 43.86% <94.28%> (+2.55%) ⬆️

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 5dc74d2...75800da. Read the comment docs.

@pnuu pnuu changed the title Add two luminance sharpening compositors [WIP] Add two luminance sharpening compositors Nov 15, 2018
@pnuu
Copy link
Member Author

pnuu commented Nov 15, 2018

Still need to add tests, and start using the luminance conversion formulae from trollilmage instead of the ones copied here. The formulae seem to be to-and-from YUV, not YCbCr, so have to take a deeper look. But at least they produce reasonable results, so not yet sure what to do in the end.

@mraspaud
Copy link
Member

Looks good, but I would rather reuse the functions from trollimage (which is a dependency of satpy) instead of copying them to satpy

@djhoese
Copy link
Member

djhoese commented Nov 15, 2018

Agree with not copying functions that are supposed to exist in trollimage. FYI @pnuu there is this PR by @katherinekolman addressing the dask-ification of the convert method: pytroll/trollimage#28

I was thinking that she didn't need to implement the YUV/YCbCr conversions right now and would merge what she has since we don't need those other conversions (@mraspaud thoughts?). @pnuu You could add on to what she has started.

@pnuu
Copy link
Member Author

pnuu commented Nov 21, 2018

Yes, I agree that eventually the conversions should go via the .convert() method, but for now I'm going with the rgb2ycbcr and ycbcr2rgb functions from trollimage.image. If I started to add the functionality to pytroll/trollimage#28 I'd be dependent on another branch and testing would fail. I think the convert() (with YCbCr) stuff should be available in released trollimage before swapping these compositors to use the functionality.

@pnuu pnuu changed the title [WIP] Add two luminance sharpening compositors Add two luminance sharpening compositors Nov 22, 2018
@djhoese djhoese merged commit a5a31f3 into master Nov 23, 2018
@djhoese djhoese deleted the feature-luminance-compositor branch November 23, 2018 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:compositors enhancement code enhancements, features, improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants