| Crates.io | realpix |
| lib.rs | realpix |
| version | 0.1.3 |
| created_at | 2026-01-11 14:57:25.354645+00 |
| updated_at | 2026-01-18 16:05:28.888552+00 |
| description | A HEALPix implementation in pure rust |
| homepage | |
| repository | |
| max_upload_size | |
| id | 2035928 |
| size | 48,424 |
REALPix is a Rust crate providing a HEALPix-style spherical pixelization, supporting both RING and NESTED indexing schemes.
It is designed for astronomy, astrometry, and fast spatial indexing on the sphere, with a strong focus on correctness, performance, and portability.
std enabled by defaultno_std supportHEALPix (Hierarchical Equal Area Latitude Pixelization) divides the sphere into:
12 Γ NΒ²
All pixels cover equal area on the sphere.
Both schemes describe the same pixelization, but differ in how pixels are numbered.
Pixels are numbered in latitude rings, starting at the north pole and moving south.
North pole
[ 0 1 2 ]
[ 3 4 5 6 ]
[ 7 8 9 10 11 ]
...
South pole
Characteristics:
Pixels are numbered hierarchically, using a quad-tree structure on each face.
Base face
βββββββββ
β 0 β
βββββββββ
Level 1
βββββ¬ββββ
β 0 β 1 β
βββββΌββββ€
β 2 β 3 β
βββββ΄ββββ
Level 2
βββββ¬ββββ¬ββββ¬ββββ
β00 β01 β10 β11 β
βββββΌββββΌββββΌββββ€
β02 β03 β12 β13 β
βββββΌββββΌββββΌββββ€
β20 β21 β30 β31 β
βββββΌββββΌββββΌββββ€
β22 β23 β32 β33 β
βββββ΄ββββ΄ββββ΄ββββ
Characteristics:
For astrometry, quad matching, and fast spatial indexing, NESTED ordering is strongly recommended.
realpix supports both:
Spherical angles
[0, Ο][0, 2Ο)Astronomical coordinates
Standard conversions are used:
ΞΈ = Ο/2 β Dec
Ο = RA
HEALPix resolution is controlled by a single parameter (nside):
nside is the number of subdivisions per edge of each base facepixels = 12 Γ nsideΒ²
Approximate pixel angular size:
pixel size β 2 / nside radians
Examples:
| nside | Pixel size |
|---|---|
| 32 | ~3.6Β° |
| 64 | ~1.8Β° |
| 128 | ~0.9Β° |
| 256 | ~0.45Β° |
std and no_stdstd is enabled by default
realpix can be built in no_std environments
No heap allocation is required
Suitable for:
MIT OR Apache-2.0