lib.data_vector.projection.ProjectionName¶
- class lib.data_vector.projection.ProjectionName(*args, **kwargs)¶
Bases:
cosmopipe.lib.utils.BaseNameSpaceClass describing a projection. All attributes default to
None(not specified or not relevant).- name¶
Name of projection.
- Type
string
- fields¶
Tracer field(s).
- Type
tuple
- space¶
Projection space, e.g. power spectrum (‘power’)? Correlation function (‘correlation’)?
- Type
string
- mode¶
Projection mode, e.g. ‘multipole’? ‘muwedge’?
- Type
string
- proj¶
Projection number or identifier (e.g. order of Legendre polynomial, lower and upper limit of \(\mu\)-wedge)
- Type
tuple, int
- wa_order¶
Wide-angle order.
- Type
int
Initialize
ProjectionName.Example
ProjectionName('ell_2') == Projection(mode='multipole',proj=2)ProjectionName('multipole',2) == Projection(mode='multipole',proj=2)ProjectionName(('multipole',2)) == Projection(mode='multipole',proj=2)- Parameters
args (tuple, list, string, dict, ProjectionName) –
Can be:
a tuple or list of (mode, proj), (space, mode, proj) or (name, space, mode, proj)
string of mode_proj, space_mode_proj, or name_space_mode_proj
a dictionary of attribute values
a
ProjectionNameinstance, which is copied.
kwargs (dict) – Dictionary of attribute values. If
argsis 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.If
modeis specified (i.e.Return x-coordinate label.
Return y-coordinate label.
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 projection attributes in
kwargs.Set attributes
kwargsif current values areNone.Attributes
CORRELATIONMUBINMULTIPOLEMUWEDGEPIWEDGEPOWERReturn latex (e.g., for the quadrupole, \(\ell = 2\)).
loggerMPI attributes
mpicommmpirootmpistatesep- 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.
- get_projlabel()¶
If
modeis specified (i.e. notNone), returnlatexsurrounded by ‘$’ signs, elseNone.
- get_xlabel()¶
Return x-coordinate label.
- get_ylabel()¶
Return y-coordinate label.
- property latex¶
Return latex (e.g., for the quadrupole, \(\ell = 2\)).
- 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 projection attributes in
kwargs.
- setdefault(**kwargs)¶
Set attributes
kwargsif current values areNone.