Hello Jacques
Ok. Its Work! Thank you. I will test this.
def newArchiveRecord(self, event):
"""Gets called on a new archive record event."""
seuil = 0
tempe = event.record.get('outTemp')
if tempe is None: tempe=15
radiation = event.record.get('radiation')
event.record['sunshine_hours'] = 0.0
if radiation is not None:
utcdate =
datetime.utcfromtimestamp(event.record.get('dateTime'))
dayofyear =
int(time.strftime("%j",time.gmtime(event.record.get('dateTime'))))
theta = 360 * dayofyear / 365
equatemps = 0.0172 + 0.4281 * cos((pi / 180) * theta) - 7.3515
* sin(
(pi / 180) * theta) - 3.3495 * cos(2 * (pi / 180) * theta)
- 9.3619 * sin(
2 * (pi / 180) * theta)
Am Freitag, 15. Mai 2020 16:04:21 UTC+2 schrieb Jacques Terrettaz:
>
> Hi Meteo Oberwallis,
>
> Try to modify the script /usr/share/weewx/user/radiationhours.py as follow
> :
>
> Replace (in line 20 ?) :
>
> tempe = float(event.record.get('outTemp'))
>
> by
>
> tempe = event.record.get('outTemp')
> if tempe is None:
> tempe=15
>
--
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/832aa004-abda-489a-824a-780599d9e61a%40googlegroups.com.