How to determine gridded seismicity based on background source in Open Quake???

501 views
Skip to first unread message

Muhammad Zulkifli

unread,
Jun 16, 2021, 9:13:20 PM6/16/21
to OpenQuake Users
Hallo everyone
I am Muhammad Zulkifli

I have problem in terms of determine  gridded seismicity  based on background source from earthquake cataloge for input PSHA in OpenQuake.

maybe someone has a solution, ow to determine gridded seismicity  based on background source in Open Quake???

Nima Dolatabadi

unread,
Jul 5, 2021, 12:02:56 AM7/5/21
to OpenQuake Users
Hello,
In order to do a grid source or smooth seismicity PSHA you need a grid of weighted a-values. for this you can use HMTK documentation prepared by openquake or use some third party Pakages such as zmap. just a grid of weighted a-values is enough to do so.
in order to create the input models i suggest you to check out openquake installation directory/qa_tests/classical/case53 or case 54. input is a part of Prof. Pagani Project on Africa.
I hope this helps.
Regards.

Muhammad Zulkifli

unread,
Jul 8, 2021, 12:37:05 AM7/8/21
to OpenQuake Users
Thanks a lot for your advice
good louc sir. I wanna try it

Muhammad Zulkifli

unread,
Jul 9, 2021, 2:25:27 AM7/9/21
to OpenQuake Users
Hello Sir

I already done run Smoothed Seismicity using tutorial in HMTK, and its succesfull.
the output file after running in "CSV" format.

my Question is how i use the cataloge Smoothed Seismicity for running hazard in Open Quake?

I follow your suggestion to open this dirctory openquake installation directory/qa_tests/classical/case53 or case 54
but I still confuse how input my Smoothed Seismicity data in that directory.
Pada Senin, 05 Juli 2021 pukul 12.02.56 UTC+8 Nima Dolatabadi menulis:

Nima Dolatabadi

unread,
Jul 14, 2021, 12:11:41 AM7/14/21
to OpenQuake Users
Hello again.
As you can see the result is based on smooth seismicity values which can be used in forcasting but not in PSHA. for this issue you must do some modification to openquake sourced code. you must edit smooth_seismicity.py to calculated the a-value for each point given in the file. if you're not familiar with python, I sugest that you go through other alternatives like zmap or other matlab codes that I can refrence you to Prof. Alessandro Valentini.
though for more information to create the openquake input files, I share the test for you below:
please keep that in mind that you do not need to create lots of issues in this group to get your answers, create one and reply to it over and over like this one.
I hope you'll be good
Regards
Nima Dolatabadi

Muhammad Zulkifli

unread,
Jul 14, 2021, 9:03:06 PM7/14/21
to openqua...@googlegroups.com
Thanks a lot sir  Nima Dolatabadi

I many get information from you. firts of all , i want to check again your suggestion based on link you send to me.

maybe if i get complex way , i call you bcak again .



--
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/bb3ff602-05ed-48bc-90c2-e67fb3a4bae7n%40googlegroups.com.


--
Muhammad Zulkifli 
Meteorological Climatological Geophysical
Agency (BMKG) & State College (STMKG)
Jakarta, 0812-12871083

Nima Dolatabadi

unread,
Jul 15, 2021, 11:57:45 AM7/15/21
to OpenQuake Users
I'll be happy to help.
feel free to contact
Ragards
Nima

Muhammad Zulkifli

unread,
Jul 18, 2021, 10:46:57 PM7/18/21
to OpenQuake Users
Hello Sir Nima
I successfull run smoothed seismicty and output file in csv format.

I want convert this data into xml or nrml for run psha . how i get the way for it??

like i attcah file bellow, i want to input coordinate and a value weight, but it complex if i input manual 
xml-data2.JPG
xml-data.JPG

David Cohen

unread,
Sep 27, 2021, 5:48:46 PM9/27/21
to openqua...@googlegroups.com
Nima, 

You have discussed alternatives for statistical earthquake data analysis i.e. declustering, completeness, b and a values, etc. and referenced Professor Alessandro Valentini. I have attempted to install HMTK package but the instructions are old and do not work. 

Is there any package that you can recommend?

Regards,
David

--
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/bb3ff602-05ed-48bc-90c2-e67fb3a4bae7n%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,
Oct 1, 2021, 3:52:23 AM10/1/21
to OpenQuake Users
Hi, HMTK is now part of OpenQuake, so if you have some recent version, you already have it installed, just the use is a bit tricky, you need to find out what parts of the code need to be replaced to their new locations - this works for me on OQ 3.11:

from openquake.hmtk.parsers.catalogue.csv_catalogue_parser import CsvCatalogueWriter, CsvCatalogueParser
from openquake.hmtk.seismicity.catalogue import Catalogue
cat = CsvCatalogueParser(input_file = 'ISC-GEM-V3.csv').read_file() #recognised headers need to be present in the csv file

from openquake.hmtk.seismicity.selector import CatalogueSelector
#select within bounding box (Turkey) min lonlat, max lonlat, done on the original cat
CatalogueSelector(master_catalogue=cat,create_copy=False).within_bounding_box([23.4,34.5,48.5,44.2])

from openquake.hmtk.seismicity.declusterer.dec_afteran import Afteran
from openquake.hmtk.seismicity.declusterer.distance_time_windows import GardnerKnopoffWindow
declust_method = Afteran()
declust_config = {'time_distance_window': GardnerKnopoffWindow(), 'time_window': 100.0}
cluster_index, cluster_flag = declust_method.decluster(cat, declust_config)
cat.purge_catalogue(cluster_flag == 0) #remove aftershocks

cat.write_catalogue('ISC-GEM_Turkey.csv') #we can save the resulting declustered catalogue

comp_config = {'magnitude_bin': 0.5, 'time_bin': 5., 'increment_lock': True }
from openquake.hmtk.seismicity.completeness.comp_stepp_1971 import Stepp1971
completeness_algorithm = Stepp1971 ()
completeness_table = completeness_algorithm.completeness (cat ,comp_config )

#The next step could be to determine GR relationship for an area source, e.g

from openquake.hazardlib.geo.point import Point
from openquake.hazardlib.geo.polygon import Polygon
pns = '3.3346058E+01 3.8560173E+01 3.2787741E+01 3.7673824E+01 3.2287301E+01 3.7357098E+01 3.1895493E+01 3.7828385E+01 3.1029273E+01 3.8543841E+01 3.0987743E+01 3.8584700E+01 3.0809671E+01 3.8594232E+01 3.0636475E+01 3.8639983E+01 3.0402299E+01 3.8798211E+01 3.0053471E+01 3.9006840E+01 2.9711967E+01 3.9121456E+01 2.9399727E+01 3.9117636E+01 2.9126519E+01 3.9194048E+01 2.8207768E+01 3.9494066E+01 2.8187624E+01 3.9683284E+01 2.8425452E+01 3.9819942E+01 2.8824420E+01 4.0066503E+01 2.9631731E+01 3.9812212E+01 2.9941591E+01 3.9714611E+01 3.0372154E+01 3.9580687E+01 3.0983979E+01 3.9422098E+01 3.1489729E+01 3.9249590E+01 3.1933458E+01 3.9076420E+01 3.2399578E+01 3.8822339E+01 3.2694714E+01 3.8602817E+01 3.2822972E+01 3.8487713E+01 3.2949770E+01 3.8658522E+01 3.3090816E+01 3.8851659E+01'.split(' ')
poly = Polygon([Point(float(pns[i]),float(pns[i+1])) for i in range(0,len(pns),2)]) 

trbg103 = CatalogueSelector(master_catalogue=cat,create_copy=True).within_polygon(poly)

mle_config = {'magnitude_interval': 0.1, 'reference_magnitude': None, 'Average Type': 'Weighted'}
from openquake.hmtk.seismicity.occurrence.b_maximum_likelihood import BMaxLikelihood
recurrence = BMaxLikelihood()
bval, sigmab, aval, sigmaa = recurrence.calculate (trbg103, mle_config, completeness = completeness_table)

but this last step failed for me - I just followed some old examples and have rewritten them, I would also be grateful if someone would share some code to do the whole process.

Thank you
Peter

Dátum: pondelok 27. septembra 2021, čas: 23:48:46 UTC+2, odosielateľ: david.m....@gmail.com

C LALLAWMAWMA

unread,
Mar 31, 2022, 7:51:09 AM3/31/22
to OpenQuake Users
Hello, can you tell how you fixed this, i have tried to run smoothed seismicity using HMTK but i cannot execute from completeness table and cant run smoothed seismicity

Hazem Badreldin

unread,
Apr 2, 2022, 5:43:39 AM4/2/22
to openqua...@googlegroups.com
Hi, 
you can use this code. I have used it in my calculations and it is running without any errors. However, I still have some problems with the output results such as high a values.
You can try to use it, I hope it helps.

catalogue_filename = r"E:\openquake\codes_2022\Hazem_PhD\Aqaba-out\aqaba_cat_dec_uh.csv"
parser = CsvCatalogueParser (catalogue_filename)
catalogue = parser.read_file (start_year=1016, end_year=2020)
comp_config = {'magnitude_bin': 0.5,'time_bin': 5.,'increment_lock': True}
completeness_algorithm = Stepp1971()
completeness_table = completeness_algorithm.completeness(catalogue,comp_config)
#Grid limits should be set up as[min_long,max_long,spc_long,min_lat max_lat,spc_lat,min_depth,max_depth,spc_depth]
grid_limits = [32,36,0.1,26,32,0.1,0, 60,30]
# Assuming a b- value of 1.0
smooth_seis = SmoothedSeismicity(grid_limits, use_3d=True, bvalue=1)
config = {'Length_Limit':3,'BandWidth':50,'increment':True}
output_data = smooth_seis.run_analysis (catalogue,config,completeness_table,smoothing_kernel=IsotropicGaussian())
output= smooth_seis.write_to_csv(r"E:\openquake\codes_2022\Hazem_PhD\Aqaba-out\smoothed_aqaba_cat_dec_uh_test.csv")

Regards,
Hazem Badreldin

--
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.

Fredy L

unread,
Jun 29, 2022, 10:21:58 AM6/29/22
to OpenQuake Users
Can u please confiirm this code is still working, 2 months back it works, i update the engine  but now it got stuck in the last steps..
output_data = smooth_seis.run_analysis (catalogue,config,completeness_table,smoothing_kernel=IsotropicGaussian())

Reply all
Reply to author
Forward
0 new messages