sunrise, sunset, sun az and el

61 views
Skip to first unread message

JoeP

unread,
Dec 14, 2010, 10:03:37 AM12/14/10
to Weewx Weather Station Discussion
I notice on the weewx example site that it shows the sunrise and
sunset times. Are these received from the weather station or
calculated in weewx based on lat/lon?
If they are calculated in weewx, by chance are other calculations done
like the current azimuth and elevation of the sun?
FWIW, NOAA has a couple sites with javascript calculators for all
these values.
Thanks,
joe

Tom Keffer

unread,
Dec 14, 2010, 12:18:17 PM12/14/10
to weewx...@googlegroups.com
Hi, Joe

All almanac calculations are done within weewx. If you want to add something
like azimuth and elevation of the sun, you would have two choices:

1. Do the calculations within weewx, then offer the results to the templates
by expanding the search list. Take a look at module weeutil.Sun. It offers
lots of different solar calculations, including azimuth and elevation (see
function sunRADec(), for example). To make the results available from within
the templates, you have to add it to the search list. There are instructions
on how to do this in the document Customizing Weewx, under the section
"Extending an existing generator."

2. If you prefer to do the calculations in javascript, then you will need
the station latitude and longitude. These are available as tags $almanac.lat
and $almanac.lon, respectively, from within the templates. Time is available
as $current.dateTime, expressed in unix epoch time.

I'll put it on my list of "Future Extensions" to add more of these kinds of
astronomical calculations. But, for now, either of these approaches would
work.

Cheers,

-tk

--
You received this message because you are subscribed to the Google Groups
"Weewx Weather Station Discussion" group.
To post to this group, send email to weewx...@googlegroups.com.
To unsubscribe from this group, send email to
weewx-user+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/weewx-user?hl=en.


bttman

unread,
Dec 15, 2010, 9:02:45 AM12/15/10
to weewx...@googlegroups.com
regarding astronomical calculations, PyEphem looks interesting... maybe overkill but what the heck?
http://rhodesmill.org/pyephem/
joe
Reply all
Reply to author
Forward
0 new messages