Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AELO: Display the asce_version in the outputs page and rename ASCE 7-16 and ASCE 41-17 to ASCE 16 and ASCE 41 #9812

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openquake/calculators/export/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@


DISPLAY_NAME = {
'asce07': 'ASCE 7-16 Parameters',
'asce41': 'ASCE 41-17 Parameters',
'asce07': 'ASCE 7 Parameters',
'asce41': 'ASCE 41 Parameters',
'mag_dst_eps_sig': "Deterministic Earthquake Scenarios",
'asset_risk': 'Exposure + Risk',
'gmf_data': 'Ground Motion Fields',
Expand Down
10 changes: 5 additions & 5 deletions openquake/calculators/postproc/compute_rtgm.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,20 +454,20 @@ def process_sites(dstore, csm, DLLs, ASCE_version):
if mrs.sum() == 0:
warning = (
'Zero hazard: there are no ruptures close to the site.'
' ASCE 7-16 and ASCE 41-17 parameters cannot be computed.'
' ASCE 7 and ASCE 41 parameters cannot be computed.'
' See User Guide.')
yield site, None, warning

elif mean_rates.max() < MIN_AFE:
warning = ('Very low hazard: ASCE 7-16 and ASCE 41-17'
warning = ('Very low hazard: ASCE 7 and ASCE 41'
' parameters cannot be computed. See User Guide.')
yield site, None, warning

elif (rtgm_df.ProbMCE.to_numpy()[sa02] < 0.11) or \
(rtgm_df.ProbMCE.to_numpy()[sa10] < 0.04):
warning = (
'The MCE at the site is very low. Users may need to'
' increase the ASCE 7-16 and ASCE 41-17 parameter values'
' increase the ASCE 7 and ASCE 41 parameter values'
' to user-specified minimums (e.g., Ss=0.11g and'
' S1=0.04g). See User Guide.')
yield site, rtgm_df, warning
Expand Down Expand Up @@ -503,8 +503,8 @@ def calc_asce(dstore, csm, job_imts, DLLs, rtgm):
logging.info(f'(%.1f,%.1f) {mce=}', lon, lat)
logging.info(f'(%.1f,%.1f) {det_mce=}', lon, lat)
asce41 = get_asce41(dstore, mce, rtgm_df.fact.to_numpy(), sid)
logging.info('(%.1f,%.1f) ASCE 7-16=%s', lon, lat, asce07)
logging.info('(%.1f,%.1f) ASCE 41-17=%s', lon, lat, asce41)
logging.info('(%.1f,%.1f) ASCE 7=%s', lon, lat, asce07)
logging.info('(%.1f,%.1f) ASCE 41=%s', lon, lat, asce41)
yield sid, mag_dst_eps_sig, asce07, asce41, mce_df


Expand Down
2 changes: 1 addition & 1 deletion openquake/server/templates/engine/get_outputs_aelo.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="row">
<div id="oq-body-wrapper">
<div class="span12">
<h2>Outputs from site: {{ site_name }}, lat: {{ lat }}, lon: {{ lon }}, vs30: {{ vs30 }}{% if calc_aelo_version is not None %}, AELO version: {{ calc_aelo_version }}{% endif %}</h2>
<h2>Outputs from site: {{ site_name }}, lat: {{ lat }}, lon: {{ lon }}, vs30: {{ vs30 }}{% if calc_aelo_version is not None %}, AELO version: {{ calc_aelo_version }}{% endif %}, {{ asce_version }}</h2>
{% if warnings %}
<div id="warning-box" class="alert alert-warning" style=>
WARNING: {{ warnings }}
Expand Down
6 changes: 6 additions & 0 deletions openquake/server/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,11 @@ def web_engine_get_outputs_aelo(request, calc_id, **kwargs):
lon, lat = ds['oqparam'].sites[0][:2] # e.g. [[-61.071, 14.686, 0.0]]
vs30 = ds['oqparam'].override_vs30 # e.g. 760.0
site_name = ds['oqparam'].description[9:] # e.g. 'AELO for CCA'->'CCA'
try:
asce_version = ds['oqparam'].asce_version
except AttributeError:
# for backwards compatibility on old calculations
asce_version = oqvalidation.OqParam.asce_version.default
try:
calc_aelo_version = ds.get_attr('/', 'aelo_version')
except KeyError:
Expand All @@ -1396,6 +1401,7 @@ def web_engine_get_outputs_aelo(request, calc_id, **kwargs):
asce07=asce07_with_units, asce41=asce41_with_units,
lon=lon, lat=lat, vs30=vs30, site_name=site_name,
calc_aelo_version=calc_aelo_version,
asce_version=asce_version,
warnings=warnings))


Expand Down
Loading