DragonFly On-Line Manual Pages
PSWIGGLE(1) Generic Mapping Tools PSWIGGLE(1)
NAME
pswiggle - Plot anomaly along track on a map
SYNOPSIS
pswiggle xyz_files -Jparameters -Rwest/east/south/north[r] -Zscale [
-Aazimuth ] [ -B[p|s]parameters ] [ -Ccenter ] [ -D[x]gap ] [
-Eazim/elev[+wlon/lat[/z]][+vx0/y0] ] [ -Gfill ] [ -H[i][nrec] ] [
-Jz|Zparameters ] [ -Ifix_az ] [ -K ] [ -N ] [ -O ] [ -P ] [
-S[x]lon0/lat0/length[/units] ] [ -Tpen ] [ -U[just/dx/dy/][c|label] ]
[ -V ] [ -Wpen ] [ -X[a|c|r][x-shift[u]] ] [ -Y[a|c|r][y-shift[u]] ] [
-ccopies ] [ -:[i|o] ] [ -bi[s|S|d|D[ncol]|c[var1/...]] ] [ -fcolinfo ]
[ -m[i|o][flag] ]
DESCRIPTION
pswiggle reads (x,y,z) triplets from files [or standard input] and
plots z as a function of distance along track. This means that two
consecutive (x,y) points define the local distance axis, and the local
z axis is then perpendicular to the distance axis. The user may set a
preferred positive anomaly plot direction, and if the positive normal
is outside the plus/minus 90 degree window around the preferred
direction, then 180 degrees are added to the direction. Either the
positive or the negative wiggle may be shaded. The resulting
PostScript code is written to standard output.
files List one or more file-names. If no files are given, pswiggle
will read standard input.
-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 .gmtdefaults4, but this
can be overridden on the command line by appending c, i, or m to
the scale/width value. When central meridian is optional,
default is center of longitude range on -R option. Default
standard parallel is the equator. For map height, max
dimension, or min dimension, append h, *, or - to the width,
respectively.
More details can be found in the psbasemap man pages.
CYLINDRICAL PROJECTIONS:
-Jclon0/lat0/scale (Cassini)
-Jcyl_stere/[lon0/[lat0/]]scale (Cylindrical Stereographic)
-Jj[lon0/]scale (Miller)
-Jm[lon0/[lat0/]]scale (Mercator)
-Jmlon0/lat0/scale (Mercator - Give meridian and standard
parallel)
-Jo[a]lon0/lat0/azimuth/scale (Oblique Mercator - point and
azimuth)
-Jo[b]lon0/lat0/lon1/lat1/scale (Oblique Mercator - two points)
-Joclon0/lat0/lonp/latp/scale (Oblique Mercator - point and
pole)
-Jq[lon0/[lat0/]]scale (Cylindrical Equidistant)
-Jtlon0/[lat0/]scale (TM - Transverse Mercator)
-Juzone/scale (UTM - Universal Transverse Mercator)
-Jy[lon0/[lat0/]]scale (Cylindrical Equal-Area)
CONIC PROJECTIONS:
-Jblon0/lat0/lat1/lat2/scale (Albers)
-Jdlon0/lat0/lat1/lat2/scale (Conic Equidistant)
-Jllon0/lat0/lat1/lat2/scale (Lambert Conic Conformal)
-Jpoly/[lon0/[lat0/]]scale ((American) Polyconic)
AZIMUTHAL PROJECTIONS:
-Jalon0/lat0[/horizon]/scale (Lambert Azimuthal Equal-Area)
-Jelon0/lat0[/horizon]/scale (Azimuthal Equidistant)
-Jflon0/lat0[/horizon]/scale (Gnomonic)
-Jglon0/lat0[/horizon]/scale (Orthographic)
-Jglon0/lat0/altitude/azimuth/tilt/twist/Width/Height/scale
(General Perspective).
-Jslon0/lat0[/horizon]/scale (General Stereographic)
MISCELLANEOUS PROJECTIONS:
-Jh[lon0/]scale (Hammer)
-Ji[lon0/]scale (Sinusoidal)
-Jkf[lon0/]scale (Eckert IV)
-Jk[s][lon0/]scale (Eckert VI)
-Jn[lon0/]scale (Robinson)
-Jr[lon0/]scale (Winkel Tripel)
-Jv[lon0/]scale (Van der Grinten)
-Jw[lon0/]scale (Mollweide)
NON-GEOGRAPHICAL PROJECTIONS:
-Jp[a]scale[/origin][r|z] (Polar coordinates (theta,r))
-Jxx-scale[d|l|ppow|t|T][/y-scale[d|l|ppow|t|T]] (Linear, log,
and power scaling)
-R xmin, xmax, ymin, and ymax specify the Region of interest. For
geographic regions, these limits correspond to west, east,
south, and north and you may specify them in decimal degrees or
in [+-]dd:mm[:ss.xxx][W|E|S|N] format. Append r if lower left
and upper right map coordinates are given instead of w/e/s/n.
The two shorthands -Rg and -Rd stand for global domain (0/360
and -180/+180 in longitude respectively, with -90/+90 in
latitude). Alternatively, specify the name of an existing grid
file and the -R settings (and grid spacing, if applicable) are
copied from the grid. For calendar time coordinates you may
either give (a) relative time (relative to the selected
TIME_EPOCH and in the selected TIME_UNIT; append t to -JX|x), or
(b) absolute time of the form [date]T[clock] (append T to
-JX|x). At least one of date and clock must be present; the T
is always required. The date string must be of the form
[-]yyyy[-mm[-dd]] (Gregorian calendar) or yyyy[-Www[-d]] (ISO
week calendar), while the clock string must be of the form
hh:mm:ss[.xxx]. The use of delimiters and their type and
positions must be exactly as indicated (however, input, output
and plot formats are customizable; see gmtdefaults).
-Z Gives anomaly scale in data-units/distance-unit.
OPTIONS
No space between the option flag and the associated arguments.
-A Sets the preferred positive azimuth. Positive wiggles will
"gravitate" towards that direction.
-B Sets map boundary annotation and tickmark intervals; see the
psbasemap man page for all the details.
-C Subtract center from the data set before plotting [0].
-D Means there is a data gap if 2 consecutive points are more than
gap distance units apart. For geographic map projections the
gap is assumed to be in km, else it is in the user's units.
-E Sets the viewpoint's azimuth and elevation (for perspective
view) [180/90]. For frames used for animation, you may want to
append * to fix the center of your data domain (or specify a
particular world coordinate point with +wlon0/lat[/z]) which
will project to the center of your page size (or specify the
coordinates of the projected view point with +vx0/y0).
-G Set fill shade, color or pattern of positive wiggles [Default is
black] (See SPECIFYING FILL below).
-H Input file(s) has header record(s). If used, the default number
of header records is N_HEADER_RECS. Use -Hi if only input data
should have header records [Default will write out header
records if the input data have them]. Blank lines and lines
starting with # are always skipped.
-I Set a fixed azimuth projection for wiggles [Default uses track
azimuth, but see -A].
-K More PostScript code will be appended later [Default terminates
the plot system].
-N Paint negative wiggles instead of positive [Default].
-O Selects Overlay plot mode [Default initializes a new plot
system].
-P Selects Portrait plotting mode [Default is Landscape, see
gmtdefaults to change this].
-S Draws a simple vertical scale centered on lon0/lat0. Use -Sx to
specify cartesian coordinates instead. length is in z units,
append unit name for labeling
-T Draw track [Default is no track]. Append pen attributes to use
[Defaults: width = 0.25p, color = black, texture = solid]. (See
SPECIFYING PENS below).
-U Draw Unix System time stamp on plot. By adding just/dx/dy/, the
user may specify the justification of the stamp and where the
stamp should fall on the page relative to lower left corner of
the plot. For example, BL/0/0 will align the lower left corner
of the time stamp with the lower left corner of the plot.
Optionally, append a label, or c (which will plot the command
string.). The GMT parameters UNIX_TIME, UNIX_TIME_POS, and
UNIX_TIME_FORMAT can affect the appearance; see the gmtdefaults
man page for details. The time string will be in the locale set
by the environment variable TZ (generally local time).
-V Selects verbose mode, which will send progress reports to stderr
[Default runs "silently"].
-W Draw wiggle outline [Default is no outline]. Append pen
attributes to use [Defaults: width = 0.25p, color = black,
texture = solid]. (See SPECIFYING PENS below).
-X -Y Shift plot origin relative to the current origin by (x-shift,y-
shift) and optionally append the length unit (c, i, m, p). You
can prepend a to shift the origin back to the original position
after plotting, or prepend r [Default] to reset the current
origin to the new location. If -O is used then the default (x-
shift,y-shift) is (0,0), otherwise it is (r1i, r1i) or (r2.5c,
r2.5c). Alternatively, give c to align the center coordinate (x
or y) of the plot with the center of the page based on current
page size.
-: Toggles between (longitude,latitude) and (latitude,longitude)
input and/or output. [Default is (longitude,latitude)]. Append
i to select input only or o to select output only. [Default
affects both].
-bi Selects binary input. Append s for single precision [Default is
d (double)]. Uppercase S or D will force byte-swapping.
Optionally, append ncol, the number of columns in your binary
input file if it exceeds the columns needed by the program. Or
append c if the input file is netCDF. Optionally, append
var1/var2/... to specify the variables to be read. [Default is
3 input columns].
-c Specifies the number of plot copies. [Default is 1].
-f Special formatting of input and/or output columns (time or
geographical data). Specify i or o to make this apply only to
input or output [Default applies to both]. Give one or more
columns (or column ranges) separated by commas. Append T
(absolute calendar time), t (relative time in chosen TIME_UNIT
since TIME_EPOCH), x (longitude), y (latitude), or f (floating
point) to each column or column range item. Shorthand -f[i|o]g
means -f[i|o]0x,1y (geographic coordinates).
-m Multiple segment file(s). Segments are separated by a special
record. For ASCII files the first character must be flag
[Default is '>']. For binary files all fields must be NaN and
-b must set the number of output columns explicitly. By default
the -m setting applies to both input and output. Use -mi and
-mo to give separate settings to input and output.
SPECIFYING PENS
pen The attributes of lines and symbol outlines as defined by pen is
a comma delimetered list of width, color and texture, each of
which is optional. width can be indicated as a measure (points,
centimeters, inches) or as faint, thin[ner|nest], thick[er|est],
fat[ter|test], or obese. color specifies a gray shade or color
(see SPECIFYING COLOR below). texture is a combination of
dashes `-' and dots `.'.
SPECIFYING FILL
fill The attribute fill specifies the solid shade or solid color (see
SPECIFYING COLOR below) or the pattern used for filling
polygons. Patterns are specified as pdpi/pattern, where pattern
gives the number of the built-in pattern (1-90) or the name of a
Sun 1-, 8-, or 24-bit raster file. The dpi sets the resolution
of the image. For 1-bit rasters: use Pdpi/pattern for inverse
video, or append :Fcolor[B[color]] to specify fore- and
background colors (use color = - for transparency). See GMT
Cookbook & Technical Reference Appendix E for information on
individual patterns.
SPECIFYING COLOR
color The color of lines, areas and patterns can be specified by a
valid color name; by a gray shade (in the range 0-255); by a
decimal color code (r/g/b, each in range 0-255; h-s-v, ranges
0-360, 0-1, 0-1; or c/m/y/k, each in range 0-1); or by a
hexadecimal color code (#rrggbb, as used in HTML). See the
gmtcolors manpage for more information and a full list of color
names.
EXAMPLES
To plot the magnetic anomaly stored in the file track.xym along track @
1000 nTesla/cm (after removing a mean value of 32000 nTesla), using a
15 -cm-wide Polar Stereographic map ticked every 5 degrees in Portrait
mode, with positive anomalies in red on a blue track of width 0.25
points, use
pswiggle track.xym -R-20/10/-80/-60 -JS 0/90/15c -Z 1000 -B 5 -C 32000
-P -G red -T 0.25p,blue -S 1000 -V > track_xym.ps
BUGS
Sometimes the (x,y) coordinates are not printed with enough significant
digits, so the local perpendicular to the track swings around a lot.
To see if this is the problem, you should do this:
awk '{ if (NR > 1) print atan2(y-$1, x-$2); y=$1; x=$2; }' yourdata.xyz
| more
(note that output is in radians; on some machines you need "nawk" to do
this). Then if these numbers jump around a lot, you may do this:
awk '{ print NR, $0 }' yourdata.xyz | filter1d -Fb 5 -N 4/0
--D_FORMAT=value > smoothed.xyz
and plot this data set instead.
SEE ALSO
GMT(1), gmtcolors(5), filter1d(1), psbasemap(1), splitxyz(1)
GMT 4.5.14 1 Nov 2015 PSWIGGLE(1)