lib.theory.effect_ap.AnisotropicScaling¶
- class lib.theory.effect_ap.AnisotropicScaling(model=None, basis=None)¶
Bases:
lib.theory.base.BaseModelClass 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
NoneusesBaseModel.basisattribute of input model. Ifbasis.modeis'multipole', model is first expanded onto Legendre polynomials to get :math:’mu’ dependence.
Methods
Return shallow copy of
self.deepcopyEvaluate model in rescaled coordinates.
Instantiate and initalize class with state dictionary.
is_mpi_broadcastis_mpi_gatheredis_mpi_rootis_mpi_scatteredApply anisotropic scaling to \(k, \mu\) coordinates.
Load class in numpy binary format from disk.
If different formats are possible, this method should between them based on file name extension.
log_criticallog_debuglog_errorlog_infolog_warningSave class to disk.
If different formats are possible, this method should between them based on file name extension.
Set scaling parameters, along
qparand perpendicularqperpto the line-of-sight.Apply anistropic scaling to \(s, \mu\) coordinates.
Attributes
loggerMPI attributes
mpicommmpirootmpistate- __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,mushould 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,mushould 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 incls._registry, return instance ofcls._registry[__class__](instead ofcls).
- 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
qparand perpendicularqperpto 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,mushould 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.