comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: A color table for topography
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: A color table for topography [message #46014] Wed, 26 October 2005 16:18
hjalti is currently offline  hjalti
Messages: 13
Registered: October 2003
Junior Member
Thank you Peter, I'm no serious geographer:)
Re: A color table for topography [message #46019 is a reply to message #46014] Tue, 25 October 2005 23:22 Go to previous message
peter.albert@gmx.de is currently offline  peter.albert@gmx.de
Messages: 108
Registered: July 2005
Senior Member
Hi Hjalti,

I once tried to mimick such a color table myself. It uses the first 82
colours only, so there is room for improvement. And I am sure it does
not fulfill any serious geographer's conventions. But it looks not too
bad.

N.B. Blue is set to index 2, so if the ocean is to appear blue, make
the appropriate pixels have the correct value. (Or modify the code, I
have no idea why back in time that was necessary for me..)

Here is the code:

r = bytarr(256)
g = bytarr(256)
b = bytarr(256)

; Blue for ocean
r[2] = 0 & g[2] = 0 & b[2] = 150

; Some shades of green for the lower elevations
r[3:20] = 0
g[3:20] = bindgen(18) * (190.-120.) / 17. + 120
b[3:20] = 0

; Here we go from green to more brownish colours
r[21:40] = bindgen(20) * (220.) / 19.
g[21:40] = 190
b[21:40] = 0

; Now these are the real brown colours for higher elevations
r[41:60] = 220 - bindgen(20) * (30) / 19.
g[41:60] = 190 - bindgen(20) * (80) / 19.
b[41:60] = 0

; And finally let the colours fade such that we get white mountain
tops:
r[61:80] = bindgen(20) * 65 / 19. + 190
g[61:80] = bindgen(20) * 145 / 19. + 110
b[61:80] = bindgen(20) * 255 / 19.

; For some reason I needed a gray value at index 81, probably for
annotations?
r[81] = 235 & g[81] = 235 & b[81] = 235

; Well, go for it!
tvlct, r, g, b

; And, just to get an idea, this is how a strangely shaped mountain
; (with some small spots of ocean in the image edges)
; could be displayed with this colour table:

tv, bytscl((dist(200))^2,top=78)+2


Best regards,

Peter
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Georeferencing satellite data in batch-mode ENVI?
Next Topic: Re: transforming a row vector into a column vector

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:16:18 PDT 2025

Total time taken to generate the page: 0.00630 seconds