grdpmodeler

Evaluate a plate motion model on a geographic grid

Synopsis

gmt grdpmodeler [ agegrdfile ] -Erot_file|ID1-ID2|lon/lat/angle[+i] -Sflags [ -Fpolygonfile ] [ -Goutgrid ] [ -Iincrement ] [ -Rregion ] [ -Tage ] [ -V[level] ] [ -bbinary ] [ -dnodata ] [ -hheaders ] [ -oflags ] [ -rreg ] [ -:[i|o] ] [ --PAR=value ]

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

Description

grdpmodeler reads a geographical age grid and a plate motion model and evaluates one of several model predictions. Optionally, the user may supply a clipping polygon in multiple-segment format; then, only the part of the grid inside the polygon is used to determine the model prediction; the remainder of the grid is set to NaN.

Required Arguments

-Erot_file|ID1-ID2|lon/lat/angle[+i]

Rotations can be specified in one of three ways: (1): Give file with rotation parameters. This file must contain one record for each rotation; each record must be of the following format:

lon lat tstart [tstop] angle [ khat a b c d e f g df ]

where tstart and tstop are in Myr and lon lat angle are in degrees. tstart and tstop are the ages of the old and young ends of a stage. If tstop is not present in the record then a total reconstruction rotation is expected and tstop is implicitly set to 0 and should not be specified for any of the records in the file. If a covariance matrix C for the rotation is available it must be specified in a format using the nine optional terms listed in brackets. Here, C = (g/khat)*[ a b d; b c e; d e f ] which shows C made up of three row vectors. If the degrees of freedom (df) in fitting the rotation is 0 or not given it is set to 10000. Blank lines and records whose first column contains # will be ignored. (2): Give the filename composed of two plate IDs separated by a hyphen (e.g., PAC-MBL) and we will instead extract that rotation from the GPlates rotation database. We return an error if the rotation cannot be found. (3): Specify lon/lat/angle, i.e., the longitude, latitude, and opening angle (all in degrees and separated by /) for a single total reconstruction rotation. Regardless of method, you may append +i to the argument to indicate you wish to invert the rotation(s).

-Sflags

Type of model prediction(s). Append one or more items: choose from a for plate motion azimuth, d for great-circle distance between current location and its origin at the ridge (in km), s for plate motion model stage ID (1 is youngest), v for plate motion rate (in mm/yr), w for plate rotation rate (degree/Myr), x for change in longitude relative to location of crust formation, y for change in latitude relative to location of crust formation, X for longitude of crust formation, and Y for latitude of crust formation. If no arguments are given we default to all [adsvwxyXY].

Optional Arguments

ingrid

Name of a grid file in geographical (lon, lat) coordinates with ages in Myr. If no grid is provided then you may define the domain via -R, -I, and optionally -r.

-Fpolygonfile

Specify a multisegment closed polygon file that describes the inside area of the grid where the model should be evaluated; the outside will be set to NaN [Default evaluates model on the entire grid].

-Goutgrid[=ID][+ddivisor][+ninvalid] [+ooffset|a][+sscale|a] [:driver[dataType][+coptions]]

Name of output grid. This is the grid with the model predictions given the specified rotations. Note: If you specified more than one model prediction in -S then the filename must be a template that contains the format %s; this will be replaced with the corresponding tags az, dist, stage, vel, omega, dlon, dlat, lon, lat. If the -G option is not used then we create no grids and instead write lon, lat, age, predictions records to standard output. Optionally, append =ID for writing a specific file format (See full description). The following modifiers are supported:

  • +d - Divide data values by given divisor [Default is 1].

  • +n - Replace data values matching invalid with a NaN.

  • +o - Offset data values by the given offset, or append a for automatic range offset to preserve precision for integer grids [Default is 0].

  • +s - Scale data values by the given scale, or append a for automatic scaling to preserve precision for integer grids [Default is 1].

Note: Any offset is added before any scaling. +sa also sets +oa (unless overridden). To write specific formats via GDAL, use = gd and supply driver (and optionally dataType) and/or one or more concatenated GDAL -co options using +c. See the “Writing grids and images” cookbook section for more details.

-Ixinc[+e|n][/yinc[+e|n]]

x_inc [and optionally y_inc] is the grid spacing. Geographical (degrees) coordinates: Optionally, append an increment unit. Choose among m to indicate arc minutes or s to indicate arc seconds. If one of the units e, f, k, M, n or u is appended instead, the increment is assumed to be given in meter, foot, km, Mile, nautical mile or US survey foot, respectively, and will be converted to the equivalent degrees longitude at the middle latitude of the region (the conversion depends on PROJ_ELLIPSOID). If y_inc is given but set to 0 it will be reset equal to x_inc; otherwise it will be converted to degrees latitude. All coordinates: If +e is appended then the corresponding max x (east) or y (north) may be slightly adjusted to fit exactly the given increment [by default the increment may be adjusted slightly to fit the given domain]. Finally, instead of giving an increment you may specify the number of nodes desired by appending +n to the supplied integer argument; the increment is then recalculated from the number of nodes, the registration, and the domain. The resulting increment value depends on whether you have selected a gridline-registered or pixel-registered grid; see GMT File Formats for details. Note: If -Rgrdfile is used then the grid spacing and the registration have already been initialized; use -I and -r to override these values.

-Rwest/east/south/north[/zmin/zmax][+r][+uunit]

Specify the region of interest.

The region may be specified in one of several ways:

  1. -Rwest/east/south/north[+uunit]. This is the standard way to specify geographic regions when using map projections where meridians and parallels are rectilinear. The coordinates may be specified in decimal degrees or in [±]dd:mm[:ss.xxx][W|E|S|N] format. Optionally, append +uunit to specify a region in projected units (e.g., UTM meters) where west/east/south/north are Cartesian projected coordinates compatible with the chosen projection (-J) and unit is an allowable distance unit; we inversely project to determine the actual rectangular geographic region.

  2. -Rwest/south/east/north+r. This form is useful for map projections that are oblique, making meridians and parallels poor choices for map boundaries. Here, we instead specify the lower left corner and upper right corner geographic coordinates, followed by the modifier +r. This form guarantees a rectangular map even though lines of equal longitude and latitude are not straight lines.

  3. -Rg or -Rd. These forms can be used to quickly specify the global domain (0/360 for -Rg and -180/+180 for -Rd in longitude, with -90/+90 in latitude).

  4. -Rcode1,code2,…[+e|r|Rincs]. This indirectly supplies the region by consulting the DCW (Digital Chart of the World) database and derives the bounding regions for one or more countries given by the codes. Simply append one or more comma-separated countries using the two-character ISO 3166-1 alpha-2 convention. To select a state within a country (if available), append .state, e.g, US.TX for Texas. To specify a whole continent, prepend = to any of the continent codes AF (Africa), AN (Antarctica), AS (Asia), EU (Europe), OC (Oceania), NA (North America), or SA (South America). The following modifiers can be appended:

    • +r to adjust the region boundaries to be multiples of the steps indicated by inc, xinc/yinc, or winc/einc/sinc/ninc [default is no adjustment]. For example, -RFR+r1 will select the national bounding box of France rounded to nearest integer degree.

    • +R to extend the region outward by adding the amounts specified by inc, xinc/yinc, or winc/einc/sinc/ninc [default is no extension].

    • +e to adjust the region boundaries to be multiples of the steps indicated by inc, xinc/yinc, or winc/einc/sinc/ninc, while ensuring that the bounding box extends by at least 0.25 times the increment [default is no adjustment].

  5. -Rjustifylon0/lat0/nx/ny, where justify is a 2-character combination of L|C|R (for left, center, or right) and T|M|B (for top, middle, or bottom) (e.g., BL for lower left). The two character code justify indicates which point on a rectangular region region the lon0/lat0 coordinates refer to and the grid dimensions nx and ny are used with grid spacings given via -I to create the corresponding region. This method can be used when creating grids. For example, -RCM25/25/50/50 specifies a 50x50 grid centered on 25,25.

  6. -Rgridfile. This will copy the domain settings found for the grid in specified file. Note that depending on the nature of the calling module, this mechanism will also set grid spacing and possibly the grid registration (see Grid registration: The -r option).

  7. -Ra[uto] or -Re[xact]. Under modern mode, and for plotting modules only, you can automatically determine the region from the data used. You can either get the exact area using -Re [Default if no -R is given] or a slightly larger area sensibly rounded outwards to the next multiple of increments that depend on the data range using -Ra.

-Tage

Use a fixed age for model evaluation (i.e., override the ages in the age grid). This lets you evaluate the model at a snapshot in time. Required if no age grid was provided.

-V[level]

Select verbosity level [w]. (See full description) (See cookbook information).

-birecord[+b|l] (more …)

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

-d[i|o]nodata (more …)

Replace input columns that equal nodata with NaN and do the reverse on output.

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

Skip or produce header record(s).

-ocols[,…][,t[word]] (more …)

Select output columns (0 is first column; t is trailing text, append word to write one word only).

-r[g|p] (more …)

Set node registration [gridline].

-^ 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.

Geodetic versus Geocentric Coordinates

All spherical rotations are applied to geocentric coordinates. This means that incoming data points and grids are considered to represent geodetic coordinates and must first be converted to geocentric coordinates. Rotations are then applied, and the final reconstructed points are converted back to geodetic coordinates. This default behavior can be bypassed if the ellipsoid setting PROJ_ELLIPSOID is changed to Sphere.

Inside/outside Status

To determine if a point is inside, outside, or exactly on the boundary of a polygon we need to balance the complexity (and execution time) of the algorithm with the type of data and shape of the polygons. For any Cartesian data we use a non-zero winding algorithm, which is quite fast. For geographic data we will also use this algorithm as long as (1) the polygons do not include a geographic pole, and (2) the longitude extent of the polygons is less than 360. If this is the situation we also carefully adjust the test point longitude for any 360 degree offsets, if appropriate. Otherwise, we employ a full spherical ray-shooting method to determine a points status.

Examples

We will use a grid with Pacific crust ages (pac_age.nc), a plate motion model (Pac_APM.txt), and a polygon that contains the outline of the present Pacific plate (pac_clip_path.txt). To evaluate the plate motion azimuths at the present time for the Pacific, try

gmt grdpmodeler pac_age.nc -EPac_APM.txt -V -Fpac_clip_path.txt \
                -Gpac_dir_0.nc -Sa -T0

To determine the changes in latitude since crust formation for the entire Pacific, try

gmt grdpmodeler pac_age.nc -EPac_APM.txt -V -Fpac_clip_path.txt \
                -Gpac_dlat.nc -Sy

To determine the plate motion velocities in effect when the Pacific crust was formed, try

gmt grdpmodeler pac_age.nc -EPac_APM.txt -V -Fpac_clip_path.txt \
                -Gpac_vel.nc -Sv

To determine how far the crust has moved since formation, try

gmt grdpmodeler pac_age.nc -EPac_APM.txt -V -Fpac_clip_path.txt \
                -Gpac_dist.nc -Sd

To save the coordinates of the crust’s formation to separate grids, try

gmt grdpmodeler pac_age.nc -EPac_APM.txt -V -Fpac_clip_path.txt \
                -Gpac_origin_%s.nc -SXY

To repeat the same exercise but save output lon,lat,age,xorigin,yorigin to a table, use

gmt grdpmodeler pac_age.nc -EPac_APM.txt -V -Fpac_clip_path.txt -SXY > origin.txt

Notes

GMT distributes the EarthByte rotation model Global_EarthByte_230-0Ma_GK07_AREPS.rot. To use an alternate rotation file, create an environmental parameters named GPLATES_ROTATIONS that points to an alternate rotation file.