Skip to content

Commit

Permalink
Merge pull request #1207 from pelson/healpix_fix
Browse files Browse the repository at this point in the history
Fixed rHealpix projection, closing #1206.
  • Loading branch information
kbevers authored Dec 26, 2018
2 parents 14481b2 + 5d39ae0 commit 355d681
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PJ_healpix.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ static XY combine_caps(double x, double y, int north_square, int south_square,
double a[2];
/* Workaround cppcheck git issue */
double* pa = a;
pa[0] = -3*M_FORTPI + ((inverse == 0) ? 0 : capmap.cn) *M_HALFPI;
pa[1] = M_HALFPI;
pa[0] = -3*M_FORTPI + ((inverse == 0) ? pole : capmap.cn) *M_HALFPI;
pa[1] = ((capmap.region == north) ? 1 : -1) *M_HALFPI;
vector_add(ret_dot, a, vector);
}

Expand Down
19 changes: 19 additions & 0 deletions test/gie/builtins.gie
Original file line number Diff line number Diff line change
Expand Up @@ -2006,6 +2006,25 @@ expect -0.001790493 0.000759909
accept -200 -100
expect -0.001790493 -0.000759909

-------------------------------------------------------------------------------
operation +proj=rhealpix +south_square=2 +north_square=3
-------------------------------------------------------------------------------
tolerance 1 m
accept 45 50
expect 10806592 10007554
accept 45 -50
expect 5003777 -5802815
accept 135 50
expect 15011332 5802815

direction inverse
accept 10806592 10007554
expect 45 50
accept 5003777 -5802815
expect 45 -50
accept 15011332 5802815
expect 135 50


===============================================================================
Interrupted Goode Homolosine
Expand Down

0 comments on commit 355d681

Please sign in to comment.