5,838
edits
m (→Cumulus Calculated Parameters: dew point) |
|||
Line 86: | Line 86: | ||
[http://en.wikipedia.org/wiki/Wet_bulb Wet bulb] | [http://en.wikipedia.org/wiki/Wet_bulb Wet bulb] | ||
and [https://en.wikipedia.org/wiki/Dew_point Dew point | and [[#How_does_Cumulus_know_the_height_of_the_cloud_base.3F]] | ||
*The dew point calculation for Cumulus 1 uses a third party library which uses the Davis dew point calculation '''dewpoint := tempinC + ((0.13 * tempinC) + 13.6) * Ln(humidity / 100)''' | |||
* The dew point calculation for MX follows the standard [https://en.wikipedia.org/wiki/Dew_point calculation in wikipedia]. | |||
Note this means that Cumulus 1 and MX log files have a continuity break when you migrate from one flavour to another. | |||
<pre> | |||
/* ================================================================================================= | |||
DEW POINT TEMPERATURE | |||
The dew point calculation in Cumulus 1 uses a third party library which uses the Davis dew point calculation '''dewpoint := tempinC + ((0.13 * tempinC) + 13.6) * Ln(humidity / 100)''' | |||
============================================================================== */ | |||
function calcDewPoint(tempDegC, tempLetter, RHumidity) | |||
{ | |||
var dp = tempDegC + ((0.13 * tempDegC) +13.6) * Math.log(RHumidity / 100); | |||
return calcTempR(dp, tempLetter); // return as string in right units for user | |||
} | |||
/* ================================================================================================= | |||
DEW POINT TEMPERATURE | |||
The following is a formula from https://github.com/nicolasgrancher/weather-js/blob/master/js/weather.js | |||
This matches the formula that MX uses. | |||
It has only been edited to add the middle input parameter and to output using a call to CalcTempR | |||
============================================================================== */ | |||
/** | |||
* Dew point calculation. | |||
* @see https://en.wikipedia.org/wiki/Dew_point | |||
* | |||
* @param Tc temperature in celsius | |||
* @param R relative humidity | |||
* @returns {number} | |||
*/ | |||
function dewPoint(Tc, tempLetter, R) | |||
{ // parameters: tempDegC, tempLetter, (RHumidity /100) // added middle parameter, should be accessible anyway, but playing safe | |||
if (Tc < 0 || Tc > 60) | |||
{ | |||
return calcTempR(Tc, tempLetter); // return as string in right units for user | |||
} | |||
if (R < 0.01 || R > 1) { | |||
return calcTempR(Tc, tempLetter); // return as string in right units for user | |||
} | |||
var a = 17.27; | |||
var b = 237.7; | |||
var alphaTR = ((a * Tc) / (b + Tc)) + Math.log(R); | |||
var Tr = (b * alphaTR) / (a - alphaTR); | |||
if (Tr < 0 || Tr > 50) { | |||
return calcTempR(Tc, tempLetter); // return as string in right units for user | |||
} | |||
return calcTempR(Tr, tempLetter); // return as string in right units for user | |||
} | |||
</pre> | |||
[[Humidex]] and [[Wind chill]] and [[Heat index]] and [[#My heat index/humidex/wind chill is the same as my temperature]] | [[Humidex]] and [[Wind chill]] and [[Heat index]] and [[#My heat index/humidex/wind chill is the same as my temperature]] |
edits