This proposal changes the way the initial "raw" WCS – what is returned by butler.get("raw_wcs") or, equivalently butler.get("raw").getWcs() – is determined. The current implementation uses the standard FITS header keys (CRVAL, CRPIX, CDX_Y) to create a SkyWcs. That SkyWcs is passed to ip_isr, where it is optionally updated with a camera geometry-defined optical distortion model, and subsequently used by the astrometric calibration task for the initial reference catalog match. Here, the proposal is to build this initial "raw" WCS based on a combination of telescope boresight and rotation angle (from VisitInfo) and detector positions and optical distortion (from the camera geometry). This means that ip_isr will no longer attempt to create a distorted WCS (previously configured via addDistortionModel): the SkyWcs object attached to the raw will always be our best guess at the true pixel->sky transformation.
Doing this as part of the butler handling of raw exposures simplifies our WCS code paths, as ISR will no longer be able to potentially overwrite the SkyWcs. This was a source of confusion during the investigation phase of DM-19943: there were multiple possible places that could generate the input SkyWcs used to initialize AstrometryTask.
As part of this change, we will add a "raw_header_wcs" butler dataset type to allow users to get at the FITS header WCS stored in the raw exposure (what was previously returned by butler.get("raw_wcs")).
This approach avoids answering some important questions in the gen3 butler regarding versioned camera geometry and the provenance of the raw WCS. We will deal with those questions once the Gen2 butler has been retired, to avoid having to implement two different systems for said versioning and provenance.