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

Set invert as a modifier when do composite #2718

Closed
littlehell opened this issue Jan 12, 2024 · 2 comments
Closed

Set invert as a modifier when do composite #2718

littlehell opened this issue Jan 12, 2024 · 2 comments
Labels

Comments

@littlehell
Copy link

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

@mraspaud
Copy link
Member

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

@littlehell
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants