firecrown.generators.two_point

Generator support for TwoPoint statistics.

Classes

LogLinearElls

Generator for log-linear integral ell values.

EllOrThetaConfig

A dictionary of options for generating the ell or theta.

Functions

generate_bin_centers(*, minimum, maximum, n[, binning])

Return the centers of bins that span the range from minimum to maximum.

generate_ells_cells(ell_config)

Generate ells or theta values from the configuration dictionary.

generate_reals(theta_config)

Generate theta and xi values from the configuration dictionary.

Module Contents

class firecrown.generators.two_point.LogLinearElls(/, **data)[source]

Bases: pydantic.BaseModel

Inheritance diagram of firecrown.generators.two_point.LogLinearElls

Generator for log-linear integral ell values.

The initializer for LogLinearElls accepts only named parameters. A default value is provided for each parameter, which default is used if the parameter is not provided to the initializer.

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. All must be integers. All these conditions are verified in the initializer.

LogLinearElls objects are immutable, so they are safe to share and to use as default values for parameters.

Parameters:

data (Any)

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

minimum: Annotated[int, Field(ge=0)] = 2
midpoint: Annotated[int, Field(ge=0)] = 50
maximum: Annotated[int, Field(ge=0)] = 60000
n_log: Annotated[int, Field(ge=1)] = 200
require_increasing()[source]

Validate the ell values.

Return type:

LogLinearElls

generate(min_ell=None, max_ell=None)[source]

Generate the log-linear ell values.

This will use the object’s minimum, midpoint, maximum, and n_log, unless min_ell and max_ell are provided, in which case those will be used.

Parameters:
  • min_ell (int | None) – The low edge of the first bin.

  • max_ell (int | None) – The high edge of the last bin.

Returns:

The ell values.

Return type:

numpy.typing.NDArray[numpy.int64]

generate_all()[source]

Generate all ell values from minimum to maximum, inclusive.

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]

class firecrown.generators.two_point.EllOrThetaConfig[source]

Bases: TypedDict

Inheritance diagram of firecrown.generators.two_point.EllOrThetaConfig

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:
Returns:

ells and Cells