pswiggle

Plot z = f(x,y) anomalies along tracks

Synopsis

gmt pswiggle [ table ] -Jparameters -Rwest/east/south/north[/zmin/zmax][+r][+uunit] -Zscale [ -A[azimuth] ] [ -B[p|s]parameters ] [ -Ccenter ] [ -Drefpoint ] [ -Fpanel ] [ -Gfill[+n][+p] ] [ -Ifix_az ] [ -K ] [ -O ] [ -P ] [ -Tpen ] [ -U[stamp] ] [ -V[level] ] [ -Wpen ] [ -X[a|c|f|r][xshift] ] [ -Y[a|c|f|r][yshift] ] [ -bibinary ] [ -dinodata ] [ -eregexp ] [ -fflags ] [ -ggaps ] [ -hheaders ] [ -iflags ] [ -pflags ] [ -qiflags ] [ -ttransp ] [ -:[i|o] ] [ --PAR=value ]

Note: No space is allowed between the option flag and the associated arguments.

Description

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, forming a right-handed coordinate system. The user may set a preferred positive anomaly plot direction, and if the positive normal is outside the ±90 degree window around the preferred direction, then 180 degrees are added to the direction. Either the positive or the negative wiggle (or both) may be shaded.

Required Arguments

-Jparameters (more …)

Select map projection.

-Rxmin/xmax/ymin/ymax[+r][+uunit] (more …)

Specify the region of interest.

For perspective view -p, optionally append /zmin/zmax. (more …)

-Zscale

Gives anomaly scale in data-units/distance-unit. Append c, i, or p to indicate the distance unit (cm, inch, or point); if no unit is given we use the default unit that is controlled by PROJ_LENGTH_UNIT.

Optional Arguments

table

One or more ASCII (or binary, see -bi[ncols][type]) data table file(s) holding a number of data columns. If no tables are given then we read from standard input.

-A[azimuth]

Sets the preferred positive azimuth. Positive wiggles will “gravitate” towards that direction, i.e., azimuths of the normal direction to the track will be flipped into the -90/+90 degree window centered on azimuth and that defines the positive wiggle side. If no azimuth is given the no preferred azimuth is enforced. Default is -A0.

-B[p|s]parameters (more …)

Set map boundary frame and axes attributes.

-Ccenter

Subtract center from the data set before plotting [0].

-D[g|j|J|n|x]refpoint+wlength[+jjustify][+al|r][+odx[/dy]][+l[label]]

Defines the reference point on the map for the vertical scale bar using one of four coordinate systems:

(1) Append glon/lat for map (user) coordinates, (2) jcode or Jcode for setting the refpoint via a 2-char justification code that refers to the (invisible) projected map bounding box, (3) nxn/yn for normalized (0-1) bounding box coordinates, or (4) xx/y for plot coordinates (inches, cm, points, append unit). All but x requires both -R and -J to be specified. You can offset the reference point via +odx/dy in the direction implied by code or +jjustify.

Append +w followed by the length or the scale bar in data (z) units. By default, the anchor point on the scale is assumed to be the middle left corner (ML), but this can be changed by appending +j followed by a 2-char justification code justify (see text). Note: If -Dj is used then justify defaults to the same as refpoint, if -DJ is used then justify defaults to the mirror opposite of refpoint. Consequently, -DJ is used to place a scale outside the map frame while -Dj is used to place it inside the frame. Move scale label to the left side with +al [Default is to the right of the scale]. Append +l to set the z unit label that is used in the scale label [no unit]. The FONT_ANNOT_PRIMARY is used for the font setting.

-F[+cclearances][+gfill][+i[[gap/]pen]][+p[pen]][+r[radius]][+s[[dx/dy/][shade]]]

Without further options, draws a rectangular border around the vertical scale bar using MAP_FRAME_PEN; specify a different pen with +ppen. Add +gfill to fill the scale panel [no fill]. Append +cclearance where clearance is either gap, xgap/ygap, or lgap/rgap/bgap/tgap where these items are uniform, separate in x- and y-direction, or individual side spacings between scale and border. Append +i to draw a secondary, inner border as well. We use a uniform gap between borders of 2p and the MAP_DEFAULT_PEN unless other values are specified. Append +r to draw rounded rectangular borders instead, with a 6p corner radius. You can override this radius by appending another value. Finally, append +s to draw an offset background shaded region. Here, dx/dy indicates the shift relative to the foreground frame [4p/-4p] and shade sets the fill style to use for shading [gray50].

-Gfill[+n][+p] (more …)

Set fill shade, color or pattern for positive and/or negative wiggles [Default is no fill]. Optionally, append +p to fill positive areas (this is the default behavior). Append +n to fill negative areas. Append +n+p to fill both positive and negative areas with the same fill.

-Ifix_az

Set a fixed azimuth projection for wiggles [Default uses track azimuth, but see -A]. With this option, the calculated track-normal azimuths are overridden by fixed_az.

-Tpen

Draw track [Default is no track]. Append pen attributes to use [Defaults: width = 0.25p, color = black, style = solid].

-U[label][+c][+jjust][+odx/dy] (more …)

Draw GMT time stamp logo on plot.

-V[level] (more …)

Select verbosity level [w].

-Wpen

Specify outline pen attributes [Default is no outline].

-bi[ncols][t] (more …)

Select native binary format for primary input. [Default is 3 input columns].

-dinodata (more …)

Replace input columns that equal nodata with NaN.

-e[~]“pattern” | -e[~]/regexp/[i] (more …)

Only accept data records that match the given pattern.

-f[i|o]colinfo (more …)

Specify data types of input and/or output columns.

-g[a]x|y|d|X|Y|D|[col]zgap[+n|p] (more …)

Determine data gaps and line breaks.

-h[i|o][n][+c][+d][+msegheader][+rremark][+ttitle] (more …)

Skip or produce header record(s).

-icols[+l][+sscale][+ooffset][,][,t[word]] (more …)

Select input columns and transformations (0 is first column, t is trailing text, append word to read one word only).

-p[x|y|z]azim[/elev[/zlevel]][+wlon0/lat0[/z0]][+vx0/y0] (more …)

Select perspective view.

-qi[~]rows[+ccol][+a|f|s] (more …)

Select input rows or data range(s) [all].

-t[transp] (more …)

Set transparency level in percent.

-:[i|o] (more …)

Swap 1st and 2nd column on input and/or output.

-^ or just -

Print a short message about the syntax of the command, then exit (NOTE: on Windows just use -).

-+ or just +

Print an extensive usage (help) message, including the explanation of any module-specific option (but not the GMT common options), then exit.

-? or no arguments

Print a complete usage (help) message, including the explanation of all options, then exit.

--PAR=value

Temporarily override a GMT default setting; repeatable. See gmt.conf for parameters.

Classic Mode Arguments

These options are used to manipulate the building of layered GMT PostScript plots in classic mode. They are not available when using GMT modern mode.

-K (more …)

Do not finalize the PostScript plot.

-O (more …)

Append to existing PostScript plot.

-P (more …)

Select “Portrait” plot orientation.

Examples

Note: Below are some examples of valid syntax for this module. The examples that use remote files (file names starting with @) can be cut and pasted into your terminal for testing. Other commands requiring input files are just dummy examples of the types of uses that are common but cannot be run verbatim as written.

To demonstrate a basic wiggle plot we create some synthetic data with gmtmath and pipe it through pswiggle:

gmt math -T-8/6/0.01 -N3/0 -C2 T 3 DIV 2 POW NEG EXP T PI 2 MUL MUL COS MUL 50 MUL = | gmt pswiggle -R-10/10/-3/3 -JM6i -Baf -Z100i -DjRM+w100+lnT -Tfaint -Gred+p -W1p -BWSne -P > map.ps

To plot the magnetic anomaly stored in the file track.xym along track @ 500 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

gmt pswiggle track.xym -R-20/10/-80/-60 -JS0/90/15c -Z500 -B5 \
             -C32000 -P -Gred -T0.25p,blue -DjRM+w1000+lnT -V > track_xym.ps

and the positive anomalies will in general point in the north direction. We used -D to place a vertical scale bar indicating a 1000 nT anomaly. To instead enforce a fixed azimuth of 45 for the positive wiggles, we add -I and obtain

gmt pswiggle track.xym -R-20/10/-80/-60 -JS0/90/15c -Z1000 -B5 \
          -C32000 -P -Gred -I45 -T0.25p,blue -DjRM+w1000+lnT -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:

gmt mapproject -Af yourdata.xyz | more

Then if these numbers jump around a lot, you may do this:

awk '{ print NR, $0 }' yourdata.xyz | filter1d -Fb5 -N4/0 \
--FORMAT_FLOAT_OUT=%.12g > smoothed.xyz

which performs a 5-point boxcar filter, and plot this data set instead.