I updated the $daylight tag. The whole tag is

$daylight(timestamp=None, data_binding=None, days_ago=0, horizon=None, 
use_center=False).observation.aggregation

Using the option timestamp the $daylight timespan can be used for every 
day, not only the actual day.This makes it possible to do things like that:
#for $dd in month.days
<p>
$dd.dateTime
day average: $dd.outTemp.avg,
average during light day: $daylight(timestamp=$dd).outTemp.avg
</p>
#end for

While `$almanac.sunrise` and `$almanac.sunset` calculate sunrise and sunset 
using the actual temperature and barometer of the calculation time, `
$daylight` now observes temperature and barometer of the time, the daylight 
timespan is calculated for if there are database records available. It 
first calculates approximate sunrise and sunset times for the ICAO standard 
atmosphere at 15°C and 1013.25 mbar. Then it looks up the real temperature 
and barometer for both those times. After that it calculates sunrise and 
sunset again, using the respective temperature and barometer.

That's why `$daylight(timestamp=$X).start` provides a slightly more 
accurate time for sunrise than `$almanac(timestamp=$X).sunrise` if `$X` is 
a timestamp somewhere in the past and database records are available for 
that time. The same applies to `$daylight(timestamp=$X).end` instead of `
$almanac(almanac_time=$X).sunset` for sunset and  `
$daylight(timestamp=$X).length` instead of `
$almanac(almanac_time=$X).sun.visible` for the daylight duration.

But please note that the real purpose of the $daylight tag is not sunrise 
and sunset but aggregation. 

https://github.com/roe-dl/weewx-GTS

>
>>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/36ba0c90-ed81-41d7-8bd4-78a8c453c734n%40googlegroups.com.

Reply via email to