org.opensha.sha.calc
Class SpectrumCalculator

java.lang.Object
  extended by org.opensha.sha.calc.SpectrumCalculator
All Implemented Interfaces:
SpectrumCalculatorAPI

public class SpectrumCalculator
extends java.lang.Object
implements SpectrumCalculatorAPI

Title: SpectrumCalculator

Description: This class computes the Spectral Values for given IML or Prob. Value

Version:
1.0
Author:
Nitin Gupta

Field Summary
protected static java.lang.String C
           
protected  int currRuptures
           
protected static boolean D
           
protected  int numSources
           
protected  int sourceIndex
           
protected  int totRuptures
           
 
Constructor Summary
SpectrumCalculator()
          SpectrumCalculator
 
Method Summary
 ParameterList getAdjustableParams()
           
 java.util.ListIterator getAdjustableParamsIterator()
          get the adjustable parameters
 int getCurrRuptures()
           
 DiscretizedFunc getDeterministicSpectrumCurve(Site site, ScalarIMR imr, EqkRupture rupture, boolean probAtIML, double imlProbVal)
          This function computes a deterministic exceedance curve for the given Site, IMR, and ProbEqkrupture.
 DiscretizedFunc getIML_SpectrumCurve(DiscretizedFunc spectrumFunction, Site site, ScalarIMR imr, ERF eqkRupForecast, double probVal, java.util.List supportedSA_Periods)
          This function computes a spectrum curve for all SA Period supported by the IMR and then interpolates the IML value from all the computed curves.
 double getMaxSourceDistance()
          This is a direct way of getting the distance cutoff from that parameter
 PtSrcDistCorr.Type getPtSrcDistCorrType()
          This gets the type of point-source distance correction that is desired (see the class PtSrcDistCorr for options)
 DiscretizedFunc getSpectrumCurve(Site site, ScalarIMR imr, ERF eqkRupForecast, double imlVal, java.util.List supportedSA_Periods)
          This function computes a spectrum curve for the given Site, IMR, and ERF.
 int getTotRuptures()
           
 void setAdjustableParams(ParameterList paramList)
           
 void setMaxSourceDistance(double distance)
          This sets the maximum distance of sources to be considered in the calculation.
 void setPtSrcDistCorrType(PtSrcDistCorr.Type type)
          This sets the type of point-source distance correction that is desired (see the class PtSrcDistCorr for options)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

C

protected static final java.lang.String C
See Also:
Constant Field Values

D

protected static final boolean D
See Also:
Constant Field Values

currRuptures

protected int currRuptures

totRuptures

protected int totRuptures

sourceIndex

protected int sourceIndex

numSources

protected int numSources
Constructor Detail

SpectrumCalculator

public SpectrumCalculator()
SpectrumCalculator

Method Detail

getAdjustableParams

public ParameterList getAdjustableParams()
Specified by:
getAdjustableParams in interface SpectrumCalculatorAPI
Returns:
the adjustable ParameterList

setAdjustableParams

public void setAdjustableParams(ParameterList paramList)
Specified by:
setAdjustableParams in interface SpectrumCalculatorAPI

getMaxSourceDistance

public double getMaxSourceDistance()
This is a direct way of getting the distance cutoff from that parameter

Specified by:
getMaxSourceDistance in interface SpectrumCalculatorAPI

getAdjustableParamsIterator

public java.util.ListIterator getAdjustableParamsIterator()
get the adjustable parameters

Specified by:
getAdjustableParamsIterator in interface SpectrumCalculatorAPI
Returns:

setMaxSourceDistance

public void setMaxSourceDistance(double distance)
This sets the maximum distance of sources to be considered in the calculation. Sources more than this distance away are ignored. This is simply a direct way of setting the parameter. Default value is 250 km.

Specified by:
setMaxSourceDistance in interface SpectrumCalculatorAPI
Parameters:
distance: - the maximum distance in km

getIML_SpectrumCurve

public DiscretizedFunc getIML_SpectrumCurve(DiscretizedFunc spectrumFunction,
                                            Site site,
                                            ScalarIMR imr,
                                            ERF eqkRupForecast,
                                            double probVal,
                                            java.util.List supportedSA_Periods)
This function computes a spectrum curve for all SA Period supported by the IMR and then interpolates the IML value from all the computed curves. The curve in place in the passed in hazFunction (with the X-axis values being the IMLs for which exceedance probabilites are desired).

Specified by:
getIML_SpectrumCurve in interface SpectrumCalculatorAPI
Parameters:
specFunction: - This function is where the final interplotaed spectrum for the IML@prob curve is placed.
site: - site object
imr: - selected IMR object
eqkRupForecast: - selected Earthquake rup forecast
Returns:

getSpectrumCurve

public DiscretizedFunc getSpectrumCurve(Site site,
                                        ScalarIMR imr,
                                        ERF eqkRupForecast,
                                        double imlVal,
                                        java.util.List supportedSA_Periods)
This function computes a spectrum curve for the given Site, IMR, and ERF. The curve in place in the passed in hazFunction (with the X-axis values being the SA Periods for which exceedance probabilites are desired).

Specified by:
getSpectrumCurve in interface SpectrumCalculatorAPI
Parameters:
hazFunction: - This function is where the hazard curve is placed
site: - site object
imr: - selected IMR object
eqkRupForecast: - selected Earthquake rup forecast
Returns:

getCurrRuptures

public int getCurrRuptures()
Specified by:
getCurrRuptures in interface SpectrumCalculatorAPI
Returns:
the current rupture being traversed

getTotRuptures

public int getTotRuptures()
Specified by:
getTotRuptures in interface SpectrumCalculatorAPI
Returns:
the total number of ruptures in the earthquake rupture forecast model

getDeterministicSpectrumCurve

public DiscretizedFunc getDeterministicSpectrumCurve(Site site,
                                                     ScalarIMR imr,
                                                     EqkRupture rupture,
                                                     boolean probAtIML,
                                                     double imlProbVal)
This function computes a deterministic exceedance curve for the given Site, IMR, and ProbEqkrupture. The curve in place in the passed in hazFunction (with the X-axis values being the IMLs for which exceedance probabilites are desired).

Specified by:
getDeterministicSpectrumCurve in interface SpectrumCalculatorAPI
Parameters:
hazFunction: - This function is where the hazard curve is placed
site: - site object
imr: - selected IMR object
rupture: - Single Earthquake Rupture
Returns:

setPtSrcDistCorrType

public void setPtSrcDistCorrType(PtSrcDistCorr.Type type)
Description copied from interface: SpectrumCalculatorAPI
This sets the type of point-source distance correction that is desired (see the class PtSrcDistCorr for options)

Specified by:
setPtSrcDistCorrType in interface SpectrumCalculatorAPI

getPtSrcDistCorrType

public PtSrcDistCorr.Type getPtSrcDistCorrType()
Description copied from interface: SpectrumCalculatorAPI
This gets the type of point-source distance correction that is desired (see the class PtSrcDistCorr for options)

Specified by:
getPtSrcDistCorrType in interface SpectrumCalculatorAPI