59 def run(self, *, wcs, bbox):
60 """Re-fit the pointing from the WCSs in a visit.
64 wcs : `lsst.afw.geom.SkyWcs`
65 Target WCS to approximate.
66 bbox : `lsst.geom.Box2I`
67 The region where the WCS and its approximation are expected to be
72 results : `lsst.pipe.base.Struct`
73 A struct with the following attributes:
75 - ``wcs`` (`lsst.afw.geom.SkyWcs`): a copy of the input ``wcs``
76 with a SIP approximation attached.
77 - ``delta_sky`` (`lsst.geom.Angle`): maximum separation in
78 ``pixelToSky`` values on a grid offset from the one used for the
80 - ``delta_pixel`` (`float`): maximum separation in ``skyToPixel``
81 values on a grid offset from the one used for the fit.
84 math.ceil(bbox.width / self.config.grid_spacing) + 1,
85 math.ceil(bbox.height / self.config.grid_spacing) + 1,
88 delta_sky, delta_pixel = approx.computeDeltas()
89 self.log.verbose(
'Fit TAN-SIP approximation good to %0.2g" and %0.2g pixels.',
90 delta_sky.asArcseconds(), delta_pixel)
92 wcs=wcs.copyWithFitsApproximation(approx.getWcs()),
94 delta_pixel=delta_pixel,