1 | pro sclarr,map,xscale,xmax,dispimg, OFFSET=offnum,SMIN=minnum |
---|
2 | |
---|
3 | ;THIS SCALES AN ARRAY FOR DISPLAY |
---|
4 | ;WITH RNBWSSMI COLOR TABLE |
---|
5 | ; map=byte array |
---|
6 | ; xscale = value to scale geophysical data by |
---|
7 | ; xmax = maximum of that geophysical parameter |
---|
8 | ; dispimg=scaled byte array to be displayed |
---|
9 | ; offset= adjustment value to original data |
---|
10 | ; smin= minimum value for scale |
---|
11 | |
---|
12 | |
---|
13 | IF N_elements(offnum) EQ 0 THEN offnum=0 |
---|
14 | IF N_elements(minnum) EQ 0 THEN minnum=0 |
---|
15 | |
---|
16 | slope=159./(xmax-minnum) |
---|
17 | intercept=(159-slope*(xmax+minnum))/2. |
---|
18 | print, slope, intercept |
---|
19 | |
---|
20 | s=SIZE(map) |
---|
21 | xsize = s(1) |
---|
22 | ysize = s(2) |
---|
23 | TEMP=replicate(0,xsize,ysize) |
---|
24 | |
---|
25 | x= where (map lt 251B,num) |
---|
26 | if(num ne 0) then begin |
---|
27 | TEMP(x)=round((float(map(x))*xscale-offnum)*slope+intercept) |
---|
28 | endif |
---|
29 | |
---|
30 | x= where (TEMP lt 0,num) |
---|
31 | if(num ne 0) then TEMP(x)=0 |
---|
32 | x= where (TEMP gt 159,num) |
---|
33 | if (num ne 0) then TEMP(x)=159 |
---|
34 | |
---|
35 | dispimg=byte(TEMP) |
---|
36 | |
---|
37 | x=where(map eq 255B,num) |
---|
38 | if(num ne 0) then dispimg(x)=185B |
---|
39 | |
---|
40 | x= where(map eq 254B,num) |
---|
41 | if(num ne 0) then dispimg(x)=160B |
---|
42 | |
---|
43 | x= where(map eq 253B,num) |
---|
44 | if(num ne 0) then dispimg(x)=160B |
---|
45 | |
---|
46 | x= where(map eq 252B,num) |
---|
47 | if(num ne 0) then dispimg(x)=210B |
---|
48 | |
---|
49 | x= where (map eq 251B,num) |
---|
50 | if(num ne 0)then dispimg(x)=160B |
---|
51 | |
---|
52 | |
---|
53 | end |
---|