pro display,im,low,high,z=z,sm=sm,cont=cont,wnum=wnum,nointer=nointer,$ ox,oy,kern=kern,shift=shift,nw=nw if n_params(0) lt 1 then begin print,"display,im,low,high,z=z,sm=sm,shift=shift (,ox,oy)" print,"Display image im, scaling low - high, z=zoom, sm=smooth factor" print,"/nointer - override cubic interpolation when magnifying image" print,"wnum = wnum - set window no. for image" print,"Optional outputs: print,"kern = kern - returns gaussian kernal if sm ne 0" print,"ox,oy - offsets from window corner for use with curval" print,"/shift - shift image by 1 pix in x,y to correct for xselect binning" print,"Sample usage: " print,"display,im,0,10,z=3,wnum=1,sm=1.5,ox,oy" return endif im2 = float(im) if n_elements(sm) gt 0 then begin im2 = gauss_smooth(im,sm) ; boxsz = fix(sm*4+0.5)+1 ; kern = fltarr(boxsz,boxsz) ; norm = 1/(2*!pi*sm^2) ; midl = (boxsz-1)/2. ; for x = 0,boxsz-1 do for y = 0,boxsz-1 do $ ; kern(x,y) = norm*exp((-(x-midl)^2-(y-midl)^2)/(2*sm^2)) ; im2 = convol(im2,kern,center=1) endif if n_elements(z) gt 0 then begin sz = size(im2) if keyword_set(nointer) then im2 = congrid(im2,sz(1)*z,sz(2)*z) $ else im2 = congrid(im2,sz(1)*z,sz(2)*z,/cubic) endif else z = 1 if keyword_set(shift) then shift = z else shift = 0 sz2 = size(im2) print,'Minmax of processed image: ',minmax(im2) print,'Size of processed image: ',strn(sz2(1)),' X ',strn(sz2(2)) if n_elements(wnum) eq 0 then wnum = 0 if not keyword_set(nw) then $ window,wnum,xsize=sz2(1)*1.25,ysize=sz2(2)*1.25 zx = !d.x_vsize/float(sz2(1)) - 1 zy = !d.y_vsize/float(sz2(2)) - 1 print,'Effective x,y zoom: ',strn(zx),' ',strn(zy) if n_elements(cont) gt 0 then image_cont,im2 else $ ; tv,bytscl(im2,low,high),1.115*z+0.115*sz2(1),1.115*z+0.115*sz2(2) ; tv,bytscl(im2,low,high),0.75*z+0.25*sz2(1)/2,0.75*z+0.25*sz2(2)/2 if n_elements(ox) eq 0 then ox = shift+zx*sz2(1)/2 if n_elements(oy) eq 0 then oy = shift+zy*sz2(2)/2 tv,bytscl(im2,low,high),ox,oy ; stop if !d.x_vsize ne sz2(1)*1.25 or !d.y_vsize ne sz2(2)*1.25 then $ print,'WARNING... window size is too large for xray_contour to work',$ ' properly.' return end