Fix Version/s: None
Component/s: astro_metadata_translator, obs_base
Currently because MegaPrime and DECam use multi-extension FITS files to store data for all detectors in a single file, we need to have a special ingest task. It's easy to miss this and end up ingesting a single detector.
Investigate an alternative scheme where a file header is read from FITS as now, the instrument is determined and then a method on the instrument class can return additional information (such as headers indexed by HDU) if needed.
One final comment is that we probably don't want to read each header twice so whatever API the translator class/Instrument class uses it has to be able to say "primary HDU is fine, you can use that".
I have this all working and can ingest with DECam and CFHT without needing the specialist ingest task.
I encountered a bug in astropy with compressed image headers (like we have in testdata_cfht) but I work around it.
I think I can remove the special tasks on this ticket as well. Krzysztof Findeisen are there any uses of the DECam ingest task that I would not spot in a normal lsst_distrib jenkins build?
DM-29265 adds the DECam ingest task to an ap_verify config. The config wouldn't be used by anything other than full ap_verify runs. I don't know of any other references that wouldn't show up in an lsst org search.
Krzysztof Findeisen would you mind doing the review? It's a bit of code in metadata translator and minor changes elsewhere. I do change astrometadata translate to report all HDUs now.
I have left the stubs of the separate raw ingest tasks around with a deprecation notice.
Looking at the way ingest works (in the absence of an index file or sidecar) it currently does:
An alternative approach could be:
The advantage of the second is that this would embed the multiple HDU knowledge into a place that would allow it to be leveraged by the astrometadata write-index and write-sidecar commands. Putting it in the Instrument class completely separates it from that and I don't think we gain anything by doing so.