Skip to main content

Welcome to 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

  1. taking the Fourier transform of the input motion(s)
  2. multiplying by the transfer function for computing the motion of a single-degree-of-freedom (SDOF) oscillator with natural period T and damping D
  3. computing the peak acceleration amplitude for the SDOF oscillator
  4. repeating steps 2 and 3 for a range of user-specified periods

Installation

pip install ucla_geotech_tools.response_spectrum

Command

get_response_spectrum(**kwargs)
get_ngawest2_T()

Input parameters.

motion(s) = an M x N list or python array 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. (required)  
dt = time step (required)
D = damping (optional, default = 0.05)
T = array of natural periods (optional, default = array used for NGAwest2 project: 
T = [0.01, 0.02, 0.022, 0.025, 0.029, 0.030, 0.035, 0.036, 0.040, 0.042, 0.044, 0.045, 0.046, 0.048, 0.050, 0.055, 0.060, 0.065, 0.067, 0.070, 0.075, 0.080, 0.085, 0.090, 0.095, 0.100, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.22, 0.24, 0.25, 0.26, 0.28, 0.29, 0.30, 0.32, 0.34, 0.35, 0.36, 0.38, 0.40, 0.42, 0.44, 0.45, 0.46, 0.48, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.2, 2.4, 2.5, 2.6, 2.8, 3.0, 3.2, 3.4, 3.5, 3.6, 3.8, 4.0, 4.4, 4.6, 4.8, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 20.0])
zeropad = 1: apply zero padding to speed up FFT operation, 0: do not pad with zeros (optional, default = 1)
verbose = 1: print output message when default values are being used, 0: suppress output messages (optional, default = 1)

Example

Python script

import numpy as np
import ucla_geotech_tools.response_spectrum as ars
import matplotlib.pyplot as plt

N = 4000               # Number of time steps
M = 3                  # Number of motions
dt = 0.005             # Time step in seconds
D = 0.05               # Damping
freq = [1.0, 3.0, 5.0] # Frequencies for three different harmonic motions

motions = np.empty([M,N],dtype="float64")
for i in range(M):
    for j in range(N):
        motions[i][j] = np.sin(2*np.pi*freq[i]*j*dt)

# Get spectral periods used in NGAWest2 project
T = ars.get_ngawest2_T()

# Get Python array containing pseudo-spectral acceleration values
Sa = ars.get_response_spectrum(motions=motions, dt=dt, D=D, zeropad=0, verbose=0)

for i in range(M):
    plt.loglog(T,Sa[i])
plt.xlabel('Natural Period (s)')
plt.ylabel('Spectral Acceleration (g)')

Output

Metadata

Release files for ucla-geotech-tools-response-spectrum 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ucla-geotech-tools-response-spectrum 1.0.5
File Size Uploaded Provenance Actions
ucla_geotech_tools-response_spectrum-1.0.5.tar.gz 135.8 kB Without provenance Details for ucla_geotech_tools-response_spectrum-1.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ucla-geotech-tools-response-spectrum 1.0.5
File Interpreter ABI Platform Actions
ucla_geotech_tools_response_spectrum-1.0.5-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for ucla_geotech_tools_response_spectrum-1.0.5-cp39-cp39-win_amd64.whl

Total release size: 229.8 kB

Release files / ucla_geotech_tools-response_spectrum-1.0.5.tar.gz

Download URL ucla_geotech_tools-response_spectrum-1.0.5.tar.gz
Size 135.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7f99ec5b3d5764b84905a8718bfdc8631da470a4c2dd3d7c9021367153306cd6
BLAKE2b-256 checksum
How to use checksums
0152c1dafb81d9da4f4db4b1b3cf3436323742714a91be4bd3943b1074b1b79f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

Release files / ucla_geotech_tools_response_spectrum-1.0.5-cp39-cp39-win_amd64.whl

Download URL ucla_geotech_tools_response_spectrum-1.0.5-cp39-cp39-win_amd64.whl
Size 94.0 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
0c5a1f50f2b79201bfbe98f43ec44e3a450d5930ade217808eeb7e861de0fefb
BLAKE2b-256 checksum
How to use checksums
38cc5f648f1865425c3a142f59da3068ef524a3343ffe14e1e994035e4ca98cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

Security for ucla-geotech-tools-response-spectrum 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page