healpix_resample.CellPointResampler#

class healpix_resample.CellPointResampler(*args, **kwargs)[source]#

Resample input lat-lon points as HEALPix “cell-points”.

The values of the input lat-lon points are resampled on HEALPix cells with a fixed, maximum refinement level (=29) in which the points are located.

Level-29 cells have a tiny resolution of 0.4 milliarcseconds. In many applications those cells can be approximated as “points”.

If multiple input points are located within the same cell, their values are merged according to the reduce option.

__init__(*args, **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, **kwargs)

Pre-compute sparse operators.

comp_matrix()

get_cell_ids()

invert(hval)

Project HEALPix field back to the sample locations.

resample(val)

Estimate the HEALPix field from unstructured samples.