该函数是Sections类的一个方法,用于获取section的参数。
def get_section_params(self, section=None):
"""
get_section_params: Returns the properties that define the input section.
:param section: None or str; Name of the section. If None and there is only one, takes that one.
:return: tuple of floats or integers; depends on the resolution.
"""
import gempy as gp
# 创建模型
geo_model = gp.create_model("Example")
# 设置模型
gp.init_data(geo_model, [0, 1000, 0, 1000, 0, 1000], [50, 50, 2], path_i="./input_data/simple_fault_model_orientations.csv", path_o="./input_data/simple_fault_model_foliations.csv")
# 进行地层建模
gp.set_interpolator(geo_model, theano_optimizer="fast_run")
gp.compute_model(geo_model)
geo_model.surfaces
section_name = "section"
geo_model.add_section(section_name, [0, 1000, 0, 800, 0, 1000])
geo_model.set_section_grid(section_name)
# 获取section参数
section_params = geo_model.solutions.grid.get_section_params(section_name)
print(section_params)
# (array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
# 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 13., 27.,
# 40., 53., ... , 987., 993., 1000.]),
# array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
# 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
# ... , 987., 993., 1000.]),
# array([ 0., 1000.]))