Post by smurphy on Feb 12, 2020 9:23:53 GMT -8
Hi all,
just wondering if anyone tried to compute the Dew point on their Weather Station and graph it somehow.
The formulat is quite complex (I admit), and I actually manged to get it to be computed using bc and bash (shell script).
Feeding it into MRTG through my weather.sh script, I can integrate it into the Temp-view.
Whiuch formulas are you guys using?
Using the first formulat from: en.wikipedia.org/wiki/Dew_point
Using the first formulat from: en.wikipedia.org/wiki/Dew_point
Complex formulat wouldn't work with simple shell-scripting. For those who are interested, here is what I use:
# Dew point calculation. DS0 provided by initial call.
# Check temperature 0⁰C < T < 60⁰C
# Humidity between: 0.01 (1%) < Humidity < 1.00 (100%)
# Tr = Dew point 0⁰C < Tr < 50⁰C
# Link: https://fr.wikipedia.org/wiki/Point_de_rosée
# f(T, RH) = (a*Temp)/(b+Temp)+l(Humidity) using bc -l
# a = 17.27
# b = 237.7 ⁰C
# Humidity written in: 1% == 0.01
# and use that in the calculation:
# Tr = (b*f(T, RH)) / (a - f(T, RH))
#
if [ "$ACTION" == "dewpoint" ]
then
rDS0=`echo $DS0 | cut -d '.' -f 1`
if [ $rDS0 -gt 0 -a $rDS0 -lt 60 ]
then
Humidity=`tail -1 ${SRCDIR}/${FILE} | cut -d ";" -f 17`
a="17.27"
b="237.7"
Hum=0`echo "scale=10;$Humidity/100" | bc`
fTRH=0`echo "(${a}*${DS0})/(${b}+${DS0})+l(${Hum})" | bc -l`
Tr=`echo "scale=2;(237.7*${fTRH})/(17.27-${fTRH})" | bc -l`
# echo $Humidity
# echo $DS0
# echo $fTRH
# echo $Hum
# echo $Tr
# Assign Dew Point to DS0
DS0=$Tr
fi
fi
What it looks like can be seen here: stargate.solsys.org/mod.php?mod=systat&op=refresh_parent&arg=246×cale=Daily in case.
If course, as my Weather Station is still in the basement, it will remain quite static. Didn't have time to weather-tighten it yet. But I have all required equipment here now to make it happen. Just a matter of time