You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I assume there is a bug in point.bilin function in interpol.R. When I do gribfile extraction with harp using bilinear interpolation this routine is called from transform_geofield.R. The point.bilin function returns a n x n matrix with n equals number of stations. The result variable in point.bilin looks like:
I do not know much about harp but binding the indices like: result <- weights$w00*infield[cbind(weights$i0, weights$j0)] + weights$w01*infield[cbind(weights$i0, weights$j1)] + weights$w10*infield[cbind(weights$i1, weights$j0)] + weights$w11*infield[cbind(weights$i1, weights$j1)]
You are right. I'm afraid I introduced this bug in the latest update. I actually fixed another (worse) bug in the interpolation, but I guess I only checked my clean-up with single points and full 2d fields, not with a list of stations (n>1). The older version actually used cbind more or less in the way you propose. I'll update the package asap. Thanks for reporting this.
I assume there is a bug in point.bilin function in interpol.R. When I do gribfile extraction with harp using bilinear interpolation this routine is called from transform_geofield.R. The point.bilin function returns a n x n matrix with n equals number of stations. The result variable in point.bilin looks like:
I do not know much about harp but binding the indices like:
result <- weights$w00*infield[cbind(weights$i0, weights$j0)] + weights$w01*infield[cbind(weights$i0, weights$j1)] + weights$w10*infield[cbind(weights$i1, weights$j0)] + weights$w11*infield[cbind(weights$i1, weights$j1)]
seems to fix this. The result now looks like:
However there might be a more 'R-like' solution to this issue, so I did not commit a pull request.
Best regards,
Florian
The text was updated successfully, but these errors were encountered: