cds-astro / cds-healpix-python

cdshealpix python package
https://cds-astro.github.io/cds-healpix-python/
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

broadcasting for healpix_to_xy, lonlat_to_healpix, healpix_to_lonlat #7

Closed bmatthieu3 closed 5 years ago

bmatthieu3 commented 5 years ago

This refers to astropy/astropy-healpix#128

@lpsinger @cdeil - I did an update of these methods for the nested and ring scheme. Now it handles numpy broadcasting feature. I do the broadcasting in python side (by using the numpy broadcast_arrays method https://docs.scipy.org/doc/numpy/reference/generated/numpy.broadcast_arrays.html) as broadcasting is not fully implemented in ndarray crate (as seen here). I then send the broadcasted arrays to the rust extension code that will process them as normal array views.

I do have a 3x speedup factor between cdshealpix.healpix_to_lonlat and astropy_healpix.healpix_to_lonlat for 1000 HEALPix indices broadcasted over 10 different depths.

bmatthieu3 commented 5 years ago

@lpsinger @cdeil - I merged it because the test in dc02ba4 is passing.