[GRASS-SVN] r46115 - grass-addons/display/d.barb

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 27 04:36:46 EDT 2011


Author: hamish
Date: 2011-04-27 01:36:46 -0700 (Wed, 27 Apr 2011)
New Revision: 46115

Modified:
   grass-addons/display/d.barb/description.html
   grass-addons/display/d.barb/draw.c
   grass-addons/display/d.barb/grid.c
   grass-addons/display/d.barb/local_proto.h
   grass-addons/display/d.barb/main.c
   grass-addons/display/d.barb/points.c
Log:
spelling, run grass_indent.sh

Modified: grass-addons/display/d.barb/description.html
===================================================================
--- grass-addons/display/d.barb/description.html	2011-04-27 08:22:31 UTC (rev 46114)
+++ grass-addons/display/d.barb/description.html	2011-04-27 08:36:46 UTC (rev 46115)
@@ -7,12 +7,14 @@
 
 <h2>NOTES</h2>
 
-Cartesian aspect is measures in degreess CCW from the positive x-axis (east).
-Compass aspect is measures in degreess CW from north.
+Cartesian aspect is measured in degrees CCW from the positive x-axis (east).
+Compass aspect is measured in degrees CW from north.
 <P>
+<!--I haven't added this yet, and I'm not sure that if I will. Leaning towards not.
 Rendering is scaled so largest stick covers 20% of the display frame
 for arrows and straws, use the scale parameter to adjust from there.
 <P>
+-->
 Wind barbs are all of equal length, but that length may be adjusted
 by the scale parameter.
 <P>
@@ -34,7 +36,7 @@
 
 <h2>EXAMPLES</h2>
 
-<h4>Sparse staion data from vector maps</h4>
+<h4>Sparse station data from vector maps</h4>
 
 First prepare some dummy data, then plot it.
 <div class="code"><pre>
@@ -51,7 +53,7 @@
    aspect=compass style=barb
 </pre></div>
 
-<h4>Eularian field from raster grid</h4>
+<h4>Eulerian field from raster grid</h4>
 <div class="code"><pre>
 # r.surf.volcano module from GRASS-addons
 g.region -d
@@ -62,7 +64,7 @@
 </pre></div>
 
 <!-- useful, but not really needed
-<h4>Create polar coordinate maps from cartesian components</h4>
+<h4>Create polar coordinate maps from Cartesian components</h4>
 
 <div class="code"><pre>
 MAPu=velocity.u
@@ -127,4 +129,3 @@
 <br>
 <p>
 <i>Last changed: $Date$</i></p>
-

Modified: grass-addons/display/d.barb/draw.c
===================================================================
--- grass-addons/display/d.barb/draw.c	2011-04-27 08:22:31 UTC (rev 46114)
+++ grass-addons/display/d.barb/draw.c	2011-04-27 08:36:46 UTC (rev 46115)
@@ -202,9 +202,9 @@
 }
 
 
-/* draws the stem and tail of a wind barb centered at e,n.
+/* draws the stem and tail of a wind barb centred at e,n.
    radius is scaling in display pixels, velocity is assumed as knots,
-   angle is cartesian convention CCW from positive x-axis */
+   angle is Cartesian convention CCW from positive x-axis */
 void draw_feather(double easting, double northing, double radius,
 		  double velocity, double compass_deg)
 {
@@ -648,7 +648,7 @@
 	R_polygon_abs(xi, yi, 4);
     }
 
-    /* barb rendering currenly saturates at 150 kts */
+    /* barb rendering currently saturates at 150 kts */
 
     return;
 }

Modified: grass-addons/display/d.barb/grid.c
===================================================================
--- grass-addons/display/d.barb/grid.c	2011-04-27 08:22:31 UTC (rev 46114)
+++ grass-addons/display/d.barb/grid.c	2011-04-27 08:36:46 UTC (rev 46115)
@@ -32,7 +32,7 @@
 	G_fatal_error(_("Problem reading range file"));
     G_get_fp_range_min_max(&range, &mag_min, &mag_max);
 
-    if(style != TYPE_BARB) {
+    if (style != TYPE_BARB) {
 	scale *= 1.5 / fabs(mag_max);
     }
     G_debug(3, "scaling=%.2f  rast_max=%.2f", scale, mag_max);
@@ -69,7 +69,7 @@
 	G_get_raster_row(dir_u_fd, dir_u_raster_row, row, dir_u_raster_type);
 	dir_u_ptr = dir_u_raster_row;
 
-	// should magnitude be manditory?
+	// should magnitude be mandatory?
 	if (mag_v_map) {
 	    G_get_raster_row(mag_v_fd, mag_v_raster_row, row,
 			     mag_v_raster_type);
@@ -124,29 +124,29 @@
 		continue;
 	    }
 
-	    if(is_component) {
+	    if (is_component) {
 		/* convert u,v to dir,mag */
-		r = sqrt(length*length + aspect_f*aspect_f);
+		r = sqrt(length * length + aspect_f * aspect_f);
 		theta = R2D(atan2(length, aspect_f));
 		length = r;
 		aspect_f = theta;
-		if(aspect_f < 0)
+		if (aspect_f < 0)
 		    aspect_f += 360;
 		else if (aspect_f > 360)
 		    aspect_f -= 360;
 	    }
 
-	    /* convert cartesian to compass convention */
+	    /* convert Cartesian to compass convention */
 	    if (aspect_type == TYPE_GRASS)
 		aspect_f = 90 - aspect_f;
 
-	    if(aspect_f < 0)
+	    if (aspect_f < 0)
 		aspect_f += 360;
 	    else if (aspect_f > 360)
 		aspect_f -= 360;
 
-	    if(reverse)
-	        aspect_f += 180;
+	    if (reverse)
+		aspect_f += 180;
 	    if (aspect_f > 360)
 		aspect_f -= 360;
 

Modified: grass-addons/display/d.barb/local_proto.h
===================================================================
--- grass-addons/display/d.barb/local_proto.h	2011-04-27 08:22:31 UTC (rev 46114)
+++ grass-addons/display/d.barb/local_proto.h	2011-04-27 08:36:46 UTC (rev 46115)
@@ -10,7 +10,7 @@
 #define TYPE_BARB 1
 #define TYPE_ARROW 2
 
-#define RpD ((2 * M_PI) / 360.)		/* radians/degree */
+#define RpD ((2 * M_PI) / 360.)	/* radians/degree */
 #define D2R(d) (double)(d * RpD)	/* degrees->radians */
 #define R2D(d) (double)(d / RpD)	/* radians->degrees */
 
@@ -18,7 +18,8 @@
 void do_barb_grid(char *, char *, int, int, int, double, int, int, int);
 
 /* points.c */
-void do_barb_points(char *, int, char *, char *, int, int, int, double, int, int);
+void do_barb_points(char *, int, char *, char *, int, int, int, double, int,
+		    int);
 int count_pts_in_region(struct Map_info *);
 void fill_arrays(struct Map_info *, int, char *, char *, int, double *,
 		 double *, double *, double *);

Modified: grass-addons/display/d.barb/main.c
===================================================================
--- grass-addons/display/d.barb/main.c	2011-04-27 08:22:31 UTC (rev 46114)
+++ grass-addons/display/d.barb/main.c	2011-04-27 08:36:46 UTC (rev 46115)
@@ -154,8 +154,7 @@
     /* TODO */
     from_to = G_define_flag();
     from_to->key = 'r';
-    from_to->label =
-	_("Rotate direction 180 degrees");
+    from_to->label = _("Rotate direction 180 degrees");
     from_to->description =
 	_("Useful for switching between atmospheric and oceanographic conventions");
 
@@ -184,7 +183,7 @@
 	strncpy(dir_u_map, dir_opt->answer, sizeof(dir_u_map) - 1);
 	strncpy(mag_v_map, magn_opt->answer, sizeof(mag_v_map) - 1);
     }
-    dir_u_map[sizeof(dir_u_map) - 1] = '\0'; /* strncpy() doesn't null-terminate on overflow */
+    dir_u_map[sizeof(dir_u_map) - 1] = '\0';	/* strncpy() doesn't null-terminate on overflow */
     mag_v_map[sizeof(mag_v_map) - 1] = '\0';
 
     if (vinput_opt->answer)

Modified: grass-addons/display/d.barb/points.c
===================================================================
--- grass-addons/display/d.barb/points.c	2011-04-27 08:22:31 UTC (rev 46114)
+++ grass-addons/display/d.barb/points.c	2011-04-27 08:36:46 UTC (rev 46115)
@@ -254,15 +254,15 @@
 		Mags[i] = cvarr_mag_v.ctype == DB_C_TYPE_INT ?
 		    (double)cv_mag_v->val.i : cv_mag_v->val.d;
 	    if (!is_uv) {
-		if (Mags[i] < 0)  /* magnitude is scalar and can only be positive */
+		if (Mags[i] < 0)	/* magnitude is scalar and can only be positive */
 		    Mags[i] = 0;
 	    }
 	}
 
-	if(is_uv) {
+	if (is_uv) {
 	    /* now that we have the data loaded, cycle back and process it */
 	    theta = R2D(atan2(Mags[i], Dirs[i]));
-	    r = sqrt(Dirs[i]*Dirs[i] + Mags[i]*Mags[i]);
+	    r = sqrt(Dirs[i] * Dirs[i] + Mags[i] * Mags[i]);
 	    Dirs[i] = theta;
 	    Mags[i] = r;
 	}



More information about the grass-commit mailing list