org.opensha.sha.calc
Interface HazardCurveCalculatorAPI

All Known Implementing Classes:
HazardCurveCalculator, HazardCurveCalculator

public interface HazardCurveCalculatorAPI

Title: HazardCurveCalculatorAPI

Description: Defines the interface for the HazardCurveCalculator.

Version:
1.0
Author:
: Ned (Edward) Field, Nitin Gupta and Vipin Gupta

Method Summary
 ParameterList getAdjustableParams()
          Get the adjustable parameter list of calculation parameters
 ListIterator<Parameter<?>> getAdjustableParamsIterator()
          Get iterator for the adjustable parameters
 DiscretizedFunc getAnnualizedRates(DiscretizedFunc hazFunction, double years)
          Returns the Annualized Rates for the Hazard Curves
 DiscretizedFunc getAverageEventSetHazardCurve(DiscretizedFunc hazFunction, Site site, ScalarIMR imr, ERF eqkRupForecast)
          This function computes an average hazard curve from a number of stochastic event sets for the given Site, IMR, eqkRupForecast, where the number of event-set realizations is specified as the value in numStochEventSetRealizationsParam.
 int getCurrRuptures()
          gets the current rupture that is being processed
 DiscretizedFunc getEventSetHazardCurve(DiscretizedFunc hazFunction, Site site, ScalarIMR imr, List<EqkRupture> eqkRupList, boolean updateCurrRuptures)
          This function computes a hazard curve for the given Site, IMR, and event set (eqkRupList), where it is assumed that each of the events occur (probability of each is 1.0).
 DiscretizedFunc getHazardCurve(DiscretizedFunc hazFunction, Site site, Map<TectonicRegionType,ScalarIMR> imrMap, ERF eqkRupForecast)
          This function computes a hazard curve for the given Site, imrMap, ERF, and discretized function, where the latter supplies the x-axis values (the IMLs) for the computation, and the result (probability) is placed in the y-axis values of this function.
 DiscretizedFunc getHazardCurve(DiscretizedFunc hazFunction, Site site, ScalarIMR imr, EqkRupture rupture)
          This computes the "deterministic" exceedance curve for the given Site, IMR, and ProbEqkrupture (conditioned on the event actually occurring).
 DiscretizedFunc getHazardCurve(DiscretizedFunc hazFunction, Site site, ScalarIMR imr, ERF eqkRupForecast)
          This function computes a hazard curve for the given Site, IMR, ERF, and discretized function, where the latter supplies the x-axis values (the IMLs) for the computation, and the result (probability) is placed in the y-axis values of this function.
 ArbitrarilyDiscretizedFunc getMagDistCutoffFunc()
          This gets the mag-dist filter function (distance on x-axis and mag on y-axis), returning null if the includeMagDistFilterParam has been set to false.
 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)
 int getTotRuptures()
          gets the total number of ruptures.
 void setAdjustableParams(ParameterList paramList)
          This was created so new instances of this calculator could be given pointers to a set of parameter that already exist.
 void setIncludeMagDistCutoff(boolean include)
          Sets the IncludeMagDistFilterParam parameter, which determines if the magnitude/distance filter is used in calculation.
 void setMagDistCutoffFunc(ArbitrarilyDiscretizedFunc magDistfunc)
          This sets the mag-dist filter function (distance on x-axis and mag on y-axis), and also sets the value of includeMagDistFilterParam as true
 void setMaxSourceDistance(double distance)
          This sets the maximum distance of sources to be considered in the calculation.
 void setNumStochEventSetRealizations(int numRealizations)
          Set the number of stochastic event set realizations for average event set hazard curve calculation.
 void setPtSrcDistCorrType(PtSrcDistCorr.Type ptSrcDistCorrType)
          This sets the type of point-source distance correction that is desired (see the class PtSrcDistCorr for options)
 void stopCalc()
          stops the Hazard Curve calculations.
 

Method Detail

getAdjustableParams

ParameterList getAdjustableParams()
Get the adjustable parameter list of calculation parameters

Returns:
the adjustable ParameterList

getAdjustableParamsIterator

ListIterator<Parameter<?>> getAdjustableParamsIterator()
Get iterator for the adjustable parameters

Returns:
parameter iterator

setPtSrcDistCorrType

void setPtSrcDistCorrType(PtSrcDistCorr.Type ptSrcDistCorrType)
This sets the type of point-source distance correction that is desired (see the class PtSrcDistCorr for options)

Parameters:
ptSrcDistCorrType -

getPtSrcDistCorrType

PtSrcDistCorr.Type getPtSrcDistCorrType()
This gets the type of point-source distance correction that is desired (see the class PtSrcDistCorr for options)

Parameters:
ptSrcDistCorrType -

setMaxSourceDistance

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.

Parameters:
distance: - the maximum distance in km

getMaxSourceDistance

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

Returns:
max source distance

setMagDistCutoffFunc

void setMagDistCutoffFunc(ArbitrarilyDiscretizedFunc magDistfunc)
This sets the mag-dist filter function (distance on x-axis and mag on y-axis), and also sets the value of includeMagDistFilterParam as true

Parameters:
magDistfunc - function to set

setNumStochEventSetRealizations

void setNumStochEventSetRealizations(int numRealizations)
Set the number of stochastic event set realizations for average event set hazard curve calculation. This simply sets the NumStochasticEventSetsParam parameter.

Parameters:
numRealizations - number of stochastic event set realizations

setIncludeMagDistCutoff

void setIncludeMagDistCutoff(boolean include)
Sets the IncludeMagDistFilterParam parameter, which determines if the magnitude/distance filter is used in calculation.

Parameters:
include - if true, the magnitude/distance filter is included

getMagDistCutoffFunc

ArbitrarilyDiscretizedFunc getMagDistCutoffFunc()
This gets the mag-dist filter function (distance on x-axis and mag on y-axis), returning null if the includeMagDistFilterParam has been set to false.

Returns:
mag-dist filter function

setAdjustableParams

void setAdjustableParams(ParameterList paramList)
This was created so new instances of this calculator could be given pointers to a set of parameter that already exist.

Parameters:
paramList - parameters to be set

getAnnualizedRates

DiscretizedFunc getAnnualizedRates(DiscretizedFunc hazFunction,
                                   double years)
Returns the Annualized Rates for the Hazard Curves

Parameters:
hazFunction - Discretized Hazard Function
Returns:
annualized rates for the given hazard function

getHazardCurve

DiscretizedFunc getHazardCurve(DiscretizedFunc hazFunction,
                               Site site,
                               ScalarIMR imr,
                               ERF eqkRupForecast)
This function computes a hazard curve for the given Site, IMR, ERF, and discretized function, where the latter supplies the x-axis values (the IMLs) for the computation, and the result (probability) is placed in the y-axis values of this function. This always applies a source and rupture distance cutoff using the value of the maxDistanceParam parameter (set to a very high value if you don't want this). It also applies a magnitude-dependent distance cutoff on the sources if the value of includeMagDistFilterParam is "true" and using the function in magDistCutoffParam.

Parameters:
hazFunction: - This function is where the hazard curve is placed
site: - site object
imr: - selected IMR object
eqkRupForecast: - selected Earthquake rup forecast
Returns:

getHazardCurve

DiscretizedFunc getHazardCurve(DiscretizedFunc hazFunction,
                               Site site,
                               Map<TectonicRegionType,ScalarIMR> imrMap,
                               ERF eqkRupForecast)
This function computes a hazard curve for the given Site, imrMap, ERF, and discretized function, where the latter supplies the x-axis values (the IMLs) for the computation, and the result (probability) is placed in the y-axis values of this function. This always applies a source and rupture distance cutoff using the value of the maxDistanceParam parameter (set to a very high value if you don't want this). It also applies a magnitude-dependent distance cutoff on the sources if the value of includeMagDistFilterParam is "true" and using the function in magDistCutoffParam. The IMR will be selected on a source by source basis by the imrMap parameter. If the mapping only contains a single IMR, then that IMR will be used for all sources. Otherwise, if a mapping exists for the source's tectonic region type (TRT), then the IMR from that mapping will be used for that source. If no mapping exists, a NullPointerException will be thrown. Once the IMR is selected, it's TRT paramter can be set by the soruce, depending on the SetTRTinIMR_FromSourceParam param and NonSupportedTRT_OptionsParam param. If SetTRTinIMR_FromSourceParam is true, then the IMR's TRT param will be set by the source (otherwise it will be left unchanged). If it is to be set, but the source's TRT is not supported by the IMR, then NonSupportedTRT_OptionsParam is used.

Parameters:
hazFunction: - This function is where the hazard curve is placed
site: - site object
imrMap - this Map specifies which IMR to use with each tectonic region.
eqkRupForecast - selected Earthquake rup forecast
Returns:
hazard curve. Function passed in is updated in place, so this is just a pointer to the hazFunction param.
Throws:
NullPointerException - if there are multiple IMRs in the mapping, but no mapping exists for a soruce in the ERF.

getHazardCurve

DiscretizedFunc getHazardCurve(DiscretizedFunc hazFunction,
                               Site site,
                               ScalarIMR imr,
                               EqkRupture rupture)
This computes the "deterministic" exceedance curve for the given Site, IMR, and ProbEqkrupture (conditioned on the event actually occurring). The hazFunction passed in provides the x-axis values (the IMLs) and the result (probability) is placed in the y-axis values of this function.

Parameters:
hazFunction - This function is where the deterministic hazard curve is placed
site - site object
imr - selected IMR object
rupture - Single Earthquake Rupture
Returns:
hazard curve. Function passed in is updated in place, so this is just a pointer to the hazFunction param.

getCurrRuptures

int getCurrRuptures()
gets the current rupture that is being processed


getTotRuptures

int getTotRuptures()
gets the total number of ruptures.

Returns:
total number of ruptures.

stopCalc

void stopCalc()
stops the Hazard Curve calculations.


getAverageEventSetHazardCurve

DiscretizedFunc getAverageEventSetHazardCurve(DiscretizedFunc hazFunction,
                                              Site site,
                                              ScalarIMR imr,
                                              ERF eqkRupForecast)
This function computes an average hazard curve from a number of stochastic event sets for the given Site, IMR, eqkRupForecast, where the number of event-set realizations is specified as the value in numStochEventSetRealizationsParam. The passed in discretized function supplies the x-axis values (the IMLs) for the computation, and the result (probability) is placed in the y-axis values of this function. This always applies a rupture distance cutoff using the value of the maxDistanceParam parameter (set to a very high value if you don't want this). This does not (yet?) apply the magnitude-dependent distance cutoff represented by includeMagDistFilterParam and magDistCutoffParam.

Parameters:
hazFunction - This function is where the hazard curve is placed
site - site object
imr - selected IMR object
eqkRupForecast - selected Earthquake rup forecast
Returns:
hazard curve. Function passed in is updated in place, so this is just a pointer to the hazFunction param.

getEventSetHazardCurve

DiscretizedFunc getEventSetHazardCurve(DiscretizedFunc hazFunction,
                                       Site site,
                                       ScalarIMR imr,
                                       List<EqkRupture> eqkRupList,
                                       boolean updateCurrRuptures)
This function computes a hazard curve for the given Site, IMR, and event set (eqkRupList), where it is assumed that each of the events occur (probability of each is 1.0). The passed in discretized function supplies the x-axis values (the IMLs) for the computation, and the result (probability) is placed in the y-axis values of this function. This always applies a rupture distance cutoff using the value of the maxDistanceParam parameter (set to a very high value if you don't want this). This does not (yet?) apply the magnitude-dependent distance cutoff represented by includeMagDistFilterParam and magDistCutoffParam.

Parameters:
hazFunction - This function is where the hazard curve is placed
site - site object
imr - selected IMR object
eqkRupForecast - selected Earthquake rup forecast
updateCurrRuptures - tells whether to update current ruptures (for the getCurrRuptures() method used for progress bars)
Returns:
hazard curve. Function passed in is updated in place, so this is just a pointer to the hazFunction param.