# grdvs30

Convert topographic slope to Vs30 velocities

## Synopsis

gmt grdvs30 ingrid -G outgrid -C val|fname[+g] [ -R region ] [ -V[level] ] [ -W water_vel ] [ -i flags ] [ -r reg ] [ -:[i|o] ]

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

## Description

Takes one topographic grid in geographical coordinates and a constant craton value or a craton file which are taken as weights ranging from 1 (one) on stable shields (craton) and 0 in active tectonic regions -- values in between will be computed as the weighted average of the craton and tectonic models.

An optional argument water_vel is the value that water-covered areas will be set to; the default is 600.

## Required Arguments

ingrid

  This is the input grid file.

-C val|fname[+g]
  Argument val can be one of these three:

    - A value val between 0 and 1, where 0 means a stable Craton and 1 an Active region.

    - The name of a multi-segment file with the cratons polygons. In this case the polygons will be feed to grdmask to compute a cratons/active tectonic mask. Use -C@cratons.xy to download a cratons file from the GMT server.

    - The name of a grid with the cratons/active tectonic regions. In this case the +g suffix is mandatory to indicate that we are reading a grid.

-G outgrid

  This is the output grid file.

## Optional Arguments

### The -R option

Syntax

-R xmin/xmax/ymin/ymax[+r][+u unit]

  Specify the region of interest. This defines the subregion to be operated out.

Description

The -R option defines the map region or data domain of interest. It may be specified in one of several ways (options 1 and 3 are shown in panels a) and b) respectively of the Figure Map region):

1. -R xmin/xmax/ymin/ymax. This is the standard way to specify Cartesian data domains and geographic regions when using map projections where meridians and parallels are rectilinear, where xmin, xmax, ymin, and ymax refer to the data limits.

2. -R xmin/xmax/ymin/ymax+u unit. Append +u unit to the option 1 to specify a region in projected units (e.g., UTM meters) where xmin/xmax/ymin/ymax are Cartesian projected coordinates compatible with the chosen projection and unit is an allowable distance unit [e]. The coordinates are relative to the standard longitude and latitude indicated in the projection (-J). For projected regions centered on (0,0) you may use the short-hand -R halfwidth[/halfheight]+u unit, where halfheight defaults to halfwidth if not given. This short-hand requires the +u modifier.

3. -R xlleft/ylleft/xuright/yuright+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.

4. -R g or -R d. 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).

5. -R gridfile. 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).

6. -R code1,code2,…[+e|r|R incs]. 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 either the two-character ISO 3166-1 alpha-2 convention (e.g., -RNO) or the full country name (e.g., -RNorway). To select a state within a country (if available), append .state (e.g, -RUS.TX). To specify a whole continent, spell out the full continent name (e.g., -RAfrica). Finally, append any DCW collection abbreviations or full names for the extent of the collection or named region. All names are case-insensitive. 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, -R FR+r1 will select the national bounding box of France rounded to nearest integer degree, where inc can be positive to expand the region or negative to shrink the region.

   - +R to adjust the region by adding the amounts specified by inc, xinc/yinc, or winc/einc/sinc/ninc [default is no extension], where inc can be positive to expand the region or negative to shrink the region.

   - +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 is adjusted by at least 0.25 times the increment [default is no adjustment], where inc can be positive to expand the region or negative to shrink the region.

7. -R justify x0/y0/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 grid region the x0/y0 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, -RCM 25/25/50/50 specifies a 50x50 grid centered on 25,25.

8. -R xmin/xmax/ymin/ymax/zmin/zmax. This method can be used for perspective views with the -Jz and the -p option, where the z-range (zmin/zmax) is appended to the first method to indicate the third dimension. This is not used for -p without -Jz, in which case a perspective view of the place is plotted with no third dimension.

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

-W water_vel

  water_vel sets the Vs30 value used in areas designated as water in the landmask [default=600]

### The -V option

Syntax

-V[level]

  Select verbosity level [w].

Description

The -V option controls the verbosity mode, which determines which messages are sent to standard error. Choose among 7 levels of verbosity; each level adds more messages:

- q - Quiet, not even fatal error messages are produced.

- e - Error messages only.

- w - Warnings (by default, same as running without -V)

- t - Timings (report runtimes for time-intensive algorithms).

- i - Informational messages (same as -V only).

- c - Compatibility warnings (if compiled with backward-compatibility).

- d - Debugging messages.

This option can also be set by specifying the default GMT_VERBOSE as quiet, error, warning, timing, compat, information, or debug, in order of increased verbosity [default is warning].

-i cols[+l][+d divisor][+s scale|d|k][+o offset][,…][,t[word]] (more …)

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

### The -R option

Syntax

-R xmin/xmax/ymin/ymax[+r][+u unit]

  Specify the region of interest. This defines the subregion to be operated out.

Description

The -R option defines the map region or data domain of interest. It may be specified in one of several ways (options 1 and 3 are shown in panels a) and b) respectively of the Figure Map region):

1. -R xmin/xmax/ymin/ymax. This is the standard way to specify Cartesian data domains and geographic regions when using map projections where meridians and parallels are rectilinear, where xmin, xmax, ymin, and ymax refer to the data limits.

2. -R xmin/xmax/ymin/ymax+u unit. Append +u unit to the option 1 to specify a region in projected units (e.g., UTM meters) where xmin/xmax/ymin/ymax are Cartesian projected coordinates compatible with the chosen projection and unit is an allowable distance unit [e]. The coordinates are relative to the standard longitude and latitude indicated in the projection (-J). For projected regions centered on (0,0) you may use the short-hand -R halfwidth[/halfheight]+u unit, where halfheight defaults to halfwidth if not given. This short-hand requires the +u modifier.

3. -R xlleft/ylleft/xuright/yuright+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.

4. -R g or -R d. 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).

5. -R gridfile. 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).

6. -R code1,code2,…[+e|r|R incs]. 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 either the two-character ISO 3166-1 alpha-2 convention (e.g., -RNO) or the full country name (e.g., -RNorway). To select a state within a country (if available), append .state (e.g, -RUS.TX). To specify a whole continent, spell out the full continent name (e.g., -RAfrica). Finally, append any DCW collection abbreviations or full names for the extent of the collection or named region. All names are case-insensitive. 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, -R FR+r1 will select the national bounding box of France rounded to nearest integer degree, where inc can be positive to expand the region or negative to shrink the region.

   - +R to adjust the region by adding the amounts specified by inc, xinc/yinc, or winc/einc/sinc/ninc [default is no extension], where inc can be positive to expand the region or negative to shrink the region.

   - +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 is adjusted by at least 0.25 times the increment [default is no adjustment], where inc can be positive to expand the region or negative to shrink the region.

7. -R justify x0/y0/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 grid region the x0/y0 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, -RCM 25/25/50/50 specifies a 50x50 grid centered on 25,25.

8. -R xmin/xmax/ymin/ymax/zmin/zmax. This method can be used for perspective views with the -Jz and the -p option, where the z-range (zmin/zmax) is appended to the first method to indicate the third dimension. This is not used for -p without -Jz, in which case a perspective view of the place is plotted with no third dimension.

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

-:[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.

## Examples

To compute a Vs30 estimate of the topo.grd grid and a craton value of 0, do:

    gmt grdvs30 topo.grd -C0 -Gvs30.grd -V

## Reference

- https://github.com/usgs/earthquake-global_vs30/blob/master/src/grad2vs30.c

## See Also

grdshake, gmt