healpix_resample.BilinearResampler#

class healpix_resample.BilinearResampler(*args, area=None, **kwargs)[source]#

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

Parameters:
  • area (array-like or None) – Per-sample pixel area/weight, shape (N,). Only used by resample(conservative=True) (see below) – ignored by the default interpolation path. Defaults to 1.0 for every sample (equal-area pixels / already-extensive quantities), the same convention as ConservativeResampler.

  • All other parameters are forwarded to ``KNeighborsResampler``.

__init__(*args, area=None, **kwargs)[source]#

Pre-compute sparse operators.

Parameters:
  • lon_deg, lat_deg – unstructured sample coordinates in degrees, shape (N,)

  • Npt – number of nearest HEALPix cells used per sample

  • level – HEALPix level, nside = 2**level

  • sigma_m – Gaussian length scale (meters). If None, uses the HEALPix pixel scale sigma = sqrt(4*pi/(12*4**level))*R.

  • threshold – keep only HEALPix cells whose global weight sum >= threshold

  • nest – HEALPix indexing scheme

  • dtype/device – torch dtype/device for all matrices and computations

Methods

__init__(*args[, area])

Pre-compute sparse operators.

comp_matrix()

get_cell_ids()

invert(hval)

Project HEALPix field back to the sample locations.

resample(val, *[, conservative])

Estimate the HEALPix field from unstructured samples.