Skip to main content

Sparse GPU-enabled regridding from lon/lat to HEALPix

Project description

healpix-resample

healpix-resample is a lightweight Python package designed to regrid data defined on longitude--latitude coordinates onto a HEALPix grid.

The package provides GPU-accelerated operators (via PyTorch) to construct sparse linear mappings between input geodetic coordinates and a target HEALPix tessellation at a chosen resolution level.

This package manages the HEALPix authalic definition and the Earth ellipsoid using the WGS84 reference system.

Objectives

The main goals of the package are:

  • Provide a generic regridding framework from (lon, lat) to HEALPix.
  • Support different interpolation strategies:
    • Nearest-neighbor mapping
    • PSF / multi-point weighted interpolation
  • Enable efficient handling of:
    • Large numbers of input points
    • Batched data (B, N)
    • CUDA acceleration
  • Offer a reusable linear operator that can be:
    • Applied forward (data → HEALPix)
    • Used inside inverse problems or iterative solvers

Design Principles

  • Modular architecture:
    • knn module: generic operator construction
    • nearest: nearest-neighbor specialization
    • psf: weighted multi-point interpolation
  • Sparse matrix representation for scalability
  • Torch-based implementation for CPU/GPU flexibility
  • Resolution controlled via HEALPix level parameter

Installation (Private Repository)

This package is distributed as a private repository and must be installed from source.


Clone the repository

git clone https://github.com/EOPF-DGGS/healpix-resample.git
cd healpix-resample

If you use SSH access:

git clone git@github.com:EOPF-DGGS/healpix-resample.git
cd healpix-resample

Install in editable mode (recommended for development)

pip install -e .

Editable mode allows you to modify the source code without reinstalling the package after each change.


Standard installation (optional)

If you do not need editable mode:

pip install .

Requirements

Make sure you are using:

  • Python ≥ 3.8
  • A working PyTorch installation (CPU or CUDA)
  • numpy
  • healpix-geo

Verifying the installation

After installation:

import healpix_resample
print(healpix_resample.__file__)

If no error occurs, the installation is successful.

Typical Use Case

from healpix_resample.nearest import NearestResampler

op = NearestResampler(lon_deg=lon, lat_deg=lat, level=level, device="cuda")
healpix_values = op.resample(values)

Target Applications

  • Earth observation data remapping
  • Oceanographic or atmospheric gridding
  • Astronomical sky projections
  • Large-scale geospatial data harmonization

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

healpix_resample-0.1.4.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

healpix_resample-0.1.4-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file healpix_resample-0.1.4.tar.gz.

File metadata

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

File hashes

Hashes for healpix_resample-0.1.4.tar.gz
Algorithm Hash digest
SHA256 aeb83b8f5d357c078cbe69852831cb0011e8029c9a9faaba8fac88f405155f1f
MD5 89ed356f70689b5267772c3e9aa2e698
BLAKE2b-256 076a75436a52d500720a06f9b1ad395c510dace7ecf0125a3acd2efff9ee94b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for healpix_resample-0.1.4.tar.gz:

Publisher: pypipublish.yml on EOPF-DGGS/healpix-resample

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

File details

Details for the file healpix_resample-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for healpix_resample-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cac8fc35795b911683ac2938a2e2051f58f20eccf7d3d83cb15a44ea526112ab
MD5 db6759879dd503c23debca8153eef916
BLAKE2b-256 f7dcb21800022cfc13f44f567a4fdd4b0c92e56e1f56960f1675297b0bcc8fd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for healpix_resample-0.1.4-py3-none-any.whl:

Publisher: pypipublish.yml on EOPF-DGGS/healpix-resample

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