using the dstore to probe disaggregation results

103 views
Skip to first unread message

Anne Hulsey

unread,
Sep 14, 2021, 2:50:16 PM9/14/21
to OpenQuake Users
I'm trying to get familiar with how disaggregation results are stored in the dstore, so I can nimbly extract exactly what I am looking for.

calculations.export.hazard includes an export_disagg_csv_xml function. For each N (site), M (imt), P (poe level), and Z (no sure what this is), it selects a realization based on r = hmap4.rlzs[s,z]. What does this realization represent and when/how was it selected?

Also, calculations.extract has several functions with (dstore, what) as the input. Where can I find a list of options for the "what" parameter?

Michele Simionato

unread,
Sep 16, 2021, 1:41:25 AM9/16/21
to OpenQuake Users
This is advanced. In a disaggregation calculation you can specify the realizations you want to consider with the parameters `rlz_index` or `num_rlzs_disagg` (both documented in the manual, see there).
For instance suppose there are 1000 realizations and for some reason you are interested only in realizations 42 and 475. Then you would set `rlz_index = 42,475` in the job.ini. In that case Z would be 2
and z=0 would refer to realization #42 while z=1 would refer to realization #475.

By default Z is 1 because the calculator extracts the realization producing the hazard curve closest to the mean for the site in consideration and uses only that. If you want the engine to consider (for instance)
the 4 realizations closest to the mean you can specify `num_rlzs_disagg=4`. In that case Z would be 4. z=0 would give the closest realization to the mean, z=1 the second closest, z=2 the third closest and z=3
the forth closest.

If you want to understand how the extractor works I suggest you to look at openquake.commands.plot.make_figure_disagg. "what" refers to the string used to specify the kind of disaggregation wanted.
For instance for the command

    $ oq plot "disagg?kind=Mag&imt=PGA"

`what` would be the string ""disagg?kind=Mag&imt=PGA". You have to play with the code to understand how it works. A general overview of the extract API is given here:

HTH,

                               Michele Simionato

Anne Hulsey

unread,
Sep 16, 2021, 12:15:21 PM9/16/21
to OpenQuake Users
Thanks, Michele. Your responses to both questions are exactly what I was looking for.

Anne Hulsey

unread,
Dec 8, 2021, 3:25:48 PM12/8/21
to OpenQuake Users
Hello again, Michele.

I am trying to understand how oq balances multiple poes, intensity measures, and sites when it identifies the "hazard curve closest to the mean." Could you point me to the portion of the code that selects the realization numbers that are eventually stored as best_rlzs in the .hdf5 file?

Thanks,
Anne

Michele Simionato

unread,
Dec 9, 2021, 8:19:54 AM12/9/21
to OpenQuake Users
On Wednesday, December 8, 2021 at 9:25:48 PM UTC+1 anne....@auckland.ac.nz wrote:
Hello again, Michele.

I am trying to understand how oq balances multiple poes, intensity measures, and sites when it identifies the "hazard curve closest to the mean." Could you point me to the portion of the code that selects the realization numbers that are eventually stored as best_rlzs in the .hdf5 file?

Reply all
Reply to author
Forward
0 new messages