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

NaN on non-continuous fields #12

Closed holgerpieta closed 4 years ago

holgerpieta commented 4 years ago

Some fields (e.g. TM,TN or TX) have non-continuous data, i.e. in most time-steps they only contain a "-" and no data. Only once or twice a day there is a number. The node will always return NaN for those fields, because it tries to interpolate between two "-" or between one "-" and one number, which both doesn't work.

The most backwards compatible way of solving that would be to check for "-" before interpolating and returning either the value before or after (or any of those) instead of trying to interpolate. And only return NaN if both values are "-". Obvious drawback: It forces the user to find the right look ahead time to get the value she wants. I would prefer it to search for either the last or the next valid data point. Probably the last would be better.

holgerpieta commented 4 years ago

PR https://github.com/c5te1n/node-red-contrib-dwd-local-weather/pull/13 solves the problem by using the next forecast time point.

c5te1n commented 4 years ago

PR #13 is merged. Will be fixed in the next release of the node.