lib.theory.base.ProjectionBasis¶
- class lib.theory.base.ProjectionBasis(x=None, **kwargs)¶
Bases:
cosmopipe.lib.utils.BaseNameSpaceClass representing a model basis.
- x¶
Array of x-coordinates where the model can be safely evaluated.
- Type
array
- name¶
Model name.
- Type
string
- fields¶
Tracer field(s).
- Type
tuple
- space¶
Projection space, e.g. power spectrum (‘power’)? Correlation function (‘correlation’)?
- Type
string
- shotnoise¶
If in Fourier space, Poisson shotnoise associated to that model.
- Type
float
- mode¶
Projection mode, e.g. ‘multipole’? ‘muwedge’?
- Type
string
- projs¶
List of projection number or identifier (e.g. order of Legendre polynomial, lower and upper limit of \(\mu\)-wedge).
- Type
list
- wa_order¶
Wide-angle order.
- Type
int
Initialize
ProjectionBasis.- Parameters
x (array, dict, default=None) – Dictionary of attribute values, or array of x-coordinates where the model can be safely evaluated.
kwargs (dict) – Dictionary of attribute values. If
xis dictionary, is updated bykwargs.
Methods
Return dictionary of attributes, droping those set to
Noneifdrop_noneisTrue.Return copy, setting attributes
kwargson-the-fly.deepcopyIs
selfequal toother, i.e. same type and attributes, ignoring attributes set toNone?.Instantiate and initalize class with state dictionary.
Return attribute
name, defaulting todefault.is_mpi_broadcastis_mpi_gatheredis_mpi_rootis_mpi_scatteredLoad 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 attributes
kwargs.Set attributes
kwargsif current values areNone.Export projection basis as a
ProjectionNameCollectioninstance.Attributes
CORRELATIONMULTIPOLEMUWEDGEPOWERloggerMPI attributes
mpicommmpirootmpistate- as_dict(drop_none=True)¶
Return dictionary of attributes, droping those set to
Noneifdrop_noneisTrue.
- copy(**kwargs)¶
Return copy, setting attributes
kwargson-the-fly.
- eq_ignore_none(other)¶
Is
selfequal toother, i.e. same type and attributes, ignoring attributes set toNone?
- classmethod from_state(state, mpiroot=0, mpicomm=None)¶
Instantiate and initalize class with state dictionary.
- get(name, default=None)¶
Return attribute
name, defaulting todefault.
- 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(**kwargs)¶
Set attributes
kwargs.
- setdefault(**kwargs)¶
Set attributes
kwargsif current values areNone.
- to_projs()¶
Export projection basis as a
ProjectionNameCollectioninstance.