This star list is then fed through the setstage (Section 5.7.7) program which determines the x, y coordinates of the stars and the amount of vignetting by the guider.
This list is then sorted to find the brightest unvignetted star that does not block the science chip. If no star is found, the script exits with a non-zero code. Finally the stage is positioned to the star's proper position.