OpenQuake tool for calculating average GMFs at sites in scenario mode?

285 views
Skip to first unread message

ruthm...@gmail.com

unread,
Jan 28, 2021, 12:07:00 PM1/28/21
to OpenQuake Users
Hi Marco, Michelle, Graeme, et al,

I was wondering whether an OpenQuake hazard function exists for scenario made, that calculates the average GMF at each site over all the realisations, that my Kyrgyz collaborators can use.

We use OpenQuake in scenario mode and for each scenario we want to calculate the average PGA, for example, at each site. In order to do this I have written them a simple python script that loads the site locations (from sitemesh.csv) and the gmf data (from gmf.csv), takes the mean of all the realisations at each site for all the GMPEs, and outputs a file of: longitude, latitude, mean PGA, etc.

My collaborators however are not very comfortable with python, and whilst they are happy to run the script they aren't able to update it themselves. This has caused some issues as you've upgraded OpenQuake (e.g. changed the column name from 'sid' to 'site_id', or changed the number of rows of headers) and I have had to update the script for them.

So I was wondering if there was a tool within OpenQuake or the Hazard Modeller’s Toolkit that does this, that you update with new versions, so that they could use that rather than my script? I couldn't see one, but thought it would be worth checking.

Many thanks,

Ruth

Michele Simionato

unread,
Jan 29, 2021, 5:30:58 AM1/29/21
to OpenQuake Users
The next version of the OpenQuake engine will also compute the average GMF (it is already implemented in master, only the exporter is missing).
Notice that computing correctly the average GMF is tricky because the engine does not store the zeros.
For instance if you have 3 events and the GMVs are [0.1, 0.2, 0] the correct average will be (0.1 + 0.2 + 0)/3 = 0.1, however any script looking only at the exported GMFs would
compute the wrong average (0.1 + 0.2) / 2 = 0.15 because the zero value is not stored and not exported.

                        Michele

Ruth Amey

unread,
Feb 3, 2021, 6:28:22 AM2/3/21
to OpenQuake Users
Hi Michele,

Great to hear the next version will compute average GMFs.

And thanks for that information, I wasn't aware that OpenQuake doesn't store zeros. To clarify, does that mean when exporting the gmf-data.csv file for scenarios, any GMF values that are zero will show a NaN or be empty? Or will that row for that realisation not be exported at all? I will go and check this isn't a problem in my scenarios.

Many thanks,

Ruth

Michele Simionato

unread,
Feb 3, 2021, 8:15:34 AM2/3/21
to OpenQuake Users
On Wednesday, February 3, 2021 at 12:28:22 PM UTC+1 Ruth Amey wrote:
Hi Michele,

Great to hear the next version will compute average GMFs.

And thanks for that information, I wasn't aware that OpenQuake doesn't store zeros. To clarify, does that mean when exporting the gmf-data.csv file for scenarios, any GMF values that are zero will show a NaN or be empty? Or will that row for that realisation not be exported at all? I will go and check this isn't a problem in my scenarios.


The row will not be exported at all. Notice that it depends on the version of the engine, in the past scenarios were also exporting the zeros, but in current master for sure the zeros are not exported, both in scenarios and event based calculations.
I do not remember what is the situation for engine 3.10, you should check.

            Michele 

Stoyan Andreev

unread,
Feb 10, 2021, 9:51:38 AM2/10/21
to OpenQuake Users
Hi Michele, 
In addition to providing the mean scenario hazard, do you plan to output also the stdev and percentiles?

Michele Simionato

unread,
Feb 11, 2021, 2:15:03 AM2/11/21
to OpenQuake Users
The stddev, not the percentiles. However it should be emphasized that when I say mean and stddev, I mean in log space: this is equivalent to computing geometric mean and geometric standard deviation, defined as the exponential of the correspondent quantities on the logarithms of the ground motion fields (see also https://en.wikipedia.org/wiki/Log-normal_distribution). The feature is documented here and it is already available in the current master:
         Michele

Stoyan Andreev

unread,
Feb 11, 2021, 6:07:26 AM2/11/21
to OpenQuake Users
Thank you Michele, 
You are providing the logarithm of the median (ie "mu") and the log-standard (ie "beta") of the distribution of the ground motion. I think this is quite enough, since even when combining different GMMs the final distribution of the GMF values is very close to log-normal.

Stoyan

Doston Jumayev

unread,
Feb 17, 2025, 5:15:45 AM2/17/25
to OpenQuake Users

Dear Michele Simionato,

Thank you for your explanations.

From your response, I understand that the engine can store the mean GMFs internally but does not export them in the form of a CSV file. Is this correct? If so, is there still an issue when trying to generate the average value as an output file?

Additionally, could you suggest a method for computing the average GMFs for a large number of points (e.g., 10,000) and simulations (e.g., 1,000)? I am also wondering whether it is possible to compute average values directly from the HDF5 file that is provided as output.

Thank you again for your assistance.

пятница, 29 января 2021 г. в 15:30:58 UTC+5, Michele Simionato:
Reply all
Reply to author
Forward
0 new messages