lib.theory.linear.LinearModel

class lib.theory.linear.LinearModel(pklin, klin=None, FoG='gaussian')

Bases: lib.theory.base.BasePTModel

Linear RSD Kaiser model.

Initialize BasePTModel.

Parameters
  • pklin (array, callable, PowerSpectrumInterpolator1D) – Linear power spectrum. If array, klin must be provided.

  • klin (array, default=None) – Wavenumbers. Must be provided if pklin is an array.

  • FoG (callable, string, default='gaussian') – Type of Finger-of-God effect.

Methods

copy

Return shallow copy of self.

deepcopy

eval

Return power spectrum at input k, mu.

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

pk_mu

Return power spectrum at input k, mu.

save

Save class to disk.

save_auto

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

Attributes

logger

mpiattrs

MPI attributes

mpicomm

mpiroot

mpistate

__call__(*args, **kwargs)

Evaluate model.

copy()

Return shallow copy of self.

eval(k, mu=0.0, b1=2.0, shotnoise=0.0, f=1.0, grid=True, **kwargs)

Return power spectrum at input k, mu.

Parameters
  • k (array) – Wavenumbers.

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

  • b1 (float) – Linear bias.

  • shotnoise (float) – Shot noise.

  • f (float) – Growth rate.

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

  • kwargs (dict) – Arguments for FoG.

Returns

pk_mu

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

pk_mu(k, mu=0.0, b1=2.0, shotnoise=0.0, f=1.0, grid=True, **kwargs)

Return power spectrum at input k, mu.

Parameters
  • k (array) – Wavenumbers.

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

  • b1 (float) – Linear bias.

  • shotnoise (float) – Shot noise.

  • f (float) – Growth rate.

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

  • kwargs (dict) – Arguments for FoG.

Returns

pk_mu

Return type

array

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.