A system for downhole optical analysis includes a housing forming at least part of a pressure barrier. The system also includes a window, formed at an end of the housing, the window being at least semi-transparent to permit light to travel through the window. The system further includes at least one light source, arranged within the housing, wherein the at least one light source is configured to emit a beam of light at a wavelength to enable non-contact, optical cleaning of the window, the wavelength being selected to reduce interaction with the window while heating a fluid film formed on the window outside the housing.