Skip to content

Regression in rHealpix projection since v4.9.1 #1206

@pelson

Description

@pelson

I'm working on providing the Rectangular Healpix projection in cartopy. I started the process some time ago (around Christmas 🎄last year as it happens) and was using v4.9.1. It produced some pretty pleasant results:

Cartopy healpix projection

(FWIW, cartopy has a general image transformation tool that can produce images like this for any projection that has a forward and inverse defined)

I didn't have the time to investigate at the time, but it turns out that this projection has had a regression in later versions of proj, particularly with regards to the lower rectangle. The following image is indicative of the issue:

figure_1

A quick demonstration of the issue:

$ proj
Rel. 4.9.1, 04 March 2015
usage: proj [ -beEfiIlormsStTvVwW [args] ] [ +opts[=arg] ] [ files ]

echo 40 -50 | proj +proj=rhealpix  | cs2cs +proj=rhealpix  +to +proj=latlon -f %.4f
40.0000	-50.0000 0.0000

And with 5.2.0:

$ proj
Rel. 5.2.0, September 15th, 2018
usage: proj [ -bdeEfiIlmorsStTvVwW [args] ] [ +opts[=arg] ] [ files ]
$ echo 40 -50 | proj +proj=rhealpix  | cs2cs +proj=rhealpix  +to +proj=latlon -f %.4f
-130.0000	50.0000 0.0000

You can see that the round-trip transformation is no longer correct.

The image gives us another hint of what is going on - notice how cartopy is projecting the antarctic geometry to the north pole, which suggests that it is the lon/lat -> healpix meters conversion which is wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions