Skip to content

Commit

Permalink
Add tests for Lambert azimuthal extrema
Browse files Browse the repository at this point in the history
These tests produce the LamberAzimuthalEqualArea CRS with central
latitudes at the poles to ensure the extreme cases work as required.
  • Loading branch information
ajdawson committed Aug 2, 2018
1 parent 6d49a13 commit 93066ca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/cartopy/tests/crs/test_lambert_azimuthal_equal_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import numpy as np
from numpy.testing import assert_almost_equal
import pytest

import cartopy.crs as ccrs

Expand Down Expand Up @@ -59,3 +60,10 @@ def test_offset(self):
assert crs_offset.proj4_init == expected
assert tuple(np.array(crs.x_limits) + 1234) == crs_offset.x_limits
assert tuple(np.array(crs.y_limits) - 4321) == crs_offset.y_limits

@pytest.mark.parametrize("latitude", [-90, 90])
def test_extrema(self, latitude):
crs = ccrs.LambertAzimuthalEqualArea(central_latitude=latitude)
expected = ('+ellps=WGS84 +proj=laea +lon_0=0.0 +lat_0={} '
'+x_0=0.0 +y_0=0.0 +no_defs'.format(latitude))
assert crs.proj4_init == expected

0 comments on commit 93066ca

Please sign in to comment.