pygmt.clib.Session.__getitem__

Session.__getitem__(self, 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
namestr

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

Returns
constantint

Integer value of the constant. Do not rely on this value because it might change.

Raises
GMTCLibError

If the constant doesn’t exist.