Skip to content

fiery.bounds.indexing

This module contains functions that wrap out-of-bound indices back in-bounds, according to some boundary condition.

Functions:

Name Description
replicate

Apply replicate boundary conditions to an index. Aliases: border, nearest, repeat, edge.

dft

Apply DFT boundary conditions to an index. Aliases: wrap, gridwrap, circular, circulant.

dct1

Apply DCT-I boundary conditions to an index. Alias: mirror

dct2

Apply DCT-II boundary conditions to an index. Aliases: reflect, reflection, gridmirror, neumann.

dst1

Apply DST-I boundary conditions to an index. Alias: antimirror

dst2

Apply DST-II boundary conditions to an index. Aliases: antireflect, dirichlet.

nocheck

Do not wrap indices (assume they are inbounds)

Attributes

nearest module-attribute

nearest = replicate

Alias for replicate

border module-attribute

border = replicate

Alias for replicate

repeat module-attribute

repeat = replicate

Alias for replicate

edge module-attribute

edge = replicate

Alias for replicate

reflect module-attribute

reflect = dct2

Alias for dct2

reflection module-attribute

reflection = dct2

Alias for dct2

gridmirror module-attribute

gridmirror = dct2

Alias for dct2

neumann module-attribute

neumann = dct2

Alias for dct2

mirror module-attribute

mirror = dct1

Alias for dct1

antireflect module-attribute

antireflect = dst2

Alias for dst2

dirichlet module-attribute

dirichlet = dst2

Alias for dst2

antimirror module-attribute

antimirror = dst1

Alias for dst1

wrap module-attribute

wrap = dft

Alias for dft

gridwrap module-attribute

gridwrap = dft

Alias for dft

circular module-attribute

circular = dft

Alias for dft

circulant module-attribute

circulant = dft

Alias for dft

Functions:

nocheck

nocheck(i, n)

Assume all indices are inbounds

replicate

replicate(i, n)

Apply replicate (nearest/border) boundary conditions to an index

Aliases

border, nearest, repeat, edge

Parameters:

Name Type Description Default
i int or tensor

Index

required
n int

Length of the field of view

required

Returns:

Name Type Description
i int or tensor

Index that falls inside the field of view [0, n-1]

s {1, 0, -1}

Sign of the transformation (always 1 for replicate)

dft

dft(i, n)

Apply DFT (circulant/wrap) boundary conditions to an index

Parameters:

Name Type Description Default
i int or tensor

Index

required
n int

Length of the field of view

required

Returns:

Name Type Description
i int or tensor

Index that falls inside the field of view [0, n-1]

s {1, 0, -1}

Sign of the transformation (always 1 for dft)

dct2

dct2(i, n)

Apply DCT-II (reflect) boundary conditions to an index

Parameters:

Name Type Description Default
i int or tensor

Index

required
n int

Length of the field of view

required

Returns:

Name Type Description
i int or tensor

Index that falls inside the field of view [0, n-1]

s {1, 0, -1}

Sign of the transformation (always 1 for dct2)

dct1

dct1(i, n)

Apply DCT-I (mirror) boundary conditions to an index

Aliases

mirror

Parameters:

Name Type Description Default
i int or tensor

Index

required
n int

Length of the field of view

required

Returns:

Name Type Description
i int or tensor

Index that falls inside the field of view [0, n-1]

s {1, 0, -1}

Sign of the transformation (always 1 for dct1)

dst1

dst1(i, n)

Apply DST-I (antimirror) boundary conditions to an index

Aliases

antimirror

Parameters:

Name Type Description Default
i int or tensor

Index

required
n int

Length of the field of view

required

Returns:

Name Type Description
i int or tensor

Index that falls inside the field of view [0, n-1]

s [tensor of] {1, 0, -1}

Sign of the transformation

dst2

dst2(i, n)

Apply DST-II (antireflect) boundary conditions to an index

Parameters:

Name Type Description Default
i int or tensor

Index

required
n int

Length of the field of view

required

Returns:

Name Type Description
i int or tensor

Index that falls inside the field of view [0, n-1]

s [tensor of] {1, 0, -1}

Sign of the transformation