Closed jpaul-git closed 3 years ago
So "good news" is I get the same end result as you when I do this with my own RadC files. However, my cimss_true_color_sunz_rayleigh
produces an all black image and not the true color you are getting. If I replace the true color background in the background compositor I get something like what you're hoping for:
I'll look at your cimss true color closer and see what I can figure out.
So I should point out that when I saved the cimss true color I had also loaded the colorized ir raw and the final IR_sandwich_true_with_background. If I save just the cimss ture color by itself then it looks fine. I have a feeling one of the composites is "corrupting" one of the other composites.
What was the other true color composite that produces the expected result?
true_color
was what I used for the above image.
Generating the cimss_true_color_sunz_rayleigh
and colorized_ir_clouds_abi_cool
together produces two perfectly valid images. If instead of the abi cool, I use ir_sandwich_true_abi_alpha
then the true color comes out black.
Edit: I think I found it. The SandwichCompositor does an inplace operation.
Weird. Both true_color
and cimss_true_color_sunz_rayleigh
use the same compositors. The cimss
variant has specialized enhancements method as the last step, so could that be the culprit? With a quick glance can't spot anything else that's different between the two.
Ok, an inplace operation does sound like the correct cause.
@jpaul-git I'm not sure how comfortable you are installing packages from git, but if you could try installing Satpy from my branch in #1690 it would be great to have another data point showing that my fix actually fixes this. You should be able to do:
pip install -U git+https://github.com/djhoese/satpy.git@bugfix-sandwich-inplace
Note that if you do this, after you've tested it, you'll want to reinstall the package from conda or PyPI or wherever you originally installed it from.
@djhoese Thank you! I downloaded your Satpy package from your github branch and tested it using my composites and enhancements. The image comes out as expected, with the IR Sandwich clouds and the True Color background. I downloaded it into it's own environment. Would I still need to reinstall the package from conda?
No, if it is in its own environment then that's fine. I just wanted to make sure you used a stable version of Satpy in the future.
Thank you so much for helping me! The images look amazing.
Describe the Bug
When using the BackgroundCompositor on a foreground picture (RGBA) and a background picture (RGB) instead of showing the background picture wherever the foreground picture is transparent, the background turns completely black instead.
Goal: To create an IR Sandwich Product with the background as the True Color Image. This can be done one other way, but the True Color image loses it's vibrant colors.
To Reproduce
The following composites and enhancements are used in the abi.yaml files:
CIMSS True Color Sunz Rayleigh (composites/abi.yaml):
Colorize the IR Clouds (composites/abi.yaml):
Using the Color enhancement (enhancements/abi.yaml):
To create an image with the luminance from the True Color image and the Colorized IR Clouds
Then Mask this luminance enhanced colorized IR to get only the coldest clouds:
Then feed this luminance enhance colorized IR of only the coldest clouds in the BackgroundCompositor with the True Color image as the background.
Python Code
Expected Results This should produce a True Color image with the coldest cloud tops colorized according to the IR brightness temperatures.
Actual results
Screenshots cimss_true_color_sunz_rayleigh image:
colorized_ir_clouds_abi_cool image:
ir_sandwich_true_abi_alpha image (the end result should look similar to this but with more vibrant colors for the land like the true color image above has):
ir_colorized_raw image:
IR_sandwich_true_with_background image (the end result):
Environment Info: