c5te1n / node-red-contrib-dwd-local-weather

Node Red node to retrieve local weather forecast from DWD (Germany)
Apache License 2.0
13 stars 11 forks source link

No interpolation for non-continuous fields #13

Closed holgerpieta closed 4 years ago

holgerpieta commented 4 years ago

This PR solves https://github.com/c5te1n/node-red-contrib-dwd-local-weather/issues/12

Some forecast fields are non-continuous, i.e. do not contain valid data for each forecast time point. Instead they just contain "-". Number.parseFloat() will parse that as NaN, causing the interpolation to fail and return NaN as well. Except for files that are fully in the future, nothing but NaN will be returned, because interpolation will always fail.

With this fix, the node first checks the previous forecast for NaN and only interpolates if it's a valid number. Resulting behavior:

c5te1n commented 4 years ago

Merged this into master.