utilities
utilities
Functions
| Name | Description |
|---|---|
| csv_time_hist | Read a CSV file containing time history acceleration data and return a 1D numpy array and a timestep |
| load_sample_ground_motion | Load a single sample ground motion by filename from the sample_ground_motions folder. |
| sample_ground_motions | Load sample ground motions from the sample_ground_motions folder. |
csv_time_hist
utilities.csv_time_hist(filename)Read a CSV file containing time history acceleration data and return a 1D numpy array and a timestep
Returns: a_in: A 1D numpy array containing time history data. dt: The timestep of the data.
load_sample_ground_motion
utilities.load_sample_ground_motion(filename)Load a single sample ground motion by filename from the sample_ground_motions folder.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| filename | str | The filename of the ground motion CSV file (with or without .csv extension) | required |
Returns
| Name | Type | Description |
|---|---|---|
| GroundMotion | A GroundMotion object containing the time history data and metadata. |
Raises
| Name | Type | Description |
|---|---|---|
| FileNotFoundError | If the specified file is not found in the sample_ground_motions folder. |
sample_ground_motions
utilities.sample_ground_motions()Load sample ground motions from the sample_ground_motions folder.
Returns
| Name | Type | Description |
|---|---|---|
| dict | A dictionary where keys are motion names (str) and values are GroundMotion objects containing the time history data and metadata. |
Notes
This function reads all CSV files in the sample_ground_motions folder and creates GroundMotion objects for each file. The file name (without extension) is used as the key in the returned dictionary.