dataframe_models
dataframe_models
¶
This module defines the dataframes returned by solvis.
- We use the
panderas
library to define the dataframe schemas and solvis testing validates that dataframes have the expected columns names and types. - currenty schema attributes are NOT the actual dataframe column names, For these see the code and the `Field(alias={column_name}) value. See below...
- refactoring of column names is expected in a future release, but legacy column names will be supported.
Fault models¶
FaultSectionSchemaBase
¶
Bases: pda.DataFrameModel
A base schema for common dataframe columns.
This is not used directly, but is reused in other schema.
Attributes:
Name | Type | Description |
---|---|---|
section_id |
Series[pd.Int32Dtype]
|
unique section id. |
section_name |
Series[str]
|
the fault section name. |
dip_angle |
Series[pd.Float64Dtype]
|
dip angle of the section (degrees). |
rake |
Series[pd.Float64Dtype]
|
rake angle of the section (degrees). |
lower_depth |
Series[pd.Float64Dtype]
|
lower section depth (meters). |
upper_depth |
Series[pd.Float64Dtype]
|
upper section depth (meters). |
aseismic_slip_factor |
Series[pd.Float64Dtype]
|
ratio of slip that is considered aseismic. |
coupling_coefficient |
Series[pd.Float64Dtype]
|
coupling coefficient. |
parent_fault_id |
Series[pd.Int32Dtype]
|
unique id of th parent fault. |
parent_fault_name |
Series[str]
|
unique name of ther parent fault. |
dip_direction |
Series[pd.Float64Dtype]
|
dip direciton (degrees). |
geometry |
Series[geometry]
|
A set of coordinates defining the section surface trace. |
target_slip_rate |
Series[pd.Float64Dtype]
|
the target slip reate used in the grand inversion. |
target_slip_rate_stddev |
Series[pd.Float64Dtype]
|
the target slip rate stddev used in the grand inversion. |
Source code in solvis/solution/dataframe_models.py
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 |
|
FaultSectionSchema
¶
Bases: FaultSectionSchemaBase
A Dataframe schema for fault_section
.
Notes
- this just adds an index to the base class FaultSectionSchema.
Attributes:
Name | Type | Description |
---|---|---|
index |
Index[pd.Int64Dtype]
|
on section id. |
Source code in solvis/solution/dataframe_models.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
FaultSectionWithSolutionSlipRate
¶
Bases: FaultSectionSchemaBase
A Dataframe schema for fault_sections_with_solution_slip_rates
.
Notes
- this just adds an index and one column to the base class FaultSectionSchema.
Attributes:
Name | Type | Description |
---|---|---|
index |
Index[pd.Int64Dtype]
|
on section id. |
solution_slip_rate |
Series[pd.Float64Dtype]
|
the slip rate calculated in the Opensha grand inversion. |
Source code in solvis/solution/dataframe_models.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
FaultSectionRuptureRateSchema
¶
Bases: FaultSectionSchemaBase
A Dataframe schema for fault_sections_with_rupture_rates
.
This table joins each permutation of rupture_id and section_id with their aggregated rates across all the inversion solution branches.
Todo
- why is this schema used in inversion_solution_file, shouldn't it exclusivly on fault_system_solution ??
Attributes:
Name | Type | Description |
---|---|---|
fault_system_idx |
Index[pd.CategoricalDtype]
|
index on fault system |
section_idx |
Index[pd.Int64Dtype]
|
index on section id. |
rupture |
Index[pd.Int64Dtype]
|
the rupture id. |
section |
Series[pd.Int32Dtype]
|
the fault_section id. |
key_0 |
Series[pd.UInt32Dtype]
|
Todo: drop this please!! |
fault_system |
Series[str]
|
fault system short code eg 'CRU' |
rupture_id |
Series[pd.UInt32Dtype]
|
the id of each rupture |
rate_count |
Series[pd.Int64Dtype]
|
count of aggregate ruptures with rate. |
rate_max |
Series[pd.Float32Dtype]
|
max rate of aggregate ruptures with rate. |
rate_min |
Series[pd.Float32Dtype]
|
min rate of aggregate ruptures with rate. |
rate_weighted_mean |
Series[pd.Float32Dtype]
|
rate weighted mean of aggregate ruptures with rate. |
magnitude |
Series[pd.Float32Dtype]
|
the rupture magnitude. |
mean_rake |
Series[pd.Float32Dtype]
|
the mean rake angle of the ruptures fault sections (degrees). |
area |
Series[pd.Float32Dtype]
|
rupture area (meters^2). |
length |
Series[pd.Float32Dtype]
|
rupture length (meters). |
section |
Series[pd.Int32Dtype]
|
Series[pd.Int32Dtype] |
Note
remaining attributes are inherited from FaultSectionSchemaBase
Source code in solvis/solution/dataframe_models.py
137 138 139 140 141 142 143 144 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 |
|
Rupture models¶
RuptureBaseSchema
¶
Bases: pda.DataFrameModel
A Dataframe schema base.
Attributes:
Name | Type | Description |
---|---|---|
magnitude |
Series[pd.Float32Dtype]
|
the rupture magnitude. |
mean_rake |
Series[pd.Float32Dtype]
|
the mean rake angle of the ruptures' fault sections (degrees). |
area |
Series[pd.Float32Dtype]
|
rupture area (meters^2). |
length |
Series[pd.Float32Dtype]
|
rupture length (meters). |
Source code in solvis/solution/dataframe_models.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
|
RuptureRateSchema
¶
Bases: pda.DataFrameModel
A Dataframe schema for InversionSolutionFile.rupture_rates
.
Attributes:
Name | Type | Description |
---|---|---|
index |
Index[pd.Int64Dtype]
|
unique index on rupture_id. |
rupture_id |
Series[pd.UInt32Dtype]
|
the id of each rupture |
annual_rate |
Series[pd.Float32Dtype]
|
the rupture rate |
Source code in solvis/solution/dataframe_models.py
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
|
RuptureSectionSchema
¶
Bases: pda.DataFrameModel
A Dataframe schema for rupture_section
.
This is a join
table iterating all permutations of rupture_id and section_id.
Attributes:
Name | Type | Description |
---|---|---|
index |
Index[pd.Int64Dtype]
|
unique index. |
rupture_id |
Series[pd.Int64Dtype]
|
the id of each rupture |
section_id |
Series[pd.Int32Dtype]
|
the id of each fault_section |
Source code in solvis/solution/dataframe_models.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
|
RupturesWithRuptureRatesSchema
¶
Bases: RuptureBaseSchema
A Dataframe schema for InversionSolution.ruptures_with_rupture_rates
.
Attributes:
Name | Type | Description |
---|---|---|
index |
Index[pd.Int64Dtype]
|
integer id. |
rupture_id |
Series[pd.UInt32Dtype]
|
same as index. |
annual_rate |
Series[pd.Float32Dtype]
|
annual rupture rate. |
magnitude |
Series[pd.Float32Dtype]
|
the rupture magnitude. |
mean_rake |
Series[pd.Float32Dtype]
|
the mean rake angle of the ruptures' fault sections (degrees). |
area |
Series[pd.Float32Dtype]
|
rupture area (meters^2). |
length |
Series[pd.Float32Dtype]
|
rupture length (meters). |
Source code in solvis/solution/dataframe_models.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
|
RuptureSectionsWithRuptureRatesSchema
¶
Bases: RuptureBaseSchema
A Dataframe schema for InversionSolution.rs_with_rupture_rates
.
Source code in solvis/solution/dataframe_models.py
270 271 272 273 274 275 276 277 278 279 280 281 |
|
Participation models¶
SectionParticipationSchema
¶
Bases: pda.DataFrameModel
A Dataframe schema for section_participation_rate
.
Attributes:
Name | Type | Description |
---|---|---|
section |
Index[pd.Int32Dtype]
|
unique index on section_id. |
participation_rate |
Series[pd.Float32Dtype]
|
sum of the ruptures involving each fault section. |
Source code in solvis/solution/dataframe_models.py
20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
ParentFaultParticipationSchema
¶
Bases: pda.DataFrameModel
A Dataframe schema for fault_participation_rate
.
Attributes:
Name | Type | Description |
---|---|---|
parent_fault_id |
Index[pd.Int32Dtype]
|
unique index on parent fault id. |
participation_rate |
Series[pd.Float32Dtype]
|
sum of the ruptures involving each parent fault. |
Source code in solvis/solution/dataframe_models.py
35 36 37 38 39 40 41 42 43 44 45 46 47 |
|