jaabell / ShakerMaker

Easily create physically-realistic earthquake ground motions for engineering and seismology!
https://shakermaker.readthedocs.io/
21 stars 8 forks source link

Error when run examples script #1

Open HosseinBazeghi opened 1 year ago

HosseinBazeghi commented 1 year ago

Hello Dr. @jaabell ,

Recently, I installed the latest version of ShakerMaker, and during running examples script, the program shows the following error:

>> python3 example0_readme_example.py 

ShakerMaker Run begin. dt=0.05 nfft=4096 dk=0.3 tb=1000 tmin=0.0 tmax=100
-------------------------------------------------------------------------
 *** 0 psource.tt=0 t0[0]=-49.166668 dh=4.0 dz=4
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/shakermaker/shakermaker.py", line 254, in run
    station.add_to_response(z_stf, e_stf, n_stf, t, tmin, tmax)
  File "/usr/local/lib/python3.10/dist-packages/shakermaker/station.py", line 75, in add_to_response
    self._z[nskip:(nskip+len(z))] = z
ValueError: could not broadcast input array from shape (8192,) into shape (983,)
0 of 1 done t[0]=-49.1667 t[-1]=360.3833 (tmin=0.0000 tmax=100.0000)

ShakerMaker Run done. Total time: 0.13463470100032282 s
------------------------------------------------

However the example scripts work when I go back to previous commit of station.py in 1a37a0261b8e7b941418a9a0b4c73700454285f8 .

Could you please check this commit.

Regards, Hossein Bazeghi

jaabell commented 1 year ago

Hi Hossein! Thanks for trying this out. I've been working on some improvements on ShakerMaker to allow me to model large faults more efficiently. This probably broke the examples. I'll take a look and resolve.

I'm excited that you are using this!