Instead of using ExposureFormatter and the like it would be simpler for the butler to run FITS persistence directly. My proposal is as follows:
- In afw add Python functions readFitsWithOptions(path, options) and writeFitsWithOptions(path, options) to all classes that the butler may persist, including Exposure, MaskedImage, Image, Mask and all catalog classes,
- In those new functions the options argument is a daf.base.PropertySet containing the "additional data" provided to the butler. The functions parse that data and use that to call readFits or writeFits method appropriately.
- Note that the path argument can be anything supported by an overload of readFits or writeFits: a file path, fits::File or fits::MemFileManager.
- In daf_persistence the Fits IO functions will be simplified to call the new functions described above, and the same pair of functions can be used for image-like objects and catalogs.
A similar treatment will be required for other objects that the butler tries to persist as FITS using boost persistence.