org.opensha.sha.imr
Class AttenuationRelationship

java.lang.Object
  extended by org.opensha.sha.imr.AbstractIMR
      extended by org.opensha.sha.imr.AttenuationRelationship
All Implemented Interfaces:
Serializable, Comparable<IntensityMeasureRelationship>, Named, ShortNamed, XMLSaveable, IntensityMeasureRelationship, ScalarIMR
Direct Known Subclasses:
AB2003_AttenRel, AB2006_140_AttenRel, Abrahamson_2000_AttenRel, AS_1997_AttenRel, AS_2005_AttenRel, AS_2008_AttenRel, ASI_AttenRelWrapper, AtkBoo_2006_AttenRel, BA_2006_AttenRel, BA_2008_AttenRel, BC_2004_AttenRel, BJF_1997_AttenRel, BommerEtAl_2009_AttenRel, BS_2003_AttenRel, Campbell_1997_AttenRel, Campbell_2003_AttenRel, CB_2003_AttenRel, CB_2006_AttenRel, CB_2008_AttenRel, CB_2010_CAV_AttenRel, CS_2005_AttenRel, CY_2006_AttenRel, CY_2008_AttenRel, CyberShakeIMR, DahleEtAl_1995_AttenRel, DSI_AttenRelWrapper, Field_2000_AttenRel, FrankelEtAl_1996_AttenRel, InterpolatedSA_AttenRelWrapper, KS_2006_AttenRel, McVerryetal_2000_AttenRel, ModAttenuationRelationship, MultiIMR_Averaged_AttenRel, NGAW2_Wrapper, NSHMP_2008_CA, NSHMP08_CEUS, NSHMP08_SUB_Interface, NSHMP08_SUB_Slab, NSHMP08_WUS, NSHMP14_WUS, NSHMP14_WUS_ASK, NSHMP14_WUS_ASK_EpiDn, NSHMP14_WUS_ASK_EpiUp, NSHMP14_WUS_BSSA, NSHMP14_WUS_BSSA_EpiDn, NSHMP14_WUS_BSSA_EpiUp, NSHMP14_WUS_CB, NSHMP14_WUS_CB_EpiDn, NSHMP14_WUS_CB_EpiUp, NSHMP14_WUS_CY, NSHMP14_WUS_CY_EpiDn, NSHMP14_WUS_CY_EpiUp, NSHMP14_WUS_GK, NSHMP14_WUS_Idriss, NSHMP14_WUS_Idriss_EpiDn, NSHMP14_WUS_Idriss_EpiUp, SadighEtAl_1997_AttenRel, SEA_1999_AttenRel, ShakeMap_2003_AttenRel, SI_AttenRelWrapper, SilvaEtAl_2002_AttenRel, SiteSpecific_2006_AttenRel, SomervilleEtAl_2001_AttenRel, ToroEtAl_1997_AttenRel, TP2005_AttenRel, USGS_Combined_2004_AttenRel, WC94_DisplMagRel, YoungsEtAl_1997_AttenRel, ZhaoEtAl_2006_AttenRel, ZhaoEtAl_2006_AttenRel

public abstract class AttenuationRelationship
extends AbstractIMR
implements ScalarIMR

Title: AttenuationRelationship

Description: This subclass of IntensityMeasureRelationship is the abstract implementation for Attenuation Relationships (also known as Ground Motion Prediction Equations (GMPEs)). In addition to implementing the ScalarIntensityMeasureRelationshipAPI interface (where all IMLs are double values), this also assumes that the probability distribution for the IMLs is Gaussian. The probability calculation is identical for all subclasses, and is therefore handled here in the abstract class (according to the truncation-type and truncation-level parameters defined here), whereas subclasses simply implement the getMean() and getStdDev() methods (as well as others).

Remember, the probability that an intensity-measure type (IMT, defined by a parameter in the subclass) will exceed some IML is computed from parameters defined in the subclass, and these parameters are categorized according to whether they relate to a Site, EqkRupture, Propagation Effect (meaning the value depends on both the given Site and EqkRupture), or to some "Other" category (there is a separate list defined for each of these categories). In addition, each subclass has a list of supported IMTs.

We need to avoid subclasses from defining the same parameter with different names, or defining different parameters with he same name. To this end, we define the following parameters here in this abstract class (all of which are instances of the associated parameter defined in the "param" folder at the same directory level of this class, see that code for exact definitions):

Intensity-Measure parameters (IMTs)

Site-related parameters

EqkRupture-related parameters

Propagation-Effect related parameters

Other parameters

Note that these parameters are only defined here, and need to be instantiated in a given subclass if their use is desired (otherwise they can be ignored). Again, most of the parameters do not really need to be defined here (other than the few that are actually used in methods here), but we define them here anyway to encourage consistent usage. These parameters can also be overridden if different attributes are desired.

Notes for Implementing Subclasses:

The easiest way to learn how to implement an AttenuationRelationship is to look at one that's already been implemented. In fact, you can simply duplicate the one that is closest to what you want to implement, change the name, and modify accordingly (that's what we generally do).

The first step is to identify the intensity-measure types the model is to support, and to initialize these from the constructor using the initPropagationEffectParams() method, which also populates the supportedIMParams list.

When defining a new parameter (either for an IMT or for one of the other parameter types described below), you should always choose from the parameters already defined in the "param" folder (at the same level as this class) if it exists. Otherwise you need to define and create a new one in your subclass. If you think anyone else might want to use your new one (or could accidentally adopt the same name), then we should add it to "params" folder here to avoid effort duplication (or inconsistencies).

The second step is to identify the parameters the model depends upon (categorized by those that depend on the Site, EqkRupture, Propagation Effect, or Other), and to initialize them from the constructor using the following associated methods:

All but the last method is defined as abstract here in order to remind developers to implement these methods (they can have an empty implementation if there are no such parameters in the subclass). The initOtherParams() method is implemented here because the two truncation-related parameters will likely exist in every subclass (although this method must still be called as "super.initOtherParams()" from the subclass in order to include them). Each of the above methods also populates the associated list (siteParams, eqkRuptureParams, propagationEffectParams, or otherParams).

The third step is to populate the following lists (typically done using a initIndependentParamLists() method called from the constructor): meanIndependentParams, stdDevIndependentParams, exceedProbIndependentParams, and imlAtExceedProbIndependentParams. If the Attenuation Relationship is to listen to, and act, on any parameter changes, the following methods need to be implement: initParameterEventListeners(), resetParameterEventListeners() and parameterChange(*).

The fourth step is to implement the setEqkRupture(qkRup) and setSite(site) methods, which simply set the values of the EqkRupture-related and Site-related parameters from the objects passed in. We also need to implement the initPropagationEffectParams() method, which sets those parameters from the current Site and EqkRupture objects (this method is generally called at the end of the setEqkRupture(qkRup) and setSite(site) methods).

The fifth step is to implement the getMean() and getStdDev() methods, which simply calculate those respective values from current parameter settings.

Note that if the value of the distance parameter used by the model exceeds the USER_MAX_DISTANCE field, then the value of VERY_SMALL_MEAN should be returned by the getMean() method (implemented in order to get results consistent with the 2003 NSHMP Fortran code). The final step is to document the attenuation relationship, both in terms of Java docs and the glossary at our web page (http://www.opensha.org/documentation/glossary), for which you can use another model as a guide (e.g., see CB_2008_AttenRel and its glossary entry - http://www.opensha.org/documentation/modelsImplemented/attenRel/CB_2008.html).

We've skipped some details in these instructions, but again, the easiest way to implement a model is look at one that's already been implemented

Please ask questions and feel free to improve these notes if you can.

Version:
1.0
Author:
Edward H. Field
See Also:
Serialized Form

Field Summary
protected  AftershockParam aftershockParam
           
static String C
          Classname constant used for debugging statements
protected  CAV_Param cavParam
           
protected  ComponentParam componentParam
           
protected static boolean D
          Prints out debugging statements if true
protected  DepthTo1pt0kmPerSecParam depthTo1pt0kmPerSecParam
           
protected  DepthTo2pt5kmPerSecParam depthTo2pt5kmPerSecParam
           
protected  DipParam dipParam
           
protected  DistanceJBParameter distanceJBParam
           
protected  DistanceRupParameter distanceRupParam
          Propagation Effect Parameters (see classes for exact definitions)
protected  DistanceSeisParameter distanceSeisParam
           
protected  DistRupMinusDistX_OverRupParam distRupMinusDistX_OverRupParam
           
protected  DistRupMinusJB_OverRupParameter distRupMinusJB_OverRupParam
           
protected  Ds575_Param ds575Param
           
protected  Ds595_Param ds595Param
           
protected static String ERR
          Common error message = "Not all parameters have been set"
protected  ParameterList exceedProbIndependentParams
          List of all Parameters that the exceed.
protected  FaultTypeParam fltTypeParam
           
protected  FocalDepthParam focalDepthParam
           
protected  HangingWallFlagParam hangingWallFlagParam
           
protected  ParameterList imlAtExceedProbIndependentParams
          List of all Parameters that the IML at exceed.
protected  MagParam magParam
          Earthquake Rupture related parameters (see classes for exact definitions)
protected  ParameterList meanIndependentParams
          List of all Parameters that the mean calculation depends upon, except for the intensity-measure related parameters (type/level) and any independentdent parameters they contain.
protected  PGA_Param pgaParam
          Intensity-Measure Parameters (see classes for exact definitions)
protected  PGD_Param pgdParam
           
protected  PGV_Param pgvParam
           
protected  RakeParam rakeParam
           
protected  RupTopDepthParam rupTopDepthParam
           
protected  RupWidthParam rupWidthParam
           
protected  DampingParam saDampingParam
           
protected  SA_Param saParam
           
protected  PeriodParam saPeriodParam
           
protected  SigmaTruncLevelParam sigmaTruncLevelParam
           
protected  SigmaTruncTypeParam sigmaTruncTypeParam
           
protected  ParameterList stdDevIndependentParams
          List of all Parameters that the stdDev calculation depends upon, except for the intensity-measure related parameters (type/level) and any independentdent parameters they contain.
protected  StdDevTypeParam stdDevTypeParam
          Other Parameters (see classes for exact definitions)
protected  TectonicRegionTypeParam tectonicRegionTypeParam
           
protected  double USER_MAX_DISTANCE
          This allows users to set a maximul distance (beyond which the mean will be effectively zero)
protected static double VERY_SMALL_MEAN
           
protected  Vs30_TypeParam vs30_TypeParam
           
protected  Vs30_Param vs30Param
          Site related parameters (see classes for exact definitions)
 
Fields inherited from class org.opensha.sha.imr.AbstractIMR
eqkRupture, eqkRuptureParams, EXCEED_PROB_DEFAULT, EXCEED_PROB_INFO, EXCEED_PROB_MAX, EXCEED_PROB_MIN, EXCEED_PROB_NAME, exceedProbParam, im, intensityMeasureChanged, listener, otherParams, propagationEffectParams, site, siteParams, supportedIMParams, url_info_string, XML_METADATA_IMT_NAME, XML_METADATA_NAME, XML_METADATA_SITE_PARAMETERS_NAME
 
Fields inherited from interface org.opensha.commons.metadata.XMLSaveable
XML_METADATA_NAME
 
Constructor Summary
AttenuationRelationship()
          Constructor for the AttenuationRelationship object - subclasses should execute the various init*() methods (in proper order)
 
Method Summary
 String getAllParamMetadata()
          This returns metadata for all parameters (only showing the independent parameters relevant for the presently chosen imt)
 double getEpsilon()
          This returns (iml-mean)/stdDev, ignoring any truncation.
 double getEpsilon(double iml)
          This returns (iml-mean)/stdDev, ignoring any truncation.
 DiscretizedFunc getExceedProbabilities(DiscretizedFunc intensityMeasureLevels)
          This fills in the exceedance probability for multiple intensityMeasure levels (often called a "hazard curve"); the levels are obtained from the X values of the input function, and Y values are filled in with the asociated exceedance probabilities.
 double getExceedProbability()
          This calculates the probability that the intensity-measure level (the value in the Intensity-Measure Parameter) will be exceeded given the mean and stdDev computed from current independent parameter values.
 double getExceedProbability(double iml)
          This calculates the probability that the supplied intensity-measure level will be exceeded given the mean and stdDev computed from current independent parameter values.
protected  double getExceedProbability(double mean, double stdDev, double iml)
          This method computed the probability of exceeding the IM-level given the mean and stdDev, and considering the sigma truncation type and level.
static double getExceedProbability(double mean, double stdDev, double iml, SigmaTruncTypeParam sigmaTruncTypeParam, SigmaTruncLevelParam sigmaTruncLevelParam)
           
 ParameterList getExceedProbIndependentParams()
          Returns a list of all the Parameters that the exceedProb calculation depends upon (not including the intensity-measure related parameters and their internal, independent parameters).
 ListIterator<Parameter<?>> getExceedProbIndependentParamsIterator()
          Returns an iterator over all the Parameters that the exceedProb calculation depends upon (not including the intensity-measure related parameters and their internal, independent parameters).
 double getIML_AtExceedProb()
          This calculates the intensity-measure level associated with probability held by the exceedProbParam given the mean and standard deviation (according to the chosen truncation type and level).
 double getIML_AtExceedProb(double exceedProb)
          This calculates the intensity-measure level associated with given probability and the calculated mean and standard deviation (and according to the chosen truncation type and level).
 ParameterList getIML_AtExceedProbIndependentParams()
          Returns a list of all the Parameters that the IML-at-exceed- probability calculation depends upon.
 ListIterator<Parameter<?>> getIML_AtExceedProbIndependentParamsIterator()
          Returns an iterator over all the Parameters that the IML-at-exceed- probability calculation depends upon.
 ParameterList getMeanIndependentParams()
          Returns a list of all the Parameters that the Mean calculation depends upon.
 ListIterator<Parameter<?>> getMeanIndependentParamsIterator()
          Returns an iterator over all the Parameters that the Mean calculation depends upon.
 DiscretizedFunc getSA_ExceedProbSpectrum(double iml)
          This calculates the exceed-probability at each SA Period for the supplied intensity-measure level (a hazard spectrum).
 DiscretizedFunc getSA_IML_AtExceedProbSpectrum(double exceedProb)
          This calculates the intensity-measure level for each SA Period associated with the given probability.
 ParameterList getStdDevIndependentParams()
          Returns a list of all the Parameters that the StdDev calculation depends upon (not including the intensity-measure related parameters and their internal, independent parameters).
 ListIterator<Parameter<?>> getStdDevIndependentParamsIterator()
          Returns an iterator over all the Parameters that the StdDev calculation depends upon (not including the intensity-measure related parameters and their internal, independent parameters).
 double getTotExceedProbability(PointEqkSource ptSrc, double iml)
          This method will compute the total probability of exceedance for a PointEqkSource (including the probability of each rupture).
protected abstract  void initEqkRuptureParams()
          Creates the EqkRupture-related parameters, which are all associated parameters that the exceedance probability depends upon.
protected  void initOtherParams()
          This creates the otherParams list.
protected  void initParameterEventListeners()
          Adds the Listeners to the parameters so that Attenuation can listen to any kind of changes to parameter values.
protected abstract  void initPropagationEffectParams()
          Creates Propagation-Effect related parameters, which are all associated parameters that the exceedance probability depends upon.
protected abstract  void initSiteParams()
          This creates Site-related parameters, which are all associated parameters that the exceedance probability depends upon.
protected abstract  void initSupportedIntensityMeasureParams()
          This creates the supported intensity-measure parameters.
 boolean isTectonicRegionSupported(String tectRegionName)
          Tells whether the given tectonic region is supported
 boolean isTectonicRegionSupported(TectonicRegionType tectRegion)
          Tells whether the given tectonic region is supported
 void resetParameterEventListeners()
          Allows to reset the change listeners on the parameters
 void setIntensityMeasureLevel(Double iml)
          Sets the value of the selected intensityMeasure;
 void setIntensityMeasureLevel(Object iml)
          Sets the value of the currently selected intensityMeasure (if the value is allowed); this will reject anything that is not a Double.
protected abstract  void setPropagationEffectParams()
          Calculates the value of each propagation effect parameter from the current Site and ProbEqkRupture objects.
 void setSiteLocation(Location loc)
          This method sets the location in the site.
 void setUserMaxDistance(double maxDist)
          This method sets the user-defined distance beyond which ground motion is set to effectively zero (the mean is a large negative value).
 
Methods inherited from class org.opensha.sha.imr.AbstractIMR
compareTo, fromXMLMetadata, getEqkRupture, getEqkRuptureParams, getEqkRuptureParamsIterator, getInfoURL, getIntensityMeasure, getIntensityMeasureLevel, getName, getOtherParams, getOtherParamsIterator, getParameter, getPropagationEffectParams, getPropagationEffectParamsIterator, getSite, getSiteParams, getSiteParamsIterator, getSupportedIntensityMeasures, getSupportedIntensityMeasuresIterator, isIntensityMeasureSupported, isIntensityMeasureSupported, setAll, setEqkRupture, setExceedProb, setIntensityMeasure, setIntensityMeasure, setSite, setWarningListener, toXMLMetadata
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensha.sha.imr.ScalarIMR
getMean, getStdDev
 
Methods inherited from interface org.opensha.sha.imr.IntensityMeasureRelationship
getEqkRupture, getEqkRuptureParams, getEqkRuptureParamsIterator, getInfoURL, getIntensityMeasure, getIntensityMeasureLevel, getName, getOtherParams, getOtherParamsIterator, getParameter, getPropagationEffectParams, getPropagationEffectParamsIterator, getShortName, getSite, getSiteParams, getSiteParamsIterator, getSupportedIntensityMeasures, getSupportedIntensityMeasuresIterator, isIntensityMeasureSupported, isIntensityMeasureSupported, setAll, setEqkRupture, setExceedProb, setIntensityMeasure, setIntensityMeasure, setParamDefaults, setSite, toXMLMetadata
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

C

public static final String C
Classname constant used for debugging statements

See Also:
Constant Field Values

D

protected static final boolean D
Prints out debugging statements if true

See Also:
Constant Field Values

pgaParam

protected PGA_Param pgaParam
Intensity-Measure Parameters (see classes for exact definitions)


pgvParam

protected PGV_Param pgvParam

pgdParam

protected PGD_Param pgdParam

saParam

protected SA_Param saParam

saPeriodParam

protected PeriodParam saPeriodParam

saDampingParam

protected DampingParam saDampingParam

cavParam

protected CAV_Param cavParam

ds575Param

protected Ds575_Param ds575Param

ds595Param

protected Ds595_Param ds595Param

stdDevTypeParam

protected StdDevTypeParam stdDevTypeParam
Other Parameters (see classes for exact definitions)


sigmaTruncTypeParam

protected SigmaTruncTypeParam sigmaTruncTypeParam

sigmaTruncLevelParam

protected SigmaTruncLevelParam sigmaTruncLevelParam

componentParam

protected ComponentParam componentParam

tectonicRegionTypeParam

protected TectonicRegionTypeParam tectonicRegionTypeParam

magParam

protected MagParam magParam
Earthquake Rupture related parameters (see classes for exact definitions)


fltTypeParam

protected FaultTypeParam fltTypeParam

aftershockParam

protected AftershockParam aftershockParam

rakeParam

protected RakeParam rakeParam

dipParam

protected DipParam dipParam

rupTopDepthParam

protected RupTopDepthParam rupTopDepthParam

rupWidthParam

protected RupWidthParam rupWidthParam

focalDepthParam

protected FocalDepthParam focalDepthParam

distanceRupParam

protected DistanceRupParameter distanceRupParam
Propagation Effect Parameters (see classes for exact definitions)


distanceJBParam

protected DistanceJBParameter distanceJBParam

distanceSeisParam

protected DistanceSeisParameter distanceSeisParam

distRupMinusJB_OverRupParam

protected DistRupMinusJB_OverRupParameter distRupMinusJB_OverRupParam

distRupMinusDistX_OverRupParam

protected DistRupMinusDistX_OverRupParam distRupMinusDistX_OverRupParam

hangingWallFlagParam

protected HangingWallFlagParam hangingWallFlagParam

vs30Param

protected Vs30_Param vs30Param
Site related parameters (see classes for exact definitions)


vs30_TypeParam

protected Vs30_TypeParam vs30_TypeParam

depthTo2pt5kmPerSecParam

protected DepthTo2pt5kmPerSecParam depthTo2pt5kmPerSecParam

depthTo1pt0kmPerSecParam

protected DepthTo1pt0kmPerSecParam depthTo1pt0kmPerSecParam

USER_MAX_DISTANCE

protected double USER_MAX_DISTANCE
This allows users to set a maximul distance (beyond which the mean will be effectively zero)


VERY_SMALL_MEAN

protected static final double VERY_SMALL_MEAN
See Also:
Constant Field Values

ERR

protected static final String ERR
Common error message = "Not all parameters have been set"

See Also:
Constant Field Values

meanIndependentParams

protected ParameterList meanIndependentParams
List of all Parameters that the mean calculation depends upon, except for the intensity-measure related parameters (type/level) and any independentdent parameters they contain.


stdDevIndependentParams

protected ParameterList stdDevIndependentParams
List of all Parameters that the stdDev calculation depends upon, except for the intensity-measure related parameters (type/level) and any independentdent parameters they contain.


exceedProbIndependentParams

protected ParameterList exceedProbIndependentParams
List of all Parameters that the exceed. prob. calculation depends upon, except for the intensity-measure related parameters (type/level) and any independentdent parameters they contain. Note that this and its iterator method could be applied in the parent class.


imlAtExceedProbIndependentParams

protected ParameterList imlAtExceedProbIndependentParams
List of all Parameters that the IML at exceed. prob. calculation depends upon, except for the intensity-measure related parameters (type/level) and any independentdent parameters they contain.

Constructor Detail

AttenuationRelationship

public AttenuationRelationship()
Constructor for the AttenuationRelationship object - subclasses should execute the various init*() methods (in proper order)

Method Detail

setUserMaxDistance

public void setUserMaxDistance(double maxDist)
This method sets the user-defined distance beyond which ground motion is set to effectively zero (the mean is a large negative value).

Specified by:
setUserMaxDistance in interface ScalarIMR
Parameters:
maxDist -

setIntensityMeasureLevel

public void setIntensityMeasureLevel(Object iml)
                              throws ParameterException
Sets the value of the currently selected intensityMeasure (if the value is allowed); this will reject anything that is not a Double.

Specified by:
setIntensityMeasureLevel in interface IntensityMeasureRelationship
Overrides:
setIntensityMeasureLevel in class AbstractIMR
Parameters:
iml - The new intensityMeasureLevel value
Throws:
ParameterException - Description of the Exception

setIntensityMeasureLevel

public void setIntensityMeasureLevel(Double iml)
                              throws ParameterException
Sets the value of the selected intensityMeasure;

Specified by:
setIntensityMeasureLevel in interface ScalarIMR
Parameters:
iml - The new intensityMeasureLevel value
Throws:
ParameterException - Description of the Exception

setSiteLocation

public void setSiteLocation(Location loc)
This method sets the location in the site. This is helpful because it allows to set the location within the site without setting the Site Parameters. Thus allowing the capability of setting the site once and changing the location of the site to do the calculations.

Specified by:
setSiteLocation in interface ScalarIMR

setPropagationEffectParams

protected abstract void setPropagationEffectParams()
Calculates the value of each propagation effect parameter from the current Site and ProbEqkRupture objects.


getExceedProbability

public double getExceedProbability()
                            throws ParameterException,
                                   IMRException
This calculates the probability that the intensity-measure level (the value in the Intensity-Measure Parameter) will be exceeded given the mean and stdDev computed from current independent parameter values. Note that the answer is not stored in the internally held exceedProbParam (this latter param is used only for the getIML_AtExceedProb() method).

Specified by:
getExceedProbability in interface IntensityMeasureRelationship
Returns:
The exceedProbability value
Throws:
ParameterException - Description of the Exception
IMRException - Description of the Exception

getExceedProbability

public double getExceedProbability(double iml)
                            throws ParameterException,
                                   IMRException
This calculates the probability that the supplied intensity-measure level will be exceeded given the mean and stdDev computed from current independent parameter values. Note that the answer is not stored in the internally held exceedProbParam (this latter param is used only for the getIML_AtExceedProb() method).

Specified by:
getExceedProbability in interface ScalarIMR
Returns:
The exceedProbability value
Throws:
ParameterException - Description of the Exception
IMRException - Description of the Exception

getSA_ExceedProbSpectrum

public DiscretizedFunc getSA_ExceedProbSpectrum(double iml)
                                         throws ParameterException,
                                                IMRException
This calculates the exceed-probability at each SA Period for the supplied intensity-measure level (a hazard spectrum). The x values in the returned function correspond to the periods supported by the IMR.

Specified by:
getSA_ExceedProbSpectrum in interface ScalarIMR
Returns:
DiscretizedFuncAPI - The hazard spectrum
Throws:
ParameterException
IMRException

getSA_IML_AtExceedProbSpectrum

public DiscretizedFunc getSA_IML_AtExceedProbSpectrum(double exceedProb)
                                               throws ParameterException,
                                                      IMRException
This calculates the intensity-measure level for each SA Period associated with the given probability. The x values in the returned function correspond to the periods supported by the IMR.

Specified by:
getSA_IML_AtExceedProbSpectrum in interface ScalarIMR
Parameters:
exceedProb -
Returns:
DiscretizedFuncAPI - the IML function
Throws:
ParameterException
IMRException

getEpsilon

public double getEpsilon()
This returns (iml-mean)/stdDev, ignoring any truncation. This gets the iml from the value in the Intensity-Measure Parameter.

Specified by:
getEpsilon in interface ScalarIMR
Returns:
double

getEpsilon

public double getEpsilon(double iml)
This returns (iml-mean)/stdDev, ignoring any truncation.

Specified by:
getEpsilon in interface ScalarIMR
Parameters:
iml - double
Returns:
double

getExceedProbability

protected double getExceedProbability(double mean,
                                      double stdDev,
                                      double iml)
                               throws ParameterException,
                                      IMRException
This method computed the probability of exceeding the IM-level given the mean and stdDev, and considering the sigma truncation type and level.

Parameters:
mean -
stdDev -
iml -
Returns:
Throws:
ParameterException
IMRException

getExceedProbability

public static double getExceedProbability(double mean,
                                          double stdDev,
                                          double iml,
                                          SigmaTruncTypeParam sigmaTruncTypeParam,
                                          SigmaTruncLevelParam sigmaTruncLevelParam)

getExceedProbabilities

public DiscretizedFunc getExceedProbabilities(DiscretizedFunc intensityMeasureLevels)
                                       throws ParameterException
This fills in the exceedance probability for multiple intensityMeasure levels (often called a "hazard curve"); the levels are obtained from the X values of the input function, and Y values are filled in with the asociated exceedance probabilities.

Specified by:
getExceedProbabilities in interface ScalarIMR
Parameters:
intensityMeasureLevels - The function to be filled in
Returns:
The function filled in
Throws:
ParameterException - Description of the Exception

getTotExceedProbability

public double getTotExceedProbability(PointEqkSource ptSrc,
                                      double iml)
This method will compute the total probability of exceedance for a PointEqkSource (including the probability of each rupture). It is assumed that this source is Poissonian (not checked). This saves time by computing distance only once for all ruptures in this source. This could be extended to include the point-source distance correction as well (a boolean in the constructor?), although this would have to check for each distance type.

Parameters:
ptSrc -
iml -
Returns:

getIML_AtExceedProb

public double getIML_AtExceedProb()
                           throws ParameterException
This calculates the intensity-measure level associated with probability held by the exceedProbParam given the mean and standard deviation (according to the chosen truncation type and level). Note that this does not store the answer in the value of the internally held intensity-measure parameter.

Specified by:
getIML_AtExceedProb in interface ScalarIMR
Returns:
The intensity-measure level
Throws:
ParameterException - Description of the Exception

getIML_AtExceedProb

public double getIML_AtExceedProb(double exceedProb)
                           throws ParameterException
This calculates the intensity-measure level associated with given probability and the calculated mean and standard deviation (and according to the chosen truncation type and level). Note that this does not store the answer in the value of the internally held intensity-measure parameter.

Specified by:
getIML_AtExceedProb in interface ScalarIMR
Parameters:
exceedProb - : Sets the Value of the exceed Prob param with this value.
Returns:
The intensity-measure level
Throws:
ParameterException - Description of the Exception

getMeanIndependentParamsIterator

public ListIterator<Parameter<?>> getMeanIndependentParamsIterator()
Returns an iterator over all the Parameters that the Mean calculation depends upon. (not including the intensity-measure related parameters and their internal, independent parameters).

Specified by:
getMeanIndependentParamsIterator in interface ScalarIMR
Returns:
The Independent Params Iterator

getMeanIndependentParams

public ParameterList getMeanIndependentParams()
Description copied from interface: ScalarIMR
Returns a list of all the Parameters that the Mean calculation depends upon. (not including the intensity-measure related parameters and their internal, independent parameters).

Specified by:
getMeanIndependentParams in interface ScalarIMR
Returns:
The Independent Params list

getStdDevIndependentParamsIterator

public ListIterator<Parameter<?>> getStdDevIndependentParamsIterator()
Returns an iterator over all the Parameters that the StdDev calculation depends upon (not including the intensity-measure related parameters and their internal, independent parameters).

Specified by:
getStdDevIndependentParamsIterator in interface ScalarIMR
Returns:
The Independent Parameters Iterator

getStdDevIndependentParams

public ParameterList getStdDevIndependentParams()
Description copied from interface: ScalarIMR
Returns a list of all the Parameters that the StdDev calculation depends upon (not including the intensity-measure related parameters and their internal, independent parameters).

Specified by:
getStdDevIndependentParams in interface ScalarIMR
Returns:
The Independent Parameters list

getExceedProbIndependentParamsIterator

public ListIterator<Parameter<?>> getExceedProbIndependentParamsIterator()
Returns an iterator over all the Parameters that the exceedProb calculation depends upon (not including the intensity-measure related parameters and their internal, independent parameters).

Specified by:
getExceedProbIndependentParamsIterator in interface ScalarIMR
Returns:
The Independent Params Iterator

getExceedProbIndependentParams

public ParameterList getExceedProbIndependentParams()
Description copied from interface: ScalarIMR
Returns a list of all the Parameters that the exceedProb calculation depends upon (not including the intensity-measure related parameters and their internal, independent parameters).

Specified by:
getExceedProbIndependentParams in interface ScalarIMR
Returns:
The Independent Params list

getIML_AtExceedProbIndependentParamsIterator

public ListIterator<Parameter<?>> getIML_AtExceedProbIndependentParamsIterator()
Returns an iterator over all the Parameters that the IML-at-exceed- probability calculation depends upon. (not including the intensity-measure related paramters and their internal, independent parameters).

Specified by:
getIML_AtExceedProbIndependentParamsIterator in interface ScalarIMR
Returns:
The Independent Params Iterator

getIML_AtExceedProbIndependentParams

public ParameterList getIML_AtExceedProbIndependentParams()
Description copied from interface: ScalarIMR
Returns a list of all the Parameters that the IML-at-exceed- probability calculation depends upon. (not including the intensity-measure related paramters and their internal, independent parameters).

Specified by:
getIML_AtExceedProbIndependentParams in interface ScalarIMR
Returns:
The Independent Params list

getAllParamMetadata

public String getAllParamMetadata()
This returns metadata for all parameters (only showing the independent parameters relevant for the presently chosen imt)

Specified by:
getAllParamMetadata in interface ScalarIMR
Returns:

initSupportedIntensityMeasureParams

protected abstract void initSupportedIntensityMeasureParams()
This creates the supported intensity-measure parameters. All implementation is in the subclass (it's defined here as a reminder/suggestions).


initSiteParams

protected abstract void initSiteParams()
This creates Site-related parameters, which are all associated parameters that the exceedance probability depends upon. All implementation is in the subclass (it's defined here as a reminder/suggestions).


initEqkRuptureParams

protected abstract void initEqkRuptureParams()
Creates the EqkRupture-related parameters, which are all associated parameters that the exceedance probability depends upon. All implementation is in the subclass (it's defined here as a reminder/suggestions).


initPropagationEffectParams

protected abstract void initPropagationEffectParams()
Creates Propagation-Effect related parameters, which are all associated parameters that the exceedance probability depends upon. All implementation is in the subclass (it's defined here as a reminder/suggestions).


initOtherParams

protected void initOtherParams()
This creates the otherParams list. These are any parameters that the exceedance probability depends upon that is not a supported IMT (or one of their independent parameters) and is not contained in, or computed from, the site or eqkRutpure objects. Note that this does not include the exceedProbParam (which exceedance probability does not depend on). sigmaTruncTypeParam and sigmaTruncLevelParam are instantiated here and added to the otherParams list (others should be implemented as desired in subclasses). The tectonicRegionTypeParam is also instantiated here with default options (TYPE_ACTIVE_SHALLOW); this should be overridden in subclass if other options are desired (and you'll need use the replaceParameter method to change the one in the otherParams list).


initParameterEventListeners

protected void initParameterEventListeners()
Adds the Listeners to the parameters so that Attenuation can listen to any kind of changes to parameter values.


resetParameterEventListeners

public void resetParameterEventListeners()
Allows to reset the change listeners on the parameters

Specified by:
resetParameterEventListeners in interface ScalarIMR

isTectonicRegionSupported

public boolean isTectonicRegionSupported(String tectRegionName)
Tells whether the given tectonic region is supported

Specified by:
isTectonicRegionSupported in interface ScalarIMR
Parameters:
tectRegionName -
Returns:

isTectonicRegionSupported

public boolean isTectonicRegionSupported(TectonicRegionType tectRegion)
Tells whether the given tectonic region is supported

Specified by:
isTectonicRegionSupported in interface ScalarIMR
Parameters:
tectRegion -
Returns: