Skip to main content

Morton numbering and indexing for healpix grids

Project description

mortie

Tests CodSpeed codecov PyPI version Python 3.10+ CodSpeed Badge

Morty using mortie

Mortie is a library for applying morton indexing to healpix grids. Morton numbering (also called z-ordering) facilitates several geospatial operators such as buffering and neighborhood look-ups, and can generally be thought of as a type of geohashing.

This particular implementation focuses on hierarchical healpix maps, and is mostly inspired from this paper.

Performance

Mortie uses Rust-accelerated morton indexing functions for high performance. The Rust implementation provides dramatic speedups:

Dataset Size Rust Python (reference) Speedup
1,000 values 1.93 ms 4.14 ms 2.1x
100,000 values 1.85 ms 410.59 ms 222x
1.2M coordinates 102.51 ms 5.1 sec 50x

Pre-built wheels are available for Linux, macOS, and Windows. The Rust extension is required and is included in all pip-installed wheels.

Installation

pip install mortie

For development builds with Rust, see BUILDING.md.

Spatial Buffer

Mortie provides a morton_buffer function for expanding a set of morton cells by a configurable border ring. This is useful for capturing edge cells missed by sparse vertex sampling (e.g., near HEALPix pole holes).

import numpy as np
import mortie

# Convert coordinates to morton cells at order 6
cells = np.unique(mortie.geo2mort(lats, lons, order=6))

# Expand by 1-cell ring (8-connected neighbors)
border = mortie.morton_buffer(cells, k=1)
expanded = np.union1d(cells, border)

All input indices must be at the same order. The function returns only the new border cells, not the input cells themselves.

Dependencies

numpy. All HEALPix operations use the Rust-native healpix crate bundled in the compiled extension — no external HEALPix library is needed.

Funding

Initial funding of this work was supported by the ICESat-2 project science office, at the Laboratory for Cryospheric Sciences (NASA Goddard, Section 615).

References

[1] Youngren, Robert W., and Mikel D. Petty. "A multi-resolution HEALPix data structure for spherically mapped point data." Heliyon 3.6 (2017): e00332. doi: 10.1016/j.heliyon.2017.e00332

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mortie-0.6.2.tar.gz (15.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mortie-0.6.2-cp310-abi3-win_amd64.whl (15.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

mortie-0.6.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.1 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

mortie-0.6.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (15.1 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

mortie-0.6.2-cp310-abi3-macosx_11_0_arm64.whl (15.0 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

mortie-0.6.2-cp310-abi3-macosx_10_12_x86_64.whl (15.1 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file mortie-0.6.2.tar.gz.

File metadata

  • Download URL: mortie-0.6.2.tar.gz
  • Upload date:
  • Size: 15.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mortie-0.6.2.tar.gz
Algorithm Hash digest
SHA256 a1c76ae86f36a7b847d4498b84341867a2cec84da9cccd9173952cb7efca39c2
MD5 bd5924b2952f24b0f9ca78def9d75c9a
BLAKE2b-256 f0b62cd400248f215558c1a3c4324b4d8d606a487cdb56e06f2cb57e44b04d7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mortie-0.6.2.tar.gz:

Publisher: build-wheels.yml on espg/mortie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mortie-0.6.2-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: mortie-0.6.2-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 15.1 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mortie-0.6.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f28695d25cc73477ddd50bbda2177617e5661efeaca657541c739ff4503b95bb
MD5 efadea70c3efbd5cb82af07b91efbb5e
BLAKE2b-256 e13316ac8a23fbb3581d1b0f97ae665bf1992aa2f150d1cd80cf7394eb0b1c51

See more details on using hashes here.

Provenance

The following attestation bundles were made for mortie-0.6.2-cp310-abi3-win_amd64.whl:

Publisher: build-wheels.yml on espg/mortie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mortie-0.6.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mortie-0.6.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e26224ba9f3c4fc876c608c70d28e29e7ec8b494c47b2c3cb6f3cdd0dfca8ec8
MD5 ec6271a58da178e43be746ef4876d36c
BLAKE2b-256 dd2def31661ee856bb69e76ff10c47bc92afaef774d08ec61439768c7452e497

See more details on using hashes here.

Provenance

The following attestation bundles were made for mortie-0.6.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build-wheels.yml on espg/mortie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mortie-0.6.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mortie-0.6.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a62b6ac8bc2e10635768af0fdef197bdcb79eeb1d62abacc0cace41008364558
MD5 33c67dff40781233ce919c4924280f57
BLAKE2b-256 bd65b2f3c76702c5a4d45a65e16c0375432d583d00b74bf2169398e7568a785a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mortie-0.6.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: build-wheels.yml on espg/mortie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mortie-0.6.2-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mortie-0.6.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9237b004f8832b6ed478b3d3c592d8193684714b65c8729f24439074339b5699
MD5 712733b3a6d2ffe614f26ac3ab87ab4b
BLAKE2b-256 c6bbbc48af8cf3ba77af5919033ef520827c10b226b738cf6fba222b0565131a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mortie-0.6.2-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: build-wheels.yml on espg/mortie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mortie-0.6.2-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mortie-0.6.2-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ed7e34a04a909537c7bdd33aac82ce94fd55c48c939955cf6a9a0c19809fbd2a
MD5 f813131a48d7ce3daa05517926363f24
BLAKE2b-256 87f8502efa83a4dea34309afd1a5171b62061c710c0b7ef03f671184be9f5ee9

See more details on using hashes here.

Provenance

The following attestation bundles were made for mortie-0.6.2-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: build-wheels.yml on espg/mortie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page