healpix_resample.healpix_to_utm#

healpix_resample.healpix_to_utm(cell_data, cell_ids, level, *, grid=None, resolution=None, crs=None, method='bilinear', nest=True, ellipsoid='WGS84', **kwargs)[source]#

Resample an in-memory HEALPix field onto a UTM raster in one call.

If grid is not given, it is built with UTMGrid.from_cell_ids from the bounding box of the cells, using resolution (default: the HEALPix cell size) and crs (default: the UTM zone of the cells’ centroid).

This wrapper needs cell_data and cell_ids in memory. For a dataset larger than memory, or to apply the same geometry to several fields, build a HealpixToUTM first, read only its cell_ids from the source, and call its resample().

Returns:

  • data (numpy.ndarray or torch.Tensor) – Raster values, shape (ny, nx) or (B, ny, nx), same array type as cell_data. Pixels that depend on a cell absent from cell_ids are NaN.

  • grid (UTMGrid) – The grid the data are defined on (grid.x, grid.y, grid.crs).