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.

SimpleLimbDark doesn't vary u1

See original GitHub issue

Hey Dan,

Now that 0.4 is out, I’m trying out your suggestion from our conversation in starry. It looks like SimpleLimbDark is fast and exactly what I want, but your code example isn’t working. set_u doesn’t seem to care what you feed in as u1, the output is always the same. u2 does have an effect though. Was your example wrong? Any idea what’s up?

Here’s the example code and outputs I’m getting:

import matplotlib.pyplot as plt
import numpy as np
from exoplanet.theano_ops.driver import SimpleLimbDark

plt.figure()
bs = np.arange(-1.5, 1.5, 0.01)
rr = 0.2

u2 = 0.2
for u1 in [0., 0.2, 0.4, 0.6]:
    ld = SimpleLimbDark()
    ld.set_u([u1, u2])
    flux = 1 + ld.apply(bs, rr)
    plt.plot(bs, flux, label=f'u1 = {u1}, u2 = {u2}')
plt.legend()


plt.figure()

u1 = 0.2
for u2 in [0., 0.2, 0.4, 0.6]:
    ld = SimpleLimbDark()
    ld.set_u([u1, u2])
    flux = 1 + ld.apply(bs, rr)
    plt.plot(bs, flux, label=f'u1 = {u1}, u2 = {u2}')
plt.legend()

Figure_1 Figure_2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
dfmcommented, Oct 27, 2020

Good catch! I think that what you want is set_u([1, u1, u2]) for now, but let me do a few tests. It’s related to the definitions from the limbdark paper.

1reaction
ericagolcommented, Oct 28, 2020

Yes, that looks correct: just after equation (2) in the paper, it states that u_0 = -1.
limbdark_definitions

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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