healpix_resample.CategoricalResampler#

class healpix_resample.CategoricalResampler(lon_deg, lat_deg, level, *, kernel=<class 'healpix_resample.bilinear.BilinearResampler'>, **kernel_kwargs)[source]#

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

Use this when each sample carries exactly one class label out of a fixed set (e.g. a land-cover or scene classification) – as opposed to BitmaskResampler’s independent, co-occurring boolean flags. Each class’s presence/absence is resampled as a 0/1 indicator through kernel (default BilinearResampler), and the output class per cell is whichever indicator scored highest – “argmax_over_bilinear” in the issue’s own working name.

Parameters:
  • lon_deg, lat_deg (array-like, shape (N,)) – Sample coordinates in degrees.

  • level (int) – HEALPix level (nside = 2**level).

  • kernel (type) – A KNeighborsResampler subclass used to interpolate each class’s indicator map – default BilinearResampler. See resample()’s docstring for why the default is the best-behaved choice for this purpose.

  • **kernel_kwargs – Forwarded to kernel’s constructor together with lon_deg, lat_deg, level.

__init__(lon_deg, lat_deg, level, *, kernel=<class 'healpix_resample.bilinear.BilinearResampler'>, **kernel_kwargs)[source]#

Methods

__init__(lon_deg, lat_deg, level, *[, kernel])

resample(mask, *[, return_scores, ...])

Resample mutually-exclusive class labels to HEALPix by argmax.