Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 17ae40b

Browse filesBrowse files
authored
Merge pull request #19076 from anntzer/aitoff
Small improvements to aitoff projection.
2 parents a610953 + 527faa4 commit 17ae40b
Copy full SHA for 17ae40b

File tree

Expand file treeCollapse file tree

1 file changed

+2
-5
lines changed
Filter options
  • lib/matplotlib/projections
Expand file treeCollapse file tree

1 file changed

+2
-5
lines changed

‎lib/matplotlib/projections/geo.py

Copy file name to clipboardExpand all lines: lib/matplotlib/projections/geo.py
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,7 @@ def transform_non_affine(self, ll):
264264
cos_latitude = np.cos(latitude)
265265

266266
alpha = np.arccos(cos_latitude * np.cos(half_long))
267-
# Avoid divide-by-zero errors using same method as NumPy.
268-
alpha[alpha == 0.0] = 1e-20
269-
# We want unnormalized sinc. numpy.sinc gives us normalized
270-
sinc_alpha = np.sin(alpha) / alpha
267+
sinc_alpha = np.sinc(alpha / np.pi) # np.sinc is sin(pi*x)/(pi*x).
271268

272269
x = (cos_latitude * np.sin(half_long)) / sinc_alpha
273270
y = np.sin(latitude) / sinc_alpha
@@ -282,7 +279,7 @@ class InvertedAitoffTransform(_GeoTransform):
282279
def transform_non_affine(self, xy):
283280
# docstring inherited
284281
# MGDTODO: Math is hard ;(
285-
return xy
282+
return np.full_like(xy, np.nan)
286283

287284
def inverted(self):
288285
# docstring inherited

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.