Skip to content

Commit

Permalink
Replace hardcoded refcat names with a query.
Browse files Browse the repository at this point in the history
This still forces us to load refcats the pipelines don't use, but at
least prevents us from having to manually curate a list of known types.
  • Loading branch information
kfindeisen committed Apr 15, 2024
1 parent d51552a commit e936c99
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions python/activator/middleware_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1561,8 +1561,7 @@ def _get_refcat_types(butler):
refcat_types : iterable of `str` or `lsst.daf.butler.DatasetType`
The matching dataset type objects, or their names.
"""
# TODO: we can't queryDatasetTypes in just the refcats
# collection, so we have to specify a list here. Replace this
# with another solution ASAP.
return ["gaia", "panstarrs", "gaia_dr2_20200414", "ps1_pv3_3pi_20170110",
"atlas_refcat2_20220201", "gaia_dr3_20230707", "uw_stars_20240228"]
# Assume that any type that has ONLY a single spatial dimension, and a
# SimpleCatalog storage class, is a refcat.
return {t for t in butler.registry.queryDatasetTypes(...)
if t.storageClass_name == "SimpleCatalog" and len(t.dimensions) == 1 and t.dimensions.skypix}

0 comments on commit e936c99

Please sign in to comment.