pygmt.info

pygmt.info(table, per_column=None, spacing=None, nearest_multiple=None, verbose=None, aspatial=None, coltypes=None, registration=None, **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 a numpy.ndarray form [w, e, s, n], which can be used directly as the region parameter for other modules (hence only dx and dy are needed). If the per_column parameter is combined with spacing, then the numpy.ndarray output will be rounded up/down for as many columns as there are increments provided in spacing. A similar parameter nearest_multiple will provide a numpy.ndarray in the form of [zmin, zmax, dz] for makecpt.

Full option list at https://docs.generic-mapping-tools.org/latest/gmtinfo.html

Aliases:

  • C = per_column

  • I = spacing

  • T = nearest_multiple

  • V = verbose

  • a = aspatial

  • f = coltypes

  • r = registration

Parameters
  • table (str or numpy.ndarray or pandas.DataFrame or xarray.Dataset or geopandas.GeoDataFrame) – Pass in either a file name to an ASCII data table, a 1D/2D numpy.ndarray, a pandas.DataFrame, an xarray.Dataset made up of 1D xarray.DataArray data variables, or a geopandas.GeoDataFrame containing 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], unless per_column is 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 [Default is w], which modulates the messages written to stderr. Choose among 7 levels of verbosity:

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

    • e - Error messages only

    • w - Warnings [Default]

    • t - Timings (report runtimes for time-intensive algorithms);

    • i - Informational messages (same as verbose=True)

    • c - Compatibility warnings

    • d - Debugging messages

  • 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/latest/gmt.html#aspatial-full.

  • 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/latest/gmt.html#f-full.

  • registration (str) – g|p. Force gridline (g) or pixel (p) node registration. [Default is g(ridline)].

Returns

output (np.ndarray or str) – Return type depends on whether any of the per_column, spacing, or nearest_multiple parameters are set.

  • numpy.ndarray if either of the above parameters are used.

  • str if none of the above parameters are used.