Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update intensity_measures.py to support SciPy 1.6.0 #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions smtk/intensity_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import numpy as np
from math import pi
from scipy.integrate import cumtrapz
from scipy.integrate import cumulative_trapezoid
from scipy import constants
import matplotlib.pyplot as plt
import smtk.response_spectrum as rsp
Expand Down Expand Up @@ -67,12 +67,12 @@ def get_peak_measures(time_step, acceleration, get_vel=False, get_disp=False):
if get_disp:
get_vel = True
if get_vel:
velocity = time_step * cumtrapz(acceleration, initial=0.)
velocity = time_step * cumulative_trapezoid(acceleration, initial=0.)
pgv = np.max(np.fabs(velocity))
else:
pgv = None
if get_disp:
displacement = time_step * cumtrapz(velocity, initial=0.)
displacement = time_step * cumulative_trapezoid(velocity, initial=0.)
pgd = np.max(np.fabs(displacement))
else:
pgd = None
Expand Down Expand Up @@ -542,7 +542,7 @@ def get_husid(acceleration, time_step):
Time-step of record (s)
"""
time_vector = get_time_vector(time_step, len(acceleration))
husid = np.hstack([0., cumtrapz(acceleration ** 2., time_vector)])
husid = np.hstack([0., cumulative_trapezoid(acceleration ** 2., time_vector)])
return husid, time_vector


Expand Down