-
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
Add initial Scene/DataTree conversion via Scene.to_xarray_datatree
#2452
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2452 +/- ##
==========================================
+ Coverage 94.75% 94.81% +0.05%
==========================================
Files 335 340 +5
Lines 48852 49417 +565
==========================================
+ Hits 46291 46853 +562
- Misses 2561 2564 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 75 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I think that this could also be really useful for #2171. Currently the sorting is done by platform/sensor and the by area because this made the most sense when I started. But I think it could be useful to display the |
Related to #2352, I thought I'd add a
Scene.to_xarray_datatree
method to the Scene. I want to use this as a stepping stone into more DataTree usage in Satpy and see where it takes us. I also wanted a reason to play around with DataTree more and see how it goes.At the time of writing this is a pretty simple implementation, but also provides a lot of flexibility. When discussing this concept in #2352 I brought up the ideas of "schemes" or predefined tree-structuring methods that users could choose from. For example, "area"-based or "DataID"-based organizing. As I started working on this (TDD for the win!) I realized I could just structure it as "what metadata keys should I use for each 'group'". This means users can select the level of the hierarchy of the tree. For example, group by platform_name and sensor by specifying
group_keys=("platform_name", "sensor")
.So at this point, this works as described above, but I'm looking for feedback for others. I seem to remember @mraspaud and @gerritholl being part of this conversation and @ghiggi doing some reworking of
Scene.to_xarray_dataset
related to CF compatibility. I'm curious what you guys think of this.There is still a lot TODO like: