|
Post by truefinn on Mar 28, 2021 12:36:28 GMT -8
Activies of weekend included a DewPoint -project. Here's a short summary:
1. Added to the end of 'WeatherData' table a new column named 'DewPoint' 2. Made changes to 'pclogging.py' program, so that dew point has to be calculated only once. Additions (excluding INSERT clause and it's preparation) to code were:
from math include log . . . OutTemp = CWJSON["OutdoorTemperature"] OutHum = CWJSON["OutdoorHumidity"] SA_DewPoint = ( OutTemp - (( 100 - OutHum ) / 5 )) # Simple approximation NOT USED ANYWHERE GammaTRH = round ((( log ( OutHum / 100 ) + (( 18.678 * OutTemp ) / ( 257.14 + OutTemp ))), 4) DewPoint = round ((( 257.14 * GammaTRH ) / ( 18.678 - GammaTRH )), 2) state.DewPoint = DewPoint
3. Added print -command after each line above
Log file 'nohup.out' contained after that for example lines (situation before row was inserted)
Outdoor Temperature = 10.22 Outdoor Humidity = 48 Simple approximation of Dew Point = -0.17999...... GammaTRH = -0.02 Dew Point = -0.28 state Dew Point = -0.28
New 'Dew Point' -graph was also added, during which negative 'Dew Point' values forced to do also following additions/changes to 'weather_page.py' file:
if ( min ( DewPoint ) < 0): minDewTemp = min ( DewPoint ) * 1.10 else: minDewTemp = min ( DewPoint ) * 0.9 maxDewTemp = max ( DewPoint ) * 1.10
Calculated values above were used to set yaxes to graph
|
|