Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit5ce3637

Browse files
committed
FIX: simplify Mercator transform
1 parentc9984fe commit5ce3637

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

‎examples/scales/scales.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,7 @@ def inverse(x):
7878
# Function Mercator transform
7979
defforward(a):
8080
a=np.deg2rad(a)
81-
# mask values too close to +/- 90, which are ill-defined.
82-
masked=np.ma.masked_where((a<=-np.pi/2+0.02)|
83-
(a>=np.pi/2-0.02),a)
84-
ifmasked.mask.any():
85-
returnnp.rad2deg(
86-
np.ma.log(np.abs(np.ma.tan(masked)+1.0/np.ma.cos(masked))))
87-
else:
88-
returnnp.rad2deg(np.log(np.abs(np.tan(a)+1.0/np.cos(a))))
81+
returnnp.rad2deg(np.log(np.abs(np.tan(a)+1.0/np.cos(a))))
8982

9083

9184
definverse(a):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp