|
LFWX
|
 |
« on: September 16, 2009, 12:42:27 PM » |
|
I would like to add "Frostbite Time" to my webpage this winter, but will need to create a javascript to compute it. Maybe someone more experienced can do it quicker than I can! The formula is at this page under "Wind Chill and Time to Frostbite" http://www.survivaltopics.com/survival/the-wind-chill-factor/If I'm reading the description correctly, "V" will be zero for wind speeds 15mph & lower, and will be (windspeed - 15) for windspeeds greater than 15mph. Note the the frostbite time is not directly related to windchill temperature. • At a temperature of -30F and wind speed of 5mph, the wind chill chart shows a wind chill value of -46F and exposed flesh freezes in 30-minutes. • At a temperature of -15F and wind speed of 30mph, the wind chill chart also shows a wind chill of -46F but it also shows that exposed flesh freezes in 10-minutes (freezes much faster at the same wind chill temperature). Thanks Mike
|
|
|
|
|
Logged
|
Station: Davis Vantage Pro2 Fan Aspirated Software: Virtual Weather Station V14.00p64 OS: Windows Vista Home Premium www.LFWeatherCenter.comCWOP: DW1039 CoCoRaHS: OH-BT-1 Weather Underground: KOHHAMIL7 Weather For You: DW1039 Midwestern Weather Network
|
|
|
|
LFWX
|
 |
« Reply #1 on: September 25, 2009, 09:27:19 PM » |
|
UPDATE:I just found a chart from the US Army Research Institute of Environmental Medicine showing " time to frosbite" for various windspeed/temperature combinations - more detaild than the color coded NWS Wind Chill charts. Page 43 of this document, below the Wind Chill chart: http://www.usariem.army.mil/download/cold0102.pdf(the caculations are based on wind speed at 33 feet, so this should work well) My attempts at creating a script from the previously mentioned formula have not worked, so far - strange results or "NaN" (not a number) results. So I may just use some " if...then" statements to calculate the times using this new chart I've found.
|
|
|
|
|
Logged
|
Station: Davis Vantage Pro2 Fan Aspirated Software: Virtual Weather Station V14.00p64 OS: Windows Vista Home Premium www.LFWeatherCenter.comCWOP: DW1039 CoCoRaHS: OH-BT-1 Weather Underground: KOHHAMIL7 Weather For You: DW1039 Midwestern Weather Network
|
|
|
|
LFWX
|
 |
« Reply #2 on: September 26, 2009, 02:58:23 AM » |
|
OK, I think I now have the "time to frosbite" for windspeed/temperature combinations which will cause it to be less than two hours. The HTML tags in the code are for VWS, substitute your own for other software. ^vxv007^ = Outside Temperature^vva002^ = Average Windspeed (5 minute average in my case) Script to calculate Frostbite Time (fbt): fbt defaults to "999" at the start of the script, if it is still "999" after the script has run - the frostbite time is greater than 2 hours & no warning is needed. <script language="JavaScript">
var fbt=999 //if fbt is still 999 after script - no warning needed
if (^vxv007^<-45 && ^vva002^>30) {fbt=2;} else if (^vxv007^<-45 && ^vva002^>20) {fbt=3;} else if (^vxv007^<-45 && ^vva002^>10) {fbt=4;} else if (^vxv007^<-45 && ^vva002^>5) {fbt=6;} else if (^vxv007^<-45 && ^vva002^>=0) {fbt=8;}
else if (^vxv007^<-40 && ^vva002^>35) {fbt=2;} else if (^vxv007^<-40 && ^vva002^>25) {fbt=3;} else if (^vxv007^<-40 && ^vva002^>15) {fbt=4;} else if (^vxv007^<-40 && ^vva002^>10) {fbt=5;} else if (^vxv007^<-40 && ^vva002^>5) {fbt=7;} else if (^vxv007^<-40 && ^vva002^>=0) {fbt=9;}
else if (^vxv007^<-35 && ^vva002^>45) {fbt=2;} else if (^vxv007^<-35 && ^vva002^>30) {fbt=3;} else if (^vxv007^<-35 && ^vva002^>20) {fbt=4;} else if (^vxv007^<-35 && ^vva002^>15) {fbt=5;} else if (^vxv007^<-35 && ^vva002^>10) {fbt=6;} else if (^vxv007^<-35 && ^vva002^>5) {fbt=7;} else if (^vxv007^<-35 && ^vva002^>=0) {fbt=11;}
else if (^vxv007^<-30 && ^vva002^>35) {fbt=3;} else if (^vxv007^<-30 && ^vva002^>25) {fbt=4;} else if (^vxv007^<-30 && ^vva002^>20) {fbt=5;} else if (^vxv007^<-30 && ^vva002^>15) {fbt=6;} else if (^vxv007^<-30 && ^vva002^>10) {fbt=7;} else if (^vxv007^<-30 && ^vva002^>5) {fbt=9;} else if (^vxv007^<-30 && ^vva002^>=0) {fbt=12;}
else if (^vxv007^<-25 && ^vva002^>45) {fbt=3;} else if (^vxv007^<-25 && ^vva002^>30) {fbt=4;} else if (^vxv007^<-25 && ^vva002^>20) {fbt=5;} else if (^vxv007^<-25 && ^vva002^>20) {fbt=6;} else if (^vxv007^<-25 && ^vva002^>10) {fbt=8;} else if (^vxv007^<-25 && ^vva002^>5) {fbt=10;} else if (^vxv007^<-25 && ^vva002^>=0) {fbt=14;}
else if (^vxv007^<-20 && ^vva002^>40) {fbt=4;} else if (^vxv007^<-20 && ^vva002^>30) {fbt=5;} else if (^vxv007^<-20 && ^vva002^>25) {fbt=6;} else if (^vxv007^<-20 && ^vva002^>20) {fbt=7;} else if (^vxv007^<-20 && ^vva002^>15) {fbt=8;} else if (^vxv007^<-20 && ^vva002^>10) {fbt=9;} else if (^vxv007^<-20 && ^vva002^>5) {fbt=12;} else if (^vxv007^<-20 && ^vva002^>=0) {fbt=17;}
else if (^vxv007^<-15 && ^vva002^>40) {fbt=5;} else if (^vxv007^<-15 && ^vva002^>30) {fbt=6;} else if (^vxv007^<-15 && ^vva002^>25) {fbt=7;} else if (^vxv007^<-15 && ^vva002^>20) {fbt=8;} else if (^vxv007^<-15 && ^vva002^>15) {fbt=9;} else if (^vxv007^<-15 && ^vva002^>10) {fbt=12;} else if (^vxv007^<-15 && ^vva002^>5) {fbt=15;} else if (^vxv007^<-15 && ^vva002^>=0) {fbt=22;}
else if (^vxv007^<-10 && ^vva002^>45) {fbt=6;} else if (^vxv007^<-10 && ^vva002^>35) {fbt=7;} else if (^vxv007^<-10 && ^vva002^>30) {fbt=8;} else if (^vxv007^<-10 && ^vva002^>25) {fbt=9;} else if (^vxv007^<-10 && ^vva002^>20) {fbt=10;} else if (^vxv007^<-10 && ^vva002^>15) {fbt=12;} else if (^vxv007^<-10 && ^vva002^>10) {fbt=15;} else if (^vxv007^<-10 && ^vva002^>5) {fbt=19;} else if (^vxv007^<-10 && ^vva002^>=0) {fbt=31;}
else if (^vxv007^<-5 && ^vva002^>40) {fbt=8;} else if (^vxv007^<-5 && ^vva002^>35) {fbt=9;} else if (^vxv007^<-5 && ^vva002^>30) {fbt=10;} else if (^vxv007^<-5 && ^vva002^>25) {fbt=12;} else if (^vxv007^<-5 && ^vva002^>20) {fbt=13;} else if (^vxv007^<-5 && ^vva002^>15) {fbt=16;} else if (^vxv007^<-5 && ^vva002^>10) {fbt=20;} else if (^vxv007^<-5 && ^vva002^>5) {fbt=28;}
else if (^vxv007^<0 && ^vva002^>45) {fbt=11;} else if (^vxv007^<0 && ^vva002^>40) {fbt=12;} else if (^vxv007^<0 && ^vva002^>35) {fbt=13;} else if (^vxv007^<0 && ^vva002^>30) {fbt=14;} else if (^vxv007^<0 && ^vva002^>25) {fbt=16;} else if (^vxv007^<0 && ^vva002^>20) {fbt=19;} else if (^vxv007^<0 && ^vva002^>10) {fbt=23;}
else if (^vxv007^<5 && ^vva002^>45) {fbt=16;} else if (^vxv007^<5 && ^vva002^>40) {fbt=18;} else if (^vxv007^<5 && ^vva002^>35) {fbt=20;} else if (^vxv007^<5 && ^vva002^>30) {fbt=23;} else if (^vxv007^<5 && ^vva002^>25) {fbt=28;} else if (^vxv007^<5 && ^vva002^>20) {fbt=42;}
</script> Script to display a frostbite caution when needed: " CAUTION: Frostbite possible in 15 minutes or less" <script language="JavaScript"> if (fbt<999) document.write('<big><b>CAUTION:</b></big> Frostbite possible in ' + fbt + ' minutes or less'); </script> I won't know if this actually works until winter, if it gets cold enough. It rarely gets that cold & windy here, and the all-time record low for Cincinnati is -25 so most of the script should never be used. (knock on wood) Maybe someone in a colder climate could verify the output.
|
|
|
|
|
Logged
|
Station: Davis Vantage Pro2 Fan Aspirated Software: Virtual Weather Station V14.00p64 OS: Windows Vista Home Premium www.LFWeatherCenter.comCWOP: DW1039 CoCoRaHS: OH-BT-1 Weather Underground: KOHHAMIL7 Weather For You: DW1039 Midwestern Weather Network
|
|
|
|
sam2004gp
|
 |
« Reply #3 on: September 26, 2009, 08:40:03 AM » |
|
Hmm Interesting stuff you got there. You have come up with a great idea and formula. I wish our weather was rough enough to warrant putting it on my webpage. Great Job. 
|
|
|
|
« Last Edit: September 26, 2009, 08:42:43 AM by sam2004gp »
|
Logged
|
|
|
|
|
CNYWeather
|
 |
« Reply #4 on: September 26, 2009, 08:46:47 AM » |
|
That looks like a great script. Think I'll play and get it to WD too.
|
|
|
|
|
Logged
|
|
|
|
|
Bushman
|
 |
« Reply #5 on: September 26, 2009, 12:04:11 PM » |
|
Prety, uh... cool.  ALthough I have to believe there is an algorithm for that.
|
|
|
|
|
Logged
|
|
|
|
|
LFWX
|
 |
« Reply #6 on: September 26, 2009, 12:38:35 PM » |
|
Hmm Interesting stuff you got there. You have come up with a great idea and formula. I wish our weather was rough enough to warrant putting it on my webpage. Great Job.  Thanks. True - this will most likely not show up on my site. It's one of several that only show when needed, between the "greeting" and the box giving a brief description of the current conditions. <!-- Display flash flood, heat stress, kite flying weather, frostbite caution & record temperature notices--> <tr> <td style="width:810" align="center"><font face="Arial" size="3" color="red"><b> <SCRIPT LANGUAGE = "JavaScript"> if (fbt<999) document.write('<big><b>- CAUTION -</b></big><br>Frostbite possible in ' + fbt + ' minutes or less'); if (^vxv123^ > 1.99 && ^vxv122^ > 0.99) document.write('FLASH FLOODING possible<br>(' + ^vxv122^ + '" of rain in the past hour & ' + ^vxv123^ + '" of rain in the past 24 hours)<br>'); if (thwavg > 129) document.write("Heat Stroke Imminent!<br>"); else if (thwavg > 104) document.write("Heat Cramps, Heat Exhaustion or Heatstroke Likely<br>with prolonged exposure and physical activity<br>"); else if (thwavg > 89) document.write("Heat Cramps, Heat Exhaustion or Heatstroke Possible<br>with prolonged exposure and physical activity<br>"); </script></b></font> <font face="Arial" size="3" color="green"><b> <SCRIPT LANGUAGE = "JavaScript"> if (^vxv007^ > 65.9 && ^vva002^ > 7.9 && ^vxv018^ > 99 && ^vxv124^ == 0 && ^vxv122^ == 0 && deltagust > 14) document.write("It's Kite Flying Weather, but be careful - it's gusty out there!<br>"); else if (^vxv007^ > 65.9 && ^vva002^ > 7.9 && ^vxv018^ > 99 && ^vxv124^ == 0 && ^vxv122^ == 0) document.write("It's Kite Flying Weather!<br>"); if (deltahigh > -6 && deltahigh < 0) document.write('The current temperature is ' + (0 - deltahigh) +'° cooler than the Record High for this date.<br>'); if (deltahigh == 0) document.write('The current temperature is equal to the Record High for this date.<br>'); if (deltahigh > 0) document.write('The current temperature is ' + deltahigh + '° warmer than the Record High for this date.<br>'); if (deltalow > -6 && deltalow < 0) document.write('The current temperature is ' + (0 - deltalow) +'° warmer than the Record Low for this date.<br>'); if (deltalow == 0) document.write('The current temperature is equal to the Record Low for this date.<br>'); if (deltalow > 0) document.write('The current temperature is ' + deltalow + '° cooler than the Record Low for this date.<br>'); </script></b></font> <font face="Arial" size="3" color="red"><b> <SCRIPT LANGUAGE = "JavaScript"> if (high == ^almhi1^) document.write('The Record High of ' + high + '° has been tied today.<br>'); else if (high > ^almhi1^) document.write('A NEW RECORD HIGH temperature of ' + high + '° has been reached today.<br>(' + (high - ^almhi1^) + '° warmer than the previous Record)<br>'); else if (^almhi1^ - high < 6) document.write('A near Record High temperature of ' + high + '° has been reached today.<br>(' + (^almhi1^ - high) + '° cooler than the Record)<br>'); </script></b></font> <font face="Arial" size="3" color="blue"><b> <SCRIPT LANGUAGE = "JavaScript"> if (low == ^almlo1^) document.write('The Record Low temperature of ' + low + '° has been tied today.<br>'); else if (low < ^almlo1^) document.write('A NEW RECORD LOW temperature of ' + low + '° has been reached today.<br>(' + (^almlo1^ - low) + '° cooler than the previous Record)<br>'); else if (low - ^almlo1^ < 6) document.write('A near Record Low temperature of ' + low + '° has been reached today.<br>(' + (low - ^almlo1^) + '° warmer than the Record)<br>'); </script> </b></font></td> </tr>
Some of the variables are calculated elsewhere. Prety, uh... cool.  ALthough I have to believe there is an algorithm for that. Yes, but my attempts to write a script for it have failed, so far. Any ideas?!
|
|
|
|
« Last Edit: September 26, 2009, 12:45:26 PM by LFWX »
|
Logged
|
Station: Davis Vantage Pro2 Fan Aspirated Software: Virtual Weather Station V14.00p64 OS: Windows Vista Home Premium www.LFWeatherCenter.comCWOP: DW1039 CoCoRaHS: OH-BT-1 Weather Underground: KOHHAMIL7 Weather For You: DW1039 Midwestern Weather Network
|
|
|
|
LFWX
|
 |
« Reply #7 on: January 03, 2011, 09:19:13 PM » |
|
UPDATE: I ran across an on-line frostbite time calculator and started plugging in various temperatures and wind speeds (5 degree and 5 mph increments), so here is the refined Java Script using this new info. This version works down to -30 degrees F with winds up to 45 mph. (I have VWS outputting the 5 minute average wind speed "^vva002^") <script language="JavaScript"> <!--calculate frostbite time--> var temperature = ^vxv007^; var averagewind = ^vva002^; var fbt=999 //if fbt is still 999 after script runs - no warning is needed if (temperature <=-30 && ^vva002^>=45) {fbt=2;} else if (temperature <= -30 && averagewind >= 40) {fbt=3;} else if (temperature <= -30 && averagewind >= 35) {fbt=3;} else if (temperature <= -30 && averagewind >= 30) {fbt=4;} else if (temperature <= -30 && averagewind >= 25) {fbt=4;} else if (temperature <= -30 && averagewind >= 20) {fbt=5;} else if (temperature <= -30 && averagewind >= 15) {fbt=5;} else if (temperature <= -30 && averagewind >= 10) {fbt=7;} else if (temperature <= -30 && averagewind >= 5) {fbt=9;} else if (temperature <= -30 && averagewind >= 0) {fbt=12;} else if (temperature <= -25 && averagewind >= 45) {fbt=3;} else if (temperature <= -25 && averagewind >= 40) {fbt=3;} else if (temperature <= -25 && averagewind >= 35) {fbt=4;} else if (temperature <= -25 && averagewind >= 30) {fbt=5;} else if (temperature <= -25 && averagewind >= 25) {fbt=5;} else if (temperature <= -25 && averagewind >= 20) {fbt=6;} else if (temperature <= -25 && averagewind >= 15) {fbt=6;} else if (temperature <= -25 && averagewind >= 10) {fbt=8;} else if (temperature <= -25 && averagewind >= 5) {fbt=10;} else if (temperature <= -25 && averagewind >= 0) {fbt=14;} else if (temperature <= -20 && averagewind >= 45) {fbt=4;} else if (temperature <= -20 && averagewind >= 40) {fbt=4;} else if (temperature <= -20 && averagewind >= 35) {fbt=5;} else if (temperature <= -20 && averagewind >= 30) {fbt=6;} else if (temperature <= -20 && averagewind >= 25) {fbt=6;} else if (temperature <= -20 && averagewind >= 20) {fbt=7;} else if (temperature <= -20 && averagewind >= 15) {fbt=7;} else if (temperature <= -20 && averagewind >= 10) {fbt=9;} else if (temperature <= -20 && averagewind >= 5) {fbt=12;} else if (temperature <= -20 && averagewind >= 0) {fbt=17;} else if (temperature <= -15 && averagewind >= 45) {fbt=5;} else if (temperature <= -15 && averagewind >= 40) {fbt=5;} else if (temperature <= -15 && averagewind >= 35) {fbt=6;} else if (temperature <= -15 && averagewind >= 30) {fbt=7;} else if (temperature <= -15 && averagewind >= 25) {fbt=8;} else if (temperature <= -15 && averagewind >= 20) {fbt=9;} else if (temperature <= -15 && averagewind >= 15) {fbt=9;} else if (temperature <= -15 && averagewind >= 10) {fbt=12;} else if (temperature <= -15 && averagewind >= 5) {fbt=15;} else if (temperature <= -15 && averagewind >= 0) {fbt=22;} else if (temperature <= -10 && averagewind >= 45) {fbt=6;} else if (temperature <= -10 && averagewind >= 40) {fbt=7;} else if (temperature <= -10 && averagewind >= 35) {fbt=8;} else if (temperature <= -10 && averagewind >= 30) {fbt=9;} else if (temperature <= -10 && averagewind >= 25) {fbt=10;} else if (temperature <= -10 && averagewind >= 20) {fbt=11;} else if (temperature <= -10 && averagewind >= 15) {fbt=12;} else if (temperature <= -10 && averagewind >= 10) {fbt=15;} else if (temperature <= -10 && averagewind >= 5) {fbt=19;} else if (temperature <= -10 && averagewind >= 0) {fbt=31;} else if (temperature <= -5 && averagewind >= 45) {fbt=8;} else if (temperature <= -5 && averagewind >= 40) {fbt=9;} else if (temperature <= -5 && averagewind >= 35) {fbt=11;} else if (temperature <= -5 && averagewind >= 30) {fbt=12;} else if (temperature <= -5 && averagewind >= 25) {fbt=13;} else if (temperature <= -5 && averagewind >= 20) {fbt=15;} else if (temperature <= -5 && averagewind >= 15) {fbt=16;} else if (temperature <= -5 && averagewind >= 10) {fbt=20;} else if (temperature <= -5 && averagewind >= 5) {fbt=28;} else if (temperature < 0 && averagewind >= 45) {fbt=11;} else if (temperature < 0 && averagewind >= 40) {fbt=12;} else if (temperature < 0 && averagewind >= 35) {fbt=14;} else if (temperature < 0 && averagewind >= 30) {fbt=16;} else if (temperature < 0 && averagewind >= 25) {fbt=17;} else if (temperature < 0 && averagewind >= 20) {fbt=19;} else if (temperature < 0 && averagewind >= 15) {fbt=21;} else if (temperature < 0 && averagewind >= 10) {fbt=23;} else if (temperature <= 5 && averagewind >= 45) {fbt=17;} else if (temperature <= 5 && averagewind >= 40) {fbt=20;} else if (temperature <= 5 && averagewind >= 35) {fbt=22;} else if (temperature <= 5 && averagewind >= 30) {fbt=25;} else if (temperature <= 5 && averagewind >= 25) {fbt=30;} else if (temperature <= 5 && averagewind >= 20) {fbt=42;} </script>
|
|
|
|
|
Logged
|
Station: Davis Vantage Pro2 Fan Aspirated Software: Virtual Weather Station V14.00p64 OS: Windows Vista Home Premium www.LFWeatherCenter.comCWOP: DW1039 CoCoRaHS: OH-BT-1 Weather Underground: KOHHAMIL7 Weather For You: DW1039 Midwestern Weather Network
|
|
|
|
C5250
|
 |
« Reply #8 on: January 05, 2011, 03:41:18 AM » |
|
Update see version 1.1 on page 2. I slapped this together pretty quick, but I think it should work. <script language="JavaScript"> <!-- // FrostbiteTime // version: 1.0 // date: 4 Jan 2011 // author: WIEST // // Function to return Time to Frostbite in minutes. // // Parameters: // // FBScale - Use "F" for Fahrenheit/mph, or "C" for Celsius/kph // FBtemp - Temperature in the scale selected by FBScale // FBwind - Wind speed in the scale selected by FBScale // // Return Values: // // If the temperature is between -50F and 10F with a wind speed // between 0 mph and 50 mph, or -15C and -50C with a wind speed // between 0 kph and 80 kph, the returned value will be the // calculated potential time to Frostbite. // // 0 = Not calculated // -1 = Out of range or no Frostbite risk // // Frostbite times obtained from the charts at: // http://www.ofcm.gov/jagti/r19-ti-plan/pdf/03_chap3.pdf //
function FrostbiteTime( FBScale, FBtemp, FBwind ) {
var FBTarray = new Array(); FBtemp = Number(FBtemp); FBtemp = Math.round((FBtemp+50) / 5); if ( FBScale=="F" ) { FBwind = Math.round((FBwind / 5 ) -1 ); } else { FBwind = Math.round((FBwind / 10 ) -1 ); }
if ( FBScale=="F" && FBtemp <= 13 && FBtemp >= -1 && FBwind <= 9) {
FBTarray[0] = new Array( 7, 8, 9, 11, 12, 14, 17, 22, 31, 180, 180, 180, 180 ); FBTarray[1] = new Array( 5, 6, 7, 7, 9, 10, 12, 15, 19, 28, 180, 180, 180 ); FBTarray[2] = new Array( 4, 4, 5, 6, 7, 8, 9, 12, 15, 20, 33, 180, 180); FBTarray[3] = new Array( 3, 4, 4, 5, 6, 8, 8, 9, 12, 16, 23, 180, 180 ); FBTarray[4] = new Array( 3, 3, 4, 4, 5, 6, 7, 8, 10, 13, 19, 42, 180 ); FBTarray[5] = new Array( 2, 3, 3, 4, 4, 5, 6, 7, 9, 12, 16, 28, 180 ); FBTarray[6] = new Array( 2, 2, 3, 3, 4, 4, 5, 6, 8, 10, 14, 23, 180 ); FBTarray[7] = new Array( 2, 2, 2, 3, 3, 4, 5, 6, 7, 9, 13, 20, 180 ); FBTarray[8] = new Array( 2, 2, 2, 3, 3, 4, 4, 5, 7, 8, 12, 18, 180 ); FBTarray[9] = new Array( 2, 2, 2, 2, 3, 3, 4, 5, 6, 8, 11, 16, 180 );
FBTreturn = FBTarray[FBwind][FBtemp]; } else if (FBScale=="C" && FBtemp <= 8 && FBtemp >= -1 && FBwind <= 7 ) {
FBTarray[0] = new Array( 6, 7, 8, 11, 15, 22, 180, 180 ); FBTarray[1] = new Array( 4, 5, 6, 7, 10, 14, 180, 180 ); FBTarray[2] = new Array( 3, 4, 4, 6, 8, 11, 18, 180 ); FBTarray[3] = new Array( 2, 3, 4, 5, 6, 9, 14, 42 ); FBTarray[4] = new Array( 2, 2, 3, 4, 5, 8, 12, 27 ); FBTarray[5] = new Array( 2, 2, 3, 3, 5, 7, 10, 22 ); FBTarray[6] = new Array( 2, 2, 2, 3, 4, 6, 9, 18 ); FBTarray[7] = new Array( 1, 2, 2, 3, 4, 5, 8, 16 );
FBTreturn = FBTarray[FBwind][FBtemp]; }
else {
if ( FBScale == "F" || "C" ) { FBTreturn = -1; } else { FBTreturn = 0; } } if (FBTreturn == 180) { FBTreturn = -1; } return FBTreturn;
}
// --></script>
I also put together a page where you can manually enter the parameters and play with it: http://weather.stadhaugh.com/Frostbite.htmlFeel free to abuse it in search of errors. Edit to fix Celsius
|
|
|
|
« Last Edit: January 06, 2011, 09:11:40 PM by C5250 »
|
Logged
|
Precious little in your life is yours by right and won without a fight.
|
|
|
|
Axelvold
|
 |
« Reply #9 on: January 05, 2011, 05:45:18 AM » |
|
I slapped this together pretty quick, but I think it should work. <script language="JavaScript"> <!-- // FrostbiteTime // version: 1.0 // date: 4 Jan 2011 // author: WIEST // // Function to return Time to Frostbite in minutes. // // Parameters: // // FBScale - Use "F" for Fahrenheit/mph, or "C" for Celsius/kph // FBtemp - Temperature in the scale selected by FBScale // FBwind - Wind speed in the scale selected by FBScale // // Return Values: // // If the temperature is between -50F and 10F with a wind speed // between 0 mph and 50 mph, or -15C and -50C with a wind speed // between 0 kph and 80 kph, the returned value will be the // calculated potential time to Frostbite. // // 0 = Not calculated // -1 = Out of range or no Frostbite risk // // Frostbite times obtained from the charts at: // http://www.ofcm.gov/jagti/r19-ti-plan/pdf/03_chap3.pdf //
function FrostbiteTime( FBScale, FBtemp, FBwind ) {
var FBTarray = new Array();
FBtemp = Math.round(FBtemp)+50; FBtemp = FBtemp / 5; FBtemp = Math.round(FBtemp);
if ( FBScale=="F" && FBtemp <= 13 && FBtemp >= -1 && FBwind <= 60) { FBwind = Math.round(FBwind / 5);
FBTarray[0] = new Array( 7, 8, 9, 11, 12, 14, 17, 22, 31, 180, 180, 180, 180 ); FBTarray[1] = new Array( 5, 6, 7, 7, 9, 10, 12, 15, 19, 28, 180, 180, 180 ); FBTarray[2] = new Array( 4, 4, 5, 6, 7, 8, 9, 12, 15, 20, 33, 180, 180); FBTarray[3] = new Array( 3, 4, 4, 5, 6, 8, 8, 9, 12, 16, 23, 180, 180 ); FBTarray[4] = new Array( 3, 3, 4, 4, 5, 6, 7, 8, 10, 13, 19, 42, 180 ); FBTarray[5] = new Array( 2, 3, 3, 4, 4, 5, 6, 7, 9, 12, 16, 28, 180 ); FBTarray[6] = new Array( 2, 2, 3, 3, 4, 4, 5, 6, 8, 10, 14, 23, 180 ); FBTarray[7] = new Array( 2, 2, 2, 3, 3, 4, 5, 6, 7, 9, 13, 20, 180 ); FBTarray[8] = new Array( 2, 2, 2, 3, 3, 4, 4, 5, 7, 8, 12, 18, 180 ); FBTarray[9] = new Array( 2, 2, 2, 2, 3, 3, 4, 5, 6, 8, 11, 16, 180 );
FBTreturn = FBTarray[FBwind][FBtemp]; } else if (FBScale=="C" && FBtemp >= 8 && FBtemp <= -1 && FBwind >= 90 ) {
FBwind = Math.round(FBwind / 10);
FBTarray[0] = new Array( 6, 7, 8, 11, 15, 22, 180, 180 ); FBTarray[1] = new Array( 4, 5, 6, 7, 10, 14, 180, 180 ); FBTarray[2] = new Array( 3, 4, 4, 6, 8, 11, 18, 180 ); FBTarray[3] = new Array( 2, 3, 4, 5, 6, 9, 14, 42 ); FBTarray[4] = new Array( 2, 2, 3, 4, 5, 8, 12, 27 ); FBTarrat[5] = new Array( 2, 2, 3, 3, 5, 7, 10, 22 ); FBTarray[6] = new Array( 2, 2, 2, 3, 4, 6, 9, 18 ); FBTarray[7] = new Array( 1, 2, 2, 3, 4, 5, 8, 16 );
FBTreturn = FBTarray[FBwind][FBtemp]; } else {
if ( FBScale == "F" || "C" ) { FBTreturn = -1; } else { FBTreturn = 0; } } if (FBTreturn == 180) { FBTreturn = -1; } return FBTreturn;
}
// --></script>
I also put together a page where you can manually enter the parameters and play with it: http://weather.stadhaugh.com/Frostbite.htmlFeel free to abuse it in search of errors. I cant get this to work, it will only return -1, no matter what I put in to the boxes.
|
|
|
|
|
Logged
|
Lars Magnusson Axelvold / Sweden 55° 57' 41" N / 13° 6' 1" E WX Station: Davis Vantage Pro2 Plus  
|
|
|
|
|
|
Axelvold
|
 |
« Reply #11 on: January 05, 2011, 03:49:53 PM » |
|
If I want to calculate temperatures below -15 C how should i do that?
Or is not possible to get frostbite below -15 C?
I'm intresting in -10, -5 and if possible 0
|
|
|
|
|
Logged
|
Lars Magnusson Axelvold / Sweden 55° 57' 41" N / 13° 6' 1" E WX Station: Davis Vantage Pro2 Plus  
|
|
|
|
mackbig
|
 |
« Reply #12 on: January 05, 2011, 04:04:29 PM » |
|
I thought you could get frost bite that low, but according to the inventors of modern windchill the risk does not start till -25 http://www.ec.gc.ca/media_archive/press/2001/011030_n_e.htmAndrew If I want to calculate temperatures below -15 C how should i do that?
Or is not possible to get frostbite below -15 C?
I'm intresting in -10, -5 and if possible 0
|
|
|
|
|
Logged
|
 Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display. Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64
|
|
|
jmcmurry
Jim McMurry
Senior Contributor
  
Offline
Posts: 255
Davis Vantage Pro 2 Plus Wireless.
|
 |
« Reply #13 on: January 05, 2011, 04:20:40 PM » |
|
Lars, I haven't been able to get anything but -1 yet either. Must be something I'm doing wrong so I'll keep trying. If there's a math whiz out there I found some formulas at http://www.survivaltopics.com/survival/the-wind-chill-factor/ that might be appropriate. - Jim
|
|
|
|
|
Logged
|
|
|
|
|
Axelvold
|
 |
« Reply #14 on: January 05, 2011, 04:32:41 PM » |
|
It does work with F but not C. I did find that formula as well. I was thinking of putting that in excel, but I'm no excel expert so I can't figure it out how to get it wotking.
|
|
|
|
« Last Edit: January 05, 2011, 04:35:50 PM by Axelvold »
|
Logged
|
Lars Magnusson Axelvold / Sweden 55° 57' 41" N / 13° 6' 1" E WX Station: Davis Vantage Pro2 Plus  
|
|
|
|
C5250
|
 |
« Reply #15 on: January 05, 2011, 05:13:54 PM » |
|
If I want to calculate temperatures below -15 C how should i do that?
Or is not possible to get frostbite below -15 C?
I'm intresting in -10, -5 and if possible 0
It's typically not bothered with because the time is greater than 180 minutes. My script is designed to return -1 if that is the frostbite time (effectively, little to no risk of frostbite). It does work with F but not C.
I did find that formula as well.
I was thinking of putting that in excel, but I'm no excel expert so I can't figure it out how to get it wotking.
Oops! I was doing most of my testing using F, and only did some token testing using C. I did say feel free to abuse it (find the flaws), so Thanks all for finding that problem. It's fixed and Celsius works properly now. Also edited my previous post to include the fix. I had found a couple of slightly different formulas, but a lookup table is faster, easier in this case, and works just as well.
|
|
|
|
|
Logged
|
Precious little in your life is yours by right and won without a fight.
|
|
|
jmcmurry
Jim McMurry
Senior Contributor
  
Offline
Posts: 255
Davis Vantage Pro 2 Plus Wireless.
|
 |
« Reply #16 on: January 05, 2011, 08:42:00 PM » |
|
Yes, with that change it works for C and gets pretty close to the table. Thanks for working this up for us. I've got it in my site now but hope it never shows up ... but I know it will.
- Jim
|
|
|
|
|
Logged
|
|
|
|
|
Axelvold
|
 |
« Reply #17 on: January 05, 2011, 08:42:43 PM » |
|
If I want to calculate temperatures below -15 C how should i do that?
Or is not possible to get frostbite below -15 C?
I'm intresting in -10, -5 and if possible 0
It's typically not bothered with because the time is greater than 180 minutes. My script is designed to return -1 if that is the frostbite time (effectively, little to no risk of frostbite). It does work with F but not C.
I did find that formula as well.
I was thinking of putting that in excel, but I'm no excel expert so I can't figure it out how to get it wotking.
Oops! I was doing most of my testing using F, and only did some token testing using C. I did say feel free to abuse it (find the flaws), so Thanks all for finding that problem. It's fixed and Celsius works properly now. Also edited my previous post to include the fix. I had found a couple of slightly different formulas, but a lookup table is faster, easier in this case, and works just as well. Now it's working in C as well. -10 C @ 20 m/s would cause a frostbite before 180 min, would it not?
|
|
|
|
|
Logged
|
Lars Magnusson Axelvold / Sweden 55° 57' 41" N / 13° 6' 1" E WX Station: Davis Vantage Pro2 Plus  
|
|
|
|
C5250
|
 |
« Reply #18 on: January 05, 2011, 10:40:54 PM » |
|
Now it's working in C as well.
-10 C @ 20 m/s would cause a frostbite before 180 min, would it not?
I used the charts at http://www.ofcm.gov/jagti/r19-ti-plan/pdf/03_chap3.pdf, they are on page 10 of that document. If you read the rest of the document, it summarizes the experiments that where done to determine frostbite risk. Of note was that it was found that typically actual temp had to be notably below freezing before there was a notable risk. Also noted is that solar irradiation, activity level and physical health effects the risk. Certainly, someone in poor health doing nothing on cloudy day with a temp not much less than freezing would be at risk. But the charts are designed to reflect a 5% risk to a person doing normal light outdoor activity. And solar irradiation was deemed to difficult to incorporate. Overall, I feel the assumptions and conclusions are proper. The important thing is that when the risk is getting down to about 10 mins, or less, everyone needs to be aware of the risk.
|
|
|
|
|
Logged
|
Precious little in your life is yours by right and won without a fight.
|
|
|
|
Axelvold
|
 |
« Reply #19 on: January 06, 2011, 03:02:05 AM » |
|
Now it's working in C as well.
-10 C @ 20 m/s would cause a frostbite before 180 min, would it not?
I used the charts at http://www.ofcm.gov/jagti/r19-ti-plan/pdf/03_chap3.pdf, they are on page 10 of that document. If you read the rest of the document, it summarizes the experiments that where done to determine frostbite risk. Of note was that it was found that typically actual temp had to be notably below freezing before there was a notable risk. Also noted is that solar irradiation, activity level and physical health effects the risk. Certainly, someone in poor health doing nothing on cloudy day with a temp not much less than freezing would be at risk. But the charts are designed to reflect a 5% risk to a person doing normal light outdoor activity. And solar irradiation was deemed to difficult to incorporate. Overall, I feel the assumptions and conclusions are proper. The important thing is that when the risk is getting down to about 10 mins, or less, everyone needs to be aware of the risk. Ok, thanks for the information. What have to be modified if I want to calculate above -15C ?
|
|
|
|
|
Logged
|
Lars Magnusson Axelvold / Sweden 55° 57' 41" N / 13° 6' 1" E WX Station: Davis Vantage Pro2 Plus  
|
|
|
jmcmurry
Jim McMurry
Senior Contributor
  
Offline
Posts: 255
Davis Vantage Pro 2 Plus Wireless.
|
 |
« Reply #20 on: January 06, 2011, 11:38:41 AM » |
|
I looked at this again this morning and found that we were off by one row in the arrays. Easily fixed by subtracting 1 from each:
FBwind = Math.round(FBwind / 5) -1;
in the "F" array and
FBwind = Math.round(FBwind / 10) -1;
in the "C" array. I wondered why things were a little off when I compared to the chart last night and that was it.
Thanks again. - Jim
|
|
|
|
|
Logged
|
|
|
|
|
C5250
|
 |
« Reply #21 on: January 06, 2011, 06:16:49 PM » |
|
Ok, thanks for the information.
What have to be modified if I want to calculate above -15C ?
Probably not any point in doing so, it's a simple matter to add -10C, but it would easily be 180+ minutes for all wind speeds. On the fahrenheit chart the highest temperature is 10° and that has >2hr for all wind speeds, -10C is even warmer, about 14F. I looked at this again this morning and found that we were off by one row in the arrays. Easily fixed by subtracting 1 from each:
FBwind = Math.round(FBwind / 5) -1;
in the "F" array and
FBwind = Math.round(FBwind / 10) -1;
in the "C" array. I wondered why things were a little off when I compared to the chart last night and that was it.
Thanks again. - Jim
You must have managed to get a copy in between when I fixed the C problem and this problem. I was doing some more testing after fixing the C problem, and noticed the same issue myself and fixed it also yesterday.
|
|
|
|
|
Logged
|
Precious little in your life is yours by right and won without a fight.
|
|
|
|
C5250
|
 |
« Reply #22 on: January 06, 2011, 09:10:04 PM » |
|
Version 1.1 Two minor changes; 1. Added -10C - Better harmony with F including 10F, note that any wind speed in this temp range will return -1 (>2hr/180+) 2. Changed the return value for "out of range" to 0, this should make it easier to distinguish between an input error vs >2hr/180+ Frostbite time. <script language="JavaScript"> <!-- // FrostbiteTime // version: 1.1 // date: 6 Jan 2011 // author: WIEST // // Function to return Time to Frostbite in minutes. // // Parameters: // // FBScale - Use "F" for Fahrenheit/mph, or "C" for Celsius/kph // FBtemp - Temperature in the scale selected by FBScale // FBwind - Wind speed in the scale selected by FBScale // // Return Values: // // If the temperature is between -50F and 10F with a wind speed // between 0 mph and 50 mph, or -15C and -50C with a wind speed // between 0 kph and 80 kph, the returned value will be the // calculated potential time to Frostbite. // // 0 = Not calculated or Out of Range // -1 = Little or no Frostbite risk // // Frostbite times obtained from the charts at: // http://www.ofcm.gov/jagti/r19-ti-plan/pdf/03_chap3.pdf // // Version history: // 1.0 4 Jan 2011 first version // 1.1 6 Jan 2011 added -10C, changed "out of range" return value to 0 //
function FrostbiteTime( FBScale, FBtemp, FBwind ) {
var FBTarray = new Array(); FBtemp = Number(FBtemp); FBtemp = Math.round((FBtemp+50) / 5); if ( FBScale=="F" ) { FBwind = Math.round((FBwind / 5 ) -1 ); } else { FBwind = Math.round((FBwind / 10 ) -1 ); }
if (( FBScale=="F" ) && ( FBtemp <= 13 ) && ( FBtemp >= 0 ) && ( FBwind <= 9 )) {
FBTarray[0] = new Array( 7, 8, 9, 11, 12, 14, 17, 22, 31, 180, 180, 180, 180 ); FBTarray[1] = new Array( 5, 6, 7, 7, 9, 10, 12, 15, 19, 28, 180, 180, 180 ); FBTarray[2] = new Array( 4, 4, 5, 6, 7, 8, 9, 12, 15, 20, 33, 180, 180); FBTarray[3] = new Array( 3, 4, 4, 5, 6, 8, 8, 9, 12, 16, 23, 180, 180 ); FBTarray[4] = new Array( 3, 3, 4, 4, 5, 6, 7, 8, 10, 13, 19, 42, 180 ); FBTarray[5] = new Array( 2, 3, 3, 4, 4, 5, 6, 7, 9, 12, 16, 28, 180 ); FBTarray[6] = new Array( 2, 2, 3, 3, 4, 4, 5, 6, 8, 10, 14, 23, 180 ); FBTarray[7] = new Array( 2, 2, 2, 3, 3, 4, 5, 6, 7, 9, 13, 20, 180 ); FBTarray[8] = new Array( 2, 2, 2, 3, 3, 4, 4, 5, 7, 8, 12, 18, 180 ); FBTarray[9] = new Array( 2, 2, 2, 2, 3, 3, 4, 5, 6, 8, 11, 16, 180 );
FBTreturn = FBTarray[FBwind][FBtemp]; } else if (( FBScale=="C" ) && ( FBtemp <= 9 ) && ( FBtemp >= 0 ) && ( FBwind <= 7 )) {
FBTarray[0] = new Array( 6, 7, 8, 11, 15, 22, 180, 180, 180 ); FBTarray[1] = new Array( 4, 5, 6, 7, 10, 14, 180, 180, 180 ); FBTarray[2] = new Array( 3, 4, 4, 6, 8, 11, 18, 180, 180 ); FBTarray[3] = new Array( 2, 3, 4, 5, 6, 9, 14, 42, 180 ); FBTarray[4] = new Array( 2, 2, 3, 4, 5, 8, 12, 27, 180 ); FBTarray[5] = new Array( 2, 2, 3, 3, 5, 7, 10, 22, 180 ); FBTarray[6] = new Array( 2, 2, 2, 3, 4, 6, 9, 18, 180 ); FBTarray[7] = new Array( 1, 2, 2, 3, 4, 5, 8, 16, 180 );
FBTreturn = FBTarray[FBwind][FBtemp]; }
else { if ( FBScale == "F" || "C" ) { FBTreturn = 0; } }
if (FBTreturn == 180) { FBTreturn = -1; } return FBTreturn; }
Basic usage example (untested, use at your own risk): <script language="JavaScript"> <!--
FBTime = FrostbiteTime( "C", FBtemp, FBwind ); //"C" will use Celsius/kph
if (FBTime) { //FrostbiteTime returned something other than 0 if (FBTime = -1) { //Frostbite Time is 180+ minutes document.write("There is little risk of Frostbite."); } else { //FrostbiteTime returned a time document.write("Frostbite can occur in as little as " + FBTime + " minutes."); } else { //FrostbiteTime returned 0 //Little or no risk of Frostbite }
// --></script>
In this example, usage could be as simple as replacing FBtemp and FBwind with what ever variable your page creation software uses for Temperature and average wind speed. Also note that if you might actually see a temperature below -50C or F, you would probably want to check for that and add a message to warn of the severe potential for frostbite. Check the source of my calculator page at http://weather.stadhaugh.com/Frostbite.html for the function calcFBT for some more hints on more advanced usage, input range checking, return value handling, etc.
|
|
|
|
|
Logged
|
Precious little in your life is yours by right and won without a fight.
|
|
|
|
LFWX
|
 |
« Reply #23 on: January 07, 2011, 02:07:23 AM » |
|
What we REALLY need is for a Java Script Guru to convert the formula into Java Script for us!!!!!!  Per http://www.survivaltopics.com/survival/the-wind-chill-factor/Ft = ((-24.5 x ((0.667 x (V10 x 8/5)) + 4.8)) + 2111) x (-4.8 - ((Tair - 32) x 5/9)) -1.668
where Ft is the frostbite time in minutes, Tair and V are the air temperature in units of (°F) and wind speed in Miles per hour > 15 measured at a height of 33 feet
AND
Ft = ((-24.5 x ((0.667 x V10) + 4.8)) + 2111) x (-4.8 - Tair)-1.668
where Ft is the frostbite time in minutes, Tair and V are the air temperature in units of degrees Celcius and wind speed in Kiliometers per hour > 25 measured at a height of 10 meters
I'll do the hard part  V = Windspeed - 15 (MPH)
AND
V = Windspeed - 25 (KPH)
|
|
|
|
|
Logged
|
Station: Davis Vantage Pro2 Fan Aspirated Software: Virtual Weather Station V14.00p64 OS: Windows Vista Home Premium www.LFWeatherCenter.comCWOP: DW1039 CoCoRaHS: OH-BT-1 Weather Underground: KOHHAMIL7 Weather For You: DW1039 Midwestern Weather Network
|
|
|
|
mackbig
|
 |
« Reply #24 on: January 07, 2011, 07:27:28 AM » |
|
Isnt this (-4.8 - Tair)-1.668 supposed to be (-4.8 - Tair)^-1.668 ?
I was playing around with it in excel the other night, could not match their outputs using sample numbers
Andrew
|
|
|
|
|
Logged
|
 Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display. Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64
|
|
|
|