xarray_regrid.methods._shared

Utility functions shared between methods.

Functions

construct_intervals(→ pandas.IntervalIndex)

Create pandas.intervals with given coordinates.

restore_properties(…)

Restore coord names, copy values and attributes of target, & add NaN padding.

reduce_data_to_new_domain(…)

Slice the input data to bounds of the target dataset, to reduce computations.

Module Contents

xarray_regrid.methods._shared.construct_intervals(coord: numpy.ndarray) pandas.IntervalIndex[source]

Create pandas.intervals with given coordinates.

xarray_regrid.methods._shared.restore_properties(result: xarray.DataArray, original_data: xarray.DataArray | xarray.Dataset, target_ds: xarray.Dataset, coords: list[collections.abc.Hashable], fill_value: Any) xarray.DataArray[source]
xarray_regrid.methods._shared.restore_properties(result: xarray.Dataset, original_data: xarray.DataArray | xarray.Dataset, target_ds: xarray.Dataset, coords: list[collections.abc.Hashable], fill_value: Any) xarray.Dataset

Restore coord names, copy values and attributes of target, & add NaN padding.

xarray_regrid.methods._shared.reduce_data_to_new_domain(data: xarray.DataArray, target_ds: xarray.Dataset, coords: list[collections.abc.Hashable]) xarray.DataArray[source]
xarray_regrid.methods._shared.reduce_data_to_new_domain(data: xarray.Dataset, target_ds: xarray.Dataset, coords: list[collections.abc.Hashable]) xarray.Dataset

Slice the input data to bounds of the target dataset, to reduce computations.