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



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

SSYYNNOOPPSSIISS
       sshhaaddee..ccllrr..sshh
       sshhaaddee..ccllrr..sshh	hheellpp	 sshhaaddee..ccllrr..sshh	 [aallttiittuuddee==_v_a_l_u_e]
       [rr__aazziimmuutthh==_v_a_l_u_e]   [gg__aazziimmuutthh==_v_a_l_u_e]	[bb__aazziimmuutthh==_v_a_l_u_e]
       [eelleevvaattiioonn==_n_a_m_e]

DDEESSCCRRIIPPTTIIOONN
       _s_h_a_d_e_._c_l_r_._s_h is a Bourne shell (sh(1)) script that creates
       a colored raster shaded relief map based on current  reso-
       lution  settings  and  on  sun  altitude  and  color light
       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.


       In case, no parameter are provided on startup,  this  pro-
       gram   is   interactive;  the  user  enters  the  command:
       sshhaaddee..ccllrr..sshh

       The program then prompts the user to enter values for:

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

	      the  azimuth  of the red, green, and blue lights 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_._c_l_r_._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)), \

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

	      rang = sin($alt)*sin(slope) +  cos($alt)*cos(slope)
	      * cos($raz-aspect),\

	      red = int(if(rang < 0.,0.,4.9*rang)), \

	      gang  = sin($alt)*sin(slope) + cos($alt)*cos(slope)
	      * cos($gaz-aspect),\

	      green = int(if(gang < 0.,0.,4.9*gang)), \

	      bang = sin($alt)*sin(slope) +  cos($alt)*cos(slope)
	      * cos($baz-aspect), \

	      blue = int(if(bang < 0.,0.,4.9*bang)), \

	      1. + red + 5. * green + 25. * blue )


       EOF




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


       _s_h_a_d_e_._c_l_r_._s_h then runs _r_._c_o_l_o_r_s to assign a color table to
       the new shaded relief map _._s_h_a_d_e.

FFIILLEESS
       This  program is simply a shell script.	Users are encour-
       aged to make their own shell scripts using  similar  tech-
       niques.	See $GISBASE/scripts/shade.clr.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  Engi-
       neering	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_._r_e_l_._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.clr.sh(1)
