lib.data_vector.projection.ProjectionName

class lib.data_vector.projection.ProjectionName(*args, **kwargs)

Bases: cosmopipe.lib.utils.BaseNameSpace

Class 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 ProjectionName instance, which is copied.

  • kwargs (dict) – Dictionary of attribute values. If args is dictionary, is updated by kwargs.

Methods

as_dict

Return dictionary of attributes, droping those set to None if drop_none is True.

copy

Return copy, setting attributes kwargs on-the-fly.

deepcopy

eq_ignore_none

Is self equal to other, i.e. same type and attributes, ignoring attributes set to None?.

from_state

Instantiate and initalize class with state dictionary.

get

Return attribute name, defaulting to default.

get_projlabel

If mode is specified (i.e.

get_xlabel

Return x-coordinate label.

get_ylabel

Return y-coordinate label.

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

save

Save class to disk.

save_auto

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

set

Set projection attributes in kwargs.

setdefault

Set attributes kwargs if current values are None.

Attributes

CORRELATION

MUBIN

MULTIPOLE

MUWEDGE

PIWEDGE

POWER

latex

Return latex (e.g., for the quadrupole, \(\ell = 2\)).

logger

mpiattrs

MPI attributes

mpicomm

mpiroot

mpistate

sep

as_dict(drop_none=True)

Return dictionary of attributes, droping those set to None if drop_none is True.

copy(**kwargs)

Return copy, setting attributes kwargs on-the-fly.

eq_ignore_none(other)

Is self equal to other, i.e. same type and attributes, ignoring attributes set to None?

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

Instantiate and initalize class with state dictionary.

get(name, default=None)

Return attribute name, defaulting to default.

get_projlabel()

If mode is specified (i.e. not None), return latex surrounded by ‘$’ signs, else None.

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 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(**kwargs)

Set projection attributes in kwargs.

setdefault(**kwargs)

Set attributes kwargs if current values are None.