Skip to content

Surprising ang2pix results #73

@davidhassell

Description

@davidhassell

Hello,

Firstly - great work on this! I'm currently working on using it as the HEALPix engine in cf-python - thank you.

I've noticed some surprising results with ang2pix in some cases:

import healpix

for lat in ([89.9], [0.01], [0]):
    i = healpix.ang2pix(2, [0, 45, 90, 135, 180, 225, 270, 315], lat, nest=True, lonlat=True)
    print('lat=',lat,'result=', i)

gives

lat= [89]   result= [ 9  3 13  7 17 11 21 15]  # Not OK: Didn't expect 9, 13, 17, 21
lat= [0.01] result= [19  0 23  4 27  8 31 12]  # OK
lat= [0]    result= [19 28 23 32 27 36 31 24]  # Not OK: Didn't expect 32, 36
                                               #         Expected one of 0, 17, 22, 35
                                               #         Expected one of 4, 21, 26, 36
                                               #         Expected one of 8, 25, 30, 43
                                               #         Expected one of 12, 18, 29, 47

It'd be great to know ...

  • Am I using the library correctly?
  • Are my expectations correct on this?

Many thanks for your help,
David

Here's the Górski figure for reference:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions