firecrown.metadata_functions
This module deals with two-point metadata functions.
It contains functions used to manipulate two-point metadata, including extracting metadata from a sacc file and creating new metadata objects.
Attributes
Functions
|
Create a Measurement object from a dictionary. |
|
Create a Measurement object from a dictionary. |
|
Create a dictionary from a Measurement object. |
|
Create a dictionary from a Measurement object. |
|
Use the naming convention to assign the right measurement to each tracer. |
|
Extracts the two-point function metadata from a Sacc object. |
|
Extracts the two-point function metadata from a Sacc object. |
|
Extract all two-point function metadata from a sacc file. |
|
Extracts the two-point function metadata from a sacc file. |
|
Extract the two-point function metadata and data from a sacc file. |
|
Extract the two-point function metadata and data from a sacc file. |
|
Extracts the two-point function metadata from a sacc file. |
|
Extract ells and weights for a window function. |
|
Extract the two-point function metadata from a sacc file. |
|
Build a TwoPointXY object from the inferred galaxy z distributions. |
|
Return the measurements from a TwoPointXiThetaIndex object. |
Module Contents
- firecrown.metadata_functions.TwoPointRealIndex
- firecrown.metadata_functions.TwoPointHarmonicIndex
- firecrown.metadata_functions.make_measurement(value)[source]
Create a Measurement object from a dictionary.
- Parameters:
value (firecrown.metadata_types.Measurement | dict[str, Any])
- Return type:
firecrown.metadata_types.Measurement
- firecrown.metadata_functions.make_measurements(value)[source]
Create a Measurement object from a dictionary.
- Parameters:
value (set[firecrown.metadata_types.Measurement] | list[dict[str, Any]])
- Return type:
set[firecrown.metadata_types.Measurement]
- firecrown.metadata_functions.make_measurement_dict(value)[source]
Create a dictionary from a Measurement object.
- Parameters:
value (firecrown.metadata_types.Measurement) – the measurement to turn into a dictionary
- Return type:
dict[str, str]
- firecrown.metadata_functions.make_measurements_dict(value)[source]
Create a dictionary from a Measurement object.
- Parameters:
value (set[firecrown.metadata_types.Measurement]) – the measurement to turn into a dictionary
- Return type:
list[dict[str, str]]
- firecrown.metadata_functions.match_name_type(tracer1, tracer2, a, b, require_convetion=False)[source]
Use the naming convention to assign the right measurement to each tracer.
- Parameters:
tracer1 (str)
tracer2 (str)
a (firecrown.metadata_types.Measurement)
b (firecrown.metadata_types.Measurement)
require_convetion (bool)
- Return type:
tuple[bool, str, firecrown.metadata_types.Measurement, str, firecrown.metadata_types.Measurement]
- firecrown.metadata_functions.extract_all_tracers_inferred_galaxy_zdists(sacc_data, include_maybe_types=False)[source]
Extracts the two-point function metadata from a Sacc object.
The Sacc object contains a set of tracers (one-dimensional bins) and data points (measurements of the correlation between two tracers).
This function extracts the two-point function metadata from the Sacc object and returns it in a list.
- Parameters:
sacc_data (sacc.Sacc)
- Return type:
- firecrown.metadata_functions.extract_all_measured_types(sacc_data, include_maybe_types=False)[source]
Extracts the two-point function metadata from a Sacc object.
The Sacc object contains a set of tracers (one-dimensional bins) and data points (measurements of the correlation between two tracers).
This function extracts the two-point function metadata from the Sacc object and returns it in a list.
- Parameters:
sacc_data (sacc.Sacc)
include_maybe_types (bool)
- Return type:
dict[str, set[firecrown.metadata_types.Measurement]]
- firecrown.metadata_functions.extract_all_real_metadata_indices(sacc_data, allowed_data_type=None)[source]
Extract all two-point function metadata from a sacc file.
Extracts the two-point function measurement metadata for all measurements made in real space from a Sacc object.
- Parameters:
sacc_data (sacc.Sacc)
allowed_data_type (None | list[str])
- Return type:
list[TwoPointRealIndex]
- firecrown.metadata_functions.extract_all_harmonic_metadata_indices(sacc_data, allowed_data_type=None)[source]
Extracts the two-point function metadata from a sacc file.
- Parameters:
sacc_data (sacc.Sacc)
allowed_data_type (None | list[str])
- Return type:
list[TwoPointHarmonicIndex]
- firecrown.metadata_functions.extract_all_harmonic_metadata(sacc_data, allowed_data_type=None, include_maybe_types=False)[source]
Extract the two-point function metadata and data from a sacc file.
- Parameters:
sacc_data (sacc.Sacc)
allowed_data_type (None | list[str])
- Return type:
- firecrown.metadata_functions.extract_all_real_metadata(sacc_data, allowed_data_type=None, include_maybe_types=False)[source]
Extract the two-point function metadata and data from a sacc file.
- Parameters:
sacc_data (sacc.Sacc)
allowed_data_type (None | list[str])
- Return type:
- firecrown.metadata_functions.extract_all_photoz_bin_combinations(sacc_data, include_maybe_types=False)[source]
Extracts the two-point function metadata from a sacc file.
- Parameters:
sacc_data (sacc.Sacc)
include_maybe_types (bool)
- Return type:
- firecrown.metadata_functions.extract_window_function(sacc_data, indices)[source]
Extract ells and weights for a window function.
- Params sacc_data:
the Sacc object from which we read.
- Params indices:
the indices of the data points in the Sacc object which are computed by the window function.
- Returns:
the ells and weights of the window function that match the given indices from a sacc object, or a tuple of (None, None) if the indices represent the measured Cells directly.
- Parameters:
sacc_data (sacc.Sacc)
indices (numpy.typing.NDArray[numpy.int64])
- Return type:
tuple[None | numpy.typing.NDArray[numpy.int64], None | numpy.typing.NDArray[numpy.float64]]
- firecrown.metadata_functions.make_all_photoz_bin_combinations(inferred_galaxy_zdists)[source]
Extract the two-point function metadata from a sacc file.
- Parameters:
inferred_galaxy_zdists (list[firecrown.metadata_types.InferredGalaxyZDist])
- Return type:
- firecrown.metadata_functions.make_two_point_xy(inferred_galaxy_zdists_dict, tracer_names, data_type)[source]
Build a TwoPointXY object from the inferred galaxy z distributions.
The TwoPointXY object is built from the inferred galaxy z distributions, the data type, and the tracer names.
- Parameters:
inferred_galaxy_zdists_dict (dict[str, firecrown.metadata_types.InferredGalaxyZDist]) – a dictionary of inferred galaxy z distributions.
tracer_names (firecrown.metadata_types.TracerNames) – a tuple of tracer names.
data_type (str) – the data type.
- Returns:
a TwoPointXY object.
- Return type: