General Question regarding export the disaggregation results in the traditional form

227 views
Skip to first unread message

Sujan Raj Adhikari

unread,
Aug 15, 2024, 10:49:23 AM8/15/24
to OpenQuake Users

Hi,

I have a question about exporting disaggregation results in the traditional format using OpenQuake Engine 3.20.1. The documentation provides the following commands:

  1. oq export disagg-rlzs-traditional <calc_id>
  2. oq export disagg-stats-traditional <calc_id>

I tried using these commands to obtain results in the traditional format, but when I run them in the OpenQuake Engine console on Windows, I receive a "syntax is incorrect" error.

Could you please provide a solution for this issue?

Thank you!

Sujan 

Calculation.PNG
Calculation2.PNG

Sujan Raj Adhikari

unread,
Aug 19, 2024, 10:23:58 AM8/19/24
to OpenQuake Users
if someone response how to obtain traditional one that will be great

Lana Todorovic

unread,
Aug 19, 2024, 1:37:03 PM8/19/24
to OpenQuake Users
Dear Sujan,

Please try typing:
oq export disagg-rlzs-traditional 42

Do not put calc_id in <>. Hope this works.

Best regards

Sujan Raj Adhikari

unread,
Aug 19, 2024, 2:35:54 PM8/19/24
to OpenQuake Users
thanks Iana but where it will export. it exported but i don't know the location. thanks for the help

Lana Todorovic

unread,
Aug 19, 2024, 2:41:24 PM8/19/24
to OpenQuake Users
Dear Sujan,

It should be exported to the directory where your job file is.

Sujan Raj Adhikari

unread,
Aug 19, 2024, 3:06:33 PM8/19/24
to OpenQuake Users
thanks Iana,
one more question, when i tried  oq export disagg-stats-traditional 54 the response is 
Keyerror: "No ' disagg-stats/TRT_Mag_Dis_Eps' found in <datastore c\........calc_54.hdf5 open>

but  oq export disagg-rlzs-traditional 54 is already runing

i can see these file through qgis . so confused. 
any thoughts on this 
thanks
Sujan

Sujan Raj Adhikari

unread,
Aug 20, 2024, 11:18:44 AM8/20/24
to OpenQuake Users
Error when i tried to use oq export disagg-stats-traditional 57 but but  oq export disagg-rlzs-traditional 57  exported fine . any reason why?


C:\Users\ADHIS4\AppData\Local\Programs\OpenQuake Engine>oq export disagg-stats-traditional 57
Traceback (most recent call last):
  File "C:\Users\ADHIS4\AppData\Local\Programs\OpenQuake Engine\python3\Lib\site-packages\openquake\commonlib\datastore.py", line 507, in __getitem__
    val = self.hdf5[key]
          ~~~~~~~~~^^^^^
  File "C:\Users\ADHIS4\AppData\Local\Programs\OpenQuake Engine\python3\Lib\site-packages\openquake\baselib\hdf5.py", line 498, in __getitem__
    h5obj = super().__getitem__(path)
            ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "C:\Users\ADHIS4\AppData\Local\Programs\OpenQuake Engine\python3\Lib\site-packages\h5py\_hl\group.py", line 357, in __getitem__
    oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py\h5o.pyx", line 189, in h5py.h5o.open
KeyError: 'Unable to synchronously open object (component not found)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\ADHIS4\AppData\Local\Programs\OpenQuake Engine\python3\Scripts\oq.exe\__main__.py", line 7, in <module>
  File "C:\Users\ADHIS4\AppData\Local\Programs\OpenQuake Engine\python3\Lib\site-packages\openquake\commands\__main__.py", line 48, in oq
    sap.run(commands, prog='oq')
  File "C:\Users\ADHIS4\AppData\Local\Programs\OpenQuake Engine\python3\Lib\site-packages\openquake\baselib\sap.py", line 212, in run
    return _run(parser(funcdict, **parserkw), argv)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ADHIS4\AppData\Local\Programs\OpenQuake Engine\python3\Lib\site-packages\openquake\baselib\sap.py", line 203, in _run
    return func(**dic)
           ^^^^^^^^^^^
  File "C:\Users\ADHIS4\AppData\Local\Programs\OpenQuake Engine\python3\Lib\site-packages\openquake\commands\export.py", line 38, in main
    fnames = export_((datastore_key, fmt), dstore)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ADHIS4\AppData\Local\Programs\OpenQuake Engine\python3\Lib\site-packages\openquake\baselib\general.py", line 668, in __call__
    return self[key](obj, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ADHIS4\AppData\Local\Programs\OpenQuake Engine\python3\Lib\site-packages\openquake\calculators\export\hazard.py", line 577, in export_disagg_csv
    aw = extract(dstore, ex % (k, s, spec))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ADHIS4\AppData\Local\Programs\OpenQuake Engine\python3\Lib\site-packages\openquake\calculators\extract.py", line 204, in __call__
    data = self[k](dstore, v)
           ^^^^^^^^^^^^^^^^^^
  File "C:\Users\ADHIS4\AppData\Local\Programs\OpenQuake Engine\python3\Lib\site-packages\openquake\calculators\extract.py", line 1177, in extract_disagg
    fullmatrix = dstore['disagg-%s/%s' % (spec, label)][sid]
                 ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ADHIS4\AppData\Local\Programs\OpenQuake Engine\python3\Lib\site-packages\openquake\commonlib\datastore.py", line 517, in __getitem__
    raise KeyError('No %r found in %s' % (key, self))
KeyError: "No 'disagg-stat/TRT_Mag_Dist_Eps' found in <DataStore C:\\Users\\ADHIS4\\oqdata\\calc_57.hdf5 open>"
123Calculation.PNG

Yves Robert

unread,
Aug 22, 2024, 2:34:09 PM8/22/24
to OpenQuake Users
The exporter has been removed. Look at the link below.

Sujan Raj Adhikari

unread,
Aug 23, 2024, 9:55:26 AM8/23/24
to OpenQuake Users
Oh really, thanks a lot. exporting all the realization and taking out the average will be the solution, but the file size will be more than 20GB. its going to be a huge task.

Owen Jiang

unread,
Oct 13, 2024, 5:59:18 PM10/13/24
to openqua...@googlegroups.com
if I just get the deaggregation results directly from OpenQuake calculation, and hope to convert to the traditional format (so the summation is 100%) and generate the plots like below. Anyone has any suggestions or if there is available python code for this? Thank you. 
image.png


--
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/0bd81281-c9ea-40aa-a70f-c830b44911d9n%40googlegroups.com.

davidm

unread,
Oct 14, 2024, 11:57:39 AM10/14/24
to OpenQuake Users
Did you work out a solution to this Sujan?

I'm having a similar issue running a seismic model with hundreds of thousands of realisations and ending up with a .csv file that is 40GB for one return period, and need to get a traditional disaggregation result. Previously I've processed disaggregation results using pandas but the size of the dataset is making this challenging.
Message has been deleted

Sujan Raj Adhikari

unread,
Oct 23, 2024, 8:05:48 AM10/23/24
to OpenQuake Users
I am using Python for this
Reply all
Reply to author
Forward
0 new messages