function [obsdata]=baseline(obsdata,wavelength,wavevector)
% 15 may 2011
% module description
%
% variables
% input: obsdata, wavelength
% temp:
% output: obsdata
% tokens:
	tmp_wave=size(wavevector); %another hack forced by matlab
	tmp_obs=size(obsdata);%another hack forced by matlab
	if (wavevector(1)<wavevector(tmp_wave(2)))
		if (wavelength=='last')
			obsdata=obsdata-repmat(obsdata(:,tmp_obs(2)),1,tmp_obs(2)); % zeros the highest wavelength to correct for drift
		end
	else
		obsdata=obsdata-repmat(obsdata(:,2),1,tmp_obs(2)); % zeros the highest wavelength to correct for drift

	end
end
