How to plot the Sun & Moon sine elevation (sun/moon rise, sun/moon set) based on local coordinates?
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/d8ebbdbb-be38-489b-9278-9f8b6f2bb003%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/ae68fe85-b7ed-4454-aa3c-5fe1c2cccc7e%40googlegroups.com.
def solar_altitude(latitude, year, month, day):
"""
Compute the altitude of the sun. No atmospherical refraction taken
in account.
Altitude of the southern hemisphere are given relative to
true north.
Altitude of the northern hemisphere are given relative to
true south.
Declination is between 23.5° North and 23.5° South depending
on the period of the year.
Source of formula for altitude is PhysicalGeography.net
http://www.physicalgeography.net/fundamentals/6h.html
"""
# Compute declination
N = daysSince2000Jan0(year, month, day)
res = sunRADec(N)
declination = res[1]
# Compute the altitude
altitude = 90.0 - latitude + declination
# In the tropical and in extreme latitude, values over 90 may occurs.
if altitude > 90:
altitude = 90 - (altitude-90)
if altitude < 0:
altitude = 0
return altitude
Thought ext-database and Almanac/pyephem to be the "natural" path, as all "embedded" in WeeWX... but it seems to generate another discussion.
Just searching for a Sun/Moon path, and the Altitude, as suggested, seems the right path.
Expectations were to be simple, but... "no free lunch".
The search continuous... and feedback always welcome.
Best, X