Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/multipoles #103

Merged
merged 7 commits into from
May 31, 2023
Merged

Feature/multipoles #103

merged 7 commits into from
May 31, 2023

Conversation

Jammy2211
Copy link
Owner

Extends the PowerLawMultipoleM4 model previously implemented to support an input value of m (e.g. m=3, m=4, etc).

The following SLaM scripts show how to use the multipole, which must be paired to a separate PowerLaw model:

https://github.com/Jammy2211/autolens_workspace_test/blob/main/slam/integration/source_lp/mass_total/base.py
https://github.com/Jammy2211/autolens_workspace_test/blob/main/slam/mass_total.py

Model composition is performed as follows:

analysis = al.AnalysisImaging(
    dataset=imaging, adapt_result=source_lp_results.last
)

multipole = af.Model(al.mp.PowerLawMultipole)
multipole.m = 4

mass_results = slam.mass_total.run(
    settings_autofit=settings_autofit,
    analysis=analysis,
    setup_adapt=setup_adapt,
    source_results=source_lp_results,
    light_results=light_results,
    mass=af.Model(al.mp.PowerLaw),
    multipole=multipole,
    reset_shear_prior=True
)

This is paired to the power-law in the SLaM pipeline:

    if multipole is not None:

        multipole.centre = mass.centre
        multipole.einstein_radius = mass.einstein_radius
        multipole.slope = mass.slope

I have also added a reset_shear_prior input:

    if not reset_shear_prior:
        shear = source_results[0].model.galaxies.lens.shear
    else:
        shear = al.mp.ExternalShear

I recommend we use this for multipole fits, because the external shear can absorb missing azimuthal structure in the lens (e.g. Amy's paper).

@Jammy2211
Copy link
Owner Author

You may also need to pull PyAutoLens main

@Jammy2211 Jammy2211 merged commit 85a7f5b into main May 31, 2023
7 checks passed
@Jammy2211 Jammy2211 deleted the feature/multipoles branch June 12, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant