forked from SciTools/cartopy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add HEALPix and rHEALPix projections
- Loading branch information
Showing
7 changed files
with
166 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright Crown and Cartopy Contributors | ||
# | ||
# This file is part of Cartopy and is released under the BSD 3-clause license. | ||
# See LICENSE in the root of the repository for full licensing details. | ||
""" | ||
Tests for the HEALPix projection. | ||
""" | ||
import cartopy.crs as ccrs | ||
from .helpers import check_proj_params | ||
|
||
|
||
def test_defaults(): | ||
crs = ccrs.HEALPix() | ||
expected = {'ellps=WGS84', 'lon_0=0'} | ||
check_proj_params('healpix', crs, expected) | ||
|
||
|
||
def test_central_longitude(): | ||
crs = ccrs.HEALPix(central_longitude=124.8) | ||
expected = {'ellps=WGS84', 'lon_0=124.8'} | ||
check_proj_params('healpix', crs, expected) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright Crown and Cartopy Contributors | ||
# | ||
# This file is part of Cartopy and is released under the BSD 3-clause license. | ||
# See LICENSE in the root of the repository for full licensing details. | ||
""" | ||
Tests for the RHEALPix projection. | ||
""" | ||
import pytest | ||
|
||
import cartopy.crs as ccrs | ||
from .helpers import check_proj_params | ||
|
||
|
||
def test_defaults(): | ||
crs = ccrs.RHEALPix() | ||
expected = {'ellps=WGS84', 'lon_0=0', 'north_square=0', 'south_square=0'} | ||
check_proj_params('rhealpix', crs, expected) | ||
|
||
|
||
def test_square_positions(): | ||
crs = ccrs.RHEALPix(north_square=1, south_square=2) | ||
expected = {'ellps=WGS84', 'lon_0=0', 'north_square=1', 'south_square=2'} | ||
check_proj_params('rhealpix', crs, expected) | ||
|
||
def test_invalid_square_positions(): | ||
with pytest.raises(ValueError, match='north_square must be'): | ||
ccrs.RHEALPix(north_square=4) | ||
with pytest.raises(ValueError, match='south_square must be'): | ||
ccrs.RHEALPix(south_square=-1) | ||
|
||
def test_central_longitude(): | ||
crs = ccrs.RHEALPix(north_square=2, central_longitude=-124.8) | ||
expected = {'ellps=WGS84', 'lon_0=-124.8', 'north_square=2', | ||
'south_square=0'} | ||
check_proj_params('rhealpix', crs, expected) |
Binary file added
BIN
+9.61 KB
.../tests/mpl/baseline_images/mpl/test_mpl_integration/test_global_map_HEALPix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.45 KB
...tests/mpl/baseline_images/mpl/test_mpl_integration/test_global_map_RHEALPix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters