Skip to content

Commit

Permalink
Merge branch 'NHERI-SimCenter:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
snaeimi authored Sep 4, 2024
2 parents 6185b35 + 53b914c commit b984e61
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 1 addition & 5 deletions modules/Workflow/whale/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1732,18 +1732,14 @@ def perform_regional_mapping(self, AIM_file_path, assetType, doParallel=True):
for input_ in reg_mapping_app.inputs:
if input_['id'] == 'assetFile':
input_['default'] = str(AIM_file_path)
# Get the event file path
eventFilePath = self.shared_data.get('RegionalEvent', {}).get( # noqa: N806
'eventFilePath', self.reference_dir
)

reg_mapping_app.inputs.append(
{
'id': 'filenameEVENTgrid',
'type': 'path',
'default': resolve_path(
self.shared_data['RegionalEvent']['eventFile'],
eventFilePath,
self.reference_dir,
),
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ def hazard_job(hazard_info): # noqa: C901, D103, PLR0915
event_info = hazard_info['Event']
# When vector IM is used. The PGA/SA needs to be computed before PGV
im_info = event_info['IntensityMeasure']
# To make the SA format consistent with R2D requirement
if im_info['Type'] == 'Vector' and 'SA' in im_info.keys(): # noqa: SIM118
periods = im_info['SA']['Periods']
periods = [float(i) for i in periods]
im_info['SA']['Periods'] = periods
if im_info['Type'] == 'SA':
periods = im_info['Periods']
periods = [float(i) for i in periods]
im_info['Periods'] = periods
if im_info['Type'] == 'Vector' and 'PGV' in im_info.keys(): # noqa: SIM118
PGV_info = im_info.pop('PGV') # noqa: N806
im_info.update({'PGV': PGV_info})
Expand Down

0 comments on commit b984e61

Please sign in to comment.