function [obsdata]=baseline(obsdata,wavelength,wavevector)
# 15 may 2011
# module description
#
# variables
# input: obsdata, wavelength
# temp:
# output: obsdata
# tokens:

	if (wavevector(1)<wavevector(columns(wavevector)))
		if (wavelength=='last')
			obsdata=obsdata-repmat(obsdata(:,columns(obsdata)),1,columns(obsdata)); # zeros the highest wavelength to correct for drift
		endif
	else
		obsdata=obsdata-repmat(obsdata(:,2),1,columns(obsdata)); # zeros the highest wavelength to correct for drift

	endif
endfunction
