pygplates.ResolvedTopologicalSharedSubSegment

class pygplates.ResolvedTopologicalSharedSubSegment

Bases: instance

The shared subset of vertices of a reconstructed topological section that uniquely contribute to the boundaries of one or more resolved topologies.

Note

Only ResolvedTopologicalBoundary and ResolvedTopologicalNetwork have boundaries and hence will share ResolvedTopologicalSharedSubSegment instances.
ResolvedTopologicalLine is excluded since it does not have a boundary.

TopologicalModel, TopologicalSnapshot or resolve_topologies() can be used to generate resolved topology boundaries (ResolvedTopologicalBoundary and ResolvedTopologicalNetwork) and the shared ResolvedTopologicalSharedSubSegment instances.

Note

Each ResolvedTopologicalSharedSubSegment instance can be shared by one or more resolved topologies.
In contrast, a ResolvedTopologicalSubSegment instance belongs to a single resolved topology.
__init__()

Raises an exception This class cannot be instantiated from Python

Methods

__init__

Raises an exception This class cannot be instantiated from Python

get_feature()

Same as get_topological_section_feature().

get_geometry()

Same as get_resolved_geometry().

get_overriding_and_subducting_plates(...)

Returns the overriding and subducting plates at this subduction zone.

get_overriding_plate(...)

Returns the overriding plate (or network) at this subduction zone.

get_resolved_feature()

Returns a feature containing the resolved sub-segment geometry.

get_resolved_geometry()

Returns the geometry containing the shared sub-segment vertices.

get_resolved_geometry_point_velocities(...)

Returns the velocities of the resolved geometry points.

get_resolved_geometry_points()

Returns the points of the resolved geometry.

get_sharing_resolved_topologies()

Returns a list of resolved topologies sharing this sub-segment.

get_sharing_resolved_topology_geometry_reversal_flags()

Returns a list of flags indicating whether a copy of the sub-segment geometry was reversed when contributing to each resolved topology sharing this sub-segment.

get_sharing_resolved_topology_on_left_flags()

Returns a list of flags indicating whether each resolved topology (sharing this sub-segment) is on left of this sub-segment.

get_sub_segments()

If this sub-segment is from a topological line section then return the child sub-segments of the topological line contributing to this sub-segment, otherwise return None.

get_subducting_plate(...)

Returns the subducting plate (or network) at this subduction zone.

get_topological_section()

Returns the topological section that the shared sub-segment was obtained from.

get_topological_section_feature()

Returns the feature referenced by the topological section.

get_topological_section_geometry()

Returns the topological section geometry that the shared sub-segment was obtained from.

get_feature()

Same as get_topological_section_feature().

Warning

The geometry in the feature is present day geometry - it is NOT reconstructed like get_geometry() is.
See get_resolved_feature() for a resolved feature containing reconstructed geometry.
get_geometry()

Same as get_resolved_geometry().

get_overriding_and_subducting_plates([return_subduction_polarity=False][, enforce_single_plates=True])

Returns the overriding and subducting plates at this subduction zone.

Parameters:
  • return_subduction_polarity (bool) – whether to also return the subduction polarity (defaults to False)

  • enforce_single_plates (bool) – whether to require a single overriding plate/network and a single subducting plate/network (defaults to True)

Returns:

a 2-tuple containing the overriding and subducting resolved boundaries/networks, or a 3-tuple that also contains the subduction polarity (‘Left’ or ‘Right’) if return_subduction_polarity is True, or None if the subduction polarity is not ‘Left’ or ‘Right’ (or doesn’t exist), or None if enforce_single_plates is True and there is not exactly one overriding plate or one overriding network or one overriding plate and network attached to this sub-segment, or None if enforce_single_plates is True and there is not exactly one subducting plate or one subducting network or one subducting plate and network attached to this sub-segment

Return type:

2-tuple of ReconstructionGeometry (or None if enforce_single_plates is False), or 3-tuple appending a str, or None

Note

If there is an overriding plate and an overriding network attached to this sub-segment then the overriding network is returned (since networks overlay plates). The same applies to subducting plates and networks.

Note

If enforce_single_plates is False, then None could be returned for the overriding plate/network (if none are found), and if more than one overriding plate (or more than one overriding network) is found then it is arbitrary which overriding plate (or network) is returned. The same applies to subducting plates and networks. This also means it’s possible that None could be returned for both the overriding and subducting plates.

Note

This method does not require the feature type (of this sub-segment) to be pygplates.FeatureType.gpml_subduction_zone. It only requires a pygplates.PropertyName.gpml_subduction_polarity feature property.

To find the overriding and subducting plate IDs of all subduction zone lines:

# Resolve our topological plate polygons (and deforming networks) to the current 'time'.
# We generate both the resolved topology boundaries and the boundary sections between them.
resolved_topologies = []
shared_boundary_sections = []
pygplates.resolve_topologies(topology_features, rotation_model, resolved_topologies, time, shared_boundary_sections)

# Iterate over the shared boundary sections of all resolved topologies.
for shared_boundary_section in shared_boundary_sections:

    # Skip sections that are not subduction zones.
    if shared_boundary_section.get_feature().get_feature_type() != pygplates.FeatureType.gpml_subduction_zone:
        continue

    # Iterate over the shared sub-segments of the current subducting line.
    # These are the parts of the subducting line that actually contribute to topological boundaries.
    for shared_sub_segment in shared_boundary_section.get_shared_sub_segments():

        # Get the overriding and subducting resolved plates/networks on either side of the current shared sub-segment.
        overriding_and_subducting_plates = shared_sub_segment.get_overriding_and_subducting_plates(
                return_subduction_polarity=True)
        if overriding_and_subducting_plates:
            overriding_plate, subducting_plate, subduction_polarity = overriding_and_subducting_plates
            overriding_plate_id = overriding_plate.get_feature().get_reconstruction_plate_id()
            subducting_plate_id = subducting_plate.get_feature().get_reconstruction_plate_id()

Added in version 0.23.

Changed in version 0.50:

  • Allow one overriding plate and one overriding network (latter is then returned).

  • Allow one subducting plate and one subducting network (latter is then returned).

  • Added enforce_single_plates argument.

get_overriding_plate([return_subduction_polarity=False][, enforce_single_plate=True])

Returns the overriding plate (or network) at this subduction zone.

Parameters:
  • return_subduction_polarity (bool) – whether to also return the subduction polarity

  • enforce_single_plate (bool) – whether to require a single overriding plate/network (defaults to True)

Returns:

overriding resolved boundary/network, or a 2-tuple that also contains the subduction polarity (‘Left’ or ‘Right’) if return_subduction_polarity is True, or None if the subduction polarity is not ‘Left’ or ‘Right’ (or doesn’t exist), or None if enforce_single_plate is True and there is not exactly one overriding plate or one overriding network or one overriding plate and network attached to this sub-segment

Return type:

ReconstructionGeometry (or None if enforce_single_plate is False), or 2-tuple appending a str, or None

Note

If there is an overriding plate and an overriding network attached to this sub-segment then the overriding network is returned (since networks overlay plates).

Note

If enforce_single_plate is False, then None could be returned for the overriding plate/network (if none are found), and if more than one overriding plate (or more than one overriding network) is found then it is arbitrary which overriding plate (or network) is returned.

Note

The number of subducting plates and networks is not considered (only overriding plates/networks are considered). In other words, if enforce_single_plate is True, it is not required to have exactly one subducting plate or one subducting network or one subducting plate and network attached to this sub-segment.

Note

This method does not require the feature type (of this sub-segment) to be pygplates.FeatureType.gpml_subduction_zone. It only requires a pygplates.PropertyName.gpml_subduction_polarity feature property.

To find the plate ID of each overriding plate attached to each subduction zone line sub-segment:

# Resolve our topological plate polygons (and deforming networks) to the current 'time'.
# We generate both the resolved topology boundaries and the boundary sections between them.
resolved_topologies = []
shared_boundary_sections = []
pygplates.resolve_topologies(topology_features, rotation_model, resolved_topologies, time, shared_boundary_sections)

# Iterate over the shared boundary sections of all resolved topologies.
for shared_boundary_section in shared_boundary_sections:

    # Skip sections that are not subduction zones.
    if shared_boundary_section.get_feature().get_feature_type() != pygplates.FeatureType.gpml_subduction_zone:
        continue

    # Iterate over the shared sub-segments of the current subducting line.
    # These are the parts of the subducting line that actually contribute to topological boundaries.
    for shared_sub_segment in shared_boundary_section.get_shared_sub_segments():

        # Get the overriding resolved plate/network of the current shared sub-segment.
        overriding_plate_and_polarity = shared_sub_segment.get_overriding_plate(True)
        if overriding_plate_and_polarity:
            overriding_plate, subduction_polarity = overriding_plate_and_polarity
            overriding_plate_id = overriding_plate.get_feature().get_reconstruction_plate_id()

Added in version 0.50.

get_resolved_feature()

Returns a feature containing the resolved sub-segment geometry.

Return type:

Feature

The returned feature contains the resolved geometry.

Note

The returned feature does not contain present-day geometry as is typical of most GPlates features.
In this way the returned feature is similar to a GPlates reconstruction export.

Note

The returned feature should not be reverse reconstructed to present day because the topological section might be a ResolvedTopologicalLine which is a topology and topologies are resolved (not reconstructed).

get_resolved_geometry()

Returns the geometry containing the shared sub-segment vertices.

Return type:

PolylineOnSphere

Note

These are the unreversed vertices. They are in the same order as the geometry of get_topological_section_geometry(). If you need a reversed version of this resolved geometry (eg, due to get_sharing_resolved_topology_geometry_reversal_flags() returning True for a particular topology) then you can use pygplates.PolylineOnSphere(sub_segment.get_resolved_geometry()[::-1]).

get_resolved_geometry_point_velocities([velocity_delta_time=1.0][, velocity_delta_time_type=pygplates.VelocityDeltaTimeType.t_plus_delta_t_to_t][, velocity_units=pygplates.VelocityUnits.kms_per_my][, earth_radius_in_kms=pygplates.Earth.mean_radius_in_kms])

Returns the velocities of the resolved geometry points.

Parameters:
  • velocity_delta_time (float) – The time delta used to calculate velocities (defaults to 1 Myr).

  • velocity_delta_time_type (VelocityDeltaTimeType.t_plus_delta_t_to_t, VelocityDeltaTimeType.t_to_t_minus_delta_t or VelocityDeltaTimeType.t_plus_minus_half_delta_t) – How the two velocity times are calculated relative to the reconstruction time. This includes [t+dt, t], [t, t-dt] and [t+dt/2, t-dt/2]. Defaults to [t+dt, t].

  • velocity_units (VelocityUnits.kms_per_my or VelocityUnits.cms_per_yr) – whether to return velocities as kilometres per million years or centimetres per year (defaults to kilometres per million years)

  • earth_radius_in_kms (float) – the radius of the Earth in kilometres (defaults to pygplates.Earth.mean_radius_in_kms)

Return type:

list of Vector3D

To associate each velocity with its point (in a sub-segment):

points = sub_segment.get_resolved_geometry_points()
velocities = sub_segment.get_resolved_geometry_point_velocities()

points_and_velocities = zip(points, point_velocities)

for point, velocity in points_and_velocities:
  ...

Added in version 0.50.

get_resolved_geometry_points()

Returns the points of the resolved geometry.

Return type:

list of PointOnSphere

This method is essentially equivalent to:

def get_resolved_geometry_points(resolved_topological_shared_sub_segment):
    return resolved_topological_shared_sub_segment.get_resolved_geometry().get_points()

Added in version 0.50.

get_sharing_resolved_topologies()

Returns a list of resolved topologies sharing this sub-segment.

Return type:

list of ReconstructionGeometry

Note

The resolved topologies (that share this sub-segment) can be ResolvedTopologicalBoundary and ResolvedTopologicalNetwork.
ResolvedTopologicalLine is excluded since it does not have a boundary.
get_sharing_resolved_topology_geometry_reversal_flags()

Returns a list of flags indicating whether a copy of the sub-segment geometry was reversed when contributing to each resolved topology sharing this sub-segment.

Return type:

list of bool

Note

The returned list is in the same order (and has the same number of elements) as the list of sharing resolved topologies returned in get_sharing_resolved_topologies().

sharing_resolved_topologies = shared_sub_segment.get_sharing_resolved_topologies()
geometry_reversal_flags = shared_sub_segment.get_sharing_resolved_topology_geometry_reversal_flags()
for index in range(len(sharing_resolved_topologies)):
    sharing_resolved_topology = sharing_resolved_topologies[index]
    geometry_reversal_flag = geometry_reversal_flags[index]
get_sharing_resolved_topology_on_left_flags()

Returns a list of flags indicating whether each resolved topology (sharing this sub-segment) is on left of this sub-segment.

Return type:

list of bool

The direction of this sub-segment (from which the left side can be determined) follows the order of points from the start to the end of the sub-segment. These are the unreversed points returned by get_resolved_geometry().

Note

The returned list is in the same order (and has the same number of elements) as the list of sharing resolved topologies returned in get_sharing_resolved_topologies().

sharing_resolved_topologies = shared_sub_segment.get_sharing_resolved_topologies()
topology_on_left_flags = shared_sub_segment.get_sharing_resolved_topology_on_left_flags()
for index in range(len(sharing_resolved_topologies)):
    sharing_resolved_topology = sharing_resolved_topologies[index]
    topology_on_left_flag = topology_on_left_flags[index]

Added in version 0.47.

get_sub_segments()

If this sub-segment is from a topological line section then return the child sub-segments of the topological line contributing to this sub-segment, otherwise return None.

Return type:

list of ResolvedTopologicalSubSegment, or None

To see if a shared sub-segment is from a topological line and then iterate over its child sub-segments:

child_sub_segments_of_topological_line_shared_sub_segment = shared_sub_segment.get_sub_segments()
if child_sub_segments_of_topological_line_shared_sub_segment:
    for child_sub_segment in child_sub_segments_of_topological_line_shared_sub_segment:
        child_sub_segment_geometry = child_sub_segment.get_resolved_geometry()
        child_sub_segment_plate_id = child_sub_segment.get_feature().get_reconstruction_plate_id()
else:
    sub_segment_geometry = shared_sub_segment.get_resolved_geometry()
    sub_segment_plate_id = shared_sub_segment.get_feature().get_reconstruction_plate_id()

Note

Each child sub-segment has its own reverse flag indicating whether it was reversed when contributing to this shared sub-segment. And this shared sub-segment also has a reverse flag, for each final boundary topology that shares it, which determines whether this shared sub-segment was reversed when contributing to each final boundary topology. So whether a child sub-segment was effectively reversed when contributing to a final boundary topology depends on both reverse flags (of the child sub-segment and this shared sub-segment). For example, if the child sub-segment was reversed in this shared sub-segment, and this shared sub-segment was reversed in a final boundary, then the child sub-segment was not reversed in that final boundary.

Added in version 0.22.

get_subducting_plate([return_subduction_polarity=False][, enforce_single_plate=True])

Returns the subducting plate (or network) at this subduction zone.

Parameters:
  • return_subduction_polarity (bool) – whether to also return the subduction polarity

  • enforce_single_plate (bool) – whether to require a single subducting plate/network (defaults to True)

Returns:

subducting resolved boundary/network, or a 2-tuple that also contains the subduction polarity (‘Left’ or ‘Right’) if return_subduction_polarity is True, or None if the subduction polarity is not ‘Left’ or ‘Right’ (or doesn’t exist), or None if enforce_single_plate is True and there is not exactly one subducting plate or one subducting network or one subducting plate and network attached to this sub-segment

Return type:

ReconstructionGeometry (or None if enforce_single_plate is False), or 2-tuple appending a str, or None

Note

If there is a subducting plate and a subducting network attached to this sub-segment then the subducting network is returned (since networks overlay plates).

Note

If enforce_single_plate is False, then None could be returned for the subducting plate/network (if none are found), and if more than one subducting plate (or more than one subducting network) is found then it is arbitrary which subducting plate (or network) is returned.

Note

The number of overriding plates and networks is not considered (only subducting plates/networks are considered). In other words, if enforce_single_plate is True, it is not required to have exactly one overriding plate or one overriding network or one overriding plate and network attached to this sub-segment.

Note

This method does not require the feature type (of this sub-segment) to be pygplates.FeatureType.gpml_subduction_zone. It only requires a pygplates.PropertyName.gpml_subduction_polarity feature property.

To find the plate ID of each subducting plate attached to each subduction zone line sub-segment:

# Resolve our topological plate polygons (and deforming networks) to the current 'time'.
# We generate both the resolved topology boundaries and the boundary sections between them.
resolved_topologies = []
shared_boundary_sections = []
pygplates.resolve_topologies(topology_features, rotation_model, resolved_topologies, time, shared_boundary_sections)

# Iterate over the shared boundary sections of all resolved topologies.
for shared_boundary_section in shared_boundary_sections:

    # Skip sections that are not subduction zones.
    if shared_boundary_section.get_feature().get_feature_type() != pygplates.FeatureType.gpml_subduction_zone:
        continue

    # Iterate over the shared sub-segments of the current subducting line.
    # These are the parts of the subducting line that actually contribute to topological boundaries.
    for shared_sub_segment in shared_boundary_section.get_shared_sub_segments():

        # Get the subducting resolved plate/network of the current shared sub-segment.
        subducting_plate_and_polarity = shared_sub_segment.get_subducting_plate(True)
        if subducting_plate_and_polarity:
            subducting_plate, subduction_polarity = subducting_plate_and_polarity
            subducting_plate_id = subducting_plate.get_feature().get_reconstruction_plate_id()

Added in version 0.30.

Changed in version 0.50:

  • Allow one subducting plate and one subducting network (latter is then returned).

  • Added enforce_single_plate argument.

get_topological_section()

Returns the topological section that the shared sub-segment was obtained from.

Return type:

ReconstructionGeometry

Note

This represents the entire geometry of the topological section, not just the part that contributes to the shared sub-segment.

Note

This topological section can be either a ReconstructedFeatureGeometry or a ResolvedTopologicalLine.
The resolved topologies that share the topological section can be ResolvedTopologicalBoundary and ResolvedTopologicalNetwork.
get_topological_section_feature()

Returns the feature referenced by the topological section.

Return type:

Feature

Note

The geometry in the returned feature represents the entire geometry of the topological section, not just the part that contributes to the shared sub-segment.

Warning

The geometry in the feature is present day geometry - it is NOT reconstructed like get_topological_section_geometry() is.
See get_resolved_feature() for a resolved feature containing reconstructed geometry.
get_topological_section_geometry()

Returns the topological section geometry that the shared sub-segment was obtained from.

Return type:

PolylineOnSphere

Note

This is the entire geometry of the topological section, not just the part that contributes to the shared sub-segment.