first working version, x y and wavelength smoothing, saving images