Opened 14 years ago

Closed 13 years ago

#40 closed defect (fixed)

Clarify how Tectonic Region is being applied in Hazard Curve Apps

Reported by: Kevin Milner Owned by: Kevin Milner
Priority: critical Milestone: OpenSHA 1.1
Component: sha Version: 1.0.x
Keywords: Tectonic, IMR Cc: Ned Field, Peter Powers


Clarify how the tectonic region parameter is being used in the Hazard Curve Apps. For example, what happens when the user selects a value for the TRT param...does it get overridden by the calculator? Where does this get set?

We might want to hide this parameter from the user, depending on if it's actually used.

Change History (6)

comment:1 Changed 14 years ago by Kevin Milner

Priority: majorcritical

comment:2 Changed 14 years ago by Kevin Milner

Keywords: Tectonic IMR added

comment:3 Changed 14 years ago by Kevin Milner

as of now, this is how it works. It's all handed by the trunk/src/org/opensha/sha/util/ Here's the logic:


if tectonic region type (TRT) is null, throw IllegalArgumentException?

if there is only 1 IMR, use that IMR for all sources. The TRT param IS NOT SET (but maybe should be?)

if there are multiple IMRs, then the matching IMR is used for that source. If that IMR's TRT param supports the TRT, then the param is set to the TRT. If it doesn't support it, then the TRT param is set as default.


We need to decide when to set the TRT param. Currently it's only set in the multi IMR case. If we change it such that the TRT param is always set, then we should hide it from the user. Otherwise, we should leave it displayed. We could also add a setting to the TRT param to set it for each source (default), but if the user selects a TRT in the param then it is hardcoded to that. What do you think?

I'm going to leave the ticket open until we make decisions.

comment:4 Changed 13 years ago by Kevin Milner

Owner: changed from Peter Powers to Kevin Milner
Status: newassigned

We still need to make decisions here. Here's my proposal to get the ball rolling.

for each source:

  • if TRT is null in the source, throw exception (currently done)
  • else:
    • if only 1 IMR:
      • use that IMR, and set the TRT param in that IMR to the TRT for the source. If it's not allowed, set it as default. (we could optionally set it to null here) This is not how it is done currently!
    • else if multiple IMRs:
      • use the IMR associated to the TRT in the Map (or throw exception if no mapping exists). Set the TRT param in that IMR to the TRT for the source.

When setting the TRT param in an IMR, we need to account for the situation where the IMR does not support the given TRT. We can either set the TRT param as default (currently done), or allow null in the TRT param and set it to that.

comment:5 Changed 13 years ago by Kevin Milner

E-mail from Ned:

Hi Kevin,

OK, I implemented what I think is full flexibility.

It turns out the processing is identical for both the single IMR and multi IMR cases.

First, the TRT in a source cannot ever be null (I've enforced that in the source class); we could relax this later if need be.

The two classes that have changed are:


The cases we now support are:

1) Set the TRT_Param value in the IMR by hand and have calculator do nothing (that same value gets used to all sources)

2) Set the TRT_Param value in the IMR according to the value in each source

If IMR does not support the source's TRT, then do one of the following:

a) set TRT_Param value to its default

b) leave the TRT_Param as it was given (as set before going into the calculator, like in (1) above)

c) throw runtime exception

Both these options (1 vs 2, and a/b/c) are specified by two adjustable parameters in the calculator.

I notice that the tectonic-region type parameter does not currently show in the Hazard Curve Calculator (along with the "Other" IMR parameters). Are we hiding that parameter? I think we should show it now (whether it's used depends on the parameter settings in the calculations control panel). Same goes for the multi IMR gui case.

I haven't yet updated the javadocs to reflect these changes, as I wanted to get your opinion before finalizing things.

Let me know what you think.

I'm not using the TRTUtils now because it seems unnecessary for what I've done, but feel free to reutilize it if it makes dealing with all the other classes easier.

We can revert if I've done a bad, bad thing.



comment:6 Changed 13 years ago by Kevin Milner

Resolution: fixed
Status: assignedclosed

OK finished in [7263]...I also moved all of of the calulation params to their own classes in org.opensha.sha.calc.params. Logic was moved back to TRTUtils because it's used by multiple classes, like the disaggregation calculator (which now takes the calc parameters list).

We need to document this, but that can be included in part of our manual (#94).

Note: See TracTickets for help on using tickets.