pygmt.info
- pygmt.info(data, verbose=False, **kwargs)[source]
Get information about data tables.
Reads from files and finds the extreme values in each of the columns reported as min/max pairs. It recognizes NaNs and will print warnings if the number of columns vary from record to record. As an option, it will find the extent of the first two columns rounded up and down to the nearest multiple of the supplied increments given by
spacing. Such output will be in anumpy.ndarrayform [w, e, s, n], which can be used directly as theregionparameter for other modules (hence only dx and dy are needed). If theper_columnparameter is combined withspacing, then thenumpy.ndarrayoutput will be rounded up/down for as many columns as there are increments provided inspacing. A similar parameternearest_multiplewill provide anumpy.ndarrayin the form of [zmin, zmax, dz] for makecpt.Full GMT docs at https://docs.generic-mapping-tools.org/6.5/gmtinfo.html.
Aliases:
C = per_column
I = spacing
T = nearest_multiple
a = aspatial
f = coltypes
i = incols
r = registration
V = verbose
- Parameters:
data (
str|PathLike|dict|ndarray|DataFrame|Dataset|GeoDataFrame) – Pass in either a file name to an ASCII data table, a 1-D/2-Dnumpy.ndarray, apandas.DataFrame, anxarray.Datasetmade up of 1-Dxarray.DataArraydata variables, or ageopandas.GeoDataFramecontaining the tabular data.per_column (bool) – Report the min/max values per column in separate columns.
spacing (str) – [b|p|f|s]dx[/dy[/dz…]]. Compute the min/max values of the first n columns to the nearest multiple of the provided increments [default is 2 columns]. By default, output results in the form
[w, e, s, n], unlessper_columnis set in which case we output each min and max value in separate output columns.nearest_multiple (str) – dz[+ccol]. Report the min/max of the first (0’th) column to the nearest multiple of dz and output this in the form
[zmin, zmax, dz].verbose (bool or str) – Select verbosity level [Full usage].
aspatial (bool or str) – [col=]name[,…]. Control how aspatial data are handled during input and output. Full documentation is at https://docs.generic-mapping-tools.org/6.5/gmt.html#aspatial-full.
incols (str or 1-D array) –
Specify data columns for primary input in arbitrary order. Columns can be repeated and columns not listed will be skipped [Default reads all columns in order, starting with the first (i.e., column 0)].
For 1-D array: specify individual columns in input order (e.g.,
incols=[1,0]for the 2nd column followed by the 1st column).For
str: specify individual columns or column ranges in the format start[:inc]:stop, where inc defaults to 1 if not specified, with columns and/or column ranges separated by commas (e.g.,incols="0:2,4+l"to input the first three columns followed by the log-transformed 5th column). To read from a given column until the end of the record, leave off stop when specifying the column range. To read trailing text, add the column t. Append the word number to t to ingest only a single word from the trailing text. Instead of specifying columns, useincols="n"to simply read numerical input and skip trailing text. Optionally, append one of the following modifiers to any column or column range to transform the input columns:+l to take the log10 of the input values.
+d to divide the input values by the factor divisor [Default is 1].
+s to multiple the input values by the factor scale [Default is 1].
+o to add the given offset to the input values [Default is 0].
coltypes (str) – [i|o]colinfo. Specify data types of input and/or output columns (time or geographical data). Full documentation is at https://docs.generic-mapping-tools.org/6.5/gmt.html#f-full.
registration (str) – g|p. Force gridline (g) or pixel (p) node registration [Default is g(ridline)].
- Return type:
- Returns:
output (
numpy.ndarrayor str) – Return type depends on whether any of theper_column,spacing, ornearest_multipleparameters are set.numpy.ndarrayif either of the above parameters are used.str if none of the above parameters are used.