lib.theory.effect_ap.AnisotropicScaling

class lib.theory.effect_ap.AnisotropicScaling(model=None, basis=None)

Bases: lib.theory.base.BaseModel

Class applying anisotropic scaling of the theory model (correlation function or power spectrum).

Initialize AnisotropicScaling.

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 'multipole', model is first expanded onto Legendre polynomials to get :math:’mu’ dependence.

Methods

copy

Return shallow copy of self.

deepcopy

eval

Evaluate model in rescaled coordinates.

from_state

Instantiate and initalize class with state dictionary.

is_mpi_broadcast

is_mpi_gathered

is_mpi_root

is_mpi_scattered

kmu_scaling

Apply anisotropic scaling to \(k, \mu\) coordinates.

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_scaling

Set scaling parameters, along qpar and perpendicular qperp to the line-of-sight.

smu_scaling

Apply anistropic scaling to \(s, \mu\) coordinates.

Attributes

logger

mpiattrs

MPI attributes

mpicomm

mpiroot

mpistate

__call__(*args, **kwargs)

Evaluate model.

copy()

Return shallow copy of self.

eval(x, mu=0.0, grid=True, **kwargs)

Evaluate model in rescaled coordinates.

Parameters
  • x (array) – x-coordinates (\(k\) or \(s\)).

  • mu (array) – Angle to the line-of-sight.

  • grid (bool) – Whether input x, mu should be interpreted as a grid, in which case the output will be arrays of shape (x.size, mu.size).

  • kwargs (dict) – Arguments for input model.

Returns

model

Return type

array

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

Instantiate and initalize class with state dictionary.

kmu_scaling(k, mu, grid=True)

Apply anisotropic scaling to \(k, \mu\) coordinates.

Parameters
  • k (array) – Wavenumbers.

  • mu (array) – Angle to the line-of-sight.

  • grid (bool) – Whether input k, mu should be interpreted as a grid, in which case the output will be arrays of shape (k.size, mu.size).

Returns

  • kap (array) – Wavenumbers after rescaling.

  • muap ; array – Angle to the line-of-sight after rescaling.

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_scaling(qpar=1, qperp=1)

Set scaling parameters, along qpar and perpendicular qperp to the line-of-sight.

smu_scaling(s, mu, grid=True)

Apply anistropic scaling to \(s, \mu\) coordinates.

Parameters
  • s (array) – Separations.

  • mu (array) – Angle to the line-of-sight.

  • grid (bool) – Whether input s, mu should be interpreted as a grid, in which case the output will be arrays of shape (s.size, mu.size).

Returns

  • sap (array) – Wavenumbers after rescaling.

  • muap ; array – Angle to the line-of-sight after rescaling.