gmtinfo

Get information about data tables

Synopsis

gmt info [ table ] [ -Aa|t|s ] [ -C ] [ -D[dx[/dy]] ] [ -EL|l|H|h[col] ] [ -F[i|d|t] ] [ -I[b|e|f|p|s]dx[/dy[/dz…][+e|r|R] ] [ -L ] [ -S[x][y] ] [ -Tdz[w|d|h|m|s][+ccol] ] [ -V[level] ] [ -aflags ] [ -bibinary ] [ -dinodata[+ccol] ] [ -eregexp ] [ -fflags ] [ -ggaps ] [ -hheaders ] [ -iflags ] [ -oflags ] [ -qiflags ] [ -rreg ] [ -sflags ] [ -wflags ] [ -:[i|o] ] [ --PAR=value ]

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

Description

info reads its standard input [or from files] and finds the extreme values in each of the columns reported as slash-separated min/max pairs. It recognizes NaNs and will print warnings if the number of columns vary from record to record. The pairs can be split into two separate columns by using the -C option. As another option, info can find the extent of data in the first two columns rounded up and down to the nearest multiple of the supplied increments given by -I. Such output will be in the text form -Rw/e/s/n, which can be used directly on the command line for other modules (hence only dx and dy are needed). If -C is combined with -I then the output will be in column form and rounded up/down for as many columns as there are increments provided in -I. A similar option (-T) will provide a -Tzmin/zmax/dz string for makecpt.

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

Optional Arguments

-Aa|t|s

Specify how the range should be reported. Choose -Aa for the range of all tables combined, -At to report the range for each table separately, and -As to report the range for each segment (in multisegment tables) separately. [Default is -Aa].

-C

Report the min/max values per column in separate columns [Default uses <min/max> format]. When used, users may also use -o to limit which output columns should be reported [all].

-D[dx[/dy]]

Modifies results obtained by -I by shifting the region to better align with the center of the data. Optionally, append granularity for this shift [Default performs an exact shift].

-EL|l|H|h[col]

Returns the record whose column col contains the minimum (l) or maximum (h) value. Upper case (L|H) works on absolute value of the data. In case of multiple matches, only the first record is returned. If col is not specified we default to the last column in the data.

-F[i|d|t]

Returns the counts of various records depending on the appended mode: i returns a single record with the total number of tables, segments, data records, header records, and overall records. In contrast, d returns information for each segment in the virtual data set: tbl_number, seg_number, n_rows, start_rec, stop_rec. Mode t does the same but honors the input table organization and thus resets seg_number, start_rec, stop_rec at the start of each new table [Default is i].

-I[b|e|f|p|s]dx[/dy[/dz…][+e|r|R]

Compute the min/max values of the first n columns to the nearest multiple of the provided increments (separate the n increments by slashes) [default is 2 columns]. By default, output results in the form -Rw/e/s/n, unless -C is set in which case we output each min and max value in separate output columns. If only one increment is given we also use it for the second column (for backwards compatibility). To override this behavior, use -Ipdx. If the input x- and y-coordinates all have the same phase shift relative to the dx and dy increments then we use those phase shifts in determining the region, and you may use -rreg to switch from gridline-registration to pixel-registration. For irregular data both phase shifts are set to 0 and the -rreg is ignored. Use -Ifdx[/dy] to report an extended region optimized to give grid dimensions for fastest results in programs using FFTs. Use -Isdx[/dy] to report an extended region optimized to give grid dimensions for fastest results in programs like surface. Use -Ib to write the bounding box of the data table or segments (see -A) as a closed polygon segment. Note: For oblique projections you should use the -Ap option in plot to draw the box properly. If -Ie is given then the exact min/max of the input is given in the -R string. Append +r to modify the min/max of the first n columns further: Append inc, xinc/yinc, or winc/einc/sinc/ninc to adjust the region to be a multiple of these steps [no adjustment]. Alternatively, use +R to extend the region outward by adding these increments instead, or +e which is like +r but it ensures that the bounding box extends by at least 0.25 times the increment [no extension].

-L

Determines common limits across tables (-At) or segments (-As). If used with -I it will round inwards so that the resulting bounds lie within the actual data domain.

-S[x][y]

Add extra space for error bars. Useful together with -I option and when later plotting with plot -E. -Sx leaves space for horizontal error bars using the values in third (2) column. -Sy leaves space for vertical error bars using the values in fourth (3) column. -S or -Sxy leaves space for both error bars using the values in third and fourth (2 and 3) columns.

-Tdz[w|d|h|m|s][+ccol]

Report the min/max of the first (0’th) column to the nearest multiple of dz and output this as the string -Tzmin/zmax/dz. To use another column, append +ccol. Cannot be used together with -I. Note: If your column has absolute time then you may append a valid fixed time unit to dz, or rely on the current setting of TIME_UNIT [s].

-V[level]

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

-a[[col=]name[,]] (more …)

Set aspatial column associations col=name.

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

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

-dinodata[+ccol] (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.

-gx|y|z|d|X|Y|Dgap[u][+a][+ccol][+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][+ddivisor][+sscale|d|k][+ooffset][,][,t[word]] (more …)

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

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

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

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

Select input rows or data limit(s) [default is all rows].

-r[g|p] (more …)

Set node registration [gridline].

-s[cols][+a][+r] (more …)

Set handling of NaN records for output.

-wy|a|w|d|h|m|s|cperiod[/phase][+ccol] (more …)

Convert an input coordinate to a cyclical coordinate.

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

ASCII Format Precision

The ASCII output formats of numerical data are controlled by parameters in your gmt.conf file. Longitude and latitude are formatted according to FORMAT_GEO_OUT, absolute time is under the control of FORMAT_DATE_OUT and FORMAT_CLOCK_OUT, whereas general floating point values are formatted according to FORMAT_FLOAT_OUT. Be aware that the format in effect can lead to loss of precision in ASCII output, which can lead to various problems downstream. If you find the output is not written with enough precision, consider switching to binary output (-bo if available) or specify more decimals using the FORMAT_FLOAT_OUT setting.

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 find the extreme values in the remote file @ship_15.txt:

gmt info @ship_15.txt

Output should look like:

ship_15.txt: N = 82651      <245/254.705>   <20/29.99131>   <-4504/-9>

To find the extreme values in @ship_15.txt to the nearest 5 units but shifted to within 1 unit of the data center, and use this region to plot all the points as small black circles using plot, run

gmt plot `gmt info -I5 -D1 @ship_15.txt` @ship_15.txt -B -Sc2p -pdf map

To find the min and max values for each of the first 3 columns, but rounded to integers, and return the result individually for each data file, use

gmt info @ship_15.txt -C -I1/1/1

Given seven profiles with different start and stop positions, we want to find a range of positions, with increment of 5, that are common to all the profiles. We use

gmt info profile_[123567].txt -L -I5

The file magprofs.txt contains a number of magnetic profiles stored as separate data segments. We need to know how many segments there are and use

gmt info magprofs.txt -Fi

Bugs

The -I option does not yet work properly with time series data (e.g., -f0T). Thus, such variable intervals as months and years are not calculated. Instead, specify your interval in the same units as the current setting of TIME_UNIT.

See Also

gmt, gmtconvert, plot