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

Home » Public Forums » archive » Re: How to plot shaded relief image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to plot shaded relief image [message #58020 is a reply to message #57826] Wed, 09 January 2008 07:49 Go to previous message
JMB is currently offline  JMB
Messages: 13
Registered: January 2008
Junior Member
> 1) I have to do this without gridview, because gridview does not
> open it's code.
> 2) I have try the SHADE_SURF with top view, it's good. But I want
> to find a 2D way to do this.

Hi Dave,

Did you already find a "2D" way ?

I tried this method that works pretty good to get a shaded relief from
a digital elevation model (DEM).

- First you need to a create a 3x3 matrix that represents the incident
light with which you want to illuminate your DEM.
- Then you have to convolve your DEM with this matrix. You will get a
kind of shading matrix.
- The last step consists in mixing your colorized DEM with this
shading matrix (which you can to stretch according to get the expected
light/shadows contrast).

; Read the dem into the dem variable (NxM matrix)

dem=read_tiff('dem.tif')

; Edit a 3x3 matrix to represents the light
; in this example the light comes from the bottom (south)

light=[[1,1,1],[0,0,0],[-1,-1,-1]]

; convolution of the dem with the 3x3 matrix

shading=convol(float(dem),float(light))

then you have several ways to use your shading matrix to enhance your
relief plot.
adding or multiplicating the 3 channels of your colored dem with the
stretched shading matrix.

I let you test...

Jérôme
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: mouse appearance
Next Topic: Re: Windows/Linux reading binary data - sign problem

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

Current Time: Thu Oct 09 23:05:52 PDT 2025

Total time taken to generate the page: 0.24638 seconds