healpix_convolution.xarray.pad

Contents

healpix_convolution.xarray.pad#

healpix_convolution.xarray.pad(cell_ids, *, ring, mode='constant', constant_value=0, end_value=0, reflect_type='even')#

pad a xarray object

Parameters:
  • cell_ids (xarray.DataArray) – The cell ids to pad. Must have a xdggs index.

  • ring (int) – The pad width in rings around the input domain. Must be 0 or positive.

  • mode (str, default: "constant") – The padding mode. Can be one of:

    • “constant”: fill the padded cells with constant_value.

    • “linear_ramp”: linearly interpolate the padded cells from the edge of the array to end_value. For ring 1, this is the same as mode="constant"

    • “edge”: fill the padded cells with the values at the edge of the array.

    • “reflect”: pad with the reflected values.

  • constant_value (scalar, default: 0) – The constant value used in constant mode.

  • end_value (scalar, default: 0) – The othermost value to interpolate to. Only used in linear ramp mode.

  • reflect_type ({"even", "odd"}, default: "even") – The reflect type. Only used in reflect mode.

Returns:

padded (healpix_convolution.xarray.Padding) – The padding object. Can be used to apply the same padding operation for multiple objects with the same geometry.