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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: How to plot shaded relief image [message #57825] Fri, 04 January 2008 07:21 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Dave writes:

> 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.

Good luck! :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: How to plot shaded relief image [message #57826 is a reply to message #57825] Fri, 04 January 2008 07:12 Go to previous messageGo to next message
Dave[4] is currently offline  Dave[4]
Messages: 38
Registered: December 2007
Member
Dear david:

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.

Thanks for your reply!


Dave














On Jan 4, 10:52 pm, David Fanning <n...@dfanning.com> wrote:
> Dave writes:
>>     How to use IDL to plot shaded relief image, just like
>> http://denali.gsfc.nasa.gov/gridview/index.html?Thanks very much!
>
> 1. Download the GRIDVIEW application.
> 2. Download a GRID.
>
> Otherwise, you could take your topographic data and
> drape another dataset over the top of it as a texture
> map:
>
>   http://www.dfanning.com/ographics_tips/imgtex.html
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: How to plot shaded relief image [message #57828 is a reply to message #57826] Fri, 04 January 2008 06:52 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Dave writes:

> How to use IDL to plot shaded relief image, just like
> http://denali.gsfc.nasa.gov/gridview/index.html? Thanks very much!

1. Download the GRIDVIEW application.
2. Download a GRID.

Otherwise, you could take your topographic data and
drape another dataset over the top of it as a texture
map:

http://www.dfanning.com/ographics_tips/imgtex.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: How to plot shaded relief image [message #57961 is a reply to message #57826] Fri, 04 January 2008 10:33 Go to previous messageGo to next message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
Dave wrote:
> Dear david:

> 2) I have try the SHADE_SURF with top view, it's good. But I want
> to find a 2D way to do this.

I'm a little slow, but how can you do this in 2D? Don't you need to
generate the shading from a 3D dataset and a light source?

-Rick
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
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 15:26:35 PDT 2025

Total time taken to generate the page: 0.00604 seconds