pygmt.clib.Session.create_data¶
- Session.create_data(family, geometry, mode, **kwargs)[source]¶
Create an empty GMT data container.
- Parameters
family (str) – A valid GMT data family name (e.g.,
'GMT_IS_DATASET'
). See theFAMILIES
attribute for valid names.geometry (str) – A valid GMT data geometry name (e.g.,
'GMT_IS_POINT'
). See theGEOMETRIES
attribute for valid names.mode (str) – A valid GMT data mode (e.g.,
'GMT_IS_OUTPUT'
). See theMODES
attribute for valid names.dim (list of 4 integers) – The dimensions of the dataset. See the documentation for the GMT C API function
GMT_Create_Data
(src/gmt_api.c
) for the full range of options regarding ‘dim’. IfNone
, will pass in the NULL pointer.ranges (list of 4 floats) – The dataset extent. Also a bit of a complicated argument. See the C function documentation. It’s called
range
in the C function but it would conflict with the Python built-inrange
function.inc (list of 2 floats) – The increments between points of the dataset. See the C function documentation.
registration (str) – The node registration (what the coordinates mean). Can be
'GMT_GRID_PIXEL_REG'
or'GMT_GRID_NODE_REG'
. Defaults to'GMT_GRID_NODE_REG'
.pad (int) – The grid padding. Defaults to
GMT_PAD_DEFAULT
.
- Returns
data_ptr (int) – A ctypes pointer (an integer) to the allocated
GMT_Dataset
object.