Viewing contents of file '../idllib/astron/contrib/varosi/code/allpro/de_stripe_1.pro'
function de_stripe_1, image

;Reduce the even/odd channel amplifier variation (vertical stripes) by using
;Least squares fit to determine the 2nd order polynomial relation
;  between adjacent channels.
;Frank Varosi STX @ NASA/GSFC 1991

	sim = size( image )

	if (sim(0) NE 2) then begin
		message,"need an image (2-D matrix)",/INFO
		return, image
	   endif

	if N_elements( pdeg ) NE 1 then pdeg=1
	imfilt = transpose( image )
	nx = sim(2)
	ny = sim(1)
	ie = indgen( ny/2 )*2
	io = ie+1

	LLsq1d, imfilt(*,io), imfilt(*,ie), factor, offset, dummy, rmserr

	if !DEBUG then print,offset,factor,rmserr

	for i=0,ny/2-1 do imfilt(0,io(i)) = factor * imfilt(*,io(i)) + offset

return, transpose( imfilt )
end