nifty8.operators.regridding_operator module#

class RegriddingOperator(domain, new_shape, space=0)[source]#

Bases: LinearOperator

Linearly interpolates an RGSpace to an RGSpace with coarser resolution.

Parameters:
  • domain (Domain, DomainTuple or tuple of Domain) – domain[space] needs to be an RGSpace.

  • new_shape (tuple of int) – Shape of the space which domain[space] is replaced by. Each entry must be smaller or equal to the respective entry in domain[space].shape.

  • space (int) – Index of space in domain on which the operator shall act. Default is 0.

__init__(domain, new_shape, space=0)[source]#
apply(x, mode)[source]#

Applies the Operator to a given x, in a specified mode.

Parameters:
  • x (nifty8.field.Field) – The input Field, defined on the Operator’s domain or target, depending on mode.

  • mode (int) –

    • TIMES: normal application

    • ADJOINT_TIMES: adjoint application

    • INVERSE_TIMES: inverse application

    • ADJOINT_INVERSE_TIMES or INVERSE_ADJOINT_TIMES: adjoint inverse application

Returns:

The processed Field defined on the Operator’s target or domain, depending on mode.

Return type:

nifty8.field.Field