shade.rel.sh(1) 	      Grass User's Manual	       shade.rel.sh(1)



NNAAMMEE
       sshhaaddee..rreell..sshh  - Creates a shaded relief map based on current resolution
       settings and sun altitude and azimuth values entered by the user.
       _(_G_R_A_S_S _S_h_e_l_l _S_c_r_i_p_t_)

SSYYNNOOPPSSIISS
       sshhaaddee..rreell..sshh
       sshhaaddee..rreell..sshh hheellpp sshhaaddee..rreell..sshh [aallttiittuuddee==_v_a_l_u_e] [aazziimmuutthh==_v_a_l_u_e] [eelleevvaa--
       ttiioonn==_n_a_m_e]

DDEESSCCRRIIPPTTIIOONN
       _s_h_a_d_e_._r_e_l_._s_h  is  a  Bourne  shell (sh(1)) script that creates a raster
       shaded relief map based on current resolution settings and on sun alti-
       tude and azimuth values entered by the user.  The new shaded relief map
       is named _._s_h_a_d_e and stored in the user's current mapset.   The  map  is
       assigned a grey-scale color table.


       In case, no parameter are provided on startup, this program is interac-
       tive; the user enters the command: sshhaaddee..rreell..sshh

       The program then prompts the user to enter values for:

	      the altitude of the sun in degrees above the  horizon  (a  value
	      between 0 and 90 degrees), and

	      the  azimuth of the sun in degrees to the east of north (a value
	      between -1 and 360 degrees).

	      the name of a raster map layer whose cell category values are to
	      provide  elevation values for the shaded relief map.  Typically,
	      this would be a map layer of elevation;  however, any raster map
	      layer can be named.

       Specifically, _s_h_a_d_e_._r_e_l_._s_h executes the following _r_._m_a_p_c_a_l_c statement:


       rr..mmaappccaallcc <<<< EEOOFF

	      $ELEV.shade = eval( \

	      x=($elev[-1,-1] + 2*$elev[0,-1] + $elev[1,-1] \

	      -$elev[-1,1] - 2*$elev[0,1] - $elev[1,1])/(8.*ewres()) , \

	      y=($elev[-1,-1] + 2*$elev[-1,0] + $elev[-1,1] \

	      -$elev[1,-1] - 2*$elev[1,0] - $elev[1,1])/(8.*nsres()) , \

	      slope=90.-atan(sqrt(x*x + y*y)), \

	      a=round(atan(x,y)), \

	      a=if(isnull(a),1,a), \

	      aspect=if(x||y,if(a,a,360.)), \

	      cang  =  sin($alt)*sin(slope)  + cos($alt)*cos(slope) * cos($az-
	      aspect), \

	      if(cang < 0.,0.,100.*cang), \

	      if(isnull(cang), null(), 100.*cang))


       EOF




       Refer to the manual entry for _r_._m_a_p_c_a_l_c for an explanation of the  fil-
       tering  syntax  shown  in  the above expression.  See, for example, the
       section on "The Neighborhood Modifier".


       _s_h_a_d_e_._r_e_l_._s_h then runs _r_._c_o_l_o_r_s to assign a grey-scale color  table  to
       the new shaded relief map _._s_h_a_d_e, by executing the command:


       rr..ccoolloorrss sshhaaddee ccoolloorr==grey


FFIILLEESS
       This  program  is  simply a shell script.  Users are encouraged to make
       their  own  shell  scripts  using  similar   techniques.    See	 $GIS-
       BASE/scripts/shade.rel.sh.

SSEEEE AALLSSOO
       _A_n  _A_l_g_e_b_r_a  _f_o_r  _G_I_S  _a_n_d _I_m_a_g_e _P_r_o_c_e_s_s_i_n_g, by Michael Shapiro and Jim
       Westervelt, U.S.  Army  Construction  Engineering  Research  Laboratory
       (March/1991) (get from GRASS web site).


       _b_l_e_n_d_._s_h

       _g_._a_s_k

       _g_._r_e_g_i_o_n

       _r_._c_o_l_o_r_s

       _r_._m_a_p_c_a_l_c _s_h_a_d_e_._c_l_r_._s_h

AAUUTTHHOORR
       Jim Westervelt, U.S. Army Construction Engineering Research Laboratory

       _L_a_s_t _c_h_a_n_g_e_d_: _$_D_a_t_e_: _2_0_0_2_/_0_3_/_0_1 _0_0_:_0_8_:_3_1 _$



GRASS 5.0						       shade.rel.sh(1)
