get rid of rainfall filtering
This commit is contained in:
parent
7e112a78e6
commit
18423bec72
@ -1,6 +1,5 @@
|
||||
import { getDeviceList, Device, Interface, InEndpoint } from 'usb';
|
||||
|
||||
const MAX_RAIN_JUMP = 10;
|
||||
const WIND_DIRS = [
|
||||
'N',
|
||||
'NNE',
|
||||
@ -236,7 +235,7 @@ class WS1080 {
|
||||
|
||||
// Bytes 14 and 15 when combined create an unsigned short int
|
||||
// that we multiply by 0.3 to find the total rain
|
||||
let totalRain = currentBlock.subarray(13, 15).readUint16LE() * 0.3;
|
||||
const totalRain = currentBlock.subarray(13, 15).readUint16LE() * 0.3;
|
||||
|
||||
// Calculate wind speeds
|
||||
const windSpeed = (wind + ((windExtra & 0x0f) << 8)) * 0.38; // Was 0.1
|
||||
@ -251,14 +250,7 @@ class WS1080 {
|
||||
// Calculate rainfall rates
|
||||
if (this.previousRain === 0) this.previousRain = totalRain;
|
||||
|
||||
let rainDiff = totalRain - this.previousRain;
|
||||
|
||||
if (rainDiff > MAX_RAIN_JUMP) {
|
||||
// Filter rainfall spikes
|
||||
rainDiff = 0;
|
||||
totalRain = this.previousRain;
|
||||
}
|
||||
|
||||
const rainDiff = totalRain - this.previousRain;
|
||||
this.previousRain = totalRain;
|
||||
|
||||
// Compile the data
|
||||
|
Loading…
Reference in New Issue
Block a user