Comments (2)
Hi again. I'm sure not if it's helpful or even a problem but I've noticed that the Location.solar_elevation
function returns values that are not entirely consistent with the dusk/dawn functions.
For example, the following program prints the solar elevation at each minute of the day, for the same date and location as above:
import astral
import datetime
import pytz
location = astral.Location(("Test name", "Test region", 56.1629, 0, "Europe/Berlin", 0))
tz = pytz.timezone(location.timezone)
beginning_of_day = tz.localize(datetime.datetime(2017, 5, 3))
for i in range(24*60):
time = beginning_of_day + datetime.timedelta(minutes=i)
elev = location.solar_elevation(time)
print(str(time) + ": " + str(elev))
The following is a sample of the output:
[output omitted]
2017-05-03 01:32:00+02:00: -17.969160095
2017-05-03 01:33:00+02:00: -17.9839581501
2017-05-03 01:34:00+02:00: -17.9981449878
2017-05-03 01:35:00+02:00: -18.0117201924
2017-05-03 01:36:00+02:00: -18.0246833656
2017-05-03 01:37:00+02:00: -18.0370341267
[output omitted]
2017-05-03 02:17:00+02:00: -18.0267245776
2017-05-03 02:18:00+02:00: -18.0138599232
2017-05-03 02:19:00+02:00: -18.0003830874
2017-05-03 02:20:00+02:00: -17.9862944615
2017-05-03 02:21:00+02:00: -17.9715944546
2017-05-03 02:22:00+02:00: -17.956283493
[output omitted]
This shows that, according toLocation.solar_elevation
, the sun goes below 18 degrees approximately at 1:34 AM while the dusk time reported by Location.dusk
is 1:29:52 AM.
And according toLocation.solar_elevation
the astronomical dawn should be around 2:19 AM.
I hope this is helpful somehow. :)
from astral.
I've come across the same issue as above. The forward and reverse calculations don't quite match up.
I had a look at the maths but I don't know enough about it to figure it out.
from astral.
Related Issues (20)
- Example in astral/docs/_sources/index.rst.txt needs to corrected.
- Feature request: Calculate Moon rise and set times HOT 4
- Astral v2 outputs dates in microseconds
- Dead links in docs
- Buggy times for northern hemisphere HOT 2
- Sunrise/sunset sometimes throws "sun always above horizon" during polar (24h) night
- Problems with error handling HOT 1
- v3.1 Changelog? HOT 1
- Mypy flags comment as invalid HOT 1
- Moon culminant/noon
- Sunrise time calculation error
- Sun rise and set cal error
- Sunset times returning for previous day HOT 4
- Missing sunsets for arctic circle locations HOT 2
- Add an Optional Argument to sun() Function to Return Only Specified Keys
- On only some days: ValueError: Unable to find a dusk time on the date specified HOT 8
- Help understanding the `timezone` field of a `LocationInfo`, does it do anything when used in tandem with sun?
- No moonrise when official almanac states there is (ditto sunrise) HOT 2
- Wrong calculation of obscuring feature calculation HOT 10
- moon rise issues with timezone HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astral.