Skip to content

Commit 8762a4b

Browse files
committed
make distortionCorrect() handle existing rectification model properly
1 parent ef0a63e commit 8762a4b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

geminidr/core/primitives_spect.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,14 @@ def determineDistortion(self, adinputs=None, **params):
15371537
else:
15381538
has_rect_model = True
15391539
in_coords = rect_model(*in_coords)
1540-
ref_coords = rect_model(*ref_coords)
1540+
# For a vertically-dispersed spectrum, the rectification
1541+
# model alters X as a function of Y. Therefore, because
1542+
# incoords and ref_coords have different Y for the same X,
1543+
# putting them *both* through the rectification model will
1544+
# produce different X values, which is not what we want.
1545+
# S0 replace the X values in ref_coords with the ones in
1546+
# in_coords. Coords are *always* (x, y)
1547+
ref_coords[dispaxis] = in_coords[dispaxis]
15411548

15421549
# The model is computed entirely in the pixel coordinate frame
15431550
# of the data, so it could be used as a gWCS object

0 commit comments

Comments
 (0)