pmesh.window module

class pmesh.window.Affine(ndim, scale=None, translate=None, period=None)[source]

Bases: object

Defines an affine Transformation, used by ResampleWindow.

Parameters:
translate : array_like, in integer mesh units.

period : array_like in integer mesh units. scale : factor that multiples on position to obtain mesh units.

rescale(amount)[source]

Returns a new Affine where the scale is multipled by amount.

shift(amount)[source]

Returns a new Affine where the translate is shifted by amount. Amount is in integer mesh units, as translate.

pmesh.window.FindResampler(window)[source]
class pmesh.window.ResampleWindow(kind, support=-1)[source]

Bases: pmesh._window.ResampleWindow

paint(real, pos, hsml=None, mass=None, diffdir=None, transform=None)[source]

paint to a field.

Parameters:
real : array_like

original values are preserved.

pos : array_like
mass : array_like or None

None for 1

hsml: array_like or None

scaling of the kernel. it is dimensionless; None for no scaling (default kernel support in grid units)

diffdir: int or None

direction for differentiation kernel. 0, 1, 2,… or None

transform: Affine

The Affine transformation from position to grid units.

readout(real, pos, hsml=None, out=None, diffdir=None, transform=None)[source]

readout from a field.

Parameters:
real : array_like
pos : array_like
hsml: array_like, or None

scaling of the kernel. it is dimensionless; None for no scaling (default kernel support in grid units)

out : array_like
mass : array_like or None

None for 1

diffdir: int or None

direction for differentiation kernel. 0, 1, 2,… or None

transform: Affine

The Affine transformation from position to grid units.

resize(support)[source]

Change the support of the window, returning a new window.