lib.theory.hankel_transform.HankelTransform

class lib.theory.hankel_transform.HankelTransform(model=None, basis=None, nx=None, ells=None, q=0, integration=None)

Bases: lib.theory.base.BaseModel

Class performing (forward and backward) Hankel transforms.

Initialize HankelTransform.

Parameters
  • model (BaseModel, callable) – Input model.

  • basis (ProjectionBasis, default=None) – Projection basis. If None uses BaseModel.basis attribute of input model. If basis.mode is 'muwedge', model is first integrated onto Legendre polynomials to get multipoles.

  • nx (int, default=None) – Number of log-space points. If None, defaults to length of basis.x.

  • ells (tuple, default=None) – Multipole orders. If None, defaults to basis.projs if basis.mode is 'muwedge', else (0,2,4).

  • q (int, default=0) – Power-law tilt to regularize Hankel transforms.

  • integration (dict) – If basis.mode is 'muwedge', options for integration over Legendre polynomials, see ModelEvaluation.

Methods

copy

Return shallow copy of self.

deepcopy

eval

Evaluate Hankel-transformed model.

from_state

Instantiate and initalize class with state dictionary.

is_mpi_broadcast

is_mpi_gathered

is_mpi_root

is_mpi_scattered

load

Load class in numpy binary format from disk.

load_auto

If different formats are possible, this method should between them based on file name extension.

log_critical

log_debug

log_error

log_info

log_warning

save

Save class to disk.

save_auto

If different formats are possible, this method should between them based on file name extension.

set_damping

Set artificial damping of the input model to regularize integration.

Attributes

logger

mpiattrs

MPI attributes

mpicomm

mpiroot

mpistate

__call__(*args, **kwargs)

Evaluate model.

copy()

Return shallow copy of self.

eval(x, **kwargs)

Evaluate Hankel-transformed model.

Parameters
  • x (array) – x-coordinates (wavenumbers or separations).

  • kwargs (dict) – Arguments for ModelEvaluation.__call__().

Returns

model

Return type

array

classmethod from_state(state, mpiroot=0, mpicomm=None)

Instantiate and initalize class with state dictionary.

classmethod load(filename, mpiroot=0, mpicomm=None)

Load class in numpy binary format from disk. If the loaded state contains __class__ and that exists in cls._registry, return instance of cls._registry[__class__] (instead of cls).

load_auto(*args, **kwargs)

If different formats are possible, this method should between them based on file name extension.

property mpiattrs

MPI attributes

save(filename)

Save class to disk.

save_auto(*args, **kwargs)

If different formats are possible, this method should between them based on file name extension.

set_damping()

Set artificial damping of the input model to regularize integration.