diff -uNr GMT3.4.2.orig/man/manl/grdbarb.l GMT3.4.2/man/manl/grdbarb.l --- GMT3.4.2.orig/man/manl/grdbarb.l Thu Jan 1 09:00:00 1970 +++ GMT3.4.2/man/manl/grdbarb.l Thu Feb 13 18:00:03 2003 @@ -0,0 +1,185 @@ +.TH GRDVECTOR l "1 Mar 2002" +.SH NAME +grdbarb \- Plot wind barb fields from grdfiles +.SH SYNOPSIS +\fBgrdbarb\fP \fIcompx.grd\fP \fIcompy.grd\fP \fB\-J\fP\fIparameters\fP [ \fB\-A\fP ] +[ \fB\-B\fP\fItickinfo\fP ] [ \fB\-E\fP ] +[ \fB\-I\fP\fIx_inc\fP[\fBm|c\fP][/\fIy_inc\fP[\fBm|c\fP]] ] [ \fB\-K\fP ] [ \fB\-N\fP ] [ \fB\-O\fP ] [ \fB\-P\fP ] +[ \fB\-Q\fP\fIparameters\fP ] [ \fB\-R\fP\fIwest/east/south/north\fP[\fBr\fP] ] +[ \fB\-T\fP ] [ \fB\-U\fP[\fI/dx/dy/\fP][\fIlabel\fP] ] [ \fB\-V\fP ] [ \fB\-W\fP\fIcontourpen\fP ] [ \fB\-X\fP\fIx-shift\fP ] +[ \fB\-Y\fP\fIy-shift\fP ] [ \fB\-Z\fP ] [ \fB\-c\fP\fIcopies\fP ] +.SH DESCRIPTION +\fBgrdbarb\fP reads two 2-D gridded files which represents the x- and y-components of a vector field and +produces a wind barb field plot by +drawing barbs with orientation and length according to the information in the files. Alternatively, +polar coordinate components may be used (r, theta). +.TP +\fIcompx.grd\fP +Contains the x-component of the vector field. +.TP +\fIcompy.grd\fP +Contains the y-component of the vector field. +.TP +.B \-J +Selects the map projection. Scale is UNIT/degree, 1:xxxxx, or width in UNIT (upper case modifier). +UNIT is cm, inch, or m, depending on the MEASURE_UNIT setting in .gmtdefaults, but this can be +overridden on the command line by appending the c, i, or m to the scale/width value. +.br +.sp +\fBCYLINDRICAL PROJECTIONS:\fP +.br +.sp +\fB\-Jc\fP\fIlon0/lat0/scale\fP (Cassini) +.br +\fB\-Jj\fP\fIlon0/scale\fP (Miller) +.br +\fB\-Jm\fP\fIscale\fP (Mercator - Greenwich and Equator as origin) +.br +\fB\-Jm\fP\fIlon0/lat0/scale\fP (Mercator - Give meridian and standard parallel) +.br +\fB\-Joa\fP\fIlon0/lat0/azimuth/scale\fP (Oblique Mercator - point and azimuth) +.br +\fB\-Job\fP\fIlon0/lat0/lon1/lat1/scale\fP (Oblique Mercator - two points) +.br +\fB\-Joc\fP\fIlon0/lat0/lonp/latp/scale\fP (Oblique Mercator - point and pole) +.br +\fB\-Jq\fP\fIlon0/scale\fP (Equidistant Cylindrical Projection (Plate Carree)) +.br +\fB\-Jt\fP\fIlon0/scale\fP (TM - Transverse Mercator, with Equator as y = 0) +.br +\fB\-Jt\fP\fIlon0/lat0/scale\fP (TM - Transverse Mercator, set origin) +.br +\fB\-Ju\fP\fIzone/scale\fP (UTM - Universal Transverse Mercator) +.br +\fB\-Jy\fP\fIlon0/lats/scale\fP (Basic Cylindrical Projection) +.br +.sp +\fBAZIMUTHAL PROJECTIONS:\fP +.br +.sp +\fB\-Ja\fP\fIlon0/lat0/scale\fP (Lambert). +.br +\fB\-Je\fP\fIlon0/lat0/scale\fP (Equidistant). +.br +\fB\-Jf\fP\fIlon0/lat0/horizon/scale\fP (Gnomonic). +.br +\fB\-Jg\fP\fIlon0/lat0/scale\fP (Orthographic). +.br +\fB\-Js\fP\fIlon0/lat0/\fP[\fIslat/\fP]\fIscale\fP (General Stereographic) +.br +.sp +\fBCONIC PROJECTIONS:\fP +.br +.sp +\fB\-Jb\fP\fIlon0/lat0/lat1/lat2/scale\fP (Albers) +.br +\fB\-Jd\fP\fIlon0/lat0/lat1/lat2/scale\fP (Equidistant) +.br +\fB\-Jl\fP\fIlon0/lat0/lat1/lat2/scale\fP (Lambert) +.br +.sp +\fBMISCELLANEOUS PROJECTIONS:\fP +.br +.sp +\fB\-Jh\fP\fIlon0/scale\fP (Hammer) +.br +\fB\-Ji\fP\fIlon0/scale\fP (Sinusoidal) +.br +\fB\-Jk\fP[\fBf|s\fP]\fIlon0/scale\fP (Eckert IV (f) and VI (s)) +.br +\fB\-Jn\fP\fIlon0/scale\fP (Robinson) +.br +\fB\-Jr\fP\fIlon0/scale\fP (Winkel Tripel) +.br +\fB\-Jv\fP\fIlon0/scale\fP (Van der Grinten) +.br +\fB\-Jw\fP\fIlon0/scale\fP (Mollweide) +.br +.sp +\fBNON-GEOGRAPHICAL PROJECTIONS:\fP +.br +.sp +\fB\-Jp\fP[\fBa\fP]\fIscale\fP[\fI/origin\fP] (polar (theta,r) coordinates, optional \fBa\fP for azimuths and offset theta [0]) +.br +\fB\-Jx\fP\fIx-scale\fP[\fBl|p\fP\fIpow\fP][\fI/y-scale\fP[\fBl|p\fP\fIpow\fP]] (Linear, log, and power scaling) +.br +More details can be found in the \fBpsbasemap\fP manpages. +.br +.SH OPTIONS +No space between the option flag and the associated arguments. +.TP +.B \-A +Means grdfiles have polar (r, theta) components instead of Cartesian (x, y). +.TP +.B \-B +Sets map boundary tickmark intervals. See \fBpsbasemap\fP for details. +.TP +.B \-E +Center vectors on grid nodes [Default draws from grid node]. +.TP +.B \-I +Only plot vectors at nodes every \fIx_inc, y_inc\fP apart (must be multiples of +original grid spacing). Append \fBm\fP for minutes or \fBc\fP for seconds. [Default plots every node]. +.TP +.B \-K +More \fIPostScript\fP code will be appended later [Default terminates the plot system]. +.TP +.B \-N +Do NOT clip vectors at map boundaries [Default will clip]. +.TP +.B \-O +Selects Overlay plot mode [Default initializes a new plot system]. +.TP +.B \-P +Selects Portrait plotting mode [\fBGMT\fP Default is Landscape, see gmtdefaults to change this]. +.TP +.B \-Q +Select barb plot. Optionally, specify \fIparameters\fP which +are \fIbarbwidth/barblength/barbangle/barbscale\fP [Default is 0.1\fBi\fP/0.2\fBi\fP/120/5]. +.TP +.B \-R +\fIwest, east, south,\fP and \fInorth\fP specify the Region of interest. To specify boundaries +in degrees and minutes [and seconds], use the dd:mm[:ss] format. Append \fBr\fP if lower left and upper right +map coordinates are given instead of wesn. +Specify a subset of the grid. +.TP +.B \-T +Means azimuth should be converted to angles based on the selected map projection. +.TP +.B \-U +Draw Unix System time stamp on plot. User may specify where the lower left corner +of the stamp should fall on the page relative to lower left corner of plot. Optionally, +append a label, or \fBc\fP (which will plot the command string.). The GMT parameters +UNIX_TIME and UNIX_TIME_POS can affect the appearance; see the \fBgmtdefaults\fP man +page for details. +.TP +.B \-V +Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. +.TP +.B \-W +Set pen attributes used for vector outlines [Default: width = 1, color = 0/0/0, texture = solid]. +.TP +.B \-X \-Y +Shift origin of plot by (\fIx-shift,y-shift\fP). +Prepend \fBa\fP for absolute coordinates; +the default (\fBr\fP) will reset plot origin. +.TP +.B \-Z +Means the angles provided are azimuths rather than direction (requires \fB\-A\fP). +.TP +.B \-c +Specifies the number of plot copies. [Default is 1] +.SH EXAMPLES +To draw the vector field given by the files r.grd and theta.grd on a linear plot +with scale 5 cm per data unit, +using vector rather than stick plot, and scale vector magnitudes so that 10 units +equal 1 inch, try +.br +.sp +grdvector r.grd theta.grd \fB\-Jx\fP5\fBc\fP \fB\-Q\fP \fB\-S\fP10\fBi\fP > gradient.ps +.br +.sp +.SH "SEE ALSO" +.IR gmt (l), +.IR grdcontour (l), +.IR psxy (l) diff -uNr GMT3.4.2.orig/man/manl/psxy.l GMT3.4.2/man/manl/psxy.l --- GMT3.4.2.orig/man/manl/psxy.l Thu Oct 3 02:25:53 2002 +++ GMT3.4.2/man/manl/psxy.l Thu Feb 13 18:03:43 2003 @@ -225,6 +225,16 @@ .B \-Sp \fBp\fPoint. No size needs to be specified (1 pixel is used). .TP +.B \-Sr +\fBw\fPind barb. Direction (in degrees counter-clockwise from horizontal) and length must be found in columns 3 and 4. \fIsize\fP, +if present, will be interpreted as barbwidth/barblength/barbangle/barbscale [Default is 0.1\fBi\fP/0.2\fBi\fP/120/5]. +.TP +.B \-SR +Same as \fB\-Sr\fP, except azimuth (in degrees east of north) should be given instead of direction. The azimuth will +be mapped into an angle based on the chosen map projection (\fB\-Sr\fP leaves the directions +unchanged.) +.TP +.B \-Ss .B \-Ss \fBs\fPquare. \fIsize\fP is diameter of circumscribing circle. .TP diff -uNr GMT3.4.3/src/Makefile GMT3.4.3.new/src/Makefile --- GMT3.4.3/src/Makefile 2003-04-11 08:03:00.000000000 +0900 +++ GMT3.4.3.new/src/Makefile 2003-04-30 22:12:50.000000000 +0900 @@ -103,7 +103,7 @@ psbasemap.c psclip.c pscoast.c pshistogram.c psimage.c psmask.c \ psrose.c psscale.c pstext.c pscontour.c pswiggle.c psxy.c psxyz.c \ sample1d.c spectrum1d.c splitxyz.c surface.c trend1d.c trend2d.c \ - triangulate.c xyz2grd.c + triangulate.c xyz2grd.c grdbarb.c first: all @@ -144,7 +144,7 @@ all: init libs $(PROGS) init: gmtmacros gmt_notposix.h gmt_nan.h - + gmtmacros: if [ `cat makegmt.macros | wc -c` = 0 ]; then \ echo "src/makegmt.macros is empty - you must rerun configure in the main GMT directory"; \ diff -uNr GMT3.4.3/src/grdbarb.c GMT3.4.3.new/src/grdbarb.c --- GMT3.4.3/src/grdbarb.c 1970-01-01 09:00:00.000000000 +0900 +++ GMT3.4.3.new/src/grdbarb.c 2003-04-30 22:12:51.000000000 +0900 @@ -0,0 +1,420 @@ +/*-------------------------------------------------------------------- + * $Id: grdbarb.c,v 0.5 2002/05/27 $ + * + * Copyright (c) 1991-2002 by P. Wessel and W. H. F. Smith + * See COPYING file for copying and redistribution conditions. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Contact info: gmt.soest.hawaii.edu + *--------------------------------------------------------------------*/ +/* + + grdbarb reads 2 grdfiles that contains the 2 components of a vector + field (cartesian or polar) and plots wind barb at the grid positions. + + *** CAUTION *** + This program is under construction. + + Author: cachu + Date: 27-MAY-2002 + Revised: ----------- + Version: 0.5 ( for GMT-3.4.1 ) + + */ + + +#include "gmt.h" + +float *r, *theta; + +main (int argc, char **argv) +{ + + int i, j, n = 0, nm, nx, ny, ij, i0, j0, di, dj, off; + int dummy[4], knot_or_ms = 0; + + BOOLEAN convert_angles = FALSE, get_rgb = FALSE, cartesian = TRUE, shrink = FALSE, set_fill = FALSE; + BOOLEAN error = FALSE, center = FALSE, outline = FALSE, azimuth = FALSE, stick_plot = TRUE, inc_set = FALSE; + BOOLEAN clip = TRUE , got_fix_length = FALSE; + + char *file[2], *cpt, txt_a[32], txt_b[32], txt_c[32], unit = 0; + + double dx2, dy2, b_width = 0.1, b_length = 0.2, b_angle = 120., b_scale = 5.; + double v_w, h_l, h_w, v_shrink, v_norm = 0.0, tmp, x, y, plot_x, plot_y, x_off, y_off; + double west, east, south, north, x2, y2, scale = 1.0, fix_length = 0.0; + double data_west, data_east, data_south, data_north, value, c, s; + + struct GRD_HEADER h[2]; + struct GMT_FILL fill; + struct GMT_PEN pen; + + GMT_init_pen (&pen, GMT_PENWIDTH); + GMT_init_fill (&fill, -1, -1, -1); + west = east = south = north = 0.0; + dummy[0] = dummy[1] = dummy[2] = dummy[3] = 0; + di = dj = 1; + i0 = j0 = 0; + dx2 = dy2 = 0.0; + + argc = GMT_begin (argc, argv); + + for (i = 1; i < argc; i++) { + if (argv[i][0] == '-') { + switch (argv[i][1]) { + /* Common parameters */ + + case 'B': + case 'J': + case 'K': + case 'O': + case 'P': + case 'R': + case 'U': + case 'V': + case 'X': + case 'x': + case 'Y': + case 'y': + case 'c': + case '\0': + error += GMT_get_common_args (argv[i], &west, &east, &south, &north); + break; + + /* Supplemental parameters */ + + case 'A': + cartesian = FALSE; + break; + case 'C': /* Vary symbol color with z */ + cpt = &argv[i][2]; + get_rgb = TRUE; + break; + case 'E': + center = TRUE; + break; + case 'G': /* Set Gray shade for polygon */ + if (GMT_getfill (&argv[i][2], &fill)) { + GMT_fill_syntax ('G'); + error++; + } + set_fill = TRUE; + break; + case 'I': /* Only use gridnodes dx2,dy2 apart */ + GMT_getinc (&argv[i][2], &dx2, &dy2); + inc_set = TRUE; + break; + case 'N': /* Do not clip at border */ + clip = FALSE; + break; + case 'Q': + if (argv[i][2] && argv[i][3] != 'n') { + if (sscanf (&argv[i][2], "%[^/]/%[^/]/%lf/%lf", txt_a, txt_b, &b_angle, &b_scale) != 4) { + fprintf (stderr, "%s: GMT SYNTAX ERROR -Q option: Could not decode barbwidth/barblength/barbangle/barbscale\n", GMT_program); + error++; + } + else { + b_width = GMT_convert_units (txt_a, GMT_INCH); + b_length = GMT_convert_units (txt_b, GMT_INCH); + } + } + stick_plot = FALSE; + break; + case 'S': + j = strlen (argv[i]) - 1; + if (strchr ("cimpCIMP", (int)argv[i][j])) unit = argv[i][j]; + if (argv[i][2] == 'l' || argv[i][2] == 'L') { + got_fix_length = TRUE; + fix_length = atof (&argv[i][3]); + } + else + scale = atof (&argv[i][2]); + break; + case 'T': + convert_angles = TRUE; + break; + case 'W': /* Set line attributes */ + if (argv[i][2] && GMT_getpen (&argv[i][2], &pen)) { + GMT_pen_syntax ('W'); + error++; + } + outline = TRUE; + break; + case 'Z': + azimuth = TRUE; + break; + default: + error = TRUE; + GMT_default_error (argv[i][1]); + break; + } + } + else if (n < 2) + file[n++] = argv[i]; + else + n++; + } + + if (argc == 1 || GMT_quick) { + fprintf (stderr, "grdbarb %s - Plot wind barb fields from grdfiles\n\n", GMT_VERSION); + fprintf (stderr, "usage: grdbarb compx.grd compy.grd -J -R [-A]\n"); + fprintf (stderr, "\t[-B] [-E] [-I] [-K] [-O] [-P] [-Q] [-N] [-T]\n"); + fprintf (stderr, "\t[-U[