-
Notifications
You must be signed in to change notification settings - Fork 272
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
Issue computing NGAEast GMMs with vectorized input #9312
Comments
Using a GSIM is non-obvious. First of all, it should not be instantiated directly, but through the import numpy as np
from openquake.hazardlib import valid
from openquake.hazardlib.contexts import simple_cmaker
gsim = valid.gsim('''[NGAEastGMPE]
gmpe_table="NGAEast_PEER_EX.hdf5"''')
n = 10
mags = np.linspace(5, 7, n)
cmaker = simple_cmaker([gsim], ['PGA'], mags=['%.2f' % mag for mag in mags])
ctx = cmaker.new_ctx(n)
ctx["mag"] = mags
ctx["vs30"] = np.linspace(200, 300, n)
ctx["rrup"] = np.linspace(1, 100, n)
mean, sigma, tau, phi = cmaker.get_mean_stds([ctx]) |
Thank you, I adapted your example and it passed the test. Note that I didn't need to instantiate the GMM using |
Using |
Thanks @micheles, we weren't aware of this. Good to know. |
Hi GEM:
If I vectorize the GMM inputs and run, say BSSA14, everything works as expected (and is much faster compared to previous versions). I've attached a minimally reproducible example:
However, if I attempt to vectorize the input to NGAEast GMMs I get an error and I don't know if it is an issue with the NGAEast models requiring the magnitude to be inputted as a scalar or if the code needs to be patched.
The error I get is from the line highlighted below:
If I look at other GMM implementations, they pass the recarray (ctx), which makes sense. But here that is not done and I don't know if it's related to these GMMs specifically or some other reason.
Please advise and thank you for your work on this python package.
The text was updated successfully, but these errors were encountered: