nifty7.operators.field_zero_padder module#

class FieldZeroPadder(domain, new_shape, space=0, central=False)[source]#

Bases: LinearOperator

Operator which applies zero-padding to one of the subdomains of its input field

Parameters:
  • domain (Domain, DomainTuple or tuple of Domain) – The operator’s input domain.

  • new_shape (list or tuple of int) – The new dimensions of the subdomain which is zero-padded. No entry must be smaller than the corresponding dimension in the operator’s domain.

  • space (int) – The index of the subdomain to be zero-padded. If None, it is set to 0 if domain contains exactly one space. domain[space] must be an RGSpace.

  • central (bool) – If False, padding is performed at the end of the domain axes, otherwise in the middle.

Notes

When doing central padding on an axis with an even length, the “central” entry should in principle be split up; this is currently not done.

apply(x, mode)[source]#

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

Parameters:
  • x (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:

Field