def max_acceleration_period(asig): from eqsig import AccSignal periods = np.logspace(-1, 1, 100) new_sig = AccSignal(asig.values, asig.dt) new_sig.generate_response_spectrum(response_times=periods, xi=0) max_index = np.argmax(new_sig.s_a) max_period = periods[max_index] return max_period
def calc_max_velocity_period(asig): from eqsig import AccSignal periods = np.logspace(-1, 0.3, 100) new_sig = AccSignal(asig.values, asig.dt) new_sig.generate_response_spectrum(response_times=periods, xi=0.15) max_index = np.argmax(new_sig.s_v) max_period = periods[max_index] return max_period
def test_plot_acc_sig_as_transfer_function(): record_path = TEST_DATA_DIR record_filename = 'test_motion_dt0p01.txt' motion_step = 0.01 rec = np.loadtxt(record_path + record_filename) acc_sig = AccSignal(rec, motion_step) plot_acc_signal.plot_acc_sig_as_transfer_function(acc_sig, [acc_sig])
def test_plot_acc_sig_as_fa_spectrum(): record_path = TEST_DATA_DIR record_filename = 'test_motion_dt0p01.txt' motion_step = 0.01 rec = np.loadtxt(record_path + record_filename) acc_sig = AccSignal(rec, motion_step) plot_acc_signal.plot_acc_sig_as_fa_spectrum(acc_sig)
def load_test_record_from_file(record_path, record_filename, scale=1): a = open(record_path + record_filename, 'r') b = a.readlines() a.close() acc = [] motion_step = float(b[0].split("=")[1]) for i in range(len(b)): if i > 3: dat = b[i].split() for j in range(len(dat)): acc.append(float(dat[j]) * scale) rec = AccSignal(acc, motion_step) return rec
def t_asig(): record_path = TEST_DATA_DIR record_filename = 'test_motion_dt0p01.txt' motion_step = 0.01 rec = np.loadtxt(record_path + record_filename, skiprows=2) return AccSignal(rec, motion_step)