ASM #12085 SNOW: Wind Chill, Frostbite Time should not default to 0. - TTR6392

Change-Id: Ifb737f93e7299791e649898ee5dc804a596ce792

Former-commit-id: 5d86c95a07f9637beb23dcb866a93dc33d8aa888
This commit is contained in:
Zhidong.Hao 2016-02-23 10:18:56 -05:00
parent d2c142b7bf
commit 40e1782ab1

View file

@ -62,6 +62,7 @@ import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
* Nov 12, 2015 3841 dhladky Augmented Slav's update fix.
* Dec 02 2015 3873 dhladky Pulled 3841 changes to 16.1.1.
* Jan 11 2016 5219 dhladky Fixed damage done to cache management by recent updates.
* Feb 18, 2016 12085 zhao Modified/added Wind Chill & Frostbite calculation for SNOW
*
* </pre>
*
@ -153,8 +154,11 @@ public class ObMultiHrsReports {
&& report.getWindSpeed() != ObConst.MISSING) {
report.setWindChill(calcWindChill(report.getTemperature(),
report.getWindSpeed()));
report.setFrostbiteTime(calcFrostbiteTime(
report.getTemperature(), report.getWindSpeed()));
}
}
ObHourReports obHourReports;
// new nominal time; create a new ObHourReports object
if (multiHrsReports.isEmpty()
@ -180,24 +184,62 @@ public class ObMultiHrsReports {
}
/**
* Frostbite time calculation formula is based on section 3.4.3 of
* FCM-R19-2003; the equation is only valid when the frostbite time is less
* than or equal to 30 min and the wind speed is greater than 16 mph and
* less than or equal to 50 mph. The referenced document is available at
* http://www.ofcm.gov/jagti/r19-ti-plan/pdf/entire_r19_ti.pdf
*
* @param temperature
* in degree F
* @param windSpeed
* in knots
* @return frostbite time in minutes
*/
private float calcFrostbiteTime(float temp, float windSpd) {
/**
* 1 knots = 1.15078 mph
*/
float windSpd_mph = 1.15078f * windSpd;
if (windSpd_mph <= 16 || windSpd_mph > 50) {
return ObConst.MISSING;
}
float xFt = -4.8f - (temp - 32f) * 5f / 9f;
if (xFt <= 0) {
return ObConst.MISSING;
}
xFt = (float) Math.pow(xFt, -1.668);
float Ft = ((-24.5f * ((0.667f * (windSpd_mph * 8f / 5f)) + 4.8f)) + 2111f)
* xFt;
if (Ft < 0 || Ft > 30f) {
return ObConst.MISSING;
}
return Ft;
}
/**
* DR 15654: Wind Chill calculation formula based on
* http://www.nws.noaa.gov/om/windchill/ as of Jan. 29, 2013
*
* @param temp
* @param temperature
* in degree F
* @param windSpd
* @param windSpeed
* in knots
* @return wind chill in degree F
*/
private float calcWindChill(float temp, float windSpd) {
if (temp > 50.0 || windSpd < 3.0) {
if (temp > 50.0) {
return ObConst.MISSING;
}
/**
* 1 knots = 1.15078 mph
*/
float spd = (float) Math.pow(1.15078 * windSpd, 0.16);
float windSpd_mph = 1.15078f * windSpd;
if (windSpd_mph < 3.0) {
return temp;
}
float spd = (float) Math.pow(windSpd_mph, 0.16);
return 35.74f + 0.6215f * temp - 35.75f * spd + 0.4275f * temp * spd;
}