Question about earthquake rupture file

227 views
Skip to first unread message

Gustavo Posada

unread,
Jun 26, 2019, 4:51:19 PM6/26/19
to OpenQuake Users

Hello!!

I want to calculate the estimation of the PGA for an event post-earthquake, I need to create the geometry of an earthquake rupture in NRML file from python code.


How can I build this file?


Thank you so much!



Michele Simionato

unread,
Jun 27, 2019, 2:59:51 AM6/27/19
to OpenQuake Users
Manually. There are several examples of ruptures in the NRML format in the scenario tests, see for instance

Peter Pažák

unread,
Jun 27, 2019, 3:59:08 AM6/27/19
to OpenQuake Users
If the rupture is not too complex, maybe also worth to look at Input Preparation Toolkit:


(registration required...), switch to tab Earthquake Rupture and tick Simple/Complex Fault Rupture, there you specify
magnitude, rake, hypocenter and the coordinates of points comprising the rupture surface edges and finally export/convert to NRML.
You also may start in QGIS drawing the geometry, exporting coordinates and then using them in IPT,
output xml from a python script or edit xml file manually like Michelle proposed...

Peter



Gustavo Posada

unread,
Jun 28, 2019, 8:42:26 AM6/28/19
to OpenQuake Users
Hi Peter! 

Thanks so much, yes I know the IPT but I wanna build the rupture file automatically. I guess that there is a methodology from python, but I don't know it.

Gustavo Posada

unread,
Jun 28, 2019, 8:44:21 AM6/28/19
to OpenQuake Users
Thanks Michele! 

Is there any tool to build the rupture file automatically?

Marco Pagani

unread,
Jun 28, 2019, 8:51:22 AM6/28/19
to OpenQuake Users

Regarding the construction of the rupture, which is the information you start from?
M


--
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/d1edb502-52f2-4e62-b70f-4879f3daeab3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


MARCO PAGANI | Seismic Hazard Team Lead | Skype mm.pagani | +39-0382-5169863
GLOBAL EARTHQUAKE MODEL | working together to assess risk

Gustavo Posada

unread,
Jun 28, 2019, 8:54:36 AM6/28/19
to OpenQuake Users
Hi Marco,

The information is the focal mechanism, hypocenter, and magnitude.


El viernes, 28 de junio de 2019, 7:51:22 (UTC-5), Marco Pagani escribió:

Regarding the construction of the rupture, which is the information you start from?
M


Thanks Michele! 

Is there any tool to build the rupture file automatically?

El jueves, 27 de junio de 2019, 1:59:51 (UTC-5), Michele Simionato escribió:


On Wednesday, June 26, 2019 at 10:51:19 PM UTC+2, Gustavo Posada wrote:

Hello!!

I want to calculate the estimation of the PGA for an event post-earthquake, I need to create the geometry of an earthquake rupture in NRML file from python code.


How can I build this file?


Thank you so much!



Manually. There are several examples of ruptures in the NRML format in the scenario tests, see for instance

--
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 openqua...@googlegroups.com.

Michele Simionato

unread,
Jun 28, 2019, 9:31:05 PM6/28/19
to OpenQuake Users


On Friday, June 28, 2019 at 2:44:21 PM UTC+2, Gustavo Posada wrote:
Thanks Michele! 

Is there any tool to build the rupture file automatically?

No, this is why I told you that you have to do it manually.

Marco Pagani

unread,
Jul 1, 2019, 8:18:26 AM7/1/19
to OpenQuake Users

Are you familiar with python? If so I will try to share some simple code.

--
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.
Message has been deleted

Gustavo Posada

unread,
Jul 1, 2019, 10:24:48 AM7/1/19
to OpenQuake Users
Yes Marco, I am.

I am using python and bash codes in my research. 


El lunes, 1 de julio de 2019, 7:18:26 (UTC-5), Marco Pagani escribió:

Are you familiar with python? If so I will try to share some simple code.

Thanks Michele! 

Is there any tool to build the rupture file automatically?

El jueves, 27 de junio de 2019, 1:59:51 (UTC-5), Michele Simionato escribió:


On Wednesday, June 26, 2019 at 10:51:19 PM UTC+2, Gustavo Posada wrote:

Hello!!

I want to calculate the estimation of the PGA for an event post-earthquake, I need to create the geometry of an earthquake rupture in NRML file from python code.


How can I build this file?


Thank you so much!



Manually. There are several examples of ruptures in the NRML format in the scenario tests, see for instance

--
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 openqua...@googlegroups.com.

Catalina YepesE

unread,
Jul 23, 2019, 5:46:40 AM7/23/19
to openqua...@googlegroups.com
Dear Gustavo,

The IPT uses the equations form Wells and Coppersmith (2015) to create a simple fault plane from a rupture focal mechanism, hypocenter, and magnitude information. The equation was selected for active shallow events. Find in the following link some code that might help you.


Regards,


CATALINA YEPES ESTRADA
 | seismic risk modeller | +39-03825169899

GLOBAL EARTHQUAKE MODEL | working together to assess risk

GEM - globalquakemodel.org | T - @GEMwrld | F - GEMwrld

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/da5b15bf-c70f-498e-b47e-59f5f90d86c8%40googlegroups.com.

Gustavo Posada

unread,
Jul 23, 2019, 10:27:13 AM7/23/19
to OpenQuake Users
Hi Catalina,

Thanks so much! The code will be useful. 

Regards,

Peter Pažák

unread,
Nov 10, 2021, 7:40:12 AM11/10/21
to OpenQuake Users
Just in case of interest, this small code outputs earthquake_rupture.xml (pasted at the end of the above code):

mag = 5.9
strike = 160 #degrees
dip = 41
rake = 124
#hypocenter
lon = -71.183
lat = 48.117
depth = 28.5

rs = get_rupture_surface(mag,{'lon':lon,'lat':lat,'depth':depth},strike, dip, rake)

content = f'''<?xml version="1.0" encoding="utf-8"?>
    <singlePlaneRupture>
        <magnitude>{mag}</magnitude>
        <rake>{rake}</rake>
        <hypocenter lat="{lat}" lon="{lon}" depth="{depth}"/>
        <planarSurface strike="{strike}" dip="{dip}">
            <topLeft lon="{rs['topLeft']['lon']}" lat="{rs['topLeft']['lat']}" depth="{rs['topLeft']['depth']}"/>
            <topRight lon="{rs['topRight']['lon']}" lat="{rs['topRight']['lat']}" depth="{rs['topRight']['depth']}"/>
            <bottomLeft lon="{rs['bottomLeft']['lon']}" lat="{rs['bottomLeft']['lat']}" depth="{rs['bottomLeft']['depth']}"/>
            <bottomRight lon="{rs['bottomRight']['lon']}" lat="{rs['bottomRight']['lat']}" depth="{rs['bottomRight']['depth']}"/>
        </planarSurface>
    </singlePlaneRupture>
</nrml>
'''

fo = open('earthquake_rupture_oq.xml','w')
fo.write(content)
fo.close()

Dátum: utorok 23. júla 2019, čas: 16:27:13 UTC+2, odosielateľ: gustavo...@siata.gov.co
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages