;+NAME/ONE LINE DESCRIPTION OF ROUTINE: ; OSLICE overplots a slice of a 2-d array. ; ; This progam will overplot a slice of a 2-d array (image) ; from (x1,y1) to (x2,y2) after the program SLICE has been used. ; SMOOTH = is the optional width in pixels of a boxcar ; smoothing (SMOOTH) to be applied to the slice (not to the original data). ; MEDIAN = is the flag (/median) to be set if a median filter (MEDIAN) ; rather than a boxcar smoothing is desired. ; ; The corners (x1,y1,x2,y2) of the slice are saved in a common ; block and only need to be specified the first time SLICE ; is used and any time new corners are desired. ; ; The program SLICE should be used to plot the first slice. ;- PRO OSLICE, ARR, X1, Y1, X2, Y2, SMOOTH=smth, MEDIAN=MEDIAN common corners, old_x1,old_y1,old_x2,old_y2 common slice_style, old_style if n_params(0) eq 1 then begin x1 = old_x1 y1 = old_y1 x2 = old_x2 y2 = old_y2 endif x1 = float(x1) & x2 = float(x2) y1 = float(y1) & y2 = float(y2) sinpa = (x2-x1)/sqrt((x2-x1)^2 + (y2-y1)^2) cospa = (y2-y1)/sqrt((x2-x1)^2 + (y2-y1)^2) x = fix(findgen(1200)*sinpa) + x1 y = fix(findgen(1200)*cospa) + y1 if (y2 ge y1) then x = x(where(y le y2)) $ else x = x(where(y ge y2)) if (x2 ge x1) then y = y(where(x le x2)) $ else y = y(where(x ge x2)) x = x(where(y ge 0)) !p.linestyle = (old_style+1)mod(6) oldcolor = !p.color if (!d.name eq 'X') then begin plotcolor !p.color = !p.linestyle + 2 endif if (n_elements(smth) eq 0) then oplot, arr(x,y) else $ if keyword_set(median) then oplot,median(arr(x,y),smth)$ else oplot,smooth(arr(x,y),smth) !p.linestyle = 0 !p.color = oldcolor old_x1 = x1 old_y1 = y1 old_x2 = x2 old_y2 = y2 old_style = old_style + 1 return end