question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change 'theta_E' keyword for Chameleon profile to reflect its actual definition

See original GitHub issue

Effective Einstein radius is calculated fine for SPEMD, but not for Chameleon profile.

import numpy as np
import matplotlib.pyplot as plt

from lenstronomy.LensModel.lens_model import LensModel
from lenstronomy.LensModel.lens_model_extensions import LensModelExtensions


theta_es = np.linspace(0.4, 2, 30)
e1 = 0.0
e2 = 0.0

chams_theta_e = []
spemds_theta_e = []


for theta_e in theta_es:
    kwargs_chameleon = {'theta_E': theta_e, 'w_c': 1.13, 'w_t': 0.03, 'e1': e1, 'e2': e2,
                             'center_x': 0, 'center_y': 0}

    kwargs_spemd = {'theta_E': theta_e, 'gamma': 1.8, 'e1': e1, 'e2': e2, 'center_x': 0, 'center_y': 0}

    lens_model_ext_cham = LensModelExtensions(LensModel(lens_model_list=['CHAMELEON']))
    lens_model_ext_spemd = LensModelExtensions(LensModel(lens_model_list=['SPEMD']))

    spacing = 1000

    chams_theta_e.append(lens_model_ext_cham.effective_einstein_radius([kwargs_chameleon], spacing=spacing))
    spemds_theta_e.append(lens_model_ext_spemd.effective_einstein_radius([kwargs_spemd], spacing=spacing))

plt.plot(theta_es, spemds_theta_e, label='SPEMD')
plt.plot(theta_es, chams_theta_e, label='CHAMELEON')
plt.xlabel('True')
plt.ylabel('Calculated')
plt.legend()
plt.show()

test

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
sibirrercommented, Jun 10, 2019

Yes, the definition was not well documented. I changed the parameter to ‘theta_1’ now and added some better documentation. Thanks! I close the issue for now. Please reopen if things are not set. With my latest push, I also changed a bit the output format of a fitting sequence and added a plotting routine that can better deal with it. Let me know if you have questions.

0reactions
ajshajibcommented, Jun 11, 2019

That’s great! Thanks for making the changes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chameleon Documentation - Read the Docs
Chameleon is an HTML/XML template engine for Python. It's designed to generate the document output of a web application, typically HTML ...
Read more >
Chameleon Definition & Meaning - Merriam-Webster
It is the ability of the chameleon to change colors, however, that has led to the figurative use of "chameleon" for someone or...
Read more >
Language Reference — Chameleon 3.8 documentation
If you redefine a global variable, you replace its definition for the rest of the template. Tip. Global variables may be changed by...
Read more >
Chameleon definition and meaning | Collins English Dictionary
1. any of numerous Old World lizards of the family Chamaeleontidae, characterized by the ability to change the color of their skin, very...
Read more >
Chameleon Symbolism & Meaning | Spirit, Totem, & Power ...
So, this unique creature serves as a symbol of fast change, adaptability, and the ability to blend in or keep a low profile....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found