[GRASS-SVN] r66355 - grass/branches/releasebranch_7_0/raster/r.horizon

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 27 15:12:26 PDT 2015


Author: annakrat
Date: 2015-09-27 15:12:26 -0700 (Sun, 27 Sep 2015)
New Revision: 66355

Added:
   grass/branches/releasebranch_7_0/raster/r.horizon/rhorizon_polar_plot.png
Modified:
   grass/branches/releasebranch_7_0/raster/r.horizon/r.horizon.html
Log:
r.horizon: add polar plot example (merge from trunk, r65706)

Modified: grass/branches/releasebranch_7_0/raster/r.horizon/r.horizon.html
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.horizon/r.horizon.html	2015-09-27 22:05:26 UTC (rev 66354)
+++ grass/branches/releasebranch_7_0/raster/r.horizon/r.horizon.html	2015-09-27 22:12:26 UTC (rev 66355)
@@ -170,6 +170,28 @@
 Horizon angles for test point (CCW from East)
 </center>
 
+<p>We can plot horizon in polar coordinates using Matplotlib in Python:
+<div class="code"><pre>
+import numpy as np
+import matplotlib.pyplot as plt
+
+horizon = np.genfromtxt('horizon.csv', delimiter=',')
+horizon = horizon[1:, :]
+
+ax = plt.subplot(111, polar=True)
+bars = ax.plot(horizon[:, 0] / 180 * np.pi,
+               (90 - horizon[:, 1]) / 180 * np.pi)
+# uncomment the 2 following lines when using -c flag
+# ax.set_theta_direction(-1)
+# ax.set_theta_zero_location('N')
+plt.show()
+</pre></div>
+
+<center>
+<img src="rhorizon_polar_plot.png"><br>
+Horizon plot in polar coordinates.
+</center>
+
 <h3>Raster map mode</h3>
 
 Raster map mode (output maps "horangle*" become input for <em>r.sun</em>):

Copied: grass/branches/releasebranch_7_0/raster/r.horizon/rhorizon_polar_plot.png (from rev 65706, grass/trunk/raster/r.horizon/rhorizon_polar_plot.png)
===================================================================
(Binary files differ)



More information about the grass-commit mailing list