Implementing a new GMPE

310 views
Skip to first unread message

ozka...@gmail.com

unread,
Oct 14, 2016, 12:43:33 PM10/14/16
to OpenQuake Users
Hi All,

I am trying to implement Kale et al. (2015) GMPEs (Kale, Ö., Akkar, S., Ansari, A. and Hamzehloo, H. (2015). A ground-motion predictive model for Iran and Turkey for horizontal PGA, PGV and 5%-damped response spectrum: Investigation of possible regional effects, Bulletin of the Seismological Society of America, 105, 2A, 963-980) to openquake by considering the steps explained in "https://github.com/gem/oq-hazardlib/wiki/Implementing-a-new-GSIM-in-the-OpenQuake-hazard-library-%5Bprovisional%5D".

I have prepared kale_2015.py, kale_2015_test.py and csv data files (mean and standard deviations) required for the tests. However I do not understand what I should do to test the code. Could you please help me on this issue?

Thanks,
Ozkan

Graeme Weatherill

unread,
Oct 14, 2016, 1:12:45 PM10/14/16
to openqua...@googlegroups.com
Dear Ozkan,

The specific instructions will depend on how you have installed the development version of OpenQuake on your system. To implement new features it is important that you install the development version of OpenQuake. For OSX and Linux I strongly recommend following the instructions here: https://github.com/gem/oq-engine/blob/master/doc/installing/development.md. I'm not sure of the best configuration for Windows (perhaps one of the developers can advise).

Your installation of oq-hazardlib should have brought in the package "nose 1.3.7". Assuming for now that you are working from the command line the first thing I suggest is to verify that the general test suite is running. Before adding your new python files to the hazardlib code (or moving them out of the directory temporarily) cd into the oq-hazardlib directory and run:

nosetests -v -a '!slow'

This should take about 10 - 15 minutes and will verify that OQ is working correctly. If so, then place the kale_2015.py file into the directory openquake/hazardlib/gsim, and the kale_2015_test.py file into the directory openquake/hazardlib/tests/gsim. Then, in the folder openquake/hazardlib/tests/gsim/data create a new folder called something like 'kale15' (or whatever relative pathname you have specified in the kale_2015_test file) and inside that new folder place the csv files. When you have done this return to the oq-hazardlib directory and from the command line run:

nosetests openquake/hazardlib/tests/gsim/kale_2015_test.py --verbose

This should execute the tests and tell you the status (OK/ERROR/FAIL) of each of the tests in the kale_2015_test.py file. If it indicates that all of the tests are running OK then you are good. If there are error messages then there is a problem in the code and you should read the log message to debug, then repeat etc. If you are seeing "FAIL" messages then it will give you statistics on the degree of mismatch - it means the GMPE is running but is not giving the values you are expecting. If it is not obvious from your code where the problem is, you can open the file openquake/hazardlib/tests/gsim/check_gsim.py and on line 40 change the debug option to True. Running the tests again this will tell you more about where the tests are failing and help you to track down which part of the code is giving problems. Once the tests are passing set this debug option back to False.

If you are happy using Github then generate a pull request (one of us will probably clone the branch and do any cleanup, add docs etc.), or ii) send me the files to this email (gra...@openquake.org) and I will open the pull request.

Please let me know if you need assistance with the GMPE (sending me the files will make this faster), or let us know if you haven't been able to successfully setup the development environment for OpenQuake.

Thanks,

Graeme
--
You received this message because you are subscribed to the Google Groups "OpenQuake Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openquake-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages