A collection of software tools developed by the UCLA geotechnical group
Project description
ucla_geotech_tools
This ucla_geotech_tools module contains software tools developed by the UCLA geotechnical engineering group. It consists of the following packages:
Installation
To install the ucla_geotech_tools module
pip install ucla_geotech_tools
To install a package from the module (e.g., auto_fchp)
pip install ucla_geotech_tools.auto_fchp
auto_fchp
Return the high-pass corner frequency value that stabilizes the displacement of a ground motion record.
The high-pass corner frequency, fchp, is selected to satisfy two objectives:
- The amplitude of a polynomial fit to the filtered displacement record divided by the amplitude of the filtered displacement record is within a tolerance of a specified target.
- The amplitude of the initial portion of the displacement record before the p-wave arrival divided bythe amplitude of the filtered displacement record is within a tolerance of a specified target.
The value of fchp is computed numerically using the Scipy package scipy.optimize.ridder(). Two initial values of fchp are provided that bracket the root, and the Scipy package solves for the root that minimizes the objective function. The tolerance is on the value of fchp, not on the value of the residual (i.e., xtol in optimize.ridder).
A value of fchp is obtained first to satisfy objective 1. Objective 2 is optional, and if it is applied, the value of fchp from objective 1 is checked against objective 2. If the residual from objective 2 is less than or equal to zero, fchp is set equal to the value from objective 1. Otherwise, iterations are performed to satisfy objective 2.
Functions
get_fchp(**kwargs)
Return the high-pass corner frequency
Keyword Args:
- *
dt
: time step in seconds (float, required) - *
acc
: acceleration array in L/s/s, where L is length (Numpy array dtype=float, required) target
: desired ratio of polynomial fit amplitude to displacement amplitude (default=0.02)tol
: tolerance for fchp (default=0.001)poly_order
: order of polynomial to fit to filtered displacement record (default=6)maxiter
: maximum number of iterations (default=30)fchp_min
: minimum frequency in Hz to consider for fchp (default=0.001)fchp_max
: maximum frequency in Hz to consider for fchp (default=0.5)tukey_alpha
: alpha parameter for scipy.signal.windows.tukey (default=0.05)apply_disp_ratio
: flag to indicate whether to apply objective 2 (default=0)disp_ratio_time
: duration in seconds of the initial portion of the record before the p-wave arrival (default=30)disp_ratio_target
: target ratio of amplitude of initial portion of displacement record to amplitude of displacement record
get_residual1(fchp, *args):
Return the residual defined as disp_fit/disp_filt - target.
Args:
fchp
: High-pass corner frequency (float)Fdisp
: Fourier coefficients of displacement record (Numpy array, dtype=complex)time
= time values (Numpy array, dtype=float)poly_order
= Order of polynomial to fit to filtered displacement (float)target
= Desired ratio of polynomial fit amplitude to displacement signal amplitude (float)freq
= Numpy array containing frequency values
Computed variables:
filt
= Coefficients of 5th order Butterworth filterFdisp_filt
= Numpy array containing Fourier coefficients of filtered displacement recorddisp_filt
= Numpy array containing filtered displacement recordcoef
= Coefficients of polynomial fit to displacement recorddisp_fit
= Numpy array containing polynomial fit ordinates at each time
get_residual2(fchp, *args):
Returns the residual defined as disp_init/disp - target.
Args:
fchp
= High-pass corner frequencyFdisp
= Numpy array containing Fourier coefficients of displacement recordtime
= Numpy array containing time valuesdisp_time
= Duration of initial portion of record before p-wave arrivaldisp_target
= Desired ratio of amplitude of initial portion of displacement record to amplitude of displacement recordfreq
= Numpy array containing frequency values
Computed variables:
filt
= Coefficients of 5th order Butterworth filterFdisp_filt
= Numpy array containing Fourier coefficients of filtered displacement recorddisp_filt
= Numpy array containing filtered displacement record
response_spectrum
response_spectrum computes a psuedo-acceleration response spectrum from an input ground motion or set of ground motions sampled at a constant frequency. Calculates are performed in the frequency domain by
- taking the Fourier transform of the input motion(s)
- multiplying by the transfer function for computing the motion of a single-degree-of-freedom (SDOF) oscillator with natural period T and damping D
- computing the peak acceleration amplitude for the SDOF oscillator
- repeating steps 2 and 3 for a range of user-specified periods
Functions
get_response_spectrum(**kwargs)
Returns a Numpy array containing response spectra
Keyword Args:
- *
motions
= Numpy array (M x N) containing acceleration data, where M is the number of motions and N is the number of data points in each motion. All motions must have the same number of data points. Python lists are not allowed; only Numpy arrays (required) - *
dt
= time step in seconds (required) D
= damping (default = 0.05)T
= array of natural periods (default = array used for NGAwest2 project)zeropad
= 1: apply zero padding to speed up FFT operation, 0: do not pad with zeros (default = 1)
get_ngawest2_T()
Returns a Numpy array containing NGAWest2 natural periods
ipyconsol
Documentation coming soon
random_field
Documentation coming soon
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ucla_geotech_tools-1.0.5-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 681eda7f3a2242e76e25f821fb83a297841b00c22f9b2f65a9ec70be6a5b3992 |
|
MD5 | d241371dc3021cd467cb112a1b213d14 |
|
BLAKE2b-256 | 29f7cfcc2040673c6735a7ca686d7e8c53a2d19c7d4d58288a5ee7a630a444e9 |