Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#136 closed defect (fixed)

MultiIMR_Averaged_AttenRel class seems to be getting an error when setting default parameter for Other Parameters when it is not supported. For example, function tries setting Active Shallow Tectonic Region Type for an Attenuation, as the default value, when it is not supported by the Attenuation Relationship.

Reported by: niting26@… Owned by: Peter Powers
Priority: major Milestone: OpenSHA 1.2
Component: sha Version:
Keywords: Cc: kmilner@…, pmpowers@…

Description

MultiIMR: const called with 7 imrs

  • Intensity Measure Relationship
  • Intensity Measure Relationship
  • Intensity Measure Relationship
  • Intensity Measure Relationship
  • Intensity Measure Relationship
  • Intensity Measure Relationship
  • Intensity Measure Relationship

MultiIMR: 2 common periods found!
MultiIMR: initializing IM param: SA
MultiIMR: initializing IM param: PGA
MultiIMR: initializing site param: Frankel2008 Site Type
MultiIMR: Frankel2008 Site Type is a custom param!
MultiIMR: initializing site param: Silva2002 Site Type
MultiIMR: Silva2002 Site Type is a custom param!
MultiIMR: initializing site param: AB2006 Site Type
MultiIMR: AB2006 Site Type is a custom param!
MultiIMR: initializing site param: Toro 2008 Site Type
MultiIMR: Toro 2008 Site Type is a custom param!
MultiIMR: initializing site param: TP2005 Site Type
MultiIMR: TP2005 Site Type is a custom param!
MultiIMR: initializing site param: CB2003 Site Type
MultiIMR: CB2003 Site Type is a custom param!
MultiIMR: const called with 3 imrs

  • Eqecat-Atkinson and Boore (2003)
  • Eqecat-Atkinson and Boore (2003)
  • Eqecat - YoungsEtAl? (1997)

MultiIMR: 2 common periods found!
MultiIMR: initializing IM param: SA
MultiIMR: initializing IM param: PGA
MultiIMR: initializing site param: Youngs1997 Site Type
MultiIMR: Youngs1997 Site Type is a custom param!
MultiIMR: initializing site param: AB2003 Site Type
MultiIMR: AB2003 Site Type is a custom param!
WARNING: child parameter 'Tectonic Region' could not be set to 'Active Shallow Crust'
Exception in thread "main" org.opensha.commons.exceptions.ConstraintException?: Tectonic Region: setValue(): Value is not allowed: Active Shallow Crust

at org.opensha.commons.param.Parameter.setValue(Parameter.java:201)
at org.opensha.commons.param.ParamLinker?.setChildVal(ParamLinker?.java:58)
at org.opensha.commons.param.ParamLinker?.<init>(ParamLinker?.java:43)
at org.opensha.commons.param.ParamLinker?.<init>(ParamLinker?.java:30)
at org.opensha.sha.imr.attenRelImpl.MultiIMR_Averaged_AttenRel.linkParams(MultiIMR_Averaged_AttenRel.java:489)
at org.opensha.sha.imr.attenRelImpl.MultiIMR_Averaged_AttenRel.initOtherParams(MultiIMR_Averaged_AttenRel.java:382)
at org.opensha.sha.imr.attenRelImpl.MultiIMR_Averaged_AttenRel.<init>(MultiIMR_Averaged_AttenRel.java:83)
at com.eqecat.canadaQuake.groundMotion.GMPEs_WithMultiAttenuationRelationship.getSubductionSlabAttenRels(GMPEs_WithMultiAttenuationRelationship.java:105)
at com.eqecat.canadaQuake.groundMotion.GMPEs_WithMultiAttenuationRelationship.getAttenuationRelationships(GMPEs_WithMultiAttenuationRelationship.java:79)
at com.eqecat.canadaQuake.calc.HazardCurveCalcUsingThread_MultiAttenRel.generateCanadaQuakeFootPrintData(HazardCurveCalcUsingThread_MultiAttenRel.java:77)
at com.eqecat.canadaQuake.calc.HazardCurveCalcUsingThread_MultiAttenRel.main(HazardCurveCalcUsingThread_MultiAttenRel.java:100)

Change History (6)

comment:1 Changed 14 years ago by Kevin Milner

I think that this is a problem with your IMRs. What TRTs do they support if not active shallow? Stable continent? If so, then when creating the individual IMRs (before passing them to MultiIMR) make sure that the TRT param is created with that as the default value.

comment:2 Changed 14 years ago by Kevin Milner

Nitin, if you reply in Trac (click the link on the bottom of the e-mails) it will help us to keep track of everything.


Nitin wrote:
I am getting this error when using AttenuationRelationship? for subduction zone, with default TRT being Subduction_SLAB. This attenuation does not support Active shallow TRT, I use a different Attenuation for it. The problem seem to happen when I am using the MultiIMR class, otherwise my Attenuations work fine. If you are to look at the source of the problem , from the stack trace, error happens when other parameters for the MultiIMRs is initiated, that has no dependence on my Attenuation Relationship (error happens before the for loop for other parameters are iterated)
Also when instantiating the MultiIMR class, my Attenuation Relationships classes are already instantiated and TRT set. I don't think the problem is within my code. Can you explain how you think that problem might be in my code? Have to tried testing this class with an AttenuationRelationship? that does not support Active Shallow TRT?
BTW, I was trying to use to MultiIMR to see if I get the same results as using the HazardCurves? with my implementation of Multi-Attenuations ? The reason for comparison is where the wt'ed average happens, in my implementation it happens after computation of prob. of exceedance, whereas if I use MultiIMR class it happens at the getMean() function.


MultiIMR can only be used with IMRs that support the same TRT. It sounds like you're trying to use it with both Subduction IMRs and shallow IMRs. Is this correct?

To assign different IMRs to each TRT, then you should use the Map<TectonicRegionType?, ScalarIntensityMeasureRelationsip?) mapping in the hazard curve calculator. Note that if you want to average multiple Subduction Slab IMRs, for example, then the mapping for Subduction Slab can contain an MutliIMR which averages those the two IMRs that support Subduction Slab.

Does that make sense?

comment:3 Changed 14 years ago by niting

I am using MultiIMR with IMRs that support same TRT. And I know how the mapping for TectonicRegionType? to ScalerIntensityMeaureRelationship? works. To explain you what I am doing -
There are 3 AttenuationRelationships? that supports TRT subduction_slab, I create the instantance of MultipleIMR giving it the instance of these Attenuations and their weights. this will help me call the Hazard Curve with the parameter Map<TectonicRegionType?,ScalerIntensityMeaureRelationship?> where TRT is Subduction slab and ScalterIntensityMeasureRelationship? is the instance of MultiIMR class.

Similarly as I do for subduction slab I have Attenuations for Active shallow that create a new instance of MultiIMR class and pass to the above map function.

Instead of using MultiIMR class I could use the function of HazardCurve? calculator, that I implemented and commited to SVN, that takes in the following parameter -

EnumMap?<TectonicRegionType?, HashMap?<ScalerIntensityMeaureRelationship?, Double>>

From the recent OpenSHA release notes I found that a version of MultiIMR is implemented I thought could replace HashMap? in my above function with instance of MultiIMR class.

Hope this help your understanding of the issue.
Nitin

comment:4 Changed 14 years ago by Kevin Milner

Oh OK, that definitely sounds like a correct use case. When you instantiate the TRT param in your IMRs, are you setting the default value? It sounds like you might have TRT params with this (invalid) configuration:

Default: Active Shallow
Allowed: Subduction Slab

This is problematic because the default value isn't allowed.

comment:5 Changed 14 years ago by Kevin Milner

Milestone: OpenSHA 1.2
Resolution: fixed
Status: newclosed

After a phone call with Nitin, I understood the problem and fixed it in revision [7402]. Nitin, either pull down the new version or simply comment out the call to super.initOtherParams(); in initOtherParams(); of MultiIMR_Averaged_AttenRel. It's not needed, and causes this error. Sorry for the misunderstanding earlier, and please let me know if you still have problems.

comment:6 Changed 14 years ago by Kevin Milner

Nitin, do you have cookies enabled in your browser? You shouldn't have to log in each time you want to comment, unless you're closing your browser each time.

Anyway, I changed it so that now all params (such as site params) now use the value for the first IMR in the list as the "master". This means that the value of the master get's propagated to each other IMR's matching parameter.

If you want to be able to set each IMR's parameter's independently then it will get more complicated. For example, if you wanted IMR 1 to have a Vs30 value of 760 while IMR 2 has a Vs30 value of 900, that would not be supported.

Updates committed to trunk in [7403].

Note: See TracTickets for help on using tickets.