firecrown.likelihood.weak_lensing ================================= .. py:module:: firecrown.likelihood.weak_lensing .. autoapi-nested-parse:: Weak lensing source and systematics. This subpackage provides weak lensing source classes and systematics for use in likelihood calculations. Classes ------- .. autoapisummary:: firecrown.likelihood.weak_lensing.HMAlignmentSystematic firecrown.likelihood.weak_lensing.LinearAlignmentSystematic firecrown.likelihood.weak_lensing.MassDependentLinearAlignmentSystematic firecrown.likelihood.weak_lensing.LinearAlignmentSystematicFactory firecrown.likelihood.weak_lensing.MultiplicativeShearBias firecrown.likelihood.weak_lensing.MultiplicativeShearBiasFactory firecrown.likelihood.weak_lensing.PhotoZShift firecrown.likelihood.weak_lensing.PhotoZShiftandStretch firecrown.likelihood.weak_lensing.SelectField firecrown.likelihood.weak_lensing.TattAlignmentSystematic firecrown.likelihood.weak_lensing.TattAlignmentSystematicFactory firecrown.likelihood.weak_lensing.WeakLensing firecrown.likelihood.weak_lensing.WeakLensingArgs firecrown.likelihood.weak_lensing.WeakLensingFactory firecrown.likelihood.weak_lensing.WeakLensingSystematic firecrown.likelihood.weak_lensing.PhotoZShiftFactory firecrown.likelihood.weak_lensing.PhotoZShiftandStretchFactory Package Contents ---------------- .. py:class:: HMAlignmentSystematic(_ = None) Bases: :py:obj:`WeakLensingSystematic` .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.HMAlignmentSystematic :parts: 1 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: :ivar ia_a_1h: the 1-halo intrinsic alignment bias parameter (satellite galaxies). :ivar ia_a_2h: the 2-halo intrinsic alignment bias parameter (central galaxies). .. py:attribute:: ia_a_1h .. py:attribute:: ia_a_2h .. py:method:: apply(tools, tracer_arg) Return a new halo-model alignment systematic. :param tools: A ModelingTools object. :param tracer_arg: The WeakLensingArgs to which apply the systematic. :return: A new WeakLensingArgs object with the systematic applied. .. py:class:: LinearAlignmentSystematic(sacc_tracer = None, alphag = 1.0) Bases: :py:obj:`WeakLensingSystematic` .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.LinearAlignmentSystematic :parts: 1 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: :ivar ia_bias: the intrinsic alignment bias parameter. :ivar alphaz: the redshift dependence of the intrinsic alignment bias. :ivar alphag: the growth function dependence of the intrinsic alignment bias. :ivar z_piv: the pivot redshift for the intrinsic alignment bias. .. py:attribute:: ia_bias .. py:attribute:: alphaz .. py:attribute:: alphag .. py:attribute:: z_piv .. py:method:: 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. .. py:class:: MassDependentLinearAlignmentSystematic(sacc_tracer = None) Bases: :py:obj:`WeakLensingSystematic` .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.MassDependentLinearAlignmentSystematic :parts: 1 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: :ivar ia_amplitude: the intrinsic alignment amplitude at the pivot halo mass. :ivar ia_mass_scaling: the power-law index of the model's mass scaling. :ivar red_fraction: the red galaxy fraction of the tracer sample. :ivar 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). The following parameter is an InternalParameter that will not be provided by the sampler, instead the value given will be used throughout all calculations: :ivar pivot_log10_halo_mass: the log10-base of the pivot halo mass of the model (default=13.5, pivot mass in M_sun/h). .. py:attribute:: ia_amplitude .. py:attribute:: ia_mass_scaling .. py:attribute:: red_fraction .. py:attribute:: log10_average_halo_mass .. py:attribute:: pivot_log10_halo_mass .. py:method:: 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. .. py:class:: LinearAlignmentSystematicFactory(/, **data) Bases: :py:obj:`pydantic.BaseModel` .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.LinearAlignmentSystematicFactory :parts: 1 Factory class for LinearAlignmentSystematic objects. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: type :type: Annotated[Literal['LinearAlignmentSystematicFactory'], Field(description='The type of the systematic.')] :value: 'LinearAlignmentSystematicFactory' .. py:attribute:: alphag :type: None | float :value: 1.0 .. py:method:: create(bin_name) Create a LinearAlignmentSystematic object. :param inferred_zdist: The inferred galaxy redshift distribution for the created LinearAlignmentSystematic object. :return: The created LinearAlignmentSystematic object. .. py:method:: create_global() Create a LinearAlignmentSystematic object. :return: The created LinearAlignmentSystematic object. .. py:class:: MultiplicativeShearBias(sacc_tracer) Bases: :py:obj:`WeakLensingSystematic` .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.MultiplicativeShearBias :parts: 1 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: :ivar mult_bias: the multiplicative shear bias parameter. .. py:attribute:: mult_bias .. py:method:: apply(tools, tracer_arg) Apply multiplicative shear bias to a source. The `scale_` of the source is multiplied by `(1 + m)`. :param tools: A ModelingTools object. :param tracer_arg: The WeakLensingArgs to which apply the shear bias. :return: A new WeakLensingArgs object with the shear bias applied. .. py:class:: MultiplicativeShearBiasFactory(/, **data) Bases: :py:obj:`pydantic.BaseModel` .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.MultiplicativeShearBiasFactory :parts: 1 Factory class for MultiplicativeShearBias objects. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: type :type: Annotated[Literal['MultiplicativeShearBiasFactory'], Field(description='The type of the systematic.')] :value: 'MultiplicativeShearBiasFactory' .. py:method:: create(bin_name) Create a MultiplicativeShearBias object. :param inferred_zdist: The inferred galaxy redshift distribution for the created MultiplicativeShearBias object. :return: The created MultiplicativeShearBias object. .. py:method:: create_global() Create a MultiplicativeShearBias object. :return: The created MultiplicativeShearBias object. .. py:class:: PhotoZShift(sacc_tracer, active = True) Bases: :py:obj:`firecrown.likelihood._base.SourceGalaxyPhotoZShift`\ [\ :py:obj:`WeakLensingArgs`\ ] .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.PhotoZShift :parts: 1 Photo-z shift systematic. .. py:class:: PhotoZShiftandStretch(sacc_tracer, active = True) Bases: :py:obj:`firecrown.likelihood._base.SourceGalaxyPhotoZShiftandStretch`\ [\ :py:obj:`WeakLensingArgs`\ ] .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.PhotoZShiftandStretch :parts: 1 Photo-z shift systematic. .. py:class:: SelectField(field = 'delta_matter') Bases: :py:obj:`firecrown.likelihood._base.SourceGalaxySelectField`\ [\ :py:obj:`WeakLensingArgs`\ ] .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.SelectField :parts: 1 Systematic to select 3D field. .. py:class:: TattAlignmentSystematic(sacc_tracer = None, include_z_dependence = False) Bases: :py:obj:`WeakLensingSystematic` .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.TattAlignmentSystematic :parts: 1 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: :ivar ia_a_1: the amplitude of the linear alignment model. :ivar ia_zpiv_1: the pivot redshift of the linear alignment model. :ivar ia_alphaz_1: the redshift dependence of the linear alignment model. :ivar ia_a_2: the amplitude of the quadratic alignment model. :ivar ia_zpiv_2: the pivot redshift of the quadratic alignment model. :ivar ia_alphaz_2: the redshift dependence of the quadratic alignment model. :ivar ia_a_d: the amplitude of the density-dependent alignment model. :ivar ia_zpiv_d: the pivot redshift of the density-dependent alignment model. :ivar ia_alphaz_d: the redshift dependence of the density-dependent alignment model. .. py:attribute:: ia_a_1 .. py:attribute:: ia_zpiv_1 .. py:attribute:: ia_alphaz_1 .. py:attribute:: ia_a_2 .. py:attribute:: ia_zpiv_2 .. py:attribute:: ia_alphaz_2 .. py:attribute:: ia_a_d .. py:attribute:: ia_zpiv_d .. py:attribute:: ia_alphaz_d .. py:method:: 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. .. py:class:: TattAlignmentSystematicFactory(/, **data) Bases: :py:obj:`pydantic.BaseModel` .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.TattAlignmentSystematicFactory :parts: 1 Factory class for TattAlignmentSystematic objects. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: type :type: Annotated[Literal['TattAlignmentSystematicFactory'], Field(description='The type of the systematic.')] :value: 'TattAlignmentSystematicFactory' .. py:attribute:: include_z_dependence :type: bool :value: False .. py:method:: create(bin_name) Create a TattAlignmentSystematic object. :param inferred_zdist: The inferred galaxy redshift distribution for the created TattAlignmentSystematic object. :return: The created TattAlignmentSystematic object. .. py:method:: create_global() Create a TattAlignmentSystematic object. :return: The created TattAlignmentSystematic object. .. py:class:: WeakLensing(*, sacc_tracer, scale = 1.0, systematics = None) Bases: :py:obj:`firecrown.likelihood._base.SourceGalaxy`\ [\ :py:obj:`WeakLensingArgs`\ ] .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.WeakLensing :parts: 1 Source class for weak lensing. .. py:attribute:: sacc_tracer .. py:attribute:: scale :value: 1.0 .. py:attribute:: current_tracer_args :type: None | WeakLensingArgs :value: None .. py:attribute:: tracer_args :type: WeakLensingArgs .. py:method:: create_ready(inferred_zdist, systematics = None) :classmethod: Create a WeakLensing object with the given tracer name and scale. .. py:method:: create_tracers(tools) Render a source by applying systematics. .. py:method:: get_scale() Returns the scales for this Source. .. py:class:: WeakLensingArgs Bases: :py:obj:`firecrown.likelihood._base.SourceGalaxyArgs` .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.WeakLensingArgs :parts: 1 Class for weak lensing tracer builder argument. .. py:attribute:: ia_bias :type: None | tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]] :value: None .. py:attribute:: ia_amplitude :type: None | numpy.float64 :value: None .. py:attribute:: ia_mass_scaling :type: None | numpy.float64 :value: None .. py:attribute:: red_fraction :type: None | numpy.float64 :value: None .. py:attribute:: log10_average_halo_mass :type: None | numpy.float64 :value: None .. py:attribute:: has_pt :type: bool :value: False .. py:attribute:: has_hm :type: bool :value: False .. py:attribute:: ia_pt_c_1 :type: None | tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]] :value: None .. py:attribute:: ia_pt_c_d :type: None | tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]] :value: None .. py:attribute:: ia_pt_c_2 :type: None | tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]] :value: None .. py:attribute:: ia_a_1h :type: None | numpy.typing.NDArray[numpy.float64] :value: None .. py:attribute:: ia_a_2h :type: None | numpy.typing.NDArray[numpy.float64] :value: None .. py:class:: WeakLensingFactory(/, **data) Bases: :py:obj:`pydantic.BaseModel` .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.WeakLensingFactory :parts: 1 Factory class for WeakLensing objects. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: type_source :type: firecrown.metadata_types.TypeSource .. py:attribute:: per_bin_systematics :type: collections.abc.Sequence[WeakLensingSystematicFactory] :value: None .. py:attribute:: global_systematics :type: collections.abc.Sequence[WeakLensingSystematicFactory] :value: None .. py:method:: model_post_init(_, /) Initialize the WeakLensingFactory object. .. py:method:: create(inferred_zdist) Create a WeakLensing object with the given tracer name and scale. .. py:method:: create_from_metadata_only(sacc_tracer) Create an WeakLensing object with the given tracer name and scale. .. py:class:: WeakLensingSystematic(parameter_prefix = None) Bases: :py:obj:`firecrown.likelihood._base.SourceGalaxySystematic`\ [\ :py:obj:`WeakLensingArgs`\ ] .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.WeakLensingSystematic :parts: 1 Abstract base class for all weak lensing systematics. .. py:method:: apply(tools, tracer_arg) :abstractmethod: Apply method to include systematics in the tracer_arg. .. py:class:: PhotoZShiftFactory(/, **data) Bases: :py:obj:`pydantic.BaseModel` .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.PhotoZShiftFactory :parts: 1 Factory class for PhotoZShift objects. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: type :type: Annotated[Literal['PhotoZShiftFactory'], Field(description='The type of the systematic.')] :value: 'PhotoZShiftFactory' .. py:method:: create(bin_name) Create a PhotoZShift object with the given tracer name. .. py:method:: create_global() Create a PhotoZShift object with the given tracer name. .. py:class:: PhotoZShiftandStretchFactory(/, **data) Bases: :py:obj:`pydantic.BaseModel` .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.PhotoZShiftandStretchFactory :parts: 1 Factory class for PhotoZShiftandStretch objects. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: type :type: Annotated[Literal['PhotoZShiftandStretchFactory'], Field(description='The type of the systematic.')] :value: 'PhotoZShiftandStretchFactory' .. py:method:: create(bin_name) Create a PhotoZShiftandStretch object with the given tracer name. .. py:method:: create_global() Create a PhotoZShiftandStretch object with the given tracer name.