-
Notifications
You must be signed in to change notification settings - Fork 10
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
gmorello
wants to merge
51
commits into
pylightcurve-3
Choose a base branch
from
master
base: pylightcurve-3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2nd digit in uncertainties
🐛 Replace `np.float` with `float`
merge v4.0.4
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)