firecrown.data_types

This module deals with data types.

This module contains data types definitions.

Classes

TwoPointMeasurement

Class defining the data for a two-point measurement.

DataVector

Wrapper for a np.ndarray that represents some observed data values.

TheoryVector

Wrapper for an np.ndarray that represents a prediction by some theory.

Functions

residuals(data, theory)

Return a bare np.ndarray with the difference between data and theory.

Module Contents

class firecrown.data_types.TwoPointMeasurement[source]

Bases: firecrown.utils.YAMLSerializable

Inheritance diagram of firecrown.data_types.TwoPointMeasurement

Class defining the data for a two-point measurement.

The class used to store the data for a two-point function measured on a sphere.

This includes the measured two-point function, their indices in the covariance matrix and the name of the covariance matrix. The corresponding metadata is also stored.

data: numpy.typing.NDArray[numpy.float64]
indices: numpy.typing.NDArray[numpy.int64]
covariance_name: str
metadata: firecrown.metadata_types.TwoPointReal | firecrown.metadata_types.TwoPointHarmonic
__post_init__()[source]

Make sure the data and indices have the same shape.

Return type:

None

__eq__(other)[source]

Equality test for TwoPointMeasurement objects.

Return type:

bool

is_real()[source]

Check if the metadata is real.

Return type:

bool

is_harmonic()[source]

Check if the metadata is harmonic.

Return type:

bool

class firecrown.data_types.DataVector[source]

Bases: numpy.typing.NDArray[numpy.float64]

Inheritance diagram of firecrown.data_types.DataVector

Wrapper for a np.ndarray that represents some observed data values.

classmethod create(vals)[source]

Create a DataVector that wraps a copy of the given array vals.

Parameters:

vals (numpy.typing.NDArray[numpy.float64]) – the array to be copied and wrapped

Returns:

a new DataVector

Return type:

DataVector

classmethod from_list(vals)[source]

Create a DataVector from the given list of floats.

Parameters:

vals (list[float]) – the list of floats

Returns:

a new DataVector

Return type:

DataVector

class firecrown.data_types.TheoryVector[source]

Bases: numpy.typing.NDArray[numpy.float64]

Inheritance diagram of firecrown.data_types.TheoryVector

Wrapper for an np.ndarray that represents a prediction by some theory.

classmethod create(vals)[source]

Create a TheoryVector that wraps a copy of the given array vals.

Parameters:

vals (numpy.typing.NDArray[numpy.float64]) – the array to be copied and wrapped

Returns:

a new TheoryVector

Return type:

TheoryVector

classmethod from_list(vals)[source]

Create a TheoryVector from the given list of floats.

Parameters:

vals (list[float]) – the list of floats

Returns:

a new TheoryVector

Return type:

TheoryVector

firecrown.data_types.residuals(data, theory)[source]

Return a bare np.ndarray with the difference between data and theory.

This is to be preferred to using arithmetic on the vectors directly.

Parameters:
Return type:

numpy.typing.NDArray[numpy.float64]