diff --git a/modules/performRegionalEventSimulation/regionalGroundMotion/ComputeIntensityMeasure.py b/modules/performRegionalEventSimulation/regionalGroundMotion/ComputeIntensityMeasure.py index f0bcd3460..46398343a 100644 --- a/modules/performRegionalEventSimulation/regionalGroundMotion/ComputeIntensityMeasure.py +++ b/modules/performRegionalEventSimulation/regionalGroundMotion/ComputeIntensityMeasure.py @@ -111,7 +111,8 @@ if 'stampede2' not in socket.gethostname(): from FetchOpenQuake import get_site_rup_info_oq - from FetchOpenSHA import * # noqa: F403 + #from FetchOpenSHA import * # noqa: F403 + from FetchOpenSHA_25_4_1 import * # noqa: F403 import threading # noqa: E402 import ujson # noqa: E402 diff --git a/modules/performRegionalEventSimulation/regionalGroundMotion/CreateScenario.py b/modules/performRegionalEventSimulation/regionalGroundMotion/CreateScenario.py index 1b7e3a0a0..87545592e 100644 --- a/modules/performRegionalEventSimulation/regionalGroundMotion/CreateScenario.py +++ b/modules/performRegionalEventSimulation/regionalGroundMotion/CreateScenario.py @@ -48,7 +48,8 @@ import pandas as pd if 'stampede2' not in socket.gethostname(): - from FetchOpenSHA import * # noqa: F403 + #from FetchOpenSHA import * # noqa: F403 + from FetchOpenSHA_25_4_1 import * # noqa: F403 def get_rups_to_run(scenario_info, user_scenarios, num_scenarios): # noqa: C901, D103 diff --git a/modules/performRegionalEventSimulation/regionalGroundMotion/CreateStation.py b/modules/performRegionalEventSimulation/regionalGroundMotion/CreateStation.py index 46048c9bf..02d1f7b61 100644 --- a/modules/performRegionalEventSimulation/regionalGroundMotion/CreateStation.py +++ b/modules/performRegionalEventSimulation/regionalGroundMotion/CreateStation.py @@ -78,7 +78,8 @@ def __call__(self, *args, **kwargs): if 'stampede2' not in socket.gethostname(): - from FetchOpenSHA import ( + #from FetchOpenSHA import ( + from FetchOpenSHA_25_4_1 import ( get_site_vs30_from_opensha, get_site_z1pt0_from_opensha, get_site_z2pt5_from_opensha, diff --git a/modules/performRegionalEventSimulation/regionalGroundMotion/FetchOpenSHA_25_4_1.py b/modules/performRegionalEventSimulation/regionalGroundMotion/FetchOpenSHA_25_4_1.py index 271d3269e..813784da5 100644 --- a/modules/performRegionalEventSimulation/regionalGroundMotion/FetchOpenSHA_25_4_1.py +++ b/modules/performRegionalEventSimulation/regionalGroundMotion/FetchOpenSHA_25_4_1.py @@ -34,7 +34,8 @@ from org.opensha.commons.data import * # noqa: F403 from org.opensha.commons.data.function import * # noqa: F403 from org.opensha.commons.data.siteData import * # noqa: F403 -from org.opensha.commons.geo import * # noqa: F403 +#from org.opensha.commons.geo import * # noqa: F403 +from org.opensha.commons.geo import Location # noqa: F403 from org.opensha.commons.param import * # noqa: F403 from org.opensha.commons.param.constraint import * # noqa: F403 from org.opensha.commons.param.event import * # noqa: F403 @@ -464,6 +465,7 @@ def get_PointSource_info_CY2014(source_info, siteList): # noqa: N802, N803, D10 'dip': float(source_info['AverageDip']), 'width': 0.0, 'zTop': sourceDepth, + 'zHyp': sourceDepth, 'aveRake': float(source_info['AverageRake']), } return site_rup_info, siteList diff --git a/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulation.py b/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulation.py index b98306223..a400da3a3 100644 --- a/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulation.py +++ b/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulation.py @@ -51,6 +51,8 @@ R2D = True +OPENSHA_JAR = 'opensha-all.jar' # version 25.4.1 (invoked in 04/2026) + def site_job(hazard_info): # noqa: C901, D103 # Sites and stations @@ -542,12 +544,14 @@ def hazard_job(hazard_info): # noqa: C901, D103, PLR0915 memory_total = psutil.virtual_memory().total / (1024.0**3) memory_request = int(memory_total * 0.75) - jpype.addClassPath('./lib/OpenSHA-1.5.2.jar') + #jpype.addClassPath('./lib/OpenSHA-1.5.2.jar') # not supported by opensha starting from 02/2026 + jpype.addClassPath('./lib/{}'.format(OPENSHA_JAR)) try: jpype.startJVM(f'-Xmx{memory_request}G', convertStrings=False) except: # noqa: E722 print( # noqa: T201 - f'StartJVM of ./lib/OpenSHA-1.5.2.jar with {memory_request} GB Memory fails. Try again after releasing some memory' + #f'StartJVM of ./lib/OpenSHA-1.5.2.jar with {memory_request} GB Memory fails. Try again after releasing some memory' + f'StartJVM of ./lib/{OPENSHA_JAR} with {memory_request} GB Memory fails. Try again after releasing some memory' ) if oq_flag: # clear up old db.sqlite3 if any diff --git a/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py b/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py index bf0bc9436..eb3333e40 100644 --- a/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py +++ b/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py @@ -52,6 +52,7 @@ R2D = True +OPENSHA_JAR = 'opensha-all.jar' # version 25.4.1 (invoked in 04/2026) def hazard_job(hazard_info): # noqa: C901, D103, PLR0915 from CreateScenario import load_ruptures_openquake @@ -578,7 +579,8 @@ def hazard_job(hazard_info): # noqa: C901, D103, PLR0915 memory_total = psutil.virtual_memory().total / (1024.0**3) memory_request = int(memory_total * 0.75) - jpype.addClassPath('./lib/OpenSHA-1.5.2.jar') + #jpype.addClassPath('./lib/OpenSHA-1.5.2.jar') # not supported by opensha starting from 02/2026 + jpype.addClassPath('./lib/{}'.format(OPENSHA_JAR)) jpype.startJVM(f'-Xmx{memory_request}G', convertStrings=False) if oq_flag: # clear up old db.sqlite3 if any diff --git a/modules/performRegionalEventSimulation/regionalGroundMotion/ScenarioForecast.py b/modules/performRegionalEventSimulation/regionalGroundMotion/ScenarioForecast.py index 39e20ad58..46207bfc0 100644 --- a/modules/performRegionalEventSimulation/regionalGroundMotion/ScenarioForecast.py +++ b/modules/performRegionalEventSimulation/regionalGroundMotion/ScenarioForecast.py @@ -47,6 +47,8 @@ import psutil +OPENSHA_JAR = 'opensha-all.jar' # version 25.4.1 (invoked in 04/2026) + if __name__ == '__main__': # parse arguments parser = argparse.ArgumentParser() @@ -112,7 +114,8 @@ memory_total = psutil.virtual_memory().total / (1024.0**3) memory_request = int(memory_total * 0.75) - jpype.addClassPath('./lib/OpenSHA-1.5.2.jar') + #jpype.addClassPath('./lib/OpenSHA-1.5.2.jar') # not supported by opensha starting from 02/2026 + jpype.addClassPath('./lib/{}'.format(OPENSHA_JAR)) jpype.startJVM(f'-Xmx{memory_request}G', convertStrings=False) from CreateScenario import ( create_earthquake_scenarios,