jenndrei / BayHunter

McMC transdimensional Bayesian inversion of surface wave dispersion and receiver functions
https://jenndrei.github.io/BayHunter
GNU General Public License v3.0
103 stars 43 forks source link

Suggestion for SynthObs.return_swddata() #7

Open dylanmikesell opened 3 years ago

dylanmikesell commented 3 years ago

First off, thank you for this code. It is great! We are using it for two projects right now and pulling out some very useful subsurface information.

We noticed that you don't save the any synthetic dispersion curves in the final c_*.npy files, so we are writing some tools to extract/compute the synthetic dispersion curves for a given model using SynthObs.return_swddata().

I have noticed two things that would be nice additions to this functions I think.

First, it would be good to check the inputs in return_swddata(). In particular I found that h (the depth axis) cannot be more than 100 elements. A useful error about this would be great.

Second, it would be nice to have another argument that allows the user to ask for a certain dispersion curves (e.g. Rayleigh wave group velocity). Right now, the code computes all 4 (phase and group for both Love and Rayleigh waves, which is a good default behavior).

I am happy to submit pull requests for these, but would like to know if they will actually get incorporated or not. Can you please let me know if this is something that you would incorporate?

Also, if anyone is still working on this code, it would be very useful to add more information about the inputs and outputs of the different methods. Right now, I feel that I am deciphering a lot of things on my own and this is slow. I know people will start using this code as more papers are published using it, but the user base would increase a lot if the code is a bit better documented. I am sure there is functionality that already exists in this code that I just don't know about, but because I don't know about it, I may be rewriting things from scratch. Regardless, thank you very much for putting this code online for us!!

dylanmikesell commented 3 years ago

Update: Here is the error related to this.

syn_disp = SynthObs.return_swddata(depth_int, vs_mean, vpvs=vpvs, x=syn_per)

File "/Users/dmikesell/anaconda3/envs/tomo/lib/python3.7/site-packages/BayHunter/SynthObs.py", line 52, in return_swddata h=h, vp=vp, vs=vs, rho=rho) File "/Users/dmikesell/anaconda3/envs/tomo/lib/python3.7/site-packages/BayHunter/surf96_modsw.py", line 99, in run_model h, vp, vs, rho = self.get_modelvectors(h, vp, vs, rho) File "/Users/dmikesell/anaconda3/envs/tomo/lib/python3.7/site-packages/BayHunter/surf96_modsw.py", line 71, in get_modelvectors thkm[:nlayer] = h ValueError: could not broadcast input array from shape (101) into shape (100)

savardge commented 4 months ago

Hi @dylanmikesell, it's been a long time since this issue, but did you end up implementing these changes to return dispersion curves into a branch of your own? I see you didn't get a reply but I would be interested! I'm testing BayHunter on my datasets to invert ambient noise dispersion curves only.