r.sun.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <h2>DESCRIPTION</h2>
  2. <b>r.sun</b> computes beam (direct), diffuse and ground reflected solar
  3. irradiation raster maps for given day, latitude, surface and atmospheric
  4. conditions. Solar parameters (e.g. time of sunrise and sunset, declination,
  5. extraterrestrial irradiance, daylight length) are stored in the resultant maps'
  6. history files. Alternatively, the local time can be specified to compute solar
  7. incidence angle and/or irradiance raster maps. The shadowing effect of the
  8. topography is incorporated by default. This can be done either internally by
  9. calculatoion of the shadowing effect directly from the digital elevation model
  10. or by specifying raster maps of the horizon height which is much faster. These
  11. horizon raster maps can be calculated using <a href="r.horizon.html">r.horizon</a>.
  12. <p>For latitude-longitude coordinates it requires that the elevation map is in meters.
  13. The rules are:
  14. <ul>
  15. <li> lat/lon coordinates: elevation in meters;
  16. <li> Other coordinates: elevation in the same unit as the easting-northing coordinates.
  17. </ul>
  18. The solar geometry of the model is based on the works of Krcho (1990), later
  19. improved by Jenco (1992). The equations describing Sun -- Earth position as
  20. well as an interaction of the solar radiation with atmosphere were originally
  21. based on the formulas suggested by Kitler and Mikler (1986). This component
  22. was considerably updated by the results and suggestions of the working group
  23. co-ordinated by Scharmer and Greif (2000) (this algorithm might be replaced
  24. by SOLPOS algorithm-library included in GRASS within <a href="r.sunmask.html">
  25. r.sunmask</a>
  26. command). The model computes all three components of global radiation (beam,
  27. diffuse and reflected) for the clear sky conditions, i.e. not taking into
  28. consideration the spatial and temporal variation of clouds. The extent and
  29. spatial resolution of the modelled area, as well as integration over time,
  30. are limited only by the memory and data storage resources. The model is built
  31. to fulfil user needs in various fields of science (hydrology, climatology,
  32. ecology and environmental sciences, photovoltaics, engineering, etc.) for
  33. continental, regional up to the landscape scales.
  34. <p>The model considers a shadowing effect of the local topography unless switched
  35. off with the <em>-p</em> flag.
  36. <b>r.sun</b> works in two modes: In the first mode it calculates for the set
  37. local time a solar incidence angle [degrees] and solar irradiance values [W.m-2].
  38. In the second mode daily sums of solar radiation [Wh.m-2.day-1] are computed
  39. within a set day. By a scripting the two modes can be used separately or
  40. in a combination to provide estimates for any desired time interval. The
  41. model accounts for sky obstruction by local relief features. Several solar
  42. parameters are saved in the resultant maps' history files, which may be viewed
  43. with the <a href="r.info.html">r.info</a> command.
  44. <p>
  45. The solar incidence angle raster map <i>incidout</i> is computed specifying
  46. elevation raster map <i>elevation</i>, aspect raster map <i>aspect</i>, slope
  47. steepness raster map <i>slope,</i> given the day <i>day</i> and local time
  48. <i>time</i>. There is no need to define latitude for locations with known
  49. and defined projection/coordinate system (check it with the <a href="g.proj.html">
  50. g.proj</a>
  51. command). If you have undefined projection, (x,y) system, etc. then the latitude
  52. can be defined explicitly for large areas by input raster map <i>lat_in</i>
  53. with interpolated latitude values. All input raster maps must
  54. be floating point (FCELL) raster maps. Null data in maps are excluded from
  55. the computation (and also speeding-up the computation), so each output raster
  56. map will contain null data in cells according to all input raster maps. The
  57. user can use <a href="r.null.html">r.null</a>
  58. command to create/reset null file for your input raster maps. <br>
  59. The specified day <i>day</i> is the number of the day of the general year
  60. where January 1 is day no.1 and December 31 is 365. Time <i>time</i> must
  61. be a local (solar) time (i.e. NOT a zone time, e.g. GMT, CET) in decimal system,
  62. e.g. 7.5 (= 7h 30m A.M.), 16.1 = 4h 6m P.M..
  63. <p>
  64. The solar <i>declination</i> parameter is an option to override
  65. the value computed by the internal routine for the day of the year. The value
  66. of geographical latitude can be set as a constant for the whole computed
  67. region or, as an option, a grid representing spatially distributed values
  68. over a large region. The geographical latitude must be also in decimal system
  69. with positive values for northern hemisphere and negative for southern one.
  70. In similar principle the Linke turbidity factor (<i>linke</i>, <i>lin</i>
  71. ) and ground albedo (<i>albedo</i>, <i>alb</i>) can be set.
  72. <p>Besides clear-sky radiations, the user can compute a real-sky radiation (beam,
  73. diffuse) using <i>coeff_bh</i> and <i>coeff_dh</i> input raster maps defining
  74. the fraction of the respective clear-sky radiations reduced by atmospheric
  75. factors (e.g. cloudiness). The value is between 0-1. Usually these
  76. coefficients can be obtained from a long-terms meteorological measurements
  77. provided as raster maps with spatial distribution of these coefficients separately
  78. for beam and diffuse radiation (see Suri and Hofierka, 2004, section 3.2).
  79. <p>
  80. The solar irradiation or irradiance raster maps <i>beam_rad</i>, <i>diff_rad</i>,
  81. <i>refl_rad</i> are computed for a given day <i>day,</i> latitude <i>lat_in</i>,
  82. elevation <i>elevation</i>, slope <i>slope</i> and aspect <i>aspect</i> raster maps.
  83. For convenience, the output raster given as <i>glob_rad</i>
  84. will output the sum of the three radiation components. The program uses
  85. the Linke atmosphere turbidity factor and ground albedo coefficient.
  86. A default, single value of Linke factor is <i>lin</i>=3.0 and
  87. is near the annual average for rural-city areas. The Linke
  88. factor for an absolutely clear atmosphere is <i>lin</i>=1.0. See notes below
  89. to learn more about this factor. The incidence solar angle is the angle between
  90. horizon and solar beam vector.
  91. <p>
  92. The solar radiation maps for a given day are computed by integrating the
  93. relevant irradiance between sunrise and sunset times for that day. The
  94. user can set a finer or coarser time step used for all-day radiation
  95. calculations with the <i>step</i> option. The default value of <i>step</i> is
  96. 0.5 hour. Larger steps (e.g. 1.0-2.0) can speed-up calculations but produce
  97. less reliable (and more jagged) results. As the sun moves through approx.
  98. 15&deg; of the sky in an hour, the default <i>step</i> of half an hour will
  99. produce 7.5&deg; steps in the data. For relatively smooth output with the
  100. sun placed for every degree of movement in the sky you should set the
  101. <i>step</i> to 4 minutes or less. <i>step</i><tt>=0.05</tt> is equivalent
  102. to every 3 minutes. Of course setting the time step to be very fine
  103. proportionally increases the module's running time.
  104. <p>The output units are in Wh per squared meter per given
  105. day [Wh/(m*m)/day]. The incidence angle and irradiance/irradiation maps are
  106. computed with the shadowing influence of relief by default. It is also possible
  107. for them to be computed without this influence using the planar flag (<i>-p</i>).
  108. In mountainous areas this can lead to very different results! The user should be
  109. aware that taking into account the shadowing effect of relief can slow
  110. down the speed of computation, especially when the sun altitude is low.
  111. <p>
  112. When considering the shadowing effect, speed and precision of computation
  113. can be controlled by the <i>distance_step</i> parameter, which defines the sampling density
  114. at which the visibility of a grid cell is computed in the direction of a
  115. path of the solar flow. It also defines the method by which the obstacle's
  116. altitude is computed. When choosing a <i>distance_step</i> less than 1.0 (i.e. sampling
  117. points will be computed at <i>distance_step</i> * cellsize distance), <em>r.sun</em> takes
  118. the altitude from the nearest grid point. Values above 1.0 will use the maximum
  119. altitude value found in the nearest 4 surrounding grid points. The default
  120. value <i>distance_step</i>=1.0 should give reasonable results for most cases (e.g.
  121. on DEM). The <i>distance_step</i> value defines a multiplying coefficient for sampling
  122. distance. This basic sampling distance equals to the arithmetic average of
  123. both cell sizes. The reasonable values are in the range 0.5-1.5. The values
  124. below 0.5 will decrease and values above 1.0 will increase the computing
  125. speed. Values greater than 2.0 may produce estimates with lower accuracy
  126. in highly dissected relief. The fully shadowed areas are written to the output
  127. maps as zero values. Areas with NULL data are considered as no barrier with
  128. shadowing effect.
  129. <p>
  130. The maps' history files are generated containing the following listed
  131. parameters used in the computation: <br>
  132. - Solar constant 1367 W.m-2 <br>
  133. - Extraterrestrial irradiance on a plane perpendicular to the solar beam [W.m-2] <br>
  134. - Day of the year <br>
  135. - Declination [radians] <br>
  136. - Decimal hour (Alternative 1 only) <br>
  137. - Sunrise and sunset (min-max) over a horizontal plane <br>
  138. - Daylight lengths <br>
  139. - Geographical latitude (min-max) <br>
  140. - Linke turbidity factor (min-max) <br>
  141. - Ground albedo (min-max)
  142. <p>The user can use a nice shellcript with variable
  143. day to compute radiation for some time interval within the year (e.g. vegetation
  144. or winter period). Elevation, aspect and slope input values should not be
  145. reclassified into coarser categories. This could lead to incorrect results.
  146. <h2> OPTIONS</h2>
  147. <p>Currently, there are two modes of r.sun.
  148. In the first mode it calculates solar incidence angle and solar irradiance
  149. raster maps using the set local time. In the second mode daily sums of solar
  150. irradiation [Wh.m-2.day-1] are computed for a specified day.
  151. <h2>NOTES</h2>
  152. Solar energy is an important input parameter in different models concerning
  153. energy industry, landscape, vegetation, evapotranspiration, snowmelt or remote
  154. sensing. Solar rays incidence angle maps can be effectively used in radiometric
  155. and topographic corrections in mountainous and hilly terrain where very accurate
  156. investigations should be performed.
  157. <p>
  158. The clear-sky solar radiation model applied in the r.sun is based on the
  159. work undertaken for development of European Solar Radiation Atlas (Scharmer
  160. and Greif 2000, Page et al. 2001, Rigollier 2001). The clear sky model estimates
  161. the global radiation from the sum of its beam, diffuse and reflected components.
  162. The main difference between solar radiation models for inclined surfaces
  163. in Europe is the treatment of the diffuse component. In the European climate
  164. this component is often the largest source of estimation error. Taking into
  165. consideration the existing models and their limitation the European Solar
  166. Radiation Atlas team selected the Muneer (1990) model as it has a sound theoretical
  167. basis and thus more potential for later improvement.
  168. <p>
  169. Details of underlying equations used in this program can be found in the
  170. reference literature cited below or book published by Neteler and Mitasova:
  171. Open Source GIS: A GRASS GIS Approach (published in Kluwer Academic Publishers
  172. in 2002).
  173. <p>
  174. Average monthly values of the Linke turbidity coefficient for a mild climate
  175. in the northern hemisphere (see reference literature for your study area):
  176. <table border="1">
  177. <tr><th>Month</th><th>Jan</th><th>Feb</th><th>Mar</th><th>Apr</th><th>May</th><th>Jun</th><th>Jul</th><th>Aug</th><th>Sep</th><th>Oct</th><th>Nov</th><th>Dec</th><th>annual</th></tr>
  178. <tr><td>mountains</td><td>1.5</td><td>1.6</td><td>1.8</td><td>1.9</td><td>2.0</td><td>2.3</td><td>2.3</td><td>2.3</td><td>2.1</td><td>1.8</td><td>1.6</td><td>1.5</td><td>1.90</td></tr>
  179. <tr><td>rural</td><td>2.1</td><td>2.2</td><td>2.5</td><td>2.9</td><td>3.2</td><td>3.4</td><td>3.5</td><td>3.3</td><td>2.9</td><td>2.6</td><td>2.3</td><td>2.2</td><td>2.75</td></tr>
  180. <tr><td>city</td><td>3.1</td><td>3.2</td><td>3.5</td><td>4.0</td><td>4.2</td><td>4.3</td><td>4.4</td><td>4.3</td><td>4.0</td><td>3.6</td><td>3.3</td><td>3.1</td><td>3.75</td></tr>
  181. <tr><td>industrial</td><td>4.1</td><td>4.3</td><td>4.7</td><td>5.3</td><td>5.5</td><td>5.7</td><td>5.8</td><td>5.7</td><td>5.3</td><td>4.9</td><td>4.5</td><td>4.2</td><td>5.00</td></tr>
  182. </table>
  183. <p>Planned improvements include the use of the SOLPOS algorithm for solar
  184. geometry calculations and internal computation of aspect and slope.
  185. <h3>Solar time</h3>
  186. By default r.sun calculates times as true solar time, whereby solar noon is
  187. always exactly 12 o'clock everywhere in the current region. Depending on where
  188. the zone of interest is located in the related time zone, this may cause
  189. differences of up to an hour, in some cases (like Western Spain) even more.
  190. On top of this, the offset varies during the year according to the Equation
  191. of Time.
  192. <p>
  193. To overcome this problem, the user can use the option <em>civil_time=&lt;timezone_offset&gt;</em>
  194. in r.sun to make it use real-world (wall clock) time. For example, for Central
  195. Europe the timezone offset is +1, +2 when daylight saving time is in effect.
  196. <p>
  197. <!-- WE DON'T KNOW, check source code:
  198. If the user use the <em>civil_time</em> parameter, also the longitude needs to
  199. be supplied as a raster map with the <em>long_in</em> parameter. Within a
  200. latlon location, such a map can be easily made with:
  201. <div class="code"><pre>
  202. r.mapcalc "lon_raster = x()"
  203. </pre></div>
  204. END OF WE DON'T KNOW
  205. -->
  206. <h3>Extraction of shadow maps</h3>
  207. A map of shadows can be extracted from the solar incidence angle map
  208. (incidout). Areas with zero values are shadowed. This will not work
  209. if the <em>-p</em> flag has been used.
  210. <h3>Large maps and out of memory problems</h3>
  211. With a large number or columns and rows, <b>r.sun</b> can consume
  212. significant amount of memory. While output raster maps are not
  213. partitionable, the input raster maps are using the <em>npartitions</em>
  214. parameter.
  215. In case of out of memory error (<tt>ERROR: G_malloc: out of memory</tt>), the
  216. <em>npartitions</em> parameter can be used to run a segmented calculation
  217. which consumes less memory during the computations.
  218. The amount of memory by <b>r.sun</b> is estimated as follows:
  219. <div class="code"><pre>
  220. # without input raster map partitioning:
  221. # memory requirements: 4 bytes per raster cell
  222. # rows,cols: rows and columns of current region (find out with g.region)
  223. # IR: number of input raster maps without horizon maps
  224. # OR: number of output raster maps
  225. memory_bytes = rows*cols*(IR*4 + horizon_steps + OR*4)
  226. # with input raster map partitioning:
  227. memory_bytes = rows*cols*((IR*4+horizon_steps)/npartitions + OR*4)
  228. </pre></div>
  229. <h2>EXAMPLES</h2>
  230. North Carolina example (considering also cast shadows):
  231. <div class="code"><pre>
  232. g.region raster=elevation -p
  233. # calculate horizon angles (to speed up the subsequent r.sun calculation)
  234. r.horizon elevation=elevation step=30 bufferzone=200 basename=horangle \
  235. maxdistance=5000
  236. # slope + aspect
  237. r.slope.aspect elevation=elevation aspect=aspect.dem slope=slope.dem
  238. # calculate global radiation for day 180 at 2p.m., using r.horizon output
  239. r.sun elevation=elevation horizon_basename=horangle horizon_step=30 \
  240. aspect=aspect.dem slope=slope.dem glob_rad=global_rad day=180 time=14
  241. # result: output global (total) irradiance/irradiation [W.m-2] for given day/time
  242. r.univar global_rad
  243. </pre></div>
  244. <p>
  245. Calculation of the integrated daily irradiation for a region in North-Carolina
  246. for a given day of the year at 30m resolution. Here day 172 (i.e., 21 June
  247. in non-leap years):
  248. <div class="code"><pre>
  249. g.region raster=elev_ned_30m -p
  250. # considering cast shadows
  251. r.sun elevation=elev_ned_30m linke_value=2.5 albedo_value=0.2 day=172 \
  252. beam_rad=b172 diff_rad=d172 \
  253. refl_rad=r172 insol_time=it172
  254. d.mon wx0
  255. # show irradiation raster map [Wh.m-2.day-1]
  256. d.rast.leg b172
  257. # show insolation time raster map [h]
  258. d.rast.leg it172
  259. </pre></div>
  260. We can compute the day of year from a specific date in Python:
  261. <div class="code"><pre>
  262. >>> import datetime
  263. >>> datetime.datetime(2014, 6, 21).timetuple().tm_yday
  264. 172
  265. </pre></div>
  266. <h2>SEE ALSO</h2>
  267. <em>
  268. <a href="r.horizon.html">r.horizon</a>,
  269. <a href="r.slope.aspect.html">r.slope.aspect</a>,
  270. <a href="r.sunhours.html">r.sunhours</a>,
  271. <a href="r.sunmask.html">r.sunmask</a>,
  272. <a href="g.proj.html">g.proj</a>,
  273. <a href="r.null.html">r.null</a>,
  274. <a href="v.surf.rst.html">v.surf.rst</a>
  275. </em>
  276. <h2>REFERENCES</h2>
  277. <ul>
  278. <li> Hofierka, J., Suri, M. (2002): The solar radiation model for Open source
  279. GIS: implementation and applications. International
  280. GRASS users conference in Trento, Italy, September 2002.
  281. (<a href="http://skagit.meas.ncsu.edu/~jaroslav/trento/Hofierka_Jaroslav.pdf">PDF</a>)
  282. <li>
  283. Hofierka, J. (1997). Direct solar radiation modelling within an open GIS
  284. environment. Proceedings of JEC-GI'97 conference in Vienna, Austria, IOS
  285. Press Amsterdam, 575-584.
  286. <li>
  287. Jenco, M. (1992). Distribution of direct solar radiation on georelief and
  288. its modelling by means of complex digital model of terrain (in Slovak). Geograficky
  289. casopis, 44, 342-355.
  290. <li>
  291. Kasten, F. (1996). The Linke turbidity factor based on improved values of
  292. the integral Rayleigh optical thickness. Solar Energy, 56 (3), 239-244.
  293. <li>
  294. Kasten, F., Young, A. T. (1989). Revised optical air mass tables and approximation
  295. formula. Applied Optics, 28, 4735-4738.
  296. <li>
  297. Kittler, R., Mikler, J. (1986): Basis of the utilization of solar radiation
  298. (in Slovak). VEDA, Bratislava, p. 150.
  299. <li>
  300. Krcho, J. (1990). Morfometrick&aacute; analza a digit&aacute;lne modely georeli&eacute;fu
  301. (Morphometric analysis and digital models of georelief, in Slovak).
  302. VEDA, Bratislava.
  303. <li>
  304. Muneer, T. (1990). Solar radiation model for Europe. Building services engineering
  305. research and technology, 11, 4, 153-163.
  306. <li>
  307. Neteler, M., Mitasova, H. (2002): Open Source GIS: A GRASS GIS Approach, Kluwer
  308. Academic Publishers. (Appendix explains formula;
  309. <a href="http://www.grassbook.org/">r.sun script download</a>)
  310. <li>
  311. Page, J. ed. (1986). Prediction of solar radiation on inclined surfaces. Solar
  312. energy R&amp;D in the European Community, series F - Solar radiation data,
  313. Dordrecht (D. Reidel), 3, 71, 81-83.
  314. <li>
  315. Page, J., Albuisson, M., Wald, L. (2001). The European solar radiation atlas:
  316. a valuable digital tool. Solar Energy, 71, 81-83.
  317. <li>
  318. Rigollier, Ch., Bauer, O., Wald, L. (2000). On the clear sky model of the
  319. ESRA - European Solar radiation Atlas - with respect to the Heliosat method.
  320. Solar energy, 68, 33-48.
  321. <li>
  322. Scharmer, K., Greif, J., eds., (2000). The European solar radiation atlas,
  323. Vol. 2: Database and exploitation software. Paris (Les Presses de l'&Eacute;cole
  324. des Mines).
  325. <li>
  326. Joint Research Centre: <a href="http://re.jrc.ec.europa.eu/pvgis/">GIS solar radiation database for Europe</a> and
  327. <a href="http://re.jrc.ec.europa.eu/pvgis/solres/solmod3.htm">Solar radiation and GIS</a>
  328. </ul>
  329. <h2>AUTHORS</h2>
  330. Jaroslav Hofierka, GeoModel, s.r.o. Bratislava, Slovakia <br>
  331. Marcel Suri, GeoModel, s.r.o. Bratislava, Slovakia <br>
  332. Thomas Huld, JRC, Italy <br>
  333. &copy; 2007, Jaroslav Hofierka, Marcel Suri. This program is free software under the GNU General Public License (&gt;=v2)
  334. <address>
  335. <a href="MAILTO:hofierka@geomodel.sk">hofierka@geomodel.sk</a>
  336. <a href="MAILTO:suri@geomodel.sk">suri@geomodel.sk</a>
  337. </address>
  338. <p>
  339. <i>Last changed: $Date$</i>