Skip to content

Commit 5ed5c31

Browse files
xssfoxTheSkorm
authored andcommitted
Skew-t filter bad data.
1 parent 9467398 commit 5ed5c31

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

js/sondehub.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2156,7 +2156,7 @@ function skewTdraw (callsign) {
21562156

21572157
// Extract temperature datapoint
21582158
if (entry.hasOwnProperty('temp')){
2159-
if(parseFloat(entry.temp) > -270.0){
2159+
if(parseFloat(entry.temp) > -250.0){
21602160
_temp = parseFloat(entry.temp);
21612161
} else{
21622162
idx = idx + 1;
@@ -2169,15 +2169,15 @@ function skewTdraw (callsign) {
21692169
}
21702170

21712171

2172+
_dewp = null;
2173+
21722174
// Try and extract RH datapoint
21732175
if (entry.hasOwnProperty('humidity')){
21742176
if(parseFloat(entry.humidity) >= 0.0){
21752177
_rh = parseFloat(entry.humidity);
21762178
// Calculate the dewpoint
21772179
_dewp = (243.04 * (Math.log(_rh / 100) + ((17.625 * _temp) / (243.04 + _temp))) / (17.625 - Math.log(_rh / 100) - ((17.625 * _temp) / (243.04 + _temp))));
2178-
} else {
2179-
_dewp = -1000.0;
2180-
}
2180+
}
21812181
}
21822182

21832183
// Calculate movement
@@ -2205,7 +2205,11 @@ function skewTdraw (callsign) {
22052205
break;
22062206
}
22072207

2208-
_new_skewt_data = {"press": _pressure, "hght": _new_pos.alt, "temp": _temp, "dwpt": _dewp, "wdir": _wdir, "wspd": _wspd};
2208+
_new_skewt_data = {"press": _pressure, "hght": _new_pos.alt, "temp": _temp, "wdir": _wdir, "wspd": _wspd};
2209+
2210+
if (_dewp != null){
2211+
_new_skewt_data.dwpt = _dewp
2212+
}
22092213

22102214
skewt_data.push(_new_skewt_data);
22112215

0 commit comments

Comments
 (0)