pygmt.clib.Session.write_data

Session.write_data(self, family, geometry, mode, wesn, output, data)[source]

Write a GMT data container to a file.

The data container should be created by create_data.

Wraps GMT_Write_Data but only allows writing to a file. So the method argument is omitted.

Parameters
familystr

A valid GMT data family name (e.g., 'GMT_IS_DATASET'). See the data_families attribute for valid names. Don’t use the GMT_VIA_VECTOR or GMT_VIA_MATRIX constructs for this. Use GMT_IS_VECTOR and GMT_IS_MATRIX instead.

geometrystr

A valid GMT data geometry name (e.g., 'GMT_IS_POINT'). See the data_geometries attribute for valid names.

modestr

How the data is to be written to the file. This option varies depending on the given family. See the GMT API documentation for details.

wesnlist or numpy array

[xmin, xmax, ymin, ymax, zmin, zmax] of the data. Must have 6 elements.

outputstr

The output file name.

datactypes.c_void_p

Pointer to the data container created by create_data.

Raises
GMTCLibError

For invalid input arguments or if the GMT API functions returns a non-zero status code.