healpix_resample.GridBilinearResampler#
- class healpix_resample.GridBilinearResampler(lon_deg, lat_deg, level, *, out_cell_ids=None, nest=True, ellipsoid='WGS84', min_weight=0.5, device='cpu', dtype=torch.float64, verbose=False)[source]#
Bilinear interpolation of lon/lat grids at HEALPix cell centres.
- Parameters:
lon_deg, lat_deg (
array-like) – 1-D longitude and latitude axes of the input grid, in any order (ascending, descending, or crossing the antimeridian). Several grids (“bands” of rows with their own longitude axis, e.g. the 1” and 1.5” tiles of the Copernicus DEM on both sides of 50°N) are given as two lists of 1-D axes of the same length; they must not overlap in latitude. Cells between the last row of a band and the first row of the next one are interpolated between those two rows, each along its own longitude axis, when the gap is not wider than 1.5 row steps of the two bands; cells in a wider gap are NaN.level (
int) – HEALPix level of the output. Meant for levels whose cells are not larger than the grid step: each cell takes the value at its centre, so at coarser levels the result aliases (use block means of a finer level, or a conservative resampler, there).out_cell_ids (
array-like, optional) – Output cells. Default: the cells around the grid nodes, which include every cell whose centre is inside the grid (the others are NaN).nest (
bool) – Nested (default) or ring indexing, as for the other resamplers.ellipsoid (
str) – Ellipsoid of the cell centres, as for the other resamplers.min_weight (
float) – Cells whose valid (non-NaN, inside the grid) corner weights sum to less than this are NaN; the others are renormalised over their valid corners.1.0gives NaN as soon as one corner is NaN (as scipy); the default 0.5 extends valid areas by up to half a pixel.The values given to :meth:`resample` are, for each band in the order
given, the 2-D ``(lat, lon)`` array of that band (axes in the order
given) flattened in C order, concatenated (
N = sum(nlat * nlon).)
- __init__(lon_deg, lat_deg, level, *, out_cell_ids=None, nest=True, ellipsoid='WGS84', min_weight=0.5, device='cpu', dtype=torch.float64, verbose=False)[source]#
Methods
__init__(lon_deg, lat_deg, level, *[, ...])get_cell_ids()resample(val, **unused)Interpolate the grid values at the cell centres.