;------------------------------------------------------------------------------ ; scale3d_amr.pro -- MZ 1-18-99 ; ; take the hydro variable in block format and create a single 1 byte ; array at the resolution of the finest block for plotting purposes. ; Optionally allow a resolution less than the finest to create a ; smaller array (use the sample keyword) ; ; ; arguments: ; ; tvar -- the variable to be scaled, tvar[maxblocks,nxb,nyb] ; ; ; colormap_min \ The limits of the colormap to use -- default is ; colormap_max / 0 to 255 ;------------------------------------------------------------------------------ function scale3d_amr, tvar, MIN = tvarmin, MAX = tvarmax if n_elements(tvarmax) EQ 0 then begin varmax = max(tvar) endif else begin varmax = tvarmax endelse if n_elements(tvarmin) EQ 0 then begin varmin = min(tvar) endif else begin varmin = tvarmin endelse ; mark those regions which are holes -- -1.e30, and make these black iholes = where(tvar EQ -1.e30) s = size(tvar) ;temp_arr = tvar temp_scale = bytarr(s[1],s[2],s[3]) temp_scale = bytscl(tvar, min = varmin, max = varmax) ; mark the holes black if min(iholes GT 0) then temp_scale[iholes] = 0 return, temp_scale end