-
Notifications
You must be signed in to change notification settings - Fork 303
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
Save geotiff with keep_palette still add an alpha band #2143
Comments
Side note: I see you have What composite/product are you saving? I see AHI B01 in the geotiff metadata. For This is sort of described here: If you are not worried about colormaps and you just want an L image with no Alpha band then you could specify instead This is described in multiple places for better or worse, but probably in most detail here: |
Thanks a lot, I think Actually in my processing I do something like that : scn = Scene(reader='ahi_hsd', filenames=files)
...
ds = scn[channel]
dataset_scaled = xr.apply_ufunc(scaling_func, ds)
...
crop_channel.save_dataset(channel, writer='geotiff', filename=str(fp), fill_value=0, ...) So yes I'm already converting my data from albedo values to pixel, following an internal mapping. PS : Many thanks for the quick answer and for this amazing lib ! Automatic generation of pre-defined composite is really a killer |
Glad that worked! Let us know if you have any problems and thanks for the kind words. |
Describe the bug
When saving an image with the code below, I expect only one band to be written on my Tiff file.
However, at one point my XRImage has mode = "L", and thus not respecting my "keep_palette" argument ..
Any thoughs on this ?
Might be related to #640
To Reproduce
My output looks like :
By following step by step, I got to the point that :
My XRImage is created with mode = "L" by default, somere around here : https://github.com/pytroll/satpy/blob/main/satpy/writers/__init__.py#L443
At XRImage.finalise() https://github.com/pytroll/trollimage/blob/main/trollimage/xrimage.py#L1110
and therefore still adding an extra band
Environment Info:
The text was updated successfully, but these errors were encountered: