【发布时间】:2021-10-25 18:01:31
【问题描述】:
我执行了球面克里金法,但我似乎无法获得好的输出图。 坐标(x 和 y)的范围从大约 51 纬度到大约 6.5 经度 我的观察范围从 -70 到 +10 这是我的代码:
import openturns as ot
import pandas as pd
# your input / output data can be easily formatted as samples for openturns
df = pd.read_csv("kreuzkerpenutm.csv")
inputdata = ot.Sample(df[['x','y']].values)
outputdata = ot.Sample(df[['z']].values)
dimension = 2 # dimension of your input (x,y)
basis = ot.ConstantBasisFactory(dimension).build()
covarianceModel = ot.SphericalModel(dimension)
algo = ot.KrigingAlgorithm(inputdata, outputdata, covarianceModel, basis)
algo.run()
result = algo.getResult()
metamodel = result.getMetaModel()
lower = [-10.0] * 2 # lower bound of the 2D window
upper = [50.0] * 2 # upper bound of the 2D window
graph = metamodel.draw(lower, upper)
graph.setBoundingBox(ot.Interval(lower, upper))
graph.add(ot.Cloud(inputdata)) # overlay a scatter plot of the observation points
graph.setTitle("Kriging metamodel")
# A View object allows us to interact with the underlying matplotlib figure
from openturns.viewer import View
view = View(graph, legend_kw={'bbox_to_anchor':(1,1), 'loc':"upper left"})
view.getFigure().tight_layout()
这是我的输出:
我不知道为什么我的图表不会显示我的输入以及我的克里金结果。
感谢您的想法和帮助
【问题讨论】:
-
提供和回答并不容易,因为我无法访问 .csv 文件。您会将脚本更新为重现您的问题的最小工作示例吗?
标签: pandas kriging spatial-interpolation gaussian-process openturns