CompositeAboutPoints#

class rojak.atmosphere.compositing.CompositeAboutPoints(grid, centre_dim_name, block_sizes, block_chunk, centre_array, centre_coords, km_coords, interpolation, lat_lon_buffer)[source]#

Composite fields on a common grid about the centres stored in a dask.dataframe.DataFrame.

Build it once with from_centres(), which locates, counts and shuffles the centres, then call it on each field to composite. Only the interpolation is built for each field. As every composite shares the same (lazy) centre arrays, computing the composites together evaluates the shuffle once. See composite_about_points() for how the compositing works.

It is callable, so it can be applied to every data variable of a xarray.Dataset with xarray.Dataset.map().

Example

>>> composite = CompositeAboutPoints.from_centres(
...     ds, centres, vert_dim_name="pressure_level", vert_column="level"
... )
>>> composites = ds[["temperature", "u_wind"]].map(composite)
>>> geopotential_composite = composite(ds["geopotential"])
Parameters:
__init__(grid, centre_dim_name, block_sizes, block_chunk, centre_array, centre_coords, km_coords, interpolation, lat_lon_buffer)[source]#
Parameters:
Return type:

None

Methods

__init__(grid, centre_dim_name, block_sizes, ...)

from_centres(template, centres, *[, ...])

Locate and group the centres on the grid of template.

Attributes

grid

centre_dim_name

block_sizes

block_chunk

centre_array

centre_coords

km_coords

interpolation

lat_lon_buffer