arkottke / pyrotd

Python scripts to compute the rotated response spectrum.
MIT License
21 stars 14 forks source link

Positional argument `osc_type` doesn't work (pyrotd 0.5.4) #5

Closed farshadrasuli closed 1 year ago

farshadrasuli commented 1 year ago

Hello everyone,

When I use the positional argument obs_type with the calc_spec_accels() function, it gives an error.

script:

import numpy as np
import pyrotd

#%% read record
record = 'RSN8883_14383980_13849360.AT2'

record_content = open(record, mode='r').readlines()

# Flag indicating dt is found and that ground motion
# values should be read -- ASSUMES dt is on last line
# of header!!!
flag = 0

record_samples = []
for line in record_content:
    if line == '\n':
        # Blank line --> do nothing
        continue
    elif flag == 1:
        words = line.split()
        for word in words:
            record_samples.append(float(word))
    else:
        words = line.split()
        if words[0] == 'NPTS=':
            record_NPTS = words[1]
            record_DT = float(words[3])
            flag = 1

#%% compute spectral acceleration
f = np.logspace(-1, 2, 91)
xi = 0.05
spec_accel = pyrotd.calc_spec_accels(record_DT, record_samples, f, xi, 5, 'sa').spec_accel

error:

TypeError: calc_spec_accels() takes from 3 to 5 positional arguments but 6 were given
farshadrasuli commented 1 year ago

This error was fixed by updating to version 0.6.0.