Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Multiscene blend with weights #2275
Multiscene blend with weights #2275
Changes from 2 commits
1ec54cf
7eba546
a7d5ee7
d4bec06
6a3b52e
d20d4de
51df85e
d32eeeb
4091526
1abfc5a
b28df3f
e262e12
24b9153
695b98d
6627d48
80ff2a0
818b0f1
c2a90d8
248d449
f4b0874
0def84a
3b718ab
505aa24
2d38257
b5adf6a
5e91383
897df3d
0b187dd
c987b5d
933de7b
3c125dc
238c71c
c76e790
8baca79
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may have discussed this already, but first or last dataset? Or should it be a merge of the two? That way start_time and end_time should be handled "properly".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think we briefly discussed it. It is not obvious to me what you should do to make it intuitive and right. Which is why I would prefer to keep it as simple as possible. It feels like it will depend on the use case. It maybe that some scenes are not contributing at all to the final product, though they have been part of the stacking/blending process. Sounds like we should perhaps make a function that does this blending of attributes, and that way at least it will be more explicit in the code for future adaptations/changes? Then I would suggest we keep it simple what that function then actually does for now. I would go for a special treatment of the scene start and end times, and take from either first or last for the rest of the attributes? What else, besides times need special care?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
satpy/satpy/dataset/metadata.py
Lines 30 to 48 in 9a496eb
The function already exists ^. But it looks like it doesn't handle start/end time the way I thought it would. That special handling is apparently only in the internal reader code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Now I have changed the tests so that the blended scene has the start and end times set to the oldest
start_time
and the newestend_time
of the scenes in the weighted stack. And the test pass with this code in the stack function:I should of course put that time calculation in a separate function. But I suppose you would like to have a
combine_metadata
function that also handle the times as expected?Here I am not averaging but looking for the time span that describes all the data resulting in the blended scene.
Also, do you think I should handle the case when a scene does not have a start and an end time, and how?
I would tend to require in that case that the user provides scenes that have start/end times! Or should all scenes have that (requirement of all readers)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djhoese I feel like this is growing, so hope I can finish it soon and then we could add more complexity and more clever handling of attributes etc in other/future PRs when that becomes needed, does that sound reasonable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am OK keeping this as the first Scene metadata for now. If you have the time I think
combine_metadata
would at least be more accurate. If you also have the time a future PR to combine_metadata to min/max start/end time would be appreciated. I know the conversation has come up in the past so hopefully I'm not forgetting some reason for why it isn't already that way.