firecrown.likelihood.weak_lensing ================================= .. py:module:: firecrown.likelihood.weak_lensing .. autoapi-nested-parse:: Weak lensing source and systematics. Attributes ---------- .. autoapisummary:: firecrown.likelihood.weak_lensing.MULTIPLICATIVE_SHEAR_BIAS_DEFAULT_BIAS firecrown.likelihood.weak_lensing.LINEAR_ALIGNMENT_DEFAULT_IA_BIAS firecrown.likelihood.weak_lensing.LINEAR_ALIGNMENT_DEFAULT_ALPHAZ firecrown.likelihood.weak_lensing.LINEAR_ALIGNMENT_DEFAULT_ALPHAG firecrown.likelihood.weak_lensing.LINEAR_ALIGNMENT_DEFAULT_Z_PIV firecrown.likelihood.weak_lensing.TATT_ALIGNMENT_DEFAULT_IA_A_1 firecrown.likelihood.weak_lensing.TATT_ALIGNMENT_DEFAULT_IA_A_2 firecrown.likelihood.weak_lensing.TATT_ALIGNMENT_DEFAULT_IA_A_D firecrown.likelihood.weak_lensing.HM_ALIGNMENT_DEFAULT_IA_A_1H firecrown.likelihood.weak_lensing.HM_ALIGNMENT_DEFAULT_IA_A_2H firecrown.likelihood.weak_lensing.WeakLensingSystematicFactory Classes ------- .. autoapisummary:: firecrown.likelihood.weak_lensing.WeakLensingArgs firecrown.likelihood.weak_lensing.WeakLensingSystematic firecrown.likelihood.weak_lensing.PhotoZShiftandStretch firecrown.likelihood.weak_lensing.PhotoZShift firecrown.likelihood.weak_lensing.SelectField firecrown.likelihood.weak_lensing.MultiplicativeShearBias firecrown.likelihood.weak_lensing.LinearAlignmentSystematic firecrown.likelihood.weak_lensing.TattAlignmentSystematic firecrown.likelihood.weak_lensing.HMAlignmentSystematic firecrown.likelihood.weak_lensing.WeakLensing firecrown.likelihood.weak_lensing.MultiplicativeShearBiasFactory firecrown.likelihood.weak_lensing.LinearAlignmentSystematicFactory firecrown.likelihood.weak_lensing.TattAlignmentSystematicFactory firecrown.likelihood.weak_lensing.WeakLensingFactory Module Contents --------------- .. py:class:: WeakLensingArgs Bases: :py:obj:`firecrown.likelihood.source.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:: 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:: WeakLensingSystematic(parameter_prefix = None) Bases: :py:obj:`firecrown.likelihood.source.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:: PhotoZShiftandStretch(sacc_tracer, active = True) Bases: :py:obj:`firecrown.likelihood.source.SourceGalaxyPhotoZShiftandStretch`\ [\ :py:obj:`WeakLensingArgs`\ ] .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.PhotoZShiftandStretch :parts: 1 Photo-z shift systematic. .. py:class:: PhotoZShift(sacc_tracer, active = True) Bases: :py:obj:`firecrown.likelihood.source.SourceGalaxyPhotoZShift`\ [\ :py:obj:`WeakLensingArgs`\ ] .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.PhotoZShift :parts: 1 Photo-z shift systematic. .. py:class:: SelectField(field = 'delta_matter') Bases: :py:obj:`firecrown.likelihood.source.SourceGalaxySelectField`\ [\ :py:obj:`WeakLensingArgs`\ ] .. autoapi-inheritance-diagram:: firecrown.likelihood.weak_lensing.SelectField :parts: 1 Systematic to select 3D field. .. py:data:: MULTIPLICATIVE_SHEAR_BIAS_DEFAULT_BIAS :value: 1.0 .. 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. :returns: A new WeakLensingArgs object with the shear bias applied. .. py:data:: LINEAR_ALIGNMENT_DEFAULT_IA_BIAS :value: 0.5 .. py:data:: LINEAR_ALIGNMENT_DEFAULT_ALPHAZ :value: 0.0 .. py:data:: LINEAR_ALIGNMENT_DEFAULT_ALPHAG :value: 1.0 .. py:data:: LINEAR_ALIGNMENT_DEFAULT_Z_PIV :value: 0.5 .. 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:data:: TATT_ALIGNMENT_DEFAULT_IA_A_1 :value: 1.0 .. py:data:: TATT_ALIGNMENT_DEFAULT_IA_A_2 :value: 0.5 .. py:data:: TATT_ALIGNMENT_DEFAULT_IA_A_D :value: 0.5 .. py:class:: TattAlignmentSystematic(sacc_tracer = None) 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 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_a_2: the amplitude of the quadratic alignment model. :ivar ia_a_d: the amplitude of the density-dependent alignment model. .. py:attribute:: ia_a_1 .. py:attribute:: ia_a_2 .. py:attribute:: ia_a_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:data:: HM_ALIGNMENT_DEFAULT_IA_A_1H :value: 0.0001 .. py:data:: HM_ALIGNMENT_DEFAULT_IA_A_2H :value: 1.0 .. 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. :returns: A new WeakLensingArgs object with the systematic applied. .. py:class:: WeakLensing(*, sacc_tracer, scale = 1.0, systematics = None) Bases: :py:obj:`firecrown.likelihood.source.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:: 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:: 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:: 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: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:data:: WeakLensingSystematicFactory .. 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: Sequence[WeakLensingSystematicFactory] :value: None .. py:attribute:: global_systematics :type: 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.