firecrown.likelihood.weak_lensing

Weak lensing source and systematics.

This subpackage provides weak lensing source classes and systematics for use in likelihood calculations.

Classes

HMAlignmentSystematic

Halo model intrinsic alignment systematic.

LinearAlignmentSystematic

Linear alignment systematic.

MassDependentLinearAlignmentSystematic

Mass-dependent linear alignment systematic.

LinearAlignmentSystematicFactory

Factory class for LinearAlignmentSystematic objects.

MultiplicativeShearBias

Multiplicative shear bias systematic.

MultiplicativeShearBiasFactory

Factory class for MultiplicativeShearBias objects.

PhotoZShift

Photo-z shift systematic.

PhotoZShiftandStretch

Photo-z shift systematic.

SelectField

Systematic to select 3D field.

TattAlignmentSystematic

TATT alignment systematic.

TattAlignmentSystematicFactory

Factory class for TattAlignmentSystematic objects.

WeakLensing

Source class for weak lensing.

WeakLensingArgs

Class for weak lensing tracer builder argument.

WeakLensingFactory

Factory class for WeakLensing objects.

WeakLensingSystematic

Abstract base class for all weak lensing systematics.

PhotoZShiftFactory

Factory class for PhotoZShift objects.

PhotoZShiftandStretchFactory

Factory class for PhotoZShiftandStretch objects.

Package Contents

class firecrown.likelihood.weak_lensing.HMAlignmentSystematic(_=None)

Bases: WeakLensingSystematic

Inheritance diagram of firecrown.likelihood.weak_lensing.HMAlignmentSystematic

Halo model intrinsic alignment systematic.

This systematic adds a halo model based intrinsic alignment systematic which, at the moment, is fixed within the redshift bin.

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:
  • ia_a_1h – the 1-halo intrinsic alignment bias parameter (satellite galaxies).

  • ia_a_2h – the 2-halo intrinsic alignment bias parameter (central galaxies).

Parameters:

_ (None | str)

ia_a_1h
ia_a_2h
apply(tools, tracer_arg)

Return a new halo-model alignment systematic.

Parameters:
Returns:

A new WeakLensingArgs object with the systematic applied.

Return type:

WeakLensingArgs

class firecrown.likelihood.weak_lensing.LinearAlignmentSystematic(sacc_tracer=None, alphag=1.0)

Bases: WeakLensingSystematic

Inheritance diagram of firecrown.likelihood.weak_lensing.LinearAlignmentSystematic

Linear alignment systematic.

This systematic adds a linear intrinsic alignment model systematic 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:
  • ia_bias – the intrinsic alignment bias parameter.

  • alphaz – the redshift dependence of the intrinsic alignment bias.

  • alphag – the growth function dependence of the intrinsic alignment bias.

  • z_piv – the pivot redshift for the intrinsic alignment bias.

Parameters:
  • sacc_tracer (None | str)

  • alphag (None | float)

ia_bias
alphaz
alphag
z_piv
apply(tools, tracer_arg)

Return a new linear alignment systematic.

This choice is based on the given tracer_arg, in the context of the given cosmology.

Parameters:
Return type:

WeakLensingArgs

class firecrown.likelihood.weak_lensing.MassDependentLinearAlignmentSystematic(sacc_tracer=None)

Bases: WeakLensingSystematic

Inheritance diagram of firecrown.likelihood.weak_lensing.MassDependentLinearAlignmentSystematic

Mass-dependent linear alignment systematic.

Adds a linear intrinsic alignment model systematic the amplitude of which depends on the assumed model mass scaling, red fraction, and average halo mass of the tracer. Blue galaxies are assumed to have zero intrinsic alignment amplitude.

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:
  • ia_amplitude – the intrinsic alignment amplitude at the pivot halo mass.

  • ia_mass_scaling – the power-law index of the model’s mass scaling.

  • red_fraction – the red galaxy fraction of the tracer sample.

  • log10_average_halo_mass – the 10-base logarithm of the average halo mass of the tracer sample (mass should be given in units of solar mass / h).

Parameters:

sacc_tracer (None | str)

The following parameter is an InternalParameter that will not be provided by the sampler, instead the value given will be used throughout all calculations:

Variables:

pivot_log10_halo_mass – the log10-base of the pivot halo mass of the model (default=13.5, pivot mass in M_sun/h).

Parameters:

sacc_tracer (None | str)

ia_amplitude
ia_mass_scaling
red_fraction
log10_average_halo_mass
pivot_log10_halo_mass
apply(tools, tracer_arg)

Return a mass-dependent linear alignment systematic.

This choice is based on the given tracer_arg, in the context of the given cosmology.

Parameters:
Return type:

WeakLensingArgs

class firecrown.likelihood.weak_lensing.LinearAlignmentSystematicFactory(/, **data)

Bases: pydantic.BaseModel

Inheritance diagram of firecrown.likelihood.weak_lensing.LinearAlignmentSystematicFactory

Factory class for LinearAlignmentSystematic objects.

Parameters:

data (Any)

model_config

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

type: Annotated[Literal['LinearAlignmentSystematicFactory'], Field(description='The type of the systematic.')] = 'LinearAlignmentSystematicFactory'
alphag: None | float = 1.0
create(bin_name)

Create a LinearAlignmentSystematic object.

Parameters:
  • inferred_zdist – The inferred galaxy redshift distribution for the created LinearAlignmentSystematic object.

  • bin_name (str)

Returns:

The created LinearAlignmentSystematic object.

Return type:

LinearAlignmentSystematic

create_global()

Create a LinearAlignmentSystematic object.

Returns:

The created LinearAlignmentSystematic object.

Return type:

LinearAlignmentSystematic

class firecrown.likelihood.weak_lensing.MultiplicativeShearBias(sacc_tracer)

Bases: WeakLensingSystematic

Inheritance diagram of firecrown.likelihood.weak_lensing.MultiplicativeShearBias

Multiplicative shear bias systematic.

This systematic adjusts the scale_ of a source by (1 + m).

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:

mult_bias – the multiplicative shear bias parameter.

Parameters:

sacc_tracer (str)

mult_bias
apply(tools, tracer_arg)

Apply multiplicative shear bias to a source.

The scale_ of the source is multiplied by (1 + m).

Parameters:
Returns:

A new WeakLensingArgs object with the shear bias applied.

Return type:

WeakLensingArgs

class firecrown.likelihood.weak_lensing.MultiplicativeShearBiasFactory(/, **data)

Bases: pydantic.BaseModel

Inheritance diagram of firecrown.likelihood.weak_lensing.MultiplicativeShearBiasFactory

Factory class for MultiplicativeShearBias objects.

Parameters:

data (Any)

model_config

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

type: Annotated[Literal['MultiplicativeShearBiasFactory'], Field(description='The type of the systematic.')] = 'MultiplicativeShearBiasFactory'
create(bin_name)

Create a MultiplicativeShearBias object.

Parameters:
  • inferred_zdist – The inferred galaxy redshift distribution for the created MultiplicativeShearBias object.

  • bin_name (str)

Returns:

The created MultiplicativeShearBias object.

Return type:

MultiplicativeShearBias

create_global()

Create a MultiplicativeShearBias object.

Returns:

The created MultiplicativeShearBias object.

Return type:

MultiplicativeShearBias

class firecrown.likelihood.weak_lensing.PhotoZShift(sacc_tracer, active=True)

Bases: firecrown.likelihood._base.SourceGalaxyPhotoZShift[WeakLensingArgs]

Inheritance diagram of firecrown.likelihood.weak_lensing.PhotoZShift

Photo-z shift systematic.

Parameters:
  • sacc_tracer (str)

  • active (bool)

class firecrown.likelihood.weak_lensing.PhotoZShiftandStretch(sacc_tracer, active=True)

Bases: firecrown.likelihood._base.SourceGalaxyPhotoZShiftandStretch[WeakLensingArgs]

Inheritance diagram of firecrown.likelihood.weak_lensing.PhotoZShiftandStretch

Photo-z shift systematic.

Parameters:
  • sacc_tracer (str)

  • active (bool)

class firecrown.likelihood.weak_lensing.SelectField(field='delta_matter')

Bases: firecrown.likelihood._base.SourceGalaxySelectField[WeakLensingArgs]

Inheritance diagram of firecrown.likelihood.weak_lensing.SelectField

Systematic to select 3D field.

Parameters:

field (str)

class firecrown.likelihood.weak_lensing.TattAlignmentSystematic(sacc_tracer=None, include_z_dependence=False)

Bases: WeakLensingSystematic

Inheritance diagram of firecrown.likelihood.weak_lensing.TattAlignmentSystematic

TATT alignment systematic.

This systematic adds a TATT (nonlinear) intrinsic alignment model systematic.

The amplitude of each contribution to the TATT model (i.e. linear, density-dependent, or quadratic terms) can be expressed as a function in redshift, parameterized by the relationship: $A_i times frac{1 + z}{1 + z_{piv,i}}^{alpha_i}$

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:
  • ia_a_1 – the amplitude of the linear alignment model.

  • ia_zpiv_1 – the pivot redshift of the linear alignment model.

  • ia_alphaz_1 – the redshift dependence of the linear alignment model.

  • ia_a_2 – the amplitude of the quadratic alignment model.

  • ia_zpiv_2 – the pivot redshift of the quadratic alignment model.

  • ia_alphaz_2 – the redshift dependence of the quadratic alignment model.

  • ia_a_d – the amplitude of the density-dependent alignment model.

  • ia_zpiv_d – the pivot redshift of the density-dependent alignment model.

  • ia_alphaz_d – the redshift dependence of the density-dependent alignment model.

Parameters:
  • sacc_tracer (None | str)

  • include_z_dependence (bool)

ia_a_1
ia_zpiv_1
ia_alphaz_1
ia_a_2
ia_zpiv_2
ia_alphaz_2
ia_a_d
ia_zpiv_d
ia_alphaz_d
apply(tools, tracer_arg)

Return a new linear alignment systematic.

This choice is based on the given tracer_arg, in the context of the given cosmology.

Parameters:
Return type:

WeakLensingArgs

class firecrown.likelihood.weak_lensing.TattAlignmentSystematicFactory(/, **data)

Bases: pydantic.BaseModel

Inheritance diagram of firecrown.likelihood.weak_lensing.TattAlignmentSystematicFactory

Factory class for TattAlignmentSystematic objects.

Parameters:

data (Any)

model_config

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

type: Annotated[Literal['TattAlignmentSystematicFactory'], Field(description='The type of the systematic.')] = 'TattAlignmentSystematicFactory'
include_z_dependence: bool = False
create(bin_name)

Create a TattAlignmentSystematic object.

Parameters:
  • inferred_zdist – The inferred galaxy redshift distribution for the created TattAlignmentSystematic object.

  • bin_name (str)

Returns:

The created TattAlignmentSystematic object.

Return type:

TattAlignmentSystematic

create_global()

Create a TattAlignmentSystematic object.

Returns:

The created TattAlignmentSystematic object.

Return type:

TattAlignmentSystematic

class firecrown.likelihood.weak_lensing.WeakLensing(*, sacc_tracer, scale=1.0, systematics=None)

Bases: firecrown.likelihood._base.SourceGalaxy[WeakLensingArgs]

Inheritance diagram of firecrown.likelihood.weak_lensing.WeakLensing

Source class for weak lensing.

Parameters:
  • sacc_tracer (str)

  • scale (float)

  • systematics (None | collections.abc.Sequence[firecrown.likelihood._base.SourceGalaxySystematic[WeakLensingArgs]])

sacc_tracer
scale = 1.0
current_tracer_args: None | WeakLensingArgs = None
tracer_args: WeakLensingArgs
classmethod create_ready(inferred_zdist, systematics=None)

Create a WeakLensing object with the given tracer name and scale.

Parameters:
Return type:

WeakLensing

create_tracers(tools)

Render a source by applying systematics.

Parameters:

tools (firecrown.modeling_tools.ModelingTools)

get_scale()

Returns the scales for this Source.

class firecrown.likelihood.weak_lensing.WeakLensingArgs

Bases: firecrown.likelihood._base.SourceGalaxyArgs

Inheritance diagram of firecrown.likelihood.weak_lensing.WeakLensingArgs

Class for weak lensing tracer builder argument.

ia_bias: None | tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]] = None
ia_amplitude: None | numpy.float64 = None
ia_mass_scaling: None | numpy.float64 = None
red_fraction: None | numpy.float64 = None
log10_average_halo_mass: None | numpy.float64 = None
has_pt: bool = False
has_hm: bool = False
ia_pt_c_1: None | tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]] = None
ia_pt_c_d: None | tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]] = None
ia_pt_c_2: None | tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]] = None
ia_a_1h: None | numpy.typing.NDArray[numpy.float64] = None
ia_a_2h: None | numpy.typing.NDArray[numpy.float64] = None
class firecrown.likelihood.weak_lensing.WeakLensingFactory(/, **data)

Bases: pydantic.BaseModel

Inheritance diagram of firecrown.likelihood.weak_lensing.WeakLensingFactory

Factory class for WeakLensing 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[WeakLensingSystematicFactory] = None
global_systematics: collections.abc.Sequence[WeakLensingSystematicFactory] = None
model_post_init(_, /)

Initialize the WeakLensingFactory object.

Return type:

None

create(inferred_zdist)

Create a WeakLensing object with the given tracer name and scale.

Parameters:

inferred_zdist (firecrown.metadata_types.InferredGalaxyZDist)

Return type:

WeakLensing

create_from_metadata_only(sacc_tracer)

Create an WeakLensing object with the given tracer name and scale.

Parameters:

sacc_tracer (str)

Return type:

WeakLensing

class firecrown.likelihood.weak_lensing.WeakLensingSystematic(parameter_prefix=None)

Bases: firecrown.likelihood._base.SourceGalaxySystematic[WeakLensingArgs]

Inheritance diagram of firecrown.likelihood.weak_lensing.WeakLensingSystematic

Abstract base class for all weak lensing systematics.

Parameters:

parameter_prefix (None | str)

abstractmethod apply(tools, tracer_arg)

Apply method to include systematics in the tracer_arg.

Parameters:
Return type:

WeakLensingArgs

class firecrown.likelihood.weak_lensing.PhotoZShiftFactory(/, **data)

Bases: pydantic.BaseModel

Inheritance diagram of firecrown.likelihood.weak_lensing.PhotoZShiftFactory

Factory class for PhotoZShift objects.

Parameters:

data (Any)

model_config

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

type: Annotated[Literal['PhotoZShiftFactory'], Field(description='The type of the systematic.')] = 'PhotoZShiftFactory'
create(bin_name)

Create a PhotoZShift object with the given tracer name.

Parameters:

bin_name (str)

Return type:

PhotoZShift

create_global()

Create a PhotoZShift object with the given tracer name.

Return type:

PhotoZShift

class firecrown.likelihood.weak_lensing.PhotoZShiftandStretchFactory(/, **data)

Bases: pydantic.BaseModel

Inheritance diagram of firecrown.likelihood.weak_lensing.PhotoZShiftandStretchFactory

Factory class for PhotoZShiftandStretch objects.

Parameters:

data (Any)

model_config

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

type: Annotated[Literal['PhotoZShiftandStretchFactory'], Field(description='The type of the systematic.')] = 'PhotoZShiftandStretchFactory'
create(bin_name)

Create a PhotoZShiftandStretch object with the given tracer name.

Parameters:

bin_name (str)

Return type:

PhotoZShiftandStretch

create_global()

Create a PhotoZShiftandStretch object with the given tracer name.

Return type:

PhotoZShiftandStretch