subsection_id_filter
subsection_id_filter
¶
This module provides a class for filtering solution fault sections (subsections).
Classes:
Name | Description |
---|---|
FilterSubsectionIds |
a chainable filter for fault sections, returning qualifying fault section ids. |
Examples:
>>> ham50 = solvis.circle_polygon(50000, -37.78, 175.28) # 50km radius around Hamilton
<POLYGON ((175.849 -37.779, 175.847 -37.823, 175.839 -37.866, 175.825 -37.90...>
>>> solution = solvis.InversionSolution.from_archive(filename)
>>> rupture_ids = FilterRuptureIds(solution)\
.for_magnitude(min_mag=5.75, max_mag=6.25)\
.for_polygon(ham50)
>>> subsection_ids = FilterSubsectionIds(solution)\
>>> .for_rupture_ids(rupture_ids)
FilterSubsectionIds
¶
Bases: ChainableSetBase
A helper class to filter subsections, returning qualifying section_ids.
Source code in solvis/filter/subsection_id_filter.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
__init__(solution: InversionSolution)
¶
Instantiate a new filter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
solution
|
InversionSolution
|
The solution instance to filter on. |
required |
Source code in solvis/filter/subsection_id_filter.py
36 37 38 39 40 41 42 43 |
|
all() -> ChainableSetBase
¶
Convenience method returning ids for all solution fault subsections.
NB the usual join_prior
argument is not implemented as it doesn't seem useful here.
Returns:
Type | Description |
---|---|
ChainableSetBase
|
A chainable set of all the subsection_ids. |
Source code in solvis/filter/subsection_id_filter.py
45 46 47 48 49 50 51 52 53 54 |
|
for_named_fault_names(named_fault_names: Iterable[str], join_prior: Union[SetOperationEnum, str] = 'intersection') -> ChainableSetBase
¶
Find subsection ids that occur on any of the given named_fault names.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
named_fault_names
|
Iterable[str]
|
A list of one or more |
required |
Returns:
Type | Description |
---|---|
ChainableSetBase
|
The subsection_ids matching the filter. |
Raises:
Type | Description |
---|---|
ValueError
|
If any |
Source code in solvis/filter/subsection_id_filter.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|
for_parent_fault_ids(parent_fault_ids: Iterable[int], join_prior: Union[SetOperationEnum, str] = 'intersection') -> ChainableSetBase
¶
Find fault subsection ids for the given parent_fault ids.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parent_fault_ids
|
Iterable[int]
|
A list of one or more |
required |
Returns:
Type | Description |
---|---|
ChainableSetBase
|
The fault_subsection_ids matching the filter. |
Source code in solvis/filter/subsection_id_filter.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
for_parent_fault_names(parent_fault_names: Iterable[str], join_prior: Union[SetOperationEnum, str] = 'intersection') -> ChainableSetBase
¶
Find fault subsection ids for the given parent_fault names.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parent_fault_names
|
Iterable[str]
|
A list of one or more |
required |
Returns:
Type | Description |
---|---|
ChainableSetBase
|
The fault_subsection_ids matching the filter. |
Raises:
Type | Description |
---|---|
ValueError
|
If any |
Source code in solvis/filter/subsection_id_filter.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
for_polygon(polygon, contained=True) -> ChainableSetBase
¶
Source code in solvis/filter/subsection_id_filter.py
136 137 |
|
for_rupture_ids(rupture_ids: Iterable[int], join_prior: Union[SetOperationEnum, str] = 'intersection') -> ChainableSetBase
¶
Find fault subsection ids for the given rupture_ids.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rupture_ids
|
Iterable[int]
|
A list of one or more rupture ids. |
required |
Returns:
Type | Description |
---|---|
ChainableSetBase
|
The fault_subsection_ids matching the filter. |
Source code in solvis/filter/subsection_id_filter.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
tolist() -> List[int]
¶
Returns the fault subsection id as a list of integers.
Returns:
Type | Description |
---|---|
List[int]
|
A list of integers representing the filtered fault subsection ids. |
Source code in solvis/filter/subsection_id_filter.py
56 57 58 59 60 61 62 63 |
|