Error message confusion

105 views
Skip to first unread message

Jessica Chen

unread,
Aug 28, 2023, 6:44:36 PM8/28/23
to OpenQuake Users
Hi all, 
I am running some event_based calculations with the New Zealand, National Hazard Shaking Model (NHSM) and McVerry2006 GMPE's. I got the following error: 

"ValueError: ", "sampling_method must be early_weights, only the mean is available,", "and number_of_logic_tree_samples must be greater than 1."


I am using OQ 3.16 version, and this is the Job.ini file I used: 


[general]
description = name
calculation_mode = event_based_risk

[exposure]
exposure_file = exposure_file.xml

[site_params]
site_model_file = sites_file.csv

[erf]
width_of_mfd_bin = 0.1
rupture_mesh_spacing = 2.0
area_source_discretization = 10.0

[logic_trees]
source_model_logic_tree_file = source_model_logic_tree.xml
gsim_logic_tree_file = gmpe_logic_tree.xml

[hazard_calculation]
random_seed = 24
truncation_level = 3
maximum_distance = 200.0
investigation_time = 1
number_of_logic_tree_samples = 10
ses_per_logic_tree_path = 10000
minimum_intensity = {"PGA": 0.05, "SA(0.3)": 0.10}

[vulnerability]
structural_vulnerability_file = structural_vulnerability_model.xml
nonstructural_vulnerability_file = nonstructural_vulnerability_model.xml


[risk_calculation]
master_seed = 42
risk_investigation_time = 1
asset_correlation = 0
return_periods = [50, 150, 500, 1000, 2500]

[risk_outputs]
quantiles = 0.1 0.5 0.9
avg_losses = true
conditional_loss_poes = 0.02, 0.10
loss_ratios = {"structural": [0.00010, 0.00016, 0.00025, 0.00040, 0.00065, 0.0010, 0.0016, 0.0025, 0.0040, 0.0065, 0.010, 0.016, 0.025, 0.040, 0.065, 0.10, 0.16, 0.25, 0.40, 0.65, 1.0]}


Any help would be much appreciated! Thank You!

Jessica

Michele Simionato

unread,
Aug 28, 2023, 11:48:29 PM8/28/23
to OpenQuake Users
The error message is confusing (and indeed it is already fixed in master). Just remove the line 
quantiles = 0.1 0.5 0.9 and it will work. HTH,

 Michele Simionato

Jessica Chen

unread,
Aug 29, 2023, 12:47:10 AM8/29/23
to OpenQuake Users
Oh! Thank you so much! Would you know where I would add then quantiles parameter if I wanted them?

Michele Simionato

unread,
Aug 29, 2023, 1:18:48 AM8/29/23
to OpenQuake Users
If you want the quantiles, you put those in the right place, but you also need to add a line collect_rlzs=false.

            Michele

Jessica Chen

unread,
Aug 29, 2023, 5:54:24 PM8/29/23
to OpenQuake Users
Many thanks Michele!!

Currently I hit another error: 

Traceback (most recent call last):

File "C:\Program Files\OpenQuake Engine\python3\lib\site-packages\openquake\engine\engine.py", line 279, in run_calc

calc.run(shutdown=True)

File "C:\Program Files\OpenQuake Engine\python3\lib\site-packages\openquake\calculators\base.py", line 240, in run

self.pre_execute()

File "C:\Program Files\OpenQuake Engine\python3\lib\site-packages\openquake\calculators\event_based_risk.py", line 290, in pre_execute

super().pre_execute()

File "C:\Program Files\OpenQuake Engine\python3\lib\site-packages\openquake\calculators\base.py", line 634, in pre_execute

calc.run(remove=False)

File "C:\Program Files\OpenQuake Engine\python3\lib\site-packages\openquake\calculators\base.py", line 240, in run

self.pre_execute()

File "C:\Program Files\OpenQuake Engine\python3\lib\site-packages\openquake\calculators\base.py", line 644, in pre_execute

self.read_inputs()

File "C:\Program Files\OpenQuake Engine\python3\lib\site-packages\openquake\calculators\base.py", line 477, in read_inputs

self._read_risk_data()

File "C:\Program Files\OpenQuake Engine\python3\lib\site-packages\openquake\calculators\base.py", line 804, in _read_risk_data

haz_sitecol = readinput.get_site_collection(oq, self.datastore)

File "C:\Program Files\OpenQuake Engine\python3\lib\site-packages\openquake\commonlib\readinput.py", line 549, in get_site_collection

mesh = get_mesh(oqparam, h5)

File "C:\Program Files\OpenQuake Engine\python3\lib\site-packages\openquake\commonlib\readinput.py", line 440, in get_mesh

sm = get_site_model(oqparam)

File "C:\Program Files\OpenQuake Engine\python3\lib\site-packages\openquake\commonlib\readinput.py", line 482, in get_site_model

value = getattr(oqparam, site.param[name])

KeyError: 'siteclass'


How would this be resolved? 


Peter Pažák

unread,
Sep 19, 2023, 1:12:07 AM9/19/23
to OpenQuake Users
Hi, just a guess: have you specified siteclass in your site_model.csv file?

Peter

Dátum: utorok 29. augusta 2023, čas: 23:54:24 UTC+2, odosielateľ: jessi...@gmail.com
Reply all
Reply to author
Forward
0 new messages