Inversion solution model
inversion_solution_model
¶
This module defines the class InversionSolutionModel
.
The InversionSolutionModel
class provides methods to build pandas dataframes
from the raw dataframes available via the InversionSolutionFile
class.
Attributes¶
log = logging.getLogger(__name__)
module-attribute
¶
Classes¶
InversionSolutionModel(solution_file: InversionSolutionFile)
¶
helper methods for analysis of InversionSolutionProtocol subtypes.
Initialize the InversionSolutionModel
class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
solution_file
|
InversionSolutionFile
|
The inversion solution file to use. |
required |
Source code in solvis/solution/inversion_solution/inversion_solution_model.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
Attributes¶
solution_file: InversionSolutionFile
property
¶
Get the inversion solution file used by this model.
Returns:
Name | Type | Description |
---|---|---|
InversionSolutionFile |
InversionSolutionFile
|
The inversion solution file. |
rupture_sections: DataFrame[dataframe_models.RuptureSectionSchema]
property
¶
Calculate and cache the permutations of rupture_id and section_id.
Returns:
Type | Description |
---|---|
DataFrame[dataframe_models.RuptureSectionSchema]
|
pd.DataFrame: A pandas dataframe conforming to the RuptureSectionSchema. |
fault_sections_with_rupture_rates: DataFrame[dataframe_models.FaultSectionRuptureRateSchema]
cached
property
¶
Get the fault sections with rupture rates.
Returns:
Type | Description |
---|---|
DataFrame[dataframe_models.FaultSectionRuptureRateSchema]
|
pd.DataFrame: A pandas dataframe conforming to the FaultSectionRuptureRateSchema. |
parent_fault_names: List[str]
cached
property
¶
Get a sorted list of unique parent fault names.
Returns:
Type | Description |
---|---|
List[str]
|
List[str]: A list of unique parent fault names. |
fault_sections_with_solution_slip_rates: DataFrame[dataframe_models.FaultSectionWithSolutionSlipRate]
cached
property
¶
Calculate and cache fault sections and their solution slip rates.
Solution slip rate combines the inversion inputs (avg slips), and the inversion solution (rupture rates).
Returns:
Type | Description |
---|---|
DataFrame[dataframe_models.FaultSectionWithSolutionSlipRate]
|
a gpd.GeoDataFrame |
rs_with_rupture_rates: DataFrame[dataframe_models.RuptureSectionsWithRuptureRatesSchema]
cached
property
¶
Get the rupture sections with rupture rates.
Returns:
Type | Description |
---|---|
DataFrame[dataframe_models.RuptureSectionsWithRuptureRatesSchema]
|
pd.DataFrame: A pandas dataframe conforming to the RuptureSectionsWithRuptureRatesSchema. |
ruptures_with_rupture_rates: DataFrame[dataframe_models.RupturesWithRuptureRatesSchema]
cached
property
¶
Get the ruptures with rupture rates.
Returns:
Type | Description |
---|---|
DataFrame[dataframe_models.RupturesWithRuptureRatesSchema]
|
pd.DataFrame: A pandas dataframe conforming to the RupturesWithRuptureRatesSchema. |
Functions¶
rate_column_name() -> str
¶
Get the appropriate rate column name.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
"Annual Rate" or "rate_weighted_mean" |
Source code in solvis/solution/inversion_solution/inversion_solution_model.py
54 55 56 57 58 59 60 61 62 |
|
build_rupture_sections() -> DataFrame[dataframe_models.RuptureSectionSchema]
cached
¶
Build the rupture sections dataframe.
Returns:
Type | Description |
---|---|
DataFrame[dataframe_models.RuptureSectionSchema]
|
pd.DataFrame: A pandas dataframe conforming to the RuptureSectionSchema. |
Source code in solvis/solution/inversion_solution/inversion_solution_model.py
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 |
|