1

座標 (x、y、z) がわかっている一連の GPS ステーションがあり、ステーションごとにエラー (e) もあります。もちろん、これらのステーションは不均等な間隔で配置されています。問題は、ステーションのエラー e を計算するために、そのステーションのみを使用しましたが、他のステーションも考慮したいということです。

私の問題は次のとおりです。不等間隔の (x、y、z、e) ポイントのセットが与えられた場合、ポイント間の空間距離の関数で e を補間するにはどうすればよいですか? 既に持っているポイントで e を再計算しているので、補間は正確である必要はありません。また、逆距離などよりもきれいなものを探しています。たとえば、スプラインはいいでしょう。

私が読んだことから、 scipy.interpolate パッケージの splev 関数はそのトリックを行うようですが、それがどのように機能するか、または引数として何を与えるべきかを理解できません。

誰かがこれがどのように機能するかを説明するか、別の方法を教えてくれます。それは素晴らしいことです。

4

1 に答える 1

1

If I understood your question correctly, you have a point x,y,z in space, and you would like to calculate the error by interpolating from the known stations. You also suggest that the validity of an error reading depends on the distance from the point where the error is known.

So, for a point x,y,z you can calculate its distance from each of the known receiving stations. Then you have some weight function calculated from each of these distances. Finally, you take a weighted average by the weight functions (or possibly do some other trickery to eliminate outliers).

How about this:

# known station coordinates (number of rows matching number of stations)
coords = array([
    (x1, y1, z1),
    (x2, y2, z2),
    ... ])
# respective error values (number of items matching number of stations)
err_values = array([
    e1,
    e2),
    ... ])

# p is a three-element array representing our coordinates
# distances will contain the spatial euclidian distances to the stations 
distances = numpy.linalg.norm(coords - p[None,:], axis=1)

# get the weights somehow
weights = my_weight_function(distances)

# return the weighted average
return numpy.average(err_values, weights=weights)

There is one more trick which might be useful especially in this case. The last statement could be replaced by:

return numpy.sum(err_values * weights) / (eps + numpy.sum(weights))

Basically a weighted sum, but a small number eps added to the denominator. The point here is that as we talk about an error, it should be zero very far away from the known points. Otherwise we would often have an average of the known errors as the error on the other side of the globe, which is not reasonable. The only reasonable assumption is that the error is zero far away. It is not, but we do not know any better, and thus zero is the best guess.


If I understood your problem in a wrong way, let me know. (If you are thinking of the interpolation problem as a way to increase accuracy on the surface of the earth, you actually have a 2d problem on the surface of the globe, not a real 3D problem.)

于 2014-06-15T22:25:26.690 に答える