firecrown.generators.two_point
Generator support for TwoPoint statistics.
Attributes
Classes
Generator for log-linear integral ell values. |
|
A dictionary of options for generating the ell or theta. |
Functions
|
Create an array of ells to sample the power spectrum. |
|
Return the centers of bins that span the range from minimum to maximum. |
|
See log_linear_ells. |
|
Generate ells or theta values from the configuration dictionary. |
|
Generate theta and xi values from the configuration dictionary. |
|
Apply the minimum and maximum ell values to the ells and Cells. |
|
Apply the minimum and maximum theta values to the thetas and xis. |
Module Contents
- firecrown.generators.two_point.ELL_FOR_XI_DEFAULTS
- class firecrown.generators.two_point.LogLinearElls(/, **data)[source]
Bases:
pydantic.BaseModel
Generator for log-linear integral ell values.
Not all ell values will be generated. The result will contain each integral value from min to mid. Starting from mid, and going up to max, there will be n_log logarithmically spaced values.
Note that midpoint must be strictly greater than minimum, and strictly less than maximum. n_log must be positive.
- Parameters:
data (Any)
- minimum: Annotated[int, Field(ge=0)]
- midpoint: Annotated[int, Field(ge=0)]
- maximum: Annotated[int, Field(ge=0)]
- n_log: Annotated[int, Field(ge=1)]
- generate()[source]
Generate the log-linear ell values.
The result will contain each integral value from min to mid. Starting from mid, and going up to max, there will be n_log logarithmically spaced values.
- Parameters:
minimum – The low edge of the first bin.
midpoint – The high edge of the last in the linear range.
maximum – The high edge of the last bin.
n_log – The number of bins in the log section of the range.
- Return type:
numpy.typing.NDArray[numpy.int64]
- firecrown.generators.two_point.log_linear_ells(*, minimum, midpoint, maximum, n_log)[source]
Create an array of ells to sample the power spectrum.
This is used for for real-space predictions. The result will contain each integral value from min to mid. Starting from mid, and going up to max, there will be n_log logarithmically spaced values.
All values are rounded to the nearest integer.
- Parameters:
minimum (int) – The low edge of the first bin.
midpoint (int) – The high edge of the last in the linear range.
maximum (int) – The high edge of the last bin.
n_log (int) – The number of bins in the log section of the range.
- Return type:
numpy.typing.NDArray[numpy.int64]
- firecrown.generators.two_point.generate_bin_centers(*, minimum, maximum, n, binning='log')[source]
Return the centers of bins that span the range from minimum to maximum.
If binning is ‘log’, this will generate logarithmically spaced bins; if binning is ‘lin’, this will generate linearly spaced bins.
- Parameters:
minimum (float) – The low edge of the first bin.
maximum (float) – The high edge of the last bin.
n (int) – The number of bins.
binning (str) – Either ‘log’ or ‘lin’.
- Returns:
The centers of the bins.
- Return type:
numpy.typing.NDArray[numpy.float64]
- firecrown.generators.two_point.calculate_ells_for_interpolation(min_ell, max_ell)[source]
See log_linear_ells.
- This method mixes together:
the default parameters in ELL_FOR_XI_DEFAULTS
the first and last values in w.
and then calls log_linear_ells with those arguments, returning whatever it returns.
- Parameters:
min_ell (int)
max_ell (int)
- Return type:
numpy.typing.NDArray[numpy.int64]
- class firecrown.generators.two_point.EllOrThetaConfig[source]
Bases:
TypedDict
A dictionary of options for generating the ell or theta.
This dictionary contains the minimum, maximum and number of bins to generate the ell or theta values at which to compute the statistics.
- Parameters:
minimum – The start of the binning.
maximum – The end of the binning.
n – The number of bins.
binning – Pass ‘log’ to get logarithmic spaced bins and ‘lin’ to get linearly spaced bins. Default is ‘log’.
- minimum: float
- maximum: float
- n: int
- binning: str
- firecrown.generators.two_point.generate_ells_cells(ell_config)[source]
Generate ells or theta values from the configuration dictionary.
- Parameters:
ell_config (EllOrThetaConfig) – the configuration parameters.
- Returns:
ells and Cells
- firecrown.generators.two_point.generate_reals(theta_config)[source]
Generate theta and xi values from the configuration dictionary.
- Parameters:
ell_config – the configuration parameters.
theta_config (EllOrThetaConfig)
- Returns:
ells and Cells
- firecrown.generators.two_point.apply_ells_min_max(ells, Cells, indices, ell_min, ell_max)[source]
Apply the minimum and maximum ell values to the ells and Cells.
- Parameters:
ells (numpy.typing.NDArray[numpy.int64])
Cells (numpy.typing.NDArray[numpy.float64])
indices (None | numpy.typing.NDArray[numpy.int64])
ell_min (None | int)
ell_max (None | int)
- Return type:
tuple[numpy.typing.NDArray[numpy.int64], numpy.typing.NDArray[numpy.float64], None | numpy.typing.NDArray[numpy.int64]]
- firecrown.generators.two_point.apply_theta_min_max(thetas, xis, indices, theta_min, theta_max)[source]
Apply the minimum and maximum theta values to the thetas and xis.
- Parameters:
thetas (numpy.typing.NDArray[numpy.float64])
xis (numpy.typing.NDArray[numpy.float64])
indices (None | numpy.typing.NDArray[numpy.int64])
theta_min (None | float)
theta_max (None | float)
- Return type:
tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], None | numpy.typing.NDArray[numpy.int64]]