xumi1993 / seispy

Python module of seismology and receiver functions
https://seispy.xumijian.me
GNU General Public License v3.0
95 stars 29 forks source link

rf2depth: ValueError: could not broadcast input array from shape (92,3) into shape (3,4) #86

Closed ShihChi90 closed 6 months ago

ShihChi90 commented 6 months ago

Describe the bug I was running the usual workflow doing time to depth migration using rf2depth module, but ran in to arror somewhere reading depmodel. I was using same vmod as I was in seispy 1.3.4, but after updating to 1.3.5 it show this error. I downgrade my package and it worked again.

Expected behavior should run a time migration and output an npy file

Error raised File "/home/scshao/.conda/envs/seispy/lib/python3.11/site-packages/seispy/core/depmodel.py", line 51, in _search_vel_file model[:3, :] = raw_model[:, :]


ValueError: could not broadcast input array from shape (92,3) into shape (3,4)
![image](https://github.com/xumi1993/seispy/assets/95597521/0c34de17-1474-4aa3-9ad7-f0496009fdd7)

**Platform (please complete the following information):**
Linux
seispy 1.3.5

**Additional context**
Appreciated developer's work, very good project!
xumi1993 commented 6 months ago

Thanks for reporting this. I will check it ASAP.

xumi1993 commented 6 months ago

I have fixed this bug on v1.3.6. You can update Seispy to solve this problem.

ShihChi90 commented 6 months ago

another error occured after fixing depmodel in core/pertmod.py AttributeError: 'DepModel' object has no attribute 'depthsraw'. Did you mean: 'depths'? after renaming the attributes (depthsraw -> depths, vpraw/vsraw -> vp/vs) it looks to work fine. image

xumi1993 commented 6 months ago

I have fixed it. Pls update to dev branch and have a try. Thanks.