Telescopes employing linear detector arrays in a push-broom configuration enable the reconstruction of two-dimensional images of the Earth by recombining successive one-dimensional captures. This configuration, which typically features a wide field of view in the across-track direction but a narrow one in the along-track direction, often suffers from stray light, which degrades optical quality by introducing artifacts into the images. With increasingly stringent performance requirements, there is a critical need to implement effective stray light (SL) correction algorithms in addition to control by design. We describe the development of such an algorithm, using the cloud imager (CLIM) linear detector array instrument as a case study. Our approach involves calibrating SL kernels obtained by illuminating the instrument with a point-like source from various angles. In the along-track direction, we interpolate the SL kernel for any field angle without initial assumptions about SL behavior. For the across-track direction, we employ a local shift variant assumption. When applied to images of a checkerboard scene, which includes transitions between bright and dark areas, our algorithm successfully reduces SL by two orders of magnitude, demonstrating its efficacy and potential for broader application in telescopes with linear detector array.