compute_tso_offset_center

jwst.extract_2d.grisms.compute_tso_offset_center(input_model: ImageModel, distortion: CompoundModel) tuple[float, float][source]

Accurately compute the offset between the source position and aperture center.

In the case that an Offset Special Requirement is requested in the APT, the source is no longer at the aperture reference point. The dither.x_offset and dither.y_offset values encode the offset in units of arcseconds. They need to be translated from Ideal to detector coordinates and into pixel units.

Parameters:
input_modelImageModel

The input data model.

distortionDistortionModel

The distortion model.

Returns:
xc, ycfloat

The x and y center of the image in direct image coordinates.

Raises:
ValueError

The distortion model requires less than four or more than five inputs.

Notes

The wavelength is not used for the distortion calculation between v2v3 and direct image coordinates, so this can be hardcoded to NaN.