[GRASS-user] r.sunmask cast shadow question

friedtj at free.fr friedtj at free.fr
Mon Dec 2 13:47:22 PST 2013


Please allow me to answer my own request: based on further analysis on basic
synthetic terrain models, I figured out that r.sunmask will only work on a projected
framework. Hence, I re-projected the WGS-84 DEM obtained from SRTM and indeed managed
to get meaningful cast shadow representations. 

I quickly summarized some of my experiments (using GRASS 6.4.3-2 as a plugin to QGis 2.0.1)
at http://jmfriedt.free.fr/proj_grass/projection.html which might (or might not) be useful
to others.

JM

----- Mail original -----
De: "friedtj" <friedtj at free.fr>
À: grass-user at lists.osgeo.org
Envoyé: Lundi 28 Octobre 2013 11:14:43
Objet: [GRASS-user] r.sunmask cast shadow question

I am attempting to use r.sunmask to identify the time at which an
oblique-view picture was taken from a webcam in a mountain area by
trying to match the projected shadow pattern. I thus first compute
the elevetion/azimuth of the sun for my location (as provided by the USNO web site) 
and the use the A-mode projection of r.sunmask to observe the shadow pattern. I was 
surprised to observe litte (or actually no) effect of the sun elevation on the cast 
shadow pattern, so I tried the following synthetic example: a DEM is defined by 
the following elevation file

north:   0.5
south:   -0.5
east:    0.5
west:    -0.5
rows:    10
cols:    10
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 2000 2000 0 0 0 0
 0 0 0 2000 5000 5000 2000 0 0 0
 0 0 0 2000 5000 5000 2000 0 0 0
 0 0 0 0 2000 2000 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0

which is inserted on a GRASS region centered around (0,0) and hence wih a 12.3 km cell
size (111 km/9 cells). The resulting DEM is also found at http://sequanux.org/jmfriedt/t/sun1.png
My synthetic mountain is 5000 m high in the first cell which hence exhibits a slope of 22 degrees, 
and the second half of the mountain rises by 2000 m over another cell so exhibits a slope of 
10 degrees. The average tilt of the whole mountain slope spanning two cells is 11 degrees. 
I then generate the sun mask using r.sunmask for sun elevations of 20 and 40 degrees and different
azimuths to differenciate the simulations (as found at http://sequanux.org/jmfriedt/t/sun2.png -- both
png files also come with an associated world file): the 20-degree case should cast a shadow by the 
steepest slope, and the 40 degree elevation should not cast any shadow at all. As observed on the 
picture, a shadow is always cast all the way to the limit of my DEM, which seems incorrect if we
are indeed looking at the projected shadow due to the topography. Any sun elevation above
22 degrees should not generate any cast shadow pattern, and I went up to testing a sun elevation of 89 
degrees which also generated a cast shadow all the way to the limit of my DEM.

Am I misunderstanding how to use r.sunmask ? Somehow r.sun does not seem to be working on my installation
so I am unable to compare both outputs. All this was done with GRASS 6.4 called from QGis 2.0.1.

Thank you, Jean-Michel

-- 
JM Friedt, FEMTO-ST Time & Frequency/SENSeOR, 32 av. observatoire,
25044 Besancon, France
_______________________________________________
grass-user mailing list
grass-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


More information about the grass-user mailing list