Skip to content

Overwriting a prior over-writes the upper / lower limits and resets them to +/- inf #1

@Jammy2211

Description

@Jammy2211

In AutoLens, we have a pass_priors function as follows:

    class LensSourcePhase(phase.LensSourcePlanePhase):

        def pass_priors(self,previous_results):

            phase_1_results=previous_results[0]
            self.source_galaxies.source = phase_1_results.variable.source

The source GalaxyModel comes in with the correct lower / upper limits (e.g. 0.0 -> inf), but when it is over-written by the phase_1_results source, the limits automatically reset to -inf -> inf.

This means that certain parameters for certain models are going to unphysical values (e.g. negative intensity, effective radius, etc.). When we use a '.variable' to link two parameters, we should always default to the config lower / upper limits, or, at the very least, use the same values as the previous phase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions