-
Notifications
You must be signed in to change notification settings - Fork 17
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
sunrise() / sunset() documentation #180
Comments
I think the key thing here is to make clear that So a datetime stamp like this:
and not what I would say is the "correct" sunset time for that measurement ("2016-03-04 00:20:57 UTC"). Since |
Would it be clearer if we could adapt the function so input/output is UTC?
Note that it looks like # UTC midnight at a UTC position:
check_night("2016-03-04 00:00", 0, 45.45583)
[1] TRUE # 00:00 UTC => 00:00 UTC for that position
# UTC midnight for a GMT-6 position
check_night("2016-03-04 00:00", -98.41306, 45.45583)
[1] FALSE # 00:00 UTC => 2016-03-03 18:00 local GMT-6 for that position
# Other UTC timestamps for that GMT-6 position
check_night("2016-03-04 06:00", -98.41306, 45.45583)
[1] TRUE # 06:00 UTC => 00:00 local GMT-6
check_night("2016-03-04 12:00", -98.41306, 45.45583)
[1] TRUE # 12:00 UTC => 06:00 local GMT-6
check_night("2016-03-04 18:00", -98.41306, 45.45583)
[1] FALSE # 18:00 UTC => 12:00 local GMT-6 |
No, that's not the issue, all input and outputs are already in UTC. The problem is:
and
Together these two things mean that if you give it a date and time (in UTC) you don't always get the response you expect. You can see this in my example above, where the measurement (2016-03-04 00:12:14) takes place just before sunset, but it returns not the sunset that occurs 8 minuts later on the same date (2016-03-04 00:20:57), but instead the sunset of the next date, 24h and 10m later (2016-03-05 00:22:19). We either need to fix this in This is not a high priority thing, but would be good to keep track of it and fix once there is time... |
It gets more confusing:
Why jump forward a day in the first case, and backward a day in the second case? Differences of the input datetime in various time zones do not give clues as to why:
Also there is continuity along longitude, and we can change the output date by adding 360 degrees:
Do not understand the underlying function |
Sunrise and sunset are calculated relative to the solar noon of the input date. Therefore, sunrises can fall a day earlier, and sunsets can fall a day later. solar noon sunset example: 2016-03-04 18:51:32 |
Add the option |
fixed by 56a1f29 |
Need to clarify
NA
is returned if there is no sunrise/sunset (arctic circle)It seems like the crepuscule function assumes that the input date refers to the day in the local timezone of the given coordinates
This interpretation explains this example (output day is not necessarily the same as the input day)
Also explains this jump
The text was updated successfully, but these errors were encountered: