extract_each_surface_representations是Gempy中gempy.core.solution.Solution类的一个方法,用于提取每个表面的表示。
该方法没有任何参数。
该方法返回一个包含每个表面表示的列表。
import gempy as gp
# 加载数据
geo_model = gp.create_model('MyModel')
gp.init_data(
    geo_model,
    extent=[0, 10_000, 0, 10_000, 0, 10_000],
    resolution=[50, 50, 50],
)
# 添加地层学数据
gp.map_stack(
    geo_model,
    {"mylayer": 'bottom -> top', "myfault": 'top -> bottom'},
    {"mylayer": 6_000, "myfault": 5_000},
)
# 此处省略创建surface points、orientations和interpolation models的代码
# 构建模型
geo_model = gp.set_interpolator(
    geo_model,
    compile_theano=True,
    theano_optimizer='fast_compile',
)
solver = geo_model.solver
solver.tomography_config.set_values_by_name(
    {"field": "potential_field", "gradient": True, "lines": True}
)
# 建立模型的解决方案
gp.set_sharing_3_coords(geo_model)
solution = gp.compute_model(
    geo_model, compute_mesh=True, compute_gradients=True
)
# 提取每个表面的表示
surface_reps = solution.extract_each_surface_representations()
# 显示结果
print(surface_reps)
# 输出:
# [array([[ 6122.38884684,  3750.13942201,  6476.91996726],
#         [ 6149.47866103,  3726.32966639,  6443.37529558],
#         [ 7242.50686387,  3750.13942201,  6618.93577601],
#         ...,
#         [ 7270.39517096,  4454.71636351,  6830.27701753],
#         [ 7270.39517096,  4152.56681962,  6756.57170623],
#         [ 7270.39517096,  4056.06708485,  6740.39683428]])]
在上述示例中,我们首先创建了一个三维地质模型,并添加了一个地层学数据。我们然后构建了模型的解决方案,并使用extract_each_surface_representations方法提取了每个表面的表示。最后,我们打印了结果以进行验证。
extract_each_surface_representations方法只适用于求解的解决方案。numpy.ndarray 类型,维度为 $n \times 3$,其中 $n$ 为表面点的数量。gempy官方文档。