该函数用于修改排列序列。排列序列是在初始化时使用默认的序列或者手动定义,用于描述按顺序堆积各个地层单元的过程。
def modify_order_series(self, new_order_series: dict or list):
"""
Adjusts the order series of the units
Args:
new_order_series (dict or list): a numpy array or a dict containing the order series of the units
if dict, it needs to have the form
{"unit name": 1, "unit name2": 2, "unit name3": 3}
if list it needs to have the form:
["unit name1", "unit name2", "unit name3"]
"""
该方法没有返回值。它会直接修改项目的排列序列。
import gempy as gp
# 初始化项目
geo_model = gp.create_model('modify_order_series')
gp.init_data(geo_model, [0, 1, 0, 1, 0, 1], [0, 0, 1, 1, 2, 2], [0, 0, 0, 0, 0, 0],
[1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [1, 2, 3, 4, 5, 6],
path_i="interfaces", path_f="foliations")
# 打印默认序列
print(geo_model.order_series)
# 输出:{1: 0, 2: 1, 3: 2, 4: 3, 5: 4, 6: 5}
# 修改序列
geo_model.modify_order_series({'Default series':1,'Middle series':2,'Last series':3,'Another series':4,'Great series':5,'Fantasy series':6})
# 打印修改后的序列
print(geo_model.order_series)
# 输出:{'Default series': 1, 'Middle series': 2, 'Last series': 3, 'Another series': 4, 'Great series': 5, 'Fantasy series': 6}