PRO Show, pic, win, title=tit, free=free, scale=scale0, pos=pos, $ center=center, is_stokes=isto, opt=opt, use_exist=usex ;+ ; NAME: ; SHOW ; PURPOSE: ; Show an image in an own window of apropriate size. ; CATEGORY: ; Image display ; CALLING SEQUENCE: ; SHOW, IMAGE [, WINDOW] [, KEYWORDS] ; INPUTS: ; IMAGE : 2-d array. ; OPTIONAL INPUT PARAMETER: ; WINDOW: Window number to use for showing IMAGE. DEFAULT: 1 ; KEYWORDS: ; TITLE : (input) String. Title for the window. ; ; FREE : (Flag) Find a currently unused window number. ; ; SCALE : (input) Scale factor. Image is rescaled by a factor ; scale in each direction or (if scale is a vector) to ; xsize*scale(0), ysize*scale(1). ; ; POS : (input) Position of the window on screen ; ; CENTER: (Flag) Center window in screen ; ; OPT : (Flag) Perform histogram optimisation to display (using ; routine histo_opt). Good for data with some extreme ; bright or dark points. ; ; IS_STO: (input) Image is a 3-d array (*,*,2) with polarimetric ; data. Depending on the sign of IS_STO, either the sum ; or the difference of the two parts is shown, normally ; refering to Stokes I or Stokes Q/U/V. ; OUTPUTS: ; none. ; SIDE EFFECTS: ; A new window is creadted. If the window with the given number ; already existed before, it is deleted. ; PROCEDURE: ; Get size of IMAGE and eventually free window number. Create ; Window. Rescale and TVSCL IMAGE. ; MODIFICATION HISTORY: ; 10-Dec-1989 P.Suetterlin, KIS ; 02-Feb-1994 Added Scale facility ;- IF n_params() LT 2 THEN win = 1 IF NOT keyword_set(free) THEN free = 0 IF NOT keyword_set(tit) THEN tit = 'Show Image '+strtrim(win, 2) IF NOT keyword_set(scale0) THEN BEGIN scale = [1, 1] noscale = 1 ENDIF ELSE BEGIN IF n_elements(scale0) EQ 1 THEN $ scale = [scale0, scale0] $ ELSE $ scale = scale0 IF min(scale EQ [1, 1]) EQ 1 THEN noscale = 1 ELSE noscale = 0 ENDELSE IF n_elements(scale) EQ 1 THEN scale = [scale, scale] IF keyword_set(isto) THEN BEGIN IF isto GT 0 THEN $ pic1 = pic(*, *, 0)+pic(*, *, 1) $ ELSE $ pic1 = pic(*, *, 0)-pic(*, *, 1) s = size(pic1) ENDIF ELSE BEGIN s = size(pic) IF (s(0) NE 2) THEN BEGIN print, 'Falsche Dimensionen: nur 2-dim.' GOTO, aus ENDIF pic1 = pic ENDELSE IF keyword_set(usex) THEN BEGIN device, window_stat = stat IF stat(win) GT 0 THEN BEGIN wset, win wshow, icon = 0 GOTO, have_win ENDIF ENDIF IF keyword_set(pos) THEN BEGIN window, win, xsize = s(1)*scale(0), ysize = s(2)*scale(1), tit = tit, $ free = free, xpos = pos(0), ypos = pos(1) ENDIF ELSE IF keyword_set(center) THEN BEGIN device, get_screen_size=s_scr window, win, xsize=s(1)*scale(0), ysize=s(2)*scale(1), tit=tit, $ free = free, xpos = (s_scr(0)-s(1)*scale(0))/2, $ ypos = (s_scr(1)-s(2)*scale(1))/2 ENDIF ELSE $ window, win, xsi = s(1)*scale(0), ysi = s(2)*scale(1), free = free, tit = tit Have_win: IF noscale EQ 0 THEN $ pic1 = rescale(temporary(pic1), s(1)*scale(0), s(2)*scale(1)) IF keyword_set(opt) THEN $ tvscl, histo_opt(pic1) $ ELSE BEGIN ; IF !d.n_colors GT 256 THEN BEGIN ; tvlct, r, g, b, /get ; tvscl, r(pic), 0, 0, 1 ; tvscl, g(pic), 0, 0, 2 ; tvscl, b(pic), 0, 0, 3 ; ENDIF ELSE $ tvscl, pic1 ENDELSE ;IF keyword_set(isto) THEN BEGIN ; IF noscale THEN $ ; tvscl, pic1 $ ; ELSE $ ; tvscl, rescale(pic1, s(1)*scale(0), s(2)*scale(1)) ;ENDIF ELSE BEGIN ; IF noscale THEN $ ; tvscl, pic $ ; ELSE $ ; tvscl, rescale(pic, s(1)*scale(0), s(2)*scale(1)) ;ENDELSE Aus: END