Skip to content

Commit

Permalink
Add enums GridRegistration and GridType for grid registration and type (
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman authored Dec 19, 2024
1 parent 387c69f commit 8fab7c3
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
7 changes: 7 additions & 0 deletions doc/_templates/autosummary/enums.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{ fullname | escape | underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:
:member-order: bysource
16 changes: 14 additions & 2 deletions doc/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,20 @@ Getting metadata from tabular or grid data:
info
grdinfo

Enums
-----

.. currentmodule:: pygmt.enums

.. autosummary::
:toctree: generated
:nosignatures:
:template: autosummary/enums.rst

GridRegistration
GridType

.. currentmodule:: pygmt

Miscellaneous
-------------
Expand All @@ -205,8 +219,6 @@ Miscellaneous
which
show_versions

.. currentmodule:: pygmt

Datasets
--------

Expand Down
18 changes: 18 additions & 0 deletions pygmt/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,21 @@ class GridFormat(IntEnum):
GD = 22 #: Import through GDAL
EI = 23 #: ESRI Arc/Info ASCII Grid Interchange format (ASCII integer)
EF = 24 #: ESRI Arc/Info ASCII Grid Interchange format (ASCII float)


class GridRegistration(IntEnum):
"""
Enum for the grid registration.
"""

GRIDLINE = 0 #: Gridline registration
PIXEL = 1 #: Pixel registration


class GridType(IntEnum):
"""
Enum for the grid type.
"""

CARTESIAN = 0 #: Cartesian grid
GEOGRAPHIC = 1 #: Geographic grid

0 comments on commit 8fab7c3

Please sign in to comment.