-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmented r_power_n #62
Segmented r_power_n #62
Conversation
…on parameter. Added new 'geom_spread_n_exponents' and 'geom_spread_n_distances configuration parameters.
…_spreading_coefficient function.
Also, explain in config file that the number of exponents must be one more than the number of distances.
55f5c4b
to
b45ec4d
Compare
Dear Kris, happy new year to you too! 🌟 Thanks for the pull request, which looks nice. 👍 I rebased it on the latest Concerning moving the geometrical spreading code to However, I prefer to proceed in this order:
|
Great, I also wrote some code to compare the different spreading models. Once we create the |
Claudio, please wait before merging with the main branch. |
Did it already! Just make another PR 😉 |
OK, I first need to find the problem. |
Points 3. and 4. are done! @krisvanneste, could you please double-check? Thanks! |
I ran the example in my notebook with a segmented spreading model and it seems to work as expected! |
Great, thanks! I'm currently working on adding to the module a |
Plotting function added to the Here's an example code and resulting plots: import numpy as np
from sourcespec.ssp_geom_spreading import plot_geom_spread_models
source_depth = 10
epi_dists = np.arange(10, 1000, 10)
models = [
('r_power_n', {'exponent': 1}),
('boatwright', {'cutoff_dist_in_km': 100}),
('boatwright', {'cutoff_dist_in_km': 200, 'freqs': 0}),
('boatwright', {'cutoff_dist_in_km': 200, 'freqs': 10}),
('teleseismic', {'phase': 'P'}),
('teleseismic', {'phase': 'S'}),
]
plot_geom_spread_models(
source_depth, epi_dists, models=models,
plottype='linlog', xaxis='epi_dist')
source_depth = 0
epi_dists = np.arange(1, 1000, 1)
models = [
('r_power_n', {'exponent': 1}),
('r_power_n_segmented', None),
]
plot_geom_spread_models(
source_depth, epi_dists, models=models,
plottype='loglog', xaxis='hypo_dist') |
Nice! |
Hello Claudio,
My best wishes for the new year!
I have created a new branch adding support for a segmented powerlaw spreading model, similar to Boore (2003), and implemented in simulation codes like EXSIM and SMSIM. I also think that we could move all the geometrical spreading related functions in
ssp_util.py
to a dedicatedssp_geom_spreading.py
file. In principle, the originalr_spread_n
model can also be implemented with ther_spread_n_segmented
model, but for now I left it, which may result in some overlap. This is a design decision that I prefer to leave to you.I based this branch on v1.8 (because I want to apply it to my data and v2 is still experimental), but if you prefer, I could also base it on v2. I thought development of the v2 branch had stalled, but I now notice that you have continued developing. I will try to catch up as soon as possible.