Skip to content

Commit

Permalink
feat: add some Greenland regions
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed Jun 14, 2024
1 parent 503b6a1 commit 29fa593
Showing 1 changed file with 33 additions and 6 deletions.
39 changes: 33 additions & 6 deletions src/polartoolkit/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
# PolarToolkit (https://github.com/mdtanker/polartoolkit)
#
"""
Bounding regions for commonly plotted Antarctic regions. In Polar Stereographic
Projection (EPSG:3031). The format is (East, West, North, South), in meters.
Bounding regions for commonly plotted polar regions. In stereographic projections. The format is (East, West, North, South), in meters.
"""

from __future__ import annotations
Expand All @@ -23,10 +22,6 @@
utils,
)

# import polartoolkit.maps as maps
# import polartoolkit.regions as regions
# import polartoolkit.utils as utils

try:
import ipyleaflet
except ImportError:
Expand All @@ -38,6 +33,11 @@
except ImportError:
display = None

#####
#####
# Antarctica
#####
#####

# regions
antarctica = (-2800e3, 2800e3, -2800e3, 2800e3)
Expand Down Expand Up @@ -152,6 +152,25 @@
lake_vostok = (1100e3, 1535e3, -470e3, -230e3)
# ice catchements

#####
#####
# Greenland
#####
#####

# regions
greenland = (-650e3, 900e3, -3400e3, -600e3)
north_greenland = (-500e3, 600e3, -1200e3, -650e3)
# northwest_greenland = ()
# northeast_greenland = ()
# west_greenland = ()
# east_greenland = ()
# southeast_greenland = ()
# southwest_greenland = ()

# glaciers
kangerlussuaq_glacier = (380e3, 550e3, -2340e3, -2140e3)


def get_regions() -> dict[str, tuple[float, float, float, float]]:
"""
Expand Down Expand Up @@ -226,7 +245,15 @@ def draw_region(**kwargs: typing.Any) -> typing.Any:
-------
typing.Any
Returns a list of list of vertices for each polyline.
Example
-------
>>> from polartoolkit import regions, utils
...
>>> polygon = regions.draw_region()
>>> region = utils.polygon_to_region(polygon, hemisphere="north")
"""

if ipyleaflet is None:
msg = """
Missing optional dependency 'ipyleaflet' required for interactive plotting.
Expand Down

0 comments on commit 29fa593

Please sign in to comment.