datacube-core
datacube-core copied to clipboard
need support product grouping in core
ASTERS
are not part of DEA products, but due to alphabetical ordering they are always the first products showing up on query dc.list_products()
core should add a feature to support pre-identified grouping, ie.
dc.list_products(group='c3')
Yep, being able to sort our datasets by the "Baseline satellite data", "Inland water" etc groupings would be really nice!
one potential solution is to add product_category
to product metadata definition, and to query against it
[8:38 AM] Paul Haesler If product_category was listed in the metadata_type as a search field, you could use dc.index.products.search_robust(product_category="foo") - but you'd still need to trawl through the results manually. search_robust is the only method provided for searching products, and it's really intended for internal use by the dataset search methods rather than direct user use.
Even then, it's highly inefficient - there's an implicit assumption that the product table is small enough that it's OK to do a full table scan every query, so honestly, you may as well just do that manually. [8:40 AM] Paul Haesler The search_robust code would look something like:
[ prod for prod, unmatchable in dc.index.search_robust(product_category="foo") if not unmatchable]
As noted in Teams, a products version of search_by_metadata
would be doable.
Oh correction to above:
[ prod for prod, unmatchable in dc.index.products.search_robust(product_category="foo") if not unmatchable]
is equivalent to:
dc.index.products.search(product_category="foo")
But again, this requires product_category to be configured search field.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.