using the dstore to probe disaggregation results

Skip to first unread message

Anne Hulsey

Sep 14, 2021, 2:50:16 PMSep 14
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

Sep 16, 2021, 1:41:25 AMSep 16
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:


                               Michele Simionato

Anne Hulsey

Sep 16, 2021, 12:15:21 PMSep 16
to OpenQuake Users
Thanks, Michele. Your responses to both questions are exactly what I was looking for.
Reply all
Reply to author
0 new messages