source: trunk/sclarr.pro @ 2

Last change on this file since 2 was 2, checked in by pinsard, 17 years ago

initial import from /usr/work/fvi/OPA/geomag/

File size: 1.2 KB
Line 
1pro 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
13IF N_elements(offnum) EQ 0 THEN offnum=0
14IF N_elements(minnum) EQ 0 THEN minnum=0
15
16slope=159./(xmax-minnum)
17intercept=(159-slope*(xmax+minnum))/2.
18print, slope, intercept
19
20s=SIZE(map)
21xsize = s(1)
22ysize = s(2)
23TEMP=replicate(0,xsize,ysize)
24
25x= where (map lt 251B,num)
26if(num ne 0) then begin
27TEMP(x)=round((float(map(x))*xscale-offnum)*slope+intercept)
28endif
29
30x= where (TEMP lt 0,num)
31if(num ne 0) then TEMP(x)=0
32x= where (TEMP gt 159,num)
33if (num ne 0) then TEMP(x)=159
34
35dispimg=byte(TEMP)
36
37x=where(map eq 255B,num)
38if(num ne 0) then dispimg(x)=185B
39
40x= where(map eq 254B,num)
41if(num ne 0) then dispimg(x)=160B
42
43x= where(map eq 253B,num)
44if(num ne 0) then dispimg(x)=160B
45
46x= where(map eq 252B,num)
47if(num ne 0) then dispimg(x)=210B
48
49x= where (map eq 251B,num)
50if(num ne 0)then dispimg(x)=160B
51
52
53end
Note: See TracBrowser for help on using the repository browser.