Add getRiseAndSetAtSolarAngle method#135
Open
MatthiasKunnen wants to merge 6 commits intomourner:masterfrom
Open
Add getRiseAndSetAtSolarAngle method#135MatthiasKunnen wants to merge 6 commits intomourner:masterfrom
MatthiasKunnen wants to merge 6 commits intomourner:masterfrom
Conversation
Author
|
@mourner, are you accepting PRs at the moment? |
Owner
|
Sorry for not reviewing this in time — I got swamped by other commitments and have fallen behind on this project. :( Closing as the PR is superseded by #137, which is more accurate and complete. |
Author
Owner
|
Ah apologies, I misread the description — reopening. |
Author
|
The name might be confusing indeed. What do you think about |
c794569 to
bd73c8e
Compare
Author
|
@mourner, I've made some additions:
|
MatthiasKunnen
commented
Feb 8, 2020
| SunCalc.getRiseAndSetAtSolarAngle = function (date, angle, lat, lng, elevation) { | ||
|
|
||
| elevation = elevation || 0; | ||
| angle = angle - astroRefraction(angle) * 100; |
Author
There was a problem hiding this comment.
Any idea why I need to multiply by 100?
|
This saved me some time, thank you for sharing your solution @MatthiasKunnen ! |
|
published a new version which include this as https://github.com/Hypnos3/suncalc3 |
This file contains hidden or 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
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.
I have a use case where I need to get the time on which the sun will be at multiple angles. Since these altitudes are unknown I can't really name them. Therefore I've added the
getRiseAndSetAtSolarAnglemethod.The method can be seen as a shortcut to
addTimefollowed bygetTimesthat does not pollute the times array. It saves a method call and does not calculate any other times when it doesn't need to.