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:

### Issue Analytics

• State:
• Created 3 years ago

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.

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.

#### Top 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 ...
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.
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 ...
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...
Twilight - Wikipedia
For other uses, see Twilight (disambiguation). Twilight is light produced by sunlight scattering in the upper atmosphere, when the Sun is ... When...

#### Troubleshoot Live Code

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