Proposal: New enhancement interface
@djhoese is already working on this.
Since Apr 20, 2018.
Assessment
This issue has not been assessed yet.
Description
Problem description
The current method for converting data from a data array to an image is limited to a single Scene.save_datasets call. While this is useful for the user since they only have to run one function, it is limiting for anyone who wants to customize things (a major problem in satpy). This caused to_enhanced_image to be created which returns an XRImage that can be used for further customization. This made a lot more sense when we used the masked array based Image class, but now XRImage is just a wrapper around an xarray DataArray.
I propose we add an enhance method to the Scene that returns a new scene with enhanced image arrays. It could do this inplace too, but I'm not sure I like that as the default. The resulting call sequence might look like:
scn = Scene(...)
scn.load([...])
rs_scn = scn.resample(...)
enh_scn = rs_scn.enhance()
enh_scn.save_datasets()
This allows more freedom to customize the enhanced datasets or to not enhance them at all (don't call enhance). It also declutters the save_datasets available keyword arguments.
Admittedly I was the one who originally wanted enhancements to be something the writer had control over, but I'm starting to change my mind the more I use satpy. The original idea was that different writers might want different enhancements. I think for those cases it is up to the user to change what enhancements are used or for the writer to do the enhancements itself when it makes sense (ex. scale factor and offset for NetCDF writing).
Additionally this would make it easier to have different enhancements for the same datasets and save them to the same file format; something I believe @pnuu needed.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 335
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pytroll/satpy
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
bug component:compositors
-
bug component:readers
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100