-
Notifications
You must be signed in to change notification settings - Fork 107
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
Allow generating variables wanted from a list of h5 paths #504
Comments
Hey @andypbarrett!
Short answer: No. Now for the long answer. When we built it, the goal of the variables module was for it to construct a list like your example one of h5 paths, such that the user could have some control over selecting beams/groups/variables without actually needing to know/use h5py, have a granule to start with, or know anything about how data was grouped in hdf5 files. Our goal was/is to eliminate the hard coded lists we see in code examples (so I'm curious how you generated your list of h5 paths - did you manually pick them out? I know we have a HW example where it's based on number of layers in the path. More on this below.) That said, I think you present a fairly common use case where the user might already have a list they want to use to subset. The hack approach to doing what you're asking (presuming you're trying to use it to order subsetted data) would be:
This will blow up at some point (likely during order processing) if you have a typo or submit an invalid h5 path, because it completely bypasses all of the built in checks for valid h5 paths. A slightly longer approach that would go through the validation checks (if it doesn't get caught at
It goes without saying neither of these is probably a great direction to send users. Which gets us back to my earlier question about how you generated the list in the first place and then to what the typical use cases are we should add some new functionality around. Two options I can think of right away would be (1) allow the user to submit their own list of h5 paths, essentially providing a wrapper for the aforementioned "hacks"; (2) find a way to give the user more options for controlling their list during the "build" process ( I know you've spent a lot of time creating h5 path lists for various products/examples, so I'm excited to hear your input and ideas for how to make the variables module more versatile and user-friendly. |
I generated that list by hand based on common ATL03 variables used in producing ATL06 and ATL07. We are trying to produce a stripped-down h5 file for testing. But I think a list is a common enough use case. I wanted to avoid having to play around with var_list, beam_list, and keyword_list to come up with the logic to generate that list. The "hack" you present looks like what I want to do. So I propose adding a
These then get passed to This works but I get some extra variables returned. There also does not seem to be a default list for ATL03 - which is understandable. I don't know how I would generate that. I also suggest changing the PR in progress! |
Agreed, and you shouldn't have to mess around with trying to bend the logic to your will.
Hmmm... which ones? I'd be curious to look into this.
There are not default lists for any products that someone didn't contribute a list for (or directly share a list with me). If you have an inkling that there is some default list we could create (with the acknowledgement it will not be perfect), I'd be happy to add it.
Woohoo - thanks! All the other items you mentioned sound great - |
The extra variables were a result of a typo. It is fixed now and a PR created. For default vars for ATL03 I might need to touch-base on some linting issues. I've added you and Rachel as reviewers. |
I'm trying to subset ATL03 granules for a list of variables that I have as a list of H5 paths
However, I can not find an option in
Query.order_vars.append
to do this. I would expect to be able to do something like;Am I missing something?
I've tried
But this creates a long list of variables that I did not specify.
The text was updated successfully, but these errors were encountered: