pygmt.clib.Session.write_data
- Session.write_data(family, geometry, mode, wesn, output, data)[source]
Write a GMT data container to a file.
The data container should be created by
pygmt.clib.Session.create_data.Wraps
GMT_Write_Databut only allows writing to a file. So themethodargument is omitted.- Parameters
family (str) – A valid GMT data family name (e.g.,
'GMT_IS_DATASET'). See theFAMILIESattribute for valid names. Don’t use theGMT_VIA_VECTORorGMT_VIA_MATRIXconstructs for this. UseGMT_IS_VECTORandGMT_IS_MATRIXinstead.geometry (str) – A valid GMT data geometry name (e.g.,
'GMT_IS_POINT'). See theGEOMETRIESattribute for valid names.mode (str) – 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.
wesn (list or numpy array) – [xmin, xmax, ymin, ymax, zmin, zmax] of the data. Must have 6 elements.
output (str) – The output file name.
data (
ctypes.c_void_p) – Pointer to the data container created bypygmt.clib.Session.create_data.
- Raises
GMTCLibError – For invalid input arguments or if the GMT API functions returns a non-zero status code.