map_data_from_surfaces
是Gempy的SurfacePoints
类中的一个方法,用于将表面数据映射为对应的网格节点数据。
def map_data_from_surfaces(self, topology, extent):
"""
:param topology: Array with the topology of the interpolation generated
by the implicit model,
:param extent: grid extent
:return: Z interpolated values for surface points and also the input surface points
"""
SurfacePoints
类实例对象,并将表面点坐标和表面Id传递给它。map_data_from_surfaces
方法。map_data_from_surfaces
方法并传递网格范围,以获取插值后的表面点Z值和原始表面点数据。import gempy as gp
# 导入表面数据和内插点数据
surface_points = np.array([...]) # shape(20, 3)
surface_id = np.array([...]) # shape(20,)
interpolation_points = np.array([...]) # shape(10, 3)
# 初始化 SurfacePoints 对象
surface_points_object = gp.SurfacePoints(surface_points, surface_id)
# 创建隐式模型
model = gp.create_model('My Model')
gp.init_data(model, extent=[0, 5000, 0, 5000, -2000, 0])
gp.set_interpolator(model, theano_optimizer='fast_compile')
gp.add_surface_points(model, surface_points_object)
gp.add_orientations(model, orientations=[...], orientation_type="distances", float_errors=[...])
# 得到隐式模型的拓扑结构
topology = gp.compute_model(model)
# 获取表面数据的插值结果
Z, surface_points = surface_points_object.map_data_from_surfaces(topology, extent=[0, 5000, 0, 5000, -2000, 0])