pro sclarr,map,xscale,xmax,dispimg, OFFSET=offnum,SMIN=minnum ;THIS SCALES AN ARRAY FOR DISPLAY ;WITH RNBWSSMI COLOR TABLE ; map=byte array ; xscale = value to scale geophysical data by ; xmax = maximum of that geophysical parameter ; dispimg=scaled byte array to be displayed ; offset= adjustment value to original data ; smin= minimum value for scale IF N_elements(offnum) EQ 0 THEN offnum=0 IF N_elements(minnum) EQ 0 THEN minnum=0 slope=159./(xmax-minnum) intercept=(159-slope*(xmax+minnum))/2. print, slope, intercept s=SIZE(map) xsize = s(1) ysize = s(2) TEMP=replicate(0,xsize,ysize) x= where (map lt 251B,num) if(num ne 0) then begin TEMP(x)=round((float(map(x))*xscale-offnum)*slope+intercept) endif x= where (TEMP lt 0,num) if(num ne 0) then TEMP(x)=0 x= where (TEMP gt 159,num) if (num ne 0) then TEMP(x)=159 dispimg=byte(TEMP) x=where(map eq 255B,num) if(num ne 0) then dispimg(x)=185B x= where(map eq 254B,num) if(num ne 0) then dispimg(x)=160B x= where(map eq 253B,num) if(num ne 0) then dispimg(x)=160B x= where(map eq 252B,num) if(num ne 0) then dispimg(x)=210B x= where (map eq 251B,num) if(num ne 0)then dispimg(x)=160B end