Change the color palette IR108

74 views
Skip to first unread message

Ionescu Andreea

unread,
Jun 10, 2022, 5:45:44 AM6/10/22
to pytroll
Hello all,

I am new user in the pytroll pakeges and I need your help.
I want to show channel IR_108 and I need changed the color palette. 
I atached 2 files: the first - ir_108_correct is the file whan I want and the file ir_108_faild is the file obteind by me. I don't used the composition in my code only the command "global_scene.load(["IR_108")].
Can you have any idee, please?
Thank you so much
ir_108_faild.png
ir_108_correct.png

lobsiger...@gmail.com

unread,
Jun 10, 2022, 6:49:34 AM6/10/22
to pytroll
Hi,

try composites "_ir108" or "ir108_3d"

Ernst

David Hoese

unread,
Jun 10, 2022, 9:34:36 PM6/10/22
to pyt...@googlegroups.com
Hi,

The default enhancement (a.k.a. scaling) for a brightness temperature
image is dynamic between the min and max of the data so it is
understandable that it might not be what you're looking for. I
personally have never liked that the clouds are black instead of white.

You can try customizing the enhancement by following the instructions in
the second half of this section of documentation:

https://satpy.readthedocs.io/en/stable/composites.html#enhancing-the-images

You can find more information about custom satpy configuration here:
https://satpy.readthedocs.io/en/stable/config.html#component-configuration

You can look for examples of enhancement configurations here:
https://github.com/pytroll/satpy/tree/main/satpy/etc/enhancements

Dave
> --
> You received this message because you are subscribed to the Google
> Groups "pytroll" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pytroll+u...@googlegroups.com
> <mailto:pytroll+u...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pytroll/fc49e43f-c16a-4582-86f5-96b524185f46n%40googlegroups.com
> <https://groups.google.com/d/msgid/pytroll/fc49e43f-c16a-4582-86f5-96b524185f46n%40googlegroups.com?utm_medium=email&utm_source=footer>.

lobsiger...@gmail.com

unread,
Jun 11, 2022, 2:09:38 PM6/11/22
to pytroll
Andreea,

once you have all 12 seviri channels files from one time slot decompressed somewhere, you can do impressive things with satpy out of the box.
This link lets you download about 120 jpg images in a zip file that I made today. The "wetransfer" download link will expire in one week from now.


Ernst

Ionescu Andreea

unread,
Jun 14, 2022, 1:53:55 AM6/14/22
to pytroll
Hi,
I failed to make the image above. Can you tell me the steps please in more detail?
Thanks!

Ionescu Andreea

unread,
Jun 14, 2022, 4:06:58 AM6/14/22
to pytroll
HI, 
I tried to create my own composite but I failed to make the image like ir_108_correct. I don't know why is so "white" my image.
Please help me
Thank you!

David Hoese

unread,
Jun 14, 2022, 8:15:09 AM6/14/22
to pyt...@googlegroups.com
Could you tell us what you've done so far? What files did you create or
change? What code did you run? Did you do any other changes like setting
environment variables?

Dave
> <https://groups.google.com/d/msgid/pytroll/fc49e43f-c16a-4582-86f5-96b524185f46n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pytroll/fc49e43f-c16a-4582-86f5-96b524185f46n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "pytroll" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pytroll+u...@googlegroups.com
> <mailto:pytroll+u...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pytroll/9986ebc2-59ca-4410-bd8d-a1f287b369efn%40googlegroups.com
> <https://groups.google.com/d/msgid/pytroll/9986ebc2-59ca-4410-bd8d-a1f287b369efn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Ionescu Andreea

unread,
Jun 15, 2022, 7:03:10 AM6/15/22
to pytroll
In the generic.yaml I wrote this:


enhancements:
ir108_invert:
name: IR_108
operations:
- name: inverse
method: !!python/name:satpy.enhancements.invert
args: [True]
- name: stretch
method: !!python/name:satpy.enhancements.stretch
kwargs:
stretch: linear


How can I used this in my code?
I tried with : composite='IR_108'
                      img=to_image('IR_108')
                      img.invert([True])

I think I need IR_108-inverted
Thank you!

lobsiger...@gmail.com

unread,
Jun 15, 2022, 7:41:43 AM6/15/22
to pytroll
Hi,

You need an entry in your personal ../composites/visir.yaml and one in your ../enhancements/generic.yaml
See how this is done for ir108_3d in your (env) .../satpy/etc/composites/ and .../satpy/etc/enhancements/

Ernst

David Hoese

unread,
Jun 15, 2022, 8:24:15 AM6/15/22
to pyt...@googlegroups.com
You only need to modify the composites if you want to leave the original
band unchanged (by creating a "copy" as a composite). If you only change
the enhancements then you will change the scaling for that band which I
think in this case is what they want.

As for your enhancement changes, the formatting got a little messed up
in the email, but assuming your indentation is correct you need to
change the linear stretch to be a "crude" stretch like this:

https://github.com/pytroll/satpy/blob/bafe54e1d3c598f1d70b616e8d27bb2b25c62190/satpy/etc/enhancements/generic.yaml#L12-L14

The "linear" stretch is the dynamic stretching that you *don't* want.
With the crude stretch you can set the min/max limits of the data. If
you flip the limits (min=high number, max=low number) then you should be
able to remove the "inverse" step.

Dave
> <https://groups.google.com/d/msgid/pytroll/9986ebc2-59ca-4410-bd8d-a1f287b369efn%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pytroll/9986ebc2-59ca-4410-bd8d-a1f287b369efn%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "pytroll" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pytroll+u...@googlegroups.com
> <mailto:pytroll+u...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pytroll/3add18b8-5686-4b42-b8d0-db0455c26ce1n%40googlegroups.com
> <https://groups.google.com/d/msgid/pytroll/3add18b8-5686-4b42-b8d0-db0455c26ce1n%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages