FUNCTION Kont, pic, ugrenz, ogrenz, norm=norm, y=y ;+ ; NAME: ; KONT ; PURPOSE: ; Compute the continuum intensities of 2-d spectra ; CATEGORY: ; ; CALLING SEQUENCE: ; RESULT = KONT( IMAGE [, LOW [, HIGH]] [,/NORM] [,/Y] ) ; INPUTS: ; IMAGE : 2-d array with spectrum. X-direction is dispersion. ; OPTIONAL INPUT PARAMETER: ; LOW : starting coloumn of continuum. DEFAULT: 0 ; HIGH : Last coloumn of continuum. DEFAULT: Xsize-1 ; KEYWORDS: ; NORM : (Flag) normalize the result to an average of 100 ; Y : (Flag) By default, rows are averaged. With Y set, ; columns are averaged (so kont(pic,/y) is identical to ; kont(transpose(pic))). ; OUTPUTS: ; RESULT: 1-d array of size Ysize. Contains for each row the ; average of (LOW:HIGH) ; MODIFICATION HISTORY: ; 13-Feb-1989 P.Suetterlin, KIS ;- s = size(pic) IF s(0) NE 2 THEN message, 'Only 2-dim Arrays !' resx = s(1) resy = s(2) IF keyword_set(y) THEN BEGIN temp = fltarr(resx) IF N_Params() LT 3 THEN BEGIN ogrenz = resy-1 IF n_params() LT 2 THEN BEGIN ugrenz = 0 ENDIF ENDIF FOR i = 0, resx-1 DO temp(i) = $ total(pic(i, ugrenz:ogrenz))/(ogrenz-ugrenz+1) IF keyword_set(norm) THEN temp = 100*temp/total(temp)*resx ENDIF ELSE BEGIN temp = fltarr(resy) IF N_Params() LT 3 THEN BEGIN ogrenz = resx-1 IF n_params() LT 2 THEN BEGIN ugrenz = 0 ENDIF ENDIF FOR i = 0, resy-1 DO temp(i) = total(pic(ugrenz:ogrenz, $ $ i))/(ogrenz-ugrenz+1) IF keyword_set(norm) THEN temp = 100*temp/total(temp)*resy ENDELSE Return, temp END