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

Implement logarithmic law? #6

Open
wants to merge 51 commits into
base: pylightcurve-3
Choose a base branch
from
Open

Implement logarithmic law? #6

wants to merge 51 commits into from

Conversation

gmorello
Copy link
Contributor

Below I report the corresponding functions with the usual approach, however a change is necessary to account for the fact that log is not defined in 0. My proposal is:
np.log(mu24) -> np.max([ np.log(mu24), min_log ])
np.log(1.0 - rsq) -> np.max([ np.log(1.0 - rsq), 2*min_log ])
Where min_log could depend on precision.

integral definitions for classic_log method

def integral_r_classic_log(limb_darkening_coefficients, r):
a1, a2 = limb_darkening_coefficients
rsq = r * r
mu44 = 1.0 - rsq
mu24 = np.sqrt(mu44)
return 0.5 * (a1 - 1.0) * mu44 - (a1/3.0 + a2/9.0) * mu44 * mu24 + (a2/3.0) * mu44 * mu24 * np.log(mu24)

def num_classic_log(r, limb_darkening_coefficients, rprs, z):
a1, a2 = limb_darkening_coefficients
rsq = r * r
#mu = np.sqrt(1.0 - rsq)
return (1.0 - a1 * (1.0 - (1.0 - rsq)**0.5 ) - 0.5 * a2 * ((1.0 - rsq)**0.5) * np.log(1.0 - rsq) ) * r * np.arccos(np.minimum((-rprs ** 2 + z * z + rsq) / (2.0 * z * r), 1.0))

def integral_r_f_classic_log(limb_darkening_coefficients, rprs, z, r1, r2, precision=3):
x1 = (r2 - r1) / 2.0
x2 = (r2 + r1) / 2.0
#return x1 * np.sum(gausstab[precision][0][:, None] * num_classic_log(x1[None, :] * gausstab[precision][1][:, None] + x2[None, :], limb_darkening_coefficients, rprs, z), 0)
return gauss_numerical_integration(num_classic_log, r1, r2, precision, limb_darkening_coefficients, rprs, z)

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.

3 participants