pygmt.clib.Session.__getitem__

Session.__getitem__(name)[source]

Get the value of a GMT constant (C enum) from gmt_resources.h.

Used to set configuration values for other API calls. Wraps GMT_Get_Enum.

Parameters

name (str) – The name of the constant (e.g., "GMT_SESSION_EXTERNAL")

Returns

constant (int) – Integer value of the constant. Do not rely on this value because it might change.

Raises

GMTCLibError – If the constant doesn’t exist.