Deterministic seismic hazard analysis

1,529 views
Skip to first unread message

ozka...@gmail.com

unread,
Mar 23, 2015, 5:48:47 AM3/23/15
to openqua...@googlegroups.com
Dear developers,

I would like to conduct deterministic seismic hazard analysis by using OQ but I could not find any description or demo files. I would be appreciated if you can help me on this issue.

Best regards.

--
Özkan Kale

Michele Simionato

unread,
Mar 23, 2015, 6:07:24 AM3/23/15
to openqua...@googlegroups.com

Graeme Weatherill

unread,
Mar 23, 2015, 6:12:11 AM3/23/15
to openqua...@googlegroups.com
Dear Özkan,

OpenQuake has the option of generating ground motion fields for scenario events, with the possibility of generating multiple ground motion fields in order to take into account the ground motion uncertainty. An example of the inputs is here: https://github.com/gem/oq-risklib/tree/master/demos/ScenarioCase1.

Is this what you are trying to do when you say "deterministic seismic hazard analysis"?

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.

ozka...@gmail.com

unread,
Mar 23, 2015, 8:05:40 AM3/23/15
to openqua...@googlegroups.com
Dear Graeme,

Thank you for your respond.

I am not sure whether it is the case that I try to obtain. I would like compare the hazard results for a set of sites from Turkey. I have obtained probabilistic seismic hazard (PSHA) results by running OQ. Now I would like to compute deterministic seismic hazard (DSHA) results in order to compare the results with PSHA. I have a set of simple fault sources whose have a specific magnitude value, style-of-faulting (i.e. rake angle), upper and lower seismogenic depth values, dip angle, etc. I have a set of ground-motion prediction equations. If I use EZ-FRisk, it uses these inputs and calculates the closest distances between site and the faults. Then, it computes median or 84 percentile (or other fractiles specified before the analysis) spectral amplitudes (i.e., PGA, PGV or SA) for each faults considering the distance values and reports the largest value for the selected site as DSHA results. I think OQ also computes DSHA considering such an approach. Is this procedure same with the case you sent me (https://github.com/gem/oq-risklib/tree/master/demos/ScenarioCase1)?

Best regards.

Marco Pagani

unread,
Mar 30, 2015, 4:18:05 PM3/30/15
to openqua...@googlegroups.com
Dear Ozkan,

Sorry for replying late. In order to obtain what you describe in your
email the only possibility you have is to write a short code in python
which uses functions available in the OpenQuake Hazard library.

An example is available in the (ipython) notebooks repository accessible
at this link:

https://github.com/GEMScienceTools/notebooks/tree/master/hazardlib

The file you should have a look at is the one named GMPEs.ipynb.

Best wishes,

Marco


On 23/03/15 13:05, ozka...@gmail.com wrote:
> Dear Graeme,
>
> Thank you for your respond.
>
> I am not sure whether it is the case that I try to obtain. I would like
> compare the hazard results for a set of sites from Turkey. I have
> obtained probabilistic seismic hazard (PSHA) results by running OQ. Now
> I would like to compute deterministic seismic hazard (DSHA) results in
> order to compare the results with PSHA. I have a set of simple fault
> sources whose have a specific magnitude value, style-of-faulting (i.e.
> rake angle), upper and lower seismogenic depth values, dip angle, etc. I
> have a set of ground-motion prediction equations. If I use EZ-FRisk, it
> uses these inputs and calculates the closest distances between site and
> the faults. Then, it computes median or 84 percentile (or other
> fractiles specified before the analysis) spectral amplitudes (i.e., PGA,
> PGV or SA) for each faults considering the distance values and reports
> the largest value for the selected site as DSHA results. I think OQ also
> computes DSHA considering such an approach. Is this procedure same with
> the case you sent me
> (https://github.com/gem/oq-risklib/tree/master/demos/ScenarioCase1
> <https://github.com/gem/oq-risklib/tree/master/demos/ScenarioCase1>)?
>
> Best regards.
>
>
> On Monday, March 23, 2015 at 12:12:11 PM UTC+2, Graeme Weatherill wrote:
>
> Dear Özkan,
>
> OpenQuake has the option of generating ground motion fields for
> scenario events, with the possibility of generating multiple ground
> motion fields in order to take into account the ground motion
> uncertainty. An example of the inputs is here:
> https://github.com/gem/oq-risklib/tree/master/demos/ScenarioCase1
> <https://github.com/gem/oq-risklib/tree/master/demos/ScenarioCase1>.
>
> Is this what you are trying to do when you say "deterministic
> seismic hazard analysis"?
>
> Thanks,
>
> Graeme
>
> On 3/23/15 10:48 AM, ozka...@gmail.com <javascript:> wrote:
>> Dear developers,
>>
>> I would like to conduct deterministic seismic hazard analysis by
>> using OQ but I could not find any description or demo files. I
>> would be appreciated if you can help me on this issue.
>>
>> Best regards.
>>
>> --
>> Özkan Kale
>> --
>> 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 <javascript:>.
>> For more options, visit https://groups.google.com/d/optout
>> <https://groups.google.com/d/optout>.
>
> --
> 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
> <mailto:openquake-use...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--

*MARCO PAGANI* | Seismic hazard team coordinator | skype mm.pagani | g+
marco....@globalquakemodel.org | +39-0382-5169863

*GLOBAL EARTHQUAKE MODEL * working together to assess risk

*GEM -* globalquakemodel.org <http://www.globalquakemodel.org> | *T -*
@GEMwrld <http://twitter.com/GEMwrld> | *F -* GEMwrld
<http://www.facebook.com/GEMwrld>

ozka...@gmail.com

unread,
Mar 31, 2015, 3:21:29 AM3/31/15
to openqua...@googlegroups.com
Dear Marco,

Thank you for your kind respond. I will have a look at the file at the link.

Best wishes.

Ben Higgs

unread,
Feb 13, 2020, 10:12:03 PM2/13/20
to OpenQuake Users
Hi,

I'm looking to do a deterministic seismic hazard analysis (DSHA), I've read through this post but not sure if it was resolved. Is it possible to do a DSHA in OpenQuake? 

I.e is it possible to calculate a uniform hazard spectra for a single earthquake at a given distance from the site. The only logic tree would be for the different GSIMs, there is no AEP calculated for it.

Cheers
Ben

Graeme Weatherill

unread,
Feb 14, 2020, 1:40:07 AM2/14/20
to openqua...@googlegroups.com
Hi Ben,

For a single earthquake scenario, OpenQuake has the scenario calculator that generates ground motions at a site(s) from a GMPE. For this all you need is the model of the fault rupture (including magnitude, rake and 3D geometry) and the configuration file. There is an example here: https://github.com/gem/oq-engine/tree/master/demos/hazard/ScenarioCase1, and more information in the OpenQuake book and manual (available from https://www.globalquakemodel.org/oq-get-started)

The scenario calculator only runs one GMPE at a time usually generates multiple ground motion fields in order to sample the aleatory uncertainty on the GMPE. If you wanted the scenario spectrum for the median ground motions then this can be easily configured in the job.ini file by setting "truncation_level = 0", "number_of_ground_motion_fields = 1", and "intensity_measure_types = PGA, SA(0.1), SA(0.15), SA(0.2), ... SA(Tmax)". If you want a more conservative spectrum, such as the median plus 1 standard deviation, this is not feasible (to my knowledge) with the scenario calculator in its current form. For that you would do better actually calling the GMPEs from the OpenQuake library itself. Attached is a Jupyter Notebook that I use for teaching that demonstrates how to set up a scenario spectrum calculation directly from the OpenQuake libraries. I think this is working with the recent versions. To run a "logic tree" in this case you would simply need to run several GMPEs in a loop and weight the resulting spectra accordingly.

I hope this helps.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/openquake-users/8717f958-068b-4165-aa07-407b5bb4ef44%40googlegroups.com.


Exploring GMPEs for Scenario Earthquakes.ipynb

Ben Higgs

unread,
Feb 24, 2020, 2:24:19 PM2/24/20
to OpenQuake Users
Hi Graeme,

Thank you for your response! I've run the model and I can see that you get GMV results for different periods. Are these numbers ground accelerations? I would like to produce a uniform hazard spectra of ground acceleration vs period. If these numbers are not ground accelerations - is it possible to get ground acceleration values from a Scenario model run?

Thank you
Ben
To unsubscribe from this group and stop receiving emails from it, send an email to openqua...@googlegroups.com.

Peter Pažák

unread,
Feb 27, 2020, 2:25:46 AM2/27/20
to OpenQuake Users
Hi Ben,
yes, in general output of GMPEs are accelerations (PGA or SA for a specific period) in units of g (gravitational acceleration = 9.81 m/s2)

Hope this helps
Peter

francisj...@gmail.com

unread,
Sep 2, 2020, 12:43:54 AM9/2/20
to OpenQuake Users
Hello, Graeme.

With regards to the notebook you've provided above, I would like to ask if there's a way to obtain a list of Sa periods from each GMPE (in a list), say as instantiated from its corresponding CoeffsTable object? I am asking this because I would like to automate the initialization of periods in the notebook for a number of GMPEs. I am thinking of merging each respective period lists and just trim those periods that are beyond the available periods of any GMPE to prevent extrapolation (which will raise a KeyError).

Please comment if this is possible or if there is a better way on how to do this.

Thank you very much.

Best regards,

Francis

Graeme Weatherill

unread,
Sep 3, 2020, 2:20:56 AM9/3/20
to openqua...@googlegroups.com
Dear Francis,

The quickest way to retrieve a list of the periods for which the Sa coefficients of a GMPE are defined is via (for example using BindiEtAl2014Rjb):

from openquake.hazardlib.gsim.bindi_2014 import BindiEtAl2014Rjb
periods = list([sa.period for sa in BindiEtAl2014Rjb.COEFFS.sa_coeffs])

The alternative, and one I use more often in things such as trellis plotting, is to define your list of periods a priori and simply run the GMPE within a try-except block that caches a KeyError specifically, e.g.:

import numpy as np
from openquake.hazardlib.imt import SA
periods = [0.01, 0.02, ... 10.]
imts = [SA(per) for per in periods]
medians = np.zeros(len(periods))
gsim = BindiEtAl2014Rjb()
for i, imt in enumerate(imts):
   #...
   #all the steps to get the rupture, site and distance contexts
   #...
    try:
        medians[i] = gsim.get_mean_and_stddevs(..., imt, ...)[0]
    except KeyError:
        medians[i] = np.nan

It depends which one suits your workflow better.

I hope that helps.

Thanks,

Graeme

David Cohen

unread,
Mar 29, 2021, 11:07:13 AM3/29/21
to OpenQuake Users
Marco,

I need direction on how I use the "GMPEs.ipnyb" to run the GMPEs to find the standard deviation of a scenario event, I am new to python.

Regards,
David

Betka Pazakova

unread,
Mar 29, 2021, 2:08:49 PM3/29/21
to OpenQuake Users
The notebooks are a bit older, so they need some modifications to run smoothly (I run with OQ 3.10):
1) adding tectonic region type: context_maker = ContextMaker('Active Shallow Crust',gmpes)
2) exchanging the order of contexts to: rctx, sctx, dctx = context_maker.make_contexts(site_collection, rupture)
You can request to get intra- and inter-event standard deviations
        [mean], std = gmpe.get_mean_and_stddevs(sctx, rctx, dctx, PGA(), [StdDev.TOTAL,StdDev.INTRA,StdDev.INTER])
        values.append(std)
but it will be maybe a bit longer to put together e.g. a plot of the stddevs and, not sure if this information is sufficient for you as " standard deviation of a scenario event"

Peter

Dátum: pondelok 29. marca 2021, čas: 17:07:13 UTC+2, odosielateľ: david.m....@gmail.com

David Cohen

unread,
Mar 29, 2021, 5:39:51 PM3/29/21
to openqua...@googlegroups.com
Peter, 

I did understand that there are sections that need to be edited, but I edit the GMPEs.ipnyb for the GMPES and source model types, but I do not know how do to run this file in OQ.

Thanks for your help

David

You received this message because you are subscribed to a topic in the Google Groups "OpenQuake Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openquake-users/B15byzkH2SI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openquake-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openquake-users/b14cd18d-2c2f-4540-997a-a6e066fa01c6n%40googlegroups.com.


--
Watch your thoughts, for they become words. Watch your words, for they become actions. Watch your actions, for they become habits. Watch your habits, for they become your character. And watch your character, for it becomes your destiny. 

Lao Tzu

Peter Pažák

unread,
Mar 29, 2021, 11:43:24 PM3/29/21
to OpenQuake Users
Hi,

these jupyter notebooks only use parts of OpenQuake code and are designed to explore and visualise GMPEs, you cannot use / run .ipynb in OQ.
Could you plese describe what you would like to achieve?
The code in notebooks could help you to find out what will be the intra- and inter-event standard deviation when you run a specific scenario (will depend on GMPE and period).
Then, if OQ is run, random numbers from (truncated)normal distribution are drawn, that will be multiplied by these SDs (the intra-event residuals could get correlated in addition).
Sigma inter-event and epsilon are saved in the calculation and are exported when you export ground motion fields, the intra-event part can be found maybe only by running the
same calculation without uncertainty (truncation_level = 0) and then subtracting logarithms of the gm fields.

Peter

Dátum: pondelok 29. marca 2021, čas: 23:39:51 UTC+2, odosielateľ: david.m....@gmail.com

David Cohen

unread,
Mar 30, 2021, 5:39:18 PM3/30/21
to openqua...@googlegroups.com
Peter,

I am attempting to obtain the standard deviation of different GMPEs for active, intraplate and interface events that have been used in my scenario assessment. What you wrote above that they can be used to explore and visualise GMPEs, and also "The code in notebooks could help you to find out what will be the intra- and inter-event standard deviation when you run a specific scenario" ; does this mean that I can incorporate portions of the notebook in my job.ini and obtain SDs?

I did attempt to run the scenario event with truncation = 0, but it created an error message.

Regards,
David



To unsubscribe from this group and stop receiving emails from it, send an email to openquake-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openquake-users/3ae77050-dc19-461e-966b-a2ed0fcc0ba3n%40googlegroups.com.

Peter Pažák

unread,
Apr 1, 2021, 11:07:03 AM4/1/21
to OpenQuake Users
Hi David,

I modified the GMPEs jupyter notebook to show you how to print/plot the SDs for the selected GMPEs, maybe something of that will help you.
You can modify to get SDs for your GMPE for given magnitude and IMT, dependency on distance should not be significant.
The notebooks cannot directly be used / incorporated into the job.ini in any way, they are completely seprate.

Not all GMPEs support setting truncation_level = 0, what was the error you got?

PeterSDs.png

GMPEs_SD.zip

David Cohen

unread,
Apr 5, 2021, 10:08:03 AM4/5/21
to openqua...@googlegroups.com
Peter,

Thank you for all the assistance. The error messages were:

([AkkarEtAlRjb2014], PGA, source_id='0') ValueError: truncation_level=0 requires no correlation model
([BindiEtAl2017Rjb], PGA, source_id='0') ValueError: truncation_level=0 requires no correlation model
([BooreEtAl2014], PGA, source_id='0') ValueError: truncation_level=0 requires no correlation model

([DrouetBrazil2015withDepth], PGA, source_id='0') ValueError: truncation_level=0 requires no correlation model

([AbrahamsonEtAl2018SInterHigh], PGA, source_id='0') ValueError: truncation_level=0 requires no correlation model
([MontalvaEtAl2017SInter], PGA, source_id='0') ValueError: truncation_level=0 requires no correlation model
([ZhaoEtAl2016SInter], PGA, source_id='0') ValueError: truncation_level=0 requires no correlation model

([AbrahamsonEtAl2018SSlab], PGA, source_id='0') ValueError: truncation_level=0 requires no correlation model
([MontalvaEtAl2017SSlab], PGA, source_id='0') ValueError: truncation_level=0 requires no correlation model

Are there alternatives to these that could be used in their place?

David

--
You received this message because you are subscribed to a topic in the Google Groups "OpenQuake Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openquake-users/B15byzkH2SI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openquake-use...@googlegroups.com.

Peter Pažák

unread,
Apr 5, 2021, 2:48:25 PM4/5/21
to OpenQuake Users
Hi, when you set truncation_level=0 please set
ground_motion_correlation_model =
(nothing after the sign "=") and try again.
You might get another error, but with a bit of luck you could get the median ground motions for your scanario and compare
GM without uncertainty to GM with uncertainty.

Peter


Dátum: pondelok 5. apríla 2021, čas: 16:08:03 UTC+2, odosielateľ: david.m....@gmail.com

Arifan Syahbana

unread,
Jun 28, 2021, 7:44:03 PM6/28/21
to openqua...@googlegroups.com
Hi All,

Good morning, hope you all in good condition. After all, I try the python file from Graeme to conduct the distances vs GMPEs. Unluckily, I have an obstacle when using ChiouYoungs2014. The warning is like below:
--------------------------------------------------------------------
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-24-fd9a48e5c645> in <module>
     14         results[imt_name][gmpe_name] = {}
     15         # Run the GMPE
---> 16         mean, [stddev] = gmpe.get_mean_and_stddevs(sctx, rctx, dctx, imt, stddev_types)
     17         # Organise the results
     18         results[imt_name][gmpe_name]["mean"] = np.exp(mean)

/usr/local/lib/python3.6/dist-packages/openquake/hazardlib/gsim/chiou_youngs_2014.py in get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types)
     95         # Get standard deviations
     96         stddevs = self.get_stddevs(C, sites, rup.mag, y_ref, f_nl_scaling,
---> 97                                    stddev_types)
     98         return mean, stddevs
     99 

/usr/local/lib/python3.6/dist-packages/openquake/hazardlib/gsim/chiou_youngs_2014.py in get_stddevs(self, C, sites, mag, y_ref, f_nl_scaling, stddev_types)
    120         # Get between and within-event variability
    121         tau = self.get_tau(C, mag)
--> 122         phi_nl0 = self.get_phi(C, mag, sites, nl0)
    123         # Get total standard deviation propagating the uncertainty in the
    124         # nonlinear amplification term

/usr/local/lib/python3.6/dist-packages/openquake/hazardlib/gsim/chiou_youngs_2014.py in get_phi(self, C, mag, sites, nl0)
    150         """
    151         phi = C["sig3"] * np.ones(sites.vs30.shape)
--> 152         phi[sites.vs30measured] = 0.7
    153         phi = np.sqrt(phi + ((1.0 + nl0) ** 2.))
    154         mdep = C["sig1"] + (((C["sig2"] - C["sig1"]) / 1.5) *

IndexError: arrays used as indices must be of integer (or boolean) type
-------------------------------------------------------------------------
Any clue of this matter? Thank you very much for the solution. Cheers
PS: I attach the modified python file for the better view of my problems

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/openquake-users/8717f958-068b-4165-aa07-407b5bb4ef44%40googlegroups.com.


--
Warmest Regards, 

Arifan Jaya Syahbana, M.Eng
Indonesian Institute of Sciences - Research Center of Geotechnology 
Jl. Sangkuriang Bandung 40135 
Fax : 022-2504593 
Phone : 022-2503654
IMT-Distances GMPEs_shallowcrustal2.ipynb

Peter Pažák

unread,
Jul 6, 2021, 11:20:32 PM7/6/21
to OpenQuake Users
Hi, you just need to set vs30measured data type to integer:

sctx.vs30measured = np.ones_like(dctx.rjb, dtype=int)

numpy just does not like to have them float.

Peter

Dátum: utorok 29. júna 2021, čas: 1:44:03 UTC+2, odosielateľ: arifan...@gmail.com

Arifan Syahbana

unread,
Jul 7, 2021, 12:34:47 AM7/7/21
to openqua...@googlegroups.com
Hi Peter,

Thanks for the information, we will try.. 
Cheers

Reply all
Reply to author
Forward
0 new messages