User Guide#
Everything you need to understand how healpix-resample works and how to configure it.
Output format#
All resamplers return a ResampleResults dataclass:
Field |
Shape |
Description |
|---|---|---|
|
|
Resampled values on HEALPix cells |
|
|
HEALPix cell indices (nested scheme) |
|
|
CG convergence history (PSFResampler only) |
|
scalar |
Number of CG iterations (PSFResampler only) |
Key parameters (all resamplers)#
Parameter |
Default |
Description |
|---|---|---|
|
— |
HEALPix resolution. |
|
|
Minimum weight sum to keep a cell |
|
auto |
Gaussian scale in metres (defaults to pixel size) |
|
|
Restrict output to a specific subset of cells |
|
|
Geodetic ellipsoid |
|
auto |
|
|
|
PyTorch dtype. Use |
GPU usage#
Pass device="cuda" to any resampler to run on GPU. The operators M and MT stay in GPU memory between calls to resample(), so the cost is paid only once at construction time.
from healpix_resample import BilinearResampler
import torch
nr = BilinearResampler(
lon_deg=lon, lat_deg=lat,
level=13,
device="cuda",
dtype=torch.float32,
)
result = nr.resample(val) # runs on GPU
What next#
4-point weighted interpolation.
Fastest option. One cell per sample, no interpolation.
Gaussian kernel + conjugate gradient. Best quality.