pytroll/satpy

Set invert as a modifier when do composite

littlehell opened this issue · 2 comments

Hello,

I met a problem when I use satpy to generate MODIS RGB product.

When I want to generate an RGB product with ch1(R), ch2(G), and inversed ch31(B), then do projection and save as geotiff.

I think it would be easier to config this in to composites/modis.yaml if I can define a modifier named 'invert' or add invert to channel attribute directly, like:

 smoke_haze:
    compositor: !!python/name:satpy.composites.GenericCompositor
    prerequisites:
      - name: '1'
        modifiers: [ sunz_corrected, rayleigh_corrected ]
      - name: '2'
        modifiers: [ sunz_corrected, rayleigh_corrected ]
      - name: '31'
        modifiers:
            invert: true
    standard_name: smoke_haze

Is there any way to setup invert when I do composite? I tried with invert function of 'to_image' after composite but found I cannot do projection then because it lost the geo information.

Sencerely hope for your help, thanks.

Regards,
Hu

Hi,

At the moment, the way to invert a channel is to use enhancements. We do have a function called enhance2dataset that you can use that should preserve the area information: https://satpy.readthedocs.io/en/stable/api/satpy.composites.html#satpy.composites.enhance2dataset

Hi,

At the moment, the way to invert a channel is to use enhancements. We do have a function called enhance2dataset that you can use that should preserve the area information: https://satpy.readthedocs.io/en/stable/api/satpy.composites.html#satpy.composites.enhance2dataset

Hi,

This works, thanks!

Will close with issue.