oq-mbtk calculate completeness

13 views
Skip to first unread message

Hasib Abdulrazaq

unread,
Nov 1, 2025, 12:48:22 PM (7 days ago) Nov 1
to OpenQuake Users
Hi all

I am trying to calculate and apply completeness. I am using the code provided in here without any modifications (apart from 'pattern'): 

completeness_param_folder = './completeness_windows/' cmd = f"oqm cat completeness_generate {config} {completeness_param_folder}"p = subprocess.run(cmd, shell=True)pattern = os.path.join(".", "subcatalogues", "*.csv")folder_figs = "./zone_completeness_figs" folder_compl_results = "./zone_completeness" cmd = f"oqm cat completeness_analysis \"{pattern}\" {config} {folder_figs} {completeness_param_folder} {folder_compl_results}" p = subprocess.run(cmd, shell=True)

The previous parts of the code all worked fine, I can get the completeness windows files (.npy files) however when running completeness_analysis i fail to get any outputs (no folder or figures are created). I am using python 3.11.6 and OQ Engine 3.21.0 on Windows. Is there a problem with the code or version I am using?

I am supposed to get the following from the script above: "for each csv file in the subcatalogues folder, it will test the completeness windows for the catalogue, calculate the FMD parameters for the best fitting window and write these to the config along with the completeness windows, and plot the best-fitting model in a png stored in folder_figs. "

Kirsty Bayliss

unread,
Nov 1, 2025, 2:15:28 PM (7 days ago) Nov 1
to OpenQuake Users
Hi Hasib, 

Thanks for getting in touch. I suspect that the paths for the folder_figs and folder_completeness are not formatted properly for windows - they should be using the os.path.join notation as in the pattern example (e.g. folder_figs = os.path.join(".", "zone_completeness_figs" ), or to wherever you prefer the files to go). We are working on some updates to the documentation and I will check if we have fixed this for the next version.

There is a second issue here that I have encountered where jupyter sometimes hides the errors rather than printing them in the notebook. If you launched jupyter from a terminal you might see that there's an error printed there that would have been much more useful.

I think this should fix your issue, but let me know if not!

Kirsty
Reply all
Reply to author
Forward
0 new messages