create_spectra
create_spectra
¶
This module contains end user functions for creating the TS spectra from the tabulated parameters
create_enveloped_spectra(location_id: str, apoe_n: int, site_class_list: List[str], periods: List[float] = DEFAULT_PERIODS, precision: int = 3) -> pdt.DataFrame
¶
Creates a set of site class spectra for a given location_id and APoE
Parameters:
Name | Type | Description | Default |
---|---|---|---|
location_id
|
str
|
label for a TS location (e.g., 'Wellington' or '-47.3~167.8') |
required |
apoe_n
|
int
|
shorthand for APoE (1/n) # this is commonly known as a return period |
required |
site_class_list
|
List[str]
|
list of TS site class label (e.g., ['III',IV']) |
required |
periods
|
List[float]
|
list of periods [seconds] at which to calculate the spectrum |
DEFAULT_PERIODS
|
precision
|
int
|
number of decimals to include in output |
3
|
Returns:
Name | Type | Description |
---|---|---|
enveloped_spectra |
pdt.DataFrame
|
dataframe of spectra for each period (rows), spectrum and the combined envelope (columns) |
Source code in nzssdt_2023/end_user_functions/create_spectra.py
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 |
|
create_spectrum_from_parameters(pga: float, sas: float, tc: float, td: float, periods: List[float] = DEFAULT_PERIODS, precision: int = 3) -> List[float]
¶
Creates the TS spectrum based on the incoming pga, sas, tc, and td parameters
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pga
|
float
|
peak ground acceleration [g] |
required |
sas
|
float
|
short-period spectral acceleration [g] |
required |
tc
|
float
|
spectral-acceleration-plateau corner period [seconds] |
required |
td
|
float
|
spectral-velocity-plateau corner period [seconds] |
required |
periods
|
List[float]
|
list of periods [seconds] at which to calculate the spectrum |
DEFAULT_PERIODS
|
precision
|
int
|
number of decimals to include in output |
3
|
Returns:
Name | Type | Description |
---|---|---|
spectrum |
List[float]
|
acceleration spectrum [g] calculated at the incoming list of periods |
Source code in nzssdt_2023/end_user_functions/create_spectra.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|