  We have developed observation control software for the Immersion GRating
INfrared Spectrometer (IGRINS) slit-viewing camera module, which maintains the
position of an astronomical target on the spectroscopic slit. It is composed of
several packages that monitor and control the system, acquire the images, and
compensate for the tracking error by sending tracking feedback information to
the telescope control system. For efficient development and maintenance of each
software package, we have applied software engineering methods, i.e., a spiral
software development with model-based design. It is not trivial to define the
shape and center of astronomical object point spread functions (PSFs), which do
not have symmetric Gaussian profiles in short exposure (<4 s) guiding images.
Efforts to determine the PSF centroid are additionally complicated by the core
saturation of bright guide stars. We have applied both a two-dimensional
Gaussian fitting algorithm (2DGA) and center balancing algorithm (CBA) to
identify an appropriate method for IGRINS in the near-infrared K-band. The CBA
derives the expected center position along the slit-width by referencing the
spillover flux ratio of the PSF wings on both sides of the slit. In this
research, we have compared the accuracy and reliability of the CBA to the 2DGA
by using data from IGRINS commissioning observations at McDonald Observatory.
We find that the performance of each algorithm depends on the brightness of the
targets and the seeing conditions, with the CBA performing better in typical
observing scenarios. The algorithms and test results we present can be utilized
with future spectroscopic slit observations in various observing conditions and
for a variety of spectrograph designs.
