question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

idea: use sun elevation to calculate brightness

See original GitHub issue

This is some code to show the sun elevation over the course of 3 days.

import datetime

from astral.geocoder import database, lookup
import astral.sun
import matplotlib.pyplot as plt
import pytz

location = lookup("Amsterdam", database())
now = datetime.datetime.now(tz=pytz.timezone("Europe/Amsterdam"))
times = [
    now.replace(minute=minute, hour=hour, day=day)
    for day in range(1, 3)
    for hour in range(0, 24)
    for minute in range(0, 60)
]
angles = [astral.sun.elevation(location.observer, t) for t in times]
plt.plot(times, angles)

see: image

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
spencerthayercommented, Mar 6, 2021

I get that. I’ve started to look at the math on this, I’ll post anything I can figure out.

I am also trying to determine how to integrate a more natural circadian cycle. image

1reaction
claytonjncommented, Mar 6, 2021

I haven’t had a lot of time to really get into the physics/math so as of now it’s over my head.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dim lights based on the sun's elevation - Blueprints Exchange
The elevation when brightness shall start to change during sunset (0 degrees). The elevation when brightness shall stop to change during sunset ...
Read more >
Elevation Angle | PVEducation
The elevation angle (used interchangeably with altitude angle) is the angular height of the sun in the sky measured from the horizontal.
Read more >
The use of sun elevation angle for stereogrammetric boreal ...
We conclude that the variation in sun elevation angle at time of stereopair acquisition can create illumination conditions conducive for ...
Read more >
asteroids - Calculating the luminosity of a comet
I have used the flux of the Sun and the distance of the comet from the Sun to the in meters. I was...
Read more >
Twilight - Wikipedia
For other uses, see Twilight (disambiguation). Twilight is light produced by sunlight scattering in the upper atmosphere, when the Sun is ... When...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found