API Reference#

Resamplers#

healpix_resample.NearestResampler(*args[, Npt])

Nearest-neighbour HEALPix resampler — no sparse matrices.

healpix_resample.BilinearResampler(*args[, area])

Bilinear (Npt=4, inverse-distance weighted) HEALPix resampler.

healpix_resample.BicubicResampler(*args[, ...])

Radial cubic-convolution HEALPix resampler.

healpix_resample.CloughTocherResampler(...)

Delaunay triangulation + Clough-Tocher C1 cubic HEALPix resampler.

healpix_resample.PSFResampler(lon_deg, ...)

healpix_resample.CellPointResampler(*args, ...)

Resample input lat-lon points as HEALPix "cell-points".

healpix_resample.GroupByResampler([reduce])

healpix_resample.ConservativeResampler(*args)

Area-weighted, flux-conserving HEALPix resampler.

Mask-like / categorical data#

BitmaskResampler and CategoricalResampler wrap an ordinary interpolating resampler (default BilinearResampler) to resample integer bitmasks and mutually-exclusive class labels respectively – see the healpix_resample.mask (mask-like / categorical data) page.

healpix_resample.BitmaskResampler(lon_deg, ...)

Resample an integer bitmask (independent boolean flags) to HEALPix.

healpix_resample.CategoricalResampler(...[, ...])

Resample mutually-exclusive class labels to HEALPix (argmax).

healpix_resample.CategoricalResampleResults(...)

ResampleResults returned by CategoricalResampler.resample().

Large-scale processing#

subset_for_parent_cell() restricts a resampler’s input samples and output cells to one coarse HEALPix parent cell, so a global dataset can be processed one parent cell at a time without ever constructing a resampler over the full input. See the Processing one parent cell at a time (subset_for_parent_cell) page for the workflow.

healpix_resample.subset_for_parent_cell(...)

Restrict processing to one parent cell: which samples, which output cells.

Base class#

KNeighborsResampler is the base class inherited by all resamplers above. Use it directly only if you need to implement a custom weighting scheme via comp_matrix().

healpix_resample.knn.KNeighborsResampler(...)

GPU-friendly sparse HEALPix regridding via local Gaussian weights + CG deconvolution.

Output#

All resamplers return a ResampleResults dataclass.

healpix_resample.base.ResampleResults(...[, ...])

Proxy to resampling results.

Internals#

These functions are not part of the public API but are documented here for contributors. healpix_weighted_nearest() is called internally by all resamplers to build the sparse operators. conjugate_gradient() and least_squares_cg() are used internally by PSFResampler. estimate_pixel_area() is used by PSFResampler to auto-estimate per-sample pixel area when area is not supplied.

healpix_resample.knn.healpix_weighted_nearest(...)

Retourne:

healpix_resample.psf.conjugate_gradient(A_mv, b)

Solve A x = b with Conjugate Gradient, using only matvec A_mv(v).

healpix_resample.psf.least_squares_cg(M, MT, ...)

Solve for delta in a damped least-squares problem without forming dense matrices.

healpix_resample.base.estimate_pixel_area(...)

Estimate each sample's pixel area from shared-latitude "ring" structure.