firecrown.likelihood.number_counts
Number counts source and systematics.
Attributes
Classes
Class for number counts tracer builder argument. |
|
Abstract base class for systematics for Number Counts sources. |
|
Photo-z shift systematic. |
|
Photo-z shift systematic. |
|
Systematic to select 3D field. |
|
Linear bias systematic. |
|
Non-linear bias systematic. |
|
Magnification bias systematic. |
|
Simple constant magnification bias systematic. |
|
Source class for number counts. |
|
Factory class for LinearBiasSystematic objects. |
|
Factory class for PTNonLinearBiasSystematic objects. |
|
Factory class for MagnificationBiasSystematic objects. |
|
Factory class for ConstantMagnificationBiasSystematic objects. |
|
Factory class for NumberCounts objects. |
Module Contents
- class firecrown.likelihood.number_counts.NumberCountsArgs[source]
Bases:
firecrown.likelihood.source.SourceGalaxyArgs
Class for number counts tracer builder argument.
- bias: None | numpy.typing.NDArray[numpy.float64] = None
- mag_bias: None | tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]] = None
- has_pt: bool = False
- has_hm: bool = False
- b_2: None | tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]] = None
- b_s: None | tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]] = None
- class firecrown.likelihood.number_counts.NumberCountsSystematic(parameter_prefix=None)[source]
Bases:
firecrown.likelihood.source.SourceGalaxySystematic[NumberCountsArgs]
Abstract base class for systematics for Number Counts sources.
Derived classes must implement
apply()with the correct signature.- Parameters:
parameter_prefix (None | str)
- abstractmethod apply(tools, tracer_arg)[source]
Apply method to include systematics in the tracer_arg.
This does not modify the supplied tracer_arg; it returns a new one that has been updated.
- Parameters:
tools (firecrown.modeling_tools.ModelingTools) – the Modeling tools used to update the tracer_arg
tracer_arg (NumberCountsArgs) – the original NumberCountsArgs to which to apply the systematic
- Returns:
the updated NumberCountsArgs
- Return type:
- class firecrown.likelihood.number_counts.PhotoZShift(sacc_tracer, active=True)[source]
Bases:
firecrown.likelihood.source.SourceGalaxyPhotoZShift[NumberCountsArgs]
Photo-z shift systematic.
- Parameters:
sacc_tracer (str)
active (bool)
- class firecrown.likelihood.number_counts.PhotoZShiftandStretch(sacc_tracer, active=True)[source]
Bases:
firecrown.likelihood.source.SourceGalaxyPhotoZShiftandStretch[NumberCountsArgs]
Photo-z shift systematic.
- Parameters:
sacc_tracer (str)
active (bool)
- class firecrown.likelihood.number_counts.SelectField(field='delta_matter')[source]
Bases:
firecrown.likelihood.source.SourceGalaxySelectField[NumberCountsArgs]
Systematic to select 3D field.
- Parameters:
field (str)
- firecrown.likelihood.number_counts.LINEAR_BIAS_DEFAULT_ALPHAZ = 0.0
- firecrown.likelihood.number_counts.LINEAR_BIAS_DEFAULT_ALPHAG = 0.0
- firecrown.likelihood.number_counts.LINEAR_BIAS_DEFAULT_Z_PIV = 0.5
- class firecrown.likelihood.number_counts.LinearBiasSystematic(sacc_tracer)[source]
Bases:
NumberCountsSystematic
Linear bias systematic.
This systematic adds a linear bias model which varies with redshift and the growth function.
The following parameters are special Updatable parameters, which means that they can be updated by the sampler, sacc_tracer is going to be used as a prefix for the parameters:
- Variables:
alphaz – the redshift exponent of the bias.
alphag – the growth function exponent of the bias.
z_piv – the pivot redshift of the bias.
- Parameters:
sacc_tracer (str)
- alphaz
- alphag
- z_piv
- apply(tools, tracer_arg)[source]
Apply a linear bias systematic.
- Parameters:
tools (firecrown.modeling_tools.ModelingTools) – the ModelingTools used to update the tracer_arg
tracer_arg (NumberCountsArgs) – a NumberCountsArgs object with values to be updated
- Returns:
the updated NumberCountsArgs object
- Return type:
- firecrown.likelihood.number_counts.PT_NON_LINEAR_BIAS_DEFAULT_B_2 = 1.0
- firecrown.likelihood.number_counts.PT_NON_LINEAR_BIAS_DEFAULT_B_S = 1.0
- class firecrown.likelihood.number_counts.PTNonLinearBiasSystematic(sacc_tracer=None)[source]
Bases:
NumberCountsSystematic
Non-linear bias systematic.
This systematic adds a linear bias model which varies with redshift and the growth function.
The following parameters are special Updatable parameters, which means that they can be updated by the sampler, sacc_tracer is going to be used as a prefix for the parameters:
- Variables:
b_2 – the quadratic bias.
b_s – the stochastic bias.
- Parameters:
sacc_tracer (None | str)
- b_2
- b_s
- apply(tools, tracer_arg)[source]
Apply a non-linear bias systematic.
- Parameters:
tools (firecrown.modeling_tools.ModelingTools) – currently unused, but required by interface
tracer_arg (NumberCountsArgs) – a NumberCountsArgs object with values to be updated
- Returns:
the updated NumberCountsArgs object
- Return type:
- class firecrown.likelihood.number_counts.MagnificationBiasSystematic(sacc_tracer)[source]
Bases:
NumberCountsSystematic
Magnification bias systematic.
This systematic adds a magnification bias model for galaxy number contrast following Joachimi & Bridle (2010), arXiv:0911.2454.
The following parameters are special Updatable parameters, which means that they can be updated by the sampler, sacc_tracer is going to be used as a prefix for the parameters:
- Variables:
r_lim – the limiting magnitude.
sig_c – the intrinsic dispersion of the source redshift distribution.
eta – the slope of the luminosity function.
z_c – the characteristic redshift of the source distribution.
z_m – the slope of the source redshift distribution.
- Parameters:
sacc_tracer (str)
- r_lim
- sig_c
- eta
- z_c
- z_m
- apply(tools, tracer_arg)[source]
Apply a magnification bias systematic.
- Parameters:
tools (firecrown.modeling_tools.ModelingTools) – currently unused, but required by the interface
tracer_arg (NumberCountsArgs) – a NumberCountsArgs object with values to be updated
- Returns:
an updated NumberCountsArgs object
- Return type:
- firecrown.likelihood.number_counts.CONSTANT_MAGNIFICATION_BIAS_DEFAULT_MAG_BIAS = 1.0
- class firecrown.likelihood.number_counts.ConstantMagnificationBiasSystematic(sacc_tracer)[source]
Bases:
NumberCountsSystematic
Simple constant magnification bias systematic.
This systematic adds a constant magnification bias model for galaxy number contrast.
The following parameters are special Updatable parameters, which means that they can be updated by the sampler, sacc_tracer is going to be used as a prefix for the parameters:
- Variables:
mag_bias – the magnification bias.
- Parameters:
sacc_tracer (str)
- mag_bias
- apply(tools, tracer_arg)[source]
Apply a constant magnification bias systematic.
- Parameters:
tools (firecrown.modeling_tools.ModelingTools) – currently unused, but required by interface
tracer_arg (NumberCountsArgs) – a NumberCountsArgs object with values to be updated
- Returns:
an updated NumberCountsArgs object
- Return type:
- firecrown.likelihood.number_counts.NUMBER_COUNTS_DEFAULT_BIAS = 1.5
- class firecrown.likelihood.number_counts.NumberCounts(*, sacc_tracer, has_rsd=False, derived_scale=False, scale=1.0, systematics=None)[source]
Bases:
firecrown.likelihood.source.SourceGalaxy[NumberCountsArgs]
Source class for number counts.
- Parameters:
sacc_tracer (str)
has_rsd (bool)
derived_scale (bool)
scale (float)
systematics (None | collections.abc.Sequence[firecrown.likelihood.source.SourceGalaxySystematic[NumberCountsArgs]])
- sacc_tracer
- has_rsd = False
- derived_scale = False
- bias
- systematics: firecrown.updatable.UpdatableCollection[firecrown.likelihood.source.SourceGalaxySystematic[NumberCountsArgs]]
- scale = 1.0
- current_tracer_args: None | NumberCountsArgs = None
- tracer_args: NumberCountsArgs
- classmethod create_ready(inferred_zdist, has_rsd=False, derived_scale=False, scale=1.0, systematics=None)[source]
Create a NumberCounts object with the given tracer name and scale.
This is the recommended way to create a NumberCounts object. It creates a fully initialized object.
- Parameters:
inferred_zdist (firecrown.metadata_types.InferredGalaxyZDist) – the inferred redshift distribution
has_rsd (bool) – whether to include RSD in the tracer
derived_scale (bool) – whether to include a derived parameter for the scale of the tracer
scale (float) – the initial scale of the tracer
systematics (None | list[firecrown.likelihood.source.SourceGalaxySystematic[NumberCountsArgs]]) – a list of systematics to apply to the tracer
- Returns:
a fully initialized NumberCounts object
- Return type:
- create_tracers(tools)[source]
Create the tracers for this source.
- Parameters:
tools (firecrown.modeling_tools.ModelingTools) – the ModelingTools used to create the tracers
- Returns:
a tuple of tracers and the updated tracer_args
- Return type:
tuple[list[firecrown.likelihood.source.Tracer], NumberCountsArgs]
- class firecrown.likelihood.number_counts.LinearBiasSystematicFactory(/, **data)[source]
Bases:
pydantic.BaseModel
Factory class for LinearBiasSystematic objects.
- Parameters:
data (Any)
- model_config
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- type: Annotated[Literal['LinearBiasSystematicFactory'], Field(description='The type of the systematic.')] = 'LinearBiasSystematicFactory'
- create(bin_name)[source]
Create a LinearBiasSystematic object with the given tracer name.
- Parameters:
bin_name (str)
- Return type:
- class firecrown.likelihood.number_counts.PTNonLinearBiasSystematicFactory(/, **data)[source]
Bases:
pydantic.BaseModel
Factory class for PTNonLinearBiasSystematic objects.
- Parameters:
data (Any)
- model_config
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- type: Annotated[Literal['PTNonLinearBiasSystematicFactory'], Field(description='The type of the systematic.')] = 'PTNonLinearBiasSystematicFactory'
- create(bin_name)[source]
Create a PTNonLinearBiasSystematic object with the given tracer name.
- Parameters:
bin_name (str) – the name of the bin
- Returns:
the created PTNonLinearBiasSystematic object
- Return type:
- class firecrown.likelihood.number_counts.MagnificationBiasSystematicFactory(/, **data)[source]
Bases:
pydantic.BaseModel
Factory class for MagnificationBiasSystematic objects.
- Parameters:
data (Any)
- model_config
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- type: Annotated[Literal['MagnificationBiasSystematicFactory'], Field(description='The type of the systematic.')] = 'MagnificationBiasSystematicFactory'
- create(bin_name)[source]
Create a MagnificationBiasSystematic object with the given tracer name.
- Parameters:
bin_name (str) – the name of the bin
- Returns:
the created MagnificationBiasSystematic object
- Return type:
- class firecrown.likelihood.number_counts.ConstantMagnificationBiasSystematicFactory(/, **data)[source]
Bases:
pydantic.BaseModel
Factory class for ConstantMagnificationBiasSystematic objects.
- Parameters:
data (Any)
- model_config
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- type: Annotated[Literal['ConstantMagnificationBiasSystematicFactory'], Field(description='The type of the systematic.')] = 'ConstantMagnificationBiasSystematicFactory'
- create(bin_name)[source]
Create a ConstantMagnificationBiasSystematic object.
- Parameters:
bin_name (str) – the name of the bin
- Returns:
the created ConstantMagnificationBiasSystematic object
- Return type:
- firecrown.likelihood.number_counts.NumberCountsSystematicFactory
- class firecrown.likelihood.number_counts.NumberCountsFactory(/, **data)[source]
Bases:
pydantic.BaseModel
Factory class for NumberCounts objects.
- Parameters:
data (Any)
- model_config
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- type_source: firecrown.metadata_types.TypeSource
- per_bin_systematics: collections.abc.Sequence[NumberCountsSystematicFactory] = None
- global_systematics: collections.abc.Sequence[NumberCountsSystematicFactory] = None
- include_rsd: bool = False
- create(inferred_zdist)[source]
Create a NumberCounts object with the given tracer name and scale.
- Parameters:
inferred_zdist (firecrown.metadata_types.InferredGalaxyZDist) – the inferred redshift distribution
- Returns:
a fully initialized NumberCounts object
- Return type: