Re: How to plot shaded relief image [message #57825] |
Fri, 04 January 2008 07:21  |
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   |
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 #58020 is a reply to message #57826] |
Wed, 09 January 2008 07:49  |
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
|
|
|