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 a compositor that can use static images #734

Closed
pnuu opened this issue Apr 26, 2019 · 2 comments · Fixed by #804
Closed

Add a compositor that can use static images #734

pnuu opened this issue Apr 26, 2019 · 2 comments · Fixed by #804
Assignees
Labels
component:compositors enhancement code enhancements, features, improvements PCW Pytroll Contributors' Week

Comments

@pnuu
Copy link
Member

pnuu commented Apr 26, 2019

Feature Request

In #460 it has been discussed that a compositor that can use a static image as a background would be very useful.

I've been thinking about this "BackgroundCompositor" for a while even before the issue was opened, and already have some ideas. In fact this might end up being two compositors:

  1. StaticImageCompositor - read an image and use it as is (L(A) or RGB(A)), or as a channel in a composite (L(A))
  2. BackgroundCompositor - use a static image (either directly or using StaticImageCompositor) and overlay another composite on top of it (blend using A channel of the top-image as weight)

With these and already existing DayNightCompositor and CloudCompositor it would be possible to create images having:

  • Earth at Night as a background and overlay of clouds
  • mix of Earth at Night and Blue Marble as background and overlay of clouds
  • a static map as a background and overlay of clouds
@pnuu pnuu added enhancement code enhancements, features, improvements component:compositors PCW Pytroll Contributors' Week labels Apr 26, 2019
@pnuu pnuu self-assigned this Apr 26, 2019
@pnuu
Copy link
Member Author

pnuu commented Apr 26, 2019

Some things to consider when implementing:

  • how to handle start_time for a static data
  • geotiff can be read with generic_image reader and has CRS info
  • other image formats with the CRS info given in config YAML?
  • use as is if the shape of the target geo def matches with the static image shape

@djhoese
Copy link
Member

djhoese commented Apr 26, 2019

For the static image loading from YAML, would it be useful to use PIL's resize to stretch the loaded image to the input dataset (https://stackoverflow.com/a/451580/433202)? Or would that cause issues if someone wanted to resample their data first, then use the static image on the resampled data where they would probably match size.

Which makes me think maybe a keyword argument for the compositor to say that the static image has to be the same shape as the input data? That way you could turn this on/off.

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 PCW Pytroll Contributors' Week
Development

Successfully merging a pull request may close this issue.

2 participants