Required
layered_model| Type: | LayeredModel |
| Description: | The layered model to split. |
True for a given
layer, the layered model is split at that layer's top interface. To be
clear, splitting the following model:LayeredModel([ interface.Hyperplane.at(1.0), material.acoustic.Velocity.from_params(rho=1.0, vp=1.0), interface.Hyperplane.at(0.66), material.acoustic.Velocity.from_params(rho=1.0, vp=1.0), interface.Hyperplane.at(0.33), material.acoustic.Velocity.from_params(rho=1.0, vp=1.0), interface.Hyperplane.at(0.0), ])
`lambda lay: lay.bot.max_elevation == 0.33`
``` ( LayeredModel([ interface.Hyperplane.at(1.0), material.acoustic.Velocity.from_params(rho=1.0, vp=1.0), interface.Hyperplane.at(0.66), ]), LayeredModel([ interface.Hyperplane.at(0.66), material.acoustic.Velocity.from_params(rho=1.0, vp=1.0), interface.Hyperplane.at(0.33), material.acoustic.Velocity.from_params(rho=1.0, vp=1.0), interface.Hyperplane.at(0.0), ]) ) ```
`lambda lay: lay.top.max_elevation = 0.33`
``` ( LayeredModel([ interface.Hyperplane.at(1.0), material.acoustic.Velocity.from_params(rho=1.0, vp=1.0), interface.Hyperplane.at(0.66), material.acoustic.Velocity.from_params(rho=1.0, vp=1.0), interface.Hyperplane.at(0.33), ]), LayeredModel([ interface.Hyperplane.at(0.33), material.acoustic.Velocity.from_params(rho=1.0, vp=1.0), interface.Hyperplane.at(0.0), ]) ) ```
True for the top layer, or that it
returns False for all layers. In the first case, the return value of this
function will be:`(None, layered_model)`
False for all layers, the return value of this function
will be:`(layered_model, None)`
def split_layered_model(
layered_model: LayeredModel, predicate: typing.Callable[[Layer], bool]
) -> tuple[LayeredModel | None, LayeredModel | None]: ...| Type: | LayeredModel |
| Description: | The layered model to split. |
| Type: | typing.Callable[[Layer], bool] |
| Description: | A callable taking a layer as input, and returning True to signify that a split should be done at the top of the layer, otherwise returning False. |
tuple[LayeredModel | None, LayeredModel | None]None if a split has not occurred.