source_logic_tree
logic_tree
¶
Defines source logic tree structures used in NSHM.
DistributedSource
dataclass
¶
A gridded hazard source built from a background (off-fault) seismic rate model
Contains the specific identifiers used in NSHM Toshi API.
Attributes:
Name | Type | Description |
---|---|---|
nrml_id |
str
|
toshi_id for a NRML source file (needed by openquake) |
rupture_rate_scaling |
Union[float, None]
|
the scaling ratio |
type |
str
|
constant "distributed" |
Source code in nzshm_model/logic_tree/source_logic_tree/logic_tree.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
InversionSource
dataclass
¶
A hazard source built from an NSHM Grand Inversion experiment
Contains the specific identifiers used in NSHM Toshi API.
Attributes:
Name | Type | Description |
---|---|---|
nrml_id |
str
|
toshi_id for a NRML source file (needed by openquake) |
rupture_rate_scaling |
Union[float, None]
|
the scaling ratio |
inversion_id |
Union[str, None]
|
toshi_id for the source inversion solution |
rupture_set_id |
Union[str, None]
|
toshi_id for the source rupture set |
inversion_solution_type |
Union[str, None]
|
type (if any) of the source inversion solution |
type |
str
|
constant "inversion" |
Source code in nzshm_model/logic_tree/source_logic_tree/logic_tree.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
SourceBranch
dataclass
¶
Bases: Branch
A source branch can contain multiple sources.
Contains the specific identifiers used in NSHM Toshi API.
Attributes:
Name | Type | Description |
---|---|---|
values |
List[BranchAttributeValue]
|
list of attribute values that define the branch. |
sources |
List[Union[DistributedSource, InversionSource]]
|
list of branch sources. |
rupture_rate_scaling |
float
|
the scaling ratio. |
Source code in nzshm_model/logic_tree/source_logic_tree/logic_tree.py
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 |
|
tag
property
¶
tag identifies a branch based on its values (BranchAttributeValue).
Returns:
Type | Description |
---|---|
str
|
a string representation of the the list of values |
filtered_branch(logic_tree, branch_set)
¶
get a filtered branch containing reference to parent instances.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
logic_tree
|
LogicTree
|
the source_logic_tree containing the branch |
required |
branch_set
|
BranchSet
|
the branch_set containing the branch |
required |
Returns:
Type | Description |
---|---|
FilteredBranch
|
a SourceFilteredBranch instance |
Source code in nzshm_model/logic_tree/source_logic_tree/logic_tree.py
81 82 83 84 85 86 87 88 89 90 91 |
|
SourceBranchSet
dataclass
¶
Bases: BranchSet[SourceBranch]
A list of Source Branches.
Attributes:
Name | Type | Description |
---|---|---|
branches |
List[SourceBranch]
|
list of branches. |
Source code in nzshm_model/logic_tree/source_logic_tree/logic_tree.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
SourceFilteredBranch
dataclass
¶
Bases: FilteredBranch
, SourceBranch
A logic tree source branch with additional properties
Used to represent a branch that has been pruned (filtered) from a complete Source Logic Tree (SLT). The additional properties make the prundd branch traceable to its original SLT.
Attributes:
Name | Type | Description |
---|---|---|
logic_tree |
LogicTree
|
the source_logic_tree containing the branch |
branch_set |
BranchSet
|
the branch_set containing the branch |
Source code in nzshm_model/logic_tree/source_logic_tree/logic_tree.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 |
|
SourceLogicTree
dataclass
¶
Bases: LogicTree['SourceFilteredBranch']
A dataclass representing a source logic tree
Attributes:
Name | Type | Description |
---|---|---|
branch_sets |
List[SourceBranchSet]
|
list of branch sets in this tree |
logic_tree_version |
Union[int, None]
|
constant = 2 |
Source code in nzshm_model/logic_tree/source_logic_tree/logic_tree.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
|
fault_system_lts
property
¶
API alias for branch_sets (deprecated)
fault_systems
property
¶
API alias for branch_sets (deprecated)
from_source_logic_tree(original_slt)
staticmethod
¶
Migrate from old version one of slt.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
original_slt
|
SourceLogicTree
|
a v1 SourceLogicTree instance. |
required |
Returns:
Type | Description |
---|---|
SourceLogicTree
|
a new SourceLogicTree instance |
Source code in nzshm_model/logic_tree/source_logic_tree/logic_tree.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
|
SourceLogicTreeSpec
dataclass
¶
Is this used anymore?
Source code in nzshm_model/logic_tree/source_logic_tree/logic_tree.py
130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
fault_systems
property
¶
API alias for branch_sets (deprecated)