pro display, data, z1, z2, bw ; ; Program to display an image (stored in data) ; z1 and z2 are lower and upper limits for stretch on display ; np = n_params() if np eq 0 or np gt 4 then goto, ERRMES sz = size(data) if sz(0) ne 2 then goto, ERRMES grey = 1 if np eq 2 then begin grey = 0 if z1 eq 'p' or z1 eq 'P' then grey = 1 if z1 eq 'n' or z1 eq 'N' then grey = -1 if grey eq 0 then goto, ERRMES endif if np le 2 then begin i1 = (sz(1)/2) - 16 i2 = i1 + 32 j1 = (sz(2)/2) - 16 j2 = j1 + 32 sub_rast = data(i1:i2,j1:j2) z1 = median(sub_rast) - (3. * stdev(sub_rast)) z2 = median(sub_rast) + (3. * stdev(sub_rast)) print,'Setting z1 =',z1, ' and z2 = ', z2 endif if np eq 4 then begin grey = 0 if bw eq 'p' or bw eq 'P' then grey = 1 if bw eq 'n' or bw eq 'N' then grey = -1 if grey eq 0 then goto, ERRMES endif if z1 gt z2 then begin zt = z1 z1 = z2 z2 = zt endif ; window,0,xsize=450,ysize=300,title='Image' if grey eq 1 then tvscl, data < z2 > z1 if grey eq -1 then tvscl, -data < (-z1) > (-z2) ; defsysv, '!neg', grey ; defsysv,'!neg', exists=i ; if i ne 1 then defsysv, '!neg', grey else !neg = grey return ; ERRMES: print,' ERROR! Enter parameters as follows (items in parenthesis are optional)' print,string(7B) print,' display, data_array, (lower_display_lim, upper_display_lim), bw' print,string(7B) print,' ' return end