astro_metadata_translator and the data ID packers in daf_butler (which may move to obs_base on
DM-21855) currently duplicate logic that mangles certain data IDs into single integers. Various downstream code probably assumes that logic is identical, which means this is a fragility problem.
I can think of a few ways to fix this:
- If the mangled ID in astro_metadata_translator is present just to provide an ID to afw.image.VisitInfo, we might want to consider deprecating and removing that field from VisitInfo, and dropping the logic from astro_metadata_translator (I think we might want to drop it from VisitInfo regardless - it's the only place one of our data product files records anything about its own data ID, and I'm not convinced we need it).
- Move the actual implementation the mangling in astro_metadata_translator to a separate, public, free function or class so the DimensionPacker in daf_butler/obs_base can call it.